Donut
A donut chart of values, with a label in the center. colors overrides the theme’s palette.
ui.donut · Category: Data · Full reference →


pz.row([ ui.donut([60, 25, 15], label="60%"), ui.donut([45, 35, 20], colors=["#e5c07b", "#c678dd", "#56b6c2"], size=120, thickness=20, label="3"),], spacing=32, align="center")When to use
Section titled “When to use”- To show the parts of a whole (disk usage, languages of a project) with three or four slices.
import pyzed as pzfrom pyzed import ui
pz.row([ ui.donut([60, 25, 15], label="60%"), ui.donut([45, 35, 20], colors=["#e5c07b", "#c678dd", "#56b6c2"], size=120, thickness=20, label="3"),], spacing=32, align="center")Variants
Section titled “Variants”Options
Section titled “Options”

Code
ui.donut([60, 25, 15], label="60%")

colors=Code
ui.donut([45, 35, 20], colors=["#e5c07b", "#c678dd", "#56b6c2"], label="3")

thickness=6Code
ui.donut([70, 30], thickness=6, label="70%")

size=140, thickness=24Code
ui.donut([40, 30, 20, 10], size=140, thickness=24)

size=110, label="82%"Code
ui.donut([82, 18], size=110, label="82%")Events
Section titled “Events”Donut has no events of its own: it shows what you give it. Like every widget it also has the 18 common events (click, double_click, right_click, mouse_enter, drag, key_down, resize…), attached with .on(...): see Events and Events of every component.
Properties and API
Section titled “Properties and API”ui.donut
Section titled “ui.donut”donut(values, *, colors=None, size=96, thickness=14, label=None, theme=None)A donut chart; label is drawn in the center.
| Property | Default | Description |
|---|---|---|
values |
required | Values. |
colors |
None |
Colors (defaults to the theme’s). |
size |
96 |
Size. |
thickness |
14 |
Ring thickness. |
label |
None |
Center text. |
theme |
None |
Theme to use instead of the current one (pyzed.theme.current()). |