ChartsAxis API
API reference docs for the React ChartsAxis component. Learn about the props, CSS, and other APIs of this exported module.
Demos
Import
import { ChartsAxis } from '@mui/x-charts/ChartsAxis';
// or
import { ChartsAxis } from '@mui/x-charts';
Learn about the difference by reading this guide on minimizing bundle size.
Name | Type | Default | Description |
---|---|---|---|
bottomAxis | { axisId?: number | string, classes?: object, disableLine?: bool, disableTicks?: bool, fill?: string, label?: string, labelFontSize?: number, labelStyle?: object, position?: 'bottom' | 'top', slotProps?: object, slots?: object, stroke?: string, tickFontSize?: number, tickInterval?: 'auto' | array | func, tickLabelInterval?: 'auto' | func, tickLabelPlacement?: 'middle' | 'tick', tickLabelStyle?: object, tickMaxStep?: number, tickMinStep?: number, tickNumber?: number, tickPlacement?: 'end' | 'extremities' | 'middle' | 'start', tickSize?: number } | string | xAxisIds[0] The id of the first provided axis | Indicate which axis to display the bottom of the charts. Can be a string (the id of the axis) or an object |
leftAxis | { axisId?: number | string, classes?: object, disableLine?: bool, disableTicks?: bool, fill?: string, label?: string, labelFontSize?: number, labelStyle?: object, position?: 'left' | 'right', slotProps?: object, slots?: object, stroke?: string, tickFontSize?: number, tickInterval?: 'auto' | array | func, tickLabelInterval?: 'auto' | func, tickLabelPlacement?: 'middle' | 'tick', tickLabelStyle?: object, tickMaxStep?: number, tickMinStep?: number, tickNumber?: number, tickPlacement?: 'end' | 'extremities' | 'middle' | 'start', tickSize?: number } | string | yAxisIds[0] The id of the first provided axis | Indicate which axis to display the left of the charts. Can be a string (the id of the axis) or an object |
rightAxis | { axisId?: number | string, classes?: object, disableLine?: bool, disableTicks?: bool, fill?: string, label?: string, labelFontSize?: number, labelStyle?: object, position?: 'left' | 'right', slotProps?: object, slots?: object, stroke?: string, tickFontSize?: number, tickInterval?: 'auto' | array | func, tickLabelInterval?: 'auto' | func, tickLabelPlacement?: 'middle' | 'tick', tickLabelStyle?: object, tickMaxStep?: number, tickMinStep?: number, tickNumber?: number, tickPlacement?: 'end' | 'extremities' | 'middle' | 'start', tickSize?: number } | string | null | Indicate which axis to display the right of the charts. Can be a string (the id of the axis) or an object |
slotProps | object | {} | The props used for each component slot. |
slots | object | {} | Overridable component slots. See Slots API below for more details. |
topAxis | { axisId?: number | string, classes?: object, disableLine?: bool, disableTicks?: bool, fill?: string, label?: string, labelFontSize?: number, labelStyle?: object, position?: 'bottom' | 'top', slotProps?: object, slots?: object, stroke?: string, tickFontSize?: number, tickInterval?: 'auto' | array | func, tickLabelInterval?: 'auto' | func, tickLabelPlacement?: 'middle' | 'tick', tickLabelStyle?: object, tickMaxStep?: number, tickMinStep?: number, tickNumber?: number, tickPlacement?: 'end' | 'extremities' | 'middle' | 'start', tickSize?: number } | string | null | Indicate which axis to display the top of the charts. Can be a string (the id of the axis) or an object |
These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.
Class name | Rule name | Description |
---|---|---|
.MuiChartsAxis-bottom | bottom | Styles applied to the bottom axis. |
.MuiChartsAxis-directionX | directionX | Styles applied to x-axes. |
.MuiChartsAxis-directionY | directionY | Styles applied to y-axes. |
.MuiChartsAxis-label | label | Styles applied to the group containing the axis label. |
.MuiChartsAxis-left | left | Styles applied to the left axis. |
.MuiChartsAxis-line | line | Styles applied to the main line element. |
.MuiChartsAxis-right | right | Styles applied to the right axis. |
.MuiChartsAxis-root | root | Styles applied to the root element. |
.MuiChartsAxis-tick | tick | Styles applied to ticks. |
.MuiChartsAxis-tickContainer | tickContainer | Styles applied to group ingruding the tick and its label. |
.MuiChartsAxis-tickLabel | tickLabel | Styles applied to ticks label. |
.MuiChartsAxis-top | top | Styles applied to the top axis. |
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.