# C treemap 1

> Revenue mix — two levels: business line and product

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-treemap-1).

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

## Install

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

## Files

### `registry/default/chart-variants/c-treemap-1.tsx`

```tsx
"use client";

import { ChartCard } from "@/registry/default/charts/chart-card";
import { Treemap } from "@/registry/default/charts/treemap";
import { formatCurrency } from "@/registry/default/lib/chart-utils";

const data = [
  {
    children: [
      { name: "Pro monthly", value: 412000 },
      { name: "Pro annual", value: 286000 },
      { name: "Team", value: 198000 },
    ],
    name: "Subscriptions",
  },
  {
    children: [
      { name: "Onboarding", value: 96000 },
      { name: "Support plans", value: 74000 },
    ],
    name: "Services",
  },
  {
    children: [
      { name: "API overage", value: 118000 },
      { name: "Storage", value: 52000 },
    ],
    name: "Usage",
  },
  {
    children: [{ name: "Partners", value: 64000 }],
    name: "Marketplace",
  },
];

export default function RevenueByProduct() {
  return (
    <ChartCard
      className="max-w-2xl"
      description="Revenue by line of business and product, FY2026"
      title="Revenue mix"
      value={formatCurrency(1300000)}
    >
      <Treemap className="h-48" data={data} valueFormatter={formatCurrency} />
    </ChartCard>
  );
}
```
