Table
| Search | 142 |
| Social | 88 |
| Referral | 61 |
| Maps | 34 |
Docs · Visuals
Rows and columns of text or numbers, with each column formatted its own way.
Edit the example and the visual redraws. Mistakes show the same messages the API returns.
| Search | 142 |
| Social | 88 |
| Referral | 61 |
| Maps | 34 |
Change any number or label. The chart follows.
| Field | Type | Rule |
|---|---|---|
columnsRequired | array | 1 to 12 columns, in display order. Each one is described below. |
dataRequired | array | Up to 200 rows. Each row is an object keyed by column key. |
| Field | Type | Rule |
|---|---|---|
keyRequired | string | The row key this column shows. Up to 80 characters. |
labelRequired | string | The column heading. Up to 80 characters; may be empty. |
alignRequired | string | "left" or "right". Right suits numbers. |
formatRequired | string | "text", "number" or "percent" (0.25 shows as 25%). |
statusesOptional | object | Text columns only. 1 to 20 entries mapping a cell's exact text to "good", "warn" or "bad"; the cell gets a dot in that colour and shape. For example, "statuses": { "Up": "good", "Slow": "warn", "Down": "bad" }. |
hrefKeyOptional | string | Text columns only. Names a row key holding an http or https URL that links this cell; null or an empty string means no link. The key is not shown as a column and must differ from every column key. For example, a column with "hrefKey": "siteUrl" links each cell to that row's siteUrl. |
rulesOptional | array | Number and percent columns only. 1 to 6 items, each { "below": n, "status": … } or { "atLeast": n, "status": … }, compared with the stored number (0.2 is 20% on a percent column); the first match wins. For example, "rules": [{ "below": 0.9, "status": "bad" }, { "atLeast": 0.99, "status": "good" }]. |
{
"columns": [
{
"key": "channel",
"label": "Channel",
"align": "left",
"format": "text"
},
{
"key": "bookings",
"label": "Bookings",
"align": "right",
"format": "number"
}
],
"data": [
{ "channel": "Search", "bookings": 142 },
{ "channel": "Social", "bookings": 88 },
{ "channel": "Referral", "bookings": 61 },
{ "channel": "Maps", "bookings": 34 }
]
}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.