Gauge
Shows one number between min and max on an arc, like a speedometer: CPU use, temperature, a score. thresholds recolor the arc as the value climbs.
ui.gauge · Category: Data · Full reference →


pz.row([ ui.gauge(42, unit="%", label="CPU"), ui.gauge(78, unit="°C", label="GPU", thresholds=[(70, "warning"), (90, "error")]),], spacing=24)When to use
Section titled “When to use”- On dashboards, for a value with a known range and limits.
- For a value over time, use a Line chart.
import pyzed as pzfrom pyzed import ui
pz.row([ ui.gauge(42, unit="%", label="CPU"), ui.gauge(78, unit="°C", label="GPU", thresholds=[(70, "warning"), (90, "error")]),], spacing=24)Variants
Section titled “Variants”Options
Section titled “Options”

unit="%"Code
ui.gauge(64, unit="%")

label="Speed"Code
ui.gauge(88, max=200, unit=" km/h", label="Speed", size=180)

thresholds=Code
ui.gauge(93, unit="%", label="Disk", thresholds=[(70, "warning"), (90, "error")])

tint="success"Code
ui.gauge(7.5, max=10, label="Score", tint="success")Events
Section titled “Events”Gauge 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.gauge
Section titled “ui.gauge”gauge( value, *, min=0.0, max=100.0, size=140, thickness=12, unit='', label=None, tint='accent', thresholds=None, theme=None,)A half-circle meter for one number, like a speedometer. thresholds recolor the arc as the value climbs.
| Property | Default | Description |
|---|---|---|
value |
required | The number shown. |
min |
0.0 |
Value at the left end. |
max |
100.0 |
Value at the right end. |
size |
140 |
Width in pixels. |
thickness |
12 |
Width of the arc. |
unit |
"" |
Text after the number ("%", "°C"). |
label |
None |
Text under the number. |
tint |
"accent" |
Semantic color: "accent", "error", "warning", "success", "info" or a token. |
thresholds |
None |
(from_value, color) pairs, such as [(70, "warning"), (90, "error")]. |
theme |
None |
Theme to use instead of the current one (pyzed.theme.current()). |
Related
Section titled “Related”Progress ringA round progress bar.
StatA dashboard number with change and sparkline.
DonutA donut chart with a label in the middle.