useChartGauge
Chart
stable
Solid-gauge geometry engine for <OrigamChartGauge>. Given a value clamped between min and max, computes the SVG arc paths for the track (full arc background) and the indicator (partial arc proportional to the value), plus centre coordinates and radius values for the value label. Designed to mirror a speedometer-style gauge with a configurable sweep angle and thickness.
API
Signature
Full TypeScript signature sourced from the composable file.
Consumed interfaces
IUseChartGaugeOptions
IChartGaugeGeometry
API
Parameters
Input parameters accepted by this composable.
- optionsrequiredIUseChartGaugeOptions
- Configuration thunks. Required: value, min, max, width, height, padding. Optional: thickness (arc ring width, default 18px), startAngle (radians, default -3π/4), endAngle (radians, default 3π/4). All values are () => T getters so the composable reacts to reactive sources.
API
Return values
Properties and methods exposed by the composable return object.
- geometry
- Computed geometry object containing: trackPath (full arc SVG d-string), valuePath (partial arc SVG d-string, empty when value is at minimum), valueAngle (radians, for optional needle/handle), startAngle, endAngle, outerRadius, innerRadius, centerX, centerY, ratio (normalised 0..1), and clampedValue.
Usage
Examples
Ready-to-paste usage snippets.
Speedometer gauge at 65%
Custom arc sweep (half-circle)