# C series toggle chart 2

> Metric switcher — users, sessions and revenue

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

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

## Install

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

## Files

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

```tsx
"use client";

import { ChartCard } from "@/registry/default/charts/chart-card";
import { SeriesToggleChart } from "@/registry/default/charts/series-toggle-chart";
import {
  formatCompact,
  formatCurrency,
} from "@/registry/default/lib/chart-utils";

const data = [
  { month: "May", revenue: 47200, sessions: 182000, users: 41200 },
  { month: "Jun", revenue: 46100, sessions: 176000, users: 40100 },
  { month: "Jul", revenue: 50800, sessions: 198000, users: 44800 },
  { month: "Aug", revenue: 53400, sessions: 211000, users: 47300 },
  { month: "Sep", revenue: 55900, sessions: 224000, users: 50900 },
  { month: "Oct", revenue: 58700, sessions: 239000, users: 53600 },
];

export default function MetricSwitcher() {
  return (
    <ChartCard className="max-w-2xl" title="Growth, last 6 months">
      <SeriesToggleChart
        categories={["users", "sessions", "revenue"]}
        chartType="area"
        className="h-40"
        data={data}
        formatters={{ revenue: formatCurrency }}
        index="month"
        valueFormatter={formatCompact}
      />
    </ChartCard>
  );
}
```
