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

Composed Chart

Animated WebGPU bar and line series sharing one ChartGPU Cartesian plot.

ChartGPUPixiJS
ChartGPU renderer
Basic Chart

Installation

$ pnpm dlx shadcn@latest add @chartcn/chartgpu/composed-chart

Usage

import {
  ChartcnComposedChart,
  type ChartConfig,
} from "@/components/chart/composed-chart";
<ChartcnComposedChart config={chartConfig} data={data} xDataKey="month">
  <ChartcnComposedChart.Grid />
  <ChartcnComposedChart.XAxis dataKey="month" />
  <ChartcnComposedChart.Brush />
  <ChartcnComposedChart.Legend />
  <ChartcnComposedChart.Tooltip />
  <ChartcnComposedChart.Bar dataKey="revenue" />
  <ChartcnComposedChart.Line dataKey="profit" strokeWidth={2.5} />
</ChartcnComposedChart>

Examples

Loading state

isLoading='true'
Loading

API Reference

ChartcnComposedChart

PropTypeDefault
dataData[]required
configChartConfigrequired
xDataKeystring-
stackType"default" | "stacked" | "expanded" | "percent""default"
animationboolean | AnimationConfig{ duration: 650, easing: "cubicOut" }
isLoadingbooleanfalse

Bar

PropTypeDefault
dataKeystringrequired
radiusnumber4
barWidthnumber | string-
stackIdstring"chartcn"

Line

PropTypeDefault
dataKeystringrequired
strokeWidthnumber2.25
opacitynumber1
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.