score:0

One problem is that "state" is generated from the "enter()" method, so all your "bar" calls are only being executed when your "g.class" is being generated, not on update. Change this:

 var state = barholder.selectAll(".state")
                      .data(data)
                         .enter()
                            .append("g")...

to this:

 var state = barholder.selectAll(".state")
                      .data(data);
 state.enter().append("g")...

See if that helps a bit. It doesn't seem to affect your fiddle, but you might be having problems other than d3. Try simplifying your fiddle and get the d3 stuff working by itself first.


Related Query