-1

How to show tool tip only when we hover over any marker in line chart(any chart) and hide it when no data exist on graph?

1 Answers1

0

For this purpose, you should adjust the hoverMode of the chart. Just the following lines to your chart configuration code:

  // adjust chart interactivity
  var interactivity = chart.interactivity();
  // Set hover mode by X.
  interactivity.hoverMode('single');

For details, check the sample in the comment below.

AnyChart Support
  • 3,770
  • 1
  • 10
  • 16
  • Thanks!! thats works but i also have a crosshair on the chart and want to display the tooltip when crosshair line is hover over the data. – user11533651 May 22 '19 at 13:39
  • In the following sample, the tooltip is displayed when the point marker is hovered by the crosshair vertical and horizontal line - https://playground.anychart.com/Fsys6DbO/1 – AnyChart Support May 23 '19 at 02:32
  • can we get tooltip without hovering on marker manually, i mean when the cursor is not on the marker but the vertical line is on the marker. For example if i have 2 markers drawn at the same time with different values, i should get the tooltip for both at resplective places when the vertical line is hovered over those marker. – user11533651 May 24 '19 at 04:18
  • in this case, you'll need to set 'by-x' for the hoverMode and make the tooltip be union by writing this: tooltip.displayMode("union"); please check the sample: https://playground.anychart.com/M7fGYZhS – AnyChart Support May 24 '19 at 04:39