最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Jqplot DateAxis rendering is not proper - Stack Overflow

programmeradmin1浏览0评论

I tried to plot data useage per day using jqPlot along with its DateAxisRenderer, the data was static to test the graph, but I found that the points on graph are not corresponding to the exact date on the grid.

Is there a better tool out there to do this more accurately? I need to render light and interactive graphs on browser using JavaScript.

I tried to plot data useage per day using jqPlot along with its DateAxisRenderer, the data was static to test the graph, but I found that the points on graph are not corresponding to the exact date on the grid.

Is there a better tool out there to do this more accurately? I need to render light and interactive graphs on browser using JavaScript.

Share Improve this question edited May 9, 2012 at 17:30 Boro 7,9434 gold badges46 silver badges87 bronze badges asked Jul 10, 2010 at 7:46 srinathhssrinathhs 2,0384 gold badges20 silver badges33 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 8

I can fix this problem.

You can use tickInterval:'1 day' after you set min:'yyyy-mm-dd' and max:'yyyy-mm-dd' of xais. This is my example (use tickInterval:'7 day'):

   xaxis:{
        min:'2010-12-14',
        max:'2011-01-06',
        renderer:$.jqplot.DateAxisRenderer,
        rendererOptions:{tickRenderer:$.jqplot.CanvasAxisTickRenderer},
        tickInterval:'7 day',            
        tickOptions:{
          fontFamily:'Verdata',
          fontSize:'10pt',
          formatString:'%b %#d, %Y',
          angle:-30
        }
    },

I've been using the data axis renderer for months -- no bugs or problems. I did run into problems because times in JS are measured in milliseconds.

发布评论

评论列表(0)

  1. 暂无评论