Waterfall chart reference

Waterfall examples

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

Contribution-to-change bridge with computed totals, connectors, and delta labels. Type waterfall. Aliases: bridge.

Use cases

Design

Message: What moved a number from A to B: the steps between an opening and a closing total.

Use when: An opening and a closing value exist and the steps add up to the change, such as an EBIT bridge, a cash walk or budget to actual.

Not when: The steps are shares of different wholes (column stacked100); two values only (column with a diff annotation); the steps have no business order (bar sorted by value).

design-waterfall-closing-total

End the bridge on a total, so the reader does not have to add up the steps. Render checks this rule and returns the warning design-waterfall-closing-total with severity advice. A fix patch is included only when it can apply to the input as sent; otherwise follow suggest, for example when waterfall items come from rows.

design-waterfall-order

Keep the steps in their business order, such as the P&L order; sort by size only when the message is a ranking. This rule needs the author's judgment; render does not check it.

design-waterfall-horizontal

Turn the bridge horizontal when the step names do not fit upright under the columns: rotated, cut or skipped names are hard to read. Render checks this rule and returns the warning design-waterfall-horizontal with severity advice. A fix patch is included only when it can apply to the input as sent; otherwise follow suggest, for example when waterfall items come from rows.

design-waterfall-cost-direction

In a cost bridge, set items[].direction to lowerIsBetter, so a rising cost paints bad. This rule needs the author's judgment; render does not check it.

design-waterfall-few-steps

Show about eight steps or fewer; fold the small ones into one Other step at a place that keeps the business order. This rule needs the author's judgment; render does not check it.

design-waterfall-subtotals

Add a subtotal where the business reads one, such as gross profit before overheads, so a long bridge reads in parts. This rule needs the author's judgment; render does not check it.

Chart IDs

Minimal spec

{
  "type": "waterfall",
  "data": {
    "items": [
      { "id": "start", "label": "Prior", "type": "total", "value": 100 },
      { "id": "growth", "label": "Growth", "value": 25 },
      { "id": "cost", "label": "Cost", "value": -10 },
      { "id": "end", "label": "Current", "type": "total", "value": 115 }
    ]
  },
  "options": {
    "unit": "$k",
    "title": "Growth offsets cost to lift revenue by $15k",
    "source": "Illustrative data"
  }
}

Data

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

