ChartsRotationAxis API
API reference docs for the React ChartsRotationAxis component. Learn about the props, CSS, and other APIs of this exported module.
Demos
Import
import { ChartsRotationAxis } from '@mui/x-charts/ChartsRotationAxis';
// or
import { ChartsRotationAxis } from '@mui/x-charts';
// or
import { ChartsRotationAxis } from '@mui/x-charts-pro';
// or
import { ChartsRotationAxis } from '@mui/x-charts-premium';Learn about the difference by reading this guide on minimizing bundle size.
| Name | Type | Default | Description |
|---|---|---|---|
| axisId | number | string | - | The id of the axis to render. If undefined, it will be the first defined axis. |
| classes | object | - | Override or extend the styles applied to the component. See CSS classes API below for more details. |
| className | string | - | A CSS class name applied to the root element. |
| disableLine | bool | false | If true, the axis line is disabled. |
| disableTickLabel | bool | false | If true, the tick labels are not rendered. |
| disableTicks | bool | false | If true, the ticks are disabled. |
| endAngle | number | - | The end angle (in deg). |
| label | string | - | The label of the axis. |
| labelGap | number | - | The gap between the axis and the label. |
| labelStyle | object | - | The style applied to the axis label. |
| position | 'inside' | 'none' | 'outside' | 'outside' | The position of the rotation axis. It can be 'inside' or 'outside'. |
| startAngle | number | - | The start angle (in deg). |
| tickInterval | 'auto' | array | func | 'auto' | Defines which ticks are displayed. Its value can be: - 'auto' In such case the ticks are computed based on axis scale and other parameters. - a filtering function of the form |
| tickLabelInterval | 'auto' | func | 'auto' | Defines which ticks get its label displayed. Its value can be: - 'auto' In such case, labels are displayed if they do not overlap with the previous one. - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones. |
| tickLabelPlacement | 'middle' | 'tick' | 'middle' | The placement of ticks label. Can be the middle of the band, or the tick position. Only used if scale is 'band'. |
| tickLabelPosition | 'after' | 'before' | position === 'outside' ? 'after' : 'before' | Set the position of the tick labels relative to the axis line. |
| tickLabelStyle | object | - | The style applied to ticks text. |
| tickMaxStep | number | - | Maximal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). |
| tickMinStep | number | - | Minimal step between two ticks. When using time data, the value is assumed to be in ms. Not supported by categorical axis (band, points). |
| tickNumber | number | - | The number of ticks. This number is not guaranteed. Not supported by categorical axis (band, points). |
| tickPlacement | 'end' | 'extremities' | 'middle' | 'start' | 'extremities' | The placement of ticks in regard to the band interval. Only used if scale is 'band'. |
| tickPosition | 'after' | 'before' | position === 'outside' ? 'after' : 'before' | Set the position of the tick relative to the axis line. |
| tickSize | number | 6 | The size of the ticks. |
| tickSpacing | number | 0 | The minimum space between ticks when using an ordinal scale. It defines the minimum distance in pixels between two ticks. |
| Slot name | Class name | Default component | Description |
|---|---|---|---|
| axisLabel | ChartsText | Custom component for axis label. | |
| axisLine | 'line' | Custom component for the axis main line. | |
| axisTick | 'line' | Custom component for the axis tick. | |
| axisTickLabel | ChartsText | Custom component for tick label. | |
| xAxis | ChartsXAxis | Custom component for the x-axis. | |
| yAxis | ChartsYAxis | Custom component for the y-axis. |
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 |
|---|---|---|
| .MuiChartsRadialAxis-centered | centered | Styles applied to the tick label when centered. |
| .MuiChartsRadialAxis-line | line | Styles applied to the main line element. |
| .MuiChartsRadialAxis-radius | radius | Styles applied to the root element of radius axis. |
| .MuiChartsRadialAxis-root | root | Styles applied to the root element. |
| .MuiChartsRadialAxis-rotation | rotation | Styles applied to the root element of rotation axis. |
| .MuiChartsRadialAxis-tick | tick | Styles applied to ticks. |
| .MuiChartsRadialAxis-tickContainer | tickContainer | Styles applied to the group including the tick and its label. |
| .MuiChartsRadialAxis-tickLabel | tickLabel | Styles applied to the tick label. |
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.
Source code
If you did not find the information in this page, consider having a look at the implementation of the component for more detail.