chart = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
svg
.append("g")
.selectAll("rect")
.data(fruits)
.join("rect")
.attr("fill", "steelblue")
.attr("x", (d, i) => xScale(i))
.attr("y", (d) => yScale(d.count))
.attr("height", (d) => yScale(0) - yScale(d.count))
.attr("width", xScale.bandwidth());
svg.append("g").call(xAxis);
svg.append("g").call(yAxis);
return svg.node();
}