ChartGauge
Solid gauge (radial progress indicator). A 270-degree track with a filled arc indicating the current value, an optional centre label, and optional min/max endpoint labels. Reads the first datum of the first series.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-chart-gauge> — 6 internal parts.- 1.origam-chart-gauge__header
- Header block. Contains title and subtitle divs.
- 2.origam-chart-gauge__body
- Body container. Wraps the SVG and empty-state overlay.
- 3.origam-chart__gauge-track
- Background arc path — always full 270 degrees.
- 4.origam-chart__gauge-fill
- Foreground arc path — length proportional to value ratio.
- 5.origam-chart__gauge-value
- Centre value label. Hidden when gaugeShowValue=false.
- 6.origam-chart__gauge-endpoint (min/max)
- Min and max labels at arc endpoints. Hidden when gaugeShowEndpoints=false.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- gaugeMinnumber0
- Lower bound of the gauge range.
- gaugeMaxnumber100
- Upper bound of the gauge range.
- gaugeUnitstring''
- Unit appended to the centre label (e.g. "%", " km/h").
- gaugeThicknessnumber18
- Arc thickness in SVG pixels.
- gaugeStartAnglenumber-3π/4 (≈ -2.356)
- Arc start angle in radians. Default = bottom-left of a 270-degree arc.
- gaugeEndAnglenumber3π/4 (≈ 2.356)
- Arc end angle in radians. Default = bottom-right of a 270-degree arc.
- gaugeShowEndpointsbooleantrue
- Render gaugeMin and gaugeMax labels at the arc endpoints.
- gaugeShowValuebooleantrue
- Render the centre value label.
- seriesrequisArray<IChartSeries>[]
- Data series. Only series[0].data[0] is consumed as the gauge value. Extra series are ignored.
- categoriesArray<string>
- titlestring
- Optional chart title rendered above the gauge SVG.
- subtitlestring
- Optional subtitle rendered below the title.
- showLegendboolean
- legendPositionTChartLegendPosition
- showTooltipboolean
- animatedbooleantrue
- Animate the fill arc on first paint and data changes.
- animationDurationnumber
- Palette used when a series does not pin its own color.
- aspectRatiostring
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- heightnumber | string
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- elevationTElevation
- bgColorTColor
- fontSizeTFontSize
- fontWeightTFontWeight
API
Slots
Emplacements de contenu exposés par ce composant.
- #gauge-value
- Replace the centre value label. Receives raw value, normalised ratio (0..1), formatted string and unit.
- #gauge-min
- Replace the min label at the start of the arc.
- #gauge-max
- Replace the max label at the end of the arc.
- #title
- Replace the title block.
- #empty
- Rendered when series is empty or has no data.
API
Emits
Événements émis par ce composant.
- @point-clickIChartPoint, MouseEvent | KeyboardEvent
- Fired on click on the gauge arc.
- @legend-clickIChartSeries, number
- Fired when the user clicks a legend entry.
- @series-toggleIChartSeries, boolean
- Resulting visibility flip after a legend click.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- Chart root background colour.
- Inner padding of the chart root.
- Duration of the fill arc animation.
Inclusion
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
Notes
- Root element has role="figure" with aria-label set to the title prop or "gauge chart".
- SVG has role="img" with aria-valuemin, aria-valuemax, aria-valuenow attributes for screen readers.
- All animations are disabled under prefers-reduced-motion: reduce.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- colorvar(--origam-color__surface---default)
- Root chart background.
- colorvar(--origam-color__text---primary)
- Title text colour.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic gauge
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.