प्रवृत्ती विजेट
सध्याचे वाचन आणि त्याचा अलीकडील इतिहास स्पार्कलाइन म्हणून. लेटन्सी, थ्रुपुट, किंमत किंवा संदर्भासह पाहण्याजोग्या कोणत्याही आकड्यासाठी सर्वोत्तम.
हा विभाग App Store पुनरावलोकनाच्या प्रतीक्षेत असलेल्या ॲप अपडेटमधील एका वैशिष्ट्याचे वर्णन करतो. अपडेट थेट होताच ते इथे आपोआप अनलॉक होईल.
The trend template pairs one large current reading with a sparkline of the values that
led to it. Send the number you would have sent to a value widget, plus the recent history, and the widget shows both at a glance.
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 |
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).
Updates are RFC 7396 merge patches, and a merge patch replaces an array rather than appending to it. Send the whole window on every update — the newest reading plus however many earlier points you want drawn — instead of sending one new point and expecting it to be pushed onto the series.
Try it on the playground to see how a series renders across the small, medium, large, and Lock Screen families before you wire up an integration.