Chartjs-Unable to separate elements of JSON

1👍

Playing around I used the following process. I remembered rawData[0] would give me the first item. SO I tried rawData[0].DPName and it successfully gave me the first name. So I guess I’ll just use the following code to extract the elements.

rawData.forEach(dp =>{
     xLabels.push(dp.DPName);
     yData.push(dp.DPValue);
}

Would love to know if there’s a more direct way though.

Leave a comment