Against a target
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)} />;
}import { GaugeChart } from "@senvenli/react/charts";Examples
A custom range
`min` and `max` bound a figure that is not a percentage.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.
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 | Description |
|---|---|---|---|
title | string | – | What the chart shows, over it; leave it out when a card or a heading already says so. |
aria-label | string | – | Names the chart when it has no visible |
period | string | – | |
height | number | 160 | |
isLoading | boolean | – | |
valueRequired | number | – | |
min | number | 0 | 0 by default. |
max | number | 100 | 100 by default: gauges are for bounded figures (occupancy, quota). |
target | number | – | A 2px tick on the arc, named under the value. |
valueFormatter | ChartValueFormatter | plain |
titlestringWhat the chart shows, over it; leave it out when a card or a heading already says so.
aria-labelstringNames the chart when it has no visible
title(a card's heading already says what it shows).periodstringheightnumberDefault160isLoadingbooleanvalueRequirednumberminnumberDefault00 by default.
maxnumberDefault100100 by default: gauges are for bounded figures (occupancy, quota).
targetnumberA 2px tick on the arc, named under the value.
valueFormatterChartValueFormatterDefaultplain