Created
June 24, 2012 04:24
-
-
Save ptvans/2981592 to your computer and use it in GitHub Desktop.
just another inlet to tributary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x_scale = d3.scale.linear().domain([0,100]).range([0,500]); | |
var h=20 | |
//x-origin | |
var o=30 | |
//y-origin | |
var l=30 | |
var color = d3.scale.category20() | |
var array1 = [16,25,9,12,38] | |
var selection = g.selectAll('rect') | |
.data(array1) | |
.enter() | |
.append('rect') | |
.attr('fill',function(d,i){return color(i)}) | |
.attr('height',h) | |
.attr('width',function(d,i){ | |
return x_scale(d); | |
}) | |
.attr('x',function(d,i){ | |
var cw = x_scale(d); | |
var start = o; | |
o = o + cw; | |
return start; | |
}) | |
.attr('y',l) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment