This code works perfectly fine:
in my view:
<div id="chart1"></div>
And then my js:
$(document).ready(function(){
var plot1 = $.jqplot ('chart1', [[3,7,9,1,4,6,8,2,5]]);
});
When I changed my js(copied it from jqPlot site) so I could have dates included on my x axis only the grid shows without x axis or line (y axis is accurate and present):
The new js code that doesnt work:
$(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'}}]
});
});
Note I only changed the dates to 2011, renamed ID of a div to "chart1" (if compared to this jQPlot site) and added jqplot.dateAxisRenderer.min.js.
So now I have the following plugins included:
- "jqplot.canvasTextRenderer.min.js"
- "jqplot.canvasAxisLabelRenderer.min.js"
- "jqplot.dateAxisRenderer.min.js"
- "jqplot/jqplot.canvasAxisTickRenderer.min.js"
- "jqplot/jquery.jqplot.min.js"
I am getting following JS errors:
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.
What am I doing wrong here? Any help would be greatly appreciated. I googled around for 2h without success.