Widget Xu hướng
Một giá trị hiện tại kèm lịch sử gần đây được vẽ dưới dạng sparkline. Phù hợp nhất cho độ trễ, thông lượng, giá cả hay bất kỳ con số nào đáng xem trong ngữ cảnh.
Phần này mô tả một tính năng trong bản cập nhật ứng dụng đang chờ App Store xét duyệt. Tính năng sẽ tự động mở khóa tại đây ngay khi bản cập nhật được phát hành.
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).