D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
MelvanDrunen
Full window
Github gist
Meat Consumption Beef OECD 1995-2015
<!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="500" height="200"> <rect x="0" y="0" width="500" height="200" fill="green" /> <circle cx="20" cy="140" r="10" fill="violet" /> <circle cx="65" cy="130" r="20" fill="violet" /> <circle cx="140" cy="120" r="40" fill="violet" /> <circle cx="380" cy="100" r="160" fill="red" /> <circle cx="245" cy="110" r="80" fill="violet" /> <line x1="220" y1="130" x2="500" y2="130" stroke="black" stroke-width="3" /> <text x="220" y="120" fill="charcoal" font-size="42" font-weight="bold" font-family="Helvetica">More Meat</text> </svg> <p>This website shows data from OECD about Meat Consumption per capita</p> <script type="text/javascript"> //Load in contents of CSV file d3.csv("Meatconsumption_OECD_BeefandVeal_2015.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