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
Signature TypeScript complète extraite du fichier du composable.
Interfaces consommées
IUseChartGaugeOptions
IChartGaugeGeometry
API
Paramètres
Paramètres d'entrée acceptés par ce composable.
- optionsrequisIUseChartGaugeOptions
- 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
Valeurs de retour
Propriétés et méthodes exposées par l'objet retourné par le composable.
- 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
Exemples
Extraits de code prêts à coller.
Speedometer gauge at 65%
Custom arc sweep (half-circle)