chartjs / chartjs-plugin-datalabels

Chart.js plugin to display labels on data elements
https://chartjs-plugin-datalabels.netlify.app
MIT License
863 stars 459 forks source link

Problem display datalables using Chart.js 4.4.0 #402

Open 2uk3y opened 7 months ago

2uk3y commented 7 months ago

I have problem to display datalables on top of each bar. using Chart.js 4.4.0 and chartjs-plugin-datalabels 2.2.0.

here is the code that i try that not working.

https://codepen.io/2uk3y/pen/rNPyPgW

any mistake?

peteruithoven commented 7 months ago

Discussions > Q&A might be a better place for this one?

stockiNail commented 6 months ago

@2uk3y maybe I'm wrong but you haven't registered the plugin.

Chart.register(ChartDataLabels);

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

Adding it, your codepen sounds working.

Created a copy of yours here: https://codepen.io/stockinail/pen/oNmJeyp