Skip to content

onMouseMove for PieChart has empty chartX and chartY coordinates #5099

Description

@mixrich

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

It's a bug

What is the current behavior?

When I hover the right-bottom position, the <PieChart onMouseMove={({chartX}) => {}}> gives the undefined value for chartX position

image

When I hover an inner empty space, the chartX is specified when it is expected to be undefined

image

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).

Demo: try to hover different areas of a pie chart to see when the cursor position is undefined
https://codesandbox.io/p/sandbox/simple-line-chart-forked-kg9xnw?file=%2Fsrc%2FApp.tsx%3A14%2C36
or the same on stackblitz
https://stackblitz.com/edit/vitejs-vite-wbdjxe?file=src%2FApp.tsx

What is the expected behavior?

chartX position to always be present when I hover between innerRadius and outerRadius
image

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"

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