[object Promise]

# ChartsAxis API

## Demos

For examples and details on the usage of this React component, visit the component demo pages:

- [Charts - Axis](/x/react-charts/axis/)
- [Charts - Axis customization](/x/react-charts/axis-customization/)
- [Charts - Axis ticks and grid](/x/react-charts/axis-ticks/)

## Import

```jsx
import { ChartsAxis } from '@mui/x-charts/ChartsAxis';
// or
import { ChartsAxis } from '@mui/x-charts';
// or
import { ChartsAxis } from '@mui/x-charts-pro';
// or
import { ChartsAxis } from '@mui/x-charts-premium';
```

## Props

| Name | Type | Default | Required | Description |
|------|------|---------|----------|-------------|
| slotProps | `object` | `{}` | No |  |
| slots | `object` | `{}` | No |  |

> **Note**: The `ref` is forwarded to the root element.

## Slots

| Name | Default | Class | 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. |

## CSS

### Rule name

| Global class | Rule name | Description |
|--------------|-----------|-------------|
| - | bottom | Styles applied to the bottom axis. |
| - | directionX | Styles applied to x-axes. |
| - | directionY | Styles applied to y-axes. |
| - | label | Styles applied to the group containing the axis label. |
| - | left | Styles applied to the left axis. |
| - | line | Styles applied to the main line element. |
| - | right | Styles applied to the right axis. |
| - | root | Styles applied to the root element. |
| - | tick | Styles applied to ticks. |
| - | tickContainer | Styles applied to group including the tick and its label. |
| - | tickLabel | Styles applied to ticks label.

⚠️ For performance reasons, only the inline styles get considered for bounding box computation.
Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. |
| - | top | Styles applied to the top axis. |

## Source code

If you did not find the information on this page, consider having a look at the implementation of the component for more detail.

