Klar

Charts / React basic charts / Comparison

Diverging bar

Answers stacked around a centre line, disagreement to the left and agreement to the right with neutral straddling the middle, or one signed bar per row.

React component DivergingBar, data through props. Side by side: who, which source, which version is ahead. Tags: diverging, likert, survey, sentiment, stacked bar, positive negative, net score.

Install

npm i klar-charts

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

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

Usage

<DivergingBar rows={survey} categories={likert} sort="positive" sideLabels={['Disagree', 'Agree']} netLabel="Net agreement" rowHeight={40} ariaLabel="Engagement survey answers by statement" />

Related diverging bar charts