# Line Chart

One or more series drawn on over nice gridlines, with a dot and a counting value label riding the tip of each line.

```bash
npx shadcn add https://www.reelcn.dev/r/line-chart.json
```

Usage:

```tsx
<Center>
  <LineChart
    labels={["Jan", "Feb", "Mar", "Apr", "May", "Jun"]}
    series={[
      { label: "Organic", points: [120, 180, 170, 260, 310, 420] },
      { label: "Paid", points: [90, 110, 150, 140, 190, 230] },
    ]}
  />
</Center>
```

Use for:

- Trends over time: monthly signups, latency, revenue run-rate
- Comparing two to four series on one axis

Avoid:

- Comparing separate categories. Use `bar-chart`
- Volume or cumulative totals. Use `area-chart`


## Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| delay? | `number` | — | Frames to wait before entering. |
| duration? | `number` | — | Enter duration in frames. Defaults to 0.6s. Some items reuse `duration` for an unrelated local timing. See that item's own prop docs. |
| exit? | `number \| boolean` | — | Exit at the end of the parent `<Sequence>`. `false` keeps it on screen, a number sets the exit length in frames. |
| motion? | `MotionPersonality` | — | Override the theme's motion personality. |
| poster? | `boolean` | — | Renders fully entered, with no exit: for a still frame or thumbnail. Defaults to `false`. |
| holdFrames? | `number` | — | Delays the start of the exit window by this many frames, for a minimum on-screen hold. Defaults to `0`. |
| series | `LineChartSeries[]` | — |  |
| labels? | `string[]` | — | X-axis labels, one per point. Crowded axes show every second label or fewer. |
| area? | `boolean` | `false` | Fill under each line with a gradient that fades to transparent. `area-chart` sets this. |
| areaOpacity? | `number` | `0.35` | Opacity at the top of the area gradient. |
| zero? | `boolean` | — | Start the y axis at zero. Defaults to `true` with `area`; otherwise the axis fits the data. |
| width? | `number` | — | Width in design units. Defaults to the safe-area width. |
| height? | `number` | — | Height in design units, legend included. |
| strokeWidth? | `number` | `5` | Line thickness in design units. |
| drawFrames? | `number` | — | Frames each line takes to draw. Defaults to 1.4s. |
| stagger? | `number` | — | Frames between series. Defaults to 0.25s. |
| showGrid? | `boolean` | `true` |  |
| showEnd? | `boolean` | `true` | Dot and counting value label at the tip of each line. |
| locale? | `string` | `"en-US"` | BCP 47 locale for numbers. |
| format? | `NumberFormatOptions` | — | `Intl.NumberFormat` options for value and axis labels. Defaults to the precision of the data. |
| colors? | `string[]` | — | Series colors in order. Defaults to the theme palette, accent first. |
| labelColor? | `string` | — | Axis and legend labels. Defaults to the theme muted color. |
| gridColor? | `string` | — | Gridlines. Defaults to the theme border. |
| style? | `CSSProperties` | — |  |
| className? | `string` | — |  |