Hi so I'm working on a doughnut chart with chart.js
and I'm calling .destroy
on it as I need to display multiple charts with different datasets. But now my chart keeps flickering and drawing itself repeatedly. I have already declared myChart with let myChart = null;
if (myChart != null) {
myChart.destroy();
}
myChart = new Chart(document.getElementById('defaultCanvas0'), config);
This is how it looks like:
It keeps flickering and I want it to display properly each time I switch between the options in the dropdown at the bottom left (The countries)