Skip to main content
AreaChart fills the region between a line and the axis, emphasizing the magnitude of values over time. It supports stacking, which makes it easy to show how parts contribute to a whole.

Basic Usage

Stacked

Stacking shows how each series contributes to the total. The topmost line represents the combined value.

Minimal

Turn off the grid for a cleaner look.

Smooth

Set curve="smooth" for gently curved lines between data points. The filled area follows the curve.

Step

Set curve="step" to connect points with step-shaped lines. The filled area follows the stepped edges.

API Reference

AreaChart Parameters

data
list[dict] | str
required
Data as a list of dicts, or a {{ field }} interpolation reference.
series
list[ChartSeries]
required
Series definitions — each becomes a filled area on the chart.
x_axis
str | None
default:"None"
Data key for x-axis labels.
height
int
default:"300"
Chart height in pixels.
stacked
bool
default:"False"
Stack areas on top of each other.
curve
Literal["linear", "smooth", "step"]
default:"\"linear\""
Interpolation curve between data points.
show_dots
bool
default:"False"
Show a dot at each data point.
show_legend
bool
default:"False"
Show a legend below the chart.
show_tooltip
bool
default:"True"
Show tooltips on hover.
show_grid
bool
default:"True"
Show horizontal grid lines.
css_class
str | None
default:"None"
Additional Tailwind CSS classes.

ChartSeries Parameters

data_key
str
required
Data field to plot — must match a key in the data dicts.
label
str | None
default:"None"
Display label for legends and tooltips. Defaults to the data_key value.
color
str | None
default:"None"
CSS color override. By default, colors cycle through the theme’s chart palette (--chart-1 through --chart-5).

Protocol Reference

AreaChart
{
  "type": "AreaChart",
  "data": "Action[] | string (required)",
  "series": "[ChartSeries] (required)",
  "xAxis?": "string",
  "height?": "300",
  "stacked?": false,
  "curve?": "linear | smooth | step",
  "showDots?": false,
  "showLegend?": false,
  "showTooltip?": true,
  "showGrid?": true,
  "cssClass?": "string"
}
ChartSeries
{
  "dataKey": "string (required)",
  "label?": "string",
  "color?": "string"
}
For the complete protocol schema, see AreaChart, ChartSeries.