chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("g")
.attr("fill", color)
.selectAll("rect")
.data(data)
.join("rect")
.attr("x", (d, i) => x(i))
.attr("y", d => y(d.value))
.attr("stroke", (d, i) => "#111")
.attr("fill", (d, i) => colors(i))
.attr("stroke-width", 3)
.attr("height", d => y(0) - y(d.value))
.attr("width", x.bandwidth());
svg.append("g")
.call(xAxis)
.attr("font-family", "Alegreya")
.attr("font-weight", "500")
.attr("font-size", 15);
svg.append("g")
.call(yAxis)
.attr("font-family", "Alegreya")
.attr("font-weight", "500")
.attr("font-size", 15);
return svg.node();
}