Recharts: Can it support dynamic data update ?

Created on 12 May 2016  Â·  3Comments  Â·  Source: recharts/recharts

// origin data
const data = [ {name: '1s', value: 5} ]

// update
const data = [ {name: '1s', value: 5}, {name: '2s', value: 7}]

As you know, I am not expecting re-render the whole chart, especially with initial animation.
And I can't find any API about this situation.
Another ugly solution is make animation disable, but I still can't find any api about it.

Most helpful comment

You can set the prop isAnimationActive to be false to disable all animation in the Bar/Line/Area...

Now, the data updating animation is equal to initial animation, later we will support updating animation too.

Now, we use isAnimationActive to control if the animation is valid, later we will add a prop to control data updating animation.

And I'm not clear what do you mean when you say rerender the whole chart.

All 3 comments

You can set the prop isAnimationActive to be false to disable all animation in the Bar/Line/Area...

Now, the data updating animation is equal to initial animation, later we will support updating animation too.

Now, we use isAnimationActive to control if the animation is valid, later we will add a prop to control data updating animation.

And I'm not clear what do you mean when you say rerender the whole chart.

@jasonHzq
yeah, I just mean the pass the new data props to Chart Component, and its reaction(animation) just like render a new Chart.But I know it only re-render the Data Component(Line/Bar/...).
thx a lot ! great work!

Kinda hacky but it seems to work. Thank you @jasonHzq !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patientplatypus picture patientplatypus  Â·  3Comments

manishjohar picture manishjohar  Â·  3Comments

sortsen picture sortsen  Â·  3Comments

Eric24 picture Eric24  Â·  3Comments

alexliu-github picture alexliu-github  Â·  3Comments