JQplot DateAxis rendering is not correct

I tried to calculate data usage per day using jqPlot along with its DateAxisRenderer , the data was static to check the graph, but I found that the points on the graph do not match the exact date in the grid.

Is there a better tool to do this more accurately? I need to display light and interactive graphics in a browser using JavaScript .

+4
source share
2 answers

I can fix this problem.

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

  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 } }, 
+8
source

I have been using the data axis visualizer for several months - no errors or problems. I ran into problems because time in JS is measured in milliseconds.

0
source

Source: https://habr.com/ru/post/1315264/


All Articles