Skip to content

Instantly share code, notes, and snippets.

@lsirivong
Created October 15, 2012 03:02
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 lsirivong/3890632 to your computer and use it in GitHub Desktop.
Save lsirivong/3890632 to your computer and use it in GitHub Desktop.
just another inlet to tributary
{"endpoint":"","display":"svg","public":true,"require":[],"tab":"edit","display_percent":0.7,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01}
var svg = d3.select("svg");
var data = [29, 8, 15, 16, 23, 42];
var w = 25,
p = 1,
sy = 9;
var g = svg.selectAll('rect');
var colorScale = d3.scale.category20c();
g.data(data)
.enter().append("rect")
.attr({
width : function(d){return d*10 + 'px';},
height: w,
x: 100,
y : function (d, i) {return 100 + (i * (w + p))},
fill : function(d, i) { return colorScale(i);},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment