Klar

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

StackBar

A single bar split into parts; here promoters, passives and detractors.

React component StackBar, data through props. How a total splits into its pieces. Tags: stacked-bar, single-bar, share, nps, composition, proportion.

Install

npm i klar-charts

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

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

Usage

<StackBar className="mt-6" height={12} segments={rows} />

Related stackbar charts