With NVD3.js (nv.models.lineWithFocusChart), how do you set specific ticks on X-axis, when x values are dates?

前端 未结 3 1809
野性不改
野性不改 2021-01-07 00:19

I\'m using nv.models.lineWithFocusChart, where I\'m showing some hourly measurements. So the x domain is dates.

What I need is to show a tick per hour on X axis:

3条回答
  •  时光说笑
    2021-01-07 01:10

    D3 offers a convenience function for doing specific time intervals (see the documentation). You should be able to simply do

    chart.xAxis.ticks(d3.time.hours, 1)
    

提交回复
热议问题