Chartjs-Override the default format for some legend items in ChartJS

0👍

This is because you putted the generateLabels function in the root of the legend options while it needs to be nested within the labels key like so:

options: {
  legend: {
    labels: {
      generateLabels: (chart) => {
        // Implementation
      }
    }
  }
}

Documentation: https://www.chartjs.org/docs/2.9.4/configuration/legend.html#legend-label-configuration

Leave a comment