Prepare d3 chart