d3 bar chart with data manipulation