# C polar area chart 2

> Wind rose — hours by direction

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

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

## Install

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

## Files

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

```tsx
"use client";

import { ChartCard } from "@/registry/default/charts/chart-card";
import { PolarAreaChart } from "@/registry/default/charts/polar-area-chart";

// Hours of wind from each direction in October; prevailing south-westerly.
const data = [
  { direction: "N", hours: 42 },
  { direction: "NE", hours: 28 },
  { direction: "E", hours: 35 },
  { direction: "SE", hours: 61 },
  { direction: "S", hours: 104 },
  { direction: "SW", hours: 186 },
  { direction: "W", hours: 152 },
  { direction: "NW", hours: 76 },
];

export default function WindRose() {
  return (
    <ChartCard
      className="max-w-sm"
      description="Hours of wind by direction, October"
      title="Wind rose"
    >
      <PolarAreaChart
        category="hours"
        className="h-64"
        color="var(--chart-2)"
        data={data}
        index="direction"
        valueFormatter={(value) => `${value} h`}
      />
    </ChartCard>
  );
}
```
