Skip to main content
100%

Stacked bar chart with negative values

✓ Published2🌍 Public
OOvidiu Gheorghies
Last edited Jul 30, 2020
Created on Jul 30, 2020
Forked from Making a bar chart

A stacked bar chart displays positive and negative monthly values across three series (a1, a2, a3) from a CSV file. Positive and negative stacks are computed separately with `d3.stack()`, then rendered as SVG rects using `scaleLinear` and `scaleBand`. The zero axis is drawn via `tickSizeInner(xScale(0))`, and colors come from `d3.schemeTableau10`. Bars are filtered to omit zero-sized segments, with negative values extending leftward and positive values rightward.

AI-generated description

Stacked bar chart with negative values.

MIT Licensed

Similar vizzes