Passing in a new dataset to the chart component via props will trigger the chart.js .update() function to animate between the new points. If the chart should be destroyed and redrawn, you can pass in redraw as a prop.
To me .update() on new props seems like the right default behavior. I could however change this PR to make the destroy and redraw the default, then pass in a prop like update if you would rather.
Although there are no tests, I have tested this with all of the chart types.
Passing in a new dataset to the chart component via props will trigger the chart.js
.update()
function to animate between the new points. If the chart should be destroyed and redrawn, you can pass inredraw
as a prop.To me
.update()
on new props seems like the right default behavior. I could however change this PR to make the destroy and redraw the default, then pass in a prop likeupdate
if you would rather.Although there are no tests, I have tested this with all of the chart types.