score:1

Accepted answer

Finally got it - when I put in it's own update function and called it after the transition it seems to work. Anybody can explain why I can't put it in the other function? I guess it has something to do with the transition but don't know.

function update_circles() {
focus.selectAll("circle")
    .data(dataFilter)
    .attr("cx", function(d) { return x(d.datum); })       
    .attr("cy", function(d) { return y(d.Kvot); });
};

score:0

You forgot to use the transition method:

// Make the changes
focus.select("#Main").transition().duration(750)
    .attr("transform", "translate(" + (width+3) + "," + y(yMain) + ")")
    .text(sec);

More on transitions in the official documentation. Regards,


Related Query

More Query from same tag