You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
When exporting a chart, each line of multiline caption text should begin at the same x position.
Lines 2+ are completely left-aligned, ignoring chart spacing and any other factors that determine the position of the first line of caption text.
I believe this is caused by a bug in the TextBuilder.modifyDOM function. This line in particular grabs the x attribute value of the SVG (I think), and then sets the x attribute for all tspans (which replace br tags when generating SVG) to it. This has the result of resetting the text position to x=0, causing lines 2+ to be incorrectly positioned in multiline captions.
I think the solution is to use the x position of the parent text.highcharts-subtitle element.
As you can see, the tspan resets the x position from 10 to 0.
Because Highcharts copies all attributes from the br tag when generating the tspan tag, adding a dx attribute to all br tags that moves the tspan over to align with the first line will fix it. See the following example:
@khlieng Thanks for the incredibly fast response! Yes I indeed was misunderstanding the purpose of the useHTML option and didn't actually need it, so disabling it completely solves the issue for my use-case.