Created
June 9, 2014 04:54
-
-
Save hyonschu/8fa27bf0b852da2643e3 to your computer and use it in GitHub Desktop.
This file contains 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 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