chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("g")
.selectAll("path")
.data(series)
.join("path")
.attr("fill", ({key}) => color(key))
.attr("d", area)
.on("mouseover", (event, d) => {
d3.selectAll("path").attr("fill", function(d, i) { return colorGray(i) })
d3.select(event.currentTarget).style("fill", "yellow")
d3.selectAll("path").attr("fill", ({key}) => color(key))
})
.on("click", (event, d) => {
d3.select(event.currentTarget).style("fill", "black")
})
.on("mouseout", (d, i) => {
d3.selectAll("path").attr("fill", ({key}) => color(key))
})
.append("title")
.text(({key}) => key);
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis);
return svg.node();
}