{
const svg = d3.create('svg')
.attr('width', width)
.attr('height', height);
svg.append("g")
.selectAll("line")
.data(data)
.join("line")
.attr("x1", d => x(d.country) + x.bandwidth()/2)
.attr("x2", d => x(d.country) + x.bandwidth()/2)
.attr("y1", d => y(0))
.attr("y2", d => y(d.population))
.attr("stroke", "steelblue")
.attr("fill", "steelblue")
.attr("stroke-width", 2);
svg.append("g")
.selectAll("circle")
.data(data)
.join("circle")
.attr("cx", d => x(d.country) + x.bandwidth()/2)
.attr("cy", d => - 7 + y(d.population))
.attr("r", 5)
.attr("fill", "steelblue")
svg.append('g')
.attr('transform', `translate(0, ${height - margin.bottom})`)
.call(xAxis)
svg.append('g')
.attr('transform', `translate(${margin.left},0)`)
.call(yAxis)
.append('text')
.attr('fill', 'black')
.attr('font-family', 'sans-serif')
.attr('x', width / 2)
.attr('y', height )
.text("Paises");
return svg.node()
}