Chartjs-How can i show labels and value in both on bar chart

0👍

For the text label issue, you’ll need to change your custom formatter to return the dataset label instead:

formatter: function(value, context) {
  return context.chart.data.datasets[context.dataIndex].label;
}

The datalabels plugin does not support multiple labels per bar to the best of my knowledge. You’ll need to manually draw one of the labels yourself following something like this SO answer: How to show data values or index labels in ChartJs (Latest Version).

Leave a comment