Get Started →
CompositionFlow / Process CategoricalNumerical

Waterfall Chart

ggplot2: geom_rect() · Package: ggplot2 · Variables: 1 categorical (steps) + 1 numerical

WHAT IS A WATERFALL CHART?

A waterfall chart (also called a bridge chart or cascade chart) shows how an initial value increases and decreases through a series of intermediate steps to reach a final value. Positive contributions float upward, negative contributions drop downward, and the running total is visible at each step. Waterfall charts are essential in financial analysis for revenue-to-profit walkdowns, variance analysis, and budget reconciliation. They answer "what factors contributed to the change from start to finish?" In ggplot2, waterfall charts require manual calculation of cumulative positions using geom_rect() or specialized packages.

BEST FOR

  • · Financial bridge analysis
  • · Revenue-to-profit walkdown
  • · Variance analysis
  • · Incremental changes

AVOID WHEN

  • · Non-sequential data
  • · Too many steps (15+)
  • · When running total is meaningless

R + GGPLOT2 CODE EXAMPLE

ggplot2
df <- data.frame(item = c("Start","Q1","Q2","Q3","Q4"), value = c(100, 20, -15, 30, -10))
df$end <- cumsum(df$value); df$start <- c(0, head(df$end, -1))
df$item <- factor(df$item, levels = df$item)
ggplot(df, aes(x = item)) +
  geom_rect(aes(xmin = as.numeric(item)-0.4, xmax = as.numeric(item)+0.4,
    ymin = start, ymax = end, fill = value >= 0)) +
  labs(title = "Waterfall Chart", x = NULL, y = "Value")

Run this code now

Paste the code above into RChat and see the waterfall chart rendered instantly in your browser.

Try RChat Free →

SIMILAR CHART TYPES

ALTERNATIVES FOR YOUR DATA TYPE