2👍
After testing several times, this seems to fix the issue:
document.getElementById("btn1").addEventListener("click",function(){
myPieChart.data.datasets[0].data = data1Arr;
myPieChart.update();
});
document.getElementById("btn2").addEventListener("click",function(){
myPieChart.data.datasets[0].data = data2Arr;
myPieChart.update();
});
- [Chartjs]-Changing cursor to pointer on Chart.js bar chart when hover (mousemove) event is disabled?
Source:stackexchange.com