Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlotLine labels do not appear when using align right with textAlign left #17888

Closed
Techn1x opened this issue Oct 26, 2022 · 4 comments · Fixed by #18229
Closed

PlotLine labels do not appear when using align right with textAlign left #17888

Techn1x opened this issue Oct 26, 2022 · 4 comments · Fixed by #18229

Comments

@Techn1x
Copy link

Techn1x commented Oct 26, 2022

Expected behaviour

PlotLine label text is in DOM
PlotLine label appears to the right of the chart

Actual behaviour

PlotLine label text is not in DOM
PlotLine label is not appearing anywhere

Live demo with steps to reproduce

  • Add a y-axis plotline label, with align: 'right' and textAlign: 'left'
  • plotline label does not appear
  • will appear if you set useHTML: true, or use a different the textAlign value

Demo with a working plotline label, and a missing plotline label
https://jsfiddle.net/br8ag2np/

Product version

Highcharts 10.2.1

Affected browser(s)

@karolkolodziej
Copy link
Contributor

Hi @Techn1x and thank you for reporting that!

Internal note:
This issue was introduced in the 9.2.0 by this PR: #15837

Workaround:
I prepared a small workaround that calculates the min width of the label- demo.

@Techn1x
Copy link
Author

Techn1x commented Oct 27, 2022

Thanks for the workaround! The other workaround is useHTML: true but only if the text being used is known safe, which may not be the case for everybody

@karolkolodziej
Copy link
Contributor

A better workaround that calculates the exact width of the label- demo.

@Techn1x
Copy link
Author

Techn1x commented Jan 23, 2023

Thanks! For anyone ending up on this thread, the fix was included in Highcharts 10.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants