【发布时间】:2014-12-31 09:57:46
【问题描述】:
使用 nvd3 多条形图。当具有最小条时,x 轴标签不像 y 轴那样显示在中心。
生成 x 轴标签的示例代码。
chart = nv.models.multiBarChart().margin({
top: 30,
right: 28,
bottom: 50,
left: 60
})
.x(function(d) {
return d.x
})
.y(function(d) {
return d.y
})
.color(d3.scale.myColors().range());
chart.xAxis
.showMaxMin(true)
.axisLabel(xAxisLabel)
.tickFormat(xAxisTickFormat)
.tickValues(xaxisValues);
如何解决这个问题?
【问题讨论】:
-
你能把你的代码放在小提琴里,这样别人可以仔细看看。