Chart.js: Animation triggering while hovering the graph

Created on 22 Aug 2016  路  7Comments  路  Source: chartjs/Chart.js

Hi guys!

The issue is referring to that topic: https://github.com/chartjs/Chart.js/issues/3169
where @etimberg explained the possible solution but it didn't work.
So the thing is, while I am hovering the graph, I get onProgress callback executed 22 times (depending on duration of animation I think).
One possibility was that:
options: { hover: { mode: false } }
but unfortunately it doesn't work, I still get that method executed.

Am I doing something wrong?

Thank you!

help wanted bug

Most helpful comment

Note, initial animations still work on a chart with these options.
i got this from the following stackoverflow- other solutions didn't work for me...this does
https://stackoverflow.com/questions/41952055/chart-js-how-to-disable-everything-on-hover
UPDATE: newest Chart.js has re-bundled the way hover is 'listened' for:

var myChart = new Chart(canvas, {
options: {
events: []
}
...
})
making the 'events' option an empty list (instead of ['click', 'hover', etc]) makes the chart 'blind'/static because it will be listening for no events.

All 7 comments

Some news about this? It is an obvious bug :/

@sasos90 I haven't had time to look into this. Feel free to open a PR if you're able to fix it

Aaa ok no problem. I would really love to fix it, but I am afraid that there will be no time for that in that project :/

I was testing with 2.4.0 and this is fixed by the refactoring we did to the event handlers.

Updated fiddle: https://jsfiddle.net/x739euo4/1/ with hover: { mode: false } that doesn't call the animation callback all the time

That sounds awesome! Thanks!

Note, initial animations still work on a chart with these options.
i got this from the following stackoverflow- other solutions didn't work for me...this does
https://stackoverflow.com/questions/41952055/chart-js-how-to-disable-everything-on-hover
UPDATE: newest Chart.js has re-bundled the way hover is 'listened' for:

var myChart = new Chart(canvas, {
options: {
events: []
}
...
})
making the 'events' option an empty list (instead of ['click', 'hover', etc]) makes the chart 'blind'/static because it will be listening for no events.

I was testing with 2.4.0 and this is fixed by the refactoring we did to the event handlers.

Updated fiddle: https://jsfiddle.net/x739euo4/1/ with hover: { mode: false } that doesn't call the animation callback all the time

adding hover: { mode: false } doesn't works it still executes onProgress on hover over graph.

Was this page helpful?
0 / 5 - 0 ratings