0👍
A more straight forward solution (to me at least):
In your draw_chart
method (or whatever you’re calling to draw the chart):
if (typeof chart != 'undefined')
chart.destroy();
Destroy the existing chart if there is one.
From there, just add your data sets, and draw it.
This solution works well in both 1.x and 2.0.
- Chartjs-Unable to display HH:mm:ss data in Chart.js
- Chartjs-Parse 2d int array to List of BubbleDataPoints
Source:stackexchange.com