Skip to content
Advertisement

how to show A2, B2, C2 labels using chartjs 3.2.0?

I am building a graph with chartjs but I required it to show the name of the stack a2, b2, c2.

expected graph

plugin for chartjs 3.2.0 is not working

https://v2_0_0-rc_1–chartjs-plugin-datalabels.netlify.app/guide/getting-started.html

JavaScript

Advertisement

Answer

You can define a formatter that returns the stack name instead of the data value itself. The problem however is that the stack name will appear for each value. Therefore I don’t think, chartjs-plugin-datalabels lets you do exactly what you’re looking for.

JavaScript

Please take a look at your amended code below:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement