Components · Data
Chart
A chart. type: bar, line, or area (labels are the x-axis; each series has one value per label, null for a gap); pie or donut (one series; labels name the slices; values zero or more; more than 8 slices fold into "Other"); scatter (each series has points [{ x, y, label? }]; no labels). Several bar series draw grouped bars; stacked: true stacks bar or area series. format styles values (y); xFormat styles scatter x values; xLabel/yLabel name the axes.
ExamplesLink to this section
| Label | Open bugs |
|---|---|
| W1 | 21 |
| W2 | 18 |
| W3 | 15 |
| W4 | 12 |
| W5 | 10 |
| W6 | 7 |
Show JSONHide JSON
{
"version": 1,
"root": "chart",
"elements": {
"chart": {
"type": "Chart",
"props": {
"type": "line",
"title": "Open bugs by week",
"labels": ["W1", "W2", "W3", "W4", "W5", "W6"],
"series": [{ "name": "Open bugs", "values": [21, 18, 15, 12, 10, 7] }]
}
}
}
}- Platform
- Web
Spend
Quarter
| Quarter | Platform | Web |
|---|---|---|
| Q1 | $42,000 | $18,000 |
| Q2 | $45,500 | $21,000 |
| Q3 | $39,000 | $22,400 |
| Q4 | $51,200 | $25,100 |
Show JSONHide JSON
{
"version": 1,
"root": "chart",
"elements": {
"chart": {
"type": "Chart",
"props": {
"type": "bar",
"title": "Spend by team",
"format": "currency",
"currency": "USD",
"labels": ["Q1", "Q2", "Q3", "Q4"],
"series": [
{ "name": "Platform", "values": [42000, 45500, 39000, 51200] },
{ "name": "Web", "values": [18000, 21000, 22400, 25100] }
],
"xLabel": "Quarter",
"yLabel": "Spend"
}
}
}
}- Search5,40052.2%
- Direct3,10030%
- Social1,20011.6%
- Email6406.2%
| Label | Visits | Share |
|---|---|---|
| Search | 5,400 | 52.2% |
| Direct | 3,100 | 30% |
| Social | 1,200 | 11.6% |
| 640 | 6.2% |
Show JSONHide JSON
{
"version": 1,
"root": "chart",
"elements": {
"chart": {
"type": "Chart",
"props": {
"type": "donut",
"title": "Traffic by source",
"labels": ["Search", "Direct", "Social", "Email"],
"series": [{ "name": "Visits", "values": [5400, 3100, 1200, 640] }]
}
}
}
}PropsLink to this section
Generated from the zod schema the server validates with. Unknown props are ignored with a warning. Any prop can also be a dynamic value such as { "$state": "/path" }; it is checked again once it resolves.
| Prop | Type | Limits and defaults |
|---|---|---|
| typerequired | "bar" | "line" | "area" | "pie" | "donut" | "scatter" | — |
| labels | string[] | max 200 items |
| seriesrequired | object[] | 1–8 items |
| series[].namerequired | string | max 60 chars |
| series[].values | (number | null)[] | max 200 items |
| series[].points | object[] | max 500 items |
| series[].points[].xrequired | number | — |
| series[].points[].yrequired | number | — |
| series[].points[].label | string | max 80 chars |
| title | string | max 160 chars |
| format | "number" | "compact" | "percent" | "currency" | — |
| currency | string | 3-letter code |
| height | "sm" | "md" | "lg" | — |
| stacked | boolean | — |
| xLabel | string | max 60 chars |
| yLabel | string | max 60 chars |
| xFormat | "number" | "compact" | "percent" | "currency" | — |
RulesLink to this section
- bar, line, and area: each series has one value per label (null for a gap).
- pie and donut: exactly one series, values zero or more. More than 8 slices fold into "Other".
- scatter: series carry
pointsinstead ofvalues, and the chart has no labels. stackedworks with bar and area only.- See the Charts page for every type and the format rules.
Children and eventsLink to this section
Chart is a leaf: it does not show children. Validation warns when a leaf has some; wrap them in a Stack or Card instead.
It emits no events.