# Gauge Chart

Gauge for one value on its scale: semi-circle, speedometer, ring or segmented. The arc draws to the value and the number counts up.

- Category: Charts
- Page: https://wunderui.com/components/gauge-chart
- Tier: Core and Pro

## Install

Gauge Chart ships with WunderUI Core and Pro in the @wunderui/react package.

## Import

```tsx
import { GaugeChart, GaugeChartProps, GaugeChartVariant } from "@wunderui/react"
```

## Minimal usage

Then use it:

```tsx
import { GaugeChart } from "@wunderui/react/charts"

export function CpuLoad() {
  return <GaugeChart value={68} caption="of 4.0 GHz" label="CPU load" />
}
```

Expected result: You see a half dial filled to 68 percent, with the number and caption under the arc.

## When to use

### Use Gauge Chart for

- One value against its scale: load, memory, a score
- A value that falls into bands (normal, high, critical)
- A dial on a dashboard tile

### Use something else

- [Radial Chart](https://wunderui.com/components/radial-chart) for several values as rings
- [Progress Chart](https://wunderui.com/components/progress-chart) for quotas as meters
- [Bullet Chart](https://wunderui.com/components/bullet-chart) for a value against a target and ranges
- [Sparkline](https://wunderui.com/components/sparkline) for the history of a value

## Keyboard

The gauge shows one value, so the plot has one stop and the live region reads that value on its scale.

| Key | Action |
|---|---|
| `Tab` or `Shift+Tab` | Moves focus to the gauge and away from it. |
| `ArrowRight` or `ArrowLeft` | Land on the single value; the live region reads the label and the value on its scale ("CPU load: 64%"), never a share of a total. |

## Behavior

What the chart does on its own and what the page decides.

- **One value:** Set the value and, if needed, the scale (default 0 to 100). A label names the value and a caption adds a unit line; a value that isn't a finite number counts as empty.
- **Colour bands:** The speedometer and segmented gauge colour the arc by band: green to 60 percent, yellow to 80, red above. Pass your own ranges, or one colour for the semi-circle and ring.
- **Needle and ticks:** Needle and ticks shape the semi-circle and the speedometer. Min and max labels replace the texts at the ends of the scale.
- **Tooltip:** The tooltip takes its form from the chart's own width, like Area, Line and Bar: under 360 px it docks over the top of the chart at its full width, under 560 px it is the compact card, above that the standard card that follows the pointer.
- **Loading, empty and error:** The chart keeps its size while loading, empty or failed, so the card never changes height. Add a retry handler to show a Try again button on error.
- **Size:** The chart fills the width of its container, and you set the plot height. Text never scales: labels keep their size at every width.

## Motion

The enter sequence and hover follow the library's motion tokens.

- **Draw-in:** The track is there first; then the arc, the needle and the number move from the start of the scale to the value as one motion. Segments light up as the value passes them.
- **New value:** When the value changes, arc, needle and number move on from where they are to the new value, never from zero.
- **Reduced motion:** With reduced motion the enter sequence is off and the chart appears at once. Tooltip, crosshair and every state still work.

## Anatomy

- `GaugeChart`: Takes one value on a min to max scale. Options add a label, a unit caption, colour bands, a needle, ticks, segments and custom end texts.
- `Plot`: The focusable region. Arrow keys land on the single value and the live region reads its label and value on the scale, like CPU load: 64%.
- `Marks`: The track and the value arc, or the segments. On the speedometer the arc is split into colour bands with a needle. Arc, needle and number are one motion: they read the same value, so they start, travel and land together.
- `Value and caption`: The number in the ring or above the centre of the half arc, sized by the room inside the arc, with the caption below and the min and max at the ends of the half arc.
- `Colour bands`: By default green up to 60 percent of the scale, yellow to 80, red above (Normal, High, Critical). The speedometer and segmented gauge colour by band; the semi-circle and ring use one colour.
- `Tooltip`: The label and the value, with a dot in the band colour on the speedometer and segmented variants.
- `Loading, empty and error`: A muted half ring (a full ring on the ring gauge) under the shimmer. A value that isn't a finite number counts as empty and reads no value.
- `Data table and live region`: The value as a one-row table for screen readers.
- `Gauge Needle`
- `Gauge Value`
- `Chart Center`

## Best practices

### When to use

- Use GaugeChart for one number with a meaningful range, such as CPU load or a score out of 100. Use LineChart for a trend and BulletChart for several values against targets.

### Do

- Show the number and unit as text, not only as an arc. The arc is a glance; a caption like of 4.0 GHz carries the meaning for everyone.
- Add bands only where a threshold has a decision attached, such as normal, high and critical. Bands without an action are noise.
- Pair the colour with the band label in the tooltip and caption. Green, yellow and red alone fail for people who can't tell them apart.

### Don't

- Don't use a speedometer for values that only need a percentage. A ring gauge or ProgressChart takes less space and has no needle to misread.
- Don't leave min and max implicit when the scale isn't 0 to 100. The default formatter adds a percent sign, so pass a value formatter for any other unit.

## API reference

### GaugeChart

| Prop | Type | Default | Description |
|---|---|---|---|
| value* | number |  |  |
| animate | boolean |  |  |
| animationKey | string \| number |  |  |
| bands | readonly GaugeBand[] |  | Colour bands (speedometer, segmented): e.g. good / warn / critical. |
| caption | string |  | Small text under the value ("of 4.0 GHz"). |
| className | string |  | Extra classes for the root element of the chart. |
| color | "indigo" \| "blue" \| "purple" \| "green" \| "orange" \| "pink" \| "yellow" \| "red" \| "grey" |  | Colour of the value arc (semi-circle, ring). Default indigo (ring: green). |
| height | number | 220 |  |
| label | string | "Value" | Name of the measured value (tooltip, table, screen readers). |
| max | number | 100 |  |
| maxLabel | string |  |  |
| min | number | 0 |  |
| minLabel | string |  | Texts at the two ends of the half arc (default: the formatted min and max). |
| needle | boolean | false | `semi-circle-gauge`: a needle on the value (moves with the arc and the number when the value changes). |
| onRetry | () => void |  | Shows a Try again button in the error state and calls this when it is pressed. |
| palette | "bands" \| "indigo" \| "heat" \| "success" | "bands" | bands keeps the colour bands (or color for one arc). indigo uses the indigo tonal scale, light at the start of the scale and strong at its end. heat and success paint the arc with a ramp that follows its sweep (green to red, or red to green), shown up to the value; the number and the needle stay in the foreground colour. |
| segments | number | 10 | `segmented-gauge`: number of segments (default 10). |
| state | "ready" \| "loading" \| "empty" \| "error" |  |  |
| ticks | number |  | `semi-circle-gauge`: tick marks inside the arc (number of intervals, e.g. 10). |
| valueFormatter | ChartValueFormatter |  |  |
| variant | "semi-circle-gauge" \| "speedometer-gauge" \| "ring-gauge" \| "segmented-gauge" | "semi-circle-gauge" | Figma variant. Default `semi-circle-gauge`. |
| width | number |  |  |

## Examples

### States

### Colour ramps and indigo tones

### Needle and ticks

## In context

### Credit Score

Score on a banded speedometer with the score factors.

### Server Load

Four gauge panels, one per server.

### Net Promoter Score

NPS ring with the response mix.

## For AI agents

`get_component("gauge-chart")`

Hand your agent this page as Markdown or the WunderUI MCP server, not a screenshot.
