Skip to content

Instantly share code, notes, and snippets.

@sampathweb
Last active August 29, 2015 21:07
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 sampathweb/2efd8084d345dd23ef96 to your computer and use it in GitHub Desktop.
Save sampathweb/2efd8084d345dd23ef96 to your computer and use it in GitHub Desktop.
datasana #circles
<!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