Skip to main content
AreaChart
@coinbase/cds-web-visualization@3.4.0-beta.9
A chart component that displays data as filled areas beneath lines. Ideal for showing cumulative values, stacked data, or emphasizing volume over time.
Import
import { AreaChart } from '@coinbase/cds-web-visualization'
SourceView source code
Peer dependencies
  • framer-motion: ^10.18.0
View as Markdown

AreaChart is a cartesian chart variant that allows for easy visualization of stacked data.

Basic Example

Loading...

Simple

Loading...

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 details.

Loading...

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.

Loading...

Area Styles

You can have different area styles for each series.

Loading...

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.

Loading...

Disable Animations

You can also disable animations by setting the animate prop to false.

Loading...

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.

Loading...

Discrete

You can set multiple stops at the same offset to create a discrete gradient.

Loading...

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.

Loading...

Is this page useful?

Coinbase Design is an open-source, adaptable system of guidelines, components, and tools that aid the best practices of user interface design for crypto products.