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