chart = {
const width = 350,
height = 350,
margin = { top: 20, right: 20, bottom: 30, left: 40 };
const svg = d3.create("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom);
const g = svg.append("g")
.attr("transform", `translate(${margin.left},${margin.top})`);
g.append("g")
.call(d3.axisLeft(y));
g.append("g")
.attr("transform", `translate(0,${height})`)
.call(d3.axisBottom(x));
g.selectAll("circle")
.data(data)
.join("circle")
.attr("cx", d => x(d.longitud_sepalo))
.attr("cy", d => y(d.longitud_petalo))
.attr("r", 3)
.attr("fill", d => color(d.especie));
svg.append("text")
.attr("x", margin.left + width/2)
.attr("y", margin.top - 5)
.attr("text-anchor", "middle")
.text("Iris: Sepalo vs. Petalo");
return svg.node();
}