jqPlot DateAxis tickInterval not working

前端 未结 5 623
无人及你
无人及你 2020-12-01 18:47

I\'m trying to draw a chart with a single datapoint each month. I\'m sending this through to jqPlot as a single point on the first of each month:

$.jqplot(\'         


        
5条回答
  •  遥遥无期
    2020-12-01 19:38

    You should specify a timestamp on your plot data. As noted on jqplot example of Date Axes:

    Note, although jqPlot will parse most any human readable date, it is safest to use javascript time stamps when possible. Also, it is best to specify a date and time and not just a date alone. This is due to inconsistent browser handling of local time vs. UTC with bare dates.

    You can check it here: http://www.jqplot.com/deploy/dist/examples/date-axes.html

    I'm mentioning it because i've stumbled upon this problem 2 days ago. I solved it by passing a timestamp and defining a greater tickInterval than '1 day'.

提交回复
热议问题