chart = {
var svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("g")
.attr("transform", `translate(0,${height - margin.bottom})`)
.style("color", "steelblue")
.attr("font-size", "100")
.call(d3.axisBottom(x).tickSize(3))
svg.append("g")
.attr("transform", `translate(${margin.left},0)`)
.attr("class", "y-grid")
.style("color", "steelblue")
.call(d3.axisLeft(y).ticks(4).tickSize(-width))
.attr("opacity", "1")
svg.selectAll(".bar")
.data(data)
.enter().append("rect")
.attr("fill", "#dddd12")
.attr("class", "bar")
.attr("x", function(d) { return x(d.country); })
.attr("width", x.bandwidth())
.attr("y", function(d) { return y(d.pci); })
.attr("height", function(d) { return height-margin.bottom - y(d.pci); });
return svg.node();
}