Mẫu Timeline
Một biểu đồ sparkline theo thời gian thực để theo dõi các giá trị theo thời gian. Mỗi lần đẩy sẽ gửi một điểm dữ liệu; máy chủ tích lũy lịch sử và truyền dữ liệu sparkline đến iOS qua thông báo đẩy.

Fields
| Field | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
template | string | Required. Must be "timeline" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
value | object | The data point(s) for this push. Required. A labeled map (e.g. {\"CPU\": 72.5} or {\"CPU\": 72.5, \"GPU\": 45.2}). Max 10 series, 32-char keys | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
unit | string | Unit suffix on value display (e.g. "°C", "%"). Max 32 characters. Used as fallback when units is set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
units | object | Per-series unit overrides. Keys must match value keys; missing keys fall back to unit. Max 32-char values | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
scale | string | Y-axis scaling: "linear" (default) or "logarithmic" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
decimals | integer | Decimal places for display. null = auto-detect. Range 0–10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
smoothing | boolean | Curve interpolation between points. Default: false (straight segments) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
thresholds | array | Up to 5 horizontal reference lines. Each has value (required), color, and label (max 12 chars) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
state | string | Status text (e.g. "Heating", "Monitoring") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
icon | string | SF Symbol name (e.g. "chart.xyaxis.line") or MDI icon with mdi: prefix | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
accent_color | string | Named color or hex. Default: teal | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sắp có trong phiên bản ứng dụng 1.3.3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
primary_series | string | Names which series drives the headline value and the compact high/low range on iOS. Max 32 chars, and must match one of the value keys to take effect. When omitted (or naming an unknown key), the alphabetically-first series is used. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The server accumulates history automatically — each push appends a timestamped data point. The history field in the response is read-only (client-supplied history is ignored). Up to 300 points per series are stored; APNs payloads are dynamically downsampled via LTTB to fit 4KB while preserving peaks and visual shape.
Example: Single Value
{
"state": "ongoing",
"content": {
"template": "timeline",
"value": {"Temperature": 13.7},
"unit": "°C",
"state": "Heating",
"icon": "thermometer.medium",
"accent_color": "orange",
"smoothing": true
}
}Example: Multi-Value with Thresholds
{
"state": "ongoing",
"content": {
"template": "timeline",
"value": {
"CPU": 72.5,
"GPU": 45.2,
"Fan": 60.0,
"SSD": 38.1
},
"unit": "%",
"units": { "GPU": "°C", "SSD": "°C" },
"state": "Monitoring",
"primary_series": "CPU",
"thresholds": [
{ "value": 80, "color": "red", "label": "Critical" },
{ "value": 60, "color": "orange" }
]
}
}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.
With more than one series, set primary_series to choose which one leads. On iOS its latest value becomes the big headline number and its min/max drive the compact high/low range shown next to the sparkline; the other series still draw as lines. Omit it and PushWard falls back to the alphabetically-first key (here CPU either way), which is rarely the one you mean once you have series like GPU or SSD.
Typical Flow
- Start tracking (
ended -> ongoing): Set initial value, unit, and display options (scale, smoothing, thresholds) - Send data points (
ongoing -> ongoing): Push updated values — the sparkline grows with each push - Stop tracking (
ongoing -> ended): Final value displayed, sparkline frozen
Value-only updates are delivered at low priority to conserve the iOS push budget. Changing scale, smoothing, decimals, unit, or units triggers high-priority delivery.
Buttons & tap targets
Renders url_action and secondary_url_action as buttons below the sparkline; tap_action covers taps elsewhere on the widget. See Tap actions for the action object shape.
Use Cases
- Server monitoring — CPU temperature, memory usage, network throughput over time
- Smart home — room temperature trends, humidity tracking, energy consumption
- 3D printing — hotend/bed temperature curves during a print
- CI/CD — build time trends, test suite duration over consecutive runs
- IoT — sensor readings over time with threshold alerts