chart = {
const svg = d3.select(DOM.svg(myWidth, height))
.style("-webkit-tap-highlight-color", "transparent")
.style("overflow", "visible");
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis);
svg.append("path")
.datum(serie)
.attr("fill", "none")
.attr("stroke", "#08a6bf")
.attr("stroke-width", 1.5)
.attr("stroke-linejoin", "round")
.attr("stroke-linecap", "round")
.attr("d", line);
const tooltip = svg.append("g");
svg.on("touchmove mousemove", function(event) {
const {year, value} = bisect(d3.pointer(event, this)[0]);
tooltip
.attr("transform", `translate(${x(year)},${y(value)})`)
.call(callout, `${year}: ${formatValue(value)}`);
});
svg.on("touchend mouseleave", () => tooltip.call(callout, null));
return svg.node();
}