跳至内容

统计列表小组件

一张卡片最多六行标签与数值。最适合紧凑型仪表板 —— MRR、订阅、试用 —— 这类用图表反而说得更少的场景。

Fields

FieldTypeNotes
templatestringRequired. Must be "stat_list"
stat_rowsobject[]Required. Between 1 and 6 rows, drawn in the order you send them. Replaced wholesale on PATCH — re-send the full list (why)
stat_rows[].labelstringRequired. Non-blank, max 32 characters. The left-hand caption
stat_rows[].valuestringRequired. Non-blank, max 32 characters. A string, not a number — rendered exactly as sent
stat_rows[].unitstringRendered after the value. Max 16 characters
label, subtitle, icon, accent_color, background_color, text_colorstringShared content fields — see the API reference

Example: SaaS dashboard

PATCH /widgets/saas-dashboard
{
  "content": {
    "template": "stat_list",
    "label": "April",
    "icon": "chart.bar.fill",
    "accent_color": "indigo",
    "stat_rows": [
      { "label": "MRR",    "value": "$8 333", "unit": "USD" },
      { "label": "Subs",   "value": "412" },
      { "label": "Trials", "value": "37" },
      { "label": "Churn",  "value": "1.2",    "unit": "%" }
    ]
  }
}

Behavior

Values are strings, so formatting is yours to decide and yours to keep consistent: the currency symbol, the thousands separator, the number of decimals. Nothing is rounded or abbreviated on device, which is the whole reason to choose this template over value — but it also means a long value is a long value, and 32 characters of it will not fit on a small widget.

How many rows actually render depends on the placement. Medium and large Home Screen widgets show all six by default; the small widget shows four, and the Lock Screen rectangular shows three, packing rows two-up to reach six when every value is very short. Users can change this per widget in the PushWard app: Compact packs two columns to surface up to six rows on any size, at the cost of truncated labels on the smaller placements, and Comfortable keeps one column with larger rows and shows fewer of them. Put the row that matters most first — it is the one that survives every placement.

将在应用版本 1.6 中推出

本节介绍的功能来自一个正在等待 App Store 审核的应用更新。更新上线后,此处会自动解锁。