chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("g")
.attr("fill", "steelblue")
.selectAll("rect")
.data(rows)
.join("rect")
.attr("x", d => x(d.date))
.attr("width", x.bandwidth())
.attr("y", d => y(d.pool_amount))
.attr("height", d => y(0) - y(d.pool_amount));
svg.append("g")
.attr("fill", "lightblue")
.selectAll("rect")
.data(rows)
.join("rect")
.attr("x", d => x(d.date))
.attr("width", x.bandwidth())
.attr("y", d => y(d.match_amount + d.pool_amount))
.attr("height", d => y(0) - y(d.match_amount));
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis);
return svg.node();
}