Chart

A lightweight SVG line/area/bar chart.

MonTueWedThuFriSatSun

Bar

Line

MonTueWedThuFriSatSun

API reference

Inputs

PropTypeDefaultDescription
type"area" | "bar" | "donut" | "gauge" | "line"'line'Chart render style: line, bar, filled area, a donut ring, or a half-ring gauge.
seriesreadonly ChartSeries[][]Series to plot; bar/donut use only the first series.
labelsreadonly string[][]X-axis tick labels rendered below the chart.
heightnumber220Chart height in pixels (SVG viewBox height / donut diameter).
maxnumber | nullnullOverride for the value the chart scales against. For a donut it defines the full ring (e.g. `max=100` with data `[62]` fills 62%); otherwise the max of the series data is used.
thicknessnumber12Donut ring thickness, in the 100×100 viewBox units.
activeIndexnumber | nullnullIndex of the highlighted bar (bar charts). When set, the active bar renders solid and the rest are tinted; when `null` every bar renders solid.
barLabelsreadonly string[][]Value text shown above each bar (bar charts); pass one entry per data point.
stackedbooleanfalseStack every series into one bar per data point, bottom-to-top (bar charts).
groupedbooleanfalseRender every series side-by-side within each data slot (grouped bar charts).
barColorsreadonly string[][]Per-bar fill colors (bar charts); index-aligned with the first series' data. Overrides the series color.
trackbooleanfalseDraw a faint full-height track behind each bar (bar charts).
dotsbooleanfalseRender a dot marker at each data point (line/area charts).
gridXnumber0Number of evenly-spaced vertical grid lines (line/area charts; 0 hides them).
labelstring'Chart'Accessible label for the chart's `aria-label`.

Types

ChartSeries

FieldTypeDescription
name?stringOptional series name (used for legends/identification).
datanumber[]Y-axis values plotted in order along the series.
color?stringOptional explicit stroke/fill colour; falls back to the palette.

Every ng-blatui component also accepts a class input to merge extra Tailwind classes onto the host.