我是D3的新手,我想知道是否有一种方法可以将形状的笔触类型更改为带有条件语句的虚线?如何定位特定的圆并向其添加新样式?
var num = stageLevelUntrimmed;
if (num == "Stage 1") {
num = "1";
.style("stroke-dasharray", ("10,3")) // make the stroke dashed
} else {
num = "4";
}
g.append("svg:circle")
.attr("r", "250")
.attr("cx", cfg.w / 2)
.attr("cy", cfg.h / 2)
.style("fill", ellipsefillOne)
.style("stroke", "#FAAF3A")
.style("stroke-opacity", "0.75")
.style("stroke-width", "3.5px");这是我希望在满足条件一的情况下添加的样式:
.style("stroke-dasharray", ("10,3")) // make the stroke dashedhttps://stackoverflow.com/questions/41451800
复制相似问题