# Blood donations pie chart

> Blood donations by type, as a pie chart.

A shadcn/ui block from the [@organui](https://organui.com/?utm_source=shadcn.exchange) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/organui/chart-pie-blood-types).

- Page, with a live preview: https://shadcn.exchange/r/organui/chart-pie-blood-types
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/organui/chart-pie-blood-types-light-8109cb09997b874d.png
- Registry item: https://organui.com/r/chart-pie-blood-types.json
- Categories: charts, charts-pie
- Listed: 2026-10-22, source last changed 2026-10-22

## Install

```bash
npx shadcn@latest add https://shadcn.exchange/r/organui/chart-pie-blood-types.json
```

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

## Dependencies

- npm packages: `recharts`
- Registry items: `card`, `chart`

## Notes from the registry

Blood donations pie chart: https://organui.com/charts/pie#chart-pie-blood-types

## Files

### `registry/base-nova/charts/chart-pie-blood-types.tsx`

```tsx
"use client"

import { Pie, PieChart } from "recharts"

import {
  Card,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  type ChartConfig,
} from "@/components/ui/chart"

export const description = "Blood donations by type, as a pie chart"

// Units donated this month, illustrative.
const chartData = [
  { type: "o", units: 412, fill: "var(--color-o)" },
  { type: "a", units: 356, fill: "var(--color-a)" },
  { type: "b", units: 98, fill: "var(--color-b)" },
  { type: "ab", units: 34, fill: "var(--color-ab)" },
]

const chartConfig = {
  units: {
    label: "Units",
  },
  o: {
    label: "O",
    color: "var(--chart-1)",
  },
  a: {
    label: "A",
    color: "var(--chart-2)",
  },
  b: {
    label: "B",
    color: "var(--chart-3)",
  },
  ab: {
    label: "AB",
    color: "var(--chart-4)",
  },
} satisfies ChartConfig

export function ChartPieBloodTypes() {
  return (
    <Card className="flex flex-col">
      <CardHeader className="items-center pb-0">
        <CardTitle>Blood donations</CardTitle>
        <CardDescription>Units by ABO type, this month</CardDescription>
      </CardHeader>
      <CardContent className="flex-1 pb-0">
        <ChartContainer
          config={chartConfig}
          className="mx-auto aspect-square max-h-[250px]"
        >
          <PieChart>
            <ChartTooltip
              cursor={false}
              content={<ChartTooltipContent hideLabel />}
            />
            <Pie data={chartData} dataKey="units" nameKey="type" />
          </PieChart>
        </ChartContainer>
      </CardContent>
      <CardFooter className="text-sm text-muted-foreground">
        Illustrative data.
      </CardFooter>
    </Card>
  )
}
```
