# C range area chart 1

> Latency band — p5–p99 with the median line

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

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

## Install

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

## Files

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

```tsx
"use client";

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

const data = Array.from({ length: 24 }, (_, hour) => {
  const load = Math.sin(((hour - 6) / 24) * Math.PI * 2) * 0.5 + 0.5;
  const p50 = Math.round(90 + 50 * load);
  return {
    hour: `${String(hour).padStart(2, "0")}:00`,
    p5: Math.round(p50 * 0.55),
    p50,
    p99: Math.round(p50 * (2.2 + load)),
  };
});

export default function LatencyBand() {
  return (
    <ChartCard
      className="max-w-2xl"
      description="Checkout API, today. The band is p5–p99, the line is the median."
      title="Latency"
      value="128 ms"
    >
      <RangeAreaChart
        className="h-44"
        data={data}
        index="hour"
        label="p5–p99"
        maxKey="p99"
        midKey="p50"
        midLabel="Median"
        minKey="p5"
        valueFormatter={(v) => `${v} ms`}
        yAxisWidth={56}
      />
    </ChartCard>
  );
}
```
