Skip to content

PieCharts Labels receive an empty viewBox #6030

@matanmaze

Description

@matanmaze

Do you want to request a feature or report a bug?

A bug

What is the current behavior?

When using a custom ‎Label in ‎PieChart, the ‎viewBox prop passed to the custom label is empty

<PieChart margin={margin}>
            <Pie...>
                <Label
                  content={({viewBox}) => (
                    <CustomLabel viewBox={viewBox} />
                  )}
                  position="center"
                />

            </Pie>
</PieChart>

I wanted to provide a code sandbox, but right now it seems the provided link to fork from crashes code sandbox

Image

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

Version 3.0.2
Worked in 2XX

Metadata

Metadata

Assignees

No one assigned

    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