1👍
Solved myself by creating charts directly into charts array.
var ctx4: any = document.getElementById(`chart` + i);
this.charts.push(new Chart(ctx4, bar));
and destroyed the charts by iterating on charts array.
if (this.charts) {
this.charts.forEach(p => {
p.destroy();
});
}
- [Chartjs]-How can I hide dataset labels in Chart.js v2?
- [Chartjs]-How to use radial CanvasGradients with Chart.js's doughnut chart?
Source:stackexchange.com