Scatter Chart (Scatter)
This chapter explains the data field conventions for Scatter charts in EasyChart, especially the compatibility behavior of SeriesData.y/value, and how the z dimension drives sizeMapping.
1. Use cases
- Correlation analysis (two numeric dimensions X/Y)
- Distribution visualization (point cloud)
- Outlier detection
2. Minimum viable setup (checklist)
ChartProfile.coordinateSystem = Cartesian2D- Axes
- Series
- Common: X=Value, Y=Value
- Add 1 Serie - Serie.type = Scatter - Serie.seriesData has at least 2 points
3. Inspector fields
series[i].type = Scatterseries[i].settings: actual type isScatterSettings
- point: point style (visible/size/texture) - hover: hover highlight (enabled/pickRadius/scale, etc. depending on version) - sizeMapping: point size mapping
4. SeriesData field interpretation (runtime behavior)
Scatter chart uses:
- X coordinate:
SeriesData.x - Y coordinate: prefers
SeriesData.y - Size mapping dimension:
SeriesData.z(whensizeMapping.enabled=true)
- Compatibility: if y == 0 and value != 0, runtime uses value as y
So there are two common patterns:
4.1 Recommended (explicit X/Y)
x = X valuey = Y value
4.2 Compatibility (legacy data: use value as y)
x = X valuevalue = Y valuey = 0
Recommendation: for new data, writeydirectly to avoid mixing meanings withvalue.
5. Standard template: Value X + Value Y
- X axis:
AxisType = Value - Y axis:
AxisType = Value - Data: use pattern 4.1 (x/y)
6. sizeMapping: actual behavior
When ScatterSettings.sizeMapping.enabled = true:
- point radius is mapped from
SeriesData.z - mapping range:
minValue/maxValue->minSize/maxSize - if
clamp = true, t is clamped to 0..1 curveapplies a curve transform to t (non-linear mapping)
If sizeMapping "doesn't work", check first:
- did you actually set
zvalues (default 0) - is
minValue/maxValueequal (degenerates mapping)
7. Common pitfalls and troubleshooting
- All points are on a horizontal line
- you may have filled only value, but also set y to a non-zero value (compatibility won't trigger) - recommend using y consistently as the Y coordinate
- Hover does not respond
- ScatterSettings.hover.enabled must be enabled - too small pickRadius makes picking difficult
- Points are too small / too large
- adjust ScatterSettings.point.size - or check minSize/maxSize in sizeMapping
8. Further reading
- Axes/range, Series and data:
00_02-WorkflowAndLibrary.md - Common recipes:
04_08-CommonRecipes.md - FAQ:
04_09-FAQ.md