2013-11-14 33 views
0

我正在jQuery中繪製使用dateaxisrender jqplot的圖形。 這裏我們給出我們從x軸上的服務器收到的日期。dateaxisrender jqplot xticks寬度不一致

圖很好,但每個xtick之間的差距是不同的。

假設我的xtciks日期是:「08-Aug」,「10-Aug」,「01-Sep」,「15-sep」,25-dec。

「8月8日」和「10月8日」之間的差距很小。 「10-Aug」和「01-Sep」之間的差距很大 「15-sep」和25-dec之間的差距更大。

我認爲該圖正在考慮日期之間的天數給每個之間的寬度。 但在我的情況下,它應該是相等的寬度。

可能有人建議我該如何解決這個問題呢?

我無法在此處粘貼圖形圖像。

$.jqplot(grphOneID, [grdPoints], YI.getGraphOpts(grdXTcks, YAxisLbl)).replot(); 

getGraphOpts: function (XTcks, YAxisLbl) { 
     /// <summary>Object that holds all the setting's required for Graph generation.</summary> 
     $.jqplot.config.enablePlugins = true; 
     var optsObj = 
      { 
       axes: { 
        yaxis: { 
         ticks: m_CompositeReport.stdYLbls, 
         label: YAxisLbl, 
         tickOptions: { 
          formatString: '%d' 
         } 
       }, 
        xaxis: { 
         renderer: $.jqplot.DateAxisRenderer, 
         label: 'Shop', 
         ticks: XTcks, 
         tickOptions: { 
          formatString: "%m/%d", 
          markSize: 4 
         }, 
         numberTicks: 0, 
        } 
       }, 
       seriesColors: m_CompositeReport.stdColors.reverse() 
      } 
     return optsObj; 
    }, 

注:http://jsfiddle.net/JWhmQ/2052/ 但是我們需要的日期上線這裏繪製:http://www.jqplot.com/deploy/dist/examples/customHighlighterCursorTrendline.html

+0

人在那裏殺傷人員地雷S' – mmssaann

回答