chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append('defs')
.html(`<linearGradient id="Gradient2">
<stop offset="30%" stop-color="hsl(120, 50%, 50%)"/>
<stop offset="70%" stop-color="hsl(70, 80%, 50%)"/>
<stop offset="80%" stop-color="hsl(60, 80%, 50%)"/>
<stop offset="100%" stop-color="hsl(10, 50%, 50%)"/>
</linearGradient>`)
svg.append("path")
.datum(data)
.attr("fill", "url(#Gradient2)")
.attr("d", area);
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis);
return svg.node();
}