kurkle / chartjs-chart-treemap

Chart.js module for creating treemap charts
MIT License
139 stars 34 forks source link

tooltip not showing linebreak on \r\n #227

Closed Offbeatmammal closed 9 months ago

Offbeatmammal commented 9 months ago

in most of the chartjs chart types, I can use \r\n in the tooltip text to throw a line break. it appears not to be working as expected in treemap. I have also tried &#13; and <br> - they just display as text.

is there a trick to it?

Offbeatmammal commented 9 months ago

there is a trick to it!

rather than return the tootlip label as a text string, split it into an array, each element then becomes a line.