# C bar chart 2

> Signups by channel — stacked columns

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-bar-chart-2).

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

## Install

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

## Files

### `registry/default/chart-variants/c-bar-chart-2.tsx`

```tsx
"use client";

import { BarChart } from "@/registry/default/charts/bar-chart";
import { ChartCard } from "@/registry/default/charts/chart-card";

// Weekly signups by acquisition channel.
const data = [
  { organic: 412, paid: 268, referral: 96, week: "W36" },
  { organic: 438, paid: 301, referral: 104, week: "W37" },
  { organic: 451, paid: 244, referral: 131, week: "W38" },
  { organic: 497, paid: 322, referral: 118, week: "W39" },
  { organic: 523, paid: 356, referral: 142, week: "W40" },
  { organic: 548, paid: 331, referral: 167, week: "W41" },
];

export default function SignupsByChannel() {
  return (
    <ChartCard
      className="max-w-2xl"
      description="Weekly signups, stacked by channel"
      title="Signups"
      value="1,046"
    >
      <BarChart
        categories={["organic", "paid", "referral"]}
        className="h-48"
        data={data}
        index="week"
        type="stacked"
      />
    </ChartCard>
  );
}
```
