How to display the data label together with the value #318
-
|
I'd like to know if it's possible to access the data label to compose a custom label with the datalabels plugin. How would I proceed to have the displayed labels be: "One: 11.11%", "Two: 22.22%" and "Three: 33.33%" ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
You would use the options: {
plugins: {
datalabels: {
formatter: (v, ctx) => `${numberInLetters(ctx.dataIndex)} ${v}%`
}
}
} |
Beta Was this translation helpful? Give feedback.
-
|
Sorry, I think my example misdirected your help. But I was able to solve based on your lead: |
Beta Was this translation helpful? Give feedback.
You would use the
formatteroption, something like: