D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
omidantilong
Full window
Github gist
Manchester United — Module 2
<!DOCTYPE html> <html> <head> <title>Omid Kashan — Module 2</title> <style type="text/css"> * { box-sizing: border-box; } </style> </head> <body> <div id="main"> <h1>Inline svg. </h1> <svg id="svg-example"> <circle cx="80" cy="80" r="60" fill="purple" /> </svg> <br /><br /><br /> <h1>Top scorer's tally per year</h1> <svg id="viz" width="100%" height="100"></svg> </div> <script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script> <script> var i=1,svg = d3.select('#viz'); window.onload = function() { d3.csv('data.csv',function(data) { console.log(data); data.forEach(function(row) { svg.append("circle").attr("cx", 30*i).attr("cy", 50).attr("r", row.topscorercount).style("fill", "red").style("opacity",0.5); i++; }); }); }; </script> </body> </html>
Modified
http://d3js.org/d3.v3.min.js
to a secure url
https://d3js.org/d3.v3.min.js