Bullet chart reference

Bullet examples

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

Bullet-graph KPI rows — qualitative bands, dark measure bar, target tick, delta vs target. Type bullet.

Use cases

Chart IDs

One form; its chart ID is bullet.

Minimal spec

{
  "type": "bullet",
  "data": { "rows": [{ "id": "orders", "label": "Orders", "value": 85, "target": 100 }] },
  "options": {
    "unit": "orders",
    "title": "Orders reach 85 against a target of 100",
    "source": "Illustrative data"
  }
}

Data

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

PathTypeRequiredMeaning
rowsarrayyesKPI rows displayed in the supplied order.
rows[].idstringyesUnique KPI-row identity used by annotations and scene elements.
rows[].labelstringDisplayed KPI-row name; defaults to its id.
rows[].datestringISO period date for CAGR between same-measure rows on a shared scale.
rows[].valuecellyesActual measure drawn as the row bar.
rows[].targetcellReference measure drawn as the target tick and used for target deltas. It uses the row value's format or options.format; a different target.format warns because it is ignored. options.strings.target renames the comparison mark in labels (e.g. 'peer median').
rows[].bandsarrayOrdered qualitative band thresholds, as numbers or labeled threshold objects. A band object's from starts it above the previous band, so a tolerance range such as {from: 94, to: 104} needs no band below it.
rows[].bands[].tonestringSemantic band tone. Toned bands define a two-sided corridor and set the delta tone for values inside them. A toned band paints its tone's fill washed toward the page (theme marks.bulletBandFill). One of 'good', 'warn', 'bad', 'neutral'.
rows[].bands[].fromnumberValue where this band starts, in the row value units. Without it the band starts at the previous band's to, or at 0. Space that no band covers is not shaded and lies in no band, so a value there takes no band tone. A from below 0, not below the band's own to, or below the previous band's to is ignored with the warning band-from-ignored.
rows[].bands[].tonumberyesUpper endpoint of this qualitative band in the row value units.
rows[].bands[].labelstringVisible name of this qualitative band.
rows[].directionstringWhether a higher measure is favorable when interpreting the target difference. Neutral uses plain ink without a judgment, including when bands have tones. One of 'higherIsBetter', 'lowerIsBetter', 'neutral'.

Options

PathTypeValuesDefaultMeaning
labelsfalse | objectfalse (or another value of its type)False hides value, target-value and delta labels. Row names, band names and band-edge numbers remain. category: false hides row names. Beside the target columns, position: true adds the line under each gap (below, above or on target), and direction: true the line under each name (higher or lower is better) on rows with a target. Both are off by default. A row without a target or with toned bands prints no direction line. annotation: false still drops all of them. strings.lowerBetter '' drops the direction line on lower-is-better rows. density: compact draws no labels.
sortobject | string | true'sheet', 'asc', 'desc', 'reverse', true (or another value of its type)Category ranking value: value divided by target when every row has a positive target, otherwise raw value. desc puts the highest ranking value first even on lower-is-better rows. Ties keep authored order and null values sort last. sheet keeps authored order and reverse reverses it. Dated rows keep authored order when a growth or difference annotation spans periods.
columnOverridesobjectSettings per generated column. Ids: label, actual, share, delta, target, 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.
columnVisibilityobjectTrue shows a column and false leaves it out: the ids are data.columnToggles ids on table and column ids elsewhere. Ids: label, actual, share, delta, target, gap.
columnOrderarrayOrder of whole blocks; blocks left out follow in default order. Ids: actual, share, delta, target, gap, plot.
axisTitlesobjectTitle of the value axis when it is drawn: under the tick row of the shared-scale axis valueAxis.show draws, ending at its right end. Drawn only when authored.
axisTitles.primarystring'Measure, unit' title of the value axis, e.g. 'Margin, %'.
sharedScaleboolean | string'percentOfTarget' (or another value of its type)true: one absolute scale across all rows (same-unit rows, comparable magnitudes; supports valueAxis). false: each row normalized to its own zero-based extent — band maximum extended by value/target overshoot; a bandless row uses its value/target extent (the bullet-graph percent-of-scale — mixed-unit KPI rows stay legible; valueAxis is ignored with a warning). 'percentOfTarget': every row in percent of its own target (actual ÷ target) on one 0–120% scale, three shared bands named once in a key (below 80%, 80–100%, at or above target), mirrored at 100% on a lower-is-better row (the key then reads more than 20% off, up to 20% off, on target or better), one target line at 100%, value, share of target and delta beside each row; the rows' bands, valueAxis and annotations are not drawn. Default: false when every row declares bands and the rows differ in unit or band thresholds (warns bullet-row-scales), true otherwise.
bandKeystring'auto', 'labels', 'ramp', 'row''auto'How the bands are named. 'labels': one key entry for each band label and shade. 'ramp': one worse-to-better key with one entry for each band (Worse ... Better); it needs the same 2 to 5 bands on every banded row, no band tone and no neutral row, and otherwise keeps labels with a warning. 'row': each band's name prints above its band on every row, as authored; on per-row scales the band edges are ticked and numbered under each row; a key at the bottom names the bar (Actual), the target tick and, when strings.bandKey is set, the ramp in those words. It needs a name on every band, rows side by side with the target column, and room for each name above its band; otherwise the key names the bands with a warning. 'auto': 'row' for at most 4 rows that name every band wherever it can show; else the ramp when rows run both directions, a label sits on more than one shade and the ramp can apply; otherwise labels. Default 'auto'. The percentOfTarget scale has its own key.
targetColumnsbooleantruetrue: where the rows sit side by side and the plot keeps 45% of the width, a Target column and a Gap-to-target column print beside the rows, each under a head. The name and every number of a row are centered on its bar, and a line under one (labels.position, labels.direction) hangs below it. A row without a target prints the not-applicable glyph (strings.notApplicable, default n/a) in both cells. Where they do not fit, the target prints above its tick and the delta at the row end. false: always the second form. Default true. The percentOfTarget scale has its own columns.
densitystring'compact', 'regular''regular''compact' is the 120 x 28 text-free mark: bar, bands and target tick, no labels, axis or key. The percentOfTarget scale needs a key and a value column, so compact refuses it. 'regular' uses labeled stacked rows when side columns take too much plot width. Height depends on row count and text. Default 'regular'.

