Skip to content

Instantly share code, notes, and snippets.

@Maxim-Filimonov
Created June 23, 2013 14:03
Show Gist options
  • Save Maxim-Filimonov/5845125 to your computer and use it in GitHub Desktop.
Save Maxim-Filimonov/5845125 to your computer and use it in GitHub Desktop.
{
"libraries": [
"d3"
],
"mode": "javascript",
"layout": "fullscreen mode (vertical)",
"resolution": "reset"
}
div.bar {
display: inline-block;
width: 20px;
height: 75px;
background-color: teal;
}
w = 500;
h = 50;
svg = d3.select('svg');
var dataset = [ 5, 13, 15, 20, 25 ];
var circles = svg.selectAll("circle")
.data(dataset)
.enter()
.append("circle");
circles
.attr('cx', function(d, i) {
return (i * 59) + 25;
})
.attr('cy', h/1.3)
.attr('r', function(d) { return d;})
.attr('fill', 'yellow')
.attr('stroke', 'red')
.attr('stroke-width', function(d) { return d/3.9})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment