Charts

Pure SVG chart components — no external dependencies. Five types with enter animations, hover tooltips, legends, and full dark mode support.

{ Chart } from '/basix/js/chart.js'

Line

Smooth Catmull-Rom bezier curves. Supports multiple series and hover tooltips.

Area

Fills the region under the line with a translucent tint. Great for volume or cumulative data.

Column

Vertical bars with multiple series side-by-side. Animate with a staggered grow effect.

Bar

Horizontal bars — ideal for ranked data or long category labels.

Pie

Per-slice hover pop-out and percentage legend. Slices animate with staggered scale + fade.

Curve styles

Applies to line and area charts via the curve option.

smooth

linear

step

Usage

Options

OptionTypeDefaultDescription
typeline | area | column | bar | pie—Chart type to render.
seriesArray<{name, data[]}>—One or more data series. Each has a name and an array of { label, value } data points.
heightnumber280Inner chart height in px.
showLegendbooleantrueShow the legend below the chart.
showGridbooleantrueShow horizontal grid lines.
animatebooleantrueEnable enter animations.
curvesmooth | linear | step'smooth'Line interpolation style for line and area charts.
yMinnumber0Fixed y-axis minimum.
yMaxnumberautoFixed y-axis maximum. Defaults to max value × 1.1.