Skip to contentSkip to content

ChartsWrapper API

API reference docs for the React ChartsWrapper component. Learn about the props, CSS, and other APIs of this exported module.

Demos

Import

import { ChartsWrapper } from '@mui/x-charts/ChartsWrapper';
// or
import { ChartsWrapper } from '@mui/x-charts';
// or
import { ChartsWrapper } from '@mui/x-charts-pro';
// or
import { ChartsWrapper } from '@mui/x-charts-premium';

Learn about the difference by reading this guide on minimizing bundle size.



Wrapper for the charts components. Its main purpose is to position the HTML legend in the correct place.

Props

NameTypeDefaultDescription
children*node-

The content of the component.

extendVerticallybool`false` if the `height` prop is set. And `true` otherwise.

If true, the chart wrapper set height: 100%.

hideLegendboolfalse

If true, the legend is not rendered.

legendDirection'horizontal'
| 'vertical'
'horizontal'

The direction of the legend.

legendPosition{ horizontal?: 'center'
| 'end'
| 'start', vertical?: 'bottom'
| 'middle'
| 'top' }
{ horizontal: 'center', vertical: 'bottom' }

The position of the legend.

sxArray<func
| object
| bool>
| func
| object
-

The system prop that allows defining system overrides as well as additional CSS styles.

See the `sx` page for more details.

The component cannot hold a ref.

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.