2013-12-20 122 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