Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Stacked bar chart with negative values

Public visualization

Viewing a saved revision (read-only)

20dcb61be0bd4a0e8c08debf8eaf7b2c

Stacked bar chart with negative values

0 stars2🌍 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.