Chartjs-The title of my ChartJs on the chart is undefined, but I can't change it because my labels use a function: Object.keys(groupMedia)

1👍

It is undefined because you never set it. You have to configure the label option in the dataset and not labels, the dataset also does not have a labels option if I remember correctly.

new Chart('canvasId', {
  type: 'line'
  data: {
    labels: ['a','b'],
    datasets: [{
      data: [4,7],
      label: 'text that appears in the legend that is undefined right now'
    }]
  },
  options: {}
})

Leave a comment