Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jqplot DateAxis rendering is not proper

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.

like image 969
srinathhs Avatar asked Feb 26 '23 16:02

srinathhs


1 Answers

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
        }
    },
like image 77
ppverylove Avatar answered Mar 08 '23 09:03

ppverylove