score:1

Accepted answer

While you are creating it , you aren't running anything in your transition:

  rects.
    attr("height", 0).
    attr("y", h).
    transition().duration(3000).
    delay(function (d, i) {
        return i * 200;
    }); //<-- nothing to do  here....

If you want it to run on your updates, say to make the bar grow, just move it:

rects
  .attr({
    "x": function (d) { return xScale(d.country); },
    "y": function (d) { return yScale(d.gdp); },
    "width": xScale.rangeBand()
  })
  .transition() //<-- transition to act on height
  .attr("height", function (d) { return h - yScale(d.gdp) });

Related Query