# AreaChart
A chart component that displays data as filled areas beneath lines. Ideal for showing cumulative values, stacked data, or emphasizing volume over time.
## Import
```tsx
import { AreaChart } from '@coinbase/cds-web-visualization'
```
## Examples
AreaChart is a cartesian chart variant that allows for easy visualization of stacked data.
### Basic Example
```jsx live
```
### Simple
```jsx live
```
### Stacking
You can use the `stacked` prop to stack all areas on top of each other. You can also use the `stackId` prop on a series to create different stack groups. See [CartesianChart](/components/graphs/CartesianChart/#series-stacks) for more details.
```jsx live
}
type="dotted"
/>
```
### Negative Values
When an area chart contains negative values, the baseline automatically adjusts to zero instead of the bottom of the chart. The area fills from the data line to the zero baseline, properly showing both positive and negative regions.
```jsx live
}
showLines
showYAxis
yAxis={{
showGrid: true,
}}
/>
```
### Area Styles
You can have different area styles for each series.
```jsx live
```
### Animations
You can configure chart transitions using the `transition` prop.
#### Customized Transitions
You can pass in a custom spring based transition to your `AreaChart` for a custom transition.
```jsx live
function AnimatedStackedAreas() {
const dataCount = 20;
const minYValue = 5000;
const maxDataOffset = 15000;
const minStepOffset = 2500;
const maxStepOffset = 10000;
const updateInterval = 500;
const seriesSpacing = 2000;
const myTransition = { type: 'spring', stiffness: 700, damping: 20 };
const seriesConfig = [
{ id: 'red', label: 'Red', color: 'rgb(var(--red40))' },
{ id: 'orange', label: 'Orange', color: 'rgb(var(--orange40))' },
{ id: 'yellow', label: 'Yellow', color: 'rgb(var(--yellow40))' },
{ id: 'green', label: 'Green', color: 'rgb(var(--green40))' },
{ id: 'blue', label: 'Blue', color: 'rgb(var(--blue40))' },
{ id: 'indigo', label: 'Indigo', color: 'rgb(var(--indigo40))' },
{ id: 'purple', label: 'Purple', color: 'rgb(var(--purple40))' },
];
const domainLimit = maxDataOffset + seriesConfig.length * seriesSpacing;
function generateNextValue(previousValue) {
const range = maxStepOffset - minStepOffset;
const offset = Math.random() * range + minStepOffset;
let direction;
if (previousValue >= maxDataOffset) {
direction = -1;
} else if (previousValue <= minYValue) {
direction = 1;
} else {
direction = Math.random() < 0.5 ? -1 : 1;
}
let newValue = previousValue + offset * direction;
newValue = Math.max(minYValue, Math.min(maxDataOffset, newValue));
return newValue;
}
function generateInitialData() {
const data = [];
let previousValue = minYValue + Math.random() * (maxDataOffset - minYValue);
data.push(previousValue);
for (let i = 1; i < dataCount; i++) {
const newValue = generateNextValue(previousValue);
data.push(newValue);
previousValue = newValue;
}
return data;
}
const MemoizedDottedArea = memo((props) => (
));
function AnimatedChart() {
const [data, setData] = useState(generateInitialData);
useEffect(() => {
const intervalId = setInterval(() => {
setData((currentData) => {
const lastValue = currentData[currentData.length - 1] ?? 0;
const newValue = generateNextValue(lastValue);
return [...currentData.slice(1), newValue];
});
}, updateInterval);
return () => clearInterval(intervalId);
}, []);
const series = seriesConfig.map((config, index) => ({
id: config.id,
label: config.label,
color: config.color,
data: index === 0 ? data : Array(dataCount).fill(seriesSpacing),
}));
return (
'',
domain: { min: 0, max: domainLimit },
}}
/>
);
}
return ;
}
```
#### Disable Animations
You can also disable animations by setting the `animate` prop to `false`.
```jsx live
function AnimatedStackedAreas() {
const dataCount = 20;
const minYValue = 5000;
const maxDataOffset = 15000;
const minStepOffset = 2500;
const maxStepOffset = 10000;
const updateInterval = 500;
const seriesSpacing = 2000;
const myTransition = { type: 'spring', stiffness: 700, damping: 20 };
const seriesConfig = [
{ id: 'red', label: 'Red', color: 'rgb(var(--red40))' },
{ id: 'orange', label: 'Orange', color: 'rgb(var(--orange40))' },
{ id: 'yellow', label: 'Yellow', color: 'rgb(var(--yellow40))' },
{ id: 'green', label: 'Green', color: 'rgb(var(--green40))' },
{ id: 'blue', label: 'Blue', color: 'rgb(var(--blue40))' },
{ id: 'indigo', label: 'Indigo', color: 'rgb(var(--indigo40))' },
{ id: 'purple', label: 'Purple', color: 'rgb(var(--purple40))' },
];
const domainLimit = maxDataOffset + seriesConfig.length * seriesSpacing;
function generateNextValue(previousValue) {
const range = maxStepOffset - minStepOffset;
const offset = Math.random() * range + minStepOffset;
let direction;
if (previousValue >= maxDataOffset) {
direction = -1;
} else if (previousValue <= minYValue) {
direction = 1;
} else {
direction = Math.random() < 0.5 ? -1 : 1;
}
let newValue = previousValue + offset * direction;
newValue = Math.max(minYValue, Math.min(maxDataOffset, newValue));
return newValue;
}
function generateInitialData() {
const data = [];
let previousValue = minYValue + Math.random() * (maxDataOffset - minYValue);
data.push(previousValue);
for (let i = 1; i < dataCount; i++) {
const newValue = generateNextValue(previousValue);
data.push(newValue);
previousValue = newValue;
}
return data;
}
const MemoizedDottedArea = memo((props) => (
));
function AnimatedChart() {
const [data, setData] = useState(generateInitialData);
useEffect(() => {
const intervalId = setInterval(() => {
setData((currentData) => {
const lastValue = currentData[currentData.length - 1] ?? 0;
const newValue = generateNextValue(lastValue);
return [...currentData.slice(1), newValue];
});
}, updateInterval);
return () => clearInterval(intervalId);
}, []);
const series = seriesConfig.map((config, index) => ({
id: config.id,
label: config.label,
color: config.color,
// First series gets animated data, others get constant height
data: index === 0 ? data : Array(dataCount).fill(seriesSpacing),
}));
return (
'',
domain: { min: 0, max: domainLimit },
}}
/>
);
}
return ;
}
```
### Gradients
You can use the `gradient` prop on `series` or `Area` components to enable gradients.
Each stop requires an `offset`, which is based on the data within the x/y scale and `color`, with an optional `opacity` (defaults to 1).
Values in between stops will be interpolated smoothly using [srgb color space](https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperty).
```jsx live
function ContinuousGradient() {
const spectrumColors = [
'blue',
'green',
'orange',
'yellow',
'gray',
'indigo',
'pink',
'purple',
'red',
'teal',
'chartreuse',
];
const data = [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58];
const [currentSpectrumColor, setCurrentSpectrumColor] = useState('pink');
return (
{spectrumColors.map((color) => (
setCurrentSpectrumColor(color)}
accessibilityLabel={`Select ${color}`}
style={{
backgroundColor: `rgb(var(--${color}20))`,
border: `2px solid rgb(var(--${color}50))`,
outlineColor: `rgb(var(--${color}80))`,
outline:
currentSpectrumColor === color ? `2px solid rgb(var(--${color}80))` : undefined,
}}
width={{ base: 16, tablet: 24, desktop: 24 }}
height={{ base: 16, tablet: 24, desktop: 24 }}
borderRadius={1000}
/>
))}
[
// Allows a function which accepts min/max or direct array
{ offset: min, color: `rgb(var(--${currentSpectrumColor}80))` },
{ offset: max, color: `rgb(var(--${currentSpectrumColor}20))` },
],
},
},
]}
showYAxis
yAxis={{
showGrid: true,
}}
>
);
}
```
#### Discrete
You can set multiple stops at the same offset to create a discrete gradient.
```jsx live
function DiscreteGradient() {
const spectrumColors = [
'blue',
'green',
'orange',
'yellow',
'gray',
'indigo',
'pink',
'purple',
'red',
'teal',
'chartreuse',
];
const data = [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58];
const [currentSpectrumColor, setCurrentSpectrumColor] = useState('pink');
return (
{spectrumColors.map((color) => (
setCurrentSpectrumColor(color)}
accessibilityLabel={`Select ${color}`}
style={{
backgroundColor: `rgb(var(--${color}20))`,
border: `2px solid rgb(var(--${color}50))`,
outlineColor: `rgb(var(--${color}80))`,
outline:
currentSpectrumColor === color ? `2px solid rgb(var(--${color}80))` : undefined,
}}
width={{ base: 16, tablet: 24, desktop: 24 }}
height={{ base: 16, tablet: 24, desktop: 24 }}
borderRadius={1000}
/>
))}
[
{ offset: min, color: `rgb(var(--${currentSpectrumColor}80))` },
{ offset: min + (max - min) / 3, color: `rgb(var(--${currentSpectrumColor}80))` },
{ offset: min + (max - min) / 3, color: `rgb(var(--${currentSpectrumColor}50))` },
{
offset: min + ((max - min) / 3) * 2,
color: `rgb(var(--${currentSpectrumColor}50))`,
},
{
offset: min + ((max - min) / 3) * 2,
color: `rgb(var(--${currentSpectrumColor}20))`,
},
{ offset: max, color: `rgb(var(--${currentSpectrumColor}20))` },
],
},
},
]}
showLines
strokeWidth={4}
showYAxis
yAxis={{
showGrid: true,
}}
fillOpacity={0.5}
>
);
}
```
#### Axes
By default, gradients will be applied to the y-axis. You can apply a gradient to the x-axis by setting `axis` to `x` in the gradient definition.
```jsx live
function XAxisGradient() {
const spectrumColors = [
'blue',
'green',
'orange',
'yellow',
'gray',
'indigo',
'pink',
'purple',
'red',
'teal',
'chartreuse',
];
const data = [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58];
const [currentSpectrumColor, setCurrentSpectrumColor] = useState('pink');
return (
{spectrumColors.map((color) => (
setCurrentSpectrumColor(color)}
accessibilityLabel={`Select ${color}`}
style={{
backgroundColor: `rgb(var(--${color}20))`,
border: `2px solid rgb(var(--${color}50))`,
outlineColor: `rgb(var(--${color}80))`,
outline:
currentSpectrumColor === color ? `2px solid rgb(var(--${color}80))` : undefined,
}}
width={{ base: 16, tablet: 24, desktop: 24 }}
height={{ base: 16, tablet: 24, desktop: 24 }}
borderRadius={1000}
/>
))}
[
{ offset: min, color: `rgb(var(--${currentSpectrumColor}80))`, opacity: 0 },
{ offset: max, color: `rgb(var(--${currentSpectrumColor}20))`, opacity: 1 },
],
},
},
]}
showYAxis
yAxis={{
showGrid: true,
}}
>
);
}
```
## Props
| Prop | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `AreaComponent` | `AreaComponent` | No | `-` | Component to render the area. Takes precedence over the type prop if provided. |
| `LineComponent` | `LineComponent` | No | `-` | Component to render the line. Takes precedence over the type prop if provided. |
| `alignContent` | `ResponsiveProp` | No | `-` | - |
| `alignItems` | `ResponsiveProp` | No | `-` | - |
| `alignSelf` | `ResponsiveProp` | No | `-` | - |
| `animate` | `boolean` | No | `true` | Whether to animate the chart. |
| `as` | `div` | No | `-` | The underlying element or component the polymorphic component will render. Changing as also changes the inherited native props (e.g. href for as=a) and the expected ref type. |
| `aspectRatio` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
| `background` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
| `borderBottomLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
| `borderBottomRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
| `borderBottomWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
| `borderColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
| `borderEndWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
| `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
| `borderStartWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
| `borderTopLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
| `borderTopRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
| `borderTopWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
| `borderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
| `bordered` | `boolean` | No | `-` | Add a border around all sides of the box. |
| `borderedBottom` | `boolean` | No | `-` | Add a border to the bottom side of the box. |
| `borderedEnd` | `boolean` | No | `-` | Add a border to the trailing side of the box. |
| `borderedHorizontal` | `boolean` | No | `-` | Add a border to the leading and trailing sides of the box. |
| `borderedStart` | `boolean` | No | `-` | Add a border to the leading side of the box. |
| `borderedTop` | `boolean` | No | `-` | Add a border to the top side of the box. |
| `borderedVertical` | `boolean` | No | `-` | Add a border to the top and bottom sides of the box. |
| `bottom` | `ResponsiveProp>` | No | `-` | - |
| `classNames` | `{ root?: string; chart?: string \| undefined; } \| undefined` | No | `-` | Custom class names for the component. |
| `color` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
| `columnGap` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
| `connectNulls` | `boolean` | No | `-` | When true, the area is connected across null values. |
| `curve` | `bump \| catmullRom \| linear \| linearClosed \| monotone \| natural \| step \| stepBefore \| stepAfter` | No | `'bump'` | The curve interpolation method to use for the line. |
| `dangerouslySetBackground` | `string` | No | `-` | - |
| `display` | `ResponsiveProp` | No | `-` | - |
| `elevation` | `0 \| 1 \| 2` | No | `-` | - |
| `enableScrubbing` | `boolean` | No | `-` | Enables scrubbing interactions. When true, allows scrubbing and makes scrubber components interactive. |
| `fillOpacity` | `number` | No | `1` | Opacity of the area |
| `flexBasis` | `ResponsiveProp>` | No | `-` | - |
| `flexDirection` | `ResponsiveProp` | No | `-` | - |
| `flexGrow` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset` | No | `-` | - |
| `flexShrink` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset` | No | `-` | - |
| `flexWrap` | `ResponsiveProp` | No | `-` | - |
| `font` | `ResponsiveProp` | No | `-` | - |
| `fontFamily` | `ResponsiveProp` | No | `-` | - |
| `fontSize` | `ResponsiveProp` | No | `-` | - |
| `fontWeight` | `ResponsiveProp` | No | `-` | - |
| `gap` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
| `grid` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| none` | No | `-` | - |
| `gridArea` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
| `gridAutoColumns` | `ResponsiveProp>` | No | `-` | - |
| `gridAutoFlow` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| row \| column \| dense` | No | `-` | - |
| `gridAutoRows` | `ResponsiveProp>` | No | `-` | - |
| `gridColumn` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
| `gridColumnEnd` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
| `gridColumnStart` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
| `gridRow` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
| `gridRowEnd` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
| `gridRowStart` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
| `gridTemplate` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| none` | No | `-` | - |
| `gridTemplateAreas` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| none` | No | `-` | - |
| `gridTemplateColumns` | `ResponsiveProp>` | No | `-` | - |
| `gridTemplateRows` | `ResponsiveProp>` | No | `-` | - |
| `height` | `ResponsiveProp>` | No | `-` | - |
| `inset` | `number \| Partial` | No | `-` | Inset around the entire chart (outside the axes). |
| `justifyContent` | `ResponsiveProp` | No | `-` | - |
| `key` | `Key \| null` | No | `-` | - |
| `left` | `ResponsiveProp>` | No | `-` | - |
| `lineHeight` | `ResponsiveProp` | No | `-` | - |
| `lineType` | `solid \| dotted` | No | `'solid'` | The type of line to render. |
| `margin` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
| `marginBottom` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
| `marginEnd` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
| `marginStart` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
| `marginTop` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
| `marginX` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
| `marginY` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
| `maxHeight` | `ResponsiveProp>` | No | `-` | - |
| `maxWidth` | `ResponsiveProp>` | No | `-` | - |
| `minHeight` | `ResponsiveProp>` | No | `-` | - |
| `minWidth` | `ResponsiveProp>` | No | `-` | - |
| `onChange` | `FormEventHandler` | No | `-` | - |
| `onScrubberPositionChange` | `((index: number) => void) \| undefined` | No | `-` | Callback fired when the scrubber position changes. Receives the dataIndex of the scrubber or undefined when not scrubbing. |
| `opacity` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset` | No | `-` | - |
| `overflow` | `ResponsiveProp` | No | `-` | - |
| `padding` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
| `paddingBottom` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
| `paddingEnd` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
| `paddingStart` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
| `paddingTop` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
| `paddingX` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
| `paddingY` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
| `pin` | `top \| bottom \| left \| right \| all` | No | `-` | Direction in which to absolutely pin the box. |
| `position` | `ResponsiveProp` | No | `-` | - |
| `ref` | `((instance: SVGSVGElement \| null) => void) \| RefObject \| null` | No | `-` | - |
| `right` | `ResponsiveProp>` | No | `-` | - |
| `rowGap` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
| `series` | `AreaSeries[]` | No | `-` | Configuration objects that define how to visualize the data. Each series supports Area and Line component props for individual customization. |
| `showLines` | `boolean` | No | `-` | Whether to show lines on top of the areas. Useful for stacked contexts to show the outline of each area. |
| `showXAxis` | `boolean` | No | `-` | Whether to show the X axis. |
| `showYAxis` | `boolean` | No | `-` | Whether to show the Y axis. |
| `stacked` | `boolean` | No | `-` | Whether to stack the areas on top of each other. When true, each series builds cumulative values on top of the previous series. **Note**: Only applies to series data containing singular numbers (e.g., [10, 20, 30]). Series with [baseline, value] tuples (e.g., [[0, 10], [0, -5]]) will be skipped during stacking and rendered as-is. |
| `strokeWidth` | `number` | No | `2` | Width of the line |
| `style` | `CSSProperties` | No | `-` | Custom styles for the root element. |
| `styles` | `{ root?: CSSProperties; chart?: CSSProperties \| undefined; } \| undefined` | No | `-` | Custom styles for the component. |
| `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID |
| `textAlign` | `ResponsiveProp` | No | `-` | - |
| `textDecoration` | `ResponsiveProp` | No | `-` | - |
| `textTransform` | `ResponsiveProp` | No | `-` | - |
| `top` | `ResponsiveProp>` | No | `-` | - |
| `transform` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| none` | No | `-` | - |
| `transition` | `Orchestration & Repeat & Tween \| Orchestration & Repeat & Spring \| Orchestration & Repeat & Keyframes \| Orchestration & Repeat & Inertia \| Orchestration & Repeat & Just \| Orchestration & Repeat & None \| Orchestration & Repeat & PermissiveTransitionDefinition \| Orchestration & Repeat & Tween & { [key: string]: TransitionDefinition; } \| Orchestration & Repeat & Spring & { [key: string]: TransitionDefinition; } \| Orchestration & Repeat & Keyframes & { [key: string]: TransitionDefinition; } \| Orchestration & Repeat & Inertia & { [key: string]: TransitionDefinition; } \| Orchestration & Repeat & Just & { [key: string]: TransitionDefinition; } \| Orchestration & Repeat & None & { [key: string]: TransitionDefinition; } \| Orchestration & Repeat & PermissiveTransitionDefinition & { [key: string]: TransitionDefinition; }` | No | `-` | Transition configuration for path animations. |
| `type` | `gradient \| solid \| dotted` | No | `'solid'` | The type of area to render. |
| `userSelect` | `ResponsiveProp` | No | `-` | - |
| `visibility` | `ResponsiveProp` | No | `-` | - |
| `width` | `ResponsiveProp>` | No | `-` | - |
| `xAxis` | `(Partial & SharedProps & { bandGridLinePlacement?: AxisBandPlacement; bandTickMarkPlacement?: AxisBandPlacement \| undefined; label?: string \| undefined; labelGap?: number \| undefined; minTickLabelGap?: number \| undefined; requestedTickCount?: number \| undefined; showGrid?: boolean \| undefined; showLine?: boolean \| undefined; showTickMarks?: boolean \| undefined; tickMarkSize?: number \| undefined; ticks?: number[] \| ((value: number) => boolean) \| undefined; tickMarkLabelGap?: number \| undefined; tickInterval?: number \| undefined; tickMinStep?: number \| undefined; tickMaxStep?: number \| undefined; } & { className?: string \| undefined; classNames?: { root?: string \| undefined; label?: string \| undefined; tickLabel?: string \| undefined; gridLine?: string \| undefined; line?: string \| undefined; tickMark?: string \| undefined; } \| undefined; style?: CSSProperties \| undefined; styles?: { root?: CSSProperties \| undefined; label?: CSSProperties \| undefined; tickLabel?: CSSProperties \| undefined; gridLine?: CSSProperties \| undefined; line?: CSSProperties \| undefined; tickMark?: CSSProperties \| undefined; } \| undefined; GridLineComponent?: LineComponent \| undefined; LineComponent?: LineComponent \| undefined; TickMarkLineComponent?: LineComponent \| undefined; tickLabelFormatter?: ((value: number) => ChartTextChildren) \| undefined; TickLabelComponent?: AxisTickLabelComponent \| undefined; } & { position?: top \| bottom \| undefined; height?: number \| undefined; }) \| undefined` | No | `-` | Configuration for x-axis. Accepts axis config and axis props. To show the axis, set showXAxis to true. |
| `yAxis` | `(Partial & SharedProps & { bandGridLinePlacement?: AxisBandPlacement; bandTickMarkPlacement?: AxisBandPlacement \| undefined; label?: string \| undefined; labelGap?: number \| undefined; minTickLabelGap?: number \| undefined; requestedTickCount?: number \| undefined; showGrid?: boolean \| undefined; showLine?: boolean \| undefined; showTickMarks?: boolean \| undefined; tickMarkSize?: number \| undefined; ticks?: number[] \| ((value: number) => boolean) \| undefined; tickMarkLabelGap?: number \| undefined; tickInterval?: number \| undefined; tickMinStep?: number \| undefined; tickMaxStep?: number \| undefined; } & { className?: string \| undefined; classNames?: { root?: string \| undefined; label?: string \| undefined; tickLabel?: string \| undefined; gridLine?: string \| undefined; line?: string \| undefined; tickMark?: string \| undefined; } \| undefined; style?: CSSProperties \| undefined; styles?: { root?: CSSProperties \| undefined; label?: CSSProperties \| undefined; tickLabel?: CSSProperties \| undefined; gridLine?: CSSProperties \| undefined; line?: CSSProperties \| undefined; tickMark?: CSSProperties \| undefined; } \| undefined; GridLineComponent?: LineComponent \| undefined; LineComponent?: LineComponent \| undefined; TickMarkLineComponent?: LineComponent \| undefined; tickLabelFormatter?: ((value: number) => ChartTextChildren) \| undefined; TickLabelComponent?: AxisTickLabelComponent \| undefined; } & { axisId?: string \| undefined; position?: left \| right \| undefined; width?: number \| undefined; }) \| undefined` | No | `-` | Configuration for y-axis. Accepts axis config and axis props. To show the axis, set showYAxis to true. |
| `zIndex` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |