Skip to content

Instantly share code, notes, and snippets.

@akulmehta
Created November 18, 2020 02:51
Show Gist options
  • Save akulmehta/cf3ffc7a5b68cfa8c3616afa6c9130c7 to your computer and use it in GitHub Desktop.
Save akulmehta/cf3ffc7a5b68cfa8c3616afa6c9130c7 to your computer and use it in GitHub Desktop.
d3 csv import 64882515
license: mit
date production area yield
2015 11886.00 2030.00 58552.00
2016 12864.00 2034.00 63245.00
2017 10743.00 2021.00 53157.00
2018 11235.00 1985.00 56599.00
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
</style>
</head>
<body>
<script>
d3.csv("CA.csv", function(data) {
data.forEach(function(d) {
d.date = d.date;
d.production = +d.production;
d.area = +d.area;
d.yield = +d.yield;
});
console.log(data);
});
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment