ChartsXAxis API
Demos
For examples and details on the usage of this React component, visit the component demo pages:
Import
import { ChartsXAxis } from '@mui/x-charts';
Component name
The nameMuiChartsXAxis
can be used when providing default props or style overrides in the theme.Props
Name | Type | Default | Description |
---|---|---|---|
axisId* | string | Id of the axis to render. | |
classes | object | Override or extend the styles applied to the component. See CSS API below for more details. | |
disableLine | bool | false | If true, the axis line is disabled. |
disableTicks | bool | false | If true, the ticks are disabled. |
fill | string | 'currentColor' | The fill color of the axis text. |
label | string | The label of the axis. | |
labelFontSize | number | 14 | The font size of the axis label. |
position | 'bottom' | 'top' | Position of the axis. | |
stroke | string | 'currentColor' | The stroke color of the axis line. |
tickFontSize | number | 12 | The font size of the axis ticks text. |
tickSize | number | 6 | The size of the ticks. |
The component cannot hold a ref.
CSS
Rule name | Global class | Description |
---|---|---|
root | .MuiChartsXAxis-root | Styles applied to the root element. |
line | .MuiChartsXAxis-line | Styles applied to the main line element. |
tickContainer | .MuiChartsXAxis-tickContainer | Styles applied to group ingruding the tick and its label. |
tick | .MuiChartsXAxis-tick | Styles applied to ticks. |
tickLabel | .MuiChartsXAxis-tickLabel | Styles applied to ticks label. |
label | .MuiChartsXAxis-label | Styles applied to the axis label. |
directionX | .MuiChartsXAxis-directionX | Styles applied to x axes. |
directionY | .MuiChartsXAxis-directionY | Styles applied to y axes. |
top | .MuiChartsXAxis-top | Styles applied to the top axis. |
bottom | .MuiChartsXAxis-bottom | Styles applied to the bottom axis. |
left | .MuiChartsXAxis-left | Styles applied to the left axis. |
right | .MuiChartsXAxis-right | Styles applied to the right 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.