Reputation: 181
I was trying to build a chart which is similar to here
https://sf.relsci.com/Visualizations/davos
How can i draw the circles in a circular shape?
Upvotes: 0
Views: 1234
Reputation: 5015
Here is a FIDDLE with one way to do it.
.attr('transform', function (d, i) {
return "translate(" + ((w/2-r) * Math.cos((interval*i) * Math.PI/180)) + "," + ((w/2-r) * Math.sin((interval*i) * Math.PI/180)) + ")";
});
Hope this helps.
Upvotes: 1