reactjs / react-chartjs

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

Copy across the specified properties of each dataset when updating the chart #98

Closed tomduncalf closed 8 years ago

tomduncalf commented 8 years ago

I noticed that no properties of the datasets are copied across when updating the chart from a props change - in my case, trying to show or hide a series with a checkbox.

I'm open for discussion on the best way to do this - for now I've just created a whilelist of properties to copy across (with just my use case in it :)) but maybe there is a better way... could the entire datasets property just be copied across? I wasn't sure what the reasoning behind iterating over it and copying across one by one is.

tomduncalf commented 8 years ago

@austinpray any thoughts on this?

tomduncalf commented 8 years ago

Just seen https://github.com/jhudson8/react-chartjs/pull/109 which looks like a better implementation of this, closing