我正在尝试创建一个雷达图,其中标签沿雷达线旋转,如下图所示:https://i.imgur.com/3SPdhb9.png
当前代码:
axis.append("text")
.attr("class", "legend")
.text(function(d){return d})
.style("font-family", "sans-serif")
.style("font-size", "11px")
.attr("text-anchor", "middle")
.attr("dy", "1.5em")
.attr("transform", function(d, i){return "translate(0, -10)";})
.attr("x", function(d, i){return w/2*(1- factorLegend*Math.sin(i*radians/total))-60*Math.sin(i*radians/total);})
.attr("y", function(d, i){return h/2*(1-Math.cos(i*radians/total))-20*Math.cos(i*radians/total);});
非常感谢!