Skip to contents

Draws a hand-drawn Gantt chart: one roughened bar per task from x (start) to xend (end) on a discrete y – the whiteboard project-planning look. Map an optional progress aesthetic (0 to 1) to overlay a slimmer, darker solid bar over the completed fraction of each task. Works with dates, date-times or plain numbers on the x axis, and with every fill_style (including "watercolor"); corner_radius rounds the bar ends.

Usage

GeomSketchGantt

geom_sketch_gantt(
  mapping = NULL,
  data = NULL,
  stat = "identity",
  position = "identity",
  ...,
  height = 0.55,
  progress_shade = 0.65,
  corner_radius = 0.15,
  fill_style = "hachure",
  roughness = 1,
  bowing = 1,
  n_passes = 2L,
  seed = NULL,
  na.rm = FALSE,
  show.legend = NA,
  inherit.aes = TRUE
)

Arguments

mapping

Aesthetic mappings created by ggplot2::aes(). Requires x, xend and y; optionally progress (completed fraction, 0-1).

data

Data to display.

stat

Statistical transformation. Default "identity".

position

Position adjustment. Default "identity".

...

Other arguments passed on to the layer.

height

Bar height in y units. Default 0.55.

progress_shade

Channel multiplier (< 1 darkens) for the progress overlay's fill. Default 0.65.

corner_radius

Corner rounding of the bars; see geom_sketch_rect(). Default 0.15.

fill_style

Bar fill style; see geom_sketch_rect(). Default "hachure".

roughness, bowing, n_passes, seed

Sketch parameters.

na.rm

Remove missing values silently? Default FALSE.

show.legend

Logical; include in legend?

inherit.aes

Override default aesthetics?

Value

A ggplot2 layer object.

Examples

library(ggplot2)
plan <- data.frame(
  task  = factor(c("Design", "Build", "Test", "Ship"),
                 levels = rev(c("Design", "Build", "Test", "Ship"))),
  start = as.Date(c("2026-01-05", "2026-01-19", "2026-02-09", "2026-02-23")),
  end   = as.Date(c("2026-01-23", "2026-02-13", "2026-02-27", "2026-03-06")),
  done  = c(1, 0.7, 0.25, 0)
)
ggplot(plan, aes(x = start, xend = end, y = task, fill = task,
                 progress = done)) +
  geom_sketch_gantt(seed = 1L, show.legend = FALSE) +
  theme_sketch()