chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis)
svg.append("path")
.datum(data)
.attr("fill", "none")
.attr("stroke", "steelblue")
.attr("stroke-width", 1.5)
.attr("stroke-linejoin", "round")
.attr("stroke-linecap", "round")
.attr("d", line);
svg.append("text")
.attr("y", 10)
.attr("x", 60)
.attr("dy", ".1em")
.style("text-anchor", "middle")
.text("Temp. (c)");
svg.append("text")
.attr("x", (width/2) )
.attr("y", (height-10) )
.style("text-anchor", "middle")
.text("Fecha y hora");
return svg.node();
}