Accepted answer

What happens is that you cannot perform the


after the transition has started with


The reason is that the object returned by the chained .transition() operation does not have the method .append(). What you want to do instead is to save the object where you later want to do a transition to a variable. Then perform the .append(), then to the transition.

See this Jsfiddle:

Note that I also first set values to the y and height values of the bars, to make the transition/animation prettier.

Best of luck! /Wille

More Query from same tag