Hi,
I use a tween to perform a transition on my pie chart :
var timeout = setTimeout(function() {
path = path.data(pie(dataset));
path.transition().duration(750).attrTween("d", arcTween);
}, 500);
function arcTween(a) {
var i = d3.interpolate(this._current, a);
this._current = i(0);
return function(t) {
return arc(i(t));
};
}
And I have a legend for each arc :
var txt = d3.selectAll(".arc")
.append("text")
.attr("transform", function(d) { return "translate(" + arc.centroid(d) + ")"; })
.attr("dy", ".35em")
.style("text-anchor", "middle")
.text(function(d) { return d.data.type; });
The arcs perform the transition but not the text. The text keep the original position.
Is it possible to make a tween in order to move the text as the arcs ?
Thank you
Best regards