Skip to content
TrademarkTrademark
Docs
Data

DivergingBars

Updated: November 16, 2026
View on GitHub

DivergingBars draws one row per row of data: its name, a bar from zero, and its value. Gains grow right in the gain colour and losses left in the loss colour, all on one scale, so lengths compare across the list. Zero sits where the largest loss ends: a list with no losses uses the whole width. Every value is written with its sign (+12%), so colour is never the only cue. It takes the card, title, description, valueFormat, locale, tooltip, loading, error, emptyState and errorState the other charts take.

Bars are drawn in the order given, so sort the rows first to rank them. dataKey and nameKey read other keys than "value" and "label". Gains are emerald and losses orange by default; gainColor and lossColor take any palette name or CSS colour.

API reference

Type
Default
title
React.ReactNode—
description
React.ReactNode—
valueFormat
numbercompactpercentNumberFormatOptions(value: number) => string
—
locale
string—
tooltip
booleantrue
loading
boolean—
error
boolean—
emptyState
React.ReactNode—
errorState
React.ReactNode—
aria-label
string—
datarequired
One row per bar, drawn in the order given.
readonly DataPoint[]—
dataKey
The row key of each bar's signed value. Defaults to "value".
SeriesKey<DataPoint>"value" as SeriesKey<T>
nameKey
The row key that names each bar. Defaults to "label".
SeriesKey<DataPoint>"label" as SeriesKey<T>
gainColor
Bars above zero. Defaults to emerald.
ColorValue—
lossColor
Bars below zero. Defaults to orange.
ColorValue—
…and every FlexProps propinherited—
Edit this page on GitHub