Chartjs-Charting with chartjs, can't get it working correctly

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
  }
})

example of whats happening in console:
example of whats happening in console:

Leave a comment