For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
0
Sponsor

Area Chart

Animated, stacked, stepped, and zoomable WebGPU and WebGL area charts powered by PixiJS.

ChartGPUPixiJS
PixiJS renderer
Basic Chart

Installation

$ pnpm dlx shadcn@latest add @chartcn/pixijs/area-chart

Usage

import {
  ChartcnAreaChart,
  type ChartConfig,
} from "@/components/chart/pixijs/area-chart";
<ChartcnAreaChart
  config={chartConfig}
  data={data}
  stackType="stacked"
  xDataKey="month"
>
  <ChartcnAreaChart.Grid />
  <ChartcnAreaChart.XAxis dataKey="month" />
  <ChartcnAreaChart.Brush />
  <ChartcnAreaChart.Legend />
  <ChartcnAreaChart.Tooltip />
  <ChartcnAreaChart.Area dataKey="desktop" opacity={0.3} />
  <ChartcnAreaChart.Area dataKey="mobile" opacity={0.3} />
</ChartcnAreaChart>

Examples

Stack types

stackType='stacked'
stackType='expanded'

Step area

curveType='step'

Loading state

isLoading='true'
Loading

API Reference

ChartcnAreaChart

PropTypeDefault
dataData[]required
configChartConfigrequired
childrenReactNode-
xDataKeystring-
stackType"default" | "stacked" | "expanded" | "percent""default"
curveType"linear" | "step" | "step-before" | "step-after""linear"
animationboolean | AnimationConfig{ duration: 650, easing: "cubicOut" }
isLoadingbooleanfalse
showBrushbooleanfalse
onBrushChange({ startIndex: number; endIndex: number }) => void-

Area

PropTypeDefault
dataKeystringrequired
opacitynumber0.28
strokeWidthnumber2
stackIdstring"chartcn"
curveType"linear" | "step" | "step-before" | "step-after"-
connectNullsbooleanfalse

Shared parts

Grid, XAxis, YAxis, Brush, Legend, and Tooltip accept the concrete props documented by the Line Chart.