The PointCategoryChart
component displays categorized points on a 2D plane, allowing for flexible visual encoding using color, symbol type, or symbol size. It is ideal for representing multi-category scatter plots, surveys, or segmented data comparisons.
marks: Array<object>
(required)Each mark defines a data point on the chart and must include:
x: number
The value on the horizontal axis (e.g., age, time, score).
y: number
The value on the vertical axis (e.g., quantity, percentage).
category: string
A grouping key. Each category may be visually differentiated using color, symbol, or size.
Additional optional properties from ChartMarkProps
can be used for further customization:
foregroundStyle
symbol
symbolSize
annotation
opacity
, etc.representsDataUsing?: "foregroundStyle" | "symbol" | "symbolSize"
Controls how the chart visually distinguishes different categories:
"foregroundStyle"
– uses different colors per category."symbol"
– uses different shapes (e.g., circles, squares) per category."symbolSize"
– varies the size of symbols based on the category (or data magnitude).This is an alternative to setting
foregroundStyleBy
,symbolBy
, orsymbolSizeBy
manually.
You can dynamically switch how data is represented using a <Picker>
and bind it to the representsDataUsing
prop.
PointCategoryChart
is suitable for: