Gauge Chart
The Gauge Chart displays a single value on a semi-circular arc, ideal for KPIs, progress indicators, and dashboard metrics. It supports configurable tick marks along the arc with optional labels, a custom value formatter, and smooth animated transitions when the value changes. The track and fill colors are fully customizable.
NOTE
For the full API, see the Charts API Reference.
Example
Usage
ts
import {
createGaugeChart,
} from '@ripl/charts';
const chart = createGaugeChart('#container', {
value: 72,
min: 0,
max: 100,
label: 'Performance',
formatValue: v => `${v}%`,
});
// Update value
chart.update({ value: 85 });Options
value— The current gauge valuemin— Minimum value (default0)max— Maximum value (default100)label— Label displayed below the valuecolor— Gauge fill color (default pastel blue)trackColor— Background track color (default#e5e7eb)formatValue— Custom value formatter functiontickCount— Number of tick marks along the arc (default5, set to0to hide)showTickLabels— Whether to show value labels at each tick (defaulttrue)formatTickLabel— Custom formatter for tick labels