Skip to main content
A geom is what a chart draws for its data — a line, a bar, a point. Each geom is a layer in the spec; add several and they stack into one chart. Geoms are the visible half of the grammar: mappings and scales decide where things go, geoms decide what is drawn there.

The built-in geoms

Each is a factory that returns a layer. Call it with options to configure the layer, and geom-specific params to style what it draws:
The params available depend on the geom — see each chart type page, or the reference for the full list.

Layers

Every geom.*() you pipe in adds a layer, drawn in order — later layers sit on top. Layers share the spec-level mapping unless one overrides it. This is how decorated and combo charts are built:

Common layer options

Beyond params, every geom accepts these options:

Position modes

When several observations share the same x (because color or group splits the data), a layer’s position decides how they arrange:

Next

  • Scales — map values to positions, colors and sizes
  • Statistics — summarise a layer before drawing it
  • Chart types — geoms assembled into recipes