chartjs / chartjs-plugin-annotation

Annotation plugin for Chart.js
MIT License
603 stars 325 forks source link

Content Wrapping within a box label #876

Open stockiNail opened 1 year ago

stockiNail commented 1 year ago

Discussed in https://github.com/chartjs/chartjs-plugin-annotation/discussions/875

Originally posted by **Camology** April 13, 2023 Tried to search for others with a similar issue but did not find one, apologies if there is one out there already just point me towards it please. Basically the goal here is to have my text wrap when used as a label for a box annotation, currently you can split by using the content array which is fine if you have set boundaries, however I have variable width boxes that will be placed when needed for example: ![image](https://user-images.githubusercontent.com/12652920/231813231-bacc7af3-e902-4e1c-9667-ca5c38982d84.png) When the caution block covers a few spots on the X axis it's fine, but it can theoretically cover just 1 place or all of them, is there a way to adjust the label such that it will wrap text at the edges? I tried using inline SVGs but nothing seemed to function properly.