chart = {
const minX = x(data[0].date);
const maxX = x(data[data.length - 1].date);
const overwidth = maxX - minX + margin.left + margin.right;
console.log(minX, data[0].date, maxX, data[data.length - 1].date);
const parent = d3.create("div");
parent.append("svg")
.attr("width", width)
.attr("height", height)
.style("position", "absolute")
.style("pointer-events", "none")
.style("z-index", 1)
.call(svg => svg.append("g").call(yAxis));
parent.append("svg")
.attr("width", width)
.attr("height", height)
.style("position", "absolute")
.style("pointer-events", "none")
.style("z-index", 1)
.call(svg => svg.append("g").call(y2Axis));
const body = parent.append("div")
.style("overflow-x", "scroll")
.style("-webkit-overflow-scrolling", "touch");
body.append("svg")
.attr("width", overwidth)
.attr("height", height)
.style("display", "block")
.call(svg => svg.append("g").call(xAxis))
.append("path")
.datum(data)
.attr("fill", "steelblue")
.attr("d", area);
yield parent.node();
body.node().scrollBy(overwidth, 0);
}