CompositionBar
Properties
Use CompositionBar
One proportional bar with visible category amounts, shares or both.
Design notes
- Use in a card or narrow panel to show a few mutually exclusive parts of one whole. Pass up to six finite nonnegative values with stable unique IDs and a meaningful label.
- The bar preserves category order and proportional segment widths. Keep that order consistent across views of the same categories. Use BarChart with layout="percent" to compare several totals.
- Choose inline readouts for short labels or rows for shared numeric alignment. Use value, share or both depending on what readers need. Exact readouts remain visible without pointer or keyboard interaction.
- Zero-valued categories stay in the list without taking bar width. All-zero data shows values and omits shares. An empty list uses emptyLabel.
API reference
View TypeScript source