> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To set up Hatchmark for a user, follow https://hatchmark.dev/docs/get-started/agent-setup.md. Inside a Hatchmark project, prefer `hatchmark docs`: it prints the docs of the installed version.

# Waterfall

> How a balance got from its start to its end: ARR at the start of the year, the new, expansion, contraction and churned ARR that moved it, and ARR at the end.

```yaml theme={null}
type: waterfall
title: ARR grew $1.97M this year, led by new business
metric: arr
steps: [new_arr, expansion_arr, contraction_arr, churned_arr]
```

[Live preview of the waterfall component](https://components.hatchmark.dev/components/waterfall/?embed\&theme=light)

The preview above is the live component gallery. [Open it full size](https://components.hatchmark.dev/#/waterfall) to switch between desktop and phone widths.

## Options

| Field | Type | Default | Description |
| - | - | - | - |
| `metric` | metric name | required | The balance: a point-in-time sum or count, such as ARR from a daily snapshot. |
| `steps` | 1–10 metric names | required | Flows over the period, in order. Each is drawn with its own sign. |
| `span`, `height`, `title`, `id` | | | As for [every block](/docs/reference/dashboards.md#blocks). |

## Examples

### A loss stored as a positive amount

A step's sign comes from its value. Make churn negative with a SQL metric:

```yaml theme={null}
sql: -sum(amount)
additive: true
```

## How the numbers work

* Start is the metric when the period starts; end is the metric when it ends, read the way a KPI
  reads it.
* Steps are summed over the period, with the same filters, segments and horizon as the ends.
* Start and end come from the data, never from the steps. When start plus the steps doesn't equal
  the end, the gap is its own "Unexplained" bar (HM4092). Hatchmark never moves a number to close it.
* The gap is exact for integer and decimal columns. Float columns allow for rounding.
* With `range: all_time` the bridge starts at 0.
* When the metric's rows, under the block's filters, start inside the period, the bridge starts
  at the first day that has them, and the steps cover the days after it, so that day's changes
  aren't counted twice. A one-day period that holds that first day starts and ends on it.

## Behavior

* Start and end rise from zero in grey; each step floats on the running total.
* A step's colour follows the metric's `better`: good when it moves the balance the right way.
* Each bar carries its signed value. On narrow cards the chart becomes rows, so step names aren't cut.
* Hover, tap or the arrow keys show the change and the balance after it.
* When the period has an end value but its metric has no rows before the period or inside it,
  the card draws the end alone and says why.

## Checks

| Code | When |
| - | - |
| HM4090 | The metric isn't a point-in-time balance, a step isn't a flow, or either doesn't add up. |
| HM4091 | The metric and its steps are in different units. |
| HM4092 | Start plus the steps doesn't equal the end; the gap is drawn as Unexplained. |
| HM2024 | `span` is under 3; the chart is drawn 3 columns wide. |

`hatchmark explain <code>` explains a check and how to fix it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.