-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hover.animationDuration:0 doesn't disable animation tooltip with datalabels plugins #108
Comments
Thank you for reporting this! I spent hours trying to track this down. |
A possible workaround here is to set |
Looks like this is fixed with the current It appears that chartjs/Chart.js#5331 was the solution. The previous code fallsback to |
Thanks, but I unfortunately require the initial animations but need to alter the ones for hover, only :( So is this not an issue with this plugin, specifically? |
@etimberg I don't think it's fixed in the core repo, though not sure why your fiddle is working. For example, this one doesn't work while loading https://www.chartjs.org/dist/master/Chart.min.js. @rpearce @dutrieux the issue doesn't really come from this plugin but the lack of a method to request a new draw from the Chart.js API. Currently, we call Explicitly calling this method with |
That's really weird! The version I used was built against the latest master locally. We perhaps need the concept of layers that we can animate independently. Then the data labels plugin can redraw its layer as needed |
We may want to create separate animation requests for each (animated) property, instead of a global animation that automatically interpolate all element properties base on a single easing value. And instead of global animation (or hover animation) options, we would define per property animation (or group of properties). So for example, we could animate the background color of a point faster than its border color. Or one point position faster than another (using scriptable options). The animation framework would then be totally independent of the animated target, which is not the case currently. |
Thanks for explaining all of this |
Could we pass |
@nagix good point, I wouldn't have thought that |
It seems to fix the following case: animation.duration: 1000 && hover.animationDuration: 0 but the other way is still broken (no animation at all): animation.duration: 0 && hover.animationDuration: 1000 The only workaround that seems to work is: chart.render({duration: 1, lazy: true}); The Not sure if the |
No animarion with |
It's not the case: https://jsfiddle.net/simonbrunel/yrn8jp2L/ (I removed the datalabels plugin), that's because hover animation duration overrides the global animation duration. It allows to disable initial animations while animating the tooltips and hover interactions. |
Does it make sense to use |
Not exactly true: if tooltip / hover are disable (or if there is no change), but the user have setup label interactions (e.g. change the color when hovering a label), this would trigger an animation for nothing (labels are not animated). I don't think it makes sense for the plugin to use |
Ok, I thought label properties are subject to animation. If the plugin doesn't want an animation, I think By the way, I noticed that hover animation is not working at all, so opened chartjs/Chart.js#6129. |
I need to test
Currently, |
Version 0.6.0 has been released. |
Thanks for pushing this through |
When I use datalabels plugins with options.hover.animationDuration:0 (to disable animation with tooltip), the animation is not disable. If I remove the plugin Datalables (by removing chartjs-plugin-datalabels.js), the animation of tooltip is properly disable.
Test case : https://jsfiddle.net/dutrieux/w2vzeo3b/
Video for demo : https://youtu.be/Pd293lqSpK8
The text was updated successfully, but these errors were encountered: