You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Chart does not properly update with animation in master #6104
I have a chart parameterized by a slider, so as the user is moving the slider, I repeatedly call update() on the chart to reflect the new parameter value in real time.
It is working well with version 2.7.3, but when testing with master, the chart does not update until the user stops moving the slider.
I found that this is a regression from #5331 which removes the drop frame mechanism. As the update() method is called nearly each frame, the animation start time is also reset each frame, and consequently the chart is updated each frame with an animation progress of zero.
The same bug appears on tooltip animation with a line chart configured like this:
tooltips: { mode: 'nearest', intersect: false }
As moving the mouse cursor on the chart:
In 2.7.3 the tooltip follows the cursor
In master the tooltip does not move until we stop moving the cursor
changed the title [-]Chart do not properly update with animation in master[/-][+]Chart does not properly update with animation in master[/+]on Mar 2, 2019
@benmccann
I came to the same conclusion as @kurkle - bug is happening cause of currentStep being 0 all the time when animation is canceled quickly. If we keep currentStep in a range [1 ... numSteps] everything's working fine for me.
Activity
[-]Chart do not properly update with animation in master[/-][+]Chart does not properly update with animation in master[/+]simonbrunel commentedon Mar 2, 2019
@emmcbd can you please provide a codepen or jsfiddle that reproduces this issue? you can use https://chartjs.org/dist/master/Chart.min.js which is the latest build from master.
emmcb commentedon Mar 2, 2019
Here a reproduce case with tooltips, which is easier to reproduce:
master: https://codepen.io/anon/pen/pYyWbK
2.7.3: https://codepen.io/anon/pen/OqNOqY
Quickly move your mouse over the chart, you will see that the tooltip does not move (or with very jerky animation) until you stop moving.
If you switch back Chart.js to version 2.7.3, or revert #5331, everything is fine again.
benmccann commentedon Mar 2, 2019
@serhii-yakymuk you may want to be aware of this issue
serhii-yakymuk commentedon Mar 2, 2019
Yes, thanks. I'll try to look into it.
serhii-yakymuk commentedon Mar 2, 2019
@benmccann
I came to the same conclusion as @kurkle - bug is happening cause of currentStep being 0 all the time when animation is canceled quickly. If we keep currentStep in a range [1 ... numSteps] everything's working fine for me.
docs(LineChart): document the known jumpy-update issue and its fix
fix(fit): stop the live-updating prediction/residual charts from jumping