1👍
✅
Add a function to remove any existing chart from the canvas:
destroyChart() {
if(this.bars) {
this.bars.destroy()
}
}
Call this function right before any calls to new Chart
Also, maybe rename this.bars
to this.currentChart
See https://www.chartjs.org/docs/latest/developers/api.html#destroy
Source:stackexchange.com