Skip to content

Waterfall Chart ^0.1.17 ​

Visualize cumulative change across a sequence of positive and negative contributions. Perfect for P&L breakdowns, budget variance, and cash-flow analysis.

Basic ​

Each bar represents a change. Connectors between tops show the running total.

-50.04271.33592.7914.061.2k1.6k1.0k+350-180+220-900StartGain 1Loss 1Gain 2Loss 2End
vue
<VxWaterfallChart
  :data="[
    { label: 'Start',  value: 1000, type: 'total' },
    { label: 'Gain 1', value: 350 },
    { label: 'Loss 1', value: -180 },
    { label: 'Gain 2', value: 220 },
    { label: 'Loss 2', value: -90 },
    { label: 'End',    value: 0, type: 'total' },
  ]"
/>

Quarterly P&L ​

-6.5935.7278.03120.34162.65204.96120+45+18-8-140StartNew salesUpsellRefundsChurnEnd
vue
<VxWaterfallChart :data="quarterlyPnl" />

Revenue breakdown with subtotals ​

Use type: 'subtotal' to anchor the running total at that point.

-17.2893.7204.67315.65426.62537.6480-28-42410-180-950GrossReturnsDiscountsNet revenueCOGSOpexProfit
vue
<VxWaterfallChart
  :data="[
    { label: 'Gross',       value: 480, type: 'total' },
    { label: 'Returns',     value: -28 },
    { label: 'Discounts',   value: -42 },
    { label: 'Net revenue', value: 0, type: 'subtotal' },
    { label: 'COGS',        value: -180 },
    { label: 'Opex',        value: -95 },
    { label: 'Profit',      value: 0, type: 'total' },
  ]"
/>

Monthly cash flow ​

-7.3840.0287.41134.81182.2229.650+120+35-65-18-22-150OpeningSalesServicesPayrollRentMarketingTaxesClosing
vue
<VxWaterfallChart :data="monthlyCash" />

No connectors ​

-6.5935.7278.03120.34162.65204.96120+45+18-8-140StartNew salesUpsellRefundsChurnEnd
vue
<VxWaterfallChart :data="data" :connectors="false" />

No value labels ​

-6.5935.7278.03120.34162.65204.96StartNew salesUpsellRefundsChurnEnd
vue
<VxWaterfallChart :data="data" :valueLabels="false" />

Custom colors ​

-6.5935.7278.03120.34162.65204.96120+45+18-8-140StartNew salesUpsellRefundsChurnEnd
vue
<VxWaterfallChart
  :data="data"
  upColor="#22c55e"
  downColor="#ef4444"
  totalColor="#6366f1"
/>

Dashboard card ​

Q4 profit bridge

From gross revenue to net profit

-17.2893.7204.67315.65426.62537.6480-28-42410-180-950GrossReturnsDiscountsNet revenueCOGSOpexProfit

Props ​

PropTypeDefaultDescription
dataWaterfallPoint[][]Array of steps
heightnumber300SVG height in px
barGapnumber0.35Gap between bars (0–1)
radiusnumber4Corner radius
upColorstring#22c55ePositive bar color
downColorstring#ef4444Negative bar color
totalColorstringvar(--primary)Total / subtotal color
connectorsbooleantrueDashed lines between bars
valueLabelsbooleantrueShow value above each bar
gridbooleantrueShow horizontal grid
axisbooleantrueShow axis labels
tooltipbooleantrueShow hover tooltip
animatebooleantrueAnimate on mount
yTicksnumber5Number of y-axis ticks
min / maxnumber—Force value bounds
formatValue(v: number) => stringsmartFormat axis / tooltip

WaterfallPoint ​

ts
interface WaterfallPoint {
  label: string
  value: number
  type?: 'positive' | 'negative' | 'total' | 'subtotal'
}
  • Omit type — sign of value decides positive/negative.
  • type: 'total' — absolute bar drawn from 0 to value, resets the running total.
  • type: 'subtotal' — absolute bar drawn from 0 to the current running total (set value: 0).

Events ​

EventPayload
hover{ index, point, runningTotal }
click{ index, point, runningTotal }