Charts / React basic charts / Part-to-whole
Every category stretched to the same length so the mix can be compared, with shares inside the segments and totals at the end.
React component StackedBar100, data through props. How a total splits into its pieces. Tags: bar, stacked, 100%, share, mix, composition, proportion.
npm i klar-charts
import 'klar-charts/styles.css'
import { ThemeScope, StackedBar100 } from 'klar-charts'
# or copy the source:
npx shadcn@latest add https://klar.run/r/basic-stacked-bar-100.json<StackedBar100 data={paymentsByMarket} series={payMethods} segmentLabels={l as 'percent' | 'value'} totals totalLabel="Orders" ariaLabel="Payment method mix by market" />