highcharts / highcharts

Highcharts JS, the JavaScript charting framework
https://www.highcharts.com
Other
12.05k stars 3.63k forks source link

Stack labels with text-align has poor anchor point, which with rotation causes difference in position of text compared to regular data labels #21985

Open magnusanderson-wk opened 1 month ago

magnusanderson-wk commented 1 month ago

Expected behaviour

Total labels function similar to regular labels: https://jsfiddle.net/magnusandersonwk/Lz34oy52/

Actual behaviour

Total labels with rotation are shifted drastically upwards: https://jsfiddle.net/magnusandersonwk/2ke4uv0c/

This seems to be due to the textAlign shifting the text further than the edge of the text.

Live demo with steps to reproduce

See above

Product version

highcharts 11.4.8

Affected browser(s)

chrome

hubertkozik commented 1 month ago

Hi @magnusanderson-wk! Thank you for reporting the bug. Indeed, the rotation of stack labels is buggy.