SegmentedBar

Horizontal stacked bar showing proportions. Supports labels and legend.

Preview

Usage

import { SegmentedBar } from '@ramtt/ui'

<SegmentedBar
  segments={[
    { value: 60, color: '#16A34A', label: 'Z2' },
    { value: 25, color: '#F59E0B', label: 'Z3' },
    { value: 15, color: '#EF4444', label: 'Z5' },
  ]}
  legend
/>

Props

PropTypeDefaultDescription
segments*Segment[]Bar segments
heightnumber8Bar height in pixels
showLabelsbooleanfalseShow labels on segments
legendbooleanfalseShow legend below bar