Dot and dumbbell chart reference

Dot and dumbbell examples

Contents: Use cases, Chart IDs, Minimal spec, Data, Options, Annotations, Sizing, Fixtures.

Position-encoded item comparison — Cleveland dots, dumbbell ranges with derived gaps, or lollipops. Type dot. Aliases: cleveland, dumbbell, lollipop.

Use cases

Chart IDs

Minimal spec

{
  "type": "dot",
  "data": {
    "categories": [{ "id": "north", "label": "North" }, { "id": "south", "label": "South" }],
    "series": [{ "id": "revenue", "label": "Revenue", "values": [120, 90] }]
  },
  "options": { "unit": "$k", "title": "North revenue exceeds South by $30k", "source": "Illustrative data" }
}

Data

A cell is a number, null or a value object; see Value cell.

PathTypeRequiredMeaning
valueKindstringDefault valueKind for all series. One of 'fraction'.
categoriesarrayyesCategories defining the dot-chart rows.
categories[].idstringyesCategory identity used to match keyed values and annotation anchors.
categories[].labelstringDisplayed category name; defaults to the category id and supports line breaks. A date id or date without a label prints a short date such as '4 Sep'.
categories[].datestringISO 8601 date associated with the category.
categories[].footnoteinteger1-based reference into options.footnotes. The number is drawn beside this category label as the reference mark, and the note it points at keeps that number; a reference to no note draws nothing and warns, and notes the engine derives print unnumbered.
seriesarrayyesValues and optional ranges to compare across each category row.
series[].valueKindstringMultiply numbers by 100 into pct cells; explicit pct cells stay in percent units. One of 'fraction'.
series[].idstringyesSeries identity used by keyed options, annotations and legend entries.
series[].labelstringDisplayed series name; defaults to the series id. The hover card names each value with it ("North: 65.8").
series[].values(cell | { categoryId, value: cell })[]yesValues in category order, or keyed entries pairing a categoryId with its value.
series[].scenariostringAC, PY, PL, FC (or ACT, BUD, FCST, LY for last year). Codes and aliases accept any case.
series[].directionstringDeclared preference for higher or lower values in directional comparisons. One of 'higherIsBetter', 'lowerIsBetter'.
series[].rolestringDeclares a plotted data series or a comparison reference series. One of 'data', 'reference'.
series[].colorRolestringTheme color role used for this series when no explicit fill takes precedence. 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.
series[].fillstringExplicit CSS fill color for this series; remains authored across theme changes.
series[].unitstringUnit of this series' values. Without a format example, a $k, $m, k or m unit prints its labels whole from 100 up, in place of options.unit.
series[].formatstringFormat-by-example for this series' labels, for example 1,234 or 1.2%. Overrides options.format; a cell format overrides it.

Options

PathTypeValuesDefaultMeaning
legendstring | object'top', 'bottom', 'right', 'left', 'none', 'auto' (or another value of its type)Key position. Multiple series get a key by default unless visible direct labels name them. 'none' hides the key; unnamed series warn.
topNobject | integerKeep the n largest categories by absolute first-series value, or absolute gap for dumbbell, before sorting. Kept categories retain authored order unless sort.categories reorders them. No Others row is drawn; omitted category names are disclosed. Authored rest: true, restLabel, showRestCount or threshold warns that it is ignored when categories are omitted.
columnOverridesobjectSettings per generated column. Ids: label, gap.
columnOverrides.*.widthnumberTrack width in px. It beats the width the type would pick.
columnOverrides.*.alignstring'left', 'right', 'center'Alignment of the column: its cell text and, unless headAlign is set, its head. Bars keep starting at the panel origin.
columnOverrides.*.headAlignstring'left', 'right', 'center'Head alignment; defaults to align.
columnOverrides.*.labelstringHead text.
axisTitlesobjectTitle of the value axis when it is drawn: under the value-axis tick row, ending at the right edge of the plot. Drawn only when authored.
axisTitles.primarystring'Measure, unit' title of the value axis, e.g. 'Margin, %'.
variantstring'dot', 'dumbbell', 'lollipop''dot'Dot by default; dumbbell joins paired values and lollipop joins values to the baseline.
averageMarkerboolean | objectComputed dashed average rule with a solver-placed Ø label, as on bar and column: the mean of every dot of the series in scope ('all' by default, or the listed series).
averageMarker.scopestring | array'all' (or another value of its type)Series included in the computed average; defaults to 'all'.
arrowbooleanDumbbell only: an arrowhead at the second series' dot shows the direction of change. The connector is painted good or bad by the sign of the change when the second series declares direction, neutral otherwise; a pair whose dots nearly touch keeps a plain connector.
gapColumnbooleanDumbbell only: prints the gap, second series minus first, signed in a column right of the plot under a head such as 'Gap, pp' (pp for percent values). A highlighted row prints bold. Default false. The column stays off below 576 px canvas width.
methodNotebooleanDefault false. true adds the method footnote that names the marker inside a range as its supplied mid-point. A supplied range.mid is drawn and keyed either way.
rangeobjectWhat the drawn ranges are: their key entry and, on request, their bounds as numbers.
range.labelstringThe key entry for the drawn ranges, naming the interval, for example 'Peer range, min to max' or 'Interquartile range'. Default 'Range'.
range.valuesbooleanDefault false. true prints each range's low and high value beside its caps.
range.midLabelstringThe key entry for the open marker that draws each supplied range.mid, for example 'Peer midpoint'. Default 'Midpoint'. When only some rows carry a mid, a note names the others.

