Charba icon indicating copy to clipboard operation
Charba copied to clipboard

OOTB crosshair does not show tooltips in all linked charts

Open divq opened this issue 9 months ago • 4 comments

(related to #88)

The javascript one shows tooltips in all linked charts 截屏2024-05-14 16 07 22

But the OOTB one (created following the guide)only shows the tooltip in the chart under the mouse. 截屏2024-05-14 16 21 05

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;
}

divq avatar May 14 '24 08:05 divq