geom.bar(); they differ only in coordinate system.
The building blocks
Every spec is assembled from four kinds of ingredient:Geoms
There are five built-in geoms. Everything in the recipes below is one of these, sometimes layered:Position modes
When a geom mapscolor (or group), multiple observations share an x value. The layer’s position decides how they arrange:
Coordinate systems
Common recipes
Reach for these as starting points. Each is apipe(createSpec(...), ...) chain; the scales are elided for brevity but always required for mapped position aesthetics.
Layers
A geom is a layer. Add several to one spec and they draw over each other, sharing the spec-level mapping unless a layer overrides it. This is how combos and decorated lines are built:Guides for each type
The pages in this section walk through a specific chart type end to end — data shape, spec, and the options that matter most.- Line — trends over a continuous or ordered x-axis
- Bar & column — vertical columns for comparing categories, horizontal bars for ranking
- Area — filled trends, stacked or plain
- Pie & donut — parts of a whole
- Radar & radial — categories compared around a circle
- Scatter & bubble — correlation and three-variable plots
- Combo — two metrics on dual axes
Don’t see the chart you need? Because charts are composed from these
ingredients, most are a small tweak to a recipe above — swap the geom, add
coord.flip(), or change the position.
