Building charts using d3.js