chart = {
const svg = d3.select(DOM.svg(w, h));
svg.selectAll("circle")
.data(data)
.join("circle")
.attr("cx", d => x(d.x))
.attr("cy", d => y(d.y))
.attr("r", d => r(d.y))
.attr("fill", d => c(d.y));
svg.selectAll("text")
.data(data)
.join("text")
.filter(d => d.y > 200)
.text(d => d.name.replace(/ .*/,''))
.attr("x", d => x(d.x))
.attr("y", d => y(d.y));
svg.append("g")
.call(xAxis);
svg.append("g")
.attr("transform", `translate(${w/2}, ${h-5})`)
.append('text')
.style("text-anchor", "middle")
.text("mpg")
.attr("class", 'x_text');
svg.append("g")
.call(yAxis);
svg.append("g")
.attr("transform", `translate(20, ${h/1.2})rotate(-90)`)
.append('text')
.style("text-anchor", "middle")
.text("Despesa Mitjana")
.attr("class", 'y_text');
return svg.node();
}