I am using jqplot to plot line graphs with dates in x axis .. My graphs work perfectly in chrome browser but unfortunately i am getting “this.proxy.getTime is not a function exception” exception in firefox [Firebug console] ..
function rndColor() {
function c() {
return ('0' + Math.floor(Math.random() * 256).toString(16)).substr(-2);
}
return '#' + c() + c() + c();
}
var plot1 = $.jqplot('chart1', [[['2012-01-23 00:23:03', 23], ['2012-02-01 00:14:02', 23]]], {
title:'Disk Usage',
axes:{
xaxis:{
renderer:$.jqplot.DateAxisRenderer,
tickOptions:{
formatString:'%b-%Y'
},
min: 'Jan-2012',
max: 'Dec-2012',
timeInterval: '1 month',
},
yaxis:{
tickOptions:{
formatString:'%1.2f TB'
}
}
},
highlighter: {
show: true,
sizeAdjust: 7.5,
},
legend: {show: true,placement: "outsideGrid",},
series:[
{color: rndColor(),label: '/user/aaaa/'},
],
cursor: {
show: false
},
});
hence graphs are not getting drawn. Is there anything wrong in my configuration which causes this behaviour any help would be highly helpful.
I can not really tell why you get the error but I can tell you what is causing it:
Specifying dates as text strings that then need to be parsed into numeric values should be avoided. jqPlot is trying to intelligently convert those to javascript date objects, but is failing. You should get used to passing in date objects or epoch times (for javascript this is the number of milliseconds since January 1, 1970.
Modify your code to read: