Closed d0ublezer0 closed 1 year ago
This is because xAdjust
is resolved in measureRect
, which is done when resolving the element properties (including width).
Maybe textAlign
or position
options might get the result you are looking for?
https://www.chartjs.org/chartjs-plugin-annotation/latest/guide/types/label.html#configuration
If I interpret your code correctly, you want to move the label on the left for the half of its width.
As @kurkle said, it's possible using:
position: {
x: 'end'
},
My goal is place label at end of chart line: right side of text to the line end. Width of label is dynamic, so i tried to calculate width of label and adjust its position.
@stockiNail position:end save me, thank you!
I want adjust label position according to his width with this code:
But element.width sometime is undefined. How to resolve this?