2013-12-20 120 views
0

我正在使用下面的函數生成其上有兩行的線圖。我的問題是它沒有顯示X軸標籤(我試過它作爲變量和硬編碼)。它也沒有格式化每個tickOptions的X軸值。我有一個獨立的情節,在x軸上使用日期值而不是常規數值,並且沒有問題。任何意見將不勝感激。jqPlot不顯示x軸標籤或格式軸

function toolProbPlot(probDivTitle,probValues,probPlotTitle,probX,legendLabel) { 
    return plot = $.jqplot(probDivTitle,probValues, { 
     title: probPlotTitle, 
     seriesColors:[noColor,yesColor], 
     legend: { 
      show: true, 
      location: legendLocation, 
      placement: legendPlacement, 
      labels: legendLabel 
     }, 
     axis: { 
      xaxis: { 
       labelRenderer: $.jqplot.CanvasAxisLabelRenderer, 
       showLabel: true, 
       label: probX, 
       tickOptions: {formatString: '%.4f'} 
      }, 
      yaxis: { 
       labelRenderer: $.jqplot.CanvasAxisLabelRenderer 
      } 
     } 
    }); 
} 

回答

3

錯字:axis: {應該axes: {

還要確保已包括所有所需的.js插件

+0

嗯,這會讓你覺得很傻。感謝您指出明顯! – chemnteach