ChartsReferenceLine API
API reference docs for the React ChartsReferenceLine component. Learn about the props, CSS, and other APIs of this exported module.
Component demos
Import
import { ChartsReferenceLine } from '@mui/x-charts/ChartsReferenceLine';
// or
import { ChartsReferenceLine } from '@mui/x-charts';
The id of the axis used for the reference value.
Type:number
| string
Default:The `id` of the first defined axis.
Override or extend the styles applied to the component.
See CSS API below for more details.
Type:object
The alignment if the label is in the chart drawing area.
Type:'end'
| 'middle'
| 'start'
Default:'middle'
Additional space arround the label in px. Can be a number or an object { x, y }
to distinguish space with the reference line and space with axes.
Type:number
| { x?: number, y?: number }
Default:5
The x value associated with the reference line. If defined the reference line will be vertical.
Type:Date
| number
| string
These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.
Styles applied to the root element if the reference line is horizontal.
Rule name:horizontal
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.