chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height])
.attr("stroke-width", 1.5)
svg.append("rect")
.attr("width", "100%")
.attr("height", "100%")
.attr("fill", "#343C34");
const team_colours = ['#2E8B57','white','white','white','white','white','white','white','white','white','white']
svg.selectAll("line")
.data(pitchmarkings)
.join("line")
.attr("x1", d => d.x1)
.attr("x2", d => d.x2)
.attr("y1", d => d.y1)
.attr("y2", d => d.y2)
.attr("stroke", "white")
.attr("stroke-width", 4);
svg.selectAll("circle")
.data(spursPlod)
.join("circle")
.attr("cx", d => x(d.x))
.attr("cy", d => y(d.y))
.attr("r", (d, i) => size(d.touches))
.attr("fill", (d, i) => color(d.rating))
.attr("stroke", "black");
const text = svg.selectAll(".axis")
.data(spursPlod)
.enter()
.append("g")
.attr("class", "text")
.append("text")
.style("font-size", "26px")
.style("font-weight", 700)
.attr("text-anchor", "middle")
.attr("font-family", "monospace")
.attr("dy", "0.35em")
.attr("x", (d) => x(d.x))
.attr("y", (d) => y(d.y))
.text(d => d.n);
return svg.node();
}