# Gauge chart

A notched arc or a continuous ring, one number in the middle.

Section: Charts / Radial
Page: https://ui.heyramzi.com/components/gauge-chart
Import path: `@heyramzi/ui/charts`

## Import

```ts
import { GaugeChart } from "@heyramzi/ui/charts";
```

## Usage

```svelte
<div class="size-44">
  <GaugeChart value={72} label="Health" />
</div>
```

## Demo

```svelte
<script lang="ts">
	import { GaugeChart } from "@heyramzi/ui/charts";
</script>

<div class="flex flex-wrap items-center justify-center gap-10">
	<div class="size-44"><GaugeChart value={72} label="Health" /></div>
	<div class="size-44">
		<GaugeChart value={41} variant="ring" label="Quota" color="var(--chart-4)" />
	</div>
</div>
```

## API

| Prop | Type | Default | Notes |
| --- | --- | --- | --- |
| `value` | `number` |  | required. Arc fill, 0-100 (how many notches light up). |
| `variant` | `"gauge" \| "ring"` | `"gauge"` | "gauge" = notched arc, "ring" = continuous swept arc. |
| `showValue` | `boolean` | `true` | Show the center value/label. Off when the number sits beside the gauge. |
| `color` | `string` |  | Active arc color (CSS color or var). Alias for `activeFill`. |
| `gradient` | `boolean` |  | Single-hue gradient along the active arc. Alias for `useGradient`. |
| `label` | `string` |  | Center label under the value. Alias for `defaultLabel`. |
| `centerValue` | `number` |  | Center statistic. Defaults to `value`. Formatted via `formatOptions`. |
| `totalNotches` | `number` | `40` | Notch count around the arc. |
| `spacing` | `number` | `25` | Gap between notches as a percentage of the arc. |
| `notchLengthPercent` | `number` | `100` | Radial depth of the notch band as a percentage of the default. |
| `notchCornerRadius` | `number` |  | Corner fillet in viewBox units (0 = sharp). Defaults to a soft pill. |
| `uniformWidth` | `boolean` | `false` | Rectangular notches instead of angular/tapered. |
| `startAngle` | `number` | `135` | Arc start in degrees (default 135, sweeping to 405 = 270deg with a bottom gap). |
| `endAngle` | `number` | `405` |  |
| `useGradient` | `boolean` | `false` | Single-hue gradient along the active arc instead of a flat fill. |
| `activeGradient` | `[string, string]` |  | Hex stops for the active gradient. Defaults to a tonal ramp of `activeFill`. |
| `activeFill` | `string` | `"var(--chart-series-1)"` | Active notch color (CSS color or var). |
| `inactiveFill` | `string` |  | Track notch color. Defaults to `activeFill`. |
| `activeFillOpacity` | `number` | `1` |  |
| `inactiveFillOpacity` | `number` | `0.12` |  |
| `defaultLabel` | `string` | `"Total"` | Center label under the value. |
| `formatOptions` | `Intl.NumberFormatOptions` |  | Intl formatting for the center value. |
| `locale` | `string` |  |  |
| `prefix` | `string` |  |  |
| `suffix` | `string` |  |  |
| `size` | `number` |  | Fixed square size in px. Omit to fill the parent (responsive). |
| `minWidth` | `number` | `160` | Minimum width when responsive. |
| `ariaLabel` | `string` |  | Accessible description, e.g. "ARR run rate". |
| `class` | `string` |  |  |
