szum

Pie

Pie and donut charts for part-to-whole relationships.

Use pie to show proportions of a whole. The x field provides slice categories, the y field provides values. Colors are assigned automatically from the theme palette, and a legend is generated.

Basic pie

Donut

Set innerRadius to a value between 0 and 1. This is the inner radius as a fraction of the outer radius:

Custom colors

Use the color config with type: "categorical" to set a custom palette:

Same data, different mark

The same data format works for both barY and pie — just swap the type:

Properties

FieldTypeDefaultDescription
innerRadiusnumber0Inner radius as a fraction of outer radius. 0 = pie, 0.5 = donut.

On this page