DavideViolante / chartjs-plugin-labels

Plugin for Chart.js to display percentage, value or label in Pie or Doughnut.
MIT License
58 stars 18 forks source link

Is it possible to wrap a text? #17

Open sbikosfp opened 1 year ago

sbikosfp commented 1 year ago

I have a label that's kinda long and I want to set a max width for the label so that it can wrap the text. Is that possible? Or maybe with render function to add br tags (I don't know if render function accepts HTML tags)?

DavideViolante commented 1 year ago

Mmh I'm not sure, you should try either \n or <br> inside a custom render function I think.

hcmattd commented 1 year ago

Hi Davide. If using \n to break long labels on a pie chart, how can the line height (i.e. spacing between the lines) be controlled? Also how about the letter spacing? It would be really helpful to know how these can be managed when using this plugin.