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
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and 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.
- seriesrequiredArray<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
Content slots exposed by this component.
- #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
Events emitted by this component.
- @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.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Chart root background colour.
- Inner padding of the chart root.
- Duration of the fill arc animation.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
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.
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- colorvar(--origam-color__surface---default)
- Root chart background.
- colorvar(--origam-color__text---primary)
- Title text colour.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Basic gauge
Ecosystem
Family
Components from the same folder that share conventions and often compose together.