Skip to content

Instantly share code, notes, and snippets.

@ashleybot
Created February 17, 2012 05:01
Show Gist options
  • Save ashleybot/1850822 to your computer and use it in GitHub Desktop.
Save ashleybot/1850822 to your computer and use it in GitHub Desktop.
D3.js Simple Transistions
function redraw() {
chart.selectAll("rect")
.data(data)
.transition()
.duration(1000)
.attr("y", function(d) { return h - y(d) - .5; })
.attr("height", function(d) { return y(d); } );
}
// replace an element in the data array with a new value
data[2] = 49;
redraw();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment