block by emeeks fe73cd301a983b84f5ec

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

Full Screen

This is the code for Chapter 4, Figure 25 from D3.js in Action showing a simple streamgraph 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 streamgraphs) but that’s because the focus here is on understanding how d3.svg.area() works.

index.html

movies.csv