Not working with chartjs 3.6.2
martinjankov opened this issue · 3 comments
martinjankov commented
stockiNail commented
@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
stockiNail commented
@martinjankov I have tested with your sample:
- change Datalabels, using https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2.0.0/dist/chartjs-plugin-datalabels.min.js
- add
plugins: [ChartDataLabels],
in chart configuration, aftertype: 'pie'
Result:
David-OConnor commented
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.