Chart.js multiple dataset issue: hovering over n-th point "hovers" over every dataset's n-th point

Viewed 1099

Example situation: I have 2 line datasets in one chart.

if I hover over the second dataset's second point, it also detects hover at every other dataset's second point.

enter image description here

1 Answers

You need to set chart­'s hover mode to 'nearest', in your chart options config, like so :

options: {
      hover: {
         mode: 'nearest'
      },
      ...

this will ensure that only the hovered data-point gets active.

Here is the working fiddle.

Related