var DvtAxis=function(){};DvtObj.createSubclass(DvtAxis,DvtContainer,"DvtAxis");DvtAxis.newInstance=function(a,b,d,e){var g=new DvtAxis;g.Init(a,b,d,e);return g};DvtAxis.prototype.Init=function(a,b,d,e){DvtAxis.superclass.Init.call(this,a);this.setOptions(e);this._eventHandler=new DvtEventManager(a);this._eventHandler.addListeners(this)};DvtAxis.prototype.setOptions=function(a){this.Options=DvtAxisDefaults.calcOptions(a)};
DvtAxis.prototype.getPreferredSize=function(a,b,d){this.Options.isLayout=!0;this.render(a,b,d);a=this.getDimensions();this.Options.isLayout=!1;this.removeChildren();var e=this.Options.position;if("top"==e||"bottom"==e)return{width:b,height:Math.min(a.h,d)};e=Math.max(1,0.1*a.w);return{width:Math.min(a.w+e,b),height:d}};
DvtAxis.prototype.render=function(a,b,d,e,g){this.Width=b;this.Height=d;this.Data=DvtJSONUtils.clone(a);this.removeChildren();e||(e=0);g||(g=0);a=new DvtRectangle(e,g,b,d);DvtAxisRenderer.render(this,a);this.getContext().queueRender()};DvtAxis.prototype.__getData=function(){return this.Data?this.Data:{}};DvtAxis.prototype.__getOptions=function(){return this.Options};DvtAxis.prototype.__getEventManager=function(){return this._eventHandler};DvtAxis.prototype.__getInfo=function(){return this.Info};
DvtAxis.prototype.__setInfo=function(a){this.Info=a};var DvtAbstractAxisValueFormatter=function(a){this._bundle=a};DvtObj.createSubclass(DvtAbstractAxisValueFormatter,DvtObj,"DvtAbstractAxisValueFormatter");DvtAbstractAxisValueFormatter.prototype.format=function(){};DvtAbstractAxisValueFormatter.prototype.GetBundle=function(){return this._bundle};var DvtAxisDefaults={};DvtObj.createSubclass(DvtAxisDefaults,DvtObj,"DvtAxisDefaults");
DvtAxisDefaults.VERSION_1={position:null,minValue:null,maxValue:null,majorIncrement:null,minorIncrement:null,scaledFromBaseline:"on",timeRangeMode:"explicit",titleStyle:"font-size: 11px; color: #737373;",tickLabel:{style:"font-size: 11px; color: #333333;",rotation:"auto",rendered:!0},majorTick:{lineColor:"rgba(138,141,172,0.4)",lineWidth:1,rendered:null},minorTick:{lineColor:"rgba(138,141,172,0.20)",lineWidth:1,rendered:!1},axisLine:{lineColor:"#8A8DAC",lineWidth:1,rendered:!0},startGroupOffset:0,
endGroupOffset:0,layout:{gapRatio:1,titleGap:9,verticalAxisGap:2,horizontalAxisGap:2},isLayout:!1};DvtAxisDefaults.calcOptions=function(a){var b=DvtAxisDefaults._getDefaults(a);return a?DvtJSONUtils.merge(a,b):b};DvtAxisDefaults._getDefaults=function(){return DvtJSONUtils.clone(DvtAxisDefaults.VERSION_1)};DvtAxisDefaults.getGapSize=function(a,b){return Math.ceil(b*a.layout.gapRatio)};var DvtAxisRenderer={};DvtObj.createSubclass(DvtAxisRenderer,DvtObj,"DvtAxisRenderer");
DvtAxisRenderer.render=function(a,b){var d=DvtAxisInfo.newInstance(a.__getData(),a.__getOptions(),b);a.__setInfo(d);DvtAxisRenderer._renderTitle(a,d,b);DvtAxisRenderer._renderLabels(a,d,b)};
DvtAxisRenderer._renderTitle=function(a,b,d){var e=a.__getData(),g=a.__getOptions();if(e.title&&(b=g.position,g.isLayout&&"bottom"==b&&(b="top"),a="top"==b||"bottom"==b?DvtChartTextUtils.createText(a.__getEventManager(),a,e.title,g.titleStyle,0,0,d.w,d.h):DvtChartTextUtils.createText(a.__getEventManager(),a,e.title,g.titleStyle,0,0,d.h,d.w)))e=a.getDimensions(),g=DvtAxisDefaults.getGapSize(g,g.layout.titleGap),"top"==b?(a.setX(d.x+d.w/2-e.w/2),a.setY(d.y),d.y+=e.h+g,d.h-=e.h+g):"bottom"==b?(a.setX(d.x+
d.w/2-e.w/2),a.setY(d.y+d.h-e.h),d.h-=e.h+g):"left"==b?(a.setRotation(3*Math.PI/2),a.setTranslateX(d.x),a.setTranslateY(d.y+d.h/2+e.w/2),d.x+=e.h+g,d.w-=e.h+g):"right"==b&&(a.setRotation(Math.PI/2),a.setTranslateX(d.x+d.w),a.setTranslateY(d.y+d.h/2-e.w/2),d.w-=e.h+g),DvtLayoutUtils.alignTextStart(a)};
DvtAxisRenderer._renderLabels=function(a,b,d){var e=a.__getOptions();e.tickLabel.rendered&&(e=e.position,"top"==e||"bottom"==e?DvtAxisRenderer._renderLabelsHoriz(a,b,d):DvtAxisRenderer._renderLabelsVert(a,b,d))};
DvtAxisRenderer._renderLabelsHoriz=function(a,b,d){for(var e=b.getLabels(a.getContext()),g=a.__getOptions().isLayout,h=0,k=DvtStyleUtils.isLocaleR2L(),m=0;m<e.length;m++){var n=e[m];if(null!=n){if(b.isLabelRotated()){var o=n.getTextString(),n=g?n:n.truncateToSpace(a,d.h,d.w);if(!n)continue;n.getTextString().length<o.length&&a.__getEventManager().associate(n,new DvtSimpleObjPeer(o));k?DvtLayoutUtils.alignTextStart(n):DvtLayoutUtils.alignTextEnd(n);n.setTranslateY(d.y)}else n.alignTop(),n.setY(d.y);
a.addChild(n);h=Math.max(h,n.getDimensions().h)}}b=b.getLabels(a.getContext(),1);g=0;if(null!=b)for(m=0;m<b.length;m++)n=b[m],null!=n&&(null!=e[m]&&(g=e[m].getDimensions().w/2),k?n.setX(n.getX()+g):n.setX(n.getX()-g),n.alignTop(),n.setY(d.y+h),a.addChild(n))};
DvtAxisRenderer._renderLabelsVert=function(a,b,d){var e=a.__getOptions(),g=e.isLayout,h=e.position,k=d.x+d.w;g&&"left"==h&&(k=d.x);for(var e=function(b){var e=b.getTextString();if(b=g?b:b.truncateToSpace(a,d.w,d.h))b.getTextString().length<e.length&&a.__getEventManager().associate(b,new DvtSimpleObjPeer(e)),b.setX(k),DvtLayoutUtils.alignTextEnd(b),a.addChild(b),g&&"left"==h&&b.alignStart()},m=b.getLabels(a.getContext()),n=0;n<m.length;n++){var o=m[n];null!=o&&e(o)}b=b.getLabels(a.getContext(),1);
if(null!=b)for(n=0;n<b.length;n++)o=b[n],null!=o&&e(o)};var DvtAxisInfo=function(){};DvtObj.createSubclass(DvtAxisInfo,DvtObj,"DvtAxisInfo");DvtAxisInfo.newInstance=function(a,b,d){return a.timeAxisType&&"disabled"!=a.timeAxisType?new DvtTimeAxisInfo(a,b,d):isNaN(a.minDataValue)&&isNaN(a.maxDataValue)?new DvtGroupAxisInfo(a,b,d):new DvtDataAxisInfo(a,b,d)};
DvtAxisInfo.prototype.Init=function(a,b,d){this.Position=b.position;"top"==this.Position||"bottom"==this.Position?(this.StartCoord=d.x,this.EndCoord=d.x+d.w):(this.StartCoord=d.y,this.EndCoord=d.y+d.h);this.Data=a;this.Options=b};DvtAxisInfo.prototype.getOptions=function(){return this.Options};DvtAxisInfo.prototype.getLabels=function(){return null};DvtAxisInfo.prototype.getAxisLine=function(){return null};DvtAxisInfo.prototype.getGridLines=function(){return[]};DvtAxisInfo.prototype.getValueAt=function(){return null};
DvtAxisInfo.prototype.getCoordAt=function(){return null};DvtAxisInfo.prototype.getBoundedValueAt=function(){return null};DvtAxisInfo.prototype.getBoundedCoordAt=function(){return null};DvtAxisInfo.prototype.getUnboundedCoordAt=function(){return null};DvtAxisInfo.prototype.getBaselineCoord=function(){return null};DvtAxisInfo.prototype.isLabelRotated=function(){return!1};
DvtAxisInfo.prototype.CreateLabel=function(a,b,d){a=new DvtText(a,b,d,d);a.setCSSStyle(new DvtCSSStyle(this.Options.tickLabel.style));a.alignCenter();a.alignMiddle();return a};DvtAxisInfo.prototype.CreateGridLine=function(a,b,d){a=new DvtLine(a,d,d,d,d);a.setStroke(b);a.setPixelHinting(!0);a.setMouseEnabled(!1);return a};
DvtAxisInfo.prototype.IsOverlapping=function(a,b){if(!a||0>=a.length)return!1;var d="left"==this.Position||"right"==this.Position,e=d?this.Options.layout.verticalAxisGap:this.Options.layout.horizontalAxisGap,g=DvtStyleUtils.isLocaleR2L();if(null==a[0])return!1;var h,k,m,n;d?(h=a[0].y,k=a[0].y+a[0].h):(h=a[0].x,k=a[0].x+a[0].w);for(var o=b+1;o<a.length;o+=b+1)if(null!=a[o]){if(d){if(m=a[o].y,n=a[o].y+a[o].h,m>=h&&m-e<k||m<h&&n+e>h)return!0}else if(m=a[o].x,n=a[o].x+a[o].w,!g&&m-e<k||g&&n+e>h)return!0;
h=m+e;k=n-e}return!1};DvtAxisInfo.prototype.SkipLabels=function(a,b){for(var d=0,e=this.IsOverlapping(b,d);e;)d++,e=this.IsOverlapping(b,d);if(0<d){for(var e=[],g=0;g<a.length;g+=d+1)e.push(a[g]);return e}return a};DvtAxisInfo.prototype.GetLabelDims=function(a,b){for(var d=[],e=0;e<a.length;e++){var g=a[e];if(null==g)d.push(null);else{b.addChild(g);var h=g.getDimensions(b);b.removeChild(g);d.push(h)}}return d};DvtAxisInfo.prototype.getMajorTickCount=function(){return null};
DvtAxisInfo.prototype.setMajorTickCount=function(){};DvtAxisInfo.prototype.getMinorTickCount=function(){return null};DvtAxisInfo.prototype.setMinorTickCount=function(){};DvtAxisInfo.prototype.getMajorIncrement=function(){return null};DvtAxisInfo.prototype.getMinorIncrement=function(){return null};var DvtDataAxisInfo=function(a,b,d){this.Init(a,b,d)};DvtObj.createSubclass(DvtDataAxisInfo,DvtAxisInfo,"DvtDataAxisInfo");DvtDataAxisInfo._MAX_NUMBER_OF_GRIDS_AUTO=10;DvtDataAxisInfo._MINOR_TICK_COUNT=2;
DvtDataAxisInfo.prototype.Init=function(a,b,d){DvtDataAxisInfo.superclass.Init.call(this,a,b,d);"top"==this.Position||"bottom"==this.Position?DvtStyleUtils.isLocaleR2L()?(this._minCoord=this.EndCoord,this._maxCoord=this.StartCoord):(this._minCoord=this.StartCoord,this._maxCoord=this.EndCoord):(this._minCoord=this.EndCoord,this._maxCoord=this.StartCoord);this._minValue=b.minValue;this._maxValue=b.maxValue;this._majorIncrement=b.majorIncrement;this._minorIncrement=b.minorIncrement;this._converter=null;
void 0!==b.tickLabel&&(this._converter=b.tickLabel.converter);this._calcAxisExtents(a.minDataValue,a.maxDataValue)};
DvtDataAxisInfo.prototype.getLabels=function(a,b){if(b&&0<b)return null;var d=[],e=[],e=a.getStage();this.Options.tickLabel&&this.Options.tickLabel.scaling&&(this._axisValueFormatter=new DvtLinearScaleAxisValueFormatter(new DvtChartBundle,this._minValue,this._maxValue,this._majorIncrement,this.Options.tickLabel.scaling,this.Options.tickLabel.autoPrecision));for(var g=0;g<=this._majorTickCount;g++){var h=g*this._majorIncrement+this._minValue,k=this._formatValue(h),h=this.getCoordAt(h),k=this.CreateLabel(a,
k,h);d.push(k)}e=this.GetLabelDims(d,e);return this.SkipLabels(d,e)};DvtDataAxisInfo.prototype.getAxisLine=function(a){var b=this.Options.axisLine;return b.rendered?(b=new DvtSolidStroke(b.lineColor,1,b.lineWidth),this.CreateGridLine(a,b,10)):null};
DvtDataAxisInfo.prototype.getGridLines=function(a){for(var b=[],d,e=this.Options.majorTick,g=new DvtSolidStroke(e.lineColor,1,e.lineWidth),h=this.Options.minorTick,k=new DvtSolidStroke(h.lineColor,1,h.lineWidth),m=0;m<=this._majorTickCount;m++){var n=m*this._majorIncrement+this._minValue;if(h.rendered)for(var o=1;o<this._minorTickCount;o++){d=n+o*this._minorIncrement;if(d>this._maxValue)break;d=this.getCoordAt(d);d=this.CreateGridLine(a,k,d);b.push(d)}!1!==e.rendered&&(d=this.getCoordAt(n),d=this.CreateGridLine(a,
g,d),b.push(d))}return b};DvtDataAxisInfo.prototype.getValueAt=function(a){return a<this._minCoord||a>this._maxCoord?null:this._minValue+(a-this._minCoord)/(this._maxCoord-this._minCoord)*(this._maxValue-this._minValue)};DvtDataAxisInfo.prototype.getCoordAt=function(a){return a<this._minValue||a>this._maxValue?null:this.getUnboundedCoordAt(a)};DvtDataAxisInfo.prototype.getBoundedValueAt=function(a){a<this._minCoord?a=this._minCoord:a>this._maxCoord&&(a=this._maxCoord);return this.getValueAt(a)};
DvtDataAxisInfo.prototype.getBoundedCoordAt=function(a){a<this._minValue?a=this._minValue:a>this._maxValue&&(a=this._maxValue);return this.getUnboundedCoordAt(a)};DvtDataAxisInfo.prototype.getUnboundedCoordAt=function(a){return this._minCoord+(a-this._minValue)/(this._maxValue-this._minValue)*(this._maxCoord-this._minCoord)};DvtDataAxisInfo.prototype.getBaselineCoord=function(){var a=0;0>this._maxValue?a=this._maxValue:0<this._minValue&&(a=this._minValue);return this.getCoordAt(a)};
DvtDataAxisInfo.prototype._formatValue=function(a){if(this._converter&&this._converter.getAsString&&this._converter.getAsObject)return this._converter.getAsString(a);if(this._axisValueFormatter)return this._axisValueFormatter.format(a);var b=Math.log(this._majorIncrement)/Math.log(10),b=Math.max(Math.ceil(-b),0);return a.toFixed(b)};
DvtDataAxisInfo.prototype._calcMajorMinorIncr=function(a){this._majorIncrement=this._majorIncrement?this._majorIncrement:a;this._majorTickCount=(this._maxValue-this._minValue)/this._majorIncrement;null!=this._minorIncrement&&2<=this._majorIncrement/this._minorIncrement?this._minorTickCount=this._majorIncrement/this._minorIncrement:(this._minorTickCount=DvtDataAxisInfo._MINOR_TICK_COUNT,this._minorIncrement=this._majorIncrement/this._minorTickCount)};
DvtDataAxisInfo.prototype._calcAxisExtents=function(a,b){var d=b;"on"==this.Options.scaledFromBaseline&&(a=Math.min(0,a),b=Math.max(0,b));var e=this._calcAxisScale(null!==this._minValue&&!isNaN(this._minValue)?this._minValue:a,null!==this._maxValue&&!isNaN(this._maxValue)?this._maxValue:b);if(null==this._maxValue&&null==this._minValue){for(this._minValue=Math.floor(a/e)*e;this._minValue>a;)this._minValue-=e;for(this._maxValue=this._minValue;this._maxValue<=d||0>this._maxValue;)this._maxValue+=e}else if(null==
this._minValue)for(this._minValue=this._maxValue;this._minValue>a;)this._minValue-=e;else if(null==this._maxValue)for(this._maxValue=this._minValue;this._maxValue<=d||0>this._maxValue;)this._maxValue+=e;isNaN(this._maxValue)&&isNaN(this._minValue)&&(this._maxValue=100,this._minValue=0,e=(this._maxValue-this._minValue)/DvtDataAxisInfo._MAX_NUMBER_OF_GRIDS_AUTO);this._calcMajorMinorIncr(e)};
DvtDataAxisInfo.prototype._calcAxisScale=function(a,b){var d=b-a,e=Math.log(d)/Math.log(10),g=0,g=0==e-Math.round(e)?Math.pow(10,e-2):Math.pow(10,Math.floor(e)-1),h=Math.round(d/g),e=1;10<=h&&14>=h?e=2:15<=h&&19>=h?e=3:20<=h&&24>=h?e=4:25<=h&&45>=h?e=5:46<=h&&80>=h?e=10:81<=h&&99>=h?e=15:100==h?e=20:100<h&&(e=0<g?Math.round(d/DvtDataAxisInfo._MAX_NUMBER_OF_GRIDS_AUTO/g):Math.round(d/DvtDataAxisInfo._MAX_NUMBER_OF_GRIDS_AUTO/64));d=(this.EndCoord-this.StartCoord)/100;if(1>d){for(d=e/d;20<=d;)d/=10,
g*=10;e=20>d&&10<d?20:5<d?10:4<d?5:2<d?4:2}return e*g};DvtDataAxisInfo.prototype.getMajorTickCount=function(){return this._majorTickCount};DvtDataAxisInfo.prototype.setMajorTickCount=function(a){this._majorTickCount=a;this._majorIncrement=(this._maxValue-this._minValue)/this._majorTickCount};DvtDataAxisInfo.prototype.getMinorTickCount=function(){return this._minorTickCount};DvtDataAxisInfo.prototype.setMinorTickCount=function(a){this._minorTickCount=a;this._minorIncrement=this._majorIncrement/this._minorTickCount};
DvtDataAxisInfo.prototype.getMajorIncrement=function(){return this._majorIncrement};DvtDataAxisInfo.prototype.getMinorIncrement=function(){return this._minorIncrement};var DvtGroupAxisInfo=function(a,b,d){this.Init(a,b,d)};DvtObj.createSubclass(DvtGroupAxisInfo,DvtAxisInfo,"DvtGroupAxisInfo");
DvtGroupAxisInfo.prototype.Init=function(a,b,d){DvtGroupAxisInfo.superclass.Init.call(this,a,b,d);if(("top"==this.Position||"bottom"==this.Position)&&DvtStyleUtils.isLocaleR2L())d=this.StartCoord,this.StartCoord=this.EndCoord,this.EndCoord=d;this._groups=a.groups;a=0<b.endGroupOffset?Number(b.endGroupOffset):0;this._startOffset=0<b.startGroupOffset?Number(b.startGroupOffset):0;this._incr=(this.EndCoord-this.StartCoord)/(this._startOffset+a+this._groups.length-1);this._isLabelRotated=!1};
DvtGroupAxisInfo.prototype._rotateLabels=function(a){var b,d,e=DvtStyleUtils.isLocaleR2L();this._isLabelRotated=!0;for(var g=0;g<a.length;g++)b=a[g],d=b.getX(),b.setX(0),b.setY(0),e?b.setRotation(Math.PI/2):b.setRotation(3*Math.PI/2),b.setTranslateX(d)};DvtGroupAxisInfo.prototype.isLabelRotated=function(){return this._isLabelRotated};
DvtGroupAxisInfo.prototype.getLabels=function(a,b){if(b&&0<b)return null;for(var d=[],e=[],g=a.getStage(),e=this._groups.length,h=0;h<e;h++){var k=this._groups[h];k&&k.name&&(k=k.name);var m=this.getCoordAt(h),k=this.CreateLabel(a,k,m);d.push(k)}e=this.GetLabelDims(d,g);if(("top"==this.Position||"bottom"==this.Position)&&"auto"==this.Options.tickLabel.rotation&&this.IsOverlapping(e,0))this._rotateLabels(d),e=this.GetLabelDims(d,g);return this.SkipLabels(d,e)};
DvtGroupAxisInfo.prototype.getAxisLine=function(a){var b=this.Options.axisLine;return b.rendered?(b=new DvtSolidStroke(b.lineColor,1,b.lineWidth),this.CreateGridLine(a,b)):null};DvtGroupAxisInfo.prototype.getGridLines=function(a){var b=[],d,e=this.Options.majorTick,g=new DvtSolidStroke(e.lineColor,1,e.lineWidth);if(!0===e.rendered)for(var e=this._groups.length,h=0;h<e;h++)d=this.getCoordAt(h),d=this.CreateGridLine(a,g,d),b.push(d);return b};
DvtGroupAxisInfo.prototype.getValueAt=function(a){return Math.round((a-this.StartCoord-this._incr*this._startOffset)/this._incr)};DvtGroupAxisInfo.prototype.getCoordAt=function(a){return 0>a?null:this.StartCoord+this._incr*(this._startOffset+a)};DvtGroupAxisInfo.prototype.getBoundedValueAt=function(){return null};DvtGroupAxisInfo.prototype.getBoundedCoordAt=function(){return null};DvtGroupAxisInfo.prototype.getUnboundedCoordAt=function(){return null};
var DvtLinearScaleAxisValueFormatter=function(a,b,d,e,g,h){DvtAbstractAxisValueFormatter.call(this,a);this.Init(b,d,e,g,h)};DvtObj.createSubclass(DvtLinearScaleAxisValueFormatter,DvtAbstractAxisValueFormatter,"DvtLinearScaleAxisValueFormatter");DvtLinearScaleAxisValueFormatter.SCALE_NONE="none";DvtLinearScaleAxisValueFormatter.SCALE_AUTO="auto";DvtLinearScaleAxisValueFormatter.SCALE_THOUSAND="thousand";DvtLinearScaleAxisValueFormatter.SCALE_MILLION="million";
DvtLinearScaleAxisValueFormatter.SCALE_BILLION="billion";DvtLinearScaleAxisValueFormatter.SCALE_TRILLION="trillion";DvtLinearScaleAxisValueFormatter.SCALE_QUADRILLION="quadrillion";DvtLinearScaleAxisValueFormatter.SCALING_FACTOR_DIFFERENCE=3;DvtLinearScaleAxisValueFormatter.prototype.Init=function(a,b,d,e,g){this._scales={};this._scalesOrder=[];this._factorToScaleMapping={};this.InitScales();this.InitFormatter(a,b,d,e,g)};
DvtLinearScaleAxisValueFormatter.prototype.InitScales=function(){var a=function(a,b,g){var h;this.GetBundle()&&g&&(h=this.GetBundle().getRBString(this.GetBundle()[g],null,"DvtChartBundle."+g));g={scaleFactor:b,localizedSuffix:h};this._scales[a]=g;this._scalesOrder.push(g);this._factorToScaleMapping[b]=g},b=DvtLinearScaleAxisValueFormatter.SCALING_FACTOR_DIFFERENCE;a.call(this,DvtLinearScaleAxisValueFormatter.SCALE_NONE,0*b);a.call(this,DvtLinearScaleAxisValueFormatter.SCALE_THOUSAND,1*b,"SCALING_SUFFIX_THOUSAND");
a.call(this,DvtLinearScaleAxisValueFormatter.SCALE_MILLION,2*b,"SCALING_SUFFIX_MILLION");a.call(this,DvtLinearScaleAxisValueFormatter.SCALE_BILLION,3*b,"SCALING_SUFFIX_BILLION");a.call(this,DvtLinearScaleAxisValueFormatter.SCALE_TRILLION,4*b,"SCALING_SUFFIX_TRILLION");a.call(this,DvtLinearScaleAxisValueFormatter.SCALE_QUADRILLION,5*b,"SCALING_SUFFIX_QUADRILLION");this._scalesOrder.sort(function(a,b){return a.scaleFactor<b.scaleFactor?-1:a.scaleFactor>b.scaleFactor?1:0})};
DvtLinearScaleAxisValueFormatter.prototype.InitFormatter=function(a,b,d,e,g){var h=!1,k,m=!1;"off"!==g&&(m=!0);e=this._getScaleFactor(e);"number"!==typeof e&&(h=!0);h&&(e=this._findNearestLEScaleFactor(this._getPowerOfTen(Math.max(Math.abs(a),Math.abs(b)))));!0===m&&(a=this._getPowerOfTen(d),k=e-a,k=0<=k?k:0);this._useAutoPrecision=m;this._scaleFactor=e;this._decimalPlaces=k};
DvtLinearScaleAxisValueFormatter.prototype._findNearestLEScaleFactor=function(a){var b=0;if(a<=this._scalesOrder[0].scaleFactor)b=this._scalesOrder[0].scaleFactor;else if(a>=this._scalesOrder[this._scalesOrder.length-1].scaleFactor)b=this._scalesOrder[this._scalesOrder.length-1].scaleFactor;else for(var d=this._scalesOrder.length-1;0<=d;d--)if(this._scalesOrder[d].scaleFactor<=a){b=this._scalesOrder[d].scaleFactor;break}return b};
DvtLinearScaleAxisValueFormatter.prototype._getScaleFactor=function(a){var b;if(a=this._scales[a])b=a.scaleFactor;return b};DvtLinearScaleAxisValueFormatter.prototype.format=function(a){var b=parseFloat(a);if(isNaN(b))return a;var d;if(0<this._scaleFactor){for(a=0;a<this._scaleFactor;a++)b/=10;d=this._factorToScaleMapping[this._scaleFactor].localizedSuffix}this._useAutoPrecision&&(b=parseFloat((new Number(b)).toFixed(this._decimalPlaces)),b=this._formatFraction(b));"string"===typeof d&&(b+=d);return b};
DvtLinearScaleAxisValueFormatter.prototype._formatFraction=function(a){a=""+a;if(0<this._decimalPlaces){-1==a.indexOf(".")&&(a+=".");for(var b=a.substring(a.indexOf(".")+1).length;b<this._decimalPlaces;)a+="0",b++}return a};DvtLinearScaleAxisValueFormatter.prototype._getPowerOfTen=function(a){var a=0<=a?a:-a,b=0;if(1.0E-15>a)return 0;if(a==Number.POSITIVE_INFINITY)return Number.MAX_VALUE;if(10<=a)for(;10<=a;)b+=1,a/=10;else if(1>a)for(;1>a;)b-=1,a*=10;return b};
var DvtTimeAxisInfo=function(a,b,d){this.Init(a,b,d)};DvtObj.createSubclass(DvtTimeAxisInfo,DvtAxisInfo,"DvtTimeAxisInfo");DvtTimeAxisInfo.TIME_SECOND=1E3;DvtTimeAxisInfo.TIME_MINUTE=60*DvtTimeAxisInfo.TIME_SECOND;DvtTimeAxisInfo.TIME_HOUR=60*DvtTimeAxisInfo.TIME_MINUTE;DvtTimeAxisInfo.TIME_DAY=24*DvtTimeAxisInfo.TIME_HOUR;DvtTimeAxisInfo.TIME_MONTH_MIN=28*DvtTimeAxisInfo.TIME_DAY;DvtTimeAxisInfo.TIME_MONTH=365/12*DvtTimeAxisInfo.TIME_DAY;DvtTimeAxisInfo.TIME_YEAR=365*DvtTimeAxisInfo.TIME_DAY;
DvtTimeAxisInfo.INTERVAL_MILLISECONDS=0;DvtTimeAxisInfo.INTERVAL_SECONDS=1;DvtTimeAxisInfo.INTERVAL_MINUTE=2;DvtTimeAxisInfo.INTERVAL_HOUR=3;DvtTimeAxisInfo.INTERVAL_DAY=4;DvtTimeAxisInfo.INTERVAL_MONTH=5;DvtTimeAxisInfo.INTERVAL_YEAR=6;DvtTimeAxisInfo.AM_INDEX=12;DvtTimeAxisInfo.PM_INDEX=13;DvtTimeAxisInfo.AMPM_BEFORE_INDEX=14;DvtTimeAxisInfo.DMY_ORDER_INDEX=15;DvtTimeAxisInfo.YEAR_TRAILING_CHAR_INDEX=16;DvtTimeAxisInfo.DAY_TRAILING_CHAR_INDEX=17;
DvtTimeAxisInfo.prototype.Init=function(a,b,d){DvtTimeAxisInfo.superclass.Init.call(this,a,b,d);var d=isNaN(b.startGroupOffset)?0:b.startGroupOffset,e=isNaN(b.endGroupOffset)?0:b.endGroupOffset;"top"==this.Position||"bottom"==this.Position?DvtStyleUtils.isLocaleR2L()?(this._minCoord=this.EndCoord-e,this._maxCoord=this.StartCoord+d):(this._minCoord=this.StartCoord+d,this._maxCoord=this.EndCoord-e):(this._minCoord=this.EndCoord-e,this._maxCoord=this.StartCoord+d);this._minValue=a.minDataValue;this._maxValue=
a.maxDataValue;this._converter=null;void 0!==b.tickLabel&&(this._converter=b.tickLabel.converter);this._groups=a.groups;this._numGroups=a.groups.length;this._timeZoneOffset=0;this._timeRange=this._maxValue-this._minValue;this._averageInterval=0<this._numGroups?this._timeRange/(this._numGroups-1):0;this._level2Labels=this._level1Labels=null};DvtTimeAxisInfo.prototype.formatLabel=function(a){a=this._formatAxisLabel(new Date(a+this._timeZoneOffset),null);return null!=a[1]?a[0]+" "+a[1]:a[0]};
DvtTimeAxisInfo.prototype._formatAxisLabel=function(a,b){var d=null,e=null;if(this._converter&&this._converter.getAsString&&this._converter.getAsObject)d=this._converter.getAsString(a);else if(this._averageInterval>=DvtTimeAxisInfo.TIME_YEAR)d=this._formatDate(a,!1,!1,!0);else if(this._timeRange>=DvtTimeAxisInfo.TIME_YEAR||this._averageInterval>=DvtTimeAxisInfo.TIME_MONTH_MIN){if(null==b||b.getMonth()!=a.getMonth())d=this._formatDate(a,!1,!0,!1);if(null==b||b.getYear()!=a.getYear())e=this._formatDate(a,
!1,!1,!0)}else if(this._timeRange>=DvtTimeAxisInfo.TIME_MONTH_MIN||this._averageInterval>=DvtTimeAxisInfo.TIME_DAY){if(null==b||b.getDate()!=a.getDate())d=this._formatDate(a,!0,!1,!1);null==b||b.getYear()!=a.getYear()?e=this._formatDate(a,!1,!0,!0):b.getMonth()!=a.getMonth()&&(e=this._formatDate(a,!1,!0,!1))}else{if(this._timeRange>=DvtTimeAxisInfo.TIME_HOUR||this._averageInterval>=DvtTimeAxisInfo.TIME_MINUTE){if(null==b||b.getHours()!=a.getHours()||b.getMinutes()!=a.getMinutes())d=this._formatTime(a,
!1)}else if(null==b||b.getSeconds()!=a.getSeconds())d=this._formatTime(a,!0);null==b||b.getMonth()!=a.getMonth()?e=this._formatDate(a,!0,!0,!1):b.getDate()!=a.getDate()&&(e="left"==this.Position||"right"==this.Position?this._formatDate(a,!0,!0,!1):this._formatDate(a,!0,!1,!1))}return[d,e]};
DvtTimeAxisInfo.prototype._formatDate=function(a,b,d,e){var g=a.getFullYear(),h;h=this._timeAxisResources&&12<=this._timeAxisResources.length?this._timeAxisResources[a.getMonth()]:a.toString().split(" ")[1];a=a.getDate();if(this._timeAxisResources&&this._timeAxisResources.length>DvtTimeAxisInfo.DAY_TRAILING_CHAR_INDEX)var k=this._timeAxisResources[DvtTimeAxisInfo.DAY_TRAILING_CHAR_INDEX],g=g+this._timeAxisResources[DvtTimeAxisInfo.YEAR_TRAILING_CHAR_INDEX],a=a+k;k="DMY";this._timeAxisResources&&this._timeAxisResources.length>
DvtTimeAxisInfo.DMY_ORDER_INDEX&&(k=this._timeAxisResources[DvtTimeAxisInfo.DMY_ORDER_INDEX]);for(var m="",n=0;n<k.length;n++)b&&"D"==k[n]?m+=a+" ":d&&"M"==k[n]?m+=h+" ":e&&"Y"==k[n]&&(m+=g+" ");return 0<m.length?m.slice(0,m.length-1):m};
DvtTimeAxisInfo.prototype._formatTime=function(a,b){var d=a.getHours(),e=a.getMinutes(),g=a.getSeconds(),h="",k="",m=!1;null!=this._timeAxisResources&&this._timeAxisResources>DvtTimeAxisInfo.AMPM_BEFORE_INDEX&&(h=this._timeAxisResources[DvtTimeAxis.AM_INDEX],k=this._timeAxisResources[DvtTimeAxis.PM_INDEX],m="t"==this._timeAxisResources[DvtTimeAxisInfo.AMPM_BEFORE_INDEX]);var n=""!=h&&""!=k,o;n&&(o=k,12<d?(d-=12,o=k):0==d?(o=h,d=12):12>d&&(o=h));d=this._doubleDigit(d)+":"+this._doubleDigit(e);b&&(d+=
":"+this._doubleDigit(g));return n?m?o+" "+d:d+" "+o:d};DvtTimeAxisInfo.prototype._doubleDigit=function(a){return 10>a?"0"+a:""+a};
DvtTimeAxisInfo.prototype._generateLabels=function(a){for(var b=[],d=[],e=null,g=0,h=0,k=a.getStage(),g=DvtStyleUtils.isLocaleR2L(),m="left"==this.Position||"right"==this.Position,h=0;h<this._numGroups;h++){var n=this._groups[h];isNaN(n)&&(n=this._minValue+h*this._averageInterval);var o=new Date(n+this._timeZoneOffset),n=this.getCoordAt(n),e=this._formatAxisLabel(o,e),q=e[0];null!=q?b.push(this.CreateLabel(a,q,n)):b.push(null);e=e[1];null!=e?(e=this.CreateLabel(a,e,n),m||(g?e.alignEnd():e.alignStart()),
d.push(e)):d.push(null);e=o}g=this._skipLabelsGreedy(b,this.GetLabelDims(b,k));h=this._skipLabelsGreedy(d,this.GetLabelDims(d,k));g<=1.5*h?(b=d,d=null):2>h&&(d=null);m&&null!=d&&this._skipVertLabels(b,d,k);this._level1Labels=b;this._level2Labels=d};DvtTimeAxisInfo._isOverlapping=function(a,b,d,e,g){return d>=a&&d-g<b||d<a&&e+g>a?!0:!1};
DvtTimeAxisInfo.prototype._skipLabelsGreedy=function(a,b){if(!b||0>=b.length)return!1;var d="left"==this.Position||"right"==this.Position,e=d?this.Options.layout.verticalAxisGap:this.Options.layout.horizontalAxisGap,g=0,h,k,m,n;if(null==b[0])return g;d?(h=b[0].y,k=b[0].y+b[0].h):(h=b[0].x,k=b[0].x+b[0].w);g++;for(var o=1;o<b.length;o++)null!=b[o]&&(d?(m=b[o].y,n=b[o].y+b[o].h):(m=b[o].x,n=b[o].x+b[o].w),DvtTimeAxisInfo._isOverlapping(h,k,m,n,e)&&(a[o]=null),null!=a[o]&&(h=m+e,k=n-e,g++));return g};
DvtTimeAxisInfo.prototype._skipVertLabels=function(a,b,d){for(var e=function(a){d.addChild(a);var b=a.getDimensions(d);d.removeChild(a);return b},g=this.Options.layout.verticalAxisGap,h=function(a,b){return DvtTimeAxisInfo._isOverlapping(a.y,a.y+a.h,b.y,b.y+b.h,g)},k=null,m=!1,n=0;n<a.length;n++)if(a[n]&&b[n])if(a[n].alignBottom(),b[n].alignTop(),k&&h(k,e(a[n]))){m=!0;break}else k=e(b[n]);else if(a[n]||b[n]){var o=a[n]?a[n]:b[n];if(k&&h(k,e(o))){m=!0;break}else k=e(o)}if(m)for(var o=m=k=null,q,n=
0;n<a.length;n++)b[n]?(a[n]=null,b[n].alignCenter(),q=e(b[n]),m&&h(m,q)&&(a[k]=null),o=q):a[n]&&(q=e(a[n]),o&&h(o,q)?a[n]=null:(m=q,k=n))};DvtTimeAxisInfo.prototype.getLabels=function(a,b){if(b&&1<b)return null;this._level1Labels||this._generateLabels(a);return 1==b?this._level2Labels:this._level1Labels};DvtTimeAxisInfo.prototype.getAxisLine=function(a){var b=this.Options.axisLine;return b.rendered?(b=new DvtSolidStroke(b.lineColor,1,b.lineWidth),this.CreateGridLine(a,b,10)):null};
DvtTimeAxisInfo.prototype.getGridLines=function(a){var b=[],d,e=this.Options.majorTick,g=new DvtSolidStroke(e.lineColor,1,e.lineWidth);if(!0===e.rendered)for(e=0;e<this._numGroups;e++)d=this.getCoordAt(e),d=this.CreateGridLine(a,g,d),b.push(d);return b};DvtTimeAxisInfo.prototype.getValueAt=function(a){return a<this._minCoord||a>this._maxCoord?null:this._minValue+(a-this._minCoord)/(this._maxCoord-this._minCoord)*(this._maxValue-this._minValue)};
DvtTimeAxisInfo.prototype.getCoordAt=function(a){return a<this._minValue||a>this._maxValue?null:this.getUnboundedCoordAt(a)};DvtTimeAxisInfo.prototype.getBoundedValueAt=function(a){a<this._minCoord?a=this._minCoord:a>this._maxCoord&&(a=this._maxCoord);return this.getValueAt(a)};DvtTimeAxisInfo.prototype.getBoundedCoordAt=function(a){a<this._minValue?a=this._minValue:a>this._maxValue&&(a=this._maxValue);return this.getUnboundedCoordAt(a)};
DvtTimeAxisInfo.prototype.getUnboundedCoordAt=function(a){return this._minCoord+(a-this._minValue)/(this._maxValue-this._minValue)*(this._maxCoord-this._minCoord)};DvtTimeAxisInfo.prototype.getGroupWidth=function(){return Math.abs(this.getCoordAt(this._minValue+this._averageInterval)-this.getCoordAt(this._minValue))};