在jqplot中显示每月数据

Nic*_*ner 1 javascript jquery jqplot

我每月使用OHLC渲染器获得一系列数据,每个数据点都有一个数据点.我试图用jqplot显示它.它看起来很好,除了数据点太瘦了,因为jqplot显示它们好像它们只适用于那一天.当我取出日期,并指定月份和年份时,jqplot崩溃了.

我的数据如下:

    [
        [
            "01/01/2008", 
            8152.9054008104704, 
            2612.7075024153296, 
            5382.8064516128998
        ], 
        // ...
        [
            "03/01/2008", 
            7554.0494491662403, 
            2086.69248631764, 
            4820.3709677419401
       ], 
    ]
Run Code Online (Sandbox Code Playgroud)

这种配置是否可行,或者我应该自己破解代码?该文件没有明确说明如何做到这一点.

我应该修改什么代码?DateAxisRendererOHLCRenderer

Jag*_*h G 5

您可以使用tickInterval选项和jqplot.DateAxisRenderer插件来创建每月刻度.

xaxis: {
        renderer: jQuery.jqplot.DateAxisRenderer,
        tickOptions: {
              formatString:'%#d %I:%M %p'
        },
        rendererOptions: {
              daTickInterval: [1, 'month']
        }
  }
Run Code Online (Sandbox Code Playgroud)