# V chart 13

> Donut chart with center label showing team headcount by department

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/v-chart-13).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-chart-13
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-chart-13-light-db7b204121138b5d.png
- Registry item: https://ui.cnippet.dev/r/v-chart-13.json
- Categories: chart
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-chart-13.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/chart`

## Files

### `registry/default/variants/v-chart-13.tsx`

```tsx
"use client";

import { Cell, Pie, PieChart } from "recharts";
import {
  type ChartConfig,
  ChartContainer,
  ChartLegend,
  ChartLegendContent,
  ChartTooltip,
  ChartTooltipContent,
} from "@/registry/default/ui/chart";

const chartData = [
  { fill: "var(--color-design)", label: "Design", value: 35 },
  { fill: "var(--color-engineering)", label: "Engineering", value: 42 },
  { fill: "var(--color-marketing)", label: "Marketing", value: 15 },
  { fill: "var(--color-ops)", label: "Operations", value: 8 },
];

const chartConfig = {
  design: { color: "var(--chart-2)", label: "Design" },
  engineering: { color: "var(--chart-1)", label: "Engineering" },
  marketing: { color: "var(--chart-3)", label: "Marketing" },
  ops: { color: "var(--chart-4)", label: "Operations" },
} satisfies ChartConfig;

const total = chartData.reduce((sum, d) => sum + d.value, 0);

export function Pattern() {
  return (
    <ChartContainer
      className="mx-auto aspect-square max-h-64 w-full"
      config={chartConfig}
    >
      <PieChart>
        <ChartTooltip
          content={<ChartTooltipContent hideLabel />}
          cursor={false}
        />
        <Pie
          cx="50%"
          cy="42%"
          data={chartData}
          dataKey="value"
          innerRadius="55%"
          outerRadius="75%"
          paddingAngle={3}
          strokeWidth={0}
        >
          {chartData.map((entry) => (
            <Cell fill={entry.fill} key={entry.label} />
          ))}
        </Pie>
        <text dominantBaseline="central" textAnchor="middle" x="50%" y="42%">
          <tspan
            className="fill-foreground font-bold text-2xl"
            dy="-0.5em"
            x="50%"
          >
            {total}
          </tspan>
          <tspan className="fill-muted-foreground text-xs" dy="1.4em" x="50%">
            headcount
          </tspan>
        </text>
        <ChartLegend content={<ChartLegendContent nameKey="label" />} />
      </PieChart>
    </ChartContainer>
  );
}
```
