Pyramid

Centered pyramid distribution — one row per zone with width proportional to value. Self-contained SVG.

Primitive: ChartPyramid· Standalone (no ChartRoot needed)

Interactive demo

Usage

import { ChartPyramid } from '@ramtt/charts'

<ChartPyramid
  data={[
    { label: 'Z1', value: 60, color: 'var(--chart-1)' },
    { label: 'Z2', value: 30, color: 'var(--chart-2)' },
  ]}
/>

Props

PropTypeDefaultDescription
data*PyramidItem[]Rows ({ label, value, color? })
widthnumber480Width in px
heightnumber320Height in px
colorsstring[]Default colors when item.color is not set
gapnumber6Gap between rows in px
minBarFracnumber0.05Minimum bar width fraction so smallest zone stays visible
valueFormat(value: number) => stringRight-side readout formatter (default: "N min")