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("fill", "none")
.attr("stroke", "steelblue")
.attr("pointer-events", "all")
.selectAll("circle")
.data(data)
.join("circle")
.attr("r", 3.5)
.attr("cx", d => x(d.value))
.attr("cy", d => y(d.age))
.append("title")
.text(d => `${d.name}
${(d.value * 100).toFixed(1)}% ${d.age}`);
return svg.node();
}