Lambchop
Charts

AreaChart

Stacked area chart with gradient fills.

import { AreaChart } from "lambchop";

Live Demo

Usage

import { AreaChart } from "lambchop";

<AreaChart
  data={[
    { date: "Jan 1", playwire: 820, stripe: 310 },
    { date: "Jan 2", playwire: 910, stripe: 340 },
  ]}
  xKey="date"
  areas={[
    { key: "playwire", label: "Playwire" },
    { key: "stripe", label: "Stripe" },
  ]}
  stacked
/>

Props

PropTypeDefaultDescription
dataRecord<string, unknown>[]Array of data objects
xKeystringKey for the x-axis
areasAreaDefinition[]Area series definitions
heightnumber300Chart height in pixels
stackedbooleantrueWhether areas are stacked
classNamestringAdditional CSS classes

AreaDefinition

FieldTypeDefaultDescription
keystringData key for this area series
labelstringLegend label
colorstringautoOverride the default color

Variants

  • Single Area — Track one metric with gradient fill
  • Stacked — Show composition over time (default)
  • Unstacked — Overlapping areas for comparison
  • Custom Colors — Override the default palette