Output Charts

Docs · Visuals

KPI JSON format.

One formatted number, with an optional change beside it.

Try it

Edit the example and the visual redraws. Mistakes show the same messages the API returns.

The visual
KPI

MRR

$12,840

12% vs last month

Change any number or label. The chart follows.

Fields

The kpi document
FieldTypeRule
labelRequiredstringWhat the number is. Up to 80 characters; may be empty.
valueRequirednumberThe number itself.
formatRequiredstring"number" (12,840), "compact" (12.8K) or "percent". Percent multiplies by 100, so send 0.082 for 8.2%.
prefixOptionalstringShown before the number, such as "$". Up to 80 characters.
suffixOptionalstringShown after the number, such as " ms". Up to 80 characters.
deltaOptionalnumberA change to show beside the value.
deltaFormatOptionalstring"number" or "percent" (0.12 shows as 12%). Number when left out.
deltaLabelOptionalstringWords after the change, such as "vs last month". Up to 80 characters.
trendOptionalarrayUp to 60 numbers, oldest first, in the same unit as value. Drawn as a small line beside the number, or under it in a taller tile. For example, "trend": [12, 15, 14, 18, 21].

Good to know

  • No other keys are allowed, so a KPI document is always this small.

Example

{
  "label": "MRR",
  "value": 12840,
  "format": "number",
  "prefix": "$",
  "delta": 0.12,
  "deltaFormat": "percent",
  "deltaLabel": "vs last month"
}

Send it from your code

Paste the document in the editor, or replace it with a PUT to the visual's push URL. The push API page has the details and examples.

Next: Table JSON format