chartjs / chartjs-plugin-annotation

Annotation plugin for Chart.js
MIT License
607 stars 328 forks source link

Label annotation is not animated #539

Closed stockiNail closed 2 years ago

stockiNail commented 2 years ago

The label annotation is not animated even if the element is configured to be.

This should be due to that the labelRect property of the element, which is containing the label text position, is calculated during the element initialization.

https://github.com/chartjs/chartjs-plugin-annotation/blob/ef7bf770652f21fd151ea3043156b4dbadd59064/src/types/label.js#L57-L62

Probably the labelRect should be re-calculated during the draw phase.

EDIT: To be more precise, the content of the label is not animated