[英]X-axis labels overlap NVD3
我在我的应用程序中使用 NVD3 图表。 我不明白为什么 X 轴标签在我的图表中重叠。 有人可以帮我解决吗?
我尝试使用.ticks(3)
设置刻度数,但它似乎不会影响刻度数。
nv.addGraph(function () {
var chart = nv.models.lineChart()
.x(function (d) {
return d[0];
})
.y(function (d) {
return d[1];
})
.showXAxis(true)
.showYAxis(false)
.useInteractiveGuideline(true);
chart.xAxis //Chart x-axis settings
.axisLabel('Time')
.tickFormat(function (d) {
var dateTimeFormat = '%m/%d/%Y %H:%M';
d = new Date(d);
return d3.time.format(dateTimeFormat)(d);
});
chart.yAxis
.axisLabel('Size');
chart.forceY([0]);
d3.select('#id svg')
.datum(graphData)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.