//>>built
define("dojox/charting/axis2d/Default","dojo/_base/lang dojo/_base/array dojo/sniff dojo/_base/declare dojo/_base/connect dojo/dom-geometry ./Invisible ../scaler/linear ./common dojox/gfx dojox/lang/utils dojox/lang/functional dojo/has!dojo-bidi?../bidi/axis2d/Default".split(" "),function(Q,T,W,ha,ia,ma,X,Y,ca,y,ja,ka,na){X=ha(W("dojo-bidi")?"dojox.charting.axis2d.NonBidiDefault":"dojox.charting.axis2d.Default",X,{defaultParams:{vertical:!1,fixUpper:"none",fixLower:"none",natural:!1,leftBottom:!0,
includeZero:!1,fixed:!0,majorLabels:!0,minorTicks:!0,minorLabels:!0,microTicks:!1,rotation:0,htmlLabels:!0,enableCache:!1,dropLabels:!0,labelSizeChange:!1,position:"leftOrBottom"},optionalParams:{min:0,max:1,from:0,to:1,majorTickStep:4,minorTickStep:2,microTickStep:1,labels:[],labelFunc:null,maxLabelSize:0,maxLabelCharCount:0,trailingSymbol:null,stroke:{},majorTick:{},minorTick:{},microTick:{},tick:{},font:"",fontColor:"",title:"",titleGap:0,titleFont:"",titleFontColor:"",titleOrientation:""},constructor:function(b,
d){this.opt=Q.clone(this.defaultParams);ja.updateWithObject(this.opt,d);ja.updateWithPattern(this.opt,d,this.optionalParams);this.opt.enableCache&&(this._textFreePool=[],this._lineFreePool=[],this._textUsePool=[],this._lineUsePool=[]);this._invalidMaxLabelSize=!0;d&&"position"in d||(this.opt.position=this.opt.leftBottom?"leftOrBottom":"rightOrTop");this.renderingOptions={"shape-rendering":"crispEdges"}},setWindow:function(b,d){b!=this.scale&&(this._invalidMaxLabelSize=!0);return this.inherited(arguments)},
_groupLabelWidth:function(b,d,g){if(!b.length)return 0;50<b.length&&(b.length=50);Q.isObject(b[0])&&(b=ka.map(b,function(n){return n.text}));g&&(b=ka.map(b,function(n){return 0==Q.trim(n).length?"":n.substring(0,g)+this.trailingSymbol},this));b=b.join("\x3cbr\x3e");return y._base._getTextBox(b,{font:d}).w||0},_getMaxLabelSize:function(b,d,g,n,c,e){if(null==this._maxLabelSize&&6==arguments.length){var l=this.opt;this.scaler.minMinorStep=this._prevMinMinorStep=0;var a=Q.clone(l);delete a.to;delete a.from;
var f=Y.buildScaler(b,d,g,a,l.to-l.from);f.minMinorStep=0;this._majorStart=f.major.start;l=Y.buildTicks(f,l);if(e&&l){var h=f=0,k=function(r){r.label&&this.push(r.label)},p=[];this.opt.majorLabels&&(T.forEach(l.major,k,p),f=this._groupLabelWidth(p,c,a.maxLabelCharCount),a.maxLabelSize&&(f=Math.min(a.maxLabelSize,f)));p=[];this.opt.dropLabels&&this.opt.minorLabels&&(T.forEach(l.minor,k,p),h=this._groupLabelWidth(p,c,a.maxLabelCharCount),a.maxLabelSize&&(h=Math.min(a.maxLabelSize,h)));this._maxLabelSize=
{majLabelW:f,minLabelW:h,majLabelH:e,minLabelH:e}}else this._maxLabelSize=null}return this._maxLabelSize},calculate:function(b,d,g){this.inherited(arguments);this.scaler.minMinorStep=this._prevMinMinorStep;if((this._invalidMaxLabelSize||g!=this._oldSpan)&&Infinity!=b&&-Infinity!=d){this._invalidMaxLabelSize=!1;this.opt.labelSizeChange&&(this._maxLabelSize=null);this._oldSpan=g;var n=this.opt,c=this.chart.theme.axis,e=n.rotation%360,l=this.chart.theme.axis.tick.labelGap,a=n.font||c.majorTick&&c.majorTick.font||
c.tick&&c.tick.font;c=a?y.normalizedLength(y.splitFontString(a).size):0;a=this._getMaxLabelSize(b,d,g,e,a,c);"number"!=typeof l&&(l=4);if(a&&n.dropLabels){n=Math.abs(Math.cos(e*Math.PI/180));var f=Math.abs(Math.sin(e*Math.PI/180));0>e&&(e+=360);switch(e){case 0:case 180:this.vertical?e=c:(e=a.majLabelW,c=a.minLabelW);break;case 90:case 270:this.vertical?(e=a.majLabelW,c=a.minLabelW):e=c;break;default:e=this.vertical?Math.min(a.majLabelW,c/n):Math.min(a.majLabelW,c/f),c=Math.min(Math.sqrt(a.minLabelW*
a.minLabelW+c*c),this.vertical?c*n+a.minLabelW*f:a.minLabelW*n+c*f)}this.scaler.minMinorStep=this._prevMinMinorStep=Math.max(e,c)+l;this._skipInterval=this.scaler.minMinorStep<=this.scaler.minor.tick*this.scaler.bounds.scale?0:Math.floor((e+l)/(this.scaler.major.tick*this.scaler.bounds.scale))}else this._skipInterval=0}this.ticks=Y.buildTicks(this.scaler,this.opt);return this},getOffsets:function(){var b={l:0,r:0,t:0,b:0};if(!this.scaler)return b;var d=this.opt,g=this.chart.theme.axis,n=this.chart.theme.axis.tick.labelGap,
c=d.titleFont||g.title&&g.title.font;g=0==d.titleGap?0:d.titleGap||g.title&&g.title.gap;var e=this.chart.theme.getTick("major",d),l=this.chart.theme.getTick("minor",d);c=c?y.normalizedLength(y.splitFontString(c).size):0;var a=d.rotation%360,f=d.position,h="rightOrTop"!==f,k=Math.abs(Math.cos(a*Math.PI/180)),p=Math.abs(Math.sin(a*Math.PI/180));this.trailingSymbol=void 0===d.trailingSymbol||null===d.trailingSymbol?this.trailingSymbol:d.trailingSymbol;"number"!=typeof n&&(n=4);0>a&&(a+=360);var r=this._getMaxLabelSize();
if(r){var t=Math.ceil(Math.max(r.majLabelW,r.minLabelW))+1,m=Math.ceil(Math.max(r.majLabelH,r.minLabelH))+1;if(this.vertical)switch(r=h?"l":"r",a){case 0:case 180:b[r]="center"===f?0:t;b.t=b.b=m/2;break;case 90:case 270:b[r]=m;b.t=b.b=t/2;break;default:45>=a||180<a&&225>=a?(b[r]=m*p/2+t*k,b[h?"t":"b"]=m*k/2+t*p,b[h?"b":"t"]=m*k/2):315<a||180>a&&135<a?(b[r]=m*p/2+t*k,b[h?"b":"t"]=m*k/2+t*p,b[h?"t":"b"]=m*k/2):90>a||180<a&&270>a?(b[r]=m*p+t*k,b[h?"t":"b"]=m*k+t*p):(b[r]=m*p+t*k,b[h?"b":"t"]=m*k+t*p)}else switch(r=
h?"b":"t",a){case 0:case 180:b[r]="center"===f?0:m;b.l=b.r=t/2;break;case 90:case 270:b[r]=t;b.l=b.r=m/2;break;default:45<=a&&90>=a||225<=a&&270>=a?(b[r]=m*k/2+t*p,b[h?"r":"l"]=m*p/2+t*k,b[h?"l":"r"]=m*p/2):90<=a&&135>=a||270<=a&&315>=a?(b[r]=m*k/2+t*p,b[h?"l":"r"]=m*p/2+t*k,b[h?"r":"l"]=m*p/2):45>a||180<a&&225>a?(b[r]=m*k+t*p,b[h?"r":"l"]=m*p+t*k):(b[r]=m*k+t*p,b[h?"l":"r"]=m*p+t*k)}b[r]="center"===f?0:b[r]+(n+Math.max(0<e.length?e.length:0,0<l.length?l.length:0)+(d.title?c+g:0))}return b},cleanGroup:function(b){this.opt.enableCache&&
this.group&&(this._lineFreePool=this._lineFreePool.concat(this._lineUsePool),this._lineUsePool=[],this._textFreePool=this._textFreePool.concat(this._textUsePool),this._textUsePool=[]);this.inherited(arguments)},createText:function(b,d,g,n,c,e,l,a,f){if(!this.opt.enableCache||"html"==b)return ca.createText[b](this.chart,d,g,n,c,e,l,a,f);0<this._textFreePool.length?(b=this._textFreePool.pop(),b.setShape({x:g,y:n,text:e,align:c}),d.add(b)):b=ca.createText[b](this.chart,d,g,n,c,e,l,a);this._textUsePool.push(b);
return b},createLine:function(b,d){if(this.opt.enableCache&&0<this._lineFreePool.length){var g=this._lineFreePool.pop();g.setShape(d);b.add(g)}else g=b.createLine(d);this.opt.enableCache&&this._lineUsePool.push(g);return g},render:function(b,d){var g,n=this._isRtl();if(!this.dirty||!this.scaler)return this;var c=this.opt;var e=this.chart.theme.axis;var l=c.position,a="rightOrTop"!==l,f=c.rotation%360,h=0;h=this.chart.theme.axis.tick.labelGap;var k=c.font||e.majorTick&&e.majorTick.font||e.tick&&e.tick.font,
p=c.titleFont||e.title&&e.title.font,r=c.fontColor||e.majorTick&&e.majorTick.fontColor||e.tick&&e.tick.fontColor||"black",t=c.titleFontColor||e.title&&e.title.fontColor||"black";var m=0==c.titleGap?0:c.titleGap||e.title&&e.title.gap||15;var H=c.titleOrientation||e.title&&e.title.orientation||"axis",B=this.chart.theme.getTick("major",c),C=this.chart.theme.getTick("minor",c),da=this.chart.theme.getTick("micro",c),oa="stroke"in c?c.stroke:e.stroke,u=k?y.normalizedLength(y.splitFontString(k).size):0;
var I=Math.abs(Math.cos(f*Math.PI/180));var J=Math.abs(Math.sin(f*Math.PI/180));var R=p?y.normalizedLength(y.splitFontString(p).size):0;"number"!=typeof h&&(h=4);0>f&&(f+=360);var U=this._getMaxLabelSize();U=U&&U.majLabelW;if(this.vertical){var L=b.height-d.b;var M=void 0;var Z=d.t;var S=void 0;e=(b.height-d.b+d.t)/2;var V=void 0;J=u*J+(U||0)*I+h+Math.max(0<B.length?B.length:0,0<C.length?C.length:0)+R+m;var aa=0;var ba=-1;var v=g=0;m=1;I=0;var N=h;var O=0;switch(f){case 0:var q="end";v=.4*u;break;
case 90:q="middle";g=-u;break;case 180:q="start";v=.4*-u;break;case 270:q="middle";break;default:45>f?(q="end",v=.4*u):90>f?(q="end",v=.4*u):135>f?q="start":225>f?(q="start",v=.4*-u):270>f?(q="start",g=a?0:.4*u):315>f?(q="end",g=a?0:.4*u):(q="end",v=.4*u)}if(a)M=S="center"===l?b.width/2:d.l,h=H&&"away"==H?90:270,V=d.l-J+(270==h?R:0),m=-1,N=-N;else switch(M=S=b.width-d.r,h=H&&"axis"==H?90:270,V=b.width-d.r+J-(270==h?0:R),q){case "start":q="end";break;case "end":q="start";break;case "middle":g+=u}}else{M=
d.l;L=void 0;S=b.width-d.r;Z=void 0;V=(b.width-d.r+d.l)/2;e=void 0;J=u*I+(U||0)*J+h+Math.max(0<B.length?B.length:0,0<C.length?C.length:0)+R+m;aa=n?-1:1;m=v=g=ba=0;I=1;N=0;O=h;switch(f){case 0:q="middle";v=u;break;case 90:q="start";g=.4*-u;break;case 180:q="middle";break;case 270:q="end";g=.4*u;break;default:45>f?(q="start",v=a?u:0):135>f?(q="start",g=.4*-u):180>f?(q="start",v=a?0:-u):225>f?(q="end",v=a?0:-u):315>f?(q="end",v=a?.4*u:0):(q="end",v=a?u:0)}if(a)L=Z="center"===l?b.height/2:b.height-d.b,
h=H&&"axis"==H?180:0,e=b.height-d.b+J-(h?R:0);else switch(L=Z=d.t,h=H&&"away"==H?180:0,e=d.t-J+(h?0:R),I=-1,O=-O,q){case "start":q="end";break;case "end":q="start";break;case "middle":v-=u}}this.cleanGroup();var P=this.group;l=this.scaler;a=this.ticks;var ea=Y.getTransformerFromModel(this.scaler),D=c.title&&h||f||!this.opt.htmlLabels||W("ie")||W("opera")?"gfx":"html",E=m*B.length,F=I*B.length,fa=this._skipInterval;P.createLine({x1:M,y1:L,x2:S,y2:Z}).setStroke(oa);c.title&&(p=ca.createText[D](this.chart,
P,V,e,"middle",c.title,p,t),"html"==D?this.htmlElements.push(p):p.setTransform(y.matrix.rotategAt(h,V,e)));if(null==a)return this.dirty=!1,this;var pa=0<a.major.length?(a.major[0].value-this._majorStart)/l.major.tick:0,la=this.opt.majorLabels;T.forEach(a.major,function(w,x){var A=ea(w.value),G=(n?S:M)+aa*A,z=L+ba*A;x+=pa;this.createLine(P,{x1:G,y1:z,x2:G+E,y2:z+F}).setStroke(B);if(w.label&&(!fa||0==(x-(1+fa))%(1+fa))){var K=c.maxLabelCharCount?this.getTextWithLimitCharCount(w.label,k,c.maxLabelCharCount):
{text:w.label,truncated:!1};K=c.maxLabelSize?this.getTextWithLimitLength(K.text,k,c.maxLabelSize,K.truncated):K;A=this.createText(D,P,G+(0<B.length?E:0)+N+(f?0:g),z+(0<B.length?F:0)+O+(f?0:v),q,K.text,k,r);K.truncated&&this.chart.formatTruncatedLabel(A,w.label,D);K.truncated&&this.labelTooltip(A,this.chart,w.label,K.text,k,D);"html"==D?this.htmlElements.push(A):f&&A.setTransform([{dx:g,dy:v},y.matrix.rotategAt(f,G+(0<B.length?E:0)+N,z+(0<B.length?F:0)+O)])}},this);E=m*C.length;F=I*C.length;la=this.opt.minorLabels&&
l.minMinorStep<=l.minor.tick*l.bounds.scale;T.forEach(a.minor,function(w){var x=ea(w.value),A=(n?S:M)+aa*x,G=L+ba*x;this.createLine(P,{x1:A,y1:G,x2:A+E,y2:G+F}).setStroke(C);if(la&&w.label){var z=c.maxLabelCharCount?this.getTextWithLimitCharCount(w.label,k,c.maxLabelCharCount):{text:w.label,truncated:!1};z=c.maxLabelSize?this.getTextWithLimitLength(z.text,k,c.maxLabelSize,z.truncated):z;x=this.createText(D,P,A+(0<C.length?E:0)+N+(f?0:g),G+(0<C.length?F:0)+O+(f?0:v),q,z.text,k,r);z.truncated&&this.chart.formatTruncatedLabel(x,
w.label,D);z.truncated&&this.labelTooltip(x,this.chart,w.label,z.text,k,D);"html"==D?this.htmlElements.push(x):f&&x.setTransform([{dx:g,dy:v},y.matrix.rotategAt(f,A+(0<C.length?E:0)+N,G+(0<C.length?F:0)+O)])}},this);E=m*da.length;F=I*da.length;T.forEach(a.micro,function(w){var x=ea(w.value);w=M+aa*x;x=L+ba*x;this.createLine(P,{x1:w,y1:x,x2:w+E,y2:x+F}).setStroke(da)},this);this.dirty=!1;return this},labelTooltip:function(b,d,g,n,c,e){var l=["dijit/Tooltip"],a={type:"rect"},f=["above","below"];n=y._base._getTextBox(n,
{font:c}).w||0;c=c?y.normalizedLength(y.splitFontString(c).size):0;"html"==e?(Q.mixin(a,ma.position(b.firstChild,!0)),a.width=Math.ceil(n),a.height=Math.ceil(c),this._events.push({shape:dojo,handle:ia.connect(b.firstChild,"onmouseover",this,function(h){require(l,function(k){k.show(g,a,f)})})}),this._events.push({shape:dojo,handle:ia.connect(b.firstChild,"onmouseout",this,function(h){require(l,function(k){k.hide(a)})})})):(e=b.getShape(),d=d.getCoords(),a=Q.mixin(a,{x:e.x-n/2,y:e.y}),a.x+=d.x,a.y+=
d.y,a.x=Math.round(a.x),a.y=Math.round(a.y),a.width=Math.ceil(n),a.height=Math.ceil(c),this._events.push({shape:b,handle:b.connect("onmouseenter",this,function(h){require(l,function(k){k.show(g,a,f)})})}),this._events.push({shape:b,handle:b.connect("onmouseleave",this,function(h){require(l,function(k){k.hide(a)})})}))},_isRtl:function(){return!1}});return W("dojo-bidi")?ha("dojox.charting.axis2d.Default",[X,na]):X});