chart = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
svg
.append("g")
.selectAll("rect")
.data(racismLeaderboard)
.join("rect")
.attr("fill", colours.primary)
.attr("x", d => x(0))
.attr("y", (d, i) => y(d.force))
.attr("width", d => x(d.value) - x(0))
.attr("height", y.bandwidth())
svg
.append("line")
.attr("x1", x(1))
.attr("y1", graph.margin.top + 2)
.attr("x2", x(1))
.attr("y2", height)
.style("stroke-width", 1)
.style("stroke-dasharray", ("1,2"))
.style("stroke", colours.primary50)
.style("fill", "none")
svg
.append("text")
.attr("x", x(1) + 5)
.attr("y", height)
.text("1x")
.attr("text-anchor", "start")
.attr("font-family", graph.font)
.attr("font-size", graph.fontSize)
.style("fill", "black")
svg
.append("g")
.attr("fill", "white")
.attr("text-anchor", "end")
.attr("font-family", graph.font)
.attr("font-size", graph.fontSize)
.selectAll("text")
.data(racismLeaderboard.sort((a,b) => b.value - a.value))
.join("text")
.attr("x", d => x(d.value))
.attr("y", (d, i) => y(d.force) + y.bandwidth() / 2)
.attr("dy", "0.35em")
.attr("dx", -5)
.text(d => d3.format(".1f")(d.value) + "x")
.call(text => text.filter(d => d.Total > 40)
.text(d => d3.format(".1f")(d.value))
.attr("x", width - 10)
.attr("fill", "white")
.attr("text-anchor", "end"));
svg.append("g").call(xAxis);
svg.append("g").call(yAxis);
return svg.node()
}