Scatter and bubble chart reference
Contents: Use cases, Chart IDs, Minimal spec, Data, Options, Annotations, Sizing, Fixtures.
XY point cloud with group colors, spiral point labels, and area-true bubbles. Type scatter. Aliases: bubble.
Use cases
- Related measures
- Portfolio
- Price against volume per product
Chart IDs
scatter.points: fixtureprice-quality-brandsscatter.bubbles: fixtureportfolio-bubblesscatter.quadrants: fixturegrowth-share-matrixscatter.matrix: fixtureportfolio-nine-box
Minimal spec
{
"type": "scatter",
"data": {
"points": [
{ "id": "a", "label": "A", "x": 10, "y": 40 },
{ "id": "b", "label": "B", "x": 20, "y": 55 },
{ "id": "c", "label": "C", "x": 30, "y": 45 }
]
},
"options": {
"axisTitles": { "x": "Price ($)", "y": "Quality score" },
"title": "Quality is highest for the mid-priced offer",
"source": "Illustrative data"
}
}Data
A cell is a number, null or a value object; see Value cell.
| Path | Type | Required | Meaning |
|---|---|---|---|
| points | array | yes | Observations with x/y coordinates and optional bubble sizes. Rows: x,y; optional size,label,group. |
| points[].id | string | yes | Unique point identity used by labels, annotations and interaction records. |
| points[].group | string | Group id controlling shared legend identity and styling. | |
| points[].label | string | Displayed point name. If no point has an authored label, each point defaults to its id. If any point has an authored label, including an empty string, points with omitted labels stay unnamed on the plot and in omission notes. Their ids remain in interaction and data records. | |
| points[].x | cell | yes | Horizontal coordinate in the x-axis units. |
| points[].y | cell | yes | Vertical coordinate in the y-axis units. |
| points[].size | number | Bubble magnitude; proportional to area by default, or diameter when sizeBy requests it. | |
| points[].fill | string | Explicit CSS fill for this point, overriding group paint. | |
| points[].marker | string | Point symbol overriding its group marker. One of 'circle', 'square', 'triangle', 'diamond', 'none'. | |
| points[].scenario | string | AC, PY, PL, FC (or ACT, BUD, FCST, LY for last year). Codes and aliases accept any case. Scenario controlling the point paint convention. | |
| points[].count | number | Observations behind this point. options.minCount filters on this field and refuses when it is absent. | |
| groups | array | Named point groups supplying shared legend and styling information. | |
| groups[].id | string | yes | Group identity referenced by point.group. |
| groups[].label | string | Displayed group name in the legend; defaults to the group id. | |
| groups[].colorRole | string | Theme color role shared by points in this group. One of good, bad, warn, neutral, neutralLight, highlight, total, others; series-N for step N of the theme ramp, 1-based (series-2 is color.series[1]); or status-<key> for a theme status color. A hex color goes in fill. | |
| groups[].marker | string | Default marker shape for points in this group. One of 'circle', 'square', 'triangle', 'diamond', 'none'. |
Options
| Path | Type | Values | Default | Meaning |
|---|---|---|---|---|
| labels | false | object | false (or another value of its type) | Point labels. Names print by default; labels.value adds each point's value. false turns both off. | |
| labels.value | boolean | true prints each point's value: the size on a bubble chart, y otherwise. It sits inside a bubble it fits with a contrasting ink, otherwise beside its point, and the name moves beside the bubble. Default false. | ||
| legend | string | object | 'top', 'bottom', 'right', 'left', 'none', 'auto' (or another value of its type) | Key position. Multiple drawn groups get a key by default unless point labels name each group. 'none' hides the key; unnamed groups warn. Point names alone do not identify groups. | |
| valueAxis.clamp | object | Cap one or both axes and draw the points beyond the cap at the edge as open markers, with a derived footnote counting them. | ||
| valueAxis.clamp.min | number | Lower bound of the vertical axis, the short form of clamp.y.min. | ||
| valueAxis.clamp.max | number | Upper bound of the vertical axis, the short form of clamp.y.max. | ||
| valueAxis.clamp.x | object | Bounds of the horizontal measure. | ||
| valueAxis.clamp.x.min | number | Lower bound; points below it are drawn at the lower edge and counted in a footnote. | ||
| valueAxis.clamp.x.max | number | Upper bound; points above it are drawn at the upper edge and counted in a footnote. | ||
| valueAxis.clamp.y | object | Bounds of the vertical measure, the long form of clamp.min and clamp.max. | ||
| valueAxis.clamp.y.min | number | Lower bound; points below it are drawn at the lower edge and counted in a footnote. | ||
| valueAxis.clamp.y.max | number | Upper bound; points above it are drawn at the upper edge and counted in a footnote. | ||
| viewDomain | object | Visible numeric domain. Source means, classifications and bubble sizing keep all observations. | ||
| viewDomain.x | array | Exact horizontal viewport limits. | ||
| viewDomain.y | array | Exact vertical viewport limits. | ||
| axisTitles | object | Axis titles, e.g. { x: 'Price index', y: 'Perceived quality' }. | ||
| axisTitles.x | string | Title identifying the horizontal measure and its units. | ||
| axisTitles.y | string | Title identifying the vertical measure and its units. | ||
| axisFormat | object | Per-axis format-by-example, each falling back to format: { x: '$0', y: '0%' } prints the cost ticks as $2 and the score ticks as 60%. Tick labels, point values, hover values, zone, clamp and quadrant text and the accessible description use the format of the coordinate's axis; bubble sizes keep format. | ||
| axisFormat.x | string | Format-by-example for x values, such as '$0.0'. | ||
| axisFormat.y | string | Format-by-example for y values, such as '0%'. | ||
| minCount | number | Drop points whose points[].count is below this threshold, with a derived footnote counting them. Refused when the points carry no count. | ||
| sizeBy | string | 'area', 'diameter' | 'area' | Map bubble magnitude to area by default, or to diameter. |
| maxPointLabels | integer | 300 | Maximum number of point labels considered by the label solver; defaults to 300. | |
| quadrants | object | Two-by-two classification with explicitly declared axis cut points; cannot be combined with zones. | ||
| quadrants.x | number | object | Vertical cut point (REQUIRED): a number, or { stat: 'median' | 'mean' } over the plotted x values. | ||
| quadrants.x.stat | string | 'median', 'mean' | Unweighted statistic of plotted coordinates used as the declared cut point. | |
| quadrants.y | number | object | Horizontal cut point (REQUIRED): a number, or { stat: 'median' | 'mean' } over the plotted y values. | ||
| quadrants.y.stat | string | 'median', 'mean' | Unweighted statistic of plotted coordinates used as the declared cut point. | |
| quadrants.labels | object | Box captions; each rendered caption carries its own box count. | ||
| quadrants.labels.tl | string | Caption for the upper-left quadrant. | ||
| quadrants.labels.tr | string | Caption for the upper-right quadrant. | ||
| quadrants.labels.bl | string | Caption for the lower-left quadrant. | ||
| quadrants.labels.br | string | Caption for the lower-right quadrant. | ||
| quadrants.tint | string | 'none', 'alternating' | Neutral checkerboard wash only; good/bad quadrant coloring is not offered because the engine cannot know axis polarity. Use options.highlight for emphasis. | |
| quadrants.captionPlacement | string | 'corner', 'centre' | Place quadrant captions in their corner or center. | |
| quadrants.axisNames | object | Short axis names for the method note (methodNote: true). With both names and two declared cut points the note is one line: 'Cuts: share at 1 and growth at 8; a point on a cut counts right and above.' Otherwise the full cut-point sentence prints. | ||
| quadrants.axisNames.x | string | Short name of the horizontal axis, e.g. 'share'. | ||
| quadrants.axisNames.y | string | Short name of the vertical axis, e.g. 'growth'. | ||
| zones | object | Authored grid or polygon classifications; cannot be combined with quadrants. | ||
| zones.grid (zones branch 1) | object | Partition strategy zones with ordered x and y cut points. | ||
| zones.grid.x (zones branch 1) | array | Strictly increasing x thresholds partitioning the plot into columns. | ||
| zones.grid.y (zones branch 1) | array | Strictly increasing y thresholds partitioning the plot into rows. | ||
| zones.grid.cells (zones branch 1) | array | Named cells receiving authored classification labels and tones. | ||
| zones.grid.cells[].id (zones branch 1) | string | Unique identity for this strategy-grid cell. | ||
| zones.grid.cells[].column (zones branch 1) | integer | Zero-based horizontal interval index, increasing from left to right. | ||
| zones.grid.cells[].row (zones branch 1) | integer | Zero-based vertical interval index in increasing y-value order. | ||
| zones.grid.cells[].label (zones branch 1) | string | Visible caption for this strategy-grid cell. | ||
| zones.grid.cells[].tone (zones branch 1) | string | 'neutral', 'good', 'bad', 'warn', 'info', 'none' | Authored semantic fill tone for this cell; none draws no fill and keeps the caption and grid rules. Unauthored cells take the neutral wash. | |
| zones.grid.cells[].labelAt (zones branch 1) | string | 'plot', 'key', 'both' | Where the label goes: plot (default) captions it inside the zone, key puts it in the legend row with the zone's fill as its swatch, both does both. key and both need a label and a tone other than none. | |
| zones.grid.cells[].a11y (zones branch 1) | string | Accessible description of this cell classification. | ||
| zones.grid.xLabels (zones branch 1) | array | Labels for the x intervals; provide one more label than x thresholds. | ||
| zones.grid.yLabels (zones branch 1) | array | Labels for the y intervals; provide one more label than y thresholds. | ||
| zones.regions (zones branch 2) | array | Authored polygon regions used instead of a rectangular partition. | ||
| zones.regions[].id (zones branch 2) | string | Unique identity for this polygon classification region. | ||
| zones.regions[].points (zones branch 2) | array | At least three ordered polygon vertices in data coordinates. | ||
| zones.regions[].points[].x (zones branch 2) | number | Polygon vertex x coordinate in data units. | ||
| zones.regions[].points[].y (zones branch 2) | number | Polygon vertex y coordinate in data units. | ||
| zones.regions[].smooth (zones branch 2) | boolean | Smooth the boundary through the authored polygon vertices. | ||
| zones.regions[].label (zones branch 2) | string | Visible caption for the polygon region. | ||
| zones.regions[].tone (zones branch 2) | string | 'neutral', 'good', 'bad', 'warn', 'info', 'none' | Authored semantic fill tone for this region; none draws the outline only. | |
| zones.regions[].labelAt (zones branch 2) | string | 'plot', 'key', 'both' | Where the label goes: plot (default) captions it inside the zone, key puts it in the legend row with the zone's fill as its swatch, both does both. key and both need a label and a tone other than none. | |
| zones.regions[].a11y (zones branch 2) | string | Accessible description of this polygon classification. | ||
| trend | boolean | object | Linear trend line: an ordinary least squares fit over the drawn points, dashed across the fitted x range only, under the points and clipped to the plot. Slope, intercept and r² go into the claim records (reading.derived); the key entry of each line prints its slope and r², and the plot prints no equation. A fit over fewer than 3 points or points that share one x is left out with trend-undefined. The fit is in the values on any scale, so on a log axis the line is drawn as the curve it makes there. | ||
| trend.groups | string | array | 'all', 'each' (or another value of its type) | Which points one fit runs over: all (default) for one line, each for one line per group in its color, or a list of group ids for those groups. | |
| trend.label | string | Authored text at an end of the first trend line (the right end first, clear of the points), such as 'Linear trend'. It also names the line's key entry. | ||
| frontier | object | Pareto line: the engine keeps every drawn point that no other point beats on both axes (at least as good on both and better on one; exact ties both stay) and draws a dotted ink line through them in x order, under the points. Keyed in the legend row with its dotted stroke; point labels keep off it and cross it only on a halo. geometry.derived.frontier lists the point ids. A frontier of one point draws no line and warns frontier-single-point; a listed group without drawn points warns frontier-group-empty. | ||
| frontier.x | string | 'min', 'max' | Which x is better: min for lower (a cost), max for higher. | |
| frontier.y | string | 'min', 'max' | Which y is better: max for higher (a score), min for lower. | |
| frontier.label | string | Key label of the line; default 'Pareto line'. | ||
| frontier.extend | boolean | Run the line a short way past its first and last point, in the direction of the end segments, clipped to the plot. Default false. | ||
| frontier.groups | string | array | 'all' (or another value of its type) | Points the frontier runs over: all drawn points (default) or the drawn points of the listed groups, as one line. | |
| sizeLegend | boolean | object | Bubble size key: nested circles sharing one bottom tangent, each value printed at the top of its circle, inside the plot in the first corner (bottom-right, top-right, bottom-left, top-left) that no bubble touches; with none free it sits bottom-right and warns size-legend-overlaps-points. Drawn by default whenever a point carries a positive size; false turns it off. Refused when no point carries a size. A key larger than the plot is not drawn and warns size-legend-no-room. Without label an info lint size-legend-unnamed asks for the measure's name. legend: 'none' also drops this key and warns legend-off; set legend to a value that shows it, or set sizeLegend: false to drop it on purpose. | ||
| sizeLegend.values | array | Sizes the key circles show, largest drawn outermost; default round sizes from the data range: the largest in the data range and one half of it or less, none below the smallest bubble. Rings are drawn at the plot's scale and the key row grows to fit them; a ring is at most one eighth of the card height across. A size above the largest bubble is left out with size-legend-value-out-of-range, and with none left the key shows the defaults; a size below the smallest bubble is drawn at scale and named in an info. | ||
| sizeLegend.label | string | Name of the size measure above the key, such as 'Revenue, €bn'. | ||
| qualitativeAxes | boolean | Axes that read as directions, not scales: no tick numbers and no gridlines; each axis prints strings.axisLow ('Lower') and strings.axisHigh ('Higher') at its ends and its title in bold between two arrows, the y axis in a column left of the plot. Needs axisTitles. Positions keep their numeric scale. | ||
| methodNote | boolean | Default false. true adds the method footnotes: axes that do not start at zero, and for quadrants the cut points with their source, the tie rule, the shading, units on a cut point, empty boxes and a divider that falls outside the range. Clipped and dropped points are required for interpretation and print regardless. |
Plus the shared options. This type does not accept detailFields, labelPosition, valueAxis.break, hatchStrength, rounding. This type ignores animate, debug, rowLabels, categoryAxis, categoryLabels, secondaryAxis, sort, topN, bandFraction with an option-ignored warning.
Annotations
An annotation anchor is a category or item id string, or an object with categoryId plus optional seriesId, segmentId and edge (start, end, total); pointId addresses a scatter point. Category anchors, including from/to, take category ids, not category labels.
| Kind | Purpose | Required | Anchors | Optional fields | Notes |
|---|---|---|---|---|---|
| diff | Draws a level-difference arrow between two anchors and computes either percent change or their signed value difference. | from, to | from: AnchorRef; to: AnchorRef | mode: relative | absolute | reversed | both, default relative. relative prints the percent change from 'from' to 'to', reversed the change from 'to' to 'from', absolute the value difference, both the value difference with the percent change beside it. | Mode defaults to relative. Relative and reversed changes need a nonzero base; negative bases use its absolute magnitude and emit a warning. Absolute mode reports the raw value difference. A hidden label removes its arm. |
| delta | Computes the signed difference between an anchored value and another anchor or literal, then places a collision-managed label at the first anchor. | at, vs | at: AnchorRef; vs: AnchorRef | number | mode: absolute | relative | both, default absolute. absolute prints at minus vs, relative the percent change from vs to at, both the two as '+149 (+36%)'. relative and both need a nonzero vs. | |
| abs | Reads the anchored data value and places its formatted absolute value in a collision-managed label. | at | at: AnchorRef | ||
| note | Places authored text at an anchored data element through collision avoidance, with an optional icon or status chip. | at, text | at: AnchorRef | ||
| callout | Places authored free text at an anchored data element, routing a leader when displaced and honoring the preferred side. | at, text | at: AnchorRef | preferSide: left | right | above | below. Side the solver tries first; the label keeps a leader when it moves. headline: string. A bold first line over the text, which then prints in plain type; ${value} in it prints the anchored value from the data. Example: "headline": "${value}", "text": "Peak in handheld-loom demand" prints 153 in bold over the words. arrow: boolean, default false. An arrow from the text to the anchored point, in the arrow standard of theme marks.arrow: the text stands far enough out for a 24 px shaft, level with the point right or left of it, or over or under it, where there is room. With no such seat it draws without the arrow and warns callout-arrow-no-room. Not with icon or status. Example: "arrow": true. | |
| valueLine | Draws a reference line at an authored value or an engine-computed mean, with optional tolerance shading and attainment fill between the line and resolved actuals. | from: categoryId (optional); to: categoryId (optional) | value: number | 'mean', default mean. A number draws the line there; mean has the engine compute it. valueKind: 'fraction'. Multiply a numeric value and its tolerance by 100 before layout: 0.35 draws at 35%. Independent of data.valueKind. Omit it for values already in percent points; not valid with mean. label: string | false. Name plus value; ${value} sets its position. A number already in the name is kept once. false hides it. side: left | right, default right. Side of the plot the label sits on. tolerance: number | { low, high }. A number shades that distance on both sides of the line; low and high shade an authored corridor. On column, bar and dot the key names the band with its bounds, "Target range: 95 to 105"; without a key the band prints its bounds itself. | No anchor is required. Value defaults to mean. Scoped means are line-only: seriesId and paired from/to compute a primary-axis mean and limit its stroke to those bands; other types refuse scope fields for a mean. Numeric values cannot use scope fields except as a category clip with tolerance or attainment. A secondary-axis line needs an acknowledged secondary scale and an explicit numeric value. Optional tolerance shades a value-axis band; optional attainment fills between the line and resolved actuals. | |
| text | Places authored text at a point through the label solver: on the point, or above, below, right or left of it. The text prints as written. | at, text | at: AnchorRef | { categoryId, value } | A point is an anchor or { categoryId, value } with value in axis units. A value outside the plot, a chart with no value scale or an anchor that does not resolve warns bad-anchor and draws nothing; the axis does not grow. The text prints as written, ${value} included. It takes id and priority, and no other field. | |
| line | Draws a straight line between two points or from a text annotation, in the ink and rule width of a bracket; a stretch that would cross text is cut. | from, to | from: AnchorRef | { categoryId, value } | { annotationId }; to: AnchorRef | { categoryId, value } | { annotationId } | dashed: boolean, default false. Draws the line in the dash of a reference line. | A point is an anchor or { categoryId, value } with value in axis units. A value outside the plot, a chart with no value scale or an anchor that does not resolve warns bad-anchor and draws nothing; the axis does not grow. An end { annotationId } names a text annotation: the line starts or ends at the nearest edge of that text, at every size, and is not drawn when the text is not. A { categoryId, value } end stands on the category's center. A stretch that would cross text is cut and warns draw-crosses-text. It takes dashed and id, and no other field. |
| arrow | Draws a straight arrow between two points or from a text annotation to a point, in the theme arrow look (marks.arrow); a stretch that would cross text is cut. | from, to | from: AnchorRef | { categoryId, value } | { annotationId }; to: AnchorRef | { categoryId, value } | { annotationId } | dashed: boolean, default false. Draws the shaft in the dash of a reference line. | A point is an anchor or { categoryId, value } with value in axis units. A value outside the plot, a chart with no value scale or an anchor that does not resolve warns bad-anchor and draws nothing; the axis does not grow. An end { annotationId } names a text annotation: the arrow starts or ends at the nearest edge of that text, at every size, and is not drawn when the text is not. A { categoryId, value } end stands on the category's center. A stretch that would cross text is cut and warns draw-crosses-text. It takes dashed and id, and no other field. |
| box | Draws an unfilled box with two points as opposite corners, wrapping whole category bands, in the ink and rule width of a bracket; text inside the box stays free. | from, to | from: AnchorRef | { categoryId, value }; to: AnchorRef | { categoryId, value } | dashed: boolean, default false. Draws the edges in the dash of a reference line. | A point is an anchor or { categoryId, value } with value in axis units. A value outside the plot, a chart with no value scale or an anchor that does not resolve warns bad-anchor and draws nothing; the axis does not grow. from and to are opposite corners, the box has no fill, and text inside it stays free. A { categoryId, value } corner spans that category's whole band, so the box wraps whole bars, values and markers; from and to on one category wrap that category. A stretch that would cross text is cut and warns draw-crosses-text. It takes dashed and id, and no other field. |
Sizing
Floor 480 × 360 px; fit fill. Below 480 px wide or 360 px high, down to the compact floor of 280 × 240 px, the chart draws in compact mode; belowMinimum: 'refuse' refuses there instead.
Below the floor a render is refused with size-below-floor and the pixels it needs. measure returns the natural and comfortable size for a given spec; see Sizing in the manual.
Fixtures
| ID | Kind | Use case |
|---|---|---|
| price-quality-brands | example | Brand scatter: price vs perceived quality, every point labeled |
| price-volume-trend | example | Scatter with a least-squares trend line; the key prints its slope and r² |
| price-quality-trend-by-tier | example | One least-squares trend line per group, each in its group color |
| portfolio-bubbles | example | Bubble portfolio: ROC vs revenue CAGR, bubble = revenue, sector groups |
| dense-40-thinning | torture | Torture: 40 points — labels thin via collision, none overlap |
| cluster-spiral | torture | Torture: three tight clusters force the label spiral outward |
| auto-off-350 | torture | Torture: 350 points auto-disable all point labels |
| dense-paths-6000 | torture | Torture: 6,000 points in two groups draw as one path per group |
| negative-quadrants | torture | Torture: all four quadrants, scenario hollow markers, marker shapes |
| bubble-size-edge-cases | torture | Torture: diameter sizing with zero, missing, and invalid sizes |
| zoom-preserves-bubble-size | torture | Zoom retains source means and bubble sizing |
| scatter-clamped | example | Outliers clipped at the axis edge, thin sites dropped by count |
| growth-share-matrix | example | Strategy matrix: growth-share with declared cut points at 1.0x share and 8% growth |
| risk-impact-likelihood | example | Strategy matrix: 12 risks split at the median of both ratings (even n) |
| torture-quadrant-degenerate | torture | Torture: cut point off-domain collapses the 2x2 to a 1x2, one box holds everything |
| portfolio-nine-box | example | Nine-box portfolio: authored 3×3 cells with axis-band labels |
| competitive-position | example | Competitive-position map with smooth authored strategic contours |
| legend-edge-bubbles | example | Bubble labels at the plot edge under the sector key row |
| option-mean-quadrants | torture | Portfolio positions relative to the mean |
| option-info-grid | torture | An information zone marks the review area |
| option-region-tones | torture | Three regions distinguish operating conditions |
| scatter-compact-380 | example | Scatter in a 380px dashboard column |
| scatter-below-minimum-refuse | torture | belowMinimum refuse on a canvas at the minimum |
| scatter-clamped-both-axes | example | Both axes bounded through clamp.x and clamp.y |
| scatter-clamped-floor | example | A floor and a cap on the vertical axis through clamp.min and clamp.max |
| portfolio-bubbles-key-values | example | A bubble size key showing the authored sizes 8 and 2 |
| portfolio-nine-box-described | example | Strategy-grid cells that carry an accessible description |
| competitive-position-described | example | Polygon regions that carry an accessible description |
| dense-40-first-twenty-labels | torture | At most 20 of the 40 point labels considered by the solver |
| score-vs-cost-log | example | Score vs. cost per task on a log cost axis, with vendor groups and zones |
| log-both-stores-revenue | example | Both axes on a log scale, with median quadrants |
| log-y-under-a-decade | example | A log vertical axis over less than one decade, with a trend and a value line |
| score-vs-cost-frontier | example | Score vs cost with a Pareto line, per-axis tick units and a keyed quadrant |
| coverage-error-frontier | example | Pareto line toward higher coverage and lower error, with a cell captioned and keyed |
| competitive-position-keyed | example | Polygon regions keyed in the legend row, captioned in the plot, or outlined without a wash |
| store-format-markers | torture | Five store formats, one marker each, a label-only peer median |
| selected-labels-only | torture | Only selected points carry visible names |
| callouts-in-notes | torture | Crowded callouts name their note destination |
| story-use-case-matrix | example | Story stepper: an intro and five focus steps over a bubble matrix |