簡體   English   中英

X軸標題切斷

[英]X axis title cutting off

我嘗試使用SVG尺寸,但文字已中斷。

的jsfiddle

X軸代碼:

svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.append("text")
.attr("x", width / 2 )
.attr("y", margin.bottom + 5)
.style("text-anchor", "middle")
.style("font-size", "150%")
.text("Age in Years");

我該如何解決?

嘗試通過增加定義的邊距底部變量來進行。

但這沒有用。

當我在此行.attr("height", height + margin.top + margin.bottom + 10)添加+10時。

現在顯示良好。

fiddle

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM