رجحان ویجٹ
ایک موجودہ ریڈنگ کے ساتھ اس کی حالیہ تاریخ sparkline کے طور پر۔ latency، throughput، قیمت، یا کسی بھی ایسے نمبر کے لیے بہترین جسے سیاق و سباق میں دیکھنا ضروری ہو۔
یہ سیکشن ایک ایپ اپڈیٹ کی اُس خصوصیت کو بیان کرتا ہے جو App Store کے جائزے کے لیے زیرِ التوا ہے۔ اپڈیٹ لائیو ہوتے ہی یہ یہاں خودکار طور پر اَن لاک ہو جائے گی۔
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).