{
const svg = d3
.create("svg")
.attr("width", width)
.attr("height", height);
svg
.selectAll("rect")
.data(data)
.enter()
.append("rect")
.attr("x", d => x(xAccessor(d)))
.attr("y", d => y(yAccessor(d)))
.attr("width", x.bandwidth())
.attr("height", d => height - y(yAccessor(d)) - margin.bottom)
.attr("fill", "steelblue");
svg.append("g").call(yAxis);
svg.append("g").call(xAxis);
text(svg, "Positive Over Time").attr(
"transform",
`translate(${width / 2}, ${15}) rotate(0)`
);
text(svg, "Positive Over Time")
.attr("transform", `translate(0, ${height / 2}) rotate(-90)`)
.attr("dy", "1em")
.style("font-size", "12px");
text(svg, "Week")
.attr(
"transform",
`translate(${width / 2}, ${height - margin.bottom / 2}) rotate(0)`
)
.attr("dy", "1em")
.style("font-size", "12px");
svg.call(addRect, 0, 0, width, height, colors.navy, 0.1);
svg
.append("g")
.attr("transform", `translate(${x.bandwidth() / 2}, 0)`)
.call(addLineChart);
text(svg, "Total Tests Performed")
.attr("transform", `translate(${width}, ${height / 2} ) rotate(90)`)
.attr("dy", "1em")
.style("font-size", "12px");
return svg.node();
}