{"version":"v1.0","client_state":{"Studio.default":{"fields":{"primary":"#8a4a1f","secondary":"#3a52b0","success":"#2f9e64","warning":"#f0a91b","error":"#e5484d","info":"#0e9bc4","background":"#fafafa","surface":"#ffffff","interface":"#f0f0f1","text":"#171717","muted":"#6b6b6e","d_primary":"#9e5e34","d_secondary":"#566dc7","d_success":"#2f9e64","d_warning":"#f0a91b","d_error":"#e5484d","d_info":"#0e9bc4","d_background":"#0a0a0a","d_surface":"#151515","d_interface":"#212121","d_text":"#f5f5f5","d_muted":"#a0a0a3","spacing":0.25,"space_box":0.25,"space_gap":0.25,"box":0.625,"field_":0.5,"selector":0.25,"stroke":1.0,"font":"ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'"},"persist":"local","send_to_server":true},"ColorScheme.default":{"fields":{"mode":"system"},"persist":"local","send_to_server":true}},"endpoints":{"action":"/_bretzel/action","sse":"/_bretzel/sse","refetch":"/_bretzel/refetch"},"csrf":"4b07d6b8076a06039bdf96131446801d","page_id":"8ca0415663f3424e8aebaeea25efedef","address":""}
ui.pie_chart

Pie chart

Parts of a whole as a pie or a donut, with a figure in the middle, labels on the slices and a click that runs Python.

A donut with its total

The donut leaves room in the middle for the figure the reader looks for first.
Traffic sources · September+9.1%
48.2k visits
Organic search
Direct
Referral
Social
Email
CategoryValueShare
Organic search19840 visits41%
Direct12310 visits26%
Referral7420 visits15%
Social5260 visits11%
Email3370 visits7%

Labels on the slices

show_labels writes each share on its slice; colors picks the theme colours, in order; show_data folds the figures and their shares under the pie.
Storage used

182 GB of 250 GB

52%23%16%10%
Videos
Design files
Documents
Backups
Show the data
CategoryValueShare
Videos94 GB52%
Design files41 GB23%
Documents29 GB16%
Backups18 GB10%

Small multiples

Three small donuts compare better than one crowded pie.
North America
CategoryValueShare
Web58 %58%
iOS30 %30%
Android12 %12%
Web · iOS · Android
Europe
CategoryValueShare
Web47 %47%
iOS22 %22%
Android31 %31%
Web · iOS · Android
Asia-Pacific
CategoryValueShare
Web29 %29%
iOS24 %24%
Android47 %47%
Web · iOS · Android

A click that runs Python

on_item_click receives the slice's label and value; the list next to it is rendered again on the server.
Open tickets · click a slice
156 open
Billing
Bugs
How-to
Feature requests
CategoryValueShare
Billing3422%
Bugs5837%
How-to4126%
Feature requests2315%

Bugs

Export to CSV times out
Calendar sync skips recurring events
Dark mode: unreadable tooltip