# Appointments bar chart

> Clinic appointments attended and missed, as a stacked bar 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-bar-appointments).

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

## Install

```bash
npx shadcn@latest add https://shadcn.exchange/r/organui/chart-bar-appointments.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

Appointments bar chart: https://organui.com/charts/bar#chart-bar-appointments

## Files

### `registry/base-nova/charts/chart-bar-appointments.tsx`

```tsx
"use client"

import { Bar, BarChart, CartesianGrid, XAxis } from "recharts"

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

export const description =
  "Clinic appointments attended and missed, as a stacked bar chart"

// Outpatient appointments per month, illustrative.
const chartData = [
  { month: "January", attended: 486, missed: 64 },
  { month: "February", attended: 505, missed: 58 },
  { month: "March", attended: 537, missed: 71 },
  { month: "April", attended: 473, missed: 49 },
  { month: "May", attended: 509, missed: 52 },
  { month: "June", attended: 514, missed: 47 },
]

const chartConfig = {
  attended: {
    label: "Attended",
    color: "var(--chart-2)",
  },
  missed: {
    label: "Missed",
    color: "var(--chart-1)",
  },
} satisfies ChartConfig

export function ChartBarAppointments() {
  return (
    <Card>
      <CardHeader>
        <CardTitle>Appointments</CardTitle>
        <CardDescription>Attended and missed, by month</CardDescription>
      </CardHeader>
      <CardContent>
        <ChartContainer config={chartConfig}>
          <BarChart accessibilityLayer data={chartData}>
            <CartesianGrid vertical={false} />
            <XAxis
              dataKey="month"
              tickLine={false}
              tickMargin={10}
              axisLine={false}
              tickFormatter={(value) => value.slice(0, 3)}
            />
            <ChartTooltip content={<ChartTooltipContent hideLabel />} />
            <ChartLegend content={<ChartLegendContent />} />
            <Bar
              dataKey="attended"
              stackId="a"
              fill="var(--color-attended)"
              radius={[0, 0, 4, 4]}
            />
            <Bar
              dataKey="missed"
              stackId="a"
              fill="var(--color-missed)"
              radius={[4, 4, 0, 0]}
            />
          </BarChart>
        </ChartContainer>
      </CardContent>
      <CardFooter className="text-sm text-muted-foreground">
        About one in ten missed; illustrative data.
      </CardFooter>
    </Card>
  )
}
```
