x坐標(biāo)軸標(biāo)簽的位置
.call(xAxis)
.append("text")
.text("時(shí)間")
.attr("text-anchor","end")
這段代碼執(zhí)行后為什么“時(shí)間”在左邊軸最左側(cè)呢?我想讓它在最右側(cè)
.call(xAxis)
.append("text")
.text("時(shí)間")
.attr("text-anchor","end")
這段代碼執(zhí)行后為什么“時(shí)間”在左邊軸最左側(cè)呢?我想讓它在最右側(cè)
2015-04-10
舉報(bào)
2015-04-24
調(diào)整位置可以用三種方式,你嘗試一下:
- .attr("x", "1em")指定x 軸方向的位置
- .attr("dx", "1em")指定x 軸方向的偏移
-?.attr("text-anchor","end"),end 也可以替換為 start