Klar

Charts / React chart kit primitives / Part-to-whole

SegmentMeter

A total split into tall labelled segments, the remainder hatched; here team capacity.

React component SegmentMeter, data through props. How a total splits into its pieces. Tags: meter, segments, capacity, stacked, hatch, allocation.

Install

npm i klar-charts

import 'klar-charts/styles.css'
import { ThemeScope, SegmentMeter } from 'klar-charts'

# or copy the source:
npx shadcn@latest add https://klar.run/r/kit-segment-meter.json

Usage

<SegmentMeter
  className="mt-7"
  height={150}
  segments={[
    { label: 'Logged', value: 120, color: 'var(--blue)', detail: '120h' },
    { label: 'Planned', value: 72, color: 'var(--orange)', detail: '72h' },
    { label: 'Free', value: 48, color: 'hatch', detail: '48h' },
  ]}
/>

Related segmentmeter charts