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 — you keep the natural mapping (category 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 category around it, with the
value as radius (rose / coxcomb). A bare coord.polar() gives you 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 centre for a donut.number
default:"0"
Starting angle in degrees.
theta: 'y'. The 'fill' position normalises the stack to 100%, which is what closes the circle:
See Pie & donut and Radar & radial for worked examples.
Polar coordinates also flatten the
padding on every discrete scale to 0, so wedges meet edge to edge and a scale.x.discrete({ padding: 0.2 }) has no visible effect inside a pie.
One coord per spec
Only one coordinate system is in play at a time, and piping a secondcoord.*() replaces the first outright rather than merging into it:
Axis limits
Every coord accepts optionalxLimits / yLimits as [min, max] to clip the drawing region; both are null unless you set them. For most charts you’ll control the visible range through scale domainMin / domainMax instead — limits operate on the coordinate space rather than the data domain.
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

