chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
barData.sort((b, a) => a.value - b.value);
svg.selectAll('rect')
.data(barData)
.enter().append('rect')
.style("fill", 'steelblue')
.attr("x", d => scale.x(d.name))
.attr("width", scale.x.bandwidth())
.attr("y",d => scale.y(d.value))
.attr("height", d => scale.y(0) - scale.y(d.value));
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis);
svg.append("path")
.attr("d", d3.line()([[0, height/2], [width, height/2]]))
.attr("stroke", "black")
.style("stroke-dasharray", ("3, 3"));
svg.append("text")
.text(`전국`)
.attr("y", height / 2 - 5)
.attr("x", width - 5)
.attr('text-anchor','end')
.attr('class','label');
return svg.node();
}