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'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
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
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
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
}
The scope to apply when the series is highlighted.
Type:HighlightScope<SeriesType>
The label to display on the tooltip or the legend. It can be a string or a function.
Type:string | ((location: 'tooltip' | 'legend') => string)
Defines the mark type for the series.
There is a default mark type for each series type.
Type:ChartsLabelMarkType
Type:{
/**
* The size of the preview marker in pixels.
* @default 1
*/
markerSize?: number
}
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
Formatter used to render values in tooltip or other data display.
Type:SeriesValueFormatter<ChartsSeriesConfig[SeriesType]['valueType']>
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