0

我的文字没有得到样式。我在我的javascript中都将'stroke-opacity'设置为0.1:

// NEW add text labels    
d3.select("#plot").selectAll(".groupText") //???? ".nodeText"
    .data(nodes)
    .enter()
    .append("text")
    .attr("class", "groupText")
    .attr("dy", ".31em")
    .attr("transform", function(d) { return "translate(" + (d.x) + ", " + (d.y) + ")rotate(" + (d.x < 0 ? rotationScale(-d.y) : rotationScale(d.y)) + ")translate(" + (d.x < 0 ? (52) : (-52)) + ", " + 0 + ")"})
    //          sets the origin of rotation to the node's location ^^^^^^^^^^        ^^rotates the label for right half the other way round then the left half      ^^and shifts the label a bit from the circle
    .style("text-anchor", function(d) { return d.x > 0 ? "start" : "end"; })
    //.style("text_anchor", "bottom")
    .text(function(d) { return d.name.split("_")[0]; })
    .style("stroke", "white")
    .style("stroke-opacity", 0.1);

和html中的样式表:

/* NEW --> */
.groupText {
    font: 300 14px "Helvetica Neue", Helvetica, Arial, sans-serif;
    fill: rgb(90, 90, 90);
    font-weight: 400;
    stroke-opacity: 0.1 !important;
}

但没有任何效果,正如您从这张图片中看到的那样:(它应该适用于圆圈内的文本 - OP PIK ......等等)

在此处输入图像描述

颜色都不起作用(文本显然不是白色)..

4

0 回答 0