Skip to content

ChartsOnAxisClickHandler API

API reference docs for the React ChartsOnAxisClickHandler component. Learn about the props, CSS, and other APIs of this exported module.

Demos

Import

import { ChartsOnAxisClickHandler } from '@mui/x-charts/ChartsOnAxisClickHandler';
// or
import { ChartsOnAxisClickHandler } from '@mui/x-charts';

Learn about the difference by reading this guide on minimizing bundle size.

Props

NameTypeDescription
onAxisClickfunc

The function called for onClick events. The second argument contains information about all line/bar elements at the current mouse position.

Signature:function(event: MouseEvent, data: null | AxisData) => void
  • event The mouse event recorded on the <svg/> element.
  • data The data about the clicked axis and items associated with it.
The component cannot hold a ref.