(function(f){f.jqplot.DateAxisRenderer=function(){f.jqplot.LinearAxisRenderer.call(this)};f.jqplot.DateAxisRenderer.prototype=new f.jqplot.LinearAxisRenderer;f.jqplot.DateAxisRenderer.prototype.constructor=f.jqplot.DateAxisRenderer;f.jqplot.DateTickFormatter=function(b,a){b||(b="%Y/%m/%d");return Date.create(a).strftime(b)};f.jqplot.DateAxisRenderer.prototype.init=function(b){this.tickOptions.formatter=f.jqplot.DateTickFormatter;this._daTickInterval=this.daTickInterval=null;f.extend(!0,this,b);for(var b= this._dataBounds,a=0;a<this._series.length;a++)for(var d=this._series[a],c=d.data,g=d._plotData,d=d._stackData,e=0;e<c.length;e++)if("xaxis"==this.name||"x2axis"==this.name){c[e][0]=Date.create(c[e][0]).getTime();g[e][0]=Date.create(c[e][0]).getTime();d[e][0]=Date.create(c[e][0]).getTime();if(c[e][0]<b.min||null==b.min)b.min=c[e][0];if(c[e][0]>b.max||null==b.max)b.max=c[e][0]}else{c[e][1]=Date.create(c[e][1]).getTime();g[e][1]=Date.create(c[e][1]).getTime();d[e][1]=Date.create(c[e][1]).getTime(); if(c[e][1]<b.min||null==b.min)b.min=c[e][1];if(c[e][1]>b.max||null==b.max)b.max=c[e][1]}};f.jqplot.DateAxisRenderer.prototype.reset=function(){this.min=this._min;this.max=this._max;this.tickInterval=this._tickInterval;this.numberTicks=this._numberTicks;this.daTickInterval=this._daTickInterval};f.jqplot.DateAxisRenderer.prototype.createTicks=function(){var b=this.ticks,a=this.name,d=this._dataBounds,c;if(b.length){for(d=0;d<b.length;d++)c=b[d],a=new this.tickRenderer(this.tickOptions),c.constructor== Array?(a.value=Date.create(c[0]).getTime(),a.label=c[1]):a.value=Date.create(c).getTime(),this.showTicks?this.showTickMarks||(a.showMark=!1):(a.showLabel=!1,a.showMark=!1),a.setTick(a.value,this.name),this._ticks.push(a);this.numberTicks=b.length;this.min=this._ticks[0].value;this.max=this._ticks[this.numberTicks-1].value;this.daTickInterval=[(this.max-this.min)/(this.numberTicks-1)/1E3,"seconds"]}else{b="xaxis"==a||"x2axis"==a?this._plotDimensions.width:this._plotDimensions.height;null!=this.min&& (null!=this.max&&null!=this.numberTicks)&&(this.tickInterval=null);null!=this.tickInterval&&(Number(this.tickInterval)?this.daTickInterval=[Number(this.tickInterval),"seconds"]:"string"==typeof this.tickInterval&&(a=this.tickInterval.split(" "),1==a.length?this.daTickInterval=[1,a[0]]:2==a.length&&(this.daTickInterval=[a[0],a[1]])));a=null!=this.min?Date.create(this.min).getTime():d.min;c=null!=this.max?Date.create(this.max).getTime():d.max;a==c&&(a-=432E5,c+=432E5);d=c-a;a=null!=this.min?Date.create(this.min).getTime(): a-d/2*(this.padMin-1);d=null!=this.max?Date.create(this.max).getTime():c+d/2*(this.padMax-1);this.min=a;this.max=d;d=this.max-this.min;null==this.numberTicks&&(null!=this.daTickInterval?(b=Date.create(this.max).diff(this.min,this.daTickInterval[1],!0),this.numberTicks=Math.ceil(b/this.daTickInterval[0])+1,this.max=Date.create(this.min).add((this.numberTicks-1)*this.daTickInterval[0],this.daTickInterval[1]).getTime()):this.numberTicks=200<b?parseInt(3+(b-200)/100,10):2);null==this.daTickInterval&& (this.daTickInterval=[d/(this.numberTicks-1)/1E3,"seconds"]);for(d=0;d<this.numberTicks;d++)a=Date.create(this.min),b=a.add(d*this.daTickInterval[0],this.daTickInterval[1]).getTime(),a=new this.tickRenderer(this.tickOptions),this.showTicks?this.showTickMarks||(a.showMark=!1):(a.showLabel=!1,a.showMark=!1),a.setTick(b,this.name),this._ticks.push(a)}null==this._daTickInterval&&(this._daTickInterval=this.daTickInterval)}})(jQuery);