/** * Copyright (c) 2009 Chris Leonello * jqPlot is currently available for use in all personal or commercial projects * under both the MIT and GPL version 2.0 licenses. This means that you can * choose the license that best suits your project and use it accordingly. * * Although not required, the author would appreciate an email letting him * know of any substantial use of jqPlot. You can reach the author at: * chris dot leonello at gmail dot com or see http://www.jqplot.com/info.php . * * If you are feeling kind and generous, consider supporting the project by * making a donation at: http://www.jqplot.com/donate.php . */ (function(h){var c;h.jqplot=function(A,y,w){var x,v;if(y==null){throw"No data specified"}if(y.constructor==Array&&y.length==0||y[0].constructor!=Array){throw"Improper Data Array"}if(w==null){if(y instanceof Array){x=y;v=null}else{if(y.constructor==Object){x=null;v=y}}}else{x=y;v=w}var z=new n();z.init(A,x,v);z.draw();return z};h.jqplot.debug=1;h.jqplot.config={debug:1,enablePlugins:true,defaultHeight:300,defaultWidth:400};h.jqplot.enablePlugins=h.jqplot.config.enablePlugins;h.jqplot.preInitHooks=[];h.jqplot.postInitHooks=[];h.jqplot.preParseOptionsHooks=[];h.jqplot.postParseOptionsHooks=[];h.jqplot.preDrawHooks=[];h.jqplot.postDrawHooks=[];h.jqplot.preDrawSeriesHooks=[];h.jqplot.postDrawSeriesHooks=[];h.jqplot.preDrawLegendHooks=[];h.jqplot.addLegendRowHooks=[];h.jqplot.preSeriesInitHooks=[];h.jqplot.postSeriesInitHooks=[];h.jqplot.preParseSeriesOptionsHooks=[];h.jqplot.postParseSeriesOptionsHooks=[];h.jqplot.eventListenerHooks=[];h.jqplot.preDrawSeriesShadowHooks=[];h.jqplot.postDrawSeriesShadowHooks=[];h.jqplot.ElemContainer=function(){this._elem;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null}};h.jqplot.ElemContainer.prototype.getWidth=function(){if(this._elem){return this._elem.outerWidth(true)}else{return null}};h.jqplot.ElemContainer.prototype.getHeight=function(){if(this._elem){return this._elem.outerHeight(true)}else{return null}};h.jqplot.ElemContainer.prototype.getPosition=function(){if(this._elem){return this._elem.position()}else{return{top:null,left:null,bottom:null,right:null}}};h.jqplot.ElemContainer.prototype.getTop=function(){return this.getPosition().top};h.jqplot.ElemContainer.prototype.getLeft=function(){return this.getPosition().left};h.jqplot.ElemContainer.prototype.getBottom=function(){return this._elem.css("bottom")};h.jqplot.ElemContainer.prototype.getRight=function(){return this._elem.css("right")};function l(v){h.jqplot.ElemContainer.call(this);this.name=v;this._series=[];this.show=false;this.tickRenderer=h.jqplot.AxisTickRenderer;this.tickOptions={};this.labelRenderer=h.jqplot.AxisLabelRenderer;this.labelOptions={};this.label=null;this.showLabel=true;this.min=null;this.max=null;this.autoscale=false;this.pad=1.2;this.padMax=null;this.padMin=null;this.ticks=[];this.numberTicks;this.tickInterval;this.renderer=h.jqplot.LinearAxisRenderer;this.rendererOptions={};this.showTicks=true;this.showTickMarks=true;this.showMinorTicks=true;this.useSeriesColor=false;this.borderWidth=null;this.borderColor=null;this._dataBounds={min:null,max:null};this._offsets={min:null,max:null};this._ticks=[];this._label=null;this.syncTicks=null;this.tickSpacing=75;this._min=null;this._max=null;this._tickInterval=null;this._numberTicks=null;this.__ticks=null}l.prototype=new h.jqplot.ElemContainer();l.prototype.constructor=l;l.prototype.init=function(){this.renderer=new this.renderer();this.tickOptions.axis=this.name;if(this.label==null||this.label==""){this.showLabel=false}else{this.labelOptions.label=this.label}if(this.showLabel==false){this.labelOptions.show=false}if(this.pad==0){this.pad=1}if(this.padMax==0){this.padMax=1}if(this.padMin==0){this.padMin=1}if(this.padMax==null){this.padMax=(this.pad-1)/2+1}if(this.padMin==null){this.padMin=(this.pad-1)/2+1}this.pad=this.padMax+this.padMin-1;if(this.min!=null||this.max!=null){this.autoscale=false}if(this.syncTicks==null&&this.name.indexOf("y")>-1){this.syncTicks=true}else{if(this.syncTicks==null){this.syncTicks=false}}this.renderer.init.call(this,this.rendererOptions)};l.prototype.draw=function(v){return this.renderer.draw.call(this,v)};l.prototype.set=function(){this.renderer.set.call(this)};l.prototype.pack=function(w,v){if(this.show){this.renderer.pack.call(this,w,v)}if(this._min==null){this._min=this.min;this._max=this.max;this._tickInterval=this.tickInterval;this._numberTicks=this.numberTicks;this.__ticks=this._ticks}};l.prototype.reset=function(){this.renderer.reset.call(this)};l.prototype.resetScale=function(){this.min=null;this.max=null;this.numberTicks=null;this.tickInterval=null};function b(v){h.jqplot.ElemContainer.call(this);this.show=false;this.location="ne";this.xoffset=12;this.yoffset=12;this.border;this.background;this.textColor;this.fontFamily;this.fontSize;this.rowSpacing="0.5em";this.renderer=h.jqplot.TableLegendRenderer;this.rendererOptions={};this.preDraw=false;this.escapeHtml=false;this._series=[];h.extend(true,this,v)}b.prototype=new h.jqplot.ElemContainer();b.prototype.constructor=b;b.prototype.init=function(){this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions)};b.prototype.draw=function(w){for(var v=0;v0){D._prevPlotData=this.series[E-1]._plotData}D._sumy=0;D._sumx=0;for(C=D.data.length-1;C>-1;C--){D._sumy+=D.data[C][1];D._sumx+=D.data[C][0]}};this.getNextSeriesColor=(function(A){var z=0;var B=A.seriesColors;return function(){if(z0;D--){z=this.axes[C[D-1]];if(z.show){A[D-1]=H;H+=z.getWidth()}}if(H>this._gridPadding.right){this._gridPadding.right=H}if(this.title.show&&this.axes.x2axis.show){this._gridPadding.top=this.title.getHeight()+this.axes.x2axis.getHeight()}else{if(this.title.show){this._gridPadding.top=this.title.getHeight()}else{if(this.axes.x2axis.show){this._gridPadding.top=this.axes.x2axis.getHeight()}}}if(this.axes.xaxis.show){this._gridPadding.bottom=this.axes.xaxis.getHeight()}this.axes.xaxis.pack({position:"absolute",bottom:0,left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});this.axes.yaxis.pack({position:"absolute",top:0,left:0,height:this._height},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});this.axes.x2axis.pack({position:"absolute",top:this.title.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});for(F=8;F>0;F--){this.axes[C[F-1]].pack({position:"absolute",top:0,right:A[F-1]},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top})}this.target.append(this.grid.createElement(this._gridPadding));this.grid.draw();for(F=0;F0;A--){var B=E[A-1];if(z[B].show){D[B]=z[B].series_p2u(F[B.charAt(0)])}}return({offsets:C,gridPos:F,dataPos:D})}function x(F,J,I){var G=null;var K,D,B,H,C,A;var E;for(var D=0;D=p[0]-A._bodyWidth/2&&J<=p[0]+A._bodyWidth/2&&I>=z(K.data[C][2])&&I<=z(K.data[C][3])){G={seriesIndex:D,pointIndex:C,gridData:p,data:K.data[C]}}}else{if(!A.hlc){var z=K._yaxis.series_u2p;if(J>=p[0]-A._tickLength&&J<=p[0]+A._tickLength&&I>=z(K.data[C][2])&&I<=z(K.data[C][3])){G={seriesIndex:D,pointIndex:C,gridData:p,data:K.data[C]}}}else{var z=K._yaxis.series_u2p;if(J>=p[0]-A._tickLength&&J<=p[0]+A._tickLength&&I>=z(K.data[C][1])&&I<=z(K.data[C][2])){G={seriesIndex:D,pointIndex:C,gridData:p,data:K.data[C]}}}}}else{H=Math.sqrt((J-p[0])*(J-p[0])+(I-p[1])*(I-p[1]));if(H<=E&&(H<=B||B==null)){B=H;G={seriesIndex:D,pointIndex:C,gridData:p,data:K.data[C]}}}}}}return G}this.onClick=function(A){var z=w(A);var C=A.data.plot;var B=x(C,z.gridPos.x,z.gridPos.y);A.data.plot.eventCanvas._elem.trigger("jqplotClick",[z.gridPos,z.dataPos,B,C])};this.onDblClick=function(A){var z=w(A);var C=A.data.plot;var B=x(C,z.gridPos.x,z.gridPos.y);A.data.plot.eventCanvas._elem.trigger("jqplotDblClick",[z.gridPos,z.dataPos,B,C])};this.onMouseDown=function(A){var z=w(A);var C=A.data.plot;var B=x(C,z.gridPos.x,z.gridPos.y);A.data.plot.eventCanvas._elem.trigger("jqplotMouseDown",[z.gridPos,z.dataPos,B,C])};this.onMouseUp=function(A){var z=w(A);A.data.plot.eventCanvas._elem.trigger("jqplotMouseUp",[z.gridPos,z.dataPos,null,A.data.plot])};this.onMouseMove=function(A){var z=w(A);var C=A.data.plot;var B=x(C,z.gridPos.x,z.gridPos.y);A.data.plot.eventCanvas._elem.trigger("jqplotMouseMove",[z.gridPos,z.dataPos,B,C])};this.onMouseEnter=function(A){var z=w(A);var B=A.data.plot;A.data.plot.eventCanvas._elem.trigger("jqplotMouseEnter",[z.gridPos,z.dataPos,null,B])};this.onMouseLeave=function(A){var z=w(A);var B=A.data.plot;A.data.plot.eventCanvas._elem.trigger("jqplotMouseLeave",[z.gridPos,z.dataPos,null,B])};this.drawSeries=function(B,z){var D,C,A;if(z!=c){C=this.series[z];A=C.shadowCanvas._ctx;A.clearRect(0,0,A.canvas.width,A.canvas.height);C.drawShadow(A,B,this);A=C.canvas._ctx;A.clearRect(0,0,A.canvas.width,A.canvas.height);C.draw(A,B,this)}else{for(D=0;D0){return w[v--]}else{v=w.length-1;return w[v]}};this.get=function(x){return w[x]};this.setColors=function(x){w=x};this.reset=function(){v=0}};h.jqplot.hex2rgb=function(x,v){x=x.replace("#","");if(x.length==3){x=x[0]+x[0]+x[1]+x[1]+x[2]+x[2]}var w;w="rgba("+parseInt(x.slice(0,2),16)+", "+parseInt(x.slice(2,4),16)+", "+parseInt(x.slice(4,6),16);if(v){w+=", "+v}w+=")";return w};h.jqplot.rgb2hex=function(z){var x=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;var v=z.match(x);var y="#";for(i=1;i<4;i++){var w;if(v[i].search(/%/)!=-1){w=parseInt(255*v[i]/100,10).toString(16);if(w.length==1){w="0"+w}}else{w=parseInt(v[i],10).toString(16);if(w.length==1){w="0"+w}}y+=w}return y};h.jqplot.normalize2rgb=function(w,v){if(w.search(/^ *rgba?\(/)!=-1){return w}else{if(w.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/)!=-1){return h.jqplot.hex2rgb(w,v)}else{throw"invalid color spec"}}};h.jqplot.getColorComponents=function(z){var y=h.jqplot.normalize2rgb(z);var x=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;var v=y.match(x);var w=[];for(i=1;i<4;i++){if(v[i].search(/%/)!=-1){w[i-1]=parseInt(255*v[i]/100,10)}else{w[i-1]=parseInt(v[i],10)}}w[3]=parseFloat(v[4])?parseFloat(v[4]):1;return w};h.jqplot.log=function(){if(window.console&&h.jqplot.debug){if(arguments.length==1){console.log(arguments[0])}else{console.log(arguments)}}};var f=h.jqplot.log;h.jqplot.AxisLabelRenderer=function(v){h.jqplot.ElemContainer.call(this);this.axis;this.show=true;this.label="";this._elem;this.escapeHTML=false;h.extend(true,this,v)};h.jqplot.AxisLabelRenderer.prototype=new h.jqplot.ElemContainer();h.jqplot.AxisLabelRenderer.prototype.constructor=h.jqplot.AxisLabelRenderer;h.jqplot.AxisLabelRenderer.prototype.init=function(v){h.extend(true,this,v)};h.jqplot.AxisLabelRenderer.prototype.draw=function(){this._elem=h('
');if(Number(this.label)){this._elem.css("white-space","nowrap")}if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}return this._elem};h.jqplot.AxisLabelRenderer.prototype.pack=function(){};h.jqplot.AxisTickRenderer=function(v){h.jqplot.ElemContainer.call(this);this.mark="outside";this.axis;this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.size=4;this.markSize=6;this.show=true;this.showLabel=true;this.label="";this.value=null;this._styles={};this.formatter=h.jqplot.DefaultTickFormatter;this.formatString="";this.fontFamily;this.fontSize;this.textColor;this._elem;h.extend(true,this,v)};h.jqplot.AxisTickRenderer.prototype.init=function(v){h.extend(true,this,v)};h.jqplot.AxisTickRenderer.prototype=new h.jqplot.ElemContainer();h.jqplot.AxisTickRenderer.prototype.constructor=h.jqplot.AxisTickRenderer;h.jqplot.AxisTickRenderer.prototype.setTick=function(v,x,w){this.value=v;this.axis=x;if(w){this.isMinorTick=true}return this};h.jqplot.AxisTickRenderer.prototype.draw=function(){if(!this.label){this.label=this.formatter(this.formatString,this.value)}style='style="position:absolute;';if(Number(this.label)){style+="white-space:nowrap;"}style+='"';this._elem=h("
'+this.label+"
");for(var v in this._styles){this._elem.css(v,this._styles[v])}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}return this._elem};h.jqplot.DefaultTickFormatter=function(v,w){if(typeof w=="number"){if(!v){v="%.1f"}return h.jqplot.sprintf(v,w)}else{return String(w)}};h.jqplot.AxisTickRenderer.prototype.pack=function(){};h.jqplot.CanvasGridRenderer=function(){this.shadowRenderer=new h.jqplot.ShadowRenderer()};h.jqplot.CanvasGridRenderer.prototype.init=function(w){this._ctx;h.extend(true,this,w);var v={lineJoin:"miter",lineCap:"round",fill:false,isarc:false,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.shadowWidth,closePath:false};this.renderer.shadowRenderer.init(v)};h.jqplot.CanvasGridRenderer.prototype.createElement=function(){var y=document.createElement("canvas");var v=this._plotDimensions.width;var x=this._plotDimensions.height;y.width=v;y.height=x;this._elem=h(y);this._elem.addClass("jqplot-grid-canvas");this._elem.css({position:"absolute",left:0,top:0});if(h.browser.msie){window.G_vmlCanvasManager.init_(document)}if(h.browser.msie){y=window.G_vmlCanvasManager.initElement(y)}this._top=this._offsets.top;this._bottom=x-this._offsets.bottom;this._left=this._offsets.left;this._right=v-this._offsets.right;this._width=this._right-this._left;this._height=this._bottom-this._top;return this._elem};h.jqplot.CanvasGridRenderer.prototype.draw=function(){this._ctx=this._elem.get(0).getContext("2d");var L=this._ctx;var E=this._axes;L.save();L.fillStyle=this.background;L.fillRect(this._left,this._top,this._width,this._height);if(this.drawGridlines){L.save();L.lineJoin="miter";L.lineCap="butt";L.lineWidth=this.gridLineWidth;L.strokeStyle=this.gridLineColor;var G,D;var v=["xaxis","yaxis","x2axis","y2axis"];for(var A=4;A>0;A--){var w=v[A-1];var y=E[w];var H=y._ticks;if(y.show){for(var z=H.length;z>0;z--){var K=H[z-1];if(K.show){var F=Math.round(y.u2p(K.value))+0.5;switch(w){case"xaxis":if(K.showGridline){C(F,this._top,F,this._bottom)}if(K.showMark&&K.mark){s=K.markSize;m=K.mark;var F=Math.round(y.u2p(K.value))+0.5;switch(m){case"outside":G=this._bottom;D=this._bottom+s;break;case"inside":G=this._bottom-s;D=this._bottom;break;case"cross":G=this._bottom-s;D=this._bottom+s;break;default:G=this._bottom;D=this._bottom+s;break}if(this.shadow){this.renderer.shadowRenderer.draw(L,[[F,G],[F,D]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}C(F,G,F,D)}break;case"yaxis":if(K.showGridline){C(this._right,F,this._left,F)}if(K.showMark&&K.mark){s=K.markSize;m=K.mark;var F=Math.round(y.u2p(K.value))+0.5;switch(m){case"outside":G=this._left-s;D=this._left;break;case"inside":G=this._left;D=this._left+s;break;case"cross":G=this._left-s;D=this._left+s;break;default:G=this._left-s;D=this._left;break}if(this.shadow){this.renderer.shadowRenderer.draw(L,[[G,F],[D,F]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}C(G,F,D,F,{strokeStyle:y.borderColor})}break;case"x2axis":if(K.showGridline){C(F,this._bottom,F,this._top)}if(K.showMark&&K.mark){s=K.markSize;m=K.mark;var F=Math.round(y.u2p(K.value))+0.5;switch(m){case"outside":G=this._top-s;D=this._top;break;case"inside":G=this._top;D=this._top+s;break;case"cross":G=this._top-s;D=this._top+s;break;default:G=this._top-s;D=this._top;break}if(this.shadow){this.renderer.shadowRenderer.draw(L,[[F,G],[F,D]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}C(F,G,F,D)}break;case"y2axis":if(K.showGridline){C(this._left,F,this._right,F)}if(K.showMark&&K.mark){s=K.markSize;m=K.mark;var F=Math.round(y.u2p(K.value))+0.5;switch(m){case"outside":G=this._right;D=this._right+s;break;case"inside":G=this._right-s;D=this._right;break;case"cross":G=this._right-s;D=this._right+s;break;default:G=this._right;D=this._right+s;break}if(this.shadow){this.renderer.shadowRenderer.draw(L,[[G,F],[D,F]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}C(G,F,D,F,{strokeStyle:y.borderColor})}break;default:break}}}}}v=["y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];for(var A=7;A>0;A--){var y=E[v[A-1]];var H=y._ticks;if(y.show){var J=H[y.numberTicks-1];var B=H[0];var x=y.getLeft();var I=[[x,J.getTop()+J.getHeight()/2],[x,B.getTop()+B.getHeight()/2+1]];if(this.shadow){this.renderer.shadowRenderer.draw(L,I,{lineCap:"butt",fill:false,closePath:false})}C(I[0][0],I[0][1],I[1][0],I[1][1],{lineCap:"butt",strokeStyle:y.borderColor,lineWidth:y.borderWidth});for(var z=H.length;z>0;z--){var K=H[z-1];s=K.markSize;m=K.mark;var F=Math.round(y.u2p(K.value))+0.5;if(K.showMark&&K.mark){switch(m){case"outside":G=x;D=x+s;break;case"inside":G=x-s;D=x;break;case"cross":G=x-s;D=x+s;break;default:G=x;D=x+s;break}I=[[G,F],[D,F]];if(this.shadow){this.renderer.shadowRenderer.draw(L,I,{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}C(G,F,D,F,{strokeStyle:y.borderColor})}}}}L.restore()}function C(Q,P,N,M,O){L.save();O=O||{};h.extend(true,L,O);L.beginPath();L.moveTo(Q,P);L.lineTo(N,M);L.stroke();L.restore()}if(this.shadow){var I=[[this._left,this._bottom],[this._right,this._bottom],[this._right,this._top]];this.renderer.shadowRenderer.draw(L,I)}C(this._left,this._top,this._right,this._top,{lineCap:"round",strokeStyle:E.x2axis.borderColor,lineWidth:E.x2axis.borderWidth});C(this._right,this._top,this._right,this._bottom,{lineCap:"round",strokeStyle:E.y2axis.borderColor,lineWidth:E.y2axis.borderWidth});C(this._right,this._bottom,this._left,this._bottom,{lineCap:"round",strokeStyle:E.xaxis.borderColor,lineWidth:E.xaxis.borderWidth});C(this._left,this._bottom,this._left,this._top,{lineCap:"round",strokeStyle:E.yaxis.borderColor,lineWidth:E.yaxis.borderWidth});L.restore()};var r=24*60*60*1000;var j=function(v,w){v=String(v);while(v.length0?"floor":"ceil"](v/12));var w=x.getMonth()+(v%12);if(w==12){w=0;x.setYear(x.getFullYear()+1)}else{if(w==-1){w=11;x.setYear(x.getFullYear()-1)}}x.setMonth(w)},diff:function(z,x){var v=z.getFullYear()-x.getFullYear();var w=z.getMonth()-x.getMonth()+(v*12);var y=z.getDate()-x.getDate();return w+(y/30)}},year:{add:function(w,v){w.setYear(w.getFullYear()+Math[v>0?"floor":"ceil"](v))},diff:function(w,v){return e.month.diff(w,v)/12}}};for(var u in e){if(u.substring(u.length-1)!="s"){e[u+"s"]=e[u]}}var t=function(y,x){if(Date.prototype.strftime.formatShortcuts[x]){return y.strftime(Date.prototype.strftime.formatShortcuts[x])}else{var v=(Date.prototype.strftime.formatCodes[x]||"").split(".");var w=y["get"+v[0]]?y["get"+v[0]]():"";if(v[1]){w=j(w,v[1])}return w}};var q={succ:function(v){return this.clone().add(1,v)},add:function(x,w){var v=e[w]||e.day;if(typeof v=="number"){this.setTime(this.getTime()+(v*x))}else{v.add(this,x)}return this},diff:function(w,z,v){w=Date.create(w);if(w===null){return null}var x=e[z]||e.day;if(typeof x=="number"){var y=(this.getTime()-w.getTime())/x}else{var y=x.diff(this,w)}return(v?y:Math[y>0?"floor":"ceil"](y))},strftime:function(w){var y=w||"%Y-%m-%d",v="",x;while(y.length>0){if(x=y.match(Date.prototype.strftime.formatCodes.matcher)){v+=y.slice(0,x.index);v+=(x[1]||"")+t(this,x[2]);y=y.slice(x.index+x[0].length)}else{v+=y;y=""}}return v},getShortYear:function(){return this.getYear()%100},getMonthNumber:function(){return this.getMonth()+1},getMonthName:function(){return Date.MONTHNAMES[this.getMonth()]},getAbbrMonthName:function(){return Date.ABBR_MONTHNAMES[this.getMonth()]},getDayName:function(){return Date.DAYNAMES[this.getDay()]},getAbbrDayName:function(){return Date.ABBR_DAYNAMES[this.getDay()]},getDayOrdinal:function(){return Date.ORDINALNAMES[this.getDate()%10]},getHours12:function(){var v=this.getHours();return v>12?v-12:(v==0?12:v)},getAmPm:function(){return this.getHours()>=12?"PM":"AM"},getUnix:function(){return Math.round(this.getTime()/1000,0)},getGmtOffset:function(){var v=this.getTimezoneOffset()/60;var w=v<0?"+":"-";v=Math.abs(v);return w+j(Math.floor(v),2)+":"+j((v%1)*60,2)},getTimezoneName:function(){var v=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return v[1]||v[2]||"GMT"+this.getGmtOffset()},toYmdInt:function(){return(this.getFullYear()*10000)+(this.getMonthNumber()*100)+this.getDate()},clone:function(){return new Date(this.getTime())}};for(var a in q){Date.prototype[a]=q[a]}var d={create:function(v){if(v instanceof Date){return v}if(typeof v=="number"){return new Date(v)}var A=String(v).replace(/^\s*(.+)\s*$/,"$1"),w=0,x=Date.create.patterns.length,y;var z=A;while(w31){v=x[3];if(F')}else{if(this.text){var v="position:absolute;top:0px;left:0px;";v+=(this._plotWidth)?"width:"+this._plotWidth+"px;":"";v+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";v+=(this.fontSize)?"font-size:"+this.fontSize+";":"";v+=(this.textAlign)?"text-align:"+this.textAlign+";":"text-align:center;";v+=(this.textColor)?"color:"+this.textColor+";":"";this._elem=h('
'+this.text+"
")}}return this._elem};h.jqplot.DivTitleRenderer.prototype.pack=function(){};h.jqplot.LineRenderer=function(){this.shapeRenderer=new h.jqplot.ShapeRenderer();this.shadowRenderer=new h.jqplot.ShadowRenderer()};h.jqplot.LineRenderer.prototype.init=function(w){h.extend(true,this.renderer,w);var y={lineJoin:"round",lineCap:"round",fill:this.fill,isarc:false,strokeStyle:this.color,fillStyle:this.fillColor,lineWidth:this.lineWidth,closePath:this.fill};this.renderer.shapeRenderer.init(y);if(this.lineWidth>2.5){var x=this.shadowOffset*(1+(Math.atan((this.lineWidth/2.5))/0.785398163-1)*0.6)}else{var x=this.shadowOffset*Math.atan((this.lineWidth/2.5))/0.785398163}var v={lineJoin:"round",lineCap:"round",fill:this.fill,isarc:false,angle:this.shadowAngle,offset:x,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.lineWidth,closePath:this.fill};this.renderer.shadowRenderer.init(v)};h.jqplot.LineRenderer.prototype.setGridData=function(A){var w=this._xaxis.series_u2p;var z=this._yaxis.series_u2p;var x=this._plotData;var y=this._prevPlotData;this.gridData=[];this._prevGridData=[];for(var v=0;v0;K--){N.push(F[K-1])}if(y){this.renderer.shadowRenderer.draw(G,N,E)}this.renderer.shapeRenderer.draw(G,N,E)}}else{if(v){var O=N.slice(0)}if(this.index==0||!this._stack){var A=G.canvas.height;N.unshift([N[0][0],A]);len=N.length;N.push([N[len-1][0],A])}else{var F=this._prevGridData;for(var K=F.length;K>0;K--){N.push(F[K-1])}}if(y){this.renderer.shadowRenderer.draw(G,N,E)}this.renderer.shapeRenderer.draw(G,N,E)}if(v){var I=h.extend(true,{},E,{fill:false,closePath:false});this.renderer.shapeRenderer.draw(G,O,I);if(this.markerRenderer.show){for(K=0;Kv.max||v.max==null){v.max=A[w][0]}}else{if(A[w][1]v.max||v.max==null){v.max=A[w][1]}}}}};h.jqplot.LinearAxisRenderer.prototype.draw=function(v){if(this.show){this.renderer.createTicks.call(this);var B=0;var w;this._elem=h('
');if(this.name=="xaxis"||this.name=="x2axis"){this._elem.width(this._plotDimensions.width)}else{this._elem.height(this._plotDimensions.height)}this.labelOptions.axis=this.name;this._label=new this.labelRenderer(this.labelOptions);if(this._label.show){var A=this._label.draw(v);A.appendTo(this._elem)}if(this.showTicks){var z=this._ticks;for(var y=0;yD){D=y}}}if(v){x=this._label._elem.outerWidth(true);C=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){D=D+C;this._elem.css({height:D+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){D=D+C;this._elem.css({height:D+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){D=D+x;this._elem.css({width:D+"px",left:"0px",top:"0px"});if(v&&this._label.constructor==h.jqplot.AxisLabelRenderer){this._label._elem.css("width",x+"px")}}else{D=D+x;this._elem.css({width:D+"px",right:"0px",top:"0px"});if(v&&this._label.constructor==h.jqplot.AxisLabelRenderer){this._label._elem.css("width",x+"px")}}}}}};h.jqplot.LinearAxisRenderer.prototype.createTicks=function(){var ab=this._ticks;var X=this.ticks;var ac=this.name;var aa=this._dataBounds;var S,Y;var P,T;var y,x;var v,U;if(X.length){for(U=0;U0){E=Math.max(Math.log(P)/Math.LN10,0.05)}P-=E;T+=E}var K=T-P;var O,R;var W;if(this.autoscale&&this.min==null&&this.max==null){var J,z,L;var F=false;var N=false;var w={min:null,max:null,average:null,stddev:null};for(var U=0;UC){C=H[Q]}}}var M=(C-A)/C;if(I.renderer.constructor==h.jqplot.BarRenderer){if(A>=0&&(I.fillToZero||M>0.1)){F=true}else{F=false;if(I.fill&&I.fillToZero&&A<0&&C>0){N=true}else{N=false}}}else{if(I.fill){if(A>=0&&(I.fillToZero||M>0.1)){F=true}else{if(A<0&&C>0&&I.fillToZero){F=false;N=true}else{F=false;N=false}}}else{if(A<0){F=false}}}}}if(F){this.numberTicks=2+Math.ceil((S-(this.tickSpacing-1))/this.tickSpacing);this.min=0;z=T/(this.numberTicks-1);W=Math.pow(10,Math.abs(Math.floor(Math.log(z)/Math.LN10)));if(z/W==parseInt(z/W,10)){z+=W}this.tickInterval=Math.ceil(z/W)*W;this.max=this.tickInterval*(this.numberTicks-1)}else{if(N){this.numberTicks=2+Math.ceil((S-(this.tickSpacing-1))/this.tickSpacing);var V=Math.ceil(Math.abs(P)/K*(this.numberTicks-1));var Z=this.numberTicks-1-V;z=Math.max(Math.abs(P/V),Math.abs(T/Z));W=Math.pow(10,Math.abs(Math.floor(Math.log(z)/Math.LN10)));this.tickInterval=Math.ceil(z/W)*W;this.max=this.tickInterval*Z;this.min=-this.tickInterval*V}else{if(this.numberTicks==null){if(this.tickInterval){this.numberTicks=3+Math.ceil(K/this.tickInterval)}else{this.numberTicks=2+Math.ceil((S-(this.tickSpacing-1))/this.tickSpacing)}}if(this.tickInterval==null){z=K/(this.numberTicks-1);if(z<1){W=Math.pow(10,Math.abs(Math.floor(Math.log(z)/Math.LN10)))}else{W=1}this.tickInterval=Math.ceil(z*W*this.pad)/W}else{W=1/this.tickInterval}J=this.tickInterval*(this.numberTicks-1);L=(J-K)/2;if(this.min==null){this.min=Math.floor(W*(P-L))/W}if(this.max==null){this.max=this.min+J}}}}else{O=(this.min!=null)?this.min:P-K*(this.padMin-1);R=(this.max!=null)?this.max:T+K*(this.padMax-1);this.min=O;this.max=R;K=this.max-this.min;if(this.numberTicks==null){if(this.tickInterval!=null){this.numberTicks=Math.ceil((this.max-this.min)/this.tickInterval)+1;this.max=this.min+this.tickInterval*(this.numberTicks-1)}else{if(S>100){this.numberTicks=parseInt(3+(S-100)/75,10)}else{this.numberTicks=2}}}if(this.tickInterval==null){this.tickInterval=K/(this.numberTicks-1)}}for(var U=0;U0){B=-K._textRenderer.height*Math.cos(-K._textRenderer.angle)/2}else{B=-K.getHeight()+K._textRenderer.height*Math.cos(K._textRenderer.angle)/2}break;case"middle":B=-K.getHeight()/2;break;default:B=-K.getHeight()/2;break}}else{B=-K.getHeight()/2}var x=this.u2p(K.value)+B+"px";K._elem.css("top",x);K.pack()}}if(D){var E=this._label._elem.outerHeight(true);this._label._elem.css("top",z-y/2-E/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}};h.jqplot.MarkerRenderer=function(v){this.show=true;this.style="filledCircle";this.lineWidth=2;this.size=9;this.color="#666666";this.shadow=true;this.shadowAngle=45;this.shadowOffset=1;this.shadowDepth=3;this.shadowAlpha="0.07";this.shadowRenderer=new h.jqplot.ShadowRenderer();this.shapeRenderer=new h.jqplot.ShapeRenderer();h.extend(true,this,v)};h.jqplot.MarkerRenderer.prototype.init=function(v){h.extend(true,this,v);var x={angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,lineWidth:this.lineWidth,depth:this.shadowDepth,closePath:true};if(this.style.indexOf("filled")!=-1){x.fill=true}if(this.style.indexOf("ircle")!=-1){x.isarc=true;x.closePath=false}this.shadowRenderer.init(x);var w={fill:false,isarc:false,strokeStyle:this.color,fillStyle:this.color,lineWidth:this.lineWidth,closePath:true};if(this.style.indexOf("filled")!=-1){w.fill=true}if(this.style.indexOf("ircle")!=-1){w.isarc=true;w.closePath=false}this.shapeRenderer.init(w)};h.jqplot.MarkerRenderer.prototype.drawDiamond=function(z,w,C,B,E){var v=1.2;var F=this.size/2/v;var D=this.size/2*v;var A=[[z-F,w],[z,w+D],[z+F,w],[z,w-D]];if(this.shadow){this.shadowRenderer.draw(C,A)}this.shapeRenderer.draw(C,A,E);C.restore()};h.jqplot.MarkerRenderer.prototype.drawPlus=function(A,z,D,C,G){var w=1;var H=this.size/2*w;var E=this.size/2*w;var F=[[A,z-E],[A,z+E]];var B=[[A+H,z],[A-H,z]];var v=h.extend(true,{},this.options,{closePath:false});if(this.shadow){this.shadowRenderer.draw(D,F,{closePath:false});this.shadowRenderer.draw(D,B,{closePath:false})}this.shapeRenderer.draw(D,F,v);this.shapeRenderer.draw(D,B,v);D.restore()};h.jqplot.MarkerRenderer.prototype.drawX=function(A,z,D,C,G){var w=1;var H=this.size/2*w;var E=this.size/2*w;var v=h.extend(true,{},this.options,{closePath:false});var F=[[A-H,z-E],[A+H,z+E]];var B=[[A-H,z+E],[A+H,z-E]];if(this.shadow){this.shadowRenderer.draw(D,F,{closePath:false});this.shadowRenderer.draw(D,B,{closePath:false})}this.shapeRenderer.draw(D,F,v);this.shapeRenderer.draw(D,B,v);D.restore()};h.jqplot.MarkerRenderer.prototype.drawDash=function(z,w,C,B,E){var v=1;var F=this.size/2*v;var D=this.size/2*v;var A=[[z-F,w],[z+F,w]];if(this.shadow){this.shadowRenderer.draw(C,A)}this.shapeRenderer.draw(C,A,E);C.restore()};h.jqplot.MarkerRenderer.prototype.drawSquare=function(z,w,C,B,E){var v=1;var F=this.size/2/v;var D=this.size/2*v;var A=[[z-F,w-D],[z-F,w+D],[z+F,w+D],[z+F,w-D]];if(this.shadow){this.shadowRenderer.draw(C,A)}this.shapeRenderer.draw(C,A,E);C.restore()};h.jqplot.MarkerRenderer.prototype.drawCircle=function(w,E,A,D,B){var v=this.size/2;var z=2*Math.PI;var C=[w,E,v,0,z,true];if(this.shadow){this.shadowRenderer.draw(A,C)}this.shapeRenderer.draw(A,C,B);A.restore()};h.jqplot.MarkerRenderer.prototype.draw=function(v,A,w,z){z=z||{};switch(this.style){case"diamond":this.drawDiamond(v,A,w,false,z);break;case"filledDiamond":this.drawDiamond(v,A,w,true,z);break;case"circle":this.drawCircle(v,A,w,false,z);break;case"filledCircle":this.drawCircle(v,A,w,true,z);break;case"square":this.drawSquare(v,A,w,false,z);break;case"filledSquare":this.drawSquare(v,A,w,true,z);break;case"x":this.drawX(v,A,w,true,z);break;case"plus":this.drawPlus(v,A,w,true,z);break;case"dash":this.drawDash(v,A,w,true,z);break;default:this.drawDiamond(v,A,w,false,z);break}};h.jqplot.ShadowRenderer=function(v){this.angle=45;this.offset=1;this.alpha=0.07;this.lineWidth=1.5;this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.depth=3;this.isarc=false;h.extend(true,this,v)};h.jqplot.ShadowRenderer.prototype.init=function(v){h.extend(true,this,v)};h.jqplot.ShadowRenderer.prototype.draw=function(E,C,F){E.save();var v=(F!=null)?F:{};var D=(v.fill!=null)?v.fill:this.fill;var B=(v.closePath!=null)?v.closePath:this.closePath;var y=(v.offset!=null)?v.offset:this.offset;var w=(v.alpha!=null)?v.alpha:this.alpha;var A=(v.depth!=null)?v.depth:this.depth;E.lineWidth=(v.lineWidth!=null)?v.lineWidth:this.lineWidth;E.lineJoin=(v.lineJoin!=null)?v.lineJoin:this.lineJoin;E.lineCap=(v.lineCap!=null)?v.lineCap:this.lineCap;E.strokeStyle="rgba(0,0,0,"+w+")";E.fillStyle="rgba(0,0,0,"+w+")";for(var x=0;x').appendTo(this._elem);h('
').appendTo(z);var y=h('');y.appendTo(z);if(this.escapeHtml){y.text(x)}else{y.html(x)}};h.jqplot.TableLegendRenderer.prototype.draw=function(){var B=this;if(this.show){var z=this._series;var D="position:absolute;";D+=(this.background)?"background:"+this.background+";":"";D+=(this.border)?"border:"+this.border+";":"";D+=(this.fontSize)?"font-size:"+this.fontSize+";":"";D+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";D+=(this.textColor)?"color:"+this.textColor+";":"";this._elem=h('
');var v=false;for(var A=0;A=C)?"":Array(1+C-G.length>>>0).join(D);return F?G+E:E+G}function x(H,G,J,E,F,D){var I=E-H.length;if(I>0){var C=" ";if(D){C=" "}if(J||!F){H=A(H,E,C,J)}else{H=H.slice(0,G.length)+A("",I,"0",true)+H.slice(G.length)}}return H}function B(K,D,I,E,C,H,J,G){var F=K>>>0;I=I&&F&&{"2":"0b","8":"0","16":"0x"}[D]||"";K=I+A(F.toString(D),H||0,"0",false);return x(K,I,E,C,J,G)}function v(G,H,E,C,F,D){if(C!=null){G=G.slice(0,C)}return x(G,"",H,E,F,D)}var w=arguments,y=0,z=w[y++];return z.replace(h.jqplot.sprintf.regex,function(V,I,J,M,X,T,G){if(V=="%%"){return"%"}var N=false,K="",L=false,U=false,H=false;for(var S=0;J&&S-1?6:(G=="d")?0:void (0)}else{if(T=="*"){T=+w[y++]}else{if(T.charAt(0)=="*"){T=+w[T.slice(1,-1)]}else{T=+T}}}var P=I?w[I.slice(0,-1)]:w[y++];switch(G){case"s":if(P==null){return""}return v(String(P),N,M,T,L,H);case"c":return v(String.fromCharCode(+P),N,M,T,L,H);case"b":return B(P,2,U,N,M,T,L,H);case"o":return B(P,8,U,N,M,T,L,H);case"x":return B(P,16,U,N,M,T,L,H);case"X":return B(P,16,U,N,M,T,L,H).toUpperCase();case"u":return B(P,10,U,N,M,T,L,H);case"i":case"d":var E=parseInt(+P,10);if(isNaN(E)){return""}var R=E<0?"-":K;P=R+A(String(Math.abs(E)),T,"0",false);return x(P,R,N,M,L,H);case"e":case"E":case"f":case"F":case"g":case"G":var E=+P;if(isNaN(E)){return""}var R=E<0?"-":K;var F=["toExponential","toFixed","toPrecision"]["efg".indexOf(G.toLowerCase())];var W=["toString","toUpperCase"]["eEfFgG".indexOf(G)%2];P=R+Math.abs(E)[F](T);return x(P,R,N,M,L,H)[W]();case"p":case"P":var E=+P;if(isNaN(E)){return""}var R=E<0?"-":K;var O=String(Number(Math.abs(E)).toExponential()).split(/e|E/);var D=(O[0].indexOf(".")!=-1)?O[0].length-1:O[0].length;var Q=(O[1]<0)?-O[1]-1:0;if(Math.abs(E)<1){if(D+Q<=T){P=R+Math.abs(E).toPrecision(D)}else{if(D<=T-1){P=R+Math.abs(E).toExponential(D-1)}else{P=R+Math.abs(E).toExponential(T-1)}}}else{var C=(D<=T)?D:T;P=R+Math.abs(E).toPrecision(C)}var W=["toString","toUpperCase"]["pP".indexOf(G)%2];return x(P,R,N,M,L,H)[W]();case"n":return"";default:return V}})};h.jqplot.sprintf.regex=/%%|%(\d+\$)?([-+#0& ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g})(jQuery);