Area chart
Area chart for magnitude over an ordered axis, one band per series, overlaid or stacked.
Use an area chart for the magnitude of a total and its parts over an ordered axis; prefer a line chart when comparing categories.
Daily active users by tier
freepaid
This chart cannot be displayed here: it needs JavaScript and WebGL.
The same chart in each style
Source
```chart
type: area
title: Daily active users by tier
data:
inline:
- { day: "Mon", tier: free, users: 820 }
- { day: "Tue", tier: free, users: 910 }
- { day: "Wed", tier: free, users: 870 }
- { day: "Thu", tier: free, users: 940 }
- { day: "Mon", tier: paid, users: 240 }
- { day: "Tue", tier: paid, users: 265 }
- { day: "Wed", tier: paid, users: 290 }
- { day: "Thu", tier: paid, users: 305 }
encoding: { x: day, y: users, color: tier }
```
Fields that matter
type: areawithencoding.xfor the ordered axis andencoding.yfor the measureencoding.colorsplits the area into one band per category; bands overlay from the baseline, andstack: truestacks them and adds a total to the readoutstyle.curveismonotone(default),linear,step,step_beforeorstep_afterstyle.curve: step_afterholds a value until the next observationaxes.y.label,formatandunitdescribe the value axisaxes.y.minandaxes.y.maxfix the ends of the value axis
Unstacked areas use automatic primary values in complete groups across the shown series: last values first, then first values, then extremes. The total is at most five, or three below 480 px of plot width; if all last values cannot fit, none are drawn. Stacked areas keep their part values in readouts and do not add numeric labels.
Interactions
- Hover or focus a point to read the values of every band at that position.
- Click a legend entry to toggle a band.
- Zoom and pan on the ordered axis with brush, wheel, pinch, keys or double-click.
- Open the Table view, Download PNG or CSV, or Expand the chart.