- [/packages/x-charts/src/ChartsAxis/ChartsAxis.tsx](https://github.com/mui/material-ui/tree/HEAD/packages/x-charts/src/ChartsAxis/ChartsAxis.tsx)

# ChartsReferenceLine API

## Demos

For examples and details on the usage of this React component, visit the component demo pages:

- [Charts - Axis](/x/react-charts/axis/)
- [Charts - Reference elements](/x/react-charts/references/)

## Import

```jsx
import { ChartsReferenceLine } from '@mui/x-charts/ChartsReferenceLine';
// or
import { ChartsReferenceLine } from '@mui/x-charts';
// or
import { ChartsReferenceLine } from '@mui/x-charts-pro';
// or
import { ChartsReferenceLine } from '@mui/x-charts-premium';
```

## Props

| Name | Type | Default | Required | Description |
|------|------|---------|----------|-------------|
| axisId | `number \| string` | `The `id` of the first defined axis.` | No |  |
| classes | `object` | - | No | Override or extend the styles applied to the component. |
| label | `string` | - | No |  |
| labelAlign | `'end' \| 'middle' \| 'start'` | `'middle'` | No |  |
| labelStyle | `object` | - | No |  |
| lineStyle | `object` | - | No |  |
| spacing | `number \| { x?: number, y?: number }` | `{ x: 0, y: 5 } on a horizontal line and { x: 5, y: 0 } on a vertical line.` | No |  |
| x | `Date \| number \| string` | - | No |  |
| y | `Date \| number \| string` | - | No |  |

> **Note**: The `ref` is forwarded to the root element.

## CSS

### Rule name

| Global class | Rule name | Description |
|--------------|-----------|-------------|
| - | horizontal | Styles applied to the root element if the reference line is horizontal. |
| - | label | Styles applied to the reference label. |
| - | line | Styles applied to the reference line. |
| - | root | Styles applied to the root element. |
| - | vertical | Styles applied to the root element if the reference line is vertical. |

## Source code

If you did not find the information on this page, consider having a look at the implementation of the component for more detail.

- [/packages/x-charts/src/ChartsReferenceLine/ChartsReferenceLine.tsx](https://github.com/mui/material-ui/tree/HEAD/packages/x-charts/src/ChartsReferenceLine/ChartsReferenceLine.tsx)

# ChartsText API

## Demos

For examples and details on the usage of this React component, visit the component demo pages:

- [Charts - Axis](/x/react-charts/axis/)
- [Charts - Legend](/x/react-charts/legend/)

## Import

```jsx
import { ChartsText } from '@mui/x-charts/ChartsText';
// or
import { ChartsText } from '@mui/x-charts';
// or
import { ChartsText } from '@mui/x-charts-pro';
// or
import { ChartsText } from '@mui/x-charts-premium';
```

## Props

| Name | Type | Default | Required | Description |
|------|------|---------|----------|-------------|
| text | `string` | - | Yes |  |
| lineHeight | `number` | - | No |  |
| needsComputation | `bool` | `false` | No |  |
| style | `object` | - | No |  |

> **Note**: The `ref` is forwarded to the root element.

## Source code

If you did not find the information on this page, consider having a look at the implementation of the component for more detail.

- [/packages/x-charts/src/ChartsText/ChartsText.tsx](https://github.com/mui/material-ui/tree/HEAD/packages/x-charts/src/ChartsText/ChartsText.tsx)

# ChartsXAxis API

## Demos

For examples and details on the usage of this React component, visit the component demo pages:

- [Charts - Axis](/x/react-charts/axis/)
- [Charts - Axis customization](/x/react-charts/axis-customization/)
- [Charts - Axis ticks and grid](/x/react-charts/axis-ticks/)

## Import

```jsx
import { ChartsXAxis } from '@mui/x-charts/ChartsXAxis';
// or
import { ChartsXAxis } from '@mui/x-charts';
// or
import { ChartsXAxis } from '@mui/x-charts-pro';
// or
import { ChartsXAxis } from '@mui/x-charts-premium';
```

## Props

| Name | Type | Default | Required | Description |
|------|------|---------|----------|-------------|
| axis | `'x'` | - | No |  |
| axisId | `number \| string` | - | No |  |
| classes | `object` | - | No | Override or extend the styles applied to the component. |
| className | `string` | - | No |  |
| disableLine | `bool` | `false` | No |  |
| disableTicks | `bool` | `false` | No |  |
| label | `string` | - | No |  |
| labelStyle | `object` | - | No |  |
| slotProps | `object` | `{}` | No |  |
| slots | `object` | `{}` | No |  |
| sx | `Array<func \| object \| bool> \| func \| object` | - | No | The system prop that allows defining system overrides as well as additional CSS styles. |
| tickInterval | `'auto' \| array \| func` | `'auto'` | No |  |
| tickLabelInterval | `'auto' \| func` | `'auto'` | No |  |
| tickLabelMinGap | `number` | `4` | No |  |
| tickLabelPlacement | `'middle' \| 'tick'` | `'middle'` | No |  |
| tickLabelStyle | `object` | - | No |  |
| tickMaxStep | `number` | - | No |  |
| tickMinStep | `number` | - | No |  |
| tickNumber | `number` | - | No |  |
| tickPlacement | `'end' \| 'extremities' \| 'middle' \| 'start'` | `'extremities'` | No |  |
| tickSize | `number` | `6` | No |  |
| tickSpacing | `number` | `0` | No |  |

> **Note**: The `ref` is forwarded to the root element.

> Any other props supplied will be provided to the root element (native element).

## Slots

| Name | Default | Class | 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. |

## CSS

### Rule name

| Global class | Rule name | Description |
|--------------|-----------|-------------|
| - | bottom | Styles applied to the bottom axis. |
| - | directionX | Styles applied to x-axes. |
| - | directionY | Styles applied to y-axes. |
| - | label | Styles applied to the group containing the axis label. |
| - | left | Styles applied to the left axis. |
| - | line | Styles applied to the main line element. |
| - | right | Styles applied to the right axis. |
| - | root | Styles applied to the root element. |
| - | tick | Styles applied to ticks. |
| - | tickContainer | Styles applied to group including the tick and its label. |
| - | tickLabel | Styles applied to ticks label.

⚠️ For performance reasons, only the inline styles get considered for bounding box computation.
Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. |
| - | top | Styles applied to the top axis. |

## Source code

If you did not find the information on this page, consider having a look at the implementation of the component for more detail.

- [/packages/x-charts/src/ChartsXAxis/ChartsXAxis.tsx](https://github.com/mui/material-ui/tree/HEAD/packages/x-charts/src/ChartsXAxis/ChartsXAxis.tsx)

# ChartsYAxis API

## Demos

For examples and details on the usage of this React component, visit the component demo pages:

- [Charts - Axis](/x/react-charts/axis/)
- [Charts - Axis customization](/x/react-charts/axis-customization/)
- [Charts - Axis ticks and grid](/x/react-charts/axis-ticks/)

## Import

```jsx
import { ChartsYAxis } from '@mui/x-charts/ChartsYAxis';
// or
import { ChartsYAxis } from '@mui/x-charts';
// or
import { ChartsYAxis } from '@mui/x-charts-pro';
// or
import { ChartsYAxis } from '@mui/x-charts-premium';
```

## Props

| Name | Type | Default | Required | Description |
|------|------|---------|----------|-------------|
| axis | `'y'` | - | No |  |
| axisId | `number \| string` | - | No |  |
| classes | `object` | - | No | Override or extend the styles applied to the component. |
| className | `string` | - | No |  |
| disableLine | `bool` | `false` | No |  |
| disableTicks | `bool` | `false` | No |  |
| label | `string` | - | No |  |
| labelStyle | `object` | - | No |  |
| slotProps | `object` | `{}` | No |  |
| slots | `object` | `{}` | No |  |
| sx | `Array<func \| object \| bool> \| func \| object` | - | No | The system prop that allows defining system overrides as well as additional CSS styles. |
| tickInterval | `'auto' \| array \| func` | `'auto'` | No |  |
| tickLabelInterval | `'auto' \| func` | `'auto'` | No |  |
| tickLabelPlacement | `'middle' \| 'tick'` | `'middle'` | No |  |
| tickLabelStyle | `object` | - | No |  |
| tickMaxStep | `number` | - | No |  |
| tickMinStep | `number` | - | No |  |
| tickNumber | `number` | - | No |  |
| tickPlacement | `'end' \| 'extremities' \| 'middle' \| 'start'` | `'extremities'` | No |  |
| tickSize | `number` | `6` | No |  |
| tickSpacing | `number` | `0` | No |  |

> **Note**: The `ref` is forwarded to the root element.

> Any other props supplied will be provided to the root element (native element).

## Slots

| Name | Default | Class | 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. |

## CSS

### Rule name

| Global class | Rule name | Description |
|--------------|-----------|-------------|
| - | bottom | Styles applied to the bottom axis. |
| - | directionX | Styles applied to x-axes. |
| - | directionY | Styles applied to y-axes. |
| - | label | Styles applied to the group containing the axis label. |
| - | left | Styles applied to the left axis. |
| - | line | Styles applied to the main line element. |
| - | right | Styles applied to the right axis. |
| - | root | Styles applied to the root element. |
| - | tick | Styles applied to ticks. |
| - | tickContainer | Styles applied to group including the tick and its label. |
| - | tickLabel | Styles applied to ticks label.

⚠️ For performance reasons, only the inline styles get considered for bounding box computation.
Modifying text size by adding properties like `font-size` or `letter-spacing` to this class might cause labels to overlap. |
| - | top | Styles applied to the top axis. |

## Source code

If you did not find the information on this page, consider having a look at the implementation of the component for more detail.

- [/packages/x-charts/src/ChartsYAxis/ChartsYAxis.tsx](https://github.com/mui/material-ui/tree/HEAD/packages/x-charts/src/ChartsYAxis/ChartsYAxis.tsx)