-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
Would you like to work on a fix?
- Check this if you would like to implement a PR, we are more than happy to help you go through the process.
Current and expected behavior
Current behavior:
When changing the prop type
, the underlying chart does not update until the entire component re-renders.
Expected behavior:
When changing the prop type
, the underlying chart updates (redraws) with the new type.
Reproduction
https://codesandbox.io/s/chart-type-update-issue-iym5e9
chart.js version
v3.8.0
react-chartjs-2 version
v4.2.0
Possible solution
Redraw the chart upon type change, I will be submitting a PR momentarily
[edit] Confirmation of ChartJS not working: https://stackoverflow.com/questions/36949343/chart-js-dynamic-changing-of-chart-type-line-to-bar-as-example