chartjs / chartjs-plugin-annotation

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

textAlign property not working as I expect #768

Closed elitastic closed 2 years ago

elitastic commented 2 years ago

textAlign: 'start' is probably broken. Shouldn't this label annotation be left aligned on the zero x axis? Many thanks in advance for a short feedback.

image

https://codepen.io/elitastic/pen/JjLGmeY

stockiNail commented 2 years ago

@elitastic textAlign is used only when the content is an array (multiline text) to define the alignment of all rows.

What you need here is the position option. Try position: 'start', it should work.

stockiNail commented 2 years ago

@elitastic I forgot... have a look to the doc: https://www.chartjs.org/chartjs-plugin-annotation/latest/guide/types/label.html#position

elitastic commented 2 years ago

Thank you very much for your great support.