Multi Line Chart With Legend
UnlimitedSeveral SVG lines draw in together; legend buttons toggle a series and the y-axis rescales while the remaining lines morph to fit.
chartlinelegendtogglesvg
Installation
Run the shadcn CLI in a project with Tailwind CSS. The component lands in components/pixelpapa/chart-line-multi-legend.tsx. This is an Unlimited component, so the CLI needs your API key: set it up once, then install it by name.
Build it with AI
Prefer to let an agent do the wiring? Copy this prompt, describe where the component should go, and paste.
More charts
- Area Chart GradientA smooth SVG area chart that draws its line on mount, fades in a gradient fill and snaps a crosshair tooltip to the nearest point.
- Donut Chart SegmentsA donut whose segments sweep in one after another; hovering a segment or its legend row thickens it and swaps the centre total for that slice.
- Funnel Steps ChartA flowing horizontal funnel: each stage tapers into the next with a bezier, stages fade in left to right and hovering one shows its drop-off.
- Grouped Bar ChartSide-by-side SVG bars per category that grow from the baseline in a stagger, with a group highlight and a tooltip comparing every series.
- Heat Grid Week by HourA 7×24 SVG heatmap whose cells ripple in diagonally; hover or arrow-key between cells for a snapped tooltip, with peak hour called out.
- Inline SparklineA tiny table-cell sparkline that draws itself on mount, colours by trend and snaps a value bubble to the nearest point on hover.