This example shows how d3.nest and d3.layout.stack can be used in conjunction. This forms the basis for a stacked bar chart. This is example 16 from the screencast Splitting Charts.
MIT License