Aliases
chart, graph
DataChartSVG line, bar, and area charts with legends and point tooltips.
Aliases
chart, graph
Foundations
Contrast and distinctness,Layout and composition,Proof system
DataChart for compact product analytics, trend summaries, or operational dashboards.DataChart for stacked, zoomable, or exploration-heavy analysis.chart canvas shell
surface Owns the chart background, border, and internal spacing.
category labels and grid
axis Supports interpretation of the plotted values.
series explanation
legend Maps color to each series label.
point detail
tooltip Shows focused or hovered value details.
| Name | Type | Default | Description |
|---|---|---|---|
type | 'line' | 'bar' | 'area' | — | Chart rendering mode. |
series | Array<{ id: string; label: string; values: number[]; tone?: "brand" | "success" | "warning" | "danger" | "neutral" }> | — | Series values to plot. |
categories | string[] | — | Category labels aligned with each value index. |
title | string | — | Chart title. |
description | string | — | Optional supporting description. |
height | number | 280 | SVG height in pixels. |
showLegend | boolean | true | Shows the series legend. |
showGrid | boolean | true | Shows horizontal grid lines. |
showTooltip | boolean | true | Shows tooltip details on focus or pointer interaction. |
valueFormat | (value: number) => string | — | Optional formatter for displayed values. |
emptyTitle | string | 'No data' | Title shown when no chart data is available. |
emptyDescription | string | '' | Optional empty-state guidance. |
theme | ThemeContract | — | Sets the theme used to resolve component styles. |
| Name | Description |
|---|---|
default | DataChart is prop-driven and does not expose custom series or tooltip slots. |
Variants
line: Trend-focused path chartbar: Comparative column chartarea: Filled trend chartSizes
default: DataChart uses an explicit height prop rather than recipe sizes.States
rest: Chart rendered without an active pointtooltip: One point or bar is active for focused readingSemantics
Keyboard
Screen readers
Checklist
Implementation notes
DataChart supports line, bar, and area series. It does not support stacking or zooming.A trend chart for comparable series.
<DataChart type="line" title="Revenue" categories={['Jan', 'Feb', 'Mar']} series={[{ id: 'mrr', label: 'MRR', values: [12, 18, 24] }]} /> Bar mode works well for side-by-side category comparisons.
<DataChart type="bar" title="Activation" categories={['Week 1', 'Week 2', 'Week 3']} series={activationSeries} /> Use area mode to show a trend for one metric.
<DataChart type="area" title="Active users" showLegend={false} categories={['Mon', 'Tue', 'Wed']} series={activeUserSeries} /> Calculated fixtures; browser evidence is not collected. Layout estimates use declared text behavior and maximum token values.
type=line
type=bar
type=area