chart = {
let svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
svg
.append("g")
.selectAll("path")
.data(series)
.join("path")
.attr("fill", d => color(d))
.attr("d", area)
.append("title")
.text(({ key }) => key);
svg.append("g").call(xAxis);
svg.append("g").call(yAxis);
return svg.node();
}