0👍
In order to use the same canvas you have to clear the reference(s) to it. Charts.js states that you must use .destroy() to clear all references to the canvas.
You read about it here: Charts.js .destroy()
I had the same issue in some dynamic charts that I made so I found it easier to just create a div around the canvas, clear the div using jquery $(“#divID”).empty(), and then append the new canvas.
- Chartjs-How to use chart.js for financial with dynamic CSV data?
- Chartjs-How to get line x value from Label chart js
Source:stackexchange.com