Closed ranger-ross closed 2 years ago
As a work around, I have discovered that you can use the built in React key
attribute to force the Chart element to be reloaded any time elements change.
const key = seriesToShow.reduce((a,c) => a + c, '');
<Chart key={key} data={chartData}>...</Chart>
This is a fine work around but comes with some drawbacks such as animations being reset everytime there is a change to the key
Is there an existing issue for this?
I'm using ...
React Chart
Current Behaviour
When creating a
<Chart/>
in React chart, I have noticed that if I try to dynamically change which series are displayed, the chart will disappear and a large error trace will appear in the console.It appears to only occur after the chart is created.
See full example in the steps to reproduce
Expected Behaviour
I believe the correct behavior for this operation is to have the chart render the new series without error.
Steps to Reproduce
Environment