D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
a2q
Full window
Github gist
Educación Ejercicio 2
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Loading CSV Data with D3</title> <script type="text/javascript" src="https://d3js.org./d3.v3.js"></script> </head> <body> <svg width="640" height="480"> <rect x="200" y="150" width="100" height="100" fill="red" /> <rect x="300" y="150" width="100" height="100" fill="green" /> <rect x="400" y="150" width="100" height="100" fill="blue" /> <text x="308" y="50" fill="gray" font-size="50" font-weight="bold" font-family="Helvetica">D3</text> <text x="300" y="85" fill="gray" font-size="42" font-weight="bold" font-family="Helvetica">RGB</text> </svg> <script type="text/javascript"> d3.select("svg").append("rect").attr("x",200).attr("y",250).attr("width",100).attr("height",100).attr("fill","yellow") d3.select("svg").append("rect").attr("x",300).attr("y",250).attr("width",100).attr("height",100).attr("fill","orange") d3.select("svg").append("rect").attr("x",400).attr("y",250).attr("width",100).attr("height",100).attr("fill","gray") //Load in contents of CSV file d3.csv("EducacionAR2003a2009.csv", function(data) { //Now CSV contents have been transformed into //an array of JSON objects. //<rect x="200" y="10" width="100" height="100" fill="orange" /> //Log 'data' to the console, for verification. console.log(data); }); </script> </body> </html>
Modified
http://d3js.org./d3.v3.js
to a secure url
https://d3js.org./d3.v3.js