Skip to main content

Stacked Bar Chart

Support tickets opened each month in 2025, stacked by priority, with a tooltip for the whole stack.

Hover the charts, click the legends, switch the site theme or resize the window
Pick a preset to reconfigure every chart

What to look for​

  • Hover. The Unovis crosshair marks the top of every segment in the month and lists them all in one tooltip. Observable Plot and Vega-Lite list the whole stack too: Plot with a Plot.tip per month, Vega-Lite with a pivot transform and a hover rule. TanStack Charts lists the stack too and shades the hovered month.
  • Hide a priority. The remaining segments restack with a transition, and the y axis follows. Observable Plot does it with a few lines of state and no transition; Vega-Lite's legend highlights a priority instead of hiding it. TanStack Charts' legend hides a priority without restacking, so the segments above it float and the axis keeps its range.
  • Stack order. Vega-Lite stacks segments by the color field's name unless you add an order channel, which the demo does to keep Low at the bottom.
  • Negative values. Unovis stacks negative values below zero automatically, which makes diverging stacked bars a one-liner. Recharts needs stackOffset="sign" for that, otherwise negative segments overlap.
  • Randomize the data. Watch the segments move together. AG Charts Community, Observable Plot and Vega-Lite redraw without a transition.
  • Presets. Horizontal (orientation) is one every library can draw, though Nivo lists the months bottom-up and the Unovis crosshair only follows the x axis, so its tooltip moves to the bars. Patterns (pattern) gives each priority a fill pattern, which only ECharts (decals), Nivo and AG Charts have built in. Recharts and Observable Plot can point a bar's fill at an SVG <pattern> you write yourself, Chart.js takes a CanvasPattern that you draw yourself or get from the third-party Patternomaly library, and TanStack Charts and Vega-Lite have no pattern fills. Capacity line (VisPlotline) takes the official chartjs-plugin-annotation package in Chart.js, and ECharts draws it as a markLine, which has to belong to a series, so the demo puts it on Low.

Feature comparison​

FeatureUnovis1.8.0Recharts3.10.1Chart.js4.5.1ECharts6.1.0Nivo0.99.0AG Charts14.2.0Observable Plot0.6.17Vega-Lite6.5.0TanStack Charts1.1.0
Stacked bar
Stacking negative values
Horizontal bar
Wrapping / trimming long axis labels
Crosshair with a shared tooltip
Animated data updates
Dark mode
Waterfall

Every cell links to its source. See how we compare for the rules we followed.