Scatter charts
Explore the relationship between two measures.
scatter owns independent x and y roles. Use it to inspect correlation, clusters, outliers, and tradeoffs between two measures.
Two measures
An id field gives points stable identity across updates and animation. It does not affect visual encoding.
Size encoding
Add size.field to encode a third numeric measure. range sets the minimum and maximum rendered radius; format and legend control its display semantics.
{
"size": {
"field": "population",
"range": [4, 22],
"format": ".3~s",
"legend": { "title": "Population" }
}
}Use size for ordered magnitude, not category. Large circles can occlude smaller ones, so keep the range restrained.
Estimate intervals
Add interval when each point is an estimate with lower and upper bounds. The interval shares the selected point axis and expands its scale domain when needed.
{
"interval": {
"axis": "x",
"lower": { "field": "lower" },
"upper": { "field": "upper" },
"stroke": { "width": 2 }
}
}Intervals paint behind their points. Use them for confidence intervals, credible intervals, and comparable estimate ranges rather than for unrelated line overlays.
Either axis may carry the interval and keeps its own band, linear, log, or UTC scale semantics. Lower, estimate, and upper follow that selected scale's order.
Intervals inherit point color by default. Set one optional uniform stroke color when every interval needs the same treatment:
{
"interval": {
"axis": "x",
"lower": { "field": "start" },
"upper": { "field": "end" },
"stroke": { "color": "#2563eb", "width": 2 }
}
}The interval stroke does not create another color encoding or legend; point grouping, legends, and interaction continue to use the chart-level color encoding.
Categorical, sequential, and diverging color
Scatter color always names the encoded field explicitly.
{
"color": {
"type": "categorical",
"field": "region",
"domain": ["Americas", "EMEA", "APAC"],
"legend": { "title": "Region" }
}
}Use type: "sequential" for ordered numeric magnitude. Use type: "diverging" when a required midpoint separates two meaningful directions inside an explicit numeric domain. Sequential color accepts two or three colors; diverging color accepts three or five. Both support formatting and a continuous legend. See Color for complete behavior and examples.
Labels, references, and annotations
labels.field prints one field beside each point. Labels prefer the side by default; use position: "above" when the text should sit over its point. Use labels for a small set of important identities rather than labeling a dense cloud.
Reference lines use axis: "x" | "y" and divide the plot at a fixed value or an average, median, minimum, or maximum calculated from the data. Annotations use either a stable datum anchor such as { type: "datum", id } or an exact { type: "coordinate", x, y } anchor. Together they support quadrants and highlighted outliers without introducing free-form drawing layers.
Scales
Both axes may independently use band, linear, log, or utc when compatible with their values. Log input and explicit log domains must be positive and finite. Use explicit domains only when the domain is part of the analysis; otherwise let Szum derive readable bounds.
Properties
| Field | Type | Default | Description |
|---|---|---|---|
version | "2026-09-26" | – | Required. The chart config version. |
type | ChartType | – | Required. The chart family. |
title | string | – | Chart title. |
subtitle | string | – | Supporting text beneath the title. |
caption | string | – | Caption below the chart for a source, methodology note, or date. |
accessibilityDescription | string | – | Accessible description of the chart's meaning. |
headerAlign | "start" | "center" | "end" | theme default | Horizontal alignment for the title and subtitle. Omit it to use the selected theme's alignment. |
locale | string | "en-US" | Locale identifier accepted by JavaScript Intl and associated with the chart content, such as en, pl, or zh-Hant. |
theme | ThemeName | "editorial" | One of 6 built-in themes. |
themeOverrides | ThemeOverrides | – | Override individual theme properties. |
x | ScatterRole | – | Required. X field, scale, and format. |
y | ScatterRole | – | Required. Y field, scale, and format. |
id | { field: string } | – | Stable datum identity field. |
size | SizeEncoding | – | Automatic, canvas, or plot sizing. See Sizing. |
interval | ScatterInterval | – | Lower and upper estimate bounds inheriting point color, with an optional uniform stroke override. |
color | ScatterColor | – | Literal, categorical, sequential, or diverging color encoding. |
labels | ScatterLabels | – | Point label field, format, and preferred position. |
radius | number | theme default | Default point radius. |
xAxis | boolean | AxisOptions | – | True shows the X axis, false hides it, and an options object shows it with those settings. Omit for defaults. |
plotBorder | boolean | theme default | Full plot border, independent of axis visibility. |
yAxis | boolean | AxisOptions | – | True shows the Y axis, false hides it, and an options object shows it with those settings. Omit for defaults. |
annotations | ScatterAnnotation[] | – | Positioned annotations. |
references | ScatterReference[] | – | Reference lines. |