0👍
I have checked your code, your problem is about adding data,so I fixed it, please in adding function in your loop I mean that.
for (var index = 0; index < barChartData.datasets.length; ++index) {
barChartData.datasets[0].data[10] = 500;
barChartData.datasets[1].data[10] = 200;
}
replace those
barChartData.datasets[0].data[10] = 500;
barChartData.datasets[1].data[10] = 200;
with this
barChartData.datasets[index].data.push( Math.floor((Math.random() * 10) + 1) );
Source:stackexchange.com