GaugeChart

Semicircular gauge charts for displaying single metrics with optional color ranges and target markers.

Playground

Experiment with different settings:

Props

Midnight
72
220
16
OffOn
OffOn
Code
<GaugeChart
  data={data}
  theme="midnight"
  value={72}
  size={220}
  strokeWidth={16}
  showTicks
  showTickLabels
/>

Basic Usage

0255075100
72
Performance
tsx
<GaugeChart
  value={72}
  theme="midnight"
  label="Performance"
/>

Color Ranges

Define color ranges for different value thresholds:

0255075100
25
Low
0255075100
55
Medium
0255075100
85
High
tsx
<GaugeChart
  value={85}
  theme="midnight"
  ranges={[
    { min: 0, max: 30, color: '#ef4444' },
    { min: 30, max: 70, color: '#f59e0b' },
    { min: 70, max: 100, color: '#22c55e' },
  ]}
  label="Score"
/>

With Target Marker

Add a target prop to show a goal marker on the gauge:

0255075100
68
Progress to Goal
tsx
<GaugeChart
  value={68}
  target={80}
  theme="midnight"
  ranges={[
    { min: 0, max: 50, color: '#ef4444' },
    { min: 50, max: 80, color: '#f59e0b' },
    { min: 80, max: 100, color: '#22c55e' },
  ]}
  label="Progress to Goal"
/>

Custom Value Range

Use min and max for non-percentage values:

0mph15mph30mph45mph60mph
42mph
Wind Speed
32°F54°F76°F98°F120°F
78°F
Temperature

Different Sizes

Adjust the size prop for different visual footprints:

75
0255075100
75
0255075100
75
Performance

Props

PropTypeDefaultDescription
value*number-Current value
minnumber0Minimum value
maxnumber100Maximum value
sizenumber200Chart diameter in pixels
strokeWidthnumber16Arc stroke width
theme*ThemeName-Theme name
startAnglenumber-135Arc start angle (0 = top)
endAnglenumber135Arc end angle
ranges{ min: number; max: number; color: string }[]-Color ranges for different values
targetnumber-Target value to show marker
showTicksbooleantrueShow tick marks
tickCountnumber5Number of tick marks
showTickLabelsbooleantrueShow value labels on ticks
format(value: number) => string-Value formatter
labelstring-Label below the value
childrenReactNode-Custom center content