chart = {
const svg = d3.select(DOM.svg(width, height));
svg.append("g")
.selectAll("rect")
.data(year_means)
.join("rect")
.attr("x", d => scale_x(d.key))
.attr("width", scale_x.bandwidth())
.attr("y", d => scale_y(d.value))
.attr("height", d => scale_y(0) - scale_y(d.value))
.attr("fill", "steelblue");
svg.append("g")
.attr("fill", "black")
.attr("text-anchor", "middle")
.selectAll("text")
.data(year_means)
.join("text")
.attr("x", d => scale_x(d.key) + scale_x.bandwidth()/2)
.attr("y", d => scale_y(d.value) - 5)
.text(d => format(d.value));
svg.append("g")
.call(xAxis)
.style("font-size", "14px");
svg.append("g")
.call(yAxis)
.style("font-size", "14px");
svg.append("text")
.attr("transform", "translate(" + (width/2) + "," + (height - 20) + ")")
.style("text-anchor", "middle")
.style("font-size", "20px")
.text("Date");
svg.append("text")
.attr("transform", "translate(" + (margin.left/3) + "," + (height/2) + ")rotate(-90)")
.style("text-anchor", "middle")
.style("font-size", "20px")
.text("Personal freedom score");
svg.append("text")
.attr("transform", "translate(0," + margin.top/3 + ")")
.style("text-anchor", "left")
.style("font-size", "25px")
.text("Worldwide average personal freedom score, 2008 - 2016")
return svg.node();
}