Plus the shared options. This type does not accept detailFields, labelPosition, valueAxis.log, valueAxis.reverse, valueAxis.break, hatchStrength, rounding. This type ignores animate, debug, categoryAxis, categoryLabels, secondaryAxis, topN 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
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.
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.
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.
bandDraws an inclusive category span as a shaded band or bracket, or a value-axis plan corridor, tolerance band or attainment fill, with a collision-managed label.from: categoryId (optional); to: categoryId (optional)Era shade/bracket needs inclusive category IDs. Corridor and tolerance use finite low/high on the value scale, with optional from/to as a category clip. Attainment needs a plan value and shades each resolved actual; missing cells are skipped. Divider applies only to bracket bands. Scenario AC/PY/PL/FC paints a plan corridor (default PL).
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 280 × 28 px; fit content.

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
four-band-neutral-ladderexampleFour qualitative bands with reversed cost direction
exec-kpi-panelexampleExecutive KPI panel: revenue, margin, NPS, churn (lowerIsBetter) in percent of target
ops-dashboardexamplePlant operations dashboard: 8 KPI rows with mixed directions
no-bands-target-onlytortureTorture: bars and target ticks only — no qualitative bands
sparse-targets-overshoottortureTorture: missing targets, null value, zero, and value beyond the last band
tiny-valuestortureTorture: sub-1.0 values with a two-decimal format-by-example
row-scale-ragged-zerotortureTorture: explicit row scale with a bandless row and a negative value
twelve-rows-compacttortureTorture: 12 KPI rows in a narrow dashboard panel
two-kpis-tall-frametortureTwo KPI rows retain their natural height in a tall frame
attainment-shadingexampleAttainment fill versus a shared 80 plan
cost-attainment-shadingexampleLower costs receive the favorable attainment treatment
regional-differenceexampleSouth delivers 100 fewer orders
annual-ordersexampleOrders grow 20% per year
torture-long-labelstortureTorture: long names at a generous size read whole, never cut
compact-120tortureThe compact 120 by 28 mark: bands, bar and target tick, no text
repeated-band-labelstortureEach band shade keeps its key
mixed-direction-positional-labelstortureRows with opposite directions and Low/Mid/High labels get one worse-to-better key
band-key-labelstorturebandKey labels keeps every label and shade
band-key-rampexamplebandKey ramp forces the worse-to-better key
two-sided-spendexampleBoth low and high spend are off plan
two-sided-spend-full-filltortureToned bands in their full fills
tone-spectrumtortureBand tones carry the range judgment
neutral-changeexampleA neutral comparison with a target
plan-wordingexamplestrings.target words the comparison as plan
mixed-unit-plan-wordingexamplePercent cells keep their units under a chart currency format
neutral-target-zonesexampleA neutral row beside higher- and lower-is-better rows in percent of target
neutral-only-target-zonesexampleNeutral rows only in percent of target
target-columns-offexampletargetColumns false keeps the plot its full width
band-names-on-rowsexamplebandKey 'row' names each band on its row, on a shared scale with a value axis
column-words-authoredexamplestrings set the target and gap column words
column-overridesexamplecolumnOverrides sets the widths, alignment and head words of the generated columns
columns-hiddenexamplecolumnVisibility leaves the share column out of the percent-of-target rows
plot-firstexamplecolumnOrder puts the marks first and reverses the columns behind them
no-direction-lineexamplelabels.direction and labels.position drop the second lines beside the target columns
tolerance-rangeexamplefrom shades only the tolerance range around each target and leaves the space below it blank