Chartjs-I can't see the datalabels on the bars charts.js

0👍

Since version 1.x, Datalabels plugin no longer registers itself automatically. It must be manually registered either globally or locally.

See doc: https://chartjs-plugin-datalabels.netlify.app/guide/getting-started.html#registration

You must register globally:

// Register the plugin to all charts:
Chart.register(ChartDataLabels);

or inline

// OR only to specific charts:
var chart = new Chart(ctx, {
  plugins: [ChartDataLabels],
  options: {
    // ...
  }
})

Furthermore, be aware that the options are case sensitive the the "Color" option doesn’t exist but you should change in "color".

Leave a comment