Skip to content

yAxis with auto width does not resize correctly when data changes #6424

@daopk

Description

@daopk

What is the current behavior?

When the yAxis has its width set to auto, it does not resize correctly when the data changes.

Screen.Recording.2025-10-08.at.17.23.28.mov

What is the expected behavior?

When the data changes, the width of the yAxis should be recalculated accurately to fit the updated values.

Screen.Recording.2025-10-08.at.17.22.32.mov

Please provide a demo of the problem in a sandbox

https://stackblitz.com/edit/bl71p73s?file=src%2FExample.tsx

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

This issue occurs in Recharts v3.2.1.
In v3.2.0, the yAxis resizes correctly.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions