chart = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
svg
.selectAll("rect")
.data(data)
.join("rect")
.attr("fill", "#607D8B")
.attr("height", 0)
.attr("y", (d) => y(0))
.attr("x", (d, i) => x(i))
.attr("width", x.bandwidth())
.transition()
.duration(500)
.attr("x", (d, i) => x(i))
.attr("y", (d) => y(d.value))
.attr("height", (d) => y(0) - y(d.value))
.attr("width", x.bandwidth())
.delay((d, i) => i * 10);
svg.append("g").call(xAxis);
svg.append("g").call(yAxis);
return svg.node();
}