score:2

Accepted answer

You need to also move the text over to adjust for the radius of the chart:

arcs.enter()
        .append("text")
        .attr("transform", function(d) {
        console.log(arc.centroid(d));
                return "translate(" + arc.centroid(d) + ")translate(" + outerRadius + ", " + outerRadius + ")";
        })
    .attr("text-anchor", "middle")
        .text(function(d,i) { 
            return data[i].playerName+": "+data[i].playerScore;
    });

This will shift everything over to match the locations of the arcs' centroids.


Related Query

More Query from same tag