Pie
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
Change any number or label. The chart follows.
Fields
| Field | Type | Rule |
|---|---|---|
nameKeyRequired | string | The key in each row that holds the slice name. Up to 80 characters. |
valueKeyRequired | string | The key in each row that holds the slice size. Up to 80 characters. Must differ from nameKey. |
donutOptional | boolean | true cuts out the middle. |
dataRequired | array | Up to 24 rows. An empty array draws an empty chart. |
| Field | Type | Rule |
|---|---|---|
<nameKey>Required | string | The slice or stage name. Not empty. Up to 80 characters. |
<valueKey>Required | number | Zero 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