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.

Component 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

onAxisClick

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

Type:func

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.