Skip to content

Bad legend sizing when using 2 identical labels #1584

@nickofthyme

Description

@nickofthyme

Describe the issue

Using a legend with 2 or more identical labels causes the sizing logic to fail and render a very narrow legend.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/confident-http-qv2ks?file=/src/App.tsx
  2. Notice the legend label is about 1 px width
  3. Toggle off the legendMaxDepth option and the width with return to the correct value.

Expected behaviour
Legend sizes correctly

Screenshots

Peek 2022-02-08 15-43

Kibana Cross Issues

elastic/kibana#125129

Checklist

  • The proper chart type label has been added (e.g. :xy, :partition)
  • The proper feature labels have been added (e.g. :interactions, :axis)
  • Every related Kibana issue is listed under Kibana Cross Issues list and the kibana cross issue tag is applied

Metadata

Metadata

Assignees

Labels

:legendLegend related issue:partitionPartition/PieChart/Donut/Sunburst/Treemap chart relatedbugSomething isn't workingkibana cross issueHas a Kibana issue counterpart

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions