Building reusable charts with d3.chart