A gauge places one current value on an instrument-like arc. It is useful when the range already has a clear meaning, such as the proportion of an allocated disk quota which has been used. The screenshot is from Fission's chart gallery.
What the chart is for
Use it to summarise one percentage, not to compare several values. Keep used bytes, allocated bytes and the observation time available as text. A reader should not have to estimate a needle angle to determine whether storage is nearly full.
Data model
GaugeSeries stores labelled values, but the renderer uses only its first entry and maps it onto a fixed 0–100 scale. Compute the percentage before rendering and handle a zero allocation explicitly. Raw bytes cannot be passed as though the series accepted a custom byte range.
Authoring from a Fission component
This is an actual gauge series, rather than an empty Chart with a gauge title. The parent owns quota loading and calculation.
use fission::prelude::*;
use fission::charts::{Chart, GaugeSeries};
// The parent resolves display labels from its translation bundles.
fission_component! {
pub DiskQuotaGauge<()> {
props {
chart_title: String,
series_label: String,
value_label: String,
used_percent: f32,
}
}
view(report, _state, _cx) => Chart(
title: Some(report.chart_title.clone()),
series: vec![GaugeSeries::new(&report.series_label)
.data(vec![(&report.value_label, report.used_percent)])
.into()],
)
}
Testing and accessibility
Test zero use, full quota, over-allocation and a failed quota lookup. The arc clamps outside 0–100, so an exceptional value needs explicit text or an error state. Do not display an old observation as a current healthy reading.