chart = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
svg.append("g").call(xAxis);
svg.append("g").call(yAxis);
const strokeWidth = data.series.length > 10 ? 1.5 : 3,
opacity = data.series.length > 10 ? .2 : .7;
const path = svg
.append("g")
.attr("fill", "none")
.selectAll("path")
.data(data.series)
.join("path")
.attr("stroke", d => {
return typeof d.color !== 'undefined' ? d.color : 'steelblue';
})
.attr("stroke-width", strokeWidth)
.attr("stroke-linejoin", "round")
.attr("stroke-linecap", "round")
.style("mix-blend-mode", "multiply")
.style("opacity", opacity)
.attr("d", d => line(d.values));
return svg.node();
}