AmCharts.AmStockChart=AmCharts.Class({construct:function(a){this.type="stock";this.cname="AmStockChart";this.version="3.11.2";this.theme=a;this.createEvents("zoomed","rollOverStockEvent","rollOutStockEvent","clickStockEvent","panelRemoved","dataUpdated","init","rendered","drawn");this.colors="#FF6600 #FCD202 #B0DE09 #0D8ECF #2A0CD0 #CD0D74 #CC0000 #00CC00 #0000CC #DDDDDD #999999 #333333 #990000".split(" ");this.firstDayOfWeek=1;this.glueToTheEnd=!1;this.dataSetCounter=-1;this.zoomOutOnDataSetChange= !1;this.panels=[];this.dataSets=[];this.chartCursors=[];this.comparedDataSets=[];this.categoryAxesSettings=new AmCharts.CategoryAxesSettings(a);this.valueAxesSettings=new AmCharts.ValueAxesSettings(a);this.panelsSettings=new AmCharts.PanelsSettings(a);this.chartScrollbarSettings=new AmCharts.ChartScrollbarSettings(a);this.chartCursorSettings=new AmCharts.ChartCursorSettings(a);this.stockEventsSettings=new AmCharts.StockEventsSettings(a);this.legendSettings=new AmCharts.LegendSettings(a);this.balloon= new AmCharts.AmBalloon(a);this.previousEndDate=new Date(0);this.previousStartDate=new Date(0);this.dataSetCount=this.graphCount=0;this.chartCreated=!1;this.extendToFullPeriod=!0;AmCharts.applyTheme(this,a,this.cname)},write:function(a){var b=this.theme;this.initHC||(AmCharts.callInitHandler(this),this.initHC=!0);AmCharts.applyLang(this.language,this);var c=this.exportConfig;c&&AmCharts.AmExport&&!this.AmExport&&(this.AmExport=new AmCharts.AmExport(this,c));this.amExport&&AmCharts.AmExport&&(this.AmExport= AmCharts.extend(this.amExport,new AmCharts.AmExport(this),!0));this.AmExport&&this.AmExport.init();this.chartRendered=!1;a="object"!=typeof a?document.getElementById(a):a;this.zoomOutOnDataSetChange&&(this.endDate=this.startDate=void 0);this.categoryAxesSettings=AmCharts.processObject(this.categoryAxesSettings,AmCharts.CategoryAxesSettings,b);this.valueAxesSettings=AmCharts.processObject(this.valueAxesSettings,AmCharts.ValueAxesSettings,b);this.chartCursorSettings=AmCharts.processObject(this.chartCursorSettings, AmCharts.ChartCursorSettings,b);this.chartScrollbarSettings=AmCharts.processObject(this.chartScrollbarSettings,AmCharts.ChartScrollbarSettings,b);this.legendSettings=AmCharts.processObject(this.legendSettings,AmCharts.LegendSettings,b);this.panelsSettings=AmCharts.processObject(this.panelsSettings,AmCharts.PanelsSettings,b);this.stockEventsSettings=AmCharts.processObject(this.stockEventsSettings,AmCharts.StockEventsSettings,b);this.dataSetSelector&&(this.dataSetSelector=AmCharts.processObject(this.dataSetSelector, AmCharts.DataSetSelector,b));this.periodSelector&&(this.periodSelector=AmCharts.processObject(this.periodSelector,AmCharts.PeriodSelector,b));a.innerHTML="";this.div=a;this.measure();this.createLayout();this.updateDataSets();this.addDataSetSelector();this.addPeriodSelector();this.addPanels();this.updatePanels();this.addChartScrollbar();this.updateData();this.skipDefault||this.setDefaultPeriod()},setDefaultPeriod:function(a){var b=this.periodSelector;b&&(this.animationPlayed=!1,b.setDefaultPeriod(a))}, validateSize:function(){var a,b=this.panels;this.measurePanels();for(a=0;ac?this.colors[c]:AmCharts.randomColor())}!a&&AmCharts.ifArray(b)&&(this.mainDataSet=this.dataSets[0])},updateEvents:function(a){AmCharts.ifArray(a.stockEvents)&& AmCharts.parseEvents(a,this.panels,this.stockEventsSettings,this.firstDayOfWeek,this,this.dataDateFormat)},getLastDate:function(a){var b=this.dataDateFormat;a=a instanceof Date?new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()):b?AmCharts.stringToDate(a,b):new Date(a);return new Date(AmCharts.changeDate(a,this.categoryAxesSettings.minPeriod,1,!0).getTime()-1)},getFirstDate:function(a){var b=this.dataDateFormat;a=a instanceof Date?new Date(a.getFullYear(), a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()):b?AmCharts.stringToDate(a,b):new Date(a);return new Date(AmCharts.resetDateToMin(a,this.categoryAxesSettings.minPeriod,1,this.firstDayOfWeek))},updateData:function(){var a=this.mainDataSet;if(a){var b=this.categoryAxesSettings;-1==AmCharts.getItemIndex(b.minPeriod,b.groupToPeriods)&&b.groupToPeriods.unshift(b.minPeriod);var c=a.dataProvider;if(AmCharts.ifArray(c)){var d=a.categoryField;this.firstDate=this.getFirstDate(c[0][d]); this.lastDate=this.getLastDate(c[c.length-1][d]);this.periodSelector&&this.periodSelector.setRanges(this.firstDate,this.lastDate);a.dataParsed||(AmCharts.parseStockData(a,b.minPeriod,b.groupToPeriods,this.firstDayOfWeek,this.dataDateFormat),a.dataParsed=!0);this.updateComparingData();this.updateEvents(a)}else this.lastDate=this.firstDate=void 0;this.glueToTheEnd&&this.startDate&&this.endDate&&this.lastDate&&(AmCharts.getPeriodDuration(b.minPeriod),this.startDate=new Date(this.startDate.getTime()+ (this.lastDate.getTime()-this.endDate.getTime())),this.endDate=this.lastDate,this.updateScrollbar=!0);this.updatePanelsWithNewData()}a={type:"dataUpdated",chart:this};this.fire(a.type,a)},updateComparingData:function(){var a=this.comparedDataSets,b=this.categoryAxesSettings,c;for(c=0;ck.getTime()&&(a=k);b.getTime()k.getTime()&&(b=k);l=AmCharts.getItemIndex(g,h.groupToPeriods);h=f;f=d.choosePeriod(l,a,b);d.currentPeriod=f;var l=AmCharts.extractPeriod(f),y=AmCharts.getPeriodDuration(l.period,l.count);AmCharts.getPeriodDuration(g);1>b.getTime()-a.getTime()&&(a=new Date(b.getTime()-1));g=AmCharts.newDate(a); d.extendToFullPeriod&&(g.getTime()-e.getTime()<.1*y&&(g=AmCharts.resetDateToMin(a,l.period,l.count,w)),k.getTime()-b.getTime()<.1*y&&(b=AmCharts.resetDateToMin(k,l.period,l.count,w),b=AmCharts.changeDate(b,l.period,l.count,!0)));for(e=0;ed&&0n.getTime()&&(m=AmCharts.getPeriodDuration("DD",1),f= new Date(n.getTime()-m)),f.getTime()d&&(a=d);d=this.theme;this.unselectButtons();var e;for(e=b.length-1;0<=e;e--){var k=b[e],f=k.button;k.startTime&&k.endTime&&c==k.startTime&&a==k.endTime&&(this.unselectButtons(),f.className="amChartsButtonSelected",d&&AmCharts.applyStyles(f.style,d.PeriodButtonSelected))}}this.skipMark=!1},unselectButtons:function(){var a=this.periods,b,c=this.theme;for(b=a.length-1;0<=b;b--){var d=a[b].button;d.className="amChartsButton";c&&AmCharts.applyStyles(d.style,c.PeriodButton)}}, setDefaultPeriod:function(){var a=this.periods,b;for(b=0;ba?(d=this.startTime+d*e,e=this.endTime+1*e):(d=this.startTime-d*e,e=this.endTime-1*e);dthis.lastTime&& (e=this.lastTime);d=v[r]||!v[r]){w[r]={};w[r].amCategoryIdField=String(AmCharts.resetDateToMin(x,C,E,d).getTime());var D;for(D=0;Dg&&(s=AmCharts.newDate(x,b),s=AmCharts.changeDate(s,C,E,!0),s=AmCharts.resetDateToMin(s,C,E,d),v[r]=s.getTime());if(q==g)for(var F in z)z.hasOwnProperty(F)&& (w[r][F]=z[F]);w[r][h]=AmCharts.newDate(x,b)}else for(C=0;Cu[s+"High"]&&(u[s+"High"]=p),u[s+"Close"]=p,E=AmCharts.getDecimals(u[s+"Sum"]),D=AmCharts.getDecimals(p),u[s+"Sum"]+=p,u[s+"Sum"]=AmCharts.roundTo(u[s+"Sum"],Math.max(E,D)),u[s+"Count"]++,u[s+"Average"]=u[s+"Sum"]/u[s+"Count"])}}}a.agregatedDataProviders= k}; AmCharts.parseEvents=function(a,b,c,d,e,k){var f=a.stockEvents,h=a.agregatedDataProviders,g=b.length,n,m,t,r,v,w,l,y;for(n=0;n=E&&ythis.availableSpace&&(this.stackDown=!0);this.set=a.set();a=0;var c;for(c=0;c