ChartsYAxis API
Demos
For examples and details on the usage of this React component, visit the component demo pages:
Import
import { ChartsYAxis } from '@mui/x-charts';Component name
The nameMuiChartsYAxis 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 | 'left' | 'right' | 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 | .MuiChartsYAxis-root | Styles applied to the root element. |
| line | .MuiChartsYAxis-line | Styles applied to the main line element. |
| tickContainer | .MuiChartsYAxis-tickContainer | Styles applied to group ingruding the tick and its label. |
| tick | .MuiChartsYAxis-tick | Styles applied to ticks. |
| tickLabel | .MuiChartsYAxis-tickLabel | Styles applied to ticks label. |
| label | .MuiChartsYAxis-label | Styles applied to the axis label. |
| directionX | .MuiChartsYAxis-directionX | Styles applied to x axes. |
| directionY | .MuiChartsYAxis-directionY | Styles applied to y axes. |
| top | .MuiChartsYAxis-top | Styles applied to the top axis. |
| bottom | .MuiChartsYAxis-bottom | Styles applied to the bottom axis. |
| left | .MuiChartsYAxis-left | Styles applied to the left axis. |
| right | .MuiChartsYAxis-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
styleOverridesproperty in a custom theme.