d3v4 - Stacked Bar Chart
Built with blockbuilder.org
Remake of Mike Bostock's Stacked Bar Chart
What I learned:
- How d3.stack layout works
- Stack creates an array of layers - each layer is an of coordinates (one array per 'key')
- Coordinates [y, y1] specify top and bottom of rectangle
- Can use ordinal scale to generate colors for "layers" of stack
- Used band scale for x (time) - Band scales are like ordinal scales except the output range is continuous and numeric.