What happens is that you cannot perform the
.append("svg:title")
.text("hai");
after the transition has started with
.transition()
.duration(1000)
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: http://jsfiddle.net/willeeklund/Sfz97/6/
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