Skip to content

Instantly share code, notes, and snippets.

@daigofuji daigofuji/README.md
Created Jun 17, 2013

Embed
What would you like to do?
{
"libraries": [
"d3"
],
"mode": "javascript",
"layout": "fullscreen mode (vertical)",
"resolution": "reset"
}
/* css goes here */
<!-- html goes here -->
<div class="chart"></div>
/* javascript goes here */
var dataset =[12, 35, 46, 45, 57, 53, 4, 55, 66, ]
// var p = d3.select("body").selectAll("p");
var w = 570;
var h = 200;
var svg = d3.select(".chart")
.append("svg")
.attr({width:w, height:h});
svg.selectAll("circle")
.data(dataset)
.enter()
.append("circle")
.attr({
cx: function(d,i) {return 50+(i*100); },
cy: h/2,
r: function(d) {return d},
fill: "red"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.