Chartjs-Chart.js, returning an "date" array to plot the line graph

0πŸ‘

βœ…

It seems every object in res has a list with only a single item.
(res[i]['list'] is an array of length 1)

Try logging this:
(this takes all the values of each item and puts them in a single list)

let allvalues = [];
for (const item of res) {
  for (const measurement of item.list) {
    allvalues.push(measurement)
  }
}

console.log(allvalues);

Leave a comment