react-c3 icon indicating copy to clipboard operation
react-c3 copied to clipboard

Allow data to be updated

Open adamlwgriffiths opened this issue 9 years ago • 1 comments
trafficstars

C3 has the ability to load data using the <chart>.load function. Because the data in react-c3 is in a property, it cannot be modified and the entire component must be re-rendered.

Looking at react-rt-chart, it seems the way to do this is to use state instead of props.

adamlwgriffiths avatar Feb 25 '16 05:02 adamlwgriffiths

Hey @adamlwgriffiths - thanks for the info.

It looks like you are correct, we are using generate on every re-render. I'll check out the c3 docs for load and see how we can do it that way (probably just check if this.chart is not null; if it's not we've already generated it and we should use load. We might even be able to get by without using state.

At least I think that's how it should work. I'll do a little investigation - PR's are also welcome!

CodyReichert avatar Feb 25 '16 17:02 CodyReichert