chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height])
.attr("fill", "none")
.attr("stroke-linejoin", "round")
.attr("stroke-linecap", "round");
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis);
svg.append("path")
.datum(data.filter(line.defined()))
.attr("stroke", "#ccc")
.attr("stroke-dasharray", 2)
.attr("d", line);
svg.append("path")
.datum(data)
.attr("stroke", "steelblue")
.attr("stroke-width", 1.5)
.attr("d", line);
return svg.node();
}