chart-pie-stacked.json — ui Source File
Architecture documentation for chart-pie-stacked.json, a json file in the ui codebase.
Entity Profile
Source Code
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "chart-pie-stacked",
"type": "registry:block",
"author": "shadcn (https://ui.shadcn.com)",
"registryDependencies": [
"card",
"chart"
],
"files": [
{
"path": "charts/chart-pie-stacked.tsx",
"content": "\"use client\"\n\nimport * as React from \"react\"\nimport { TrendingUp } from \"lucide-react\"\nimport { Label, Pie, PieChart } from \"recharts\"\n\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/registry/default/ui/card\"\nimport {\n ChartConfig,\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n} from \"@/registry/default/ui/chart\"\nconst desktopData = [\n { month: \"january\", desktop: 186, fill: \"var(--color-january)\" },\n { month: \"february\", desktop: 305, fill: \"var(--color-february)\" },\n { month: \"march\", desktop: 237, fill: \"var(--color-march)\" },\n { month: \"april\", desktop: 173, fill: \"var(--color-april)\" },\n { month: \"may\", desktop: 209, fill: \"var(--color-may)\" },\n]\n\nconst mobileData = [\n { month: \"january\", mobile: 80, fill: \"var(--color-january)\" },\n { month: \"february\", mobile: 200, fill: \"var(--color-february)\" },\n { month: \"march\", mobile: 120, fill: \"var(--color-march)\" },\n { month: \"april\", mobile: 190, fill: \"var(--color-april)\" },\n { month: \"may\", mobile: 130, fill: \"var(--color-may)\" },\n]\n\nconst chartConfig = {\n visitors: {\n label: \"Visitors\",\n },\n desktop: {\n label: \"Desktop\",\n },\n mobile: {\n label: \"Mobile\",\n },\n january: {\n label: \"January\",\n color: \"hsl(var(--chart-1))\",\n },\n february: {\n label: \"February\",\n color: \"hsl(var(--chart-2))\",\n },\n march: {\n label: \"March\",\n color: \"hsl(var(--chart-3))\",\n },\n april: {\n label: \"April\",\n color: \"hsl(var(--chart-4))\",\n },\n may: {\n label: \"May\",\n color: \"hsl(var(--chart-5))\",\n },\n} satisfies ChartConfig\n\nexport default function Component() {\n return (\n <Card className=\"flex flex-col\">\n <CardHeader className=\"items-center pb-0\">\n <CardTitle>Pie Chart - Stacked</CardTitle>\n <CardDescription>January - June 2024</CardDescription>\n </CardHeader>\n <CardContent className=\"flex-1 pb-0\">\n <ChartContainer\n config={chartConfig}\n className=\"mx-auto aspect-square max-h-[250px]\"\n >\n <PieChart>\n <ChartTooltip\n content={\n <ChartTooltipContent\n labelKey=\"visitors\"\n nameKey=\"month\"\n indicator=\"line\"\n labelFormatter={(_, payload) => {\n return chartConfig[\n payload?.[0].dataKey as keyof typeof chartConfig\n ].label\n }}\n />\n }\n />\n <Pie data={desktopData} dataKey=\"desktop\" outerRadius={60} />\n <Pie\n data={mobileData}\n dataKey=\"mobile\"\n innerRadius={70}\n outerRadius={90}\n />\n </PieChart>\n </ChartContainer>\n </CardContent>\n <CardFooter className=\"flex-col gap-2 text-sm\">\n <div className=\"flex items-center gap-2 font-medium leading-none\">\n Trending up by 5.2% this month <TrendingUp className=\"h-4 w-4\" />\n </div>\n <div className=\"leading-none text-muted-foreground\">\n Showing total visitors for the last 6 months\n </div>\n </CardFooter>\n </Card>\n )\n}\n",
"type": "registry:block",
"target": ""
}
],
"categories": [
"charts",
"charts-pie"
]
}
Source
Frequently Asked Questions
What does chart-pie-stacked.json do?
chart-pie-stacked.json is a source file in the ui codebase, written in json.
Where is chart-pie-stacked.json in the architecture?
chart-pie-stacked.json is located at apps/v4/public/r/styles/default/chart-pie-stacked.json (directory: apps/v4/public/r/styles/default).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free