Trend Chart
The canonical multi-series time-series chart. One configurable component that renders as line, area, or bar with a built-in mode toggle, custom tooltip, and toggleable legend. Series colour follows the multi-series hierarchy (baseline / live / context / threshold). Scroll-gated reveal.
Throughput vs plan
Requests / sec
Add to your project
One command adds this component to your project.
1
Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.
npx shadcn@latest add @aicanvas/andromeda-trend-chart2
For dark mode, add the dark class to your <html> element:
<html class="dark">Props
Every prop this component accepts. Any other prop is forwarded to the underlying element.
TrendSeries
| Prop | Type | Default | Description |
|---|---|---|---|
| keyreq | string | - | Field in each data row holding this series' y-value. |
| labelreq | string | - | Display name shown in the tooltip and legend chip. |
| role | 'baseline'|'live'|'context'|'threshold' | - | Colour role in the Andromeda charts hierarchy; threshold also renders dashed. |
| color | string | - | Explicit override; prefer `role`. |
TrendChart
| Prop | Type | Default | Description |
|---|---|---|---|
| datareq | object[] | - | Rows of chart data, one object per x-axis point. |
| seriesreq | TrendSeries[] | - | Series to plot, each bound to a data-row field by key. |
| xKey | string | 't' | Field in each data row plotted along the x-axis. |
| modes | Array<'line'|'area'|'bar'> | ['area','bar'] | Toggle appears when >1. |
| defaultMode | 'line'|'area'|'bar' | - | Render mode selected on mount; defaults to the first entry in modes. |
| title | string | - | Heading shown at the top-left of the header. |
| yLabel | string | - | Uppercase mono axis caption, top-left. |
| tooltipLabelFormatter | (label:any)=>string | - | Formats the x value shown as the tooltip heading. |
| valueFormatter | (value:any)=>string | - | Formats each series value shown in the tooltip. |
| xInterval | number | 4 | Number of x-axis ticks skipped between rendered labels. |
| showLegend | boolean | true | Render the toggleable legend row in the footer. |
| showYAxis | boolean | true | Reserve the left Y-axis tick gutter. Set false on compact cards where an external headline already states the magnitude, and the plot then fills its card content box edge-to-edge with no stray left inset (the Andromeda spacing rules). |
| footerSlot | React.ReactNode | - | Right side of the footer (custom controls). |
| height | number|'fill' | 240 | Plot height in px, or 'fill' to grow into a flex parent. |
| className | string | - | Class applied to the root container element. |
| style | React.CSSProperties | - | Inline styles merged onto the root container element. |

