Charts

Gauge

Green, amber past 75%, red past 90%. The number is always written.

46/120

Gulshan · cars

82%

Banani occupancy

57/60

Dhanmondi · bikes

Import#

Everything comes from the package root. The example above uses:

your-component.tsx
import { GaugeChart } from "@waveinno/ui";

Props#

Read from the source of this version, so they match the code exactly.

<GaugeChart>

src/components/charts/gauge-chart.tsx
PropTypeDefaultDescription
valuerequirednumber—
maxnumber100
labelstring—
format(value: number, max: number) => string(v, m) => `${Math.round((v / m) * 100)}%`
thresholds[number, number][0.75, 0.9]Fractions of max where the colour turns warning, then danger.
invertbooleanfalseFor measures where low is bad (battery, stock): the colours flip.
sizenumber200
classNamestring—

Install#

If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.

$ npm install @waveinno/ui