chartjs / chartjs-plugin-annotation

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

Set maximum width to stroke and fill text when invoked to draw labels #859

Closed stockiNail closed 1 year ago

stockiNail commented 1 year ago

This PR is setting the max width when strokeText and fillText methods of are invoked to draw the labels.

This enables a simple appearance animation on the labels based on the width of annotation element.

stockiNail commented 1 year ago

This could be helpful on animation but it could create some limitations when you need to draw the label, ignoring the box size. Better do not implement.