Skip to content

Instantly share code, notes, and snippets.

@hyonschu
Created June 9, 2014 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyonschu/8fa27bf0b852da2643e3 to your computer and use it in GitHub Desktop.
Save hyonschu/8fa27bf0b852da2643e3 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 Test</title>
<script type="text/javascript" src="d3.min.js"></script>
</head>
<body>
<script type="text/javascript">
// load the csv file!
var dataset
var phys = []
var weight = []
d3.csv("darksoulsbody.csv", function(d) {
console.log(d)
for (i=0; i < 200; i++) { phys.push(Number(d[i].Phys)) }
for (i=0; i < 200; i++) { weight.push(Number(d[i].Weight)) }
//generating charts
var charts = d3.select("body")
.append("svg")
.attr({
"height": 600,
"width": 800
});
charts.selectAll("circle")
.data(phys)
.enter()
.attr("cx", 20) //function(d) { return d['Weight']})
.attr("cy", 100) //function(d) {return d[0]['Phys']})
.attr("r", 20)
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment