Skip to content

ResponsiveContainer - legend overlapping with chart when re-rendering #2704

Description

@middiu
  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Open the codesanbox attached.

The problem seems to be when the component status changes and the chart needs to refresh.
If the re-render is disabled than the legend is positioned correctly.

  useEffect(() => {
    setTest("");
  }, []);

What is expected?

Legend position should be correct

What is actually happening?

Legend overlapping with chart when re-rendering

Environment Info
Recharts v2.1.6
React reactjs 17
System all
Browser all

seems to be similar to issue #2636

But I'm using rechart 2.1.6 and the issue is still there

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugGeneral bug label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions