# C sunburst chart 1

> Revenue by region — region then country

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-sunburst-chart-1).

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

## Install

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

## Files

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

```tsx
"use client";

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

const data = [
  {
    children: [
      { name: "United States", value: 412000 },
      { name: "Canada", value: 68000 },
      { name: "Mexico", value: 31000 },
    ],
    name: "Americas",
  },
  {
    children: [
      { name: "Germany", value: 142000 },
      { name: "United Kingdom", value: 118000 },
      { name: "France", value: 74000 },
    ],
    name: "EMEA",
  },
  {
    children: [
      { name: "Japan", value: 96000 },
      { name: "Australia", value: 58000 },
      { name: "India", value: 41000 },
    ],
    name: "APAC",
  },
];

export default function RevenueByRegion() {
  return (
    <ChartCard
      className="max-w-sm"
      description="Q3 revenue, region → country"
      title="Revenue by region"
    >
      <SunburstChart
        className="h-64"
        data={data}
        valueFormatter={formatCurrency}
      />
    </ChartCard>
  );
}
```
