Skip to content

Instantly share code, notes, and snippets.

@daigofuji
Created June 17, 2013 13:47
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 daigofuji/5796992 to your computer and use it in GitHub Desktop.
Save daigofuji/5796992 to your computer and use it in GitHub Desktop.
{
"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