# C bullet chart 3

> Budget usage — spend with a month-end forecast marker

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/?utm_source=shadcn.exchange) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/c-bullet-chart-3).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/c-bullet-chart-3
- Screenshot: https://shadcn.exchange/shot/cnippet/c-bullet-chart-3/light.png
- Registry item: https://ui.cnippet.dev/r/c-bullet-chart-3.json
- Categories: bullet chart
- Listed: 2026-10-27, source last changed 2026-10-27

## Install

```bash
npx shadcn@latest add https://shadcn.exchange/r/cnippet/c-bullet-chart-3.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/bullet-chart`, `@cnippet/chart-utils`

## Files

### `registry/default/chart-variants/c-bullet-chart-3.tsx`

```tsx
"use client";

import { BulletChart } from "@/registry/default/charts/bullet-chart";
import { formatCurrency } from "@/registry/default/lib/chart-utils";

// Monthly cloud spend: bands at 50% / 80% / 100% of budget, target = forecast.
const lines = [
  { budget: 18000, forecast: 16500, name: "Compute", spent: 11200 },
  { budget: 6000, forecast: 6800, name: "Storage", spent: 4900 },
  { budget: 4000, forecast: 2600, name: "Networking", spent: 1700 },
];

export default function BudgetUsage() {
  return (
    <div className="w-full max-w-md rounded-lg border bg-card p-5">
      <div className="font-medium text-sm">October cloud spend</div>
      <div className="text-muted-foreground text-xs">
        Bar = spent so far · marker = month-end forecast
      </div>
      <ul className="mt-4 grid gap-5">
        {lines.map((l) => (
          <li className="grid gap-1.5" key={l.name}>
            <div className="flex justify-between text-sm">
              <span>{l.name}</span>
              <span className="text-muted-foreground tabular-nums">
                {formatCurrency(l.spent)} of {formatCurrency(l.budget)}
              </span>
            </div>
            <BulletChart
              color={
                l.forecast > l.budget ? "var(--warning)" : "var(--chart-1)"
              }
              max={Math.max(l.budget, l.forecast) * 1.05}
              ranges={[l.budget * 0.5, l.budget * 0.8, l.budget]}
              target={l.forecast}
              value={l.spent}
              valueFormatter={formatCurrency}
            />
          </li>
        ))}
      </ul>
    </div>
  );
}
```
