Earlier formats
Charts
Bar, line, area, pie, donut, and scatter charts: data shapes, stacking and grouping, number formats, and currency rules.
One component, Chart, draws 6 types: bar, line, area, pie, donut, scatter. Up to 8 series, one per color in a fixed, validated palette with light and dark values. Every chart has a Table button that shows its data as a table, for screen readers and for exact numbers.
Bar, line, and areaLink to this section
labels are the x-axis. Each series has a name and one value per label in values. height is sm, md (default), or lg; xLabel and yLabel name the axes.
| Label | Deploys |
|---|---|
| Jan | 12 |
| Feb | 19 |
| Mar | 8 |
| Apr | 22 |
| May | 17 |
| Jun | 25 |
Show JSONHide JSON
{
"version": 1,
"root": "chart",
"elements": {
"chart": {
"type": "Chart",
"props": {
"type": "bar",
"title": "Deploys per month",
"labels": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
"series": [{ "name": "Deploys", "values": [12, 19, 8, 22, 17, 25] }]
}
}
}
}- Signups
- Churn
| Label | Signups | Churn |
|---|---|---|
| Jan | 120 | 20 |
| Feb | 180 | 24 |
| Mar | 240 | 22 |
| Apr | 310 | 30 |
| May | 290 | 28 |
| Jun | 360 | 26 |
Show JSONHide JSON
{
"version": 1,
"root": "chart",
"elements": {
"chart": {
"type": "Chart",
"props": {
"type": "line",
"title": "Signups and churn",
"labels": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
"series": [
{
"name": "Signups",
"values": [120, 180, 240, 310, 290, 360]
},
{ "name": "Churn", "values": [20, 24, 22, 30, 28, 26] }
]
}
}
}
}| Label | Bytes |
|---|---|
| Jan | 1.2B |
| Feb | 1.5B |
| Mar | 1.7B |
| Apr | 2.1B |
| May | 2.4B |
| Jun | 2.9B |
Show JSONHide JSON
{
"version": 1,
"root": "chart",
"elements": {
"chart": {
"type": "Chart",
"props": {
"type": "area",
"title": "Storage used",
"format": "compact",
"height": "sm",
"labels": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
"series": [
{
"name": "Bytes",
"values": [
1200000000,
1450000000,
1700000000,
2100000000,
2350000000,
2900000000
]
}
]
}
}
}
}Grouped barsLink to this section
Several bar series draw grouped bars, side by side for each label.
- Platform
- Web
- Data
Spend
Quarter
| Quarter | Platform | Web | Data |
|---|---|---|---|
| Q1 | $42,000 | $18,000 | $9,500 |
| Q2 | $45,500 | $21,000 | $12,000 |
| Q3 | $39,000 | $22,400 | $14,200 |
| Q4 | $51,200 | $25,100 | $15,800 |
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] },
{ "name": "Data", "values": [9500, 12000, 14200, 15800] }
],
"xLabel": "Quarter",
"yLabel": "Spend"
}
}
}
}Stacked bars and areasLink to this section
"stacked": true stacks bar or area series. Negative values stack below zero, so gains and losses read in one bar.
- New
- Expansion
- Churn
| Label | New | Expansion | Churn | Total |
|---|---|---|---|---|
| Jan | 30 | 12 | -15 | 27 |
| Feb | 42 | 8 | -22 | 28 |
| Mar | 18 | 20 | -8 | 30 |
| Apr | 50 | 8 | -30 | 28 |
| May | 24 | 14 | -12 | 26 |
| Jun | 36 | 10 | -18 | 28 |
Show JSONHide JSON
{
"version": 1,
"root": "chart",
"elements": {
"chart": {
"type": "Chart",
"props": {
"type": "bar",
"stacked": true,
"title": "Net seats by source",
"labels": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
"series": [
{ "name": "New", "values": [30, 42, 18, 50, 24, 36] },
{ "name": "Expansion", "values": [12, 8, 20, 8, 14, 10] },
{ "name": "Churn", "values": [-15, -22, -8, -30, -12, -18] }
]
}
}
}
}- us-east
- eu-west
- ap-south
| Label | us-east | eu-west | ap-south | Total |
|---|---|---|---|---|
| Jan | 820K | 410K | 90K | 1.3M |
| Feb | 910K | 450K | 120K | 1.5M |
| Mar | 960K | 520K | 160K | 1.6M |
| Apr | 1M | 540K | 210K | 1.8M |
| May | 1.1M | 600K | 260K | 2M |
| Jun | 1.2M | 640K | 330K | 2.2M |
Show JSONHide JSON
{
"version": 1,
"root": "chart",
"elements": {
"chart": {
"type": "Chart",
"props": {
"type": "area",
"stacked": true,
"title": "Requests by region",
"format": "compact",
"labels": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
"series": [
{
"name": "us-east",
"values": [820000, 910000, 960000, 1020000, 1100000, 1240000]
},
{
"name": "eu-west",
"values": [410000, 450000, 520000, 540000, 600000, 640000]
},
{
"name": "ap-south",
"values": [90000, 120000, 160000, 210000, 260000, 330000]
}
]
}
}
}
}Gaps and negativesLink to this section
Write null for a missing value. Lines and areas break there instead of guessing.
null leaves a gap; the line does not invent a value for March.
| Label | Margin |
|---|---|
| Jan | -12% |
| Feb | -4% |
| Mar | — |
| Apr | 6% |
| May | 11% |
| Jun | 18% |
Show JSONHide JSON
{
"version": 1,
"root": "chart",
"elements": {
"chart": {
"type": "Chart",
"props": {
"type": "line",
"title": "Margin",
"format": "percent",
"labels": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
"series": [{ "name": "Margin", "values": [-12, -4, null, 6, 11, 18] }]
}
}
}
}Pie and donutLink to this section
Pie and donut take exactly one series. labels name the slices, and values must be zero or more. With more than 8 slices, the 7 largest stay and the rest fold into one "Other" slice. The legend shows each slice's value and share; a donut shows the total in the middle.
- Config1440%
- Deploy925.7%
- Capacity617.1%
- Dependency411.4%
- Other25.7%
| Label | Incidents | Share |
|---|---|---|
| Config | 14 | 40% |
| Deploy | 9 | 25.7% |
| Capacity | 6 | 17.1% |
| Dependency | 4 | 11.4% |
| Other | 2 | 5.7% |
Show JSONHide JSON
{
"version": 1,
"root": "chart",
"elements": {
"chart": {
"type": "Chart",
"props": {
"type": "pie",
"title": "Incidents by cause",
"labels": ["Config", "Deploy", "Capacity", "Dependency", "Other"],
"series": [{ "name": "Incidents", "values": [14, 9, 6, 4, 2] }]
}
}
}
}- Neon€1,250.0053.2%
- Vercel€980.5041.7%
- Cloudflare€120.005.1%
| Label | Spend | Share |
|---|---|---|
| Neon | €1,250.00 | 53.2% |
| Vercel | €980.50 | 41.7% |
| Cloudflare | €120.00 | 5.1% |
Show JSONHide JSON
{
"version": 1,
"root": "chart",
"elements": {
"chart": {
"type": "Chart",
"props": {
"type": "donut",
"title": "Spend by vendor",
"format": "currency",
"currency": "EUR",
"labels": ["Neon", "Vercel", "Cloudflare"],
"series": [{ "name": "Spend", "values": [1250, 980.5, 120] }]
}
}
}
}ScatterLink to this section
Scatter series carry points instead of values: { "x": 4, "y": 38, "label": "optional" }, up to 500 per series, and the chart has no labels. format styles y values and xFormat styles x values. Keep to 3 series or fewer so the colors stay easy to tell apart.
- Edge
- Origin
p95 latency (ms)
Payload (KB)
| Series | Label | Payload (KB) | p95 latency (ms) |
|---|---|---|---|
| Edge | GET /a | 4 | 38 |
| Origin | 6 | 120 | |
| Edge | 12 | 52 | |
| Origin | 18 | 140 | |
| Edge | 30 | 61 | |
| Origin | 40 | 182 | |
| Edge | POST /upload | 64 | 90 |
| Origin | POST /upload | 80 | 260 |
Show JSONHide JSON
{
"version": 1,
"root": "chart",
"elements": {
"chart": {
"type": "Chart",
"props": {
"type": "scatter",
"title": "Latency against payload size",
"xLabel": "Payload (KB)",
"yLabel": "p95 latency (ms)",
"series": [
{
"name": "Edge",
"points": [
{ "x": 4, "y": 38, "label": "GET /a" },
{ "x": 12, "y": 52 },
{ "x": 30, "y": 61 },
{ "x": 64, "y": 90, "label": "POST /upload" }
]
},
{
"name": "Origin",
"points": [
{ "x": 6, "y": 120 },
{ "x": 18, "y": 140 },
{ "x": 40, "y": 182 },
{ "x": 80, "y": 260, "label": "POST /upload" }
]
}
]
}
}
}
}Number formatsLink to this section
format applies to values, axis ticks, tooltips, and the data table. The same rules format Metric, Table, and KeyValue numbers. Values read together, such as an axis or a column, share one decimal count so they line up.
| format | Value | Shows as | Notes |
|---|---|---|---|
| number | 1234.5 | 1,234.5 | Plain numbers. Up to two decimals; whole numbers show none. |
| compact | 1250000 | 1.3M | Short form for big numbers. Values under 1 use the plain rules. |
| percent | 12.5 | 12.5% | The value is already a percent: 12.5 shows as 12.5%, not 1,250%. |
| currency | 28.5 | $28.50 | Uses currency (default USD) and its minor unit. |
| currency (JPY) | 1200 | ¥1,200 | Yen has no minor unit, so no decimals. |
| currency, sub-cent | 0.0042 | $0.0042 | Smaller than one cent keeps two significant digits, never $0.00. |
| currency, huge | 2e15 | USD 2.00e+15 | From 10¹⁵ up, numbers switch to scientific notation. |
| Label | Share |
|---|---|
| A | 12.5% |
| B | 40.0% |
| C | 47.5% |
| Label | Views |
|---|---|
| A | 12.4K |
| B | 1.3M |
| C | 98M |
| Label | Cost |
|---|---|
| A | ¥1,200 |
| B | ¥45,000 |
| C | ¥980 |
| Label | Count |
|---|---|
| A | 2.50 |
| B | 14.00 |
| C | 7.25 |
Show JSONHide JSON
{
"version": 1,
"root": "grid",
"elements": {
"grid": {
"type": "Grid",
"props": { "columns": 2 },
"children": ["as-percent", "as-compact", "as-currency", "as-number"]
},
"as-percent": {
"type": "Chart",
"props": {
"type": "bar",
"title": "percent",
"format": "percent",
"height": "sm",
"labels": ["A", "B", "C"],
"series": [{ "name": "Share", "values": [12.5, 40, 47.5] }]
}
},
"as-compact": {
"type": "Chart",
"props": {
"type": "bar",
"title": "compact",
"format": "compact",
"height": "sm",
"labels": ["A", "B", "C"],
"series": [{ "name": "Views", "values": [12400, 1250000, 98000000] }]
}
},
"as-currency": {
"type": "Chart",
"props": {
"type": "bar",
"title": "currency (JPY)",
"format": "currency",
"currency": "JPY",
"height": "sm",
"labels": ["A", "B", "C"],
"series": [{ "name": "Cost", "values": [1200, 45000, 980] }]
}
},
"as-number": {
"type": "Chart",
"props": {
"type": "bar",
"title": "number",
"height": "sm",
"labels": ["A", "B", "C"],
"series": [{ "name": "Count", "values": [2.5, 14, 7.25] }]
}
}
}
}CurrencyLink to this section
currencyis a three-letter ISO 4217 code such asUSD,EUR, orJPY. It applies only whenformatiscurrency, and defaults to USD.- Amounts use the currency's minor unit: two decimals for USD and EUR ($28.50), none for JPY. Whole amounts drop the decimals ($1,430) unless others on the same axis need them.
- A code the browser does not know still renders, as
CODE 1,234. - For a Metric,
changeuseschangeFormat, which defaults to the value's format. A revenue metric usually setschangeFormat: "percent"so a 12.4 change reads +12.4%, not +$12.40.
Chart rulesLink to this section
Validation checks the data shape for each type. These are the real messages:
| Mistake | Message |
|---|---|
| Fewer values than labels | Series "Deploys" has 3 values but there are 4 labels. Give each series one value per label (use null for a gap). |
| Two series on a pie | A pie chart shows one series, but there are 2. Put one value per slice in series[0].values and the slice names in labels. For several series, use a bar chart. |
| stacked on a line chart | stacked works with bar and area charts only, not line. Remove stacked. |
| values on a scatter chart | Series "Runs" has values, but a scatter chart reads `points`: [{ "x": 1, "y": 2 }, …]. Move the data into points. |