Skip to content

ScatterSeries API

Extended documentation for the ScatterSeries interface with detailed information on the module's properties and available APIs.

Demos

Import

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

Properties

Type:'scatter'


Optional

Color to use when displaying the series.
If colorGetter is provided, it will be used to get the color for each data point instead.
Otherwise, this color will be used for all data points in the series.

Type:string


Optional

The id of the color axis used to compute the color of the scatter points.
It points to the id of an axis defined with the zAxis prop.

Type:string


Optional

A function that returns a color based on the value and/or the data index of a point.
The returned color is used when displaying the specific data point, e.g., a marker in a line chart.
When the color of the entire series is required, e.g., in legends, the color property is used instead.

Type:(data: ColorCallbackValue<TValue>) => string


Optional

Type:readonly ScatterValueType[]


Optional

The keys used to retrieve data from the dataset.

When this prop is provided, both x and y must be provided.
While color, size, and id are optional.

Type:{
/**
* The key used to retrieve data from the dataset for the X axis.
*/
x: string
/**
* The key used to retrieve data from the dataset for the Y axis.
*/
y: string
/**
* The key used to retrieve data from the dataset for the color value.
*/
colorValue?: string
/**
* The key used to retrieve data from the dataset for the size value.
*/
sizeValue?: string
/**
* The key used to retrieve data from the dataset for the Z axis.
* @deprecated Use `colorValue` instead.
*/
z?: string
/**
* The key used to retrieve data from the dataset for the id.
*/
id?: string
}


Optional

The scope to apply when the series is highlighted.

Type:HighlightScope<SeriesType>


Optional

The id of this series.

Type:SeriesId


Optional

The label to display on the tooltip or the legend. It can be a string or a function.

Type:string | ((location: 'tooltip' | 'legend') => string)


Optional

Defines the mark type for the series.

There is a default mark type for each series type.

Type:ChartsLabelMarkType


Optional

Size of the markers in the scatter plot, in pixels.

Type:number


Optional

Type:{
/**
* The size of the preview marker in pixels.
* @default 1
*/
markerSize?: number
}


Optional

The id of the size axis used to compute the size of the scatter points.
It points to the id of an axis defined with the zAxis prop.

Type:string


Optional

Formatter used to render values in tooltip or other data display.

Type:SeriesValueFormatter<ChartsSeriesConfig[SeriesType]['valueType']>


Optional

A function to extract and transform the value from the dataset item.
It receives the full dataset item and should return a scatter value.
Can be used as an alternative to datasetKeys.

Type:(item: DatasetElementType<unknown>) => ScatterValueType


Optional

The id of the x-axis used to render the series.

Type:AxisId


Optional

The id of the y-axis used to render the series.

Type:AxisId


Optional

The id of the z-axis used to render the series.

Type:string