[Chartjs]-OnHover event is not triggering in chart.js

7👍

From v2.5 onwards parameters of onHover callback has been changed. See PR#3669

onHover callback now has 3 parameters. The 2nd parameter is the event
that triggered the hover. This was done for consistency with the
onClick callback.

function(event, activeElements) {

}

Previously, activeEvents was the first argument, and event was not passed.

You can check release notes of v2.5

So you’ve to change your onHover callback as follows:

  onHover: function(event,elements) {
    $("#canvas1").css("cursor", elements[0] ? "pointer" : "default");
  }

updated jsFiddle

Leave a comment