Output Charts

Docs · Visuals

Pie chart JSON format.

Slices of a whole, or a donut.

Try it

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

The visual
Pie

Change any number or label. The chart follows.

Fields

The pie document
FieldTypeRule
nameKeyRequiredstringThe key in each row that holds the slice name. Up to 80 characters.
valueKeyRequiredstringThe key in each row that holds the slice size. Up to 80 characters. Must differ from nameKey.
donutOptionalbooleantrue cuts out the middle.
dataRequiredarrayUp to 24 rows. An empty array draws an empty chart.
Each row in data
FieldTypeRule
<nameKey>RequiredstringThe slice or stage name. Not empty. Up to 80 characters.
<valueKey>RequirednumberZero or more.

Good to know

  • A row may hold only the nameKey and the valueKey.
  • Values are sizes, not percentages: the chart works out each slice's share.

Example

{
  "nameKey": "source",
  "valueKey": "signups",
  "donut": true,
  "data": [
    { "source": "Search", "signups": 142 },
    { "source": "Newsletter", "signups": 88 },
    { "source": "Referral", "signups": 61 },
    { "source": "Social", "signups": 34 }
  ]
}

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: KPI JSON format