chartjs / chartjs/chartjs-plugin-zoom
Zooming/panning during an animation shows values in the wrong location.
- Dominant language
- JavaScript
- Stars
- 623
- Forks
- 331
- Avg merge
- 7h 5m
- Merged PRs (30d)
- 7
Description
## Reproduction
See this Codepen for a chart that demonstrates this behaviour: https://codepen.io/MrJohz/pen/ZEreGOm
1. Create a chart that allows zooming and panning, and has at least one data point
2. Animate said data point, e.g. by changing its value and calling `.update`
3. Zoom or pan the graph during the animation
## Expected Result:
* When the animation finishes, it should be in the right place
* (Ideally) when the zoom changes during an animation, the animation should also "zoom" with the rest of the graph.
## Actual Result:
* When the animation finishes, and the zoom happened during the animation, then the point will remain in the place that it finished until either the point changes, or until another zoom operation happens, or until the graph "realises" something's wrong and fixes the point.
## Notes
I can consistently get this to reproduce using the repro codepen. By default, it'll update the point every 1.5s, so just panning around during an animation should get the problem to trigger. You can also turn off the auto-updates, and then manually trigger one by pressing the "Do Update" button. If you set the animation speed to 10s and manually trigger the updates, you've got time to really play around with the graph.
I also included the "animation off" button to demonstrate that the problem doesn't occur when animations aren't present.
Contributor guide
Assessment
This issue has not been assessed yet.