Skip to content

Custom Labels are not given X or Y coords in props #5067

Description

@Mikewa33

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

Bug

What is the current behavior?

<YAxis  padding={{ top: 10, left: 10 }} tick={<CustomYAxisTick />} tickSize={8} width={75} domain={[0, 100]} ticks={[0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100]}>
                  <Label angle={-90} dx={-25} value=Days" content={<YAxisLabel />} fontSize="2rem" fill="#7C7C7C" />
                </YAxis>

The child label is not given the x or y position props

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar (template: https://codesandbox.io/p/sandbox/simple-line-chart-v25dl4).

Using a line chart have a YAxis with a custom label. The label is not given an X or Y in props. This causes an issue with as the label doesn't adjust.

What is the expected behavior?

The custom label would receive X and Y so it can move and scale correctly.

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

"recharts": "^2.12.7". Unsure if it worked

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