Charts
LineChart
Temporal trends, multi-series comparisons, gradient area fills and live data.
<script>
import { LineChart } from "@codeatlasdev/ui/charts";
</script>
<LineChart
series={[{ name: "Revenue", data: revenue }]}
categories={months}
valueFormatter={(v) => `$${v / 1000}k`}
/>
Simple line
Code
Multi-line comparison
Each series gets its own palette color.
Code
Area with gradient fill
area fills under each line with a gradient that fades to transparent.
Code
Real-time stream
Replace the data array and the chart updates in place.
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
series | ChartSeries[] | – | Named series sharing one category axis. Each is { name, data: number[], color? }. |
categories | string[] | – | X-axis labels, one per data point. |
valueFormatter | (value: number) => string | – | Formats y-axis ticks and tooltip values. |
area | boolean | false | Fills the area under each line with a gradient. |
height | string | '320px' | CSS height of the chart. |
class | string | '' | Extra class names. |