Charba
Charba copied to clipboard
OOTB crosshair does not show tooltips in all linked charts
(related to #88)
The javascript one shows tooltips in all linked charts
But the OOTB one (created following the guide)only shows the tooltip in the chart under the mouse.
This is the code for creating the OOTB one (it is an empty GWT 2.11 project using charba-gwt 6.5)
public void onModuleLoad() {
RootPanel.get().add(createLineChartWidget());
RootPanel.get().add(createLineChartWidget());
}
private LineChartWidget createLineChartWidget() {
LineChartWidget chart = new LineChartWidget();
chart.getData().setLabels("1","2","3");
LineDataset set1 = chart.newDataset();
set1.setData(1.1,1.2,2.1);
chart.getData().setDatasets(set1);
chart.setHeight("200px");
chart.getPlugins().add(Crosshair.get());
CrosshairOptions options = chart.getOptions().getPlugins().getOptions(Crosshair.ID, Crosshair.FACTORY);
options.setGroup("LinkedGroup");
options.store();
Tooltips tooltips = chart.getOptions().getTooltips();
tooltips.setIntersect(false);
tooltips.setMode(DefaultInteractionMode.X);
return chart;
}