0👍
Instead of calling only new Chart, put it in a variable:
var chart = new Chart();
and then you can access all the datasets in the chart variable like this: chart.data.datasets
. This will give an array containing all datasets you have in your chart which you can loop over
Source:stackexchange.com