reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 301 forks source link

all chart types update with new data passed in #8

Closed jefffriesen closed 9 years ago

jefffriesen commented 9 years ago

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.

jhudson8 commented 9 years ago

thanks