chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis);
svg.append("g")
.call(grid);
const colorId = DOM.uid("color");
svg.append("linearGradient")
.attr("id", colorId.id)
.attr("gradientUnits", "userSpaceOnUse")
.attr("x1", 0)
.attr("x2", width)
.selectAll("stop")
.data(data)
.join("stop")
.attr("offset", d => x(d.year) / width)
.attr("stop-color", d => color(d.balbudgt));
svg.append("path")
.datum(data)
.attr("fill", "none")
.attr("stroke", colorId)
.attr("stroke-width", 5)
.attr("stroke-linejoin", "round")
.attr("stroke-linecap", "round")
.attr("d", line);
svg.append("text")
.attr("x", 50 )
.attr("y", 10)
.style("text-anchor", "middle")
.style("font-size", "11px")
.style("font-family", "sans-serif")
.text("Expenditure Gap");
return svg.node();
}