Chart

SVG-based data visualization component supporting bar, line, area, step, donut, and radar chart types.

// Plain markup
import { Chart } from "@shavin/ui";

Bar Mixed (Category Colors)

069138206275ChromeSafariFirefoxEdgeOther

Bar Multiple (Grouped Series)

076153229305JanFebMarAprMayJun

Bar Negative (Bi-directional Zero-Baseline)

-290-10580265450MonTueWedThuFriSat

Line Step (Orthogonal Curves)

0105210315420JanFebMarAprMayJun

Donut Active (Pie / Donut Highlight)

925Total

Radar Dots (Vertex Points)

DesignCodeUsabilitySpeedA11ySEO

Radar Grid Circle (Concentric Ring Axes)

DesignCodeUsabilitySpeedA11ySEO

Standard Bar & Area Charts

Bar
0105210315420JanFebMarAprMayJun
Area
0105210315420JanFebMarAprMayJun

Props

PropTypeDefaultDescription
data*ChartDataItem[]—Array of data item records for chart visualization.
type| "bar"—Chart visualization style type.
seriesChartSeriesConfig[]—Optional series configuration array for multi-series charts (e.g. bar-multiple).
variant"default" | "sparkline"—`sparkline` drops axes, grid and padding and fills the container (size it with className).
heightnumber260;Chart height in px (default 260; sparkline defaults to the className height).
paddingChartPadding—Plot padding in px, merged over the defaults (top 24, right 24, bottom 36, left 44).
yFormatChartYFormat—Y-axis tick / tooltip format.
yPrefixstring$Text before each formatted y value (default "$" for currency).
ySuffixstring%Text after each formatted y value (default "%" for percent).
tickCountnumber4,Number of y-axis intervals (default 4, so 5 ticks).
yMaxnumber—Fixed y-axis maximum; defaults to the data maximum.
showYAxisbooleantrue)Show y-axis tick labels (default true).
showGridbooleantrue)Show dashed horizontal grid lines (default true).
showXAxisbooleantrue)Show x-axis labels (default true).
xLabelEverynumber1)Show every Nth x label, starting with the first (default 1).
xLabelEveryMobilenumber—Below the md breakpoint show every Nth x label instead (hides the rest on small screens).
xLabelsstring[]—Explicit x labels to show (matched against datum `label`); overrides the stride props.
barRadiusChartBarRadiussmBar corner radius token (default "sm").
barGapnumber—Gap between single bars in px (default: 45% of the slot).
maxBarWidthnumber—Maximum bar width in px.

* required

Configure Theme
Theme
Accent Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font