Last active
August 29, 2015 14:07
-
-
Save ghing/29b266507457bc9e262e to your computer and use it in GitHub Desktop.
Playing with rainfall data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head></head> | |
<body> | |
<div id="chart"></div> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
var ENDPOINT_ROOT = 'http://chicagorains.com/api/hourlyPrecip/'; | |
function getURL(date, location) { | |
var dateStr = ('0' + (date.getMonth() + 1)).slice(-2) + '-' | |
+ ('0' + date.getDate()).slice(-2) + '-' | |
+ date.getFullYear(); | |
return ENDPOINT_ROOT + '?startDate=' + dateStr + '&endDate=' + dateStr + '&location=' + location; | |
} | |
function getRainfall(date) { | |
} | |
function lineChart() { | |
} | |
var today = new Date(); | |
console.debug(getURL(today)); | |
//d3.json(url, function(error, data) { | |
//}); | |
d3.select('#chart') | |
.data(data) | |
.call(lineChart); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment