D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
sporange
Full window
Github gist
LEdataEnglandRegions
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>My CSV data</title> <script type="text/javascript" src="https://d3js.org/d3.v3.js"></script> </head> <body> <svg width="500" height="250"> <line x2="162" x1="12" y2="130" y1="130" stroke-width="10" stroke="orange"></line> <line x2="87" x1="87" y2="130" y1="40" stroke-width="6" stroke="orange"></line> <line x2="34" x1="140" y2="80" y1="40" stroke-width="6" stroke="orange"></line> <line x2="24" x1="34" y2="110" y1="80" stroke-width="2" stroke="orange"></line> <line x2="44" x1="34" y2="110" y1="80" stroke-width="2" stroke="orange"></line> <line x2="130" x1="140" y2="70" y1="40" stroke-width="2" stroke="orange"></line> <line x2="150" x1="140" y2="70" y1="40" stroke-width="2" stroke="orange"></line> <line x2="44" x1="24" y2="110" y1="110" stroke-width="4" stroke="orange"></line> <line x2="150" x1="130" y2="70" y1="70" stroke-width="4" stroke="orange"></line> <text y="180" x="10" fill="black" font-size="36" font-weight="bold" font-family="Helvetica">Life expectancy</text> <text y="220" x="10" fill="black" font-size="36" font-weight="bold" font-family="Helvetica">inequality</text> </svg> <script type="text/javascript"> //Load in contents of CSV file d3.csv("PHOF_LE_data_EngRegion.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