# Metric Chart (Andromeda Legacy)

Metric Chart is a component of the free, MIT-licensed Andromeda Legacy design system from AI Canvas (https://aicanvas.me). Index of every system, component and install setup: https://aicanvas.me/llms.txt

Self-framed single-series telemetry panel: corner brackets, kicker and title header, and a status badge around one fitted-domain area chart. The fitted y-domain keeps non-zero-floor readings like altitude or latency filling the plot instead of flattening into a sliver.

- Design system: [Andromeda Legacy](https://aicanvas.me/design-systems/andromeda.md)
- License: MIT
- Install slug: `andromeda-metric-chart`
- Page: https://aicanvas.me/design-systems/andromeda/metric-chart

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-metric-chart
```

Needs a free AI Canvas account; signed out, the command writes a placeholder (an `AccountRequired` notice) instead.

Every Andromeda Legacy component at once: `npx shadcn@latest add @aicanvas/andromeda`.

Token setup: the Install section of https://aicanvas.me/llms.txt.

## Use it

It installs to `components/aicanvas/andromeda/components/MetricChart.tsx` (under `src/` if your project has one). With the usual `@/` alias:

```tsx
import { MetricChart } from '@/components/aicanvas/andromeda/components/MetricChart'
```

## Example

```tsx
import { MetricChart } from '@/components/aicanvas/andromeda/components/MetricChart'

<MetricChart
  label="Deploy duration"
  title="Build time"
  data={[{ t: 'Mon', v: 42 }, { t: 'Tue', v: 38 }, { t: 'Wed', v: 35 }]}
  unit="s"
/>
```

## Variants

- `variant`: accent, warning or fault (default 'accent')

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label?` | `string` | `'/// Telemetry'` | Card kicker label. |
| `title?` | `string` | `'Metric'` | Card title. |
| `description?` | `string` |  | Optional description line. |
| `data?` | `object[]` |  | Points of { [xKey], [dataKey] }. |
| `dataKey?` | `string` | `'v'` |  |
| `xKey?` | `string` | `'t'` |  |
| `unit?` | `string` |  | Shown muted after the tooltip value. |
| `variant?` | `'accent'\|'warning'\|'fault'` | `'accent'` | Badge only — chart ink stays neutral. |
| `badgeText?` | `string\|null` | `'Live'` | null hides the badge. |
| `domain?` | `Array` | `['dataMin - 1', 'dataMax + 1']` | recharts y-domain (fitted). |
| `xInterval?` | `number` | `3` |  |
| `height?` | `number\|'fill'` | `224` | Plot height; 'fill' grows into a flex parent. |
| `className?` | `string` |  | Additional CSS classes applied to the root element. |
| `style?` | `React.CSSProperties` |  | Inline styles applied to the root element. |

## More Andromeda Legacy components

- [Waveform](https://aicanvas.me/design-systems/andromeda/waveform.md)
- [Media Card](https://aicanvas.me/design-systems/andromeda/media-card.md)
- [Data Table](https://aicanvas.me/design-systems/andromeda/data-table.md)
- [Music Player](https://aicanvas.me/design-systems/andromeda/music-player.md)
- [Nav Item](https://aicanvas.me/design-systems/andromeda/nav-item.md)
