chart = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
const color = d3
.scaleLinear()
.domain([3, 0, -1])
.range(d3.schemeRdYlBu[3]),
gradient = DOM.uid();
svg
.append("linearGradient")
.attr("id", gradient.id)
.attr("gradientUnits", "userSpaceOnUse")
.attr("x1", 0)
.attr("y1", y(color.domain()[0]))
.attr("x2", 0)
.attr("y2", y(color.domain()[2]))
.selectAll("stop")
.data(d3.range(5))
.join("stop")
.attr("offset", i => i / 4)
.attr("stop-color", i => color(3 - i));
svg
.append("path")
.attr("fill", gradient)
.attr("d", area(values));
svg.append("g").call(xAxis);
svg.append("g").call(yAxis);
if (compareWithMM)
svg
.append("path")
.attr("fill", "none")
.attr("stroke", "steelblue")
.attr("stroke-width", .5)
.attr("d", line(mm));
return svg.node();
}