# Gauge chart

One value against its range and an optional target, as a half ring.

- Family: charts
- Import: `import { GaugeChart } from "@senvenli/react/charts";`
- Page: https://design.senvenli.com/docs/components/gauge-chart
- JSON: https://design.senvenli.com/docs/components/gauge-chart.json

## Example: Against a target

A share of 100 with the target marked on the arc.

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

const percent = new Intl.NumberFormat("en", { style: "percent" });

export default function Example() {
  return <GaugeChart title="Sales quota reached" period="Q1 2026" value={72} target={85} valueFormatter={(value) => percent.format(value / 100)} />;
}
```

## Examples

### A custom range

`min` and `max` bound a figure that is not a percentage.

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

const gigabytes = new Intl.NumberFormat("en", { style: "unit", unit: "gigabyte" });

export default function Example() {
  return <GaugeChart title="Storage used" period="Team plan, 500 GB" value={318} max={500} valueFormatter={gigabytes.format} />;
}
```

## Guidelines

### When to use it

- One figure against a goal: utilization, a quota.

### Use something else when

- [meter](https://design.senvenli.com/docs/components/meter.md): A compact bar with warning and danger thresholds fits better in a row or card.
- [progress](https://design.senvenli.com/docs/components/progress.md): The value is how far a task has got.
- [stat](https://design.senvenli.com/docs/components/stat.md): The figure and its change matter more than its range.

## Accessibility

Built in:

- A "Show as table" button shows the same data as a table, which screen readers get by default.

You provide:

- A title that says what the figure is.

## API reference

### GaugeChart

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| title | `string` |  | no | What the chart shows, over it; leave it out when a card or a heading already says so. |
| aria-label | `string` |  | no | Names the chart when it has no visible `title` (a card's heading already says what it shows). |
| period | `string` |  | no |  |
| height | `number` | `160` | no |  |
| isLoading | `boolean` |  | no |  |
| value | `number` |  | yes |  |
| min | `number` | `0` | no | 0 by default. |
| max | `number` | `100` | no | 100 by default: gauges are for bounded figures (occupancy, quota). |
| target | `number` |  | no | A 2px tick on the arc, named under the value. |
| valueFormatter | `ChartValueFormatter` | `plain` | no |  |

### Tokens it reads

`--ds-background-neutral`, `--ds-background-neutral-pressed`, `--ds-border`, `--ds-border-bold`, `--ds-border-focused`, `--ds-chart-1`, `--ds-chart-2`, `--ds-chart-3`, `--ds-chart-4`, `--ds-chart-5`, `--ds-chart-neutral`, `--ds-link`, `--ds-radius-medium`, `--ds-radius-small`, `--ds-radius-xsmall`, `--ds-shadow-overlay`, `--ds-space-050`, `--ds-space-075`, `--ds-space-100`, `--ds-space-150`, `--ds-space-200`, `--ds-space-300`, `--ds-space-400`, `--ds-surface-overlay`, `--ds-surface-raised`, `--ds-text`, `--ds-text-danger`, `--ds-text-subtle`, `--ds-text-subtlest`, `--ds-text-success`

## Related

- [stat](https://design.senvenli.com/docs/components/stat.md)
