Jqplot DateAxis渲染不正确 [英] Jqplot DateAxis rendering is not proper

查看:65
本文介绍了Jqplot DateAxis渲染不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 jqPlot 及其 DateAxisRenderer 来计划每天的数据使用情况,数据是静态测试图表,但我发现图表上的点与网格上的确切日期不对应。

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.

是否有更好的工具可以更准确地完成此操作?我需要使用 JavaScript 在浏览器上渲染光照和交互式图形。

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 can fix this problem.

你可以使用tickInterval:'1天'设置min:'yyyy-mm-dd'和max:'yyyy-mm-dd'的xais。
这是我的例子(使用tickInterval:'7天'):

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
        }
    },

这篇关于Jqplot DateAxis渲染不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