chart2 = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
const path = svg
.append("path")
.attr("d", ourline)
.attr("fill", "none")
.attr("stroke", "steelblue")
.attr("stroke-width", 1.5)
.attr("stroke-miterlimit", 1)
.attr("stroke-dasharray", strokeDasharray(t));
const gx = svg.append("g").call(xAxis);
const gy = svg.append("g").call(yAxis);
svg
.append("text")
.text("Spanish Silver Production Per Year")
.attr("transform", `translate(${width / 2},15)`)
.style("text-anchor", "middle");
svg
.append("text")
.text("Year")
.attr("transform", `translate(${(width - margin.left) / 2}, 500)`)
.style("text-anchor", "middle");
svg
.append("text")
.attr("transform", "rotate(-90)")
.attr("x", -(height / 2))
.attr("y", 20)
.text("Silver count")
.style("text-anchor", "middle");
return svg.node();
}