Skip to content

Instantly share code, notes, and snippets.

@mvuksano
Last active June 2, 2016 09:58
Show Gist options
  • Save mvuksano/c39f3563554e48b788a1e15105d6f799 to your computer and use it in GitHub Desktop.
Save mvuksano/c39f3563554e48b788a1e15105d6f799 to your computer and use it in GitHub Desktop.
var svg = d3.select('svg')
.attr('width', canvas_width);
svg.selectAll('rect')
.data(d3.entries(population))
.enter()
.append('rect')
.attr('y', function(d, i) {
return 40*i + 10;
})
.attr('x', 0)
.attr('height', bar_height)
.attr('width', function(d, i) {
return d.value;
})
.attr('fill', 'turquoise');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment