Skip to content

Legend is truncated too hard with short series name and current displayed value  #2322

@markov00

Description

@markov00

Describe the issue
The legend gets shortened and truncated when displaying the current series value if the series name is pretty short and there isn't a valid last value in the series.
Screenshot 2024-01-31 at 18 35 06
Screenshot 2024-01-31 at 18 34 59

This happens due to the following causes:

  • the automatically computed legend size depends on both the series name size and the legend extra value
  • if the default legend extra value (the last value in the series) is not available, then the size of the extra value is zero
  • with a short series name and a zero default extra value size, the overall legend size is pretty short too, causing any current hovered value to be displayed on top of the current series name

To Reproduce
Steps to reproduce the behavior:

  1. Go to codesandbox

Expected behaviour
A bit of buffer should always be present

Metadata

Metadata

Assignees

No one assigned

    Labels

    :interactionsInteractions related issue:legendLegend related issue:xyBar/Line/Area chart relatedbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions