coord.*() part into the spec. When you don’t, the chart is cartesian.
Cartesian
The standard x–y plane, and the default.Flip
coord.flip() swaps the x and y axes. Its main use is turning vertical columns into horizontal bars: keep the natural mapping (band on x, value on y) and the flip lays it on its side.
Polar
coord.polar() bends the plane into a circle. This is how pie, donut, rose and radial charts are made. It takes:
'x' | 'y'
default:"x"
Which aesthetic maps to the angle.
theta: 'y' sweeps the value around the
circle (pie, donut); theta: 'x' sweeps the band around it, with the value as
radius (rose). A bare coord.polar() gives the rose form; pass theta: 'y'
for a pie.number
default:"0"
Inner radius as a fraction
0–1. 0 is a full pie; a value like 0.5 cuts
out the center for a donut.number
default:"0"
Starting angle in degrees.
theta: 'y'. The 'fill' position normalizes the stack to 100%, which is what closes the circle:
See Pie & donut and Radar & radial for worked examples.
Polar coordinates also set the
padding of every discrete scale to 0, so wedges meet edge to edge and scale.x.discrete({ padding: 0.2 }) has no effect inside a pie.
Time around the circle
Mapping time to the angle turns a chart into a clock or a calendar: a day of tide heights, a year of temperatures. Pairtheta: 'x' with a datetime or continuous x-scale:
log or sqrt x-scale keeps its data domain, since an even step there is not an even slot.
When the circle stands for a fixed period, name its bounds, so a missing reading cannot shift the others. The inferred step only knows the readings it is given:
One coord per spec
Only one coordinate system applies at a time. Piping a secondcoord.*() replaces the first; it does not merge:
Next
- Chart types — coords combined with geoms and positions
- Pie & donut — the
theta: 'y'polar recipes in full - Radar & radial — the
theta: 'x'polar family

