Chartjs-Why the labels under chart are not corresponding with labels in legend in Chart.js for bar chart?

1πŸ‘

βœ…

The data.labels defines the ticks for a category axis. Following your configuration, the chart is expecting to have 3 data items for dataset, (first at tick β€˜a’, second at tick β€˜b’, third at tick β€˜c’).
Instead, the dataset.label are used in the legend.

In your config, all datasets have got only 1 value and all values are related to the first data.labels, β€˜a’.

Leave a comment