Docs/Cartesian Components/Area

Area

Area is a graphical series component that renders a filled area under a line on a cartesian chart. It's similar to Line but with fill instead of just a stroke, and supports stacking for combined-area layouts.

import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip } from "solid-recharts";

<AreaChart width={500} height={300} data={data}>
  <CartesianGrid strokeDasharray="3 3" />
  <XAxis dataKey="name" />
  <YAxis />
  <Tooltip />
  <Area type="monotone" dataKey="value" fill="#82ca9d" stroke="#82ca9d" />
</AreaChart>;
AreaChart
area-stacked.tsxOpen ↗
Loading source...

Props

PropTypeDefaultDescription
dataKeystring | number | func—Data key or accessor for the area's values
typestring"linear"Curve interpolation: "linear", "monotone", etc
fillstring"#8884d8"Fill color
fillOpacitynumber | string1Fill transparency (0–1)
strokestring—Line stroke color
strokeWidthnumber1Line thickness
connectNullsbooleanfalseConnect data points across null/undefined values
stackIdstring—Stack areas with others sharing this id
baseValuenumber | "dataMin" | "dataMax"0Base value for the area fill (bottom of the fill)
dotboolean | objectfalseRender dots at each point
labelboolean | objectfalseRender labels at each point
isAnimationActiveboolean | "auto""auto"Enable enter/update animation

See the recharts Area docs for the full prop matrix.

Notes

  • Stacking: pass the same stackId to multiple Area components to stack them (areas with different stack ids overlay).
  • Range areas: pass a function as dataKey that returns [low, high] instead of a single value; the area will span both values.
  • Fill opacity: use fillOpacity to control transparency without changing the base color.
  • Base value: set baseValue to align the fill to a specific value (e.g., "dataMin" for the minimum value in the data).

See also