chart = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
svg
.append("g")
.attr("transform", `translate(0,${height - margin.bottom})`)
.call(xAxis);
svg
.append("g")
.call(yAxis)
.attr("transform", `translate(${margin.left},0)`);
const yLabel = svg.append("g").call(yTitle);
const xLabel = svg.append("g").call(xTitle);
svg
.append("rect")
.attr("x", margin.left)
.attr("y", margin.top)
.attr("width", width - margin.right - margin.left)
.attr("height", priceThreshold - margin.top)
.style("opacity", 0.1)
.append("text");
svg
.append("text")
.attr("x", margin.left + 5)
.attr("y", priceThreshold - 5)
.attr("font-style", "sans-serif")
.style("font-size", "12px")
.text("Bitcoin Value >$15,000");
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", lineGenerator);
return svg.node();
}