Composed Chart Example
bklit-ui/composed-chart-exampleFreeExample
Composable composed-chart demo for Open in v0
Install it
npx shadcn@latest add https://bklit.com/r/composed-chart-example.jsonSource
1"use client"23// In your app (monorepo/npm): import { ComposedChart, SeriesBar, Area, Line, Grid, XAxis, ChartTooltip } from "@bklitui/ui/charts"4import { ComposedChart, SeriesBar, Area, Line, Grid, XAxis, ChartTooltip } from "@/components/charts"56import { curveNatural } from "@visx/curve";78const chartData = [9 { date: new Date("2024-01-01"), revenue: 4200, runRate: 3800 },10 { date: new Date("2024-02-01"), revenue: 5100, runRate: 4600 },11 { date: new Date("2024-03-01"), revenue: 4800, runRate: 5200 },12 { date: new Date("2024-04-01"), revenue: 5500, runRate: 5000 },13];1415export default function Component() {16 return (17 <main className="flex min-h-svh w-full items-center justify-center p-6 md:p-10">18 <div className="w-full max-w-3xl">19 <ComposedChart data={chartData}>20 <Grid horizontal />21 <SeriesBar dataKey="revenue" fill="var(--chart-1)" />22 <Area dataKey="runRate" curve={curveNatural} fill="var(--chart-4)" fillOpacity={0.35} />23 <Line dataKey="runRate" curve={curveNatural} stroke="var(--chart-2)" />24 <XAxis />25 <ChartTooltip />26</ComposedChart>27 </div>28 </main>29 )30}
What it pulls in
npm packages
Other registry items
Files it writes
More from bklit-ui
All 56 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Area Chart Examplearea-chart-example | bklit-ui | Examples | Free | 3 deps · 2 files | |
| Bar Chart Examplebar-chart-example | bklit-ui | Examples | Free | 4 deps · 2 files | |
| Candlestick Chart Examplecandlestick-chart-example | bklit-ui | Examples | Free | 2 deps · 2 files | |
| Choropleth Chart Examplechoropleth-chart-example | bklit-ui | Examples | Free | 3 deps · 2 files | |
| Funnel Chart Examplefunnel-chart-example | bklit-ui | Examples | Free | 2 deps · 2 files | |
| Gauge Chart Examplegauge-chart-example | bklit-ui | Examples | Free | 2 deps · 2 files | |
| Heatmap Chart Exampleheatmap-chart-example | bklit-ui | Examples | Free | 3 deps · 2 files | |
| Line Chart Exampleline-chart-example | bklit-ui | Examples | Free | 3 deps · 2 files |
