# C area chart 1

> Visitors — desktop vs mobile with gradient fill

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

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

## Install

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

## Files

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

```tsx
"use client";

import { AreaChart } from "@/registry/default/charts/area-chart";
import { ChartCard } from "@/registry/default/charts/chart-card";
import { formatCompact } from "@/registry/default/lib/chart-utils";

const data = [
  { desktop: 18640, mobile: 12210, month: "Jan" },
  { desktop: 21300, mobile: 14880, month: "Feb" },
  { desktop: 19870, mobile: 16020, month: "Mar" },
  { desktop: 23410, mobile: 17950, month: "Apr" },
  { desktop: 25120, mobile: 21330, month: "May" },
  { desktop: 24680, mobile: 23790, month: "Jun" },
];

export default function VisitorsByDevice() {
  return (
    <ChartCard
      className="max-w-2xl"
      delta={0.182}
      description="Monthly visitors, Jan – Jun 2026"
      title="Visitors"
      value={formatCompact(48470)}
    >
      <AreaChart
        categories={["desktop", "mobile"]}
        className="h-48"
        data={data}
        index="month"
      />
    </ChartCard>
  );
}
```
