score:0

Accepted answer

when you push outside of the loop you are actually pushing verserier into position [n], which in this case is 0.

if you do not add values again you can do

chart.data.labels = verserier

score:0

i don't have the explanation of the "why", but here's a workaround :

var data_array = new array();

// this doesn't work (but with no error on my side, appart from visually wrong labels)
mychart.data.labels.push(data_array);

// but this works
for(i=0;i<data_array.length;i++)
{
    mychart.data.labels.push(data_array[i]);
}

More Query from same tag