chartjs/chartjs-plugin-datalabels

Not working with chartjs 3.6.2

martinjankov opened this issue · 3 comments

@martinjankov if I'm not wrong, you are using Datalabels version 0.4.0.

For Chartjs 3.x, you need Datalabels 2.0.

Furthermore, please have a look to the plugin registration: https://chartjs-plugin-datalabels.netlify.app/guide/getting-started.html#registration

@martinjankov I have tested with your sample:

  1. change Datalabels, using https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2.0.0/dist/chartjs-plugin-datalabels.min.js
  2. add plugins: [ChartDataLabels], in chart configuration, after type: 'pie'

Result:

image

Hey! Shoutout to this fix! The syntax I'm finding everywhere, including the datalabels home page, Stack Overflow, ChatGpt etc is showing wrong or oudated syntax that is orthogonal to this. (Results in no labels, and no errors to explain why). stockiNail's syntax works.