8-bit Chart
8bitcn/chartFreeBlock
A simple 8-bit chart component
Install it
npx shadcn@latest add https://www.8bitcn.com/r/chart.jsonSource
1"use client";23import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from "recharts";45import {6 type ChartConfig,7 ChartContainer,8 ChartTooltip,9 ChartTooltipContent,10} from "@/components/ui/8bit/chart";1112export const description = "An area chart with axes";1314const chartData = [15 { month: "January", desktop: 186, mobile: 80 },16 { month: "February", desktop: 305, mobile: 200 },17 { month: "March", desktop: 237, mobile: 120 },18 { month: "April", desktop: 73, mobile: 190 },19 { month: "May", desktop: 209, mobile: 130 },20 { month: "June", desktop: 214, mobile: 140 },21];2223const chartConfig = {24 desktop: {25 label: "Desktop",26 color: "var(--chart-1)",27 },28 mobile: {29 label: "Mobile",30 color: "var(--chart-2)",31 },32} satisfies ChartConfig;3334export function ChartExample() {35 return (36 <ChartContainer37 config={chartConfig}38 className={`min-h-[200px] w-full ${"retro"}`}39 >40 <AreaChart accessibilityLayer data={chartData}>41 <CartesianGrid />42 <XAxis43 dataKey="month"44 tickLine={false}45 axisLine={false}46 tickMargin={8}47 tickFormatter={(value) => value.slice(0, 3)}48 />49 <ChartTooltip cursor={false} content={<ChartTooltipContent />} />50 <YAxis51 width={47}52 tickLine={false}53 axisLine={false}54 tickMargin={8}55 tickCount={3}56 />57 <Area58 dataKey="mobile"59 fill="var(--chart-2)"60 stroke="var(--chart-2)"61 stackId="a"62 />63 <Area64 dataKey="desktop"65 fill="var(--chart-1)"66 stroke="var(--chart-1)"67 stackId="a"68 />69 </AreaChart>70 </ChartContainer>71 );72}
What it pulls in
Other registry items
Files it writes
More from 8bitcn
All 121 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| 8-bit Advanced 1advanced1 | 8bitcn | Blocks | Free | no deps · 3 files | |
| 8-bit Advanced 2advanced2 | 8bitcn | Blocks | Free | no deps · 5 files | |
| 8-bit Advanced 3advanced3 | 8bitcn | Blocks | Free | no deps · 6 files | |
| 8-bit Audio Settingsaudio-settings | 8bitcn | Blocks | Free | 2 deps · 7 files | |
| 8-bit Chapter Introchapter-intro | 8bitcn | Blocks | Free | no deps · 3 files | |
| 8-bit Character Sheetcharacter-sheet | 8bitcn | Blocks | Free | no deps · 9 files | |
| 8-bit Chart Area Stepchart-area-step | 8bitcn | Blocks | Free | no deps · 3 files | |
| 8-bit Chart Barchart-bar | 8bitcn | Blocks | Free | no deps · 3 files |
