我想爲我的y軸創建一個標籤,並且顯示它時出現問題。爲什麼軸上的標籤文本在D3.js中消失?
SVG.append("g")
.attr("class", "y axis")
.call(yAxis)
.append("text")
.attr("class", "label")
.attr("transform", "rotate(-90)")
.attr("x", 100)
.attr("y", 100)
.style("text-anchor", "end")
.text("Sepal Width (cm)");
當我使用上面的代碼,我不能顯示我的標籤,但是當我刪除
.attr("transform", "rotate(-90)")
我可以看到我的文字。
這是爲什麼?
沒有這個解決您的問題? – fasouto
是的,它的確如此,我非常忙碌,您的評論提醒我要將您的答案標記爲最佳答案。謝謝。 – Vanquiza
沒問題,謝謝! :) – fasouto