[charts] onAxisClick
not working when the chart layout is horizontal
#14530
Labels
component: charts
This is the name of the generic UI component, not the React module!
regression
A bug, but worse
Steps to reproduce
Link to live example: https://stackblitz.com/~/github.com/mohamad-selman/mui-charts-issue-demo
Steps:
layout
prop tohorizontal
onAxisClick
callbackFor example:
Current behavior
When clicking on any axis, the second argument of the onAxisClick callback is missing the information about the line/bar elements. The
dataIndex
is always-1
andaxisValue
isundefined
.Expected behavior
The second argument should contain data about the clicked axis and items associated with it. For example:
Context
No response
Your environment
System:
OS: macOS 14.6.1
Binaries:
Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
npm: 10.7.0 - ~/.nvm/versions/node/v20.15.0/bin/npm
pnpm: 9.7.1 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: Not Found
Edge: Not Found
Safari: 17.6
npmPackages:
@emotion/react: ^11.13.0 => 11.13.3
@emotion/styled: ^11.13.0 => 11.13.0
@mui/icons-material: ^5.16.7 => 5.16.7
@mui/lab: 5.0.0-alpha.173 => 5.0.0-alpha.173
@mui/material: ^5.16.7 => 5.16.7
@mui/x-charts: ^7.13.0 => 7.16.0
@mui/x-date-pickers: ^7.13.0 => 7.13.0
@types/react: ^18.3.3 => 18.3.3
react: 18.3.1 => 18.3.1
react-dom: 18.3.1 => 18.3.1
typescript: ^5.5.4 => 5.5.4
Search keywords: onAxisClick
The text was updated successfully, but these errors were encountered: