Skip to content

Gauge for Angular

AngularCharts

Radial gauge for one value within a known range on a 240 degree arc, with optional qualitative bands (for example poor / fair / good), a target marker, and the formatted value in the center: a static svg role=“meter” whose value text names the band and the target. Independent of the chart frame, so it stays small.

  • Value in rangeA radial arc for one value between a minimum and maximum.
  • Bands and targetNamed qualitative bands and a target marker; the current band shows under the value.
  • Meter semanticsExposed as a meter whose value text names the band and the target.
  • LightweightA static reading without the chart frame, so it stays small.

Behavior, design tokens, and limitations are described on the Gauge page; this page covers the Angular API.

import { Component } from '@angular/core';
import { AuiGauge } from '@absoluteui/angular/gauge';
import type { GaugeBand } from '@absoluteui/components/gauge';
@Component({
selector: 'app-cpu',
imports: [AuiGauge],
template: `<aui-gauge label="CPU load" [value]="load" [bands]="bands" [target]="60"></aui-gauge>`,
})
export class CpuComponent {
readonly load = 72;
readonly bands: GaugeBand[] = [{ to: 50, label: 'Normal' }, { to: 80, label: 'Busy' }, { to: 100, label: 'Critical' }];
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiGauge } from '@absoluteui/angular/gauge';

Defaults for every instance: provideAbsoluteUIConfig({ components: { gauge: { ... } } }) (see Configuration).

Class AuiGauge; template reference #ref="auiGauge".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Input Type Default Description
label string Required. What is measured: visible title and the accessible name of the meter (aria-labelledby).
hideLabel boolean false Visually hide the title; it stays the accessible name.
description string Visible text below the gauge (text only). Not referenced by aria-describedby.
value number | null Required. Current value. null (or a non-finite number) shows an em dash and the value text “No value”; aria-valuenow is removed. Values outside min-max are clamped on the arc and in aria-valuenow; the value text keeps the real value.
min number '0' Range start (finite).
max number '100' Range end (finite, greater than min).
bands readonly GaugeBand[] Qualitative bands { to: number, label: string, color?: 1-8 } in ascending to order; the first band starts at min. Drawn as a thin arc outside the track; the current band’s label is printed under the reading and appended to the value text.
target number Target value marked across the arc; appended to the value text (“target 60%”).
color GaugeColor Palette slot of the value arc. Default: the current band’s color (its color, else its position), else 1.
valueFormat NumberFormatOptions Number format for the reading, range ends, target, and value text.
formatValue (value: number) => string Custom value text; overrides valueFormat everywhere.
valueText string Replaces the generated aria-valuetext.
theme ChartTheme Look and feel: { palette?: string[] (1-8 CSS colors for slots 1-8); fontFamily?; fontSize? (8-32 px); textColor?; gridLines?: boolean; gridColor?; gridDash? (“4 2” or “none”); axisColor?; lineWidth? (0.5-12 px); markerSize? (1-20 px); cornerRadius?, barRadius?, cellRadius?, sliceRadius?, boxRadius? (0-50 px); swatchRadius? (0-8 px); tooltipRadius?, controlRadius? (0-50 px); lineJoin?: ‘round’ | ‘miter’ | ‘bevel’; areaOpacity? (0-1); gradient?: boolean; valueLabelColor?; tooltip?: { background?, color?, borderColor? }; legendPosition?: ‘top’ | ‘bottom’ | ‘start’ | ‘end’; animation?: boolean | { duration?: number (0-5000 ms) } }. Applied as –aui-chart-* custom properties and classes on the host through the CSSOM (CSP-safe); colors are validated with CSS.supports(‘color’). Animation is opt-in and never runs with prefers-reduced-motion: reduce or [data-aui-animation=‘none’]. The gauge uses palette, gridColor (track), fontFamily, textColor (range and band labels), and animation.
showRange boolean true Print the formatted min and max under the ends of the arc.
locale string 'en-US' Number and message locale.
direction Direction 'ltr' Accepted for configuration consistency; the gauge is not mirrored (min at the lower left, clockwise to max at the lower right).

Pattern: Static meter: svg role=“meter” (WAI-ARIA 1.2) named by the title, with aria-valuenow/min/max and an aria-valuetext that names the band and the target.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Gauge: Accessibility and performance.