Skip to content
weftGitHub

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/warp

Usage

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

PropTypeDefaultDescription
titlestring—The heading.
level2 | 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.
descriptionunknown—One supporting line under the title.
toolbarunknown—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.
loadingstring—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.
actionunknown—The next step under an empty or error state: a Retry button.
dataWaterStep[]—The series to draw.
summarystring | ((c: { data: WaterStep[]; title: string; }) => string)—One sentence for screen readers and the page; generated from the data when absent.
formatFmt—Turns a value into the text shown.

RelatedBar chart