score:9

Accepted answer

The d3 way to do this would be to pass in the data and calculate the positions based on the index of the datum, i.e. something like

var theta = 2 * Math.PI / array.length;
svg.selectAll('circle').data(array).enter()
  .append("circle")
  .attr('cx', function(d, i) { return(r * Math.cos(i * theta)); })
  .attr('cy', function(d, i) { return(r * Math.sin(i * theta)); });

Related Query

More Query from same tag