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