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