Plus the shared options. This type does not accept labelPosition, valueAxis.log, valueAxis.reverse, valueAxis.break, hatchStrength, rounding. This type ignores animate, debug, categoryAxis, categoryLabels, secondaryAxis 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.

KindPurposeRequiredAnchorsOptional fieldsNotes
valueLineDraws 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. 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. attainment: boolean | { seriesId, direction }. Shades each category between its actual and the line.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.
calloutPlaces authored free text at an anchored data element, routing a leader when displaced and honoring the preferred side.at, textat: AnchorRefpreferSide: 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.
notePlaces authored text at an anchored data element through collision avoidance, with an optional icon or status chip.at, textat: AnchorRef
deltaComputes the signed difference between an anchored value and another anchor or literal, then places a collision-managed label at the first anchor.at, vsat: AnchorRef; vs: AnchorRef | numbermode: 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.
absReads the anchored data value and places its formatted absolute value in a collision-managed label.atat: AnchorRef
diffDraws a level-difference arrow between two anchors and computes either percent change or their signed value difference.from, tofrom: AnchorRef; to: AnchorRefmode: 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. The arm follows the horizontal value axis and clears the connector.
cagrDraws a growth arrow between two anchored points and computes the compound annual growth rate from their values and ISO-date span.from: AnchorRef (optional); to: AnchorRef (optional)suffix: string, default 'p.a.'. Text after the rate. period: boolean. Print the period before the rate from the anchors' category labels, '2014–2019: +5.8% p.a.'. Default true when the chart carries two or more CAGRs, so nested brackets are told apart by their text, false otherwise. An arrow's ends show its span, so an arrow prints the rate alone unless period is true. shape: bracket | arrow, default bracket. arrow draws one straight arrow over the marks with the rate in an oval on it, lifted until it clears them. Where no straight line clears the chart, the span is too short for the oval, a stack's inner layer is the anchor or the chart lays comparisons out itself, it draws the bracket and warns cagr-arrow-no-room.Omitted endpoints span the first to the last category, or the first to the last total on a waterfall. Resolved endpoints need a positive date interval from ISO dates or year-bearing labels and a positive start value; an end of zero reads -100%, and a start at or below zero or a negative end omits the rate and warns cagr-undefined. On a continuous time axis the years are the exact span between the two readings. An anchor on one series of several (seriesId, or a category of an unstacked line, which reads the first drawn series; on a stack a category reads the stack total) names that series in the label, "Product B +10.1% p.a.", and the arm runs from that series' segment or point. In text, ${value} prints the rate with its suffix, so "CAGR 2014–2019: ${value}" keeps the computed number.
textPlaces 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, textat: 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.
lineDraws 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, tofrom: 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.
arrowDraws 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, tofrom: 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.
boxDraws 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, tofrom: 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 × 270 px; fit fill. Below 480 px wide or 270 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

IDKindUse case
dot-range-benchmarkexampleBenchmark dots with peer-range bands
share-shift-dumbbellexampleDumbbell peer range: market share 2019 vs 2024 by country, sorted by gap
share-shift-arrowexampleDumbbell arrows: the change from 2019 to 2024, painted by its sign against the declared direction
nps-dot-rankingexampleCleveland dot ranking: NPS by business unit (non-zero baseline info)
audit-findings-lollipopexampleLollipop counts: audit findings by plant
sixteen-rows-two-seriestortureTorture: 16 rows × 2 grouped dot series at smart density
zero-gap-dumbbelltortureTorture: dumbbell with identical and near-identical values — touching dots merge into one «a → b» label
long-labels-lollipoptortureTorture: verbose category labels pass the 28% band cap and widen the band
negatives-with-axistortureTorture: negative values with a gridlined value axis and zero baseline
range-extremestortureTorture: zero-width and far-outside dot ranges
torture-long-labelstortureTorture: long names at a generous size read whole, never cut
average-marker-lead-timesexampleCleveland dots with the average of every dot as a dashed Average rule
nps-rows-leftexampleThe NPS ranking with its row labels aligned left
highlighted-dumbbell-keytortureActual and plan remain distinct
fraction-reference-linetortureA fraction target shares the percentage scale
column-overridesexamplecolumnOverrides sets the widths, alignment and head word of the name and gap columns