forked from syntagmatic‘s block: Clock
forked from zanarmstrong‘s block: Time Data
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
background: lightgrey;
width: 960px;
}
</style>
<body>
<div>This reads in historic stock data for Google (Alphabet)</div><br>
<div>If you want a different dataset, go to <a href="//finance.yahoo.com/q/hp?s=GOOG&a=00&b=1&c=2004&d=10&e=3&f=2015&g=d">Yahoo Finance</a> and replace 'Goog' in the URL with a different stock. Then click "download to spreadsheet" at the bottom of the page. Open in a text editor, copy the data, and paste into the stockData.csv file. </div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script>
// standard dimension variables
var width = 960,
height = 500;
// basic SVG setup
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height)
.append("g")
.attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
d3.csv('stockData.csv', function(error, stockData) {
if(error)
console.log(error)
console.log('stockData', stockData)
})
</script>