4
d3.js中是否有做.axis路径{fill:none}?在d3.js中设置坐标轴的css
我试过在.CALL .attr和.style(d3.svg.axis(),但无济于事。我只是在这里做得不对...
完整的代码,我创建使用我的轴低于:
// create Axis
svg.selectAll("axis")
.data(d3.range(angle.domain()[1]))
.enter().append("g")
.attr("class", "axis")
.attr("transform", function(d) { return "rotate(" + angle(d) * 180/Math.PI + ")"; })
.call(d3.svg.axis()
.scale(radius.copy().range([0,0]))
.ticks(1)
.tickFormat("")
.orient("left"))
.attr("fill","none") // EDITED WITH FILL NONE
.append("text")
.attr("y",
function (d) {
if (window.innerWidth < 455){
console.log("innerWidth less than 455: ",window.innerWidth);
return -(0);
}
else{
console.log("innerWidth greater than 455: ",window.innerWidth);
return -(0);
}
})
.attr("dy", "0em");
你想达到什么样的效果? – 2012-07-27 21:26:32
@LarsKotthoff我想追加一些CSS到我的轴来复制.axis路径{fill:none},它是当前内嵌在html文件中的。我想用d3属性或样式替换内联css – Apollo 2012-07-27 22:11:31
您是否尝试将'.attr(“fill”,“none”)'直接添加到轴路径? – 2012-07-27 22:17:31