chart = {
const height = 500;
const width = 928;
const marginTop = 10;
const marginRight = 20;
const marginBottom = 20;
const marginLeft = 40;
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height])
.attr("width", width)
.attr("height", height)
.attr("style", "max-width: 100%; height: auto;");
svg.append("g")
.attr("transform", `translate(0,${height - marginBottom})`)
.call(d3.axisBottom(x).ticks(width / 80).tickSizeOuter(0))
svg.append("g")
.attr("transform", `translate(${marginLeft},0)`)
.call(d3.axisLeft(y).ticks(height / 80, "s"))
.call(g => g.selectAll(".tick line").clone()
.attr("x2", width - marginLeft - marginRight)
.attr("stroke-opacity", 0.1))
.call(g => g.selectAll(".domain").remove());
svg.append('g')
.attr("fill", "none")
.attr("stroke-width", 1.5)
.attr("stroke-linejoin", "round")
.attr("stroke-linecap", "round")
.selectAll("path")
.data(data)
.join("path")
.style("mix-blend-mode", "multiply")
.attr('stroke', (l, i) => color(labels[i]))
.attr("d", l => l);
return svg.node();
}