Skip to content

Gauge

A 180° arc gauge with colored threshold zones and a needle. Perfect for pressure, temperature, or any value with normal/warning/danger ranges.

lua
ui:element({
    id = "pressure_gauge", type = "gauge",
    rect = { unit = "px", x = 10, y = 50, w = 120, h = 80 },
    props = {
        value = 101.3,
        min = 0,
        max = 200,
        warn = 0.65,
        danger = 0.85,
        label = "PRESSURE",
        unit = " kPa",
    },
    style = {
        bg = "#111827",
        arc_thickness = 8,
        font_size = 12,
        value_color = "#E2E8F0",
        label_color = "#64748B",
    }
})
PropDescription
valueCurrent value
minMinimum value
maxMaximum value
warnFraction (0..1) where warning zone starts (default 0.6)
dangerFraction (0..1) where danger zone starts (default 0.85)
invertIf true, color bands are reversed (danger on left)
labelOptional label text below value
unitOptional unit suffix appended to value display
StyleDescription
bgBackground color
arc_colorArc border color
needle_colorNeedle color
normal_colorNormal zone color
warn_colorWarning zone color
danger_colorDanger zone color
value_colorValue text color
label_colorLabel text color
arc_thicknessArc ring thickness in pixels (default 10)
font_sizeValue/label font size

⚠️ This documentation was AI-generated and may contain inaccuracies. Please submit pull requests with corrections as needed.