score:8 is an array of datasets, not a single dataset. datasets does not have its own data and label attributes. rather, each individual dataset in the array has its own data and label attributes. you therefore cannot do or dataset.label.

if you want to update the data or label variable of a specific dataset, you need to select that object from the array. to select the first dataset, simply use datasets[0]:[0].data = [amazon, google, facebook, twitter];[0].label = label;

if you want to update all datasets, use a foreach loop to iterate through the array: => { = [amazon, google, facebook, twitter];
    dataset.label = label;

two more points:

one other possible problem is that the names variable is not initialized anywhere, though it could be that you just didn't include that part of the code in your question.

also, why do you have the following three lines of code, if you just reassign all the values in the next three lines of code? = []; = []; = null;

Related Query

More Query from same tag