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
- Common: X=Value, Y=Value
- Series
- Add 1
Serie Serie.type = ScatterSerie.seriesDatahas at least 2 points
- Add 1
3. Inspector fields
series[i].type = Scatterseries[i].settings: actual type isScatterSettingspoint: 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- Compatibility: if
y == 0andvalue != 0, runtime usesvalueas y
- Compatibility: if
- Size mapping dimension:
SeriesData.z(whensizeMapping.enabled=true)
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, write
ydirectly 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 setyto a non-zero value (compatibility won’t trigger) - recommend using
yconsistently as the Y coordinate
- you may have filled only
-
Hover does not respond
ScatterSettings.hover.enabledmust be enabled- too small
pickRadiusmakes picking difficult
-
Points are too small / too large
- adjust
ScatterSettings.point.size - or check
minSize/maxSizein sizeMapping
- adjust
8. Further reading
- Axes/range, Series and data:
00_02-WorkflowAndLibrary.md - Common recipes:
04_08-CommonRecipes.md - FAQ:
04_09-FAQ.md