WaterfallChart
Shows how a starting total became an ending one, step by step.
SourcePackage @weft-js/warp
Preview
tsx
import { WaterfallChart } from '@weft-js/warp'export function Seats() { return ( <WaterfallChart title="Paying seats, Q3 to Q4" description="What moved the count" data={SEATS_BRIDGE} /> )}const SEATS_BRIDGE = [ { name: 'Q3', value: 820, total: true }, { name: 'New teams', value: 210 }, { name: 'Expansion', value: 96 }, { name: 'Contraction', value: -38 }, { name: 'Churn', value: -74 }, { name: 'Q4', value: 1014, total: true },]Installation
npm install @weft-js/warpUsage
tsx
import { WaterfallChart } from '@weft-js/warp'<WaterfallChart title="Paying seats, Q3 to Q4" description="What moved the count" data={SEATS_BRIDGE} />Accessibility
- Every chart has a text alternative and a table view of its numbers, so nothing depends on seeing the marks. See Chart for its keyboard support.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | — | The heading. |
level | 2 | 3 | 4 | 6 | 5 | — | The title's heading level: one below the heading the chart sits under. Default 3, a chart in a page section. |
description | unknown | — | One supporting line under the title. |
toolbar | unknown | — | Beside the view toggle: a layout switch, a range picker. |
state | "error" | "loading" | "empty" | — | Replaces the plot, in the same frame. With no data the frame shows empty on its own. |
loading | string | — | Shows that work is under way. |
empty | { title: string; detail?: unknown; } | — | The title and detail shown in place of the plot when there is no data. |
error | { title: string; detail?: unknown; } | — | A message that marks the field invalid and says why. |
action | unknown | — | The next step under an empty or error state: a Retry button. |
data | WaterStep[] | — | The series to draw. |
summary | string | ((c: { data: WaterStep[]; title: string; }) => string) | — | One sentence for screen readers and the page; generated from the data when absent. |
format | Fmt | — | Turns a value into the text shown. |
RelatedBar chart