此代码工作完全正常: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.
我在做什么错在这里?任何帮助将不胜感激。我搜索了两个小时没有成功。