Chartjs-Adding data to Chart.js line graph from array

0👍

Figure it out myself, this worked:

for (i = 0; i < measureAttr.length; i++) {
        const newDataSet = {
            label: measureAttr[i],
            data: dataGraph[i],
            backgroundColor: "#8e5ea2",
            fill: false
    }
    currentChart.data.datasets.push(newDataSet);
}

currentChart.update();

Leave a comment