0👍
replace your for loop with this:
data.forEach((dataObject) => {
const data = Object.values(dataObject)
const label = data.shift()
data.map((entry) => (parseFloat(entry.toString().replace(/,/g, '.'))))
datasets.push({
label,
data
})
});
and your new Chart with this:
new Chart(ctx, {
type: 'line',
data: {
labels: xLabels,
datasets
}
})
Source:stackexchange.com