forked from sampathweb's block: datasana #1
Last active
August 29, 2015 21:07
-
-
Save sampathweb/2efd8084d345dd23ef96 to your computer and use it in GitHub Desktop.
datasana #circles
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> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> | |
<style> | |
body { | |
position: fixed; | |
top: 0; | |
left: 0; | |
right: 0; | |
bottom:0; | |
} | |
</style> | |
</head> | |
<body> | |
<svg width=960 height=500> | |
</svg> | |
<script> | |
console.log("you are now rocking with d3", d3); | |
var data = [5, 19, 20, 6, 29]; | |
var svg = d3.select("svg"); | |
var circles = svg.selectAll("circle") | |
.data(data) | |
.enter() | |
.append("circle") | |
.attr({ | |
r: 10, | |
cx: function(d, i) { return 100 + i * 130}, | |
cy: function(d, i) { | |
return 300 - d * 9; | |
} | |
}); | |
</script> | |
</body> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment