Line chart
SVG line path from a data array. Renders inside ChartRoot. Supports custom y-accessors for multi-series.
Primitive:
ChartLineInteractive demo
Usage
import { ChartRoot } from '@ramtt/charts'
import { ChartLine } from '@ramtt/charts'
import { ChartAxisY } from '@ramtt/charts'
<ChartRoot data={data} height={200}>
<ChartLine className="stroke-[var(--n1150)] stroke-[1.5]" />
<ChartAxisY />
</ChartRoot>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| data | readonly number[] | — | Override ChartRoot data for this line |
| className | string | — | SVG path class (stroke color, width) |
| yDomain | [number, number] | — | Override Y domain |
| yAccessor | (d, i) => number | — | Custom Y value accessor |