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() {
    .attr("cx", function(d) { return x(d.datum); })       
    .attr("cy", function(d) { return y(d.Kvot); });


You forgot to use the transition method:

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

More on transitions in the official documentation. Regards,

Related Query

More Query from same tag