block by emeeks b734c50af51dc727cacc

Ch. 4, Fig. 24 - D3.js in Action

Full Screen

This is the code for Chapter 4, Figure 24 from D3.js in Action showing a simple stacked graph created using d3.svg.area() and setting its .y() and .y0() functions to derive values based on the stacked value at each point. Note that this does not use d3.layout.stack (which you should seriously consider if you’re considering making stacked charts) but that’s because the focus here is on understanding how d3.svg.area() works.

index.html

movies.csv