NVD3图表部分缺少网格线 [英] NVD3 chart partly missing grid lines

查看:99
本文介绍了NVD3图表部分缺少网格线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的图表中,如果您可以注意到,它缺少



我试过:

  .ticks(data [0] .length)

p>

我缺少什么?



jsFiddle

解决方案

添加.showMaxMin这个问题。

  chart.xAxis 
.showMaxMin(false)
.axisLabel Axis)
.tickFormat(function(d){return d3.time.format('%x')(new Date(d))});

工作范例是此处


In my chart here, if you can notice, it is missing grid lines for the first 4 and last 4 dates.

I tried doing:

.ticks(data[0].length)

but it didnt help.

What am I missing?

jsFiddle

解决方案

Adding .showMaxMin(false) fixes the problem.

      chart.xAxis
       .showMaxMin(false)
       .axisLabel("My X-Axis")
       .tickFormat(function(d) { return d3.time.format('%x')(new Date(d)) });

Working example is here

这篇关于NVD3图表部分缺少网格线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