Skip to documentation content

Documentation · Data

Waterfall chart

Write the steps in order. A number is a change on the running total; `total` draws the total so far as a bar of its own.

Open Waterfall chart

When to use it

Explain how a starting value becomes an ending value through the gains and losses in between: a profit bridge, a budget variance or a headcount change.

Begin with a start, write the changes in the order they apply, and end with a total. Subtotals in between are totals too.

Working example

Copy this complete example into the Source tab, then press Generate. Change its labels or values to make your first version.

Tingraph source
waterfall "Operating profit, Q3" {
  y "kUSD"
  "Revenue" 140 start
  "Cost of goods" -30
  "Gross margin" total
  "Administration" -20
  "Other income" 8
  "Operating profit" total
}

Syntax reference

The same reference used by the editor and AI briefing. Syntax is notation-specific; use the keywords listed here.

Chart

SyntaxMeaning
waterfall "Title" {open a waterfall chart

Steps

SyntaxMeaning
"Revenue" 140 starta bar from zero; the running total starts here
"Cost of goods" -30a change: up when positive, down when negative
"Gross margin" totala bar from zero to the running total so far

Bars

SyntaxMeaning
bars horizontalvertical or horizontal

Axes

SyntaxMeaning
x "Caption"caption under the across axis
y "Caption"caption beside the up axis
grid valuenone, value, category, both
range 0 250pin where the value axis runs

Look

SyntaxMeaning
colors colorfulauto, single, colorful, warm, cool, ink
colors "#2a78d6"one colour, pinned
style framedplain, ruled, framed, bold
legend bottomauto, none, right, bottom, top
values onwrite the number on every mark
size 520 340how big the chart is drawn
# commentline comment (also //)

Language rules

  • The file is one waterfall "Title" { ... } block. Nothing may sit outside it.
  • A step is Name 40 (a change, negative for a fall), one per line, in the order the total moves through them.
  • Name total draws the running total so far; it takes no number. Name 140 start sets the running total to that value and draws it from zero.
  • A waterfall is one run of steps: it takes no series or categories lines.
  • Settings are written as name value, in any order, before or after the steps.
  • Do not invent settings. Every one the language has is listed above.

Edit on the canvas

  • Drag a bar's end to change that step; a total cannot be dragged because it is worked out from the steps.
  • Set each step to a change, a total or a start in the chart panel.

Generate replaces the drawing from source. Save before generating again if you want to preserve manual finishing touches.

Read Saving & exporting

Write it with an assistant

Tingraph AI already knows this notation. For another assistant, copy the tutorial below, describe your diagram under MY DIAGRAM, then paste the returned source into the editor. This prompt includes every syntax row, rule and working example above.

Read the complete prompt
You are writing Tingraph source. Tingraph is a small text language that draws a waterfall chart. Answer with Tingraph source only.

SYNTAX
Chart
  waterfall "Title" {         open a waterfall chart

Steps
  "Revenue" 140 start         a bar from zero; the running total starts here
  "Cost of goods" -30         a change: up when positive, down when negative
  "Gross margin" total        a bar from zero to the running total so far

Bars
  bars horizontal             vertical or horizontal

Axes
  x "Caption"                 caption under the across axis
  y "Caption"                 caption beside the up axis
  grid value                  none, value, category, both
  range 0 250                 pin where the value axis runs

Look
  colors colorful             auto, single, colorful, warm, cool, ink
  colors "#2a78d6"            one colour, pinned
  style framed                plain, ruled, framed, bold
  legend bottom               auto, none, right, bottom, top
  values on                   write the number on every mark
  size 520 340                how big the chart is drawn
  # comment                   line comment (also //)

RULES
- The file is one `waterfall "Title" { ... }` block. Nothing may sit outside it.
- A step is `Name 40` (a change, negative for a fall), one per line, in the order the total moves through them.
- `Name total` draws the running total so far; it takes no number. `Name 140 start` sets the running total to that value and draws it from zero.
- A waterfall is one run of steps: it takes no `series` or `categories` lines.
- Settings are written as `name value`, in any order, before or after the steps.
- Do not invent settings. Every one the language has is listed above.

WORKED EXAMPLE
waterfall "Operating profit, Q3" {
  y "kUSD"
  "Revenue" 140 start
  "Cost of goods" -30
  "Gross margin" total
  "Administration" -20
  "Other income" 8
  "Operating profit" total
}

OUTPUT
- Reply with one fenced code block and nothing else.
- The block starts with `waterfall "…" {` and ends with `}`.
- Do not invent keywords: use only the ones listed above.
- Keep labels short enough to read inside a box, and keep every ID unique.

MY DIAGRAM
Describe what you want here, then send this message.
How AI requests, attachments and privacy work

Something unclear? Contact support or read the Privacy Policy.