Chartjs-How to add datalabels in stacked bar/line chart in chartJS

1👍

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

You should add the datalabels plugin instance to the chart config:

  const config = {
    type: 'line',
    data: data,
    plugins: [ChartDataLabels], // <- MUST BE ADDED
    options: {
    ....

Leave a comment