【问题标题】:X axis title cutting offX 轴标题截断
【发布时间】:2014-02-17 12:17:52
【问题描述】:

我尝试使用 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");

我该如何解决这个问题?

【问题讨论】:

    标签: javascript css d3.js bar-chart


    【解决方案1】:

    尝试通过增加定义的边距底部变量。

    但这没有用。

    当我在此行中添加 +10 .attr("height", height + margin.top + margin.bottom + 10).

    现在显示正常。

    fiddle.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-19
      • 1970-01-01
      • 2017-04-13
      • 1970-01-01
      • 2013-04-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多