chartjs-plugin-annotation
chartjs-plugin-annotation copied to clipboard
Content Wrapping within a box label
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:

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.