Skip to main content
100%

Horizontal stacked bar chart implementation in d3.v4

✓ Published0🌍 Public
TThanaporn-sk
Last edited Jul 28, 2017
Created on Jul 28, 2017

This example shows a horizontal stacked bar chart of monthly mortality data from the Crimean War, breaking down deaths into wounds, other causes, and disease across the 1850s. The chart is rendered with SVG in D3 v4, using `d3.stack()` with an offset and keys, a linear `xScale` for values, and a band `yScale` for dates. The code draws rectangles per layer with `d3.scaleOrdinal` and `d3.schemeCategory20` for colors, and includes `d3.axisBottom` and `d3.axisLeft` with time formatting for the date labels.

AI-generated description

Horizontal stacked bar chart implementation in d3.v4

forked from <a href='http://bl.ocks.org/caravinden/'>caravinden</a>'s block: <a href='http://bl.ocks.org/caravinden/32a3d192e0e5f6af81f4bcc12adda8f7'>Horizontal stacked bar chart implementation in d3.v4</a>

mit Licensed

Similar vizzes