AreaChart is a wrapper for CartesianChart that has some unique features over LineChart, such as the ability to stack areas on top of each other and a default value-axis minimum that follows the baseline (0 when baseline is not set). Charts are built using SVGs.
Basics
The only prop required is series, which takes an array of series objects. Each series object needs an id and a data array of numbers.
Data
Positive and Negative
Area grows from the baseline to each value, allowing for both positive and negative data to be shown. Also, you can set baseline to any value you'd like.
Range
You can pass in [min, max] tuples as data points to render an area that span a range of values.
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 for more info on stacking.
Styling
Areas
You can have different area styles for each series.
Axes
Using showXAxis and showYAxis allows you to display the axes. For more information, such as adjusting domain and range, see XAxis and YAxis.
Gradient
You can build threshold-based gradients with hard transitions by reusing stop offsets.
Composed Examples
Custom Baseline
You can combine a custom baseline with a scrubber label that shows both price and date.