ChartsAxisHighlightValue API
API reference docs for the React ChartsAxisHighlightValue component. Learn about the props, CSS, and other APIs of this exported module.
Demos
Import
import { ChartsAxisHighlightValue } from '@mui/x-charts/ChartsAxisHighlightValue';
// or
import { ChartsAxisHighlightValue } from '@mui/x-charts';
// or
import { ChartsAxisHighlightValue } from '@mui/x-charts-pro';
// or
import { ChartsAxisHighlightValue } from '@mui/x-charts-premium';Learn about the difference by reading this guide on minimizing bundle size.
A component that displays the axis value at the edge of the drawing area, aligned with the current axis highlight position.
Renders as a portal into the ChartsLayerContainer, appearing as the last child.
| Name | Type | Default | Description |
|---|---|---|---|
| axisDirection* | 'x' | 'y' | - | The axis direction. |
| axisId | number | string | - | The id of the axis. If not provided, defaults to the first axis. |
| labelPosition | 'both' | 'end' | 'none' | 'start' | 'end' | The position of the label relative to the drawing area. - |
| value | Date | number | string | - | The value to display. If not defined, tracks the axis highlight value from user interaction. |
| valueFormatter | func | - | A function to format the displayed value. If not provided, uses the axis Signature: function(value: number | Date | string) => string
|
Source code
If you did not find the information in this page, consider having a look at the implementation of the component for more detail.