Skip to main content
100%

D3 in Action Chapter 5 - Example 10

✓ Published0🌍 Public
RRoxIv
Last edited Jul 28, 2018
Created on Jul 28, 2018

This example visualizes box office data for six movies over ten days as a stacked bar chart. It uses D3.js version 3.5.5 with the `d3.layout.stack()` API to compute cumulative values from CSV data, and `d3.scale.linear()` for x, y, and height scaling. The chart renders as SVG with axis lines generated by `d3.svg.axis()`, where rectangular bars are colored using `d3.scale.category10` and positioned via the stacked layout's `y0` offsets.

AI-generated description

This is the code for Chapter 5, Figure 22 from D3.js in Action showing how to use d3.layout.stack() to create a stacked bar chart.

forked from <a href='http://bl.ocks.org/emeeks/'>emeeks</a>'s block: <a href='http://bl.ocks.org/emeeks/b4184089c979aeae28bb'>Ch. 5, Fig. 22 - D3.js in Action</a>

mit Licensed

Similar vizzes