scatter = {
const svg = d3
.create("svg")
.attr("viewBox", [0, 0, width, 600])
.style("overflow", "visible");
svg.append("g").call(x);
svg
.append("text")
.attr("class", "axis-label")
.attr("x", width / 2)
.attr("y", 580)
.attr("text-anchor", "middle")
.attr("fill", "GREEN")
.text("LIBERTAD PARA TOMAR DECISIONES");
svg
.append("text")
.attr("x", -280)
.attr("y", 0)
.attr("dy", "1em")
.attr("text-anchor", "middle")
.attr("transform", "rotate(-90)")
.attr("fill", "GREEN")
.text("PODER ADQUISITIVO");
svg
.selectAll("circle")
.data(hapiness)
.join("circle")
.attr("cx", d => x(d.Freedom_to_make_life_choices))
.attr("cy", (d) => d.GDP_per_capita*300)
.attr("r", 5.5);
return svg.node();
}