This is the code for Chapter 2, Figure 12 from D3.js in Action that creates rectangles with height based on the data bound to the selection. In this case, the rectangles all overlap each other because their X position is the same.
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js