Skip to contentSkip to content

ChartsContainerPro API

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

Demos

Import

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

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



It sets up the data providers as well as the <svg> for the chart.

This is a combination of both the ChartsDataProviderPro and ChartsSurface components.

Props

NameTypeDefaultDescription
apiRef{ current?: { setZoomData: func } }-

The ref object that exposes the chart API methods.

childrennode-

The content of the component.

colorsArray<string>
| func
blueberryTwilightPalette

Color palette used to colorize multiple series.

datasetArray<object>-

An array of objects that can be used to populate series and axes data using their dataKey property.

descstring-

The description of the chart. Used to provide an accessible description for the chart.

disableAxisListenerboolfalse

If true, the charts will not listen to the mouse move event. It might break interactive features, but will improve performance.

heightnumber-

The height of the chart in px. If not defined, it takes the height of the parent element.

highlightedItem{ dataIndex?: number, seriesId: number
| string }
-

The highlighted item. Used when the highlight is controlled.

idstring-

This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id.

initialZoomArray<{ axisId: number
| string, end: number, start: number }>
-

The list of zoom data related to each axis.

margin{ bottom?: number, left?: number, right?: number, top?: number }-

The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend. Accepts an object with the optional properties: top, bottom, left, and right.

onHighlightChangefunc-

The callback fired when the highlighted item changes.

Signature:function(highlightedItem: HighlightItemData | null) => void
  • highlightedItem The newly highlighted item.
onZoomChangefunc-

Callback fired when the zoom has changed.

Signature:function(zoomData: Array<ZoomData>) => void
  • zoomData Updated zoom data.
seriesArray<object>-

The array of series to display. Each type of series has its own specificity. Please refer to the appropriate docs page to learn more about it.

skipAnimationbool-

If true, animations are skipped. If unset or false, the animations respects the user's prefers-reduced-motion setting.

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.

theme'dark'
| 'light'
-

The color mode passed to colors when it is a function. Defaults to the mode of the Material UI theme.

titlestring-

The title of the chart. Used to provide an accessible label for the chart.

widthnumber-

The width of the chart in px. If not defined, it takes the width of the parent element.

xAxisArray<object>-

The configuration of the x-axes. If not provided, a default axis config is used. An array of AxisConfig objects.

yAxisArray<object>-

The configuration of the y-axes. If not provided, a default axis config is used. An array of AxisConfig objects.

zAxisArray<{ colorMap?: { colors: Array<string>, type: 'ordinal', unknownColor?: string, values?: Array<Date
| number
| string> }
| { color: Array<string>
| func, max?: Date
| number, min?: Date
| number, type: 'continuous' }
| { colors: Array<string>, thresholds: Array<Date
| number>, type: 'piecewise' }, data?: array, dataKey?: string, id?: string, max?: number, min?: number }>
-

The configuration of the z-axes.

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.