Trend-Widget
Ein aktueller Messwert samt seiner jüngsten Historie als Sparkline. Ideal für Latenz, Durchsatz, Preise oder jede Zahl, die man im Kontext sehen sollte.
Dieser Abschnitt beschreibt eine Funktion in einem App-Update, das derzeit vom App Store geprüft wird. Er wird hier automatisch freigeschaltet, sobald das Update verfügbar ist.
Fields
| Field | Type | Notes |
|---|---|---|
template | string | Required. Must be "trend" |
value | float | Required. The current reading, rendered large above the chart. Must be finite |
points | number[] | Required. The sparkline history, oldest first. Between 2 and 48 entries, each finite. Replaced wholesale on PATCH — re-send the whole window, not one new point (why) |
unit | string | Unit rendered after the value (e.g. "ms", "%", "req/s"). Max 32 characters |
min_value | float | Fixed lower bound of the chart. Must be less than max_value when both are sent |
max_value | float | Fixed upper bound of the chart. With either bound missing the widget auto-scales to the posted points |
trend | string | up / down / flat. Renders an inline arrow next to the value; it is your annotation, not derived from points |
label, subtitle, icon, accent_color, background_color, text_color | string | Shared content fields — see the API reference |
Example: p95 latency
{
"content": {
"template": "trend",
"value": 371,
"unit": "ms",
"points": [312, 305, 298, 310, 322, 331, 340, 336, 329, 348, 355, 362, 371],
"label": "p95 latency",
"subtitle": "api-gateway · last hour",
"icon": "waveform.path.ecg",
"accent_color": "teal",
"trend": "up"
}
}Behavior
Points are plotted left to right in the order you send them, so the last entry sits under the
current reading — keep value and the final point in agreement or the chart appears to
lag the number above it. Without min_value and max_value the chart scales
to whatever range the posted points span, which makes a flat series look dramatic; set both bounds
when you want consecutive updates to stay visually comparable (an SLO ceiling, a 0 – 100 percentage).