You must be logged in to post your query.
Home › Forums › Chart Support › unable to update Pie Chart
Tagged: #CanvasJS #pieChart #react
the Pie chart is not re-rendering, I can see the updated values when I hover on it but the chart is still the same.
it is working with the Class component, but not working on the Functional component
Functional component https://jsfiddle.net/9ojvwfks/1/
Class Component Stackblitz Link
@myselfrohit8080gmail-com,
In order to render the chart with updated options (data), you need to use the render method after updating the chart options. To access ref attributes in react, you need to use chart.current.chart. Please take a look at this react documentation for more information.
Please take a look at this updated StackBlitz example.
—- Adithya Menon Team CanvasJS
You must be logged in to reply to this topic. Login/Register