PathTypeRequiredMeaning
itemsarrayyesOrdered bridge items; order sets accumulation and positions. Rows: label,value; optional type (delta|subtotal|total).
items[].idstringyesUnique bridge-item identity used by connectors and annotations.
items[].labelstringDisplayed bridge-item name; defaults to its id.
items[].typestringDelta contribution by default; subtotal and total show accumulated levels. One of 'delta', 'subtotal', 'total'.
items[].valuecellSigned delta contribution, or an optional check value for a subtotal or total. A check value off the running sum by more than its inputs' rounding warns derived-mismatch, and the sum is drawn. A check value off by less is disclosed: the sum is drawn, the info check-value-rounded names both numbers, and a disclosure note names them where notes.show lists 'disclosure'. An opening total with segments opens at their sum, and its value is a check value against that sum. An opening total without a value or segments is derived backward from the next total that has one across plain deltas, and refused otherwise.
items[].segmentsarrayNamed signed contributions composing this item instead of a single value. On a total or subtotal they stack as its breakdown, with their values and in the key: a later total draws them when they add up to its level, and otherwise draws its level as one bar and warns derived-mismatch. Authored segments win over the ones a closing total derives from segmented steps.
items[].segments[].idstringyesSegment identity within its waterfall item; also names connector anchors. One id is one segment across the bridge: its first authored label, colorRole and value fill paint all its bars, its key entry and its part of a derived total, and a later item that sets another one warns segment-identity-mismatch.
items[].segments[].labelstringDisplayed segment name; defaults to its id.
items[].segments[].valuecellyesSigned contribution of this segment to its item.
items[].segments[].colorRolestringTheme color role for this segment. 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.
items[].segments[].scenariostringAC, PY, PL, FC (or ACT, BUD, FCST, LY for last year). Codes and aliases accept any case. Scenario controlling this segment paint convention.
items[].datestringISO 8601 date associated with this bridge item.
items[].scenariostringAC, PY, PL, FC (or ACT, BUD, FCST, LY for last year). Codes and aliases accept any case. Scenario for this bridge item and its default segment styling.
items[].directionstringUnder 'lowerIsBetter' a rise paints bad and a fall good (options.signColor). One of 'higherIsBetter', 'lowerIsBetter'.
items[].colorRolestringA step without segments: the theme color role its bar paints in, in place of the step or sign color, as a segment takes one; neutralLight gives a gray step. Its value keeps labelPosition. A total, a step with segments and a bridge with cases take no colorRole. 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.
items[].toBaselinebooleanStart this delta at zero and reset the accumulated contribution list. A subtotal draws the sum of the deltas since the last total or baseline subtotal, from zero; the running level carries on.
items[].valuescell[]With data.cases: one value per case, in case order, in place of value — the signed delta of each case, or a total's opening or check value.
connectorsarrayAuthored connections between item levels; omission uses the default sequence.
connectors[].fromstringyesSource waterfall item id.
connectors[].tostringyesDestination waterfall item id.
connectors[].anchorstringConnect at the item sum or a named segment boundary. One of 'sum' (or another value of its type).
connectors[].hiddenbooleanHide this connector and start a new summation at the destination.
casesarrayTwo or three cases of the same bridge side by side in each step (scenarios): each item gives values, one per case, and each case runs its own levels in its own color, named in the key. Case bars draw no connectors, since a line to a case's next bar would cross the other case's bar; items take no value or segments, and data.connectors is refused. Under variant 'horizontal' each step's case bars stack in its row.
cases[].idstringyesCase identity without ':', which joins it to an item id ('<item>:<case>'); an annotation anchor names it as seriesId.
cases[].labelstringDisplayed case name in the key; defaults to the id.

Options

PathTypeValuesDefaultMeaning
legendstring | object'top', 'bottom', 'right', 'left', 'none', 'auto' (or another value of its type)Key position. Segment, case and scenario encodings keep their key because numeric bar labels do not name them. With these encodings, 'none' retains the key and reports waterfall-legend-required. A plain bridge keys its sign colors only when a lowerIsBetter step inverts them.
axisTitlesobjectAuthored primary value-axis title above the vertical plot, using column title styling. Waterfall draws no value ticks. Horizontal mode accepts this key but does not print it.
axisTitles.primarystring'Measure, unit' title of the value axis, e.g. 'Margin, %'.
variantstring'vertical', 'horizontal'Left out: vertical columns, turned into a horizontal bridge when the step names would rotate, shorten or drop, the horizontal bridge draws without a new finding, and the spec has no cases and no annotations. 'vertical' always keeps columns. A horizontal bridge draws no annotations: an old spec draws without them and warns option-ignored, so use vertical for annotations.
buildstring'up', 'down''up'Build label in the accessible description; defaults to up. Item types and signed values determine accumulation in both modes.
signColorbooleanPaint each plain step good or bad by sign × item direction, as column's signColor; zero is neutral. Default true unless the theme sets marks.bridge or a palette is named; false paints steps neutral. colorblindSafe paints signed steps, labels and key swatches with the theme's color-blind pair.
bracketRowstring'shared', 'span'Where the step brackets stand. 'shared' (default): all brackets of the bridge on one row, the lowest row that clears every bracketed span and its values. 'span': each bracket right above its own steps and their values. Either way a bracket moves to the top row where its seat is taken.
columnOverridesobjectHorizontal bridge only: width in px of the name band (label) and the value band (value). With variant 'vertical' it is refused. Left out, the variant is chosen without it, and a bridge that draws vertical warns option-ignored.
columnOverrides.*.widthnumberTrack width in px. It beats the width the type would pick.

