TailAdmin / free-nextjs-admin-dashboard

TailAdmin is a Next.js and Tailwind CSS free, open-source admin dashboard template. Provides developers with the necessary tools, components, pages to build a full-featured back-end, dashboard, or admin panel for any web project.
https://nextjs-demo.tailadmin.com
MIT License
653 stars 238 forks source link

Fix Apexcharts TypeError issues #8

Closed DanielShterenberg closed 5 months ago

DanielShterenberg commented 6 months ago

Fix "TypeError: Cannot read property 'ToString' of undefined when bar chart is rendering with data".

I used this issue in the ApexCharts repo in order to solve it.

I struggled with this issue for the past few days since I purchased the NextJS flavor of TaliAdmin so I thought it would be helpful to others as well.

ssxdev commented 5 months ago

I have a doubt, about why we are using "series={state.series}" state for series, let's say the data changes so will the graph also re-render? Even if the graph doesn't re-render can we use useEffect?

Why was an additional state involved and the setState (handleReset) which constantly re-render the entire page even if the data is not changed?