D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
threestory
Full window
Github gist
Suicide Rates by State, Year and Age Group
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Erik's example: Loading CSV Data with D3</title> <style type="text/css"> body { background-color: #b4bad6; } svg { background-color: white; } </style> <script type="text/javascript" src="https://d3js.org/d3.v3.js"></script> </head> <body> <svg width="600" height="400"> <circle fill="#498EC5" stroke="#E6D39E" stroke-width="10" cx="143" cy="172" r="85"/> <text x="228" y="188" fill="#5a5b5d" font-size="42" font-weight="normal" font-family="Georgia">Getting closer</text> </svg> <p>Look in the console to see d3 data loaded</p> <script type="text/javascript"> //Load in contents of CSV file d3.csv("suicides_1999-2013_states_age-groups.csv", function(data) { //Now CSV contents have been transformed into //an array of JSON objects. //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