Legend sizing fails on long legend labels #2196
Labels
bug
Something isn't working
kibana cross issue
Has a Kibana issue counterpart
:legend
Legend related issue
:Lens
Kibana Lens related issue
Describe the issue
Creating a chart with a legend that contains one or more labels that are very long, the
Settings.legendSize
prop is not handled as expected. The size is limited by 30% of the max label width.To Reproduce
Steps to reproduce the behavior:
Settings.legendSize
prop and notice with the very long label the size is ignored.Expected behaviour
Legend size is limited to the provided
size
Screenshots
Screen.Recording.2023-10-12.at.11.39.46.AM.mp4
Additional Context
elastic-charts/packages/charts/src/state/selectors/get_legend_size.ts
Lines 69 to 85 in 7e319d5
The main issue of the logic is at
line 76
in which we clamp the width based on size of the labels. I think we are missing a check on when to use the constraints as an upper or lower bound, need to dig a little deeper.The text was updated successfully, but these errors were encountered: