Skip to content

Regression in rendering legends with small fontsizes between highcharts 11.1 and 11.4 #21605

@magnusanderson-wk

Description

@magnusanderson-wk

Expected behaviour

Legend text rendering is centered with the text

Actual behaviour

Legend symbols shift downwards slightly with small symbolHeight

This is a regression introduced when the LegendSymbol.LineItem's verticalCenter started being computed based on symbolHeight instead of legend.fontMetrics.b.

Live demo with steps to reproduce

current: https://jsfiddle.net/magnusandersonwk/b06t2gnL/63/
11.1: https://jsfiddle.net/magnusandersonwk/ae96gcdz/28/

another example:
current: https://jsfiddle.net/magnusandersonwk/b06t2gnL/59/
11.1: https://jsfiddle.net/magnusandersonwk/ae96gcdz/25/

This fiddle contains 11.4 but a fix which makes the rendering correct. There is just one line of code that needs to be updated.
https://jsfiddle.net/magnusandersonwk/b06t2gnL/54/

Product version

Highcharts 11.4
regression from
Highcharts 11.1

Affected browser(s)

Chrome
(probably others)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions