D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
jeroen369
Full window
Github gist
udemy_base section 2-12
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v5.min.js"></script> <title>2.4</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> </head> <body> <div class="container"> <div class="row"> <div id="chart-area"></div> </div> </div> <script> var data = [25,20,10,12,15]; var svg = d3.select("#chart-area").append("svg") .attr("width", 400) .attr("height", 400); var circles = svg.selectAll("circle") .data(data) circles.enter() .append("circle") .attr("cx", function(d, i) { return i*50 + 25; }) .attr("cy", 200) .attr("r", function(d, i) { return d; }) .attr("fill", "red"); </script> </body>
https://d3js.org/d3.v5.min.js