Skip to content

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 →

GaugeGauge
  • On dashboards, for a value with a known range and limits.
  • For a value over time, use a Line chart.
import pyzed as pz
from 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)
Gauge: unit="%"Gauge: unit="%"
unit="%"
Code
ui.gauge(64, unit="%")
Gauge: label="Speed"Gauge: label="Speed"
label="Speed"
Code
ui.gauge(88, max=200, unit=" km/h", label="Speed", size=180)
Gauge: thresholds=Gauge: thresholds=
thresholds=
Code
ui.gauge(93, unit="%", label="Disk", thresholds=[(70, "warning"), (90, "error")])
Gauge: tint="success"Gauge: tint="success"
tint="success"
Code
ui.gauge(7.5, max=10, label="Score", tint="success")

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.

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()).

Full reference →