A landscape spread of up to eleven small illustrations of one subject, each a different graphic form, in three bands of unequal panels: a statement in large type, spokes round an icon and a network of circles; a smooth trend with its peak labelled, nested squares and a slope chart; a pill ranking, a treemap, a tile map and sized circles; and a closing row of icon statements.
Area chart
Shows a quantity over time as a filled area from zero: one series, stacked series, shares of 100%, or a streamgraph.
- Use when
- A volume or cumulative quantity over time where the filled magnitude matters; stacked when the total and its composition both matter; percent when only the mix matters; stream for the changing mix of many series over a long period.
- Avoid when
- Comparing the trajectories of several series against each other (use line chart: only the bottom band of a stack has a flat baseline); a few time points (use bar chart with stack); more than about 6 bands.
Preview
World solar capacity rose from 180 GW in 2014 to 1,610 GW in 2023
Cumulative installed solar PV capacity, gigawatts
import { AreaChart } from "insightcharts";
const data = [
{ year: "2014", gw: 180 },
{ year: "2015", gw: 229 },
{ year: "2016", gw: 306 },
{ year: "2017", gw: 405 },
{ year: "2018", gw: 512 },
{ year: "2019", gw: 633 },
{ year: "2020", gw: 774 },
{ year: "2021", gw: 945 },
{ year: "2022", gw: 1177 },
{ year: "2023", gw: 1610 },
];
export function Example() {
return (
<AreaChart
data={data}
x="year"
y="gw"
names={{ gw: "Installed solar capacity" }}
format={"{value} GW"}
title="World solar capacity rose from 180 GW in 2014 to 1,610 GW in 2023"
subtitle="Cumulative installed solar PV capacity, gigawatts"
source="IRENA, Renewable Capacity Statistics (rounded)"
note="Figures are approximate, for illustration"
/>
);
}{
"type": "area-chart",
"data": [
{ "year": "2014", "gw": 180 },
{ "year": "2015", "gw": 229 },
{ "year": "2016", "gw": 306 },
{ "year": "2017", "gw": 405 },
{ "year": "2018", "gw": 512 },
{ "year": "2019", "gw": 633 },
{ "year": "2020", "gw": 774 },
{ "year": "2021", "gw": 945 },
{ "year": "2022", "gw": 1177 },
{ "year": "2023", "gw": 1610 }
],
"x": "year",
"y": "gw",
"names": { "gw": "Installed solar capacity" },
"format": "{value} GW",
"title": "World solar capacity rose from 180 GW in 2014 to 1,610 GW in 2023",
"subtitle": "Cumulative installed solar PV capacity, gigawatts",
"source": "IRENA, Renewable Capacity Statistics (rounded)",
"note": "Figures are approximate, for illustration"
}Render with import { Insight } from "insightcharts" and <Insight spec={spec} />. Nested specs resolve by name; nothing else to import.
Composition
Used in
1 infographic uses area chart.
Infographics
1Installation
$ pnpm dlx shadcn@latest add @insightcharts/area-chartThe CLI copies the source into your project and needs the @insightcharts registry in components.json; see installation. With the package, import it by name:
import { AreaChart } from "insightcharts";Examples
Stacked, labelled in the bands
Wind and solar generated 4,620 TWh of electricity in 2024
World electricity generation by source, terawatt-hours
import { AreaChart } from "insightcharts";
const data = [
{
year: "2000",
Coal: 5990,
Gas: 2770,
Nuclear: 2540,
Hydro: 2620,
"Wind and solar": 32,
},
{
year: "2004",
Coal: 6940,
Gas: 3450,
Nuclear: 2700,
Hydro: 2810,
"Wind and solar": 88,
},
{
year: "2008",
Coal: 8260,
Gas: 4300,
Nuclear: 2660,
Hydro: 3250,
"Wind and solar": 233,
},
{
year: "2012",
Coal: 9170,
Gas: 5100,
Nuclear: 2400,
Hydro: 3650,
"Wind and solar": 630,
},
{
year: "2016",
Coal: 9450,
Gas: 5800,
Nuclear: 2540,
Hydro: 4020,
"Wind and solar": 1290,
},
{
year: "2020",
Coal: 9440,
Gas: 6370,
Nuclear: 2640,
Hydro: 4350,
"Wind and solar": 2440,
},
{
year: "2024",
Coal: 10590,
Gas: 6790,
Nuclear: 2770,
Hydro: 4410,
"Wind and solar": 4620,
},
];
export function Example() {
return (
<AreaChart
data={data}
x="year"
y={["Coal", "Gas", "Hydro", "Nuclear", "Wind and solar"]}
stack
format="compact"
title="Wind and solar generated 4,620 TWh of electricity in 2024"
subtitle="World electricity generation by source, terawatt-hours"
source="Ember, Global Electricity Review (rounded)"
note="Figures are approximate, for illustration"
/>
);
}{
"type": "area-chart",
"data": [
{
"year": "2000",
"Coal": 5990,
"Gas": 2770,
"Nuclear": 2540,
"Hydro": 2620,
"Wind and solar": 32
},
{
"year": "2004",
"Coal": 6940,
"Gas": 3450,
"Nuclear": 2700,
"Hydro": 2810,
"Wind and solar": 88
},
{
"year": "2008",
"Coal": 8260,
"Gas": 4300,
"Nuclear": 2660,
"Hydro": 3250,
"Wind and solar": 233
},
{
"year": "2012",
"Coal": 9170,
"Gas": 5100,
"Nuclear": 2400,
"Hydro": 3650,
"Wind and solar": 630
},
{
"year": "2016",
"Coal": 9450,
"Gas": 5800,
"Nuclear": 2540,
"Hydro": 4020,
"Wind and solar": 1290
},
{
"year": "2020",
"Coal": 9440,
"Gas": 6370,
"Nuclear": 2640,
"Hydro": 4350,
"Wind and solar": 2440
},
{
"year": "2024",
"Coal": 10590,
"Gas": 6790,
"Nuclear": 2770,
"Hydro": 4410,
"Wind and solar": 4620
}
],
"x": "year",
"y": ["Coal", "Gas", "Hydro", "Nuclear", "Wind and solar"],
"stack": true,
"format": "compact",
"title": "Wind and solar generated 4,620 TWh of electricity in 2024",
"subtitle": "World electricity generation by source, terawatt-hours",
"source": "Ember, Global Electricity Review (rounded)",
"note": "Figures are approximate, for illustration"
}Render with import { Insight } from "insightcharts" and <Insight spec={spec} />. Nested specs resolve by name; nothing else to import.
100% stacked with highlight
Wind and solar's share of electricity rose from 0.2% in 2000 to 15.8% in 2024
Share of world electricity generation
import { AreaChart } from "insightcharts";
const data = [
{
year: "2000",
Coal: 5990,
Gas: 2770,
Nuclear: 2540,
Hydro: 2620,
"Wind and solar": 32,
},
{
year: "2004",
Coal: 6940,
Gas: 3450,
Nuclear: 2700,
Hydro: 2810,
"Wind and solar": 88,
},
{
year: "2008",
Coal: 8260,
Gas: 4300,
Nuclear: 2660,
Hydro: 3250,
"Wind and solar": 233,
},
{
year: "2012",
Coal: 9170,
Gas: 5100,
Nuclear: 2400,
Hydro: 3650,
"Wind and solar": 630,
},
{
year: "2016",
Coal: 9450,
Gas: 5800,
Nuclear: 2540,
Hydro: 4020,
"Wind and solar": 1290,
},
{
year: "2020",
Coal: 9440,
Gas: 6370,
Nuclear: 2640,
Hydro: 4350,
"Wind and solar": 2440,
},
{
year: "2024",
Coal: 10590,
Gas: 6790,
Nuclear: 2770,
Hydro: 4410,
"Wind and solar": 4620,
},
];
export function Example() {
return (
<AreaChart
data={data}
x="year"
y={["Coal", "Gas", "Hydro", "Nuclear", "Wind and solar"]}
stack="percent"
highlight="Wind and solar"
title="Wind and solar's share of electricity rose from 0.2% in 2000 to 15.8% in 2024"
subtitle="Share of world electricity generation"
source="Ember, Global Electricity Review (rounded)"
note="Figures are approximate, for illustration"
/>
);
}{
"type": "area-chart",
"data": [
{
"year": "2000",
"Coal": 5990,
"Gas": 2770,
"Nuclear": 2540,
"Hydro": 2620,
"Wind and solar": 32
},
{
"year": "2004",
"Coal": 6940,
"Gas": 3450,
"Nuclear": 2700,
"Hydro": 2810,
"Wind and solar": 88
},
{
"year": "2008",
"Coal": 8260,
"Gas": 4300,
"Nuclear": 2660,
"Hydro": 3250,
"Wind and solar": 233
},
{
"year": "2012",
"Coal": 9170,
"Gas": 5100,
"Nuclear": 2400,
"Hydro": 3650,
"Wind and solar": 630
},
{
"year": "2016",
"Coal": 9450,
"Gas": 5800,
"Nuclear": 2540,
"Hydro": 4020,
"Wind and solar": 1290
},
{
"year": "2020",
"Coal": 9440,
"Gas": 6370,
"Nuclear": 2640,
"Hydro": 4350,
"Wind and solar": 2440
},
{
"year": "2024",
"Coal": 10590,
"Gas": 6790,
"Nuclear": 2770,
"Hydro": 4410,
"Wind and solar": 4620
}
],
"x": "year",
"y": ["Coal", "Gas", "Hydro", "Nuclear", "Wind and solar"],
"stack": "percent",
"highlight": "Wind and solar",
"title": "Wind and solar's share of electricity rose from 0.2% in 2000 to 15.8% in 2024",
"subtitle": "Share of world electricity generation",
"source": "Ember, Global Electricity Review (rounded)",
"note": "Figures are approximate, for illustration"
}Render with import { Insight } from "insightcharts" and <Insight spec={spec} />. Nested specs resolve by name; nothing else to import.
Streamgraph, long format
Monthly hours watched by genre, 2021 to 2024
Millions of hours per month, six genres
import { AreaChart } from "insightcharts";
const data = [
{ month: "2021-01-01", genre: "Drama", hours: 58 },
{ month: "2021-02-01", genre: "Drama", hours: 58 },
{ month: "2021-03-01", genre: "Drama", hours: 58 },
{ month: "2021-04-01", genre: "Drama", hours: 55 },
{ month: "2021-05-01", genre: "Drama", hours: 50 },
{ month: "2021-06-01", genre: "Drama", hours: 45 },
{ month: "2021-07-01", genre: "Drama", hours: 38 },
{ month: "2021-08-01", genre: "Drama", hours: 31 },
{ month: "2021-09-01", genre: "Drama", hours: 24 },
{ month: "2021-10-01", genre: "Drama", hours: 19 },
{ month: "2021-11-01", genre: "Drama", hours: 16 },
{ month: "2021-12-01", genre: "Drama", hours: 17 },
{ month: "2022-01-01", genre: "Drama", hours: 22 },
{ month: "2022-02-01", genre: "Drama", hours: 29 },
{ month: "2022-03-01", genre: "Drama", hours: 40 },
{ month: "2022-04-01", genre: "Drama", hours: 52 },
{ month: "2022-05-01", genre: "Drama", hours: 64 },
{ month: "2022-06-01", genre: "Drama", hours: 75 },
{ month: "2022-07-01", genre: "Drama", hours: 83 },
{ month: "2022-08-01", genre: "Drama", hours: 88 },
{ month: "2022-09-01", genre: "Drama", hours: 91 },
{ month: "2022-10-01", genre: "Drama", hours: 90 },
{ month: "2022-11-01", genre: "Drama", hours: 86 },
{ month: "2022-12-01", genre: "Drama", hours: 83 },
{ month: "2023-01-01", genre: "Drama", hours: 78 },
{ month: "2023-02-01", genre: "Drama", hours: 75 },
{ month: "2023-03-01", genre: "Drama", hours: 72 },
{ month: "2023-04-01", genre: "Drama", hours: 71 },
{ month: "2023-05-01", genre: "Drama", hours: 71 },
{ month: "2023-06-01", genre: "Drama", hours: 72 },
{ month: "2023-07-01", genre: "Drama", hours: 73 },
{ month: "2023-08-01", genre: "Drama", hours: 73 },
{ month: "2023-09-01", genre: "Drama", hours: 69 },
{ month: "2023-10-01", genre: "Drama", hours: 63 },
{ month: "2023-11-01", genre: "Drama", hours: 57 },
{ month: "2023-12-01", genre: "Drama", hours: 47 },
{ month: "2024-01-01", genre: "Drama", hours: 37 },
{ month: "2024-02-01", genre: "Drama", hours: 27 },
{ month: "2024-03-01", genre: "Drama", hours: 20 },
{ month: "2024-04-01", genre: "Drama", hours: 13 },
{ month: "2024-05-01", genre: "Drama", hours: 13 },
{ month: "2024-06-01", genre: "Drama", hours: 15 },
{ month: "2024-07-01", genre: "Drama", hours: 20 },
{ month: "2024-08-01", genre: "Drama", hours: 28 },
{ month: "2024-09-01", genre: "Drama", hours: 39 },
{ month: "2024-10-01", genre: "Drama", hours: 51 },
{ month: "2024-11-01", genre: "Drama", hours: 60 },
{ month: "2024-12-01", genre: "Drama", hours: 69 },
{ month: "2021-01-01", genre: "Comedy", hours: 85 },
{ month: "2021-02-01", genre: "Comedy", hours: 78 },
{ month: "2021-03-01", genre: "Comedy", hours: 73 },
{ month: "2021-04-01", genre: "Comedy", hours: 67 },
{ month: "2021-05-01", genre: "Comedy", hours: 66 },
{ month: "2021-06-01", genre: "Comedy", hours: 65 },
{ month: "2021-07-01", genre: "Comedy", hours: 66 },
{ month: "2021-08-01", genre: "Comedy", hours: 66 },
{ month: "2021-09-01", genre: "Comedy", hours: 67 },
{ month: "2021-10-01", genre: "Comedy", hours: 67 },
{ month: "2021-11-01", genre: "Comedy", hours: 64 },
{ month: "2021-12-01", genre: "Comedy", hours: 61 },
{ month: "2022-01-01", genre: "Comedy", hours: 53 },
{ month: "2022-02-01", genre: "Comedy", hours: 45 },
{ month: "2022-03-01", genre: "Comedy", hours: 35 },
{ month: "2022-04-01", genre: "Comedy", hours: 26 },
{ month: "2022-05-01", genre: "Comedy", hours: 19 },
{ month: "2022-06-01", genre: "Comedy", hours: 15 },
{ month: "2022-07-01", genre: "Comedy", hours: 12 },
{ month: "2022-08-01", genre: "Comedy", hours: 13 },
{ month: "2022-09-01", genre: "Comedy", hours: 19 },
{ month: "2022-10-01", genre: "Comedy", hours: 26 },
{ month: "2022-11-01", genre: "Comedy", hours: 33 },
{ month: "2022-12-01", genre: "Comedy", hours: 42 },
{ month: "2023-01-01", genre: "Comedy", hours: 50 },
{ month: "2023-02-01", genre: "Comedy", hours: 56 },
{ month: "2023-03-01", genre: "Comedy", hours: 60 },
{ month: "2023-04-01", genre: "Comedy", hours: 61 },
{ month: "2023-05-01", genre: "Comedy", hours: 60 },
{ month: "2023-06-01", genre: "Comedy", hours: 60 },
{ month: "2023-07-01", genre: "Comedy", hours: 59 },
{ month: "2023-08-01", genre: "Comedy", hours: 59 },
{ month: "2023-09-01", genre: "Comedy", hours: 61 },
{ month: "2023-10-01", genre: "Comedy", hours: 66 },
{ month: "2023-11-01", genre: "Comedy", hours: 71 },
{ month: "2023-12-01", genre: "Comedy", hours: 80 },
{ month: "2024-01-01", genre: "Comedy", hours: 86 },
{ month: "2024-02-01", genre: "Comedy", hours: 93 },
{ month: "2024-03-01", genre: "Comedy", hours: 96 },
{ month: "2024-04-01", genre: "Comedy", hours: 98 },
{ month: "2024-05-01", genre: "Comedy", hours: 98 },
{ month: "2024-06-01", genre: "Comedy", hours: 92 },
{ month: "2024-07-01", genre: "Comedy", hours: 84 },
{ month: "2024-08-01", genre: "Comedy", hours: 74 },
{ month: "2024-09-01", genre: "Comedy", hours: 65 },
{ month: "2024-10-01", genre: "Comedy", hours: 55 },
{ month: "2024-11-01", genre: "Comedy", hours: 48 },
{ month: "2024-12-01", genre: "Comedy", hours: 42 },
{ month: "2021-01-01", genre: "Action", hours: 59 },
{ month: "2021-02-01", genre: "Action", hours: 57 },
{ month: "2021-03-01", genre: "Action", hours: 53 },
{ month: "2021-04-01", genre: "Action", hours: 48 },
{ month: "2021-05-01", genre: "Action", hours: 41 },
{ month: "2021-06-01", genre: "Action", hours: 33 },
{ month: "2021-07-01", genre: "Action", hours: 24 },
{ month: "2021-08-01", genre: "Action", hours: 17 },
{ month: "2021-09-01", genre: "Action", hours: 13 },
{ month: "2021-10-01", genre: "Action", hours: 14 },
{ month: "2021-11-01", genre: "Action", hours: 18 },
{ month: "2021-12-01", genre: "Action", hours: 22 },
{ month: "2022-01-01", genre: "Action", hours: 32 },
{ month: "2022-02-01", genre: "Action", hours: 40 },
{ month: "2022-03-01", genre: "Action", hours: 50 },
{ month: "2022-04-01", genre: "Action", hours: 58 },
{ month: "2022-05-01", genre: "Action", hours: 62 },
{ month: "2022-06-01", genre: "Action", hours: 66 },
{ month: "2022-07-01", genre: "Action", hours: 67 },
{ month: "2022-08-01", genre: "Action", hours: 66 },
{ month: "2022-09-01", genre: "Action", hours: 64 },
{ month: "2022-10-01", genre: "Action", hours: 62 },
{ month: "2022-11-01", genre: "Action", hours: 63 },
{ month: "2022-12-01", genre: "Action", hours: 64 },
{ month: "2023-01-01", genre: "Action", hours: 68 },
{ month: "2023-02-01", genre: "Action", hours: 76 },
{ month: "2023-03-01", genre: "Action", hours: 84 },
{ month: "2023-04-01", genre: "Action", hours: 92 },
{ month: "2023-05-01", genre: "Action", hours: 101 },
{ month: "2023-06-01", genre: "Action", hours: 107 },
{ month: "2023-07-01", genre: "Action", hours: 110 },
{ month: "2023-08-01", genre: "Action", hours: 107 },
{ month: "2023-09-01", genre: "Action", hours: 104 },
{ month: "2023-10-01", genre: "Action", hours: 98 },
{ month: "2023-11-01", genre: "Action", hours: 89 },
{ month: "2023-12-01", genre: "Action", hours: 80 },
{ month: "2024-01-01", genre: "Action", hours: 71 },
{ month: "2024-02-01", genre: "Action", hours: 63 },
{ month: "2024-03-01", genre: "Action", hours: 59 },
{ month: "2024-04-01", genre: "Action", hours: 57 },
{ month: "2024-05-01", genre: "Action", hours: 56 },
{ month: "2024-06-01", genre: "Action", hours: 59 },
{ month: "2024-07-01", genre: "Action", hours: 59 },
{ month: "2024-08-01", genre: "Action", hours: 61 },
{ month: "2024-09-01", genre: "Action", hours: 62 },
{ month: "2024-10-01", genre: "Action", hours: 58 },
{ month: "2024-11-01", genre: "Action", hours: 53 },
{ month: "2024-12-01", genre: "Action", hours: 46 },
{ month: "2021-01-01", genre: "Documentary", hours: 29 },
{ month: "2021-02-01", genre: "Documentary", hours: 36 },
{ month: "2021-03-01", genre: "Documentary", hours: 46 },
{ month: "2021-04-01", genre: "Documentary", hours: 58 },
{ month: "2021-05-01", genre: "Documentary", hours: 72 },
{ month: "2021-06-01", genre: "Documentary", hours: 86 },
{ month: "2021-07-01", genre: "Documentary", hours: 96 },
{ month: "2021-08-01", genre: "Documentary", hours: 103 },
{ month: "2021-09-01", genre: "Documentary", hours: 108 },
{ month: "2021-10-01", genre: "Documentary", hours: 109 },
{ month: "2021-11-01", genre: "Documentary", hours: 107 },
{ month: "2021-12-01", genre: "Documentary", hours: 103 },
{ month: "2022-01-01", genre: "Documentary", hours: 99 },
{ month: "2022-02-01", genre: "Documentary", hours: 96 },
{ month: "2022-03-01", genre: "Documentary", hours: 97 },
{ month: "2022-04-01", genre: "Documentary", hours: 100 },
{ month: "2022-05-01", genre: "Documentary", hours: 107 },
{ month: "2022-06-01", genre: "Documentary", hours: 114 },
{ month: "2022-07-01", genre: "Documentary", hours: 123 },
{ month: "2022-08-01", genre: "Documentary", hours: 131 },
{ month: "2022-09-01", genre: "Documentary", hours: 139 },
{ month: "2022-10-01", genre: "Documentary", hours: 141 },
{ month: "2022-11-01", genre: "Documentary", hours: 140 },
{ month: "2022-12-01", genre: "Documentary", hours: 134 },
{ month: "2023-01-01", genre: "Documentary", hours: 124 },
{ month: "2023-02-01", genre: "Documentary", hours: 112 },
{ month: "2023-03-01", genre: "Documentary", hours: 100 },
{ month: "2023-04-01", genre: "Documentary", hours: 89 },
{ month: "2023-05-01", genre: "Documentary", hours: 78 },
{ month: "2023-06-01", genre: "Documentary", hours: 73 },
{ month: "2023-07-01", genre: "Documentary", hours: 69 },
{ month: "2023-08-01", genre: "Documentary", hours: 70 },
{ month: "2023-09-01", genre: "Documentary", hours: 73 },
{ month: "2023-10-01", genre: "Documentary", hours: 76 },
{ month: "2023-11-01", genre: "Documentary", hours: 79 },
{ month: "2023-12-01", genre: "Documentary", hours: 78 },
{ month: "2024-01-01", genre: "Documentary", hours: 75 },
{ month: "2024-02-01", genre: "Documentary", hours: 70 },
{ month: "2024-03-01", genre: "Documentary", hours: 60 },
{ month: "2024-04-01", genre: "Documentary", hours: 49 },
{ month: "2024-05-01", genre: "Documentary", hours: 39 },
{ month: "2024-06-01", genre: "Documentary", hours: 28 },
{ month: "2024-07-01", genre: "Documentary", hours: 22 },
{ month: "2024-08-01", genre: "Documentary", hours: 18 },
{ month: "2024-09-01", genre: "Documentary", hours: 18 },
{ month: "2024-10-01", genre: "Documentary", hours: 23 },
{ month: "2024-11-01", genre: "Documentary", hours: 31 },
{ month: "2024-12-01", genre: "Documentary", hours: 41 },
{ month: "2021-01-01", genre: "Horror", hours: 80 },
{ month: "2021-02-01", genre: "Horror", hours: 77 },
{ month: "2021-03-01", genre: "Horror", hours: 78 },
{ month: "2021-04-01", genre: "Horror", hours: 81 },
{ month: "2021-05-01", genre: "Horror", hours: 84 },
{ month: "2021-06-01", genre: "Horror", hours: 88 },
{ month: "2021-07-01", genre: "Horror", hours: 90 },
{ month: "2021-08-01", genre: "Horror", hours: 89 },
{ month: "2021-09-01", genre: "Horror", hours: 84 },
{ month: "2021-10-01", genre: "Horror", hours: 77 },
{ month: "2021-11-01", genre: "Horror", hours: 66 },
{ month: "2021-12-01", genre: "Horror", hours: 56 },
{ month: "2022-01-01", genre: "Horror", hours: 45 },
{ month: "2022-02-01", genre: "Horror", hours: 35 },
{ month: "2022-03-01", genre: "Horror", hours: 29 },
{ month: "2022-04-01", genre: "Horror", hours: 24 },
{ month: "2022-05-01", genre: "Horror", hours: 25 },
{ month: "2022-06-01", genre: "Horror", hours: 27 },
{ month: "2022-07-01", genre: "Horror", hours: 33 },
{ month: "2022-08-01", genre: "Horror", hours: 39 },
{ month: "2022-09-01", genre: "Horror", hours: 44 },
{ month: "2022-10-01", genre: "Horror", hours: 47 },
{ month: "2022-11-01", genre: "Horror", hours: 49 },
{ month: "2022-12-01", genre: "Horror", hours: 47 },
{ month: "2023-01-01", genre: "Horror", hours: 43 },
{ month: "2023-02-01", genre: "Horror", hours: 37 },
{ month: "2023-03-01", genre: "Horror", hours: 32 },
{ month: "2023-04-01", genre: "Horror", hours: 29 },
{ month: "2023-05-01", genre: "Horror", hours: 26 },
{ month: "2023-06-01", genre: "Horror", hours: 27 },
{ month: "2023-07-01", genre: "Horror", hours: 30 },
{ month: "2023-08-01", genre: "Horror", hours: 39 },
{ month: "2023-09-01", genre: "Horror", hours: 47 },
{ month: "2023-10-01", genre: "Horror", hours: 60 },
{ month: "2023-11-01", genre: "Horror", hours: 70 },
{ month: "2023-12-01", genre: "Horror", hours: 79 },
{ month: "2024-01-01", genre: "Horror", hours: 87 },
{ month: "2024-02-01", genre: "Horror", hours: 90 },
{ month: "2024-03-01", genre: "Horror", hours: 90 },
{ month: "2024-04-01", genre: "Horror", hours: 89 },
{ month: "2024-05-01", genre: "Horror", hours: 85 },
{ month: "2024-06-01", genre: "Horror", hours: 83 },
{ month: "2024-07-01", genre: "Horror", hours: 80 },
{ month: "2024-08-01", genre: "Horror", hours: 79 },
{ month: "2024-09-01", genre: "Horror", hours: 83 },
{ month: "2024-10-01", genre: "Horror", hours: 87 },
{ month: "2024-11-01", genre: "Horror", hours: 95 },
{ month: "2024-12-01", genre: "Horror", hours: 103 },
{ month: "2021-01-01", genre: "Animation", hours: 88 },
{ month: "2021-02-01", genre: "Animation", hours: 81 },
{ month: "2021-03-01", genre: "Animation", hours: 76 },
{ month: "2021-04-01", genre: "Animation", hours: 72 },
{ month: "2021-05-01", genre: "Animation", hours: 70 },
{ month: "2021-06-01", genre: "Animation", hours: 71 },
{ month: "2021-07-01", genre: "Animation", hours: 74 },
{ month: "2021-08-01", genre: "Animation", hours: 77 },
{ month: "2021-09-01", genre: "Animation", hours: 81 },
{ month: "2021-10-01", genre: "Animation", hours: 85 },
{ month: "2021-11-01", genre: "Animation", hours: 85 },
{ month: "2021-12-01", genre: "Animation", hours: 84 },
{ month: "2022-01-01", genre: "Animation", hours: 80 },
{ month: "2022-02-01", genre: "Animation", hours: 74 },
{ month: "2022-03-01", genre: "Animation", hours: 65 },
{ month: "2022-04-01", genre: "Animation", hours: 56 },
{ month: "2022-05-01", genre: "Animation", hours: 48 },
{ month: "2022-06-01", genre: "Animation", hours: 40 },
{ month: "2022-07-01", genre: "Animation", hours: 37 },
{ month: "2022-08-01", genre: "Animation", hours: 35 },
{ month: "2022-09-01", genre: "Animation", hours: 34 },
{ month: "2022-10-01", genre: "Animation", hours: 37 },
{ month: "2022-11-01", genre: "Animation", hours: 39 },
{ month: "2022-12-01", genre: "Animation", hours: 43 },
{ month: "2023-01-01", genre: "Animation", hours: 46 },
{ month: "2023-02-01", genre: "Animation", hours: 46 },
{ month: "2023-03-01", genre: "Animation", hours: 43 },
{ month: "2023-04-01", genre: "Animation", hours: 40 },
{ month: "2023-05-01", genre: "Animation", hours: 34 },
{ month: "2023-06-01", genre: "Animation", hours: 26 },
{ month: "2023-07-01", genre: "Animation", hours: 21 },
{ month: "2023-08-01", genre: "Animation", hours: 15 },
{ month: "2023-09-01", genre: "Animation", hours: 13 },
{ month: "2023-10-01", genre: "Animation", hours: 13 },
{ month: "2023-11-01", genre: "Animation", hours: 16 },
{ month: "2023-12-01", genre: "Animation", hours: 22 },
{ month: "2024-01-01", genre: "Animation", hours: 27 },
{ month: "2024-02-01", genre: "Animation", hours: 34 },
{ month: "2024-03-01", genre: "Animation", hours: 41 },
{ month: "2024-04-01", genre: "Animation", hours: 47 },
{ month: "2024-05-01", genre: "Animation", hours: 50 },
{ month: "2024-06-01", genre: "Animation", hours: 49 },
{ month: "2024-07-01", genre: "Animation", hours: 49 },
{ month: "2024-08-01", genre: "Animation", hours: 45 },
{ month: "2024-09-01", genre: "Animation", hours: 43 },
{ month: "2024-10-01", genre: "Animation", hours: 41 },
{ month: "2024-11-01", genre: "Animation", hours: 40 },
{ month: "2024-12-01", genre: "Animation", hours: 42 },
];
export function Example() {
return (
<AreaChart
data={data}
x="month"
y="hours"
series="genre"
stream
format={"{value}m hours"}
title="Monthly hours watched by genre, 2021 to 2024"
subtitle="Millions of hours per month, six genres"
note="Illustrative data"
/>
);
}{
"type": "area-chart",
"data": [
{ "month": "2021-01-01", "genre": "Drama", "hours": 58 },
{ "month": "2021-02-01", "genre": "Drama", "hours": 58 },
{ "month": "2021-03-01", "genre": "Drama", "hours": 58 },
{ "month": "2021-04-01", "genre": "Drama", "hours": 55 },
{ "month": "2021-05-01", "genre": "Drama", "hours": 50 },
{ "month": "2021-06-01", "genre": "Drama", "hours": 45 },
{ "month": "2021-07-01", "genre": "Drama", "hours": 38 },
{ "month": "2021-08-01", "genre": "Drama", "hours": 31 },
{ "month": "2021-09-01", "genre": "Drama", "hours": 24 },
{ "month": "2021-10-01", "genre": "Drama", "hours": 19 },
{ "month": "2021-11-01", "genre": "Drama", "hours": 16 },
{ "month": "2021-12-01", "genre": "Drama", "hours": 17 },
{ "month": "2022-01-01", "genre": "Drama", "hours": 22 },
{ "month": "2022-02-01", "genre": "Drama", "hours": 29 },
{ "month": "2022-03-01", "genre": "Drama", "hours": 40 },
{ "month": "2022-04-01", "genre": "Drama", "hours": 52 },
{ "month": "2022-05-01", "genre": "Drama", "hours": 64 },
{ "month": "2022-06-01", "genre": "Drama", "hours": 75 },
{ "month": "2022-07-01", "genre": "Drama", "hours": 83 },
{ "month": "2022-08-01", "genre": "Drama", "hours": 88 },
{ "month": "2022-09-01", "genre": "Drama", "hours": 91 },
{ "month": "2022-10-01", "genre": "Drama", "hours": 90 },
{ "month": "2022-11-01", "genre": "Drama", "hours": 86 },
{ "month": "2022-12-01", "genre": "Drama", "hours": 83 },
{ "month": "2023-01-01", "genre": "Drama", "hours": 78 },
{ "month": "2023-02-01", "genre": "Drama", "hours": 75 },
{ "month": "2023-03-01", "genre": "Drama", "hours": 72 },
{ "month": "2023-04-01", "genre": "Drama", "hours": 71 },
{ "month": "2023-05-01", "genre": "Drama", "hours": 71 },
{ "month": "2023-06-01", "genre": "Drama", "hours": 72 },
{ "month": "2023-07-01", "genre": "Drama", "hours": 73 },
{ "month": "2023-08-01", "genre": "Drama", "hours": 73 },
{ "month": "2023-09-01", "genre": "Drama", "hours": 69 },
{ "month": "2023-10-01", "genre": "Drama", "hours": 63 },
{ "month": "2023-11-01", "genre": "Drama", "hours": 57 },
{ "month": "2023-12-01", "genre": "Drama", "hours": 47 },
{ "month": "2024-01-01", "genre": "Drama", "hours": 37 },
{ "month": "2024-02-01", "genre": "Drama", "hours": 27 },
{ "month": "2024-03-01", "genre": "Drama", "hours": 20 },
{ "month": "2024-04-01", "genre": "Drama", "hours": 13 },
{ "month": "2024-05-01", "genre": "Drama", "hours": 13 },
{ "month": "2024-06-01", "genre": "Drama", "hours": 15 },
{ "month": "2024-07-01", "genre": "Drama", "hours": 20 },
{ "month": "2024-08-01", "genre": "Drama", "hours": 28 },
{ "month": "2024-09-01", "genre": "Drama", "hours": 39 },
{ "month": "2024-10-01", "genre": "Drama", "hours": 51 },
{ "month": "2024-11-01", "genre": "Drama", "hours": 60 },
{ "month": "2024-12-01", "genre": "Drama", "hours": 69 },
{ "month": "2021-01-01", "genre": "Comedy", "hours": 85 },
{ "month": "2021-02-01", "genre": "Comedy", "hours": 78 },
{ "month": "2021-03-01", "genre": "Comedy", "hours": 73 },
{ "month": "2021-04-01", "genre": "Comedy", "hours": 67 },
{ "month": "2021-05-01", "genre": "Comedy", "hours": 66 },
{ "month": "2021-06-01", "genre": "Comedy", "hours": 65 },
{ "month": "2021-07-01", "genre": "Comedy", "hours": 66 },
{ "month": "2021-08-01", "genre": "Comedy", "hours": 66 },
{ "month": "2021-09-01", "genre": "Comedy", "hours": 67 },
{ "month": "2021-10-01", "genre": "Comedy", "hours": 67 },
{ "month": "2021-11-01", "genre": "Comedy", "hours": 64 },
{ "month": "2021-12-01", "genre": "Comedy", "hours": 61 },
{ "month": "2022-01-01", "genre": "Comedy", "hours": 53 },
{ "month": "2022-02-01", "genre": "Comedy", "hours": 45 },
{ "month": "2022-03-01", "genre": "Comedy", "hours": 35 },
{ "month": "2022-04-01", "genre": "Comedy", "hours": 26 },
{ "month": "2022-05-01", "genre": "Comedy", "hours": 19 },
{ "month": "2022-06-01", "genre": "Comedy", "hours": 15 },
{ "month": "2022-07-01", "genre": "Comedy", "hours": 12 },
{ "month": "2022-08-01", "genre": "Comedy", "hours": 13 },
{ "month": "2022-09-01", "genre": "Comedy", "hours": 19 },
{ "month": "2022-10-01", "genre": "Comedy", "hours": 26 },
{ "month": "2022-11-01", "genre": "Comedy", "hours": 33 },
{ "month": "2022-12-01", "genre": "Comedy", "hours": 42 },
{ "month": "2023-01-01", "genre": "Comedy", "hours": 50 },
{ "month": "2023-02-01", "genre": "Comedy", "hours": 56 },
{ "month": "2023-03-01", "genre": "Comedy", "hours": 60 },
{ "month": "2023-04-01", "genre": "Comedy", "hours": 61 },
{ "month": "2023-05-01", "genre": "Comedy", "hours": 60 },
{ "month": "2023-06-01", "genre": "Comedy", "hours": 60 },
{ "month": "2023-07-01", "genre": "Comedy", "hours": 59 },
{ "month": "2023-08-01", "genre": "Comedy", "hours": 59 },
{ "month": "2023-09-01", "genre": "Comedy", "hours": 61 },
{ "month": "2023-10-01", "genre": "Comedy", "hours": 66 },
{ "month": "2023-11-01", "genre": "Comedy", "hours": 71 },
{ "month": "2023-12-01", "genre": "Comedy", "hours": 80 },
{ "month": "2024-01-01", "genre": "Comedy", "hours": 86 },
{ "month": "2024-02-01", "genre": "Comedy", "hours": 93 },
{ "month": "2024-03-01", "genre": "Comedy", "hours": 96 },
{ "month": "2024-04-01", "genre": "Comedy", "hours": 98 },
{ "month": "2024-05-01", "genre": "Comedy", "hours": 98 },
{ "month": "2024-06-01", "genre": "Comedy", "hours": 92 },
{ "month": "2024-07-01", "genre": "Comedy", "hours": 84 },
{ "month": "2024-08-01", "genre": "Comedy", "hours": 74 },
{ "month": "2024-09-01", "genre": "Comedy", "hours": 65 },
{ "month": "2024-10-01", "genre": "Comedy", "hours": 55 },
{ "month": "2024-11-01", "genre": "Comedy", "hours": 48 },
{ "month": "2024-12-01", "genre": "Comedy", "hours": 42 },
{ "month": "2021-01-01", "genre": "Action", "hours": 59 },
{ "month": "2021-02-01", "genre": "Action", "hours": 57 },
{ "month": "2021-03-01", "genre": "Action", "hours": 53 },
{ "month": "2021-04-01", "genre": "Action", "hours": 48 },
{ "month": "2021-05-01", "genre": "Action", "hours": 41 },
{ "month": "2021-06-01", "genre": "Action", "hours": 33 },
{ "month": "2021-07-01", "genre": "Action", "hours": 24 },
{ "month": "2021-08-01", "genre": "Action", "hours": 17 },
{ "month": "2021-09-01", "genre": "Action", "hours": 13 },
{ "month": "2021-10-01", "genre": "Action", "hours": 14 },
{ "month": "2021-11-01", "genre": "Action", "hours": 18 },
{ "month": "2021-12-01", "genre": "Action", "hours": 22 },
{ "month": "2022-01-01", "genre": "Action", "hours": 32 },
{ "month": "2022-02-01", "genre": "Action", "hours": 40 },
{ "month": "2022-03-01", "genre": "Action", "hours": 50 },
{ "month": "2022-04-01", "genre": "Action", "hours": 58 },
{ "month": "2022-05-01", "genre": "Action", "hours": 62 },
{ "month": "2022-06-01", "genre": "Action", "hours": 66 },
{ "month": "2022-07-01", "genre": "Action", "hours": 67 },
{ "month": "2022-08-01", "genre": "Action", "hours": 66 },
{ "month": "2022-09-01", "genre": "Action", "hours": 64 },
{ "month": "2022-10-01", "genre": "Action", "hours": 62 },
{ "month": "2022-11-01", "genre": "Action", "hours": 63 },
{ "month": "2022-12-01", "genre": "Action", "hours": 64 },
{ "month": "2023-01-01", "genre": "Action", "hours": 68 },
{ "month": "2023-02-01", "genre": "Action", "hours": 76 },
{ "month": "2023-03-01", "genre": "Action", "hours": 84 },
{ "month": "2023-04-01", "genre": "Action", "hours": 92 },
{ "month": "2023-05-01", "genre": "Action", "hours": 101 },
{ "month": "2023-06-01", "genre": "Action", "hours": 107 },
{ "month": "2023-07-01", "genre": "Action", "hours": 110 },
{ "month": "2023-08-01", "genre": "Action", "hours": 107 },
{ "month": "2023-09-01", "genre": "Action", "hours": 104 },
{ "month": "2023-10-01", "genre": "Action", "hours": 98 },
{ "month": "2023-11-01", "genre": "Action", "hours": 89 },
{ "month": "2023-12-01", "genre": "Action", "hours": 80 },
{ "month": "2024-01-01", "genre": "Action", "hours": 71 },
{ "month": "2024-02-01", "genre": "Action", "hours": 63 },
{ "month": "2024-03-01", "genre": "Action", "hours": 59 },
{ "month": "2024-04-01", "genre": "Action", "hours": 57 },
{ "month": "2024-05-01", "genre": "Action", "hours": 56 },
{ "month": "2024-06-01", "genre": "Action", "hours": 59 },
{ "month": "2024-07-01", "genre": "Action", "hours": 59 },
{ "month": "2024-08-01", "genre": "Action", "hours": 61 },
{ "month": "2024-09-01", "genre": "Action", "hours": 62 },
{ "month": "2024-10-01", "genre": "Action", "hours": 58 },
{ "month": "2024-11-01", "genre": "Action", "hours": 53 },
{ "month": "2024-12-01", "genre": "Action", "hours": 46 },
{ "month": "2021-01-01", "genre": "Documentary", "hours": 29 },
{ "month": "2021-02-01", "genre": "Documentary", "hours": 36 },
{ "month": "2021-03-01", "genre": "Documentary", "hours": 46 },
{ "month": "2021-04-01", "genre": "Documentary", "hours": 58 },
{ "month": "2021-05-01", "genre": "Documentary", "hours": 72 },
{ "month": "2021-06-01", "genre": "Documentary", "hours": 86 },
{ "month": "2021-07-01", "genre": "Documentary", "hours": 96 },
{ "month": "2021-08-01", "genre": "Documentary", "hours": 103 },
{ "month": "2021-09-01", "genre": "Documentary", "hours": 108 },
{ "month": "2021-10-01", "genre": "Documentary", "hours": 109 },
{ "month": "2021-11-01", "genre": "Documentary", "hours": 107 },
{ "month": "2021-12-01", "genre": "Documentary", "hours": 103 },
{ "month": "2022-01-01", "genre": "Documentary", "hours": 99 },
{ "month": "2022-02-01", "genre": "Documentary", "hours": 96 },
{ "month": "2022-03-01", "genre": "Documentary", "hours": 97 },
{ "month": "2022-04-01", "genre": "Documentary", "hours": 100 },
{ "month": "2022-05-01", "genre": "Documentary", "hours": 107 },
{ "month": "2022-06-01", "genre": "Documentary", "hours": 114 },
{ "month": "2022-07-01", "genre": "Documentary", "hours": 123 },
{ "month": "2022-08-01", "genre": "Documentary", "hours": 131 },
{ "month": "2022-09-01", "genre": "Documentary", "hours": 139 },
{ "month": "2022-10-01", "genre": "Documentary", "hours": 141 },
{ "month": "2022-11-01", "genre": "Documentary", "hours": 140 },
{ "month": "2022-12-01", "genre": "Documentary", "hours": 134 },
{ "month": "2023-01-01", "genre": "Documentary", "hours": 124 },
{ "month": "2023-02-01", "genre": "Documentary", "hours": 112 },
{ "month": "2023-03-01", "genre": "Documentary", "hours": 100 },
{ "month": "2023-04-01", "genre": "Documentary", "hours": 89 },
{ "month": "2023-05-01", "genre": "Documentary", "hours": 78 },
{ "month": "2023-06-01", "genre": "Documentary", "hours": 73 },
{ "month": "2023-07-01", "genre": "Documentary", "hours": 69 },
{ "month": "2023-08-01", "genre": "Documentary", "hours": 70 },
{ "month": "2023-09-01", "genre": "Documentary", "hours": 73 },
{ "month": "2023-10-01", "genre": "Documentary", "hours": 76 },
{ "month": "2023-11-01", "genre": "Documentary", "hours": 79 },
{ "month": "2023-12-01", "genre": "Documentary", "hours": 78 },
{ "month": "2024-01-01", "genre": "Documentary", "hours": 75 },
{ "month": "2024-02-01", "genre": "Documentary", "hours": 70 },
{ "month": "2024-03-01", "genre": "Documentary", "hours": 60 },
{ "month": "2024-04-01", "genre": "Documentary", "hours": 49 },
{ "month": "2024-05-01", "genre": "Documentary", "hours": 39 },
{ "month": "2024-06-01", "genre": "Documentary", "hours": 28 },
{ "month": "2024-07-01", "genre": "Documentary", "hours": 22 },
{ "month": "2024-08-01", "genre": "Documentary", "hours": 18 },
{ "month": "2024-09-01", "genre": "Documentary", "hours": 18 },
{ "month": "2024-10-01", "genre": "Documentary", "hours": 23 },
{ "month": "2024-11-01", "genre": "Documentary", "hours": 31 },
{ "month": "2024-12-01", "genre": "Documentary", "hours": 41 },
{ "month": "2021-01-01", "genre": "Horror", "hours": 80 },
{ "month": "2021-02-01", "genre": "Horror", "hours": 77 },
{ "month": "2021-03-01", "genre": "Horror", "hours": 78 },
{ "month": "2021-04-01", "genre": "Horror", "hours": 81 },
{ "month": "2021-05-01", "genre": "Horror", "hours": 84 },
{ "month": "2021-06-01", "genre": "Horror", "hours": 88 },
{ "month": "2021-07-01", "genre": "Horror", "hours": 90 },
{ "month": "2021-08-01", "genre": "Horror", "hours": 89 },
{ "month": "2021-09-01", "genre": "Horror", "hours": 84 },
{ "month": "2021-10-01", "genre": "Horror", "hours": 77 },
{ "month": "2021-11-01", "genre": "Horror", "hours": 66 },
{ "month": "2021-12-01", "genre": "Horror", "hours": 56 },
{ "month": "2022-01-01", "genre": "Horror", "hours": 45 },
{ "month": "2022-02-01", "genre": "Horror", "hours": 35 },
{ "month": "2022-03-01", "genre": "Horror", "hours": 29 },
{ "month": "2022-04-01", "genre": "Horror", "hours": 24 },
{ "month": "2022-05-01", "genre": "Horror", "hours": 25 },
{ "month": "2022-06-01", "genre": "Horror", "hours": 27 },
{ "month": "2022-07-01", "genre": "Horror", "hours": 33 },
{ "month": "2022-08-01", "genre": "Horror", "hours": 39 },
{ "month": "2022-09-01", "genre": "Horror", "hours": 44 },
{ "month": "2022-10-01", "genre": "Horror", "hours": 47 },
{ "month": "2022-11-01", "genre": "Horror", "hours": 49 },
{ "month": "2022-12-01", "genre": "Horror", "hours": 47 },
{ "month": "2023-01-01", "genre": "Horror", "hours": 43 },
{ "month": "2023-02-01", "genre": "Horror", "hours": 37 },
{ "month": "2023-03-01", "genre": "Horror", "hours": 32 },
{ "month": "2023-04-01", "genre": "Horror", "hours": 29 },
{ "month": "2023-05-01", "genre": "Horror", "hours": 26 },
{ "month": "2023-06-01", "genre": "Horror", "hours": 27 },
{ "month": "2023-07-01", "genre": "Horror", "hours": 30 },
{ "month": "2023-08-01", "genre": "Horror", "hours": 39 },
{ "month": "2023-09-01", "genre": "Horror", "hours": 47 },
{ "month": "2023-10-01", "genre": "Horror", "hours": 60 },
{ "month": "2023-11-01", "genre": "Horror", "hours": 70 },
{ "month": "2023-12-01", "genre": "Horror", "hours": 79 },
{ "month": "2024-01-01", "genre": "Horror", "hours": 87 },
{ "month": "2024-02-01", "genre": "Horror", "hours": 90 },
{ "month": "2024-03-01", "genre": "Horror", "hours": 90 },
{ "month": "2024-04-01", "genre": "Horror", "hours": 89 },
{ "month": "2024-05-01", "genre": "Horror", "hours": 85 },
{ "month": "2024-06-01", "genre": "Horror", "hours": 83 },
{ "month": "2024-07-01", "genre": "Horror", "hours": 80 },
{ "month": "2024-08-01", "genre": "Horror", "hours": 79 },
{ "month": "2024-09-01", "genre": "Horror", "hours": 83 },
{ "month": "2024-10-01", "genre": "Horror", "hours": 87 },
{ "month": "2024-11-01", "genre": "Horror", "hours": 95 },
{ "month": "2024-12-01", "genre": "Horror", "hours": 103 },
{ "month": "2021-01-01", "genre": "Animation", "hours": 88 },
{ "month": "2021-02-01", "genre": "Animation", "hours": 81 },
{ "month": "2021-03-01", "genre": "Animation", "hours": 76 },
{ "month": "2021-04-01", "genre": "Animation", "hours": 72 },
{ "month": "2021-05-01", "genre": "Animation", "hours": 70 },
{ "month": "2021-06-01", "genre": "Animation", "hours": 71 },
{ "month": "2021-07-01", "genre": "Animation", "hours": 74 },
{ "month": "2021-08-01", "genre": "Animation", "hours": 77 },
{ "month": "2021-09-01", "genre": "Animation", "hours": 81 },
{ "month": "2021-10-01", "genre": "Animation", "hours": 85 },
{ "month": "2021-11-01", "genre": "Animation", "hours": 85 },
{ "month": "2021-12-01", "genre": "Animation", "hours": 84 },
{ "month": "2022-01-01", "genre": "Animation", "hours": 80 },
{ "month": "2022-02-01", "genre": "Animation", "hours": 74 },
{ "month": "2022-03-01", "genre": "Animation", "hours": 65 },
{ "month": "2022-04-01", "genre": "Animation", "hours": 56 },
{ "month": "2022-05-01", "genre": "Animation", "hours": 48 },
{ "month": "2022-06-01", "genre": "Animation", "hours": 40 },
{ "month": "2022-07-01", "genre": "Animation", "hours": 37 },
{ "month": "2022-08-01", "genre": "Animation", "hours": 35 },
{ "month": "2022-09-01", "genre": "Animation", "hours": 34 },
{ "month": "2022-10-01", "genre": "Animation", "hours": 37 },
{ "month": "2022-11-01", "genre": "Animation", "hours": 39 },
{ "month": "2022-12-01", "genre": "Animation", "hours": 43 },
{ "month": "2023-01-01", "genre": "Animation", "hours": 46 },
{ "month": "2023-02-01", "genre": "Animation", "hours": 46 },
{ "month": "2023-03-01", "genre": "Animation", "hours": 43 },
{ "month": "2023-04-01", "genre": "Animation", "hours": 40 },
{ "month": "2023-05-01", "genre": "Animation", "hours": 34 },
{ "month": "2023-06-01", "genre": "Animation", "hours": 26 },
{ "month": "2023-07-01", "genre": "Animation", "hours": 21 },
{ "month": "2023-08-01", "genre": "Animation", "hours": 15 },
{ "month": "2023-09-01", "genre": "Animation", "hours": 13 },
{ "month": "2023-10-01", "genre": "Animation", "hours": 13 },
{ "month": "2023-11-01", "genre": "Animation", "hours": 16 },
{ "month": "2023-12-01", "genre": "Animation", "hours": 22 },
{ "month": "2024-01-01", "genre": "Animation", "hours": 27 },
{ "month": "2024-02-01", "genre": "Animation", "hours": 34 },
{ "month": "2024-03-01", "genre": "Animation", "hours": 41 },
{ "month": "2024-04-01", "genre": "Animation", "hours": 47 },
{ "month": "2024-05-01", "genre": "Animation", "hours": 50 },
{ "month": "2024-06-01", "genre": "Animation", "hours": 49 },
{ "month": "2024-07-01", "genre": "Animation", "hours": 49 },
{ "month": "2024-08-01", "genre": "Animation", "hours": 45 },
{ "month": "2024-09-01", "genre": "Animation", "hours": 43 },
{ "month": "2024-10-01", "genre": "Animation", "hours": 41 },
{ "month": "2024-11-01", "genre": "Animation", "hours": 40 },
{ "month": "2024-12-01", "genre": "Animation", "hours": 42 }
],
"x": "month",
"y": "hours",
"series": "genre",
"stream": true,
"format": "{value}m hours",
"title": "Monthly hours watched by genre, 2021 to 2024",
"subtitle": "Millions of hours per month, six genres",
"note": "Illustrative data"
}Render with import { Insight } from "insightcharts" and <Insight spec={spec} />. Nested specs resolve by name; nothing else to import.
Overlapping washes
July bike-share trips rose from 134,000 in 2023 to 152,000 in 2024
Bike-share trips per month, thousands
import { AreaChart } from "insightcharts";
const data = [
{ "2023": 41, "2024": 52, month: "Jan" },
{ "2023": 44, "2024": 55, month: "Feb" },
{ "2023": 58, "2024": 71, month: "Mar" },
{ "2023": 73, "2024": 80, month: "Apr" },
{ "2023": 96, "2024": 104, month: "May" },
{ "2023": 118, "2024": 131, month: "Jun" },
{ "2023": 134, "2024": 152, month: "Jul" },
{ "2023": 129, "2024": 147, month: "Aug" },
{ "2023": 98, "2024": 117, month: "Sep" },
{ "2023": 70, "2024": 84, month: "Oct" },
{ "2023": 49, "2024": 58, month: "Nov" },
{ "2023": 43, "2024": 50, month: "Dec" },
];
export function Example() {
return (
<AreaChart
data={data}
x="month"
y={["2023", "2024"]}
curve="smooth"
format={"{value}k"}
title="July bike-share trips rose from 134,000 in 2023 to 152,000 in 2024"
subtitle="Bike-share trips per month, thousands"
note="Illustrative data"
/>
);
}{
"type": "area-chart",
"data": [
{ "2023": 41, "2024": 52, "month": "Jan" },
{ "2023": 44, "2024": 55, "month": "Feb" },
{ "2023": 58, "2024": 71, "month": "Mar" },
{ "2023": 73, "2024": 80, "month": "Apr" },
{ "2023": 96, "2024": 104, "month": "May" },
{ "2023": 118, "2024": 131, "month": "Jun" },
{ "2023": 134, "2024": 152, "month": "Jul" },
{ "2023": 129, "2024": 147, "month": "Aug" },
{ "2023": 98, "2024": 117, "month": "Sep" },
{ "2023": 70, "2024": 84, "month": "Oct" },
{ "2023": 49, "2024": 58, "month": "Nov" },
{ "2023": 43, "2024": 50, "month": "Dec" }
],
"x": "month",
"y": ["2023", "2024"],
"curve": "smooth",
"format": "{value}k",
"title": "July bike-share trips rose from 134,000 in 2023 to 152,000 in 2024",
"subtitle": "Bike-share trips per month, thousands",
"note": "Illustrative data"
}Render with import { Insight } from "insightcharts" and <Insight spec={spec} />. Nested specs resolve by name; nothing else to import.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| xrequired | string | Time or ordered category field. ISO dates are placed on a true time axis. | |
| yrequired | string | string[] | Value field, or several (one area each). | |
| series | string | Field that splits rows into areas (long data). | |
| stack | boolean | "percent" | false | Stack the areas; percent normalises every x position to 100%. |
| stream | boolean | false | Streamgraph: stack around a centred baseline. The value axis is dropped because only band thickness is readable. |
| curve | "linear" | "smooth" | "step" | "linear" | Edge shape. A streamgraph defaults to smooth. |
| labels | boolean | Name each band inside itself where it fits; the rest go to the legend. Default: on when stacked. | |
| names | Record<string, string> | Display names for series keys. |
Common chart props 29
Every chart built with defineChart accepts these on top of its own props.
| Prop | Type | Description |
|---|---|---|
| data | DataInput | Rows, CSV text, a URL, { url, path }, an async function, or an Arrow-style table. Omit inside <InsightData>. |
| transform | Transform | Transform[] | A pipeline of transforms applied before drawing. |
| title | string | The title. One plain statement of what the data shows, with the number and the period ("Monthly churn fell from 4.2% to 2.1% in 2024"), or a plain label ("Monthly churn, 2024"). One clause, no figures of speech. |
| subtitle | string | Measure, unit, population, period. |
| source | string | Data source, shown as "Source: ...". |
| note | string | Method notes or caveats. |
| height | number | string | CSS height of the plot. Default 360. |
| aspect | number | Width / height. Overrides height. |
| highlight | string | string[] | The entity (or entities) the title is about. Every other series is drawn in grey. |
| annotations | Annotation[] | Reference lines, shaded bands and callouts, in data coordinates. |
| format | FormatSpec | How to print values: "compact", "percent", "currency:USD", "{value} kg", Intl options, or a function. |
| legend | boolean | Show the legend. Default: shown when there are two or more series. |
| select | boolean | string | Make marks clickable to filter. Inside <InsightData> the selection filters every other chart. Pass a field name, or true to use the chart's category field. |
| onSelect | (values: string[], field: string) => void | Called with the selected values whenever the selection changes. |
| option | EChartsOption | ((option: EChartsOption, ctx: BuildContext) => EChartsOption) | Deep-merged over the generated ECharts option, or a function that receives and returns it. Use it for ECharts settings no prop covers. |
| theme | ThemeInput | A theme, or a partial set of tokens merged over the surrounding theme, for this chart only. |
| mode | ModeInput | "auto" (default) follows the page, "system" follows the OS, or force "light" / "dark". |
| renderer | RendererInput | "auto" (default) uses SVG for light charts and canvas for heavy ones. |
| animate | boolean | Set false to disable animation. Reduced-motion preferences are always respected. |
| lazy | boolean | Mount the chart only when it scrolls near the viewport. Default true. |
| group | string | Link tooltips with other charts sharing this group id. |
| exportable | boolean | ExportFormat[] | Show an export menu: true or a list of formats from png, jpeg, svg, pdf, csv, json. |
| table | boolean | Show a collapsible "View data" table under the chart. |
| alt | string | Accessible description: the chart type and measures, then the main pattern and the notable values. |
| id | string | Stable id for this chart's selection in the shared store. |
| onEvents | Record<string, ChartEventHandler> | ECharts event handlers, e.g. { click: (params, chart) => {} }. Prefix a name with zr: to bind to the canvas itself. |
| onReady | (chart: EChartsInstance) => void | Called with the ECharts instance once it is created. |
| className | string | Class name for the outer <figure>. |
| style | CSSProperties | Inline style for the outer <figure>. |