All charts

force/*

Force

Diverging / force-stacked bars — Likert composition around a central baseline.

2 variants
@vireya/ui/charts/force/diverging

Likert-style diverging stacked horizontal bars around x=0 via stackOffset="sign".

client
@vireya/ui/charts/force/breakdown

Single-row 100%-stacked composition bar via stackOffset="expand".

client

Understanding Force charts

Diverging stacked bars lay series out from a central baseline, with negative-leaning categories extending one way and positive the other. They're the standard way to chart Likert-scale survey results, where 'disagree' and 'agree' should balance around a neutral centre.

Vireya implements them with recharts' signed stack offset, and offers a 100%-stacked breakdown variant for single-row composition bars.

When to use

  • Likert-scale survey responses (strongly disagree → strongly agree).
  • Any sentiment or rating that splits naturally into negative and positive sides.
  • Single-row 100%-stacked composition bars for a quick part-to-whole.

When to avoid

  • Data with no meaningful centre point — a plain stacked or grouped bar is clearer.
  • Precise cross-category comparison of the outer segments, which don't share a baseline.

Best practices

  • Anchor the diverging baseline at the neutral midpoint, not at zero counts.
  • Use a diverging colour ramp so the two sides read as opposites.
  • Sort rows by net sentiment to make the pattern legible.

Accessibility

  • Encode the negative/positive split with colour and order, plus labels.
  • Provide the raw counts or percentages in an accessible tooltip.

Frequently asked questions

What is a diverging bar chart used for?
It charts data that splits around a centre — most commonly Likert survey scales — by stacking negative-leaning responses to the left of a baseline and positive ones to the right, so overall sentiment is visible at a glance.
How is this different from a normal stacked bar?
A normal stacked bar grows in one direction from zero. A diverging bar uses a signed stack offset so segments extend both ways from a neutral midpoint, which is what makes balanced sentiment readable.