> Native Solid 2 fork of [solid-recharts](https://github.com/yumemi-thomas/solid-recharts) (MIT, © Thomas Guehenneux), derived from [Recharts](https://github.com/recharts/recharts) (MIT, © recharts). Adapted documentation; neither project endorses this fork.

# AreaChart

`AreaChart` is the cartesian container for `Area` series. It owns the chart's layout, scales, and interaction state; children like `XAxis`, `CartesianGrid` and `Tooltip` register themselves into it.

```tsx
() => {

	const data = [

		{ month: "Jan", visitors: 4000, signups: 2400, revenue: 2400 },

		{ month: "Feb", visitors: 3000, signups: 1398, revenue: 2210 },

		{ month: "Mar", visitors: 2000, signups: 3800, revenue: 2290 },

		{ month: "Apr", visitors: 2780, signups: 3908, revenue: 2000 },

		{ month: "May", visitors: 1890, signups: 4800, revenue: 2181 },

		{ month: "Jun", visitors: 2390, signups: 3800, revenue: 2500 },

	];

	return <ResponsiveContainer width="100%" height={300} initialDimension={{ width: 560, height: 300 }}>

		<AreaChart data={data} title="Stacked visitors and signups">

			<CartesianGrid strokeDasharray="3 3" stroke="var(--gray-a6)" />

			<XAxis dataKey="month" />

			<YAxis />

			<Tooltip />

			<Area type="monotone" dataKey="visitors" stackId="1" stroke="var(--accent-9)" fill="var(--accent-a5)" />

			<Area type="monotone" dataKey="signups" stackId="1" stroke="var(--teal-9)" fill="var(--teal-a5)" />

		</AreaChart>

	</ResponsiveContainer>;

}
```

## Props

| Prop                        | Type                           | Default          | Description                                         |
| --------------------------- | ------------------------------ | ---------------- | --------------------------------------------------- |
| `data`                      | `object[]`                     | —                | Source data array, one entry per x position         |
| `width`, `height`           | `number`                       | —                | Fixed size (omit when inside `ResponsiveContainer`) |
| `layout`                    | `"horizontal" \| "vertical"`   | `"horizontal"`   | Direction of the independent axis                   |
| `margin`                    | `{ top, right, bottom, left }` | `{ 5, 5, 5, 5 }` | Space around the plot area                          |
| `syncId`                    | `string`                       | —                | Sync tooltip/brush across charts sharing the id     |
| `onClick`, `onMouseMove`, … | `function`                     | —                | Chart-level mouse events with the active payload    |

The base props follow the Recharts 3.9.2 `AreaChart` API (reference commit `b3451050`) that solid-recharts tracks; see the [Recharts AreaChart reference](https://recharts.org/en-US/api/AreaChart). The [next-suite release scope](/charts/docs/overview/releases) lists selected adaptations, not full Recharts 3.10.1 parity.

## Notes

- Multiple `Area` children share the same axes unless you give an `Area` its own `xAxisId`/`yAxisId`.
- Set `stackId` on two or more `Area` children to stack them vertically.
- Set `syncId` on two charts to mirror tooltips and brushes between them.

## See also

- Area — the series component and its dot/label options
- XAxis · YAxis
- [ComposedChart](/charts/docs/components/composed-chart) — mix areas with lines and bars
