All Charts Displaying Same Data After State Update #4511
sidmishfpl1801
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using ApexCharts with React in a Next.js project to create multiple area plot sparklines. When the statsData states changes, all charts should update with new data. However, all charts end up displaying the same data as the last chart. I've ensured that my state is updating correctly and that each chart has unique keys.
I suspect the issue is related to how I'm updating the chart options. According to the ApexCharts documentation, I should update the outermost property of the options object.
Here’s a simplified version of my component:
I have confirmed that the statsData is correct, and the issue seems to be with the chart rendering. How can I ensure each chart updates correctly with its respective data?
Charts before state update
charts after states gets updated
Beta Was this translation helpful? Give feedback.
All reactions