Skip to content

Barchart LabelList creates unnecessary line breaks #6072

@eino

Description

@eino

What is the current behavior?

Hi,

When using LabelList on a vertical BarChart, the first label is well displayed, but for some reason the next ones are unnecessarily cut into multiple lines

See for instance:
Image

What is the expected behavior?

As the two lower labels could comfortably fit on their line, they could be displayed on a single line.

Please provide a demo of the problem in a sandbox

Here's a codesandbox example.
https://codesandbox.io/p/sandbox/recharts-bar-chart-forked-7cf59r?file=%2Fsrc%2FComponents%2FBarChartWithLabels.jsx%3A30%2C10-30%2C18

Did I miss something, or is there a way to push the labels to stay more on a single line?

Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?

3.0.2, same behavior with the 2.x versions as well

Thanks in advance!

Metadata

Metadata

Assignees

Labels

enhancementEnhancement to a current API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions