Sparkline Widget
The Sparkline widget renders a compact line or bar chart of recent values from a virtual pin β no axes, no labels, just the trend. Ideal for placing a quick visual indicator next to a Value Display without taking up a lot of space.
Default size: 2 Γ 2 grid cells
Configurationβ
| Property | Type | Default | Description |
|---|---|---|---|
points | number | 20 | Number of data points shown |
chartType | line | bar | line | Mini-chart style |
color | hex color | #6366F1 | Line / bar color |
| Device | device | β | The device to read from |
| Pin | V0βV255 | β | The virtual pin to chart |
| Label | string | β | Widget label |
Firmware exampleβ
void loop() {
Vwire.run();
float cpu = getCPULoad(); // 0β100%
Vwire.virtualSend(V0, cpu);
delay(5000); // 5 s β 20 points = last 1 min 40 s of trend
}
Pairing with Value Displayβ
A common combination:
ββββββββββββββββ¬ββββββββββββββ β
β Value Displayβ Sparkline β
β 23.5 Β°C β ~~~\/~~~ β
β β (last 20g) β
ββββββββββββββββ΄βββββββββββββββ
2Γ2, pin V0 2Γ2, pin V0
Both widgets bind to the same device and pin. The Value Display shows the current number; the Sparkline shows the recent trend.
Difference from Graphβ
| Feature | Sparkline | Graph | |---------|-----------|----- -| | Size | 2Γ2 compact | 4Γ3 large | | Axes / labels | None | Full with time axis | | Historical range | Last N pushes | Configurable (1hβ30d) | | Use | Quick trend | Detailed analysis |