Chartjs-Angularjs chartjs legend undefined

0👍

In charts the data-set must be an array of data, where the data in-turn is itself an array
i.e)data-set: [data_1, data_2, data_3], where data_1=[1,2,3,4,5]; data_2=[45,32,12,25,12];..

And the series represents the corresponds the data.

But here in your case the data-set is an array of numbers, which is why the legend becomes undefined.

$scope.chartData = {
 data: [[20, 20, 20, 20, 20, 20, 20]],
 labels: [
  "Joe",
  "Jason",
  "Mark",
  "Mike",
  "Ryan",
  "Sean",
  "Stephanie"
 ],
 series: ['Year 2016' ]
};

Leave a comment