Plus the shared options. This type does not accept detailFields, labels, valueAxis.min, valueAxis.max, valueAxis.tickStep, valueAxis.includeZero, valueAxis.percent, valueAxis.log, valueAxis.reverse, rounding. This type ignores animate, debug, rowLabels, categoryAxis, categoryLabels, secondaryAxis, sort, topN, valueAxis.show, valueAxis.gridlines 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
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.
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.
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.
notePlaces authored text at an anchored data element through collision avoidance, with an optional icon or status chip.at, textat: AnchorRef
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.
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. 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.
absReads the anchored data value and places its formatted absolute value in a collision-managed label.atat: AnchorRef
bracketDraws a bracket over an inclusive span of steps and prints the sum of their values, after an optional label.from, tofrom: categoryId; to: categoryIdlabel: string. Name printed before the sum, "Commercial +81". Without it the bracket prints the sum alone.from and to are step ids, inclusive. The engine adds the steps up and prints the signed sum; every step in the span must be a delta, so a span that holds a total is refused with bracket-span-total. A step the bridge cannot add (an open start) refuses it with bracket-span-no-value. Brackets stand in one row above the steps. Vertical bridges only.
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 × 270 px; fit fill. Below 270 px high, down to the compact floor of 280 × 180 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
ebit-bridgeexampleEBIT bridge FY21→FY24
interview-status-buildupexampleInterview pipeline build-up by status
revenue-build-upexampleRevenue → EBIT build-up with diff arrow
step-bracketsexampleBrackets over bridge steps print their sums
step-brackets-spanexamplebracketRow 'span' stands each bracket right above its own steps
total-change-bracketexampleThe total change runs as the growth bracket over the step brackets
callout-label-offsetexamplelabelOffsets moves a callout up from its step
bracket-low-stepsexampleA bracket stands directly above low steps
build-downexampleBuild-down: revenue to net income
whole-axis-opt-outexampleWhole value axis kept with an explicit false
automatic-axis-breakexampleExplicit automatic break makes small steps on a large base easier to compare
sliver-segmentstortureTorture: sliver values between giants
zero-crossingtortureTorture: running level crosses zero
long-labels-many-itemstortureTorture: 12 items, verbose category labels
single-deltatortureTorture: minimal two-item bridge
mixed-sign-segmentstortureTorture: one item with positive and negative segments
segment-cascade-horizontalexampleSeven-row horizontal cascade ends at the computed total
horizontal-net-negativetortureTorture: a horizontal mixed-sign cascade closes below zero
horizontal-pure-negative-tinytortureTorture: pure-negative tiny magnitudes remain visible horizontally
ebit-bridge-fullexampleSplit waterfall labels in full mode
ebit-bridge-compactexampleSplit waterfall labels in compact mode
torture-long-labelstortureTorture: long names at a generous size read whole, never cut
sign-bridgeexampleEBIT bridge with sign-colored steps from marks.bridge
cost-bridge-lower-is-betterexampleCost bridge: a rise paints bad and a saving good under lowerIsBetter
neutral-stepsexamplesignColor false keeps every step in the neutral
two-case-budget-bridgeexampleTwo cases side by side in each step: a conservative and an aggressive budget
two-case-budget-barsexampleThe two-case bridge as bars: each value stands past the end of its own bar
single-segment-authored-formatexampleOne segment prints one value at the authored precision
repeated-segment-keytortureEqual segment names and colors share one key
column-overridesexampleA horizontal bridge with authored name and value bands
centered-valuesexampleCentered bridge values with a thin falling step
horizontal-centered-valuesexampleCentered horizontal bridge values
sign-inside-valuesexampleInside values on signed bridge fills
grey-stepsexampleGray steps with their values inside