score:1

Accepted answer

Add appropriate width for svg element. Currently, the fourth circle do not fit to svg.

var svg = d3.select('svg');

var dataSet = [10, 20, 30,40];

var circle = svg
    .attr('width', 500) // <-- !!!
    .selectAll('circle')
    .data(dataSet)
    .enter()
    .append('circle')
    .attr({
        r:function(d){ return d },
        cx:function(d, i){ return i * 100 + 50 },
        cy:50,
        fill: 'red'
    });
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"></script>
<svg></svg>    

score:0

You cant see the last circle, because it lies outside of the image.


More Query from same tag