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", d => `translate(${x(d.x)},${y(d.y1)})`)
.call(g => g.append("circle")
.attr("stroke", "steelblue")
.attr("fill", "none")
.attr("r", 3))
.call(g => g.append("text")
.attr("dy", "0.35em")
.attr("x", 7)
.text(d => d.name))
return svg.node();
}