D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
jrzief
Full window
Github gist
Concentric Circles
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v4.min.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } </style> </head> <body> <script> var radii =[110,100, 90, 80, 70, 60,50,40,30,20,10,0] var width = 960; var height = 500; var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height) .append("g") .attr("transform", "translate(" + (width - 50)/2 + "," + height/2 + ")"); svg.selectAll('circle') .data(radii) .enter() .append('circle') .attr("cx", 50) .attr("cy", 100) .attr('r', function(d){return d}) .style("stroke", "black") .style("stroke-width", 2) .style("fill", "white"); </script> </body>
https://d3js.org/d3.v4.min.js