Your IP : 18.189.157.91


Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/main/amcharts/3.3/
Upload File :
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/main/amcharts/3.3/serial.min.js

AmCharts.AmSerialChart=AmCharts.Class({inherits:AmCharts.AmRectangularChart,construct:function(t){this.className="AmSerialChart";this.chartType="serial";AmCharts.AmSerialChart.base.construct.call(this,t);this.theme=t;this.createEvents("changed");this.columnSpacing=5;this.columnSpacing3D=0;this.columnWidth=.8;this.updateScrollbar=!0;var e=new AmCharts.CategoryAxis(t);e.chart=this;this.categoryAxis=e;this.zoomOutOnDataUpdate=!0;this.mouseWheelScrollEnabled=this.rotate=this.skipZoom=!1;this.minSelectedTime=0;AmCharts.applyTheme(this,t,"AmSerialChart")},initChart:function(){AmCharts.AmSerialChart.base.initChart.call(this);this.updateCategoryAxis(this.categoryAxis,this.rotate,"categoryAxis");this.dataChanged&&(this.updateData(),this.dataChanged=!1,this.dispatchDataUpdated=!0);var t=this.chartCursor;t&&t.updateData();var t=this.countColumns(),e=this.graphs,i;for(i=0;i<e.length;i++)e[i].columnCount=t;this.updateScrollbar=!0;this.drawChart();this.autoMargins&&!this.marginsUpdated&&(this.marginsUpdated=!0,this.measureMargins());this.mouseWheelScrollEnabled&&this.addMouseWheel()},validateData:function(t){this.marginsUpdated=!1;this.zoomOutOnDataUpdate&&!t&&(this.endTime=this.end=this.startTime=this.start=NaN);AmCharts.AmSerialChart.base.validateData.call(this)},drawChart:function(){AmCharts.AmSerialChart.base.drawChart.call(this);var t=this.chartData;if(AmCharts.ifArray(t)){var e=this.chartScrollbar;e&&e.draw();if(0<this.realWidth&&0<this.realHeight){var t=t.length-1,i,e=this.categoryAxis;if(e.parseDates&&!e.equalSpacing){if(e=this.startTime,i=this.endTime,isNaN(e)||isNaN(i))e=this.firstTime,i=this.lastTime}else if(e=this.start,i=this.end,isNaN(e)||isNaN(i))e=0,i=t;this.endTime=this.startTime=this.end=this.start=void 0;this.zoom(e,i)}}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},cleanChart:function(){AmCharts.callMethod("destroy",[this.valueAxes,this.graphs,this.categoryAxis,this.chartScrollbar,this.chartCursor])},updateCategoryAxis:function(t,e,i){t.chart=this;t.id=i;t.rotate=e;t.axisRenderer=AmCharts.RecAxis;t.guideFillRenderer=AmCharts.RecFill;t.axisItemRenderer=AmCharts.RecItem;t.setOrientation(!this.rotate);t.x=this.marginLeftReal;t.y=this.marginTopReal;t.dx=this.dx;t.dy=this.dy;t.width=this.plotAreaWidth-1;t.height=this.plotAreaHeight-1;t.viW=this.plotAreaWidth-1;t.viH=this.plotAreaHeight-1;t.viX=this.marginLeftReal;t.viY=this.marginTopReal;t.marginsChanged=!0},updateValueAxes:function(){AmCharts.AmSerialChart.base.updateValueAxes.call(this);var t=this.valueAxes,e;for(e=0;e<t.length;e++){var i=t[e],s=this.rotate;i.rotate=s;i.setOrientation(s);s=this.categoryAxis;if(!s.startOnAxis||s.parseDates)i.expandMinMax=!0}},updateData:function(){this.parseData();var t=this.graphs,e,i=this.chartData;for(e=0;e<t.length;e++)t[e].data=i;0<i.length&&(this.firstTime=this.getStartTime(i[0].time),this.lastTime=this.getEndTime(i[i.length-1].time))},getStartTime:function(t){var e=this.categoryAxis;return AmCharts.resetDateToMin(new Date(t),e.minPeriod,1,e.firstDayOfWeek).getTime()},getEndTime:function(t){var e=AmCharts.extractPeriod(this.categoryAxis.minPeriod);return AmCharts.changeDate(new Date(t),e.period,e.count,!0).getTime()-1},updateMargins:function(){AmCharts.AmSerialChart.base.updateMargins.call(this);var t=this.chartScrollbar;t&&(this.getScrollbarPosition(t,this.rotate,this.categoryAxis.position),this.adjustMargins(t,this.rotate))},updateScrollbars:function(){AmCharts.AmSerialChart.base.updateScrollbars.call(this);this.updateChartScrollbar(this.chartScrollbar,this.rotate)},zoom:function(t,e){var i=this.categoryAxis;i.parseDates&&!i.equalSpacing?this.timeZoom(t,e):this.indexZoom(t,e);this.updateLegendValues()},timeZoom:function(t,e){var i=this.maxSelectedTime;isNaN(i)||(e!=this.endTime&&e-t>i&&(t=e-i,this.updateScrollbar=!0),t!=this.startTime&&e-t>i&&(e=t+i,this.updateScrollbar=!0));var s=this.minSelectedTime;if(0<s&&e-t<s){var a=Math.round(t+(e-t)/2),s=Math.round(s/2);t=a-s;e=a+s}var h=this.chartData,a=this.categoryAxis;if(AmCharts.ifArray(h)&&(t!=this.startTime||e!=this.endTime)){var r=a.minDuration(),s=this.firstTime,o=this.lastTime;t||(t=s,isNaN(i)||(t=o-i));e||(e=o);t>o&&(t=o);e<s&&(e=s);t<s&&(t=s);e>o&&(e=o);e<t&&(e=t+r);e-t<r/5&&(e<o?e=t+r/5:t=e-r/5);this.startTime=t;this.endTime=e;i=h.length-1;r=this.getClosestIndex(h,"time",t,!0,0,i);h=this.getClosestIndex(h,"time",e,!1,r,i);a.timeZoom(t,e);a.zoom(r,h);this.start=AmCharts.fitToBounds(r,0,i);this.end=AmCharts.fitToBounds(h,0,i);this.zoomAxesAndGraphs();this.zoomScrollbar();t!=s||e!=o?this.showZB(!0):this.showZB(!1);this.updateColumnsDepth();this.dispatchTimeZoomEvent()}},indexZoom:function(t,e){var i=this.maxSelectedSeries;isNaN(i)||(e!=this.end&&e-t>i&&(t=e-i,this.updateScrollbar=!0),t!=this.start&&e-t>i&&(e=t+i,this.updateScrollbar=!0));if(t!=this.start||e!=this.end){var s=this.chartData.length-1;isNaN(t)&&(t=0,isNaN(i)||(t=s-i));isNaN(e)&&(e=s);e<t&&(e=t);e>s&&(e=s);t>s&&(t=s-1);0>t&&(t=0);this.start=t;this.end=e;this.categoryAxis.zoom(t,e);this.zoomAxesAndGraphs();this.zoomScrollbar();0!==t||e!=this.chartData.length-1?this.showZB(!0):this.showZB(!1);this.updateColumnsDepth();this.dispatchIndexZoomEvent()}},updateGraphs:function(){AmCharts.AmSerialChart.base.updateGraphs.call(this);var t=this.graphs,e;for(e=0;e<t.length;e++){var i=t[e];i.columnWidthReal=this.columnWidth;i.categoryAxis=this.categoryAxis}},updateColumnsDepth:function(){var t,e=this.graphs,i;AmCharts.remove(this.columnsSet);this.columnsArray=[];for(t=0;t<e.length;t++){i=e[t];var s=i.columnsArray;if(s){var a;for(a=0;a<s.length;a++)this.columnsArray.push(s[a])}}this.columnsArray.sort(this.compareDepth);if(0<this.columnsArray.length){e=this.container.set();this.columnSet.push(e);for(t=0;t<this.columnsArray.length;t++)e.push(this.columnsArray[t].column.set);i&&e.translate(i.x,i.y);this.columnsSet=e}},compareDepth:function(t,e){return t.depth>e.depth?1:-1},zoomScrollbar:function(){var t=this.chartScrollbar,e=this.categoryAxis;t&&this.updateScrollbar&&(e.parseDates&&!e.equalSpacing?t.timeZoom(this.startTime,this.endTime):t.zoom(this.start,this.end),this.updateScrollbar=!0)},updateTrendLines:function(){var t=this.trendLines,e;for(e=0;e<t.length;e++){var i=t[e],i=AmCharts.processObject(i,AmCharts.TrendLine,this.theme);t[e]=i;i.chart=this;AmCharts.isString(i.valueAxis)&&(i.valueAxis=this.getValueAxisById(i.valueAxis));i.valueAxis||(i.valueAxis=this.valueAxes[0]);i.categoryAxis=this.categoryAxis}},zoomAxesAndGraphs:function(){if(!this.scrollbarOnly){var t=this.valueAxes,e;for(e=0;e<t.length;e++)t[e].zoom(this.start,this.end);t=this.graphs;for(e=0;e<t.length;e++)t[e].zoom(this.start,this.end);this.zoomTrendLines();(e=this.chartCursor)&&e.zoom(this.start,this.end,this.startTime,this.endTime)}},countColumns:function(){var t=0,e=this.valueAxes.length,i=this.graphs.length,s,a,h=!1,r,o;for(o=0;o<e;o++){a=this.valueAxes[o];var n=a.stackType;if("100%"==n||"regular"==n)for(h=!1,r=0;r<i;r++)s=this.graphs[r],s.hidden||s.valueAxis!=a||"column"!=s.type||(!h&&s.stackable&&(t++,h=!0),!s.stackable&&s.clustered&&t++,s.columnIndex=t-1,s.clustered||(s.columnIndex=0));if("none"==n||"3d"==n)for(r=0;r<i;r++)s=this.graphs[r],!s.hidden&&s.valueAxis==a&&"column"==s.type&&s.clustered&&(s.columnIndex=t,t++);if("3d"==n){for(o=0;o<i;o++)s=this.graphs[o],s.depthCount=t;t=1}}return t},parseData:function(){AmCharts.AmSerialChart.base.parseData.call(this);this.parseSerialData()},getCategoryIndexByValue:function(t){var e=this.chartData,i,s;for(s=0;s<e.length;s++)e[s].category==t&&(i=s);return i},handleCursorChange:function(t){this.updateLegendValues(t.index)},handleCursorZoom:function(t){this.updateScrollbar=!0;this.zoom(t.start,t.end)},handleScrollbarZoom:function(t){this.updateScrollbar=!1;this.zoom(t.start,t.end)},dispatchTimeZoomEvent:function(){if(this.prevStartTime!=this.startTime||this.prevEndTime!=this.endTime){var t={type:"zoomed"};t.startDate=new Date(this.startTime);t.endDate=new Date(this.endTime);t.startIndex=this.start;t.endIndex=this.end;this.startIndex=this.start;this.endIndex=this.end;this.startDate=t.startDate;this.endDate=t.endDate;this.prevStartTime=this.startTime;this.prevEndTime=this.endTime;var e=this.categoryAxis,i=AmCharts.extractPeriod(e.minPeriod).period,e=e.dateFormatsObject[i];t.startValue=AmCharts.formatDate(t.startDate,e);t.endValue=AmCharts.formatDate(t.endDate,e);t.chart=this;t.target=this;this.fire(t.type,t)}},dispatchIndexZoomEvent:function(){if(this.prevStartIndex!=this.start||this.prevEndIndex!=this.end){this.startIndex=this.start;this.endIndex=this.end;var t=this.chartData;if(AmCharts.ifArray(t)&&!isNaN(this.start)&&!isNaN(this.end)){var e={chart:this,target:this,type:"zoomed"};e.startIndex=this.start;e.endIndex=this.end;e.startValue=t[this.start].category;e.endValue=t[this.end].category;this.categoryAxis.parseDates&&(this.startTime=t[this.start].time,this.endTime=t[this.end].time,e.startDate=new Date(this.startTime),e.endDate=new Date(this.endTime));this.prevStartIndex=this.start;this.prevEndIndex=this.end;this.fire(e.type,e)}}},updateLegendValues:function(t){var e=this.graphs,i;for(i=0;i<e.length;i++){var s=e[i];isNaN(t)?s.currentDataItem=void 0:s.currentDataItem=this.chartData[t].axes[s.valueAxis.id].graphs[s.id]}this.legend&&this.legend.updateValues()},getClosestIndex:function(t,e,i,s,a,h){0>a&&(a=0);h>t.length-1&&(h=t.length-1);var r=a+Math.round((h-a)/2),o=t[r][e];if(1>=h-a){if(s)return a;s=t[h][e];return Math.abs(t[a][e]-i)<Math.abs(s-i)?a:h}return i==o?r:i<o?this.getClosestIndex(t,e,i,s,a,r):this.getClosestIndex(t,e,i,s,r,h)},zoomToIndexes:function(t,e){this.updateScrollbar=!0;var i=this.chartData;if(i){var s=i.length;0<s&&(0>t&&(t=0),e>s-1&&(e=s-1),s=this.categoryAxis,s.parseDates&&!s.equalSpacing?this.zoom(i[t].time,this.getEndTime(i[e].time)):this.zoom(t,e))}},zoomToDates:function(t,e){this.updateScrollbar=!0;var i=this.chartData;if(this.categoryAxis.equalSpacing){var s=this.getClosestIndex(i,"time",t.getTime(),!0,0,i.length),i=this.getClosestIndex(i,"time",e.getTime(),!1,0,i.length);this.zoom(s,i)}else this.zoom(t.getTime(),e.getTime())},zoomToCategoryValues:function(t,e){this.updateScrollbar=!0;this.zoom(this.getCategoryIndexByValue(t),this.getCategoryIndexByValue(e))},formatPeriodString:function(t,e){if(e){var i=["value","open","low","high","close"],s="value open low high close average sum count".split(" "),a=e.valueAxis,h=this.chartData,r=e.numberFormatter;r||(r=this.numberFormatter);for(var o=0;o<i.length;o++){for(var n=i[o],d=0,l=0,m,c,u,g,p,f=0,A=0,C,x,D,v,T,b=this.start;b<=this.end;b++){var y=h[b];if(y&&(y=y.axes[a.id].graphs[e.id])){if(y.values){var S=y.values[n];if(!isNaN(S)){isNaN(m)&&(m=S);c=S;if(isNaN(u)||u>S)u=S;if(isNaN(g)||g<S)g=S;d+=S;l++;p=d/l}}if(y.percents&&(y=y.percents[n],!isNaN(y))){isNaN(C)&&(C=y);x=y;if(isNaN(D)||D>y)D=y;if(isNaN(v)||v<y)v=y;f+=y;A++;T=f/A}}}f={open:C,close:x,high:v,low:D,average:T,sum:f,count:A};t=AmCharts.formatValue(t,{open:m,close:c,high:g,low:u,average:p,sum:d,count:l},s,r,n+"\\.",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);t=AmCharts.formatValue(t,f,s,this.percentFormatter,"percents\\."+n+"\\.")}}return t},formatString:function(t,e){var i=e.graph;if(-1!=t.indexOf("[[category]]")){var s=e.serialDataItem.category;if(this.categoryAxis.parseDates){var a=this.balloonDateFormat,h=this.chartCursor;h&&(a=h.categoryBalloonDateFormat);-1!=t.indexOf("[[category]]")&&(a=AmCharts.formatDate(s,a),-1!=a.indexOf("fff")&&(a=AmCharts.formatMilliseconds(a,s)),s=a)}t=t.replace(/\[\[category\]\]/g,String(s))}i=i.numberFormatter;i||(i=this.numberFormatter);s=e.graph.valueAxis;(a=s.duration)&&!isNaN(e.values.value)&&(s=AmCharts.formatDuration(e.values.value,a,"",s.durationUnits,s.maxInterval,i),t=t.replace(RegExp("\\[\\[value\\]\\]","g"),s));s="value open low high close total".split(" ");a=this.percentFormatter;t=AmCharts.formatValue(t,e.percents,s,a,"percents\\.");t=AmCharts.formatValue(t,e.values,s,i,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);t=AmCharts.formatValue(t,e.values,["percents"],a);-1!=t.indexOf("[[")&&(t=AmCharts.formatDataContextValue(t,e.dataContext));return t=AmCharts.AmSerialChart.base.formatString.call(this,t,e)},addChartScrollbar:function(t){AmCharts.callMethod("destroy",[this.chartScrollbar]);t&&(t.chart=this,this.listenTo(t,"zoomed",this.handleScrollbarZoom));this.rotate?void 0===t.width&&(t.width=t.scrollbarHeight):void 0===t.height&&(t.height=t.scrollbarHeight);this.chartScrollbar=t},removeChartScrollbar:function(){AmCharts.callMethod("destroy",[this.chartScrollbar]);this.chartScrollbar=null},handleReleaseOutside:function(t){AmCharts.AmSerialChart.base.handleReleaseOutside.call(this,t);AmCharts.callMethod("handleReleaseOutside",[this.chartScrollbar])}});AmCharts.Cuboid=AmCharts.Class({construct:function(t,e,i,s,a,h,r,o,n,d,l,m,c,u,g){this.set=t.set();this.container=t;this.h=Math.round(i);this.w=Math.round(e);this.dx=s;this.dy=a;this.colors=h;this.alpha=r;this.bwidth=o;this.bcolor=n;this.balpha=d;this.colors=h;this.dashLength=u;this.pattern=g;c?0>e&&0===l&&(l=180):0>i&&270==l&&(l=90);this.gradientRotation=l;0===s&&0===a&&(this.cornerRadius=m);this.draw()},draw:function(){var t=this.set;t.clear();var e=this.container,i=this.w,s=this.h,a=this.dx,h=this.dy,r=this.colors,o=this.alpha,n=this.bwidth,d=this.bcolor,l=this.balpha,m=this.gradientRotation,c=this.cornerRadius,u=this.dashLength,g=this.pattern,p=r,f=r;"object"==typeof r&&(p=r[0],f=r[r.length-1]);var A,C,x,D,v,T,b,y,S;if(0<a||0<h)b=f,f=AmCharts.adjustLuminosity(p,-.2),f=AmCharts.adjustLuminosity(p,-.2),A=AmCharts.polygon(e,[0,a,i+a,i,0],[0,h,h,0,0],f,o,1,d,0,m),0<l&&(S=AmCharts.line(e,[0,a,i+a],[0,h,h],d,l,n,u)),C=AmCharts.polygon(e,[0,0,i,i,0],[0,s,s,0,0],f,o,1,d,0,m),C.translate(a,h),0<l&&(x=AmCharts.line(e,[a,a],[h,h+s],d,1,n,u)),D=AmCharts.polygon(e,[0,0,a,a,0],[0,s,s+h,h,0],f,o,1,d,0,m),v=AmCharts.polygon(e,[i,i,i+a,i+a,i],[0,s,s+h,h,0],f,o,1,d,0,m),0<l&&(T=AmCharts.line(e,[i,i+a,i+a,i],[0,h,s+h,s],d,l,n,u)),f=AmCharts.adjustLuminosity(b,.2),b=AmCharts.polygon(e,[0,a,i+a,i,0],[s,s+h,s+h,s,s],f,o,1,d,0,m),0<l&&(y=AmCharts.line(e,[0,a,i+a],[s,s+h,s+h],d,l,n,u));1>Math.abs(s)&&(s=0);1>Math.abs(i)&&(i=0);e=0===s?AmCharts.line(e,[0,i],[0,0],d,l,n,u):0===i?AmCharts.line(e,[0,0],[0,s],d,l,n,u):0<c?AmCharts.rect(e,i,s,r,o,n,d,l,c,m,u):AmCharts.polygon(e,[0,0,i,i,0],[0,s,s,0,0],r,o,n,d,l,m,!1,u);s=0>s?[A,S,C,x,D,v,T,b,y,e]:[b,y,C,x,D,v,A,S,T,e];for(A=0;A<s.length;A++)(C=s[A])&&t.push(C);g&&e.pattern(g)},width:function(t){this.w=t;this.draw()},height:function(t){this.h=t;this.draw()},animateHeight:function(t,e){var i=this;i.easing=e;i.totalFrames=1e3*t/AmCharts.updateRate;i.rh=i.h;i.frame=0;i.height(1);setTimeout(function(){i.updateHeight.call(i)},AmCharts.updateRate)},updateHeight:function(){var t=this;t.frame++;var e=t.totalFrames;t.frame<=e&&(e=t.easing(0,t.frame,1,t.rh-1,e),t.height(e),setTimeout(function(){t.updateHeight.call(t)},AmCharts.updateRate))},animateWidth:function(t,e){var i=this;i.easing=e;i.totalFrames=1e3*t/AmCharts.updateRate;i.rw=i.w;i.frame=0;i.width(1);setTimeout(function(){i.updateWidth.call(i)},AmCharts.updateRate)},updateWidth:function(){var t=this;t.frame++;var e=t.totalFrames;t.frame<=e&&(e=t.easing(0,t.frame,1,t.rw-1,e),t.width(e),setTimeout(function(){t.updateWidth.call(t)},AmCharts.updateRate))}});AmCharts.CategoryAxis=AmCharts.Class({inherits:AmCharts.AxisBase,construct:function(t){AmCharts.CategoryAxis.base.construct.call(this,t);this.minPeriod="DD";this.equalSpacing=this.parseDates=!1;this.position="bottom";this.startOnAxis=!1;this.firstDayOfWeek=1;this.gridPosition="middle";this.markPeriodChange=this.boldPeriodBeginning=!0;this.safeDistance=30;this.centerLabelOnFullPeriod=!0;this.periods=[{period:"ss",count:1},{period:"ss",count:5},{period:"ss",count:10},{period:"ss",count:30},{period:"mm",count:1},{period:"mm",count:5},{period:"mm",count:10},{period:"mm",count:30},{period:"hh",count:1},{period:"hh",count:3},{period:"hh",count:6},{period:"hh",count:12},{period:"DD",count:1},{period:"DD",count:2},{period:"DD",count:3},{period:"DD",count:4},{period:"DD",count:5},{period:"WW",count:1},{period:"MM",count:1},{period:"MM",count:2},{period:"MM",count:3},{period:"MM",count:6},{period:"YYYY",count:1},{period:"YYYY",count:2},{period:"YYYY",count:5},{period:"YYYY",count:10},{period:"YYYY",count:50},{period:"YYYY",count:100}];this.dateFormats=[{period:"fff",format:"JJ:NN:SS"},{period:"ss",format:"JJ:NN:SS"},{period:"mm",format:"JJ:NN"},{period:"hh",format:"JJ:NN"},{period:"DD",format:"MMM DD"},{period:"WW",format:"MMM DD"},{period:"MM",format:"MMM"},{period:"YYYY",format:"YYYY"}];this.nextPeriod={};this.nextPeriod.fff="ss";this.nextPeriod.ss="mm";this.nextPeriod.mm="hh";this.nextPeriod.hh="DD";this.nextPeriod.DD="MM";this.nextPeriod.MM="YYYY";AmCharts.applyTheme(this,t,"CategoryAxis")},draw:function(){AmCharts.CategoryAxis.base.draw.call(this);this.generateDFObject();var t=this.chart.chartData;this.data=t;if(AmCharts.ifArray(t)){var e,i=this.chart,s=this.start,a=this.labelFrequency,h=0;e=this.end-s+1;var r=this.gridCount,o=this.showFirstLabel,n=this.showLastLabel,d,l="",m=AmCharts.extractPeriod(this.minPeriod);d=AmCharts.getPeriodDuration(m.period,m.count);var c,u,g,p,f;c=this.rotate;var A=this.firstDayOfWeek,C=this.boldPeriodBeginning,t=AmCharts.resetDateToMin(new Date(t[t.length-1].time+1.05*d),this.minPeriod,1,A).getTime(),x;this.endTime>t&&(this.endTime=t);x=this.minorGridEnabled;var D,t=this.gridAlpha,v;if(this.parseDates&&!this.equalSpacing){this.timeDifference=this.endTime-this.startTime;s=this.choosePeriod(0);a=s.period;c=s.count;u=AmCharts.getPeriodDuration(a,c);u<d&&(a=m.period,c=m.count,u=d);g=a;"WW"==g&&(g="DD");this.stepWidth=this.getStepWidth(this.timeDifference);var r=Math.ceil(this.timeDifference/u)+5,T=l=AmCharts.resetDateToMin(new Date(this.startTime-u),a,c,A).getTime();g==a&&1==c&&this.centerLabelOnFullPeriod&&(p=u*this.stepWidth);this.cellWidth=d*this.stepWidth;e=Math.round(l/u);s=-1;e/2==Math.round(e/2)&&(s=-2,l-=u);var b=i.firstTime,y=0;x&&1<c&&(D=this.chooseMinorFrequency(c),v=AmCharts.getPeriodDuration(a,D));if(0<this.gridCount)for(e=s;e<=r;e++){m=b+u*(e+Math.floor((T-b)/u))-y;"DD"==a&&(m+=36e5);m=AmCharts.resetDateToMin(new Date(m),a,c,A).getTime();"MM"==a&&(x=(m-l)/u,1.5<=(m-l)/u&&(m-=(x-1)*u,y+=u));d=(m-this.startTime)*this.stepWidth;f=!1;this.nextPeriod[g]&&(f=this.checkPeriodChange(this.nextPeriod[g],1,m,l));x=!1;f&&this.markPeriodChange?(l=this.dateFormatsObject[this.nextPeriod[g]],x=!0):l=this.dateFormatsObject[g];C||(x=!1);l=AmCharts.formatDate(new Date(m),l);if(e==s&&!o||e==r&&!n)l=" ";this.labelFunction&&(l=this.labelFunction(l,new Date(m),this));l=new this.axisItemRenderer(this,d,l,!1,p,0,!1,x);this.pushAxisItem(l);l=m;if(!isNaN(D))for(d=1;d<c;d+=D)this.gridAlpha=this.minorGridAlpha,x=m+v*d,x=AmCharts.resetDateToMin(new Date(x),a,D,A).getTime(),x=new this.axisItemRenderer(this,(x-this.startTime)*this.stepWidth),this.pushAxisItem(x);this.gridAlpha=t}}else if(!this.parseDates){if(this.cellWidth=this.getStepWidth(e),e<r&&(r=e),h+=this.start,this.stepWidth=this.getStepWidth(e),0<r)for(C=Math.floor(e/r),D=this.chooseMinorFrequency(C),d=h,d/2==Math.round(d/2)&&d--,0>d&&(d=0),r=0,e=d;e<=this.end+2;e++){A=!1;0<=e&&e<this.data.length?(g=this.data[e],l=g.category,A=g.forceShow):l="";if(x&&!isNaN(D))if(e/D==Math.round(e/D)||A)e/C==Math.round(e/C)||A||(this.gridAlpha=this.minorGridAlpha,l=void 0);else continue;else if(e/C!=Math.round(e/C)&&!A)continue;d=this.getCoordinate(e-h);A=0;"start"==this.gridPosition&&(d-=this.cellWidth/2,A=this.cellWidth/2);if(e==s&&!o||e==this.end&&!n)l=void 0;Math.round(r/a)!=r/a&&(l=void 0);r++;T=this.cellWidth;c&&(T=NaN);this.labelFunction&&g&&(l=this.labelFunction(l,g,this));l=AmCharts.fixBrakes(l);l=new this.axisItemRenderer(this,d,l,!0,T,A,void 0,!1,A);this.pushAxisItem(l);this.gridAlpha=t}}else if(this.parseDates&&this.equalSpacing){h=this.start;this.startTime=this.data[this.start].time;this.endTime=this.data[this.end].time;this.timeDifference=this.endTime-this.startTime;s=this.choosePeriod(0);a=s.period;c=s.count;u=AmCharts.getPeriodDuration(a,c);u<d&&(a=m.period,c=m.count,u=d);g=a;"WW"==g&&(g="DD");this.stepWidth=this.getStepWidth(e);r=Math.ceil(this.timeDifference/u)+1;l=AmCharts.resetDateToMin(new Date(this.startTime-u),a,c,A).getTime();this.cellWidth=this.getStepWidth(e);e=Math.round(l/u);s=-1;e/2==Math.round(e/2)&&(s=-2,l-=u);d=this.start;d/2==Math.round(d/2)&&d--;0>d&&(d=0);p=this.end+2;p>=this.data.length&&(p=this.data.length);v=!1;v=!o;this.previousPos=-1e3;20<this.labelRotation&&(this.safeDistance=5);u=d;if(this.data[d].time!=AmCharts.resetDateToMin(new Date(this.data[d].time),a,c,A).getTime())for(A=0,b=l,e=d;e<p;e++)m=this.data[e].time,this.checkPeriodChange(a,c,m,b)&&(A++,2<=A&&(u=e,e=p),b=m);x&&1<c&&(D=this.chooseMinorFrequency(c),AmCharts.getPeriodDuration(a,D));for(e=d;e<p;e++)if(m=this.data[e].time,this.checkPeriodChange(a,c,m,l)&&e>=u){d=this.getCoordinate(e-this.start);f=!1;this.nextPeriod[g]&&(f=this.checkPeriodChange(this.nextPeriod[g],1,m,l));x=!1;f&&this.markPeriodChange?(l=this.dateFormatsObject[this.nextPeriod[g]],x=!0):l=this.dateFormatsObject[g];l=AmCharts.formatDate(new Date(m),l);if(e==s&&!o||e==r&&!n)l=" ";v?v=!1:(C||(x=!1),d-this.previousPos>this.safeDistance*Math.cos(this.labelRotation*Math.PI/180)&&(this.labelFunction&&(l=this.labelFunction(l,new Date(m),this)),l=new this.axisItemRenderer(this,d,l,void 0,void 0,void 0,void 0,x),A=l.graphics(),this.pushAxisItem(l),A=A.getBBox().width,AmCharts.isModern||(A-=d),this.previousPos=d+A));l=m}else isNaN(D)||(this.checkPeriodChange(a,D,m,T)&&(this.gridAlpha=this.minorGridAlpha,d=this.getCoordinate(e-this.start),x=new this.axisItemRenderer(this,d),this.pushAxisItem(x),T=m),this.gridAlpha=t)}for(e=0;e<this.data.length;e++)if(o=this.data[e])n=this.parseDates&&!this.equalSpacing?Math.round((o.time-this.startTime)*this.stepWidth+this.cellWidth/2):this.getCoordinate(e-h),o.x[this.id]=n;o=this.guides.length;for(e=0;e<o;e++)n=this.guides[e],C=C=C=t=s=NaN,D=n.above,n.toCategory&&(C=i.getCategoryIndexByValue(n.toCategory),isNaN(C)||(s=this.getCoordinate(C-h),l=new this.axisItemRenderer(this,s,"",!0,NaN,NaN,n),this.pushAxisItem(l,D))),n.category&&(C=i.getCategoryIndexByValue(n.category),isNaN(C)||(t=this.getCoordinate(C-h),C=(s-t)/2,l=new this.axisItemRenderer(this,t,n.label,!0,NaN,C,n),this.pushAxisItem(l,D))),n.toDate&&(this.equalSpacing?(C=i.getClosestIndex(this.data,"time",n.toDate.getTime(),!1,0,this.data.length-1),isNaN(C)||(s=this.getCoordinate(C-h))):s=(n.toDate.getTime()-this.startTime)*this.stepWidth,l=new this.axisItemRenderer(this,s,"",!0,NaN,NaN,n),this.pushAxisItem(l,D)),n.date&&(this.equalSpacing?(C=i.getClosestIndex(this.data,"time",n.date.getTime(),!1,0,this.data.length-1),isNaN(C)||(t=this.getCoordinate(C-h))):t=(n.date.getTime()-this.startTime)*this.stepWidth,C=(s-t)/2,l="H"==this.orientation?new this.axisItemRenderer(this,t,n.label,!1,2*C,NaN,n):new this.axisItemRenderer(this,t,n.label,!1,NaN,C,n),this.pushAxisItem(l,D)),s=new this.guideFillRenderer(this,t,s,n),t=s.graphics(),this.pushAxisItem(s,D),n.graphics=t,t.index=e,n.balloonText&&this.addEventListeners(t,n)}this.axisCreated=!0;i=this.x;h=this.y;this.set.translate(i,h);this.labelsSet.translate(i,h);this.positionTitle();(i=this.axisLine.set)&&i.toFront()},chooseMinorFrequency:function(t){for(var e=10;0<e;e--)if(t/e==Math.round(t/e))return t/e},choosePeriod:function(t){var e=AmCharts.getPeriodDuration(this.periods[t].period,this.periods[t].count),i=Math.ceil(this.timeDifference/e),s=this.periods;return this.timeDifference<e&&0<t?s[t-1]:i<=this.gridCount?s[t]:t+1<s.length?this.choosePeriod(t+1):s[t]},getStepWidth:function(t){var e;this.startOnAxis?(e=this.axisWidth/(t-1),1==t&&(e=this.axisWidth)):e=this.axisWidth/t;return e},getCoordinate:function(t){t*=this.stepWidth;this.startOnAxis||(t+=this.stepWidth/2);return Math.round(t)},timeZoom:function(t,e){this.startTime=t;this.endTime=e},minDuration:function(){var t=AmCharts.extractPeriod(this.minPeriod);return AmCharts.getPeriodDuration(t.period,t.count)},checkPeriodChange:function(t,e,i,s){i=new Date(i);var a=new Date(s),h=this.firstDayOfWeek;s=e;"DD"==t&&(e=1);i=AmCharts.resetDateToMin(i,t,e,h).getTime();e=AmCharts.resetDateToMin(a,t,e,h).getTime();return"DD"==t&&i-e<=AmCharts.getPeriodDuration(t,s)?!1:i!=e?!0:!1},generateDFObject:function(){this.dateFormatsObject={};var t;for(t=0;t<this.dateFormats.length;t++){var e=this.dateFormats[t];this.dateFormatsObject[e.period]=e.format}},xToIndex:function(t){var e=this.data,i=this.chart,s=i.rotate,a=this.stepWidth;this.parseDates&&!this.equalSpacing?(t=this.startTime+Math.round(t/a)-this.minDuration()/2,i=i.getClosestIndex(e,"time",t,!1,this.start,this.end+1)):(this.startOnAxis||(t-=a/2),i=this.start+Math.round(t/a));var i=AmCharts.fitToBounds(i,0,e.length-1),h;e[i]&&(h=e[i].x[this.id]);s?h>this.height+1&&i--:h>this.width+1&&i--;0>h&&i++;return i=AmCharts.fitToBounds(i,0,e.length-1)},dateToCoordinate:function(t){return this.parseDates&&!this.equalSpacing?(t.getTime()-this.startTime)*this.stepWidth:this.parseDates&&this.equalSpacing?(t=this.chart.getClosestIndex(this.data,"time",t.getTime(),!1,0,this.data.length-1),this.getCoordinate(t-this.start)):NaN},categoryToCoordinate:function(t){return this.chart?(t=this.chart.getCategoryIndexByValue(t),this.getCoordinate(t-this.start)):NaN},coordinateToDate:function(t){return this.equalSpacing?(t=this.xToIndex(t),new Date(this.data[t].time)):new Date(this.startTime+t/this.stepWidth)}});
//# sourceMappingURL=serial.map.js