Skip to content

Instantly share code, notes, and snippets.

@cubny
Last active December 20, 2015 11:04
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 cubny/4603b215592096ff3f22 to your computer and use it in GitHub Desktop.
Save cubny/4603b215592096ff3f22 to your computer and use it in GitHub Desktop.
var rect = chart.selectAll("rect")
.data(data, function(d) { return d.time; });
rect.enter().insert("rect")
.attr("x", function(d, i) { return x(i + 1) - 0.5; })
.attr("y", function(d) { return h - y(d.value) - 0.5; })
.attr("width", w)
.attr("height", function(d) { return y(d.value); })
.transition()
.duration(1000)
.attr("x", function(d, i) { return x(i) - 0.5; })
.each('end', function(){
// callback code
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment