D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
smckissock
Full window
Github gist
USG Outlays Test
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Week 2</title> <script type="text/javascript" src="https://d3js.org/d3.v3.js"></script> </head> <body> <svg width="800" height="400"> <g> <text x="20" y="40" font-family="Helvetica" font-size="40" fill="blue">USG Outlays 1962-2020</text> <rect x="20" y="100" width="30" height="180" fill="blue"></rect> <rect x="60" y="80" width="30" height="200" fill="green"></rect> <rect x="100" y="60" width="30" height="220" fill="red"></rect> <rect x="140" y="120" width="30" height="160" fill="yellow"></rect> <rect x="180" y="160" width="30" height="120" fill="purple"></rect> </g> </svg> <script type="text/javascript"> //Load in contents of CSV file d3.csv("OutlaysByAgency1962_2020.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