Skip to main content
A chart type is a recipe you compose — a geom, a coordinate system, a position mode, and the scales you declare. A vertical bar chart and a pie chart use the same geom.bar(); they differ only in coordinate system.

The building blocks

Every spec is assembled from five kinds of ingredient: A geom’s params are geometry — the bar’s band width, the line’s curve family, how a path handles nulls. Everything a mark is painted with lives in the stylesheet: see Styling.

Geoms

There are six built-in geoms. Everything in the recipes below is one of these, sometimes layered. A plugin can contribute more — see custom geoms:

Position modes

When a geom maps color (or group), multiple observations share an x value. The layer’s position decides how they arrange:
Each geom brings its own default, so a multi-series layer arranges sensibly before you say anything:

Coordinate systems

startAngle is in degrees and defaults to 0; innerRadius is a 01 fraction of the outer radius and defaults to 0.

Common recipes

Reach for these as starting points. Each is a pipe(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:
Layers are drawn in the order you pipe them — later geoms sit on top. Give a layer an id and a stylesheet entry can scope to it with { layer: 'trend' }, which is how one series in a stack of layers reads differently from the rest. Every recipe here also gets an entrance animation when it mounts, tuned through the renderer’s animation prop.

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
  • Heatmap & waffle — a value per cell of a category × category grid
  • 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.