Skip to content

Area

An area is a line chart with the region between the line and a baseline filled in. Use it when the magnitude is part of the story — typically for stacked series where the total matters as much as the parts.

```plot view=daily_signups
Plot.areaY(data, { x: "date", y: "count", fillOpacity: 0.4 })
```
```plot view=daily_signups_by_source
Plot.areaY(data, { x: "date", y: "count", fill: "source" })
```

Useful for share rather than volume.

```plot view=daily_signups_by_source
Plot.areaY(data, Plot.stackY(
{ offset: "normalize" },
{ x: "date", y: "count", fill: "source" }
))
```
OptionMeaning
x, ycolumn names (x is usually a date or ordered numeric)
fillcolumn name → series fill (also enables stacking)
fillOpacity0–1; defaults to 1 for stacked, lower for single
strokecolumn name → series stroke (often paired with lineY)
curve"linear" (default), "monotone-x", "step", "basis", "natural"
Plot.stackY(...) transforms{ offset: "normalize" } for 100%-stacked, { order: "appearance" }, { reverse: true }
tiptrue for hover tooltips

See Observable Plot — area for the full reference.