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")
.attr("stroke-width", 1.5)
.attr("font-family", "sans-serif")
.attr("font-size", 10)
.selectAll("g")
.data(data)
.join("g")
.attr("transform", function(d){ return `translate(${x(d.x)}, ${y(d.y)})`})
.call(g => g.append("circle")
.attr("stroke", "steelblue")
.attr("fill", "orange")
.attr("r",3))
.call(g => g.append("text")
.attr("dy", ".35em")
.attr("x", 7)
.text(d => d.name));
return svg.node();
}