chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width + 60, height]);
svg.append('g').call(yGridP)
.style("stroke-dasharray", ("3, 3"))
svg.append('g').call(yGridT)
.style("stroke-dasharray", ("8, 3"))
.attr("class", "axisT")
svg.append("g")
.attr("fill", myColor)
.selectAll("rect")
.data(data)
.join("rect")
.attr("x", (d, i) => x(i))
.attr("y", d => yP(d.prec))
.attr("height", d => yP(0) - yP(d.prec))
.attr("width", x.bandwidth());
svg.append('g').call(xGrid)
svg.append("g").call(xAxis)
svg.append("g")
.attr("class", "axisP")
.call(yAxisP)
svg.append("path")
.data([data])
.style("stroke", "red")
.style("stroke-width", 10)
.attr("class", "line")
.attr("fill", "none")
.attr("d", d3.line()
.curve(d3.curveCatmullRom.alpha(0.15))
.x((d, i) => (x(i) + x.bandwidth()/2))
.y((d) => yT(d.temp)));
svg.append("gr")
.attr("transform", "translate( " + width + ", 0 )")
.call(d3.axisRight(yT)); svg.selectAll("myCircles")
.data(data)
.enter()
.append("circle")
.attr("fill", "black")
.attr("stroke", "none")
.attr("cx", (d, i) => (x(i) + x.bandwidth()/2))
.attr("cy", function(d) { return yT(d.temp) })
.attr("r",4)
svg.append("g").call(yAxisT)
svg.append("text")
.attr("x", (width / 2))
.attr("y", 18)
.attr("text-anchor", "middle")
.style("font-size", "24px")
.style("font-family", "sans-serif")
.style("text-decoration", "none")
.style("font-stretch", "condensed")
.text(location.short);
svg.append("text")
.attr("x", (width / 2))
.attr("y", height - 18)
.attr("text-anchor", "middle")
.style("font-size", "14px")
.style("font-family", "sans-serif")
.style("text-decoration", "none")
.style("font-stretch", "condensed")
.text(summary);
return svg.node();
}