此代碼工作完全正常:jqplot使用dateAxisRenderer行不渲染,有什麼想法爲什麼?
<div id="chart1"></div>
然後我的JS:
在我看來$(document).ready(function(){
var plot1 = $.jqplot ('chart1', [[3,7,9,1,4,6,8,2,5]]);
});
當我改變了我的JS(從jqPlot site複製),這樣我可以有包括我的x軸僅日期網格示出了沒有x軸或線(y軸是準確的和存在的話):
新js代碼能源部SNT工作:
$(document).ready(function(){
var line1=[['2011-06-30 8:00AM',4], ['2011-7-30 8:00AM',6]];
var plot2 = $.jqplot('chart1', [line1], {
title:'Customized Date Axis',
gridPadding:{right:35},
axes:{
xaxis:{
renderer:$.jqplot.DateAxisRenderer,
tickOptions:{formatString:'%b %#d, %y'},
min:'May 30, 2011',
tickInterval:'1 month'
}
},
series:[{lineWidth:4, markerOptions:{style:'square'}}]
});
});
注意我只改日期到2011年,改名爲一個div爲 「chart1」(如果相對於this jQPlot site),並加入jqplot.dateAxisRenderer.min.js的ID。
所以現在我有以下插件包括:
- 「jqplot.canvasTextRenderer.min.js」
- 「jqplot.canvasAxisLabelRenderer.min.js」
- 「jqplot.dateAxisRenderer.min。 JS」
- 「jqplot/jqplot.canvasAxisTickRenderer.min.js」
- 「jqplot/jquery.jqplot.min.js」
我收到以下錯誤JS:
Uncaught TypeError: Cannot set property 'CanvasTextRenderer' of undefined in jqplot.canvasTextRenderer.min.js:30.
Cannot set property 'CanvasTextRenderer' of undefined in jqplot.canvasAxisLabelRenderer.min.js:30.
Cannot set property 'CanvasTextRenderer' of undefined in jqplot.dateAxisRenderer.min.js:30.
Cannot set property 'CanvasTextRenderer' of undefined in jqplot.canvasAxisTickRenderer.min.js:30.
我在做什麼錯在這裏?任何幫助將不勝感激。我搜索了兩個小時沒有成功。