amcharts.js 321 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327
  1. (function () {
  2. var d;
  3. window.AmCharts ? d = window.AmCharts : (d = {}, window.AmCharts = d, d.themes = {}, d.maps = {}, d.inheriting = {}, d.charts = [], d.onReadyArray = [], d.useUTC = !1, d.updateRate = 60, d.uid = 0, d.lang = {}, d.translations = {}, d.mapTranslations = {}, d.windows = {}, d.initHandlers = []);
  4. d.Class = function (a) {
  5. var b = function () {
  6. arguments[0] !== d.inheriting && (this.events = {}, this.construct.apply(this, arguments))
  7. };
  8. a.inherits ? (b.prototype = new a.inherits(d.inheriting), b.base = a.inherits.prototype, delete a.inherits) : (b.prototype.createEvents =
  9. function () {
  10. for (var a = 0, b = arguments.length; a < b; a++) this.events[arguments[a]] = []
  11. }, b.prototype.listenTo = function (a, b, c) {
  12. this.removeListener(a, b, c);
  13. a.events[b].push({handler: c, scope: this})
  14. }, b.prototype.addListener = function (a, b, c) {
  15. this.removeListener(this, a, b);
  16. a && this.events[a] && this.events[a].push({handler: b, scope: c})
  17. }, b.prototype.removeListener = function (a, b, c) {
  18. if (a && a.events && (a = a.events[b])) for (b = a.length - 1; 0 <= b; b--) a[b].handler === c && a.splice(b, 1)
  19. }, b.prototype.fire = function (a) {
  20. for (var b = this.events[a.type],
  21. c = 0, d = b.length; c < d; c++) {
  22. var k = b[c];
  23. k.handler.call(k.scope, a)
  24. }
  25. });
  26. for (var c in a) b.prototype[c] = a[c];
  27. return b
  28. };
  29. d.addChart = function (a) {
  30. window.requestAnimationFrame ? d.animationRequested || (d.animationRequested = !0, window.requestAnimationFrame(d.update)) : d.updateInt || (d.updateInt = setInterval(function () {
  31. d.update()
  32. }, Math.round(1E3 / d.updateRate)));
  33. d.charts.push(a)
  34. };
  35. d.removeChart = function (a) {
  36. for (var b = d.charts, c = b.length - 1; 0 <= c; c--) b[c] == a && b.splice(c, 1);
  37. 0 === b.length && d.updateInt && (clearInterval(d.updateInt),
  38. d.updateInt = NaN)
  39. };
  40. d.isModern = !0;
  41. d.getIEVersion = function () {
  42. var a = 0, b, c;
  43. "Microsoft Internet Explorer" == navigator.appName && (b = navigator.userAgent, c = /MSIE ([0-9]{1,}[.0-9]{0,})/, null !== c.exec(b) && (a = parseFloat(RegExp.$1)));
  44. return a
  45. };
  46. d.applyLang = function (a, b) {
  47. var c = d.translations;
  48. b.dayNames = d.extend({}, d.dayNames);
  49. b.shortDayNames = d.extend({}, d.shortDayNames);
  50. b.monthNames = d.extend({}, d.monthNames);
  51. b.shortMonthNames = d.extend({}, d.shortMonthNames);
  52. b.amString = "am";
  53. b.pmString = "pm";
  54. c && (c = c[a]) && (d.lang = c, c.monthNames &&
  55. (b.dayNames = d.extend({}, c.dayNames), b.shortDayNames = d.extend({}, c.shortDayNames), b.monthNames = d.extend({}, c.monthNames), b.shortMonthNames = d.extend({}, c.shortMonthNames)), c.am && (b.amString = c.am), c.pm && (b.pmString = c.pm))
  56. };
  57. d.IEversion = d.getIEVersion();
  58. 9 > d.IEversion && 0 < d.IEversion && (d.isModern = !1, d.isIE = !0);
  59. d.dx = 0;
  60. d.dy = 0;
  61. if (document.addEventListener || window.opera) d.isNN = !0, d.isIE = !1, d.dx = .5, d.dy = .5;
  62. document.attachEvent && (d.isNN = !1, d.isIE = !0, d.isModern || (d.dx = 0, d.dy = 0));
  63. window.chrome && (d.chrome = !0);
  64. d.handleMouseUp =
  65. function (a) {
  66. for (var b = d.charts, c = 0; c < b.length; c++) {
  67. var e = b[c];
  68. e && e.handleReleaseOutside && e.handleReleaseOutside(a)
  69. }
  70. };
  71. d.handleMouseMove = function (a) {
  72. for (var b = d.charts, c = 0; c < b.length; c++) {
  73. var e = b[c];
  74. e && e.handleMouseMove && e.handleMouseMove(a)
  75. }
  76. };
  77. d.handleWheel = function (a) {
  78. for (var b = d.charts, c = 0; c < b.length; c++) {
  79. var e = b[c];
  80. if (e && e.mouseIsOver) {
  81. e.mouseWheelScrollEnabled || e.mouseWheelZoomEnabled ? e.handleWheel && e.handleWheel(a) : a.stopPropagation && a.stopPropagation();
  82. break
  83. }
  84. }
  85. };
  86. d.resetMouseOver = function () {
  87. for (var a =
  88. d.charts, b = 0; b < a.length; b++) {
  89. var c = a[b];
  90. c && (c.mouseIsOver = !1)
  91. }
  92. };
  93. d.ready = function (a) {
  94. d.onReadyArray.push(a)
  95. };
  96. d.handleLoad = function () {
  97. d.isReady = !0;
  98. for (var a = d.onReadyArray, b = 0; b < a.length; b++) {
  99. var c = a[b];
  100. isNaN(d.processDelay) ? c() : setTimeout(c, d.processDelay * b)
  101. }
  102. };
  103. d.addInitHandler = function (a, b) {
  104. d.initHandlers.push({method: a, types: b})
  105. };
  106. d.callInitHandler = function (a) {
  107. var b = d.initHandlers;
  108. if (d.initHandlers) for (var c = 0; c < b.length; c++) {
  109. var e = b[c];
  110. e.types ? d.isInArray(e.types, a.type) && e.method(a) : e.method(a)
  111. }
  112. };
  113. d.getUniqueId = function () {
  114. d.uid++;
  115. return "AmChartsEl-" + d.uid
  116. };
  117. d.isNN && (document.addEventListener("mousemove", d.handleMouseMove), document.addEventListener("mouseup", d.handleMouseUp, !0), window.addEventListener("load", d.handleLoad, !0), window.addEventListener("DOMMouseScroll", d.handleWheel, !0), document.addEventListener("mousewheel", d.handleWheel, !0));
  118. d.isIE && (document.attachEvent("onmousemove", d.handleMouseMove), document.attachEvent("onmouseup", d.handleMouseUp), window.attachEvent("onload", d.handleLoad),
  119. document.attachEvent("onmousewheel", d.handleWheel));
  120. d.clear = function () {
  121. var a = d.charts;
  122. if (a) for (var b = a.length - 1; 0 <= b; b--) a[b].clear();
  123. d.updateInt && clearInterval(d.updateInt);
  124. d.charts = [];
  125. d.isNN && (document.removeEventListener("mousemove", d.handleMouseMove, !0), document.removeEventListener("mouseup", d.handleMouseUp, !0), window.removeEventListener("load", d.handleLoad, !0), window.removeEventListener("DOMMouseScroll", d.handleWheel, !0), document.removeEventListener("mousewheel", d.handleWheel, !0));
  126. d.isIE && (document.detachEvent("onmousemove",
  127. d.handleMouseMove), document.detachEvent("onmouseup", d.handleMouseUp), window.detachEvent("onload", d.handleLoad))
  128. };
  129. d.makeChart = function (a, b, c) {
  130. var e = b.type, h = b.theme;
  131. d.isString(h) && (h = d.themes[h], b.theme = h);
  132. var f;
  133. switch (e) {
  134. case "serial":
  135. f = new d.AmSerialChart(h);
  136. break;
  137. case "xy":
  138. f = new d.AmXYChart(h);
  139. break;
  140. case "pie":
  141. f = new d.AmPieChart(h);
  142. break;
  143. case "radar":
  144. f = new d.AmRadarChart(h);
  145. break;
  146. case "gauge":
  147. f = new d.AmAngularGauge(h);
  148. break;
  149. case "funnel":
  150. f = new d.AmFunnelChart(h);
  151. break;
  152. case "map":
  153. f = new d.AmMap(h);
  154. break;
  155. case "stock":
  156. f = new d.AmStockChart(h);
  157. break;
  158. case "gantt":
  159. f = new d.AmGanttChart(h)
  160. }
  161. d.extend(f, b);
  162. d.isReady ? isNaN(c) ? f.write(a) : setTimeout(function () {
  163. d.realWrite(f, a)
  164. }, c) : d.ready(function () {
  165. isNaN(c) ? f.write(a) : setTimeout(function () {
  166. d.realWrite(f, a)
  167. }, c)
  168. });
  169. return f
  170. };
  171. d.realWrite = function (a, b) {
  172. a.write(b)
  173. };
  174. d.updateCount = 0;
  175. d.validateAt = Math.round(d.updateRate / 10);
  176. d.update = function () {
  177. var a = d.charts;
  178. d.updateCount++;
  179. var b = !1;
  180. d.updateCount == d.validateAt && (b = !0, d.updateCount = 0);
  181. if (a) for (var c = a.length - 1; 0 <=
  182. c; c--) a[c].update && a[c].update(), b && (a[c].autoResize ? a[c].validateSize && a[c].validateSize() : a[c].premeasure && a[c].premeasure());
  183. window.requestAnimationFrame && window.requestAnimationFrame(d.update)
  184. };
  185. d.bezierX = 3;
  186. d.bezierY = 6;
  187. "complete" == document.readyState && d.handleLoad()
  188. })();
  189. (function () {
  190. var d = window.AmCharts;
  191. d.toBoolean = function (a, b) {
  192. if (void 0 === a) return b;
  193. switch (String(a).toLowerCase()) {
  194. case "true":
  195. case "yes":
  196. case "1":
  197. return !0;
  198. case "false":
  199. case "no":
  200. case "0":
  201. case null:
  202. return !1;
  203. default:
  204. return Boolean(a)
  205. }
  206. };
  207. d.removeFromArray = function (a, b) {
  208. var c;
  209. if (void 0 !== b && void 0 !== a) for (c = a.length - 1; 0 <= c; c--) a[c] == b && a.splice(c, 1)
  210. };
  211. d.getPath = function () {
  212. var a = document.getElementsByTagName("script");
  213. if (a) for (var b = 0; b < a.length; b++) {
  214. var c = a[b].src;
  215. if (-1 !== c.search(/\/(amcharts|ammap)\.js/)) return c.replace(/\/(amcharts|ammap)\.js.*/,
  216. "/")
  217. }
  218. };
  219. d.normalizeUrl = function (a) {
  220. return "" !== a && -1 === a.search(/\/$/) ? a + "/" : a
  221. };
  222. d.isAbsolute = function (a) {
  223. return 0 === a.search(/^http[s]?:|^\//)
  224. };
  225. d.isInArray = function (a, b) {
  226. for (var c = 0; c < a.length; c++) if (a[c] == b) return !0;
  227. return !1
  228. };
  229. d.getDecimals = function (a) {
  230. var b = 0;
  231. isNaN(a) || (a = String(a), -1 != a.indexOf("e-") ? b = Number(a.split("-")[1]) : -1 != a.indexOf(".") && (b = a.split(".")[1].length));
  232. return b
  233. };
  234. d.wordwrap = function (a, b, c, e) {
  235. var h, f, g, k;
  236. a += "";
  237. if (1 > b) return a;
  238. h = -1;
  239. for (a = (k = a.split(/\r\n|\n|\r/)).length; ++h < a; k[h] +=
  240. g) {
  241. g = k[h];
  242. for (k[h] = ""; g.length > b; k[h] += d.trim(g.slice(0, f)) + ((g = g.slice(f)).length ? c : "")) f = 2 == e || (f = g.slice(0, b + 1).match(/\S*(\s)?$/))[1] ? b : f.input.length - f[0].length || 1 == e && b || f.input.length + (f = g.slice(b).match(/^\S*/))[0].length;
  243. g = d.trim(g)
  244. }
  245. return k.join(c)
  246. };
  247. d.trim = function (a) {
  248. return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "")
  249. };
  250. d.wrappedText = function (a, b, c, e, h, f, g, k) {
  251. var l = d.text(a, b, c, e, h, f, g);
  252. if (l) {
  253. var m = l.getBBox();
  254. if (m.width > k) {
  255. var n = "\n";
  256. d.isModern || (n = "<br>");
  257. k = Math.floor(k / (m.width /
  258. b.length));
  259. 2 < k && (k -= 2);
  260. b = d.wordwrap(b, k, n, !0);
  261. l.remove();
  262. l = d.text(a, b, c, e, h, f, g)
  263. }
  264. }
  265. return l
  266. };
  267. d.getStyle = function (a, b) {
  268. var c = "";
  269. document.defaultView && document.defaultView.getComputedStyle ? c = document.defaultView.getComputedStyle(a, "").getPropertyValue(b) : a.currentStyle && (b = b.replace(/\-(\w)/g, function (a, b) {
  270. return b.toUpperCase()
  271. }), c = a.currentStyle[b]);
  272. return c
  273. };
  274. d.removePx = function (a) {
  275. if (void 0 !== a) return Number(a.substring(0, a.length - 2))
  276. };
  277. d.getURL = function (a, b) {
  278. if (a) if ("_self" != b && b) if ("_top" == b && window.top) window.top.location.href =
  279. a; else if ("_parent" == b && window.parent) window.parent.location.href = a; else if ("_blank" == b) window.open(a); else {
  280. var c = document.getElementsByName(b)[0];
  281. c ? c.src = a : (c = d.windows[b]) ? c.opener && !c.opener.closed ? c.location.href = a : d.windows[b] = window.open(a) : d.windows[b] = window.open(a)
  282. } else window.location.href = a
  283. };
  284. d.ifArray = function (a) {
  285. return a && "object" == typeof a && 0 < a.length ? !0 : !1
  286. };
  287. d.callMethod = function (a, b) {
  288. var c;
  289. for (c = 0; c < b.length; c++) {
  290. var e = b[c];
  291. if (e) {
  292. if (e[a]) e[a]();
  293. var d = e.length;
  294. if (0 < d) {
  295. var f;
  296. for (f = 0; f <
  297. d; f++) {
  298. var g = e[f];
  299. if (g && g[a]) g[a]()
  300. }
  301. }
  302. }
  303. }
  304. };
  305. d.toNumber = function (a) {
  306. return "number" == typeof a ? a : Number(String(a).replace(/[^0-9\-.]+/g, ""))
  307. };
  308. d.toColor = function (a) {
  309. if ("" !== a && void 0 !== a) if (-1 != a.indexOf(",")) {
  310. a = a.split(",");
  311. var b;
  312. for (b = 0; b < a.length; b++) {
  313. var c = a[b].substring(a[b].length - 6, a[b].length);
  314. a[b] = "#" + c
  315. }
  316. } else a = a.substring(a.length - 6, a.length), a = "#" + a;
  317. return a
  318. };
  319. d.toCoordinate = function (a, b, c) {
  320. var e;
  321. void 0 !== a && (a = String(a), c && c < b && (b = c), e = Number(a), -1 != a.indexOf("!") && (e = b - Number(a.substr(1))), -1 !=
  322. a.indexOf("%") && (e = b * Number(a.substr(0, a.length - 1)) / 100));
  323. return e
  324. };
  325. d.fitToBounds = function (a, b, c) {
  326. a < b && (a = b);
  327. a > c && (a = c);
  328. return a
  329. };
  330. d.isDefined = function (a) {
  331. return void 0 === a ? !1 : !0
  332. };
  333. d.stripNumbers = function (a) {
  334. return a.replace(/[0-9]+/g, "")
  335. };
  336. d.roundTo = function (a, b) {
  337. if (0 > b) return a;
  338. var c = Math.pow(10, b);
  339. return Math.round(a * c) / c
  340. };
  341. d.toFixed = function (a, b) {
  342. var c = String(Math.round(a * Math.pow(10, b)));
  343. if (0 < b) {
  344. var e = c.length;
  345. if (e < b) {
  346. var d;
  347. for (d = 0; d < b - e; d++) c = "0" + c
  348. }
  349. e = c.substring(0, c.length - b);
  350. "" === e && (e = 0);
  351. return e +
  352. "." + c.substring(c.length - b, c.length)
  353. }
  354. return String(c)
  355. };
  356. d.formatDuration = function (a, b, c, e, h, f) {
  357. var g = d.intervals, k = f.decimalSeparator;
  358. if (a >= g[b].contains) {
  359. var l = a - Math.floor(a / g[b].contains) * g[b].contains;
  360. "ss" == b ? (l = d.formatNumber(l, f), 1 == l.split(k)[0].length && (l = "0" + l)) : l = d.roundTo(l, f.precision);
  361. ("mm" == b || "hh" == b) && 10 > l && (l = "0" + l);
  362. c = l + "" + e[b] + "" + c;
  363. a = Math.floor(a / g[b].contains);
  364. b = g[b].nextInterval;
  365. return d.formatDuration(a, b, c, e, h, f)
  366. }
  367. "ss" == b && (a = d.formatNumber(a, f), 1 == a.split(k)[0].length && (a = "0" +
  368. a));
  369. ("mm" == b || "hh" == b) && 10 > a && (a = "0" + a);
  370. c = a + "" + e[b] + "" + c;
  371. if (g[h].count > g[b].count) for (a = g[b].count; a < g[h].count; a++) b = g[b].nextInterval, "ss" == b || "mm" == b || "hh" == b ? c = "00" + e[b] + "" + c : "DD" == b && (c = "0" + e[b] + "" + c);
  372. ":" == c.charAt(c.length - 1) && (c = c.substring(0, c.length - 1));
  373. return c
  374. };
  375. d.formatNumber = function (a, b, c, e, h) {
  376. a = d.roundTo(a, b.precision);
  377. isNaN(c) && (c = b.precision);
  378. var f = b.decimalSeparator;
  379. b = b.thousandsSeparator;
  380. var g;
  381. g = 0 > a ? "-" : "";
  382. a = Math.abs(a);
  383. var k = String(a), l = !1;
  384. -1 != k.indexOf("e") && (l = !0);
  385. 0 <= c && !l && (k =
  386. d.toFixed(a, c));
  387. var m = "";
  388. if (l) m = k; else {
  389. var k = k.split("."), l = String(k[0]), n;
  390. for (n = l.length; 0 <= n; n -= 3) m = n != l.length ? 0 !== n ? l.substring(n - 3, n) + b + m : l.substring(n - 3, n) + m : l.substring(n - 3, n);
  391. void 0 !== k[1] && (m = m + f + k[1]);
  392. void 0 !== c && 0 < c && "0" != m && (m = d.addZeroes(m, f, c))
  393. }
  394. m = g + m;
  395. "" === g && !0 === e && 0 !== a && (m = "+" + m);
  396. !0 === h && (m += "%");
  397. return m
  398. };
  399. d.addZeroes = function (a, b, c) {
  400. a = a.split(b);
  401. void 0 === a[1] && 0 < c && (a[1] = "0");
  402. return a[1].length < c ? (a[1] += "0", d.addZeroes(a[0] + b + a[1], b, c)) : void 0 !== a[1] ? a[0] + b + a[1] : a[0]
  403. };
  404. d.scientificToNormal =
  405. function (a) {
  406. var b;
  407. a = String(a).split("e");
  408. var c;
  409. if ("-" == a[1].substr(0, 1)) {
  410. b = "0.";
  411. for (c = 0; c < Math.abs(Number(a[1])) - 1; c++) b += "0";
  412. b += a[0].split(".").join("")
  413. } else {
  414. var e = 0;
  415. b = a[0].split(".");
  416. b[1] && (e = b[1].length);
  417. b = a[0].split(".").join("");
  418. for (c = 0; c < Math.abs(Number(a[1])) - e; c++) b += "0"
  419. }
  420. return b
  421. };
  422. d.toScientific = function (a, b) {
  423. if (0 === a) return "0";
  424. var c = Math.floor(Math.log(Math.abs(a)) * Math.LOG10E), e = String(e).split(".").join(b);
  425. return String(e) + "e" + c
  426. };
  427. d.randomColor = function () {
  428. return "#" + ("00000" + (16777216 * Math.random() <<
  429. 0).toString(16)).substr(-6)
  430. };
  431. d.hitTest = function (a, b, c) {
  432. var e = !1, h = a.x, f = a.x + a.width, g = a.y, k = a.y + a.height, l = d.isInRectangle;
  433. e || (e = l(h, g, b));
  434. e || (e = l(h, k, b));
  435. e || (e = l(f, g, b));
  436. e || (e = l(f, k, b));
  437. e || !0 === c || (e = d.hitTest(b, a, !0));
  438. return e
  439. };
  440. d.isInRectangle = function (a, b, c) {
  441. return a >= c.x - 5 && a <= c.x + c.width + 5 && b >= c.y - 5 && b <= c.y + c.height + 5 ? !0 : !1
  442. };
  443. d.isPercents = function (a) {
  444. if (-1 != String(a).indexOf("%")) return !0
  445. };
  446. d.formatValue = function (a, b, c, e, h, f, g, k) {
  447. if (b) {
  448. void 0 === h && (h = "");
  449. var l;
  450. for (l = 0; l < c.length; l++) {
  451. var m = c[l],
  452. n = b[m];
  453. void 0 !== n && (n = f ? d.addPrefix(n, k, g, e) : d.formatNumber(n, e), a = a.replace(new RegExp("\\[\\[" + h + "" + m + "\\]\\]", "g"), n))
  454. }
  455. }
  456. return a
  457. };
  458. d.formatDataContextValue = function (a, b) {
  459. if (a) {
  460. var c = a.match(/\[\[.*?\]\]/g), e;
  461. for (e = 0; e < c.length; e++) {
  462. var d = c[e], d = d.substr(2, d.length - 4);
  463. void 0 !== b[d] && (a = a.replace(new RegExp("\\[\\[" + d + "\\]\\]", "g"), b[d]))
  464. }
  465. }
  466. return a
  467. };
  468. d.massReplace = function (a, b) {
  469. for (var c in b) if (b.hasOwnProperty(c)) {
  470. var e = b[c];
  471. void 0 === e && (e = "");
  472. a = a.replace(c, e)
  473. }
  474. return a
  475. };
  476. d.cleanFromEmpty = function (a) {
  477. return a.replace(/\[\[[^\]]*\]\]/g,
  478. "")
  479. };
  480. d.addPrefix = function (a, b, c, e, h) {
  481. var f = d.formatNumber(a, e), g = "", k, l, m;
  482. if (0 === a) return "0";
  483. 0 > a && (g = "-");
  484. a = Math.abs(a);
  485. if (1 < a) for (k = b.length - 1; -1 < k; k--) {
  486. if (a >= b[k].number && (l = a / b[k].number, m = Number(e.precision), 1 > m && (m = 1), c = d.roundTo(l, m), m = d.formatNumber(c, {
  487. precision: -1,
  488. decimalSeparator: e.decimalSeparator,
  489. thousandsSeparator: e.thousandsSeparator
  490. }), !h || l == c)) {
  491. f = g + "" + m + "" + b[k].prefix;
  492. break
  493. }
  494. } else for (k = 0; k < c.length; k++) if (a <= c[k].number) {
  495. l = a / c[k].number;
  496. m = Math.abs(Math.floor(Math.log(l) * Math.LOG10E));
  497. l = d.roundTo(l, m);
  498. f = g + "" + l + "" + c[k].prefix;
  499. break
  500. }
  501. return f
  502. };
  503. d.remove = function (a) {
  504. a && a.remove()
  505. };
  506. d.getEffect = function (a) {
  507. ">" == a && (a = "easeOutSine");
  508. "<" == a && (a = "easeInSine");
  509. "elastic" == a && (a = "easeOutElastic");
  510. return a
  511. };
  512. d.getObjById = function (a, b) {
  513. var c, e;
  514. for (e = 0; e < a.length; e++) {
  515. var d = a[e];
  516. if (d.id == b) {
  517. c = d;
  518. break
  519. }
  520. }
  521. return c
  522. };
  523. d.applyTheme = function (a, b, c) {
  524. b || (b = d.theme);
  525. b && b[c] && d.extend(a, b[c])
  526. };
  527. d.isString = function (a) {
  528. return "string" == typeof a ? !0 : !1
  529. };
  530. d.extend = function (a, b, c) {
  531. var e;
  532. a || (a = {});
  533. for (e in b) c ? a.hasOwnProperty(e) ||
  534. (a[e] = b[e]) : a[e] = b[e];
  535. return a
  536. };
  537. d.copyProperties = function (a, b) {
  538. for (var c in a) a.hasOwnProperty(c) && "events" != c && void 0 !== a[c] && "function" != typeof a[c] && "cname" != c && (b[c] = a[c])
  539. };
  540. d.processObject = function (a, b, c, e) {
  541. if (!1 === a instanceof b && (a = e ? d.extend(new b(c), a) : d.extend(a, new b(c), !0), a.listeners)) for (var h in a.listeners) b = a.listeners[h], a.addListener(b.event, b.method);
  542. return a
  543. };
  544. d.fixNewLines = function (a) {
  545. var b = RegExp("\\n", "g");
  546. a && (a = a.replace(b, "<br />"));
  547. return a
  548. };
  549. d.fixBrakes = function (a) {
  550. if (d.isModern) {
  551. var b =
  552. RegExp("<br>", "g");
  553. a && (a = a.replace(b, "\n"))
  554. } else a = d.fixNewLines(a);
  555. return a
  556. };
  557. d.deleteObject = function (a, b) {
  558. if (a) {
  559. if (void 0 === b || null === b) b = 20;
  560. if (0 !== b) if ("[object Array]" === Object.prototype.toString.call(a)) for (var c = 0; c < a.length; c++) d.deleteObject(a[c], b - 1), a[c] = null; else if (a && !a.tagName) try {
  561. for (c in a) a[c] && ("object" == typeof a[c] && d.deleteObject(a[c], b - 1), "function" != typeof a[c] && (a[c] = null))
  562. } catch (e) {
  563. }
  564. }
  565. };
  566. d.bounce = function (a, b, c, e, d) {
  567. return (b /= d) < 1 / 2.75 ? 7.5625 * e * b * b + c : b < 2 / 2.75 ? e * (7.5625 * (b -= 1.5 /
  568. 2.75) * b + .75) + c : b < 2.5 / 2.75 ? e * (7.5625 * (b -= 2.25 / 2.75) * b + .9375) + c : e * (7.5625 * (b -= 2.625 / 2.75) * b + .984375) + c
  569. };
  570. d.easeInOutQuad = function (a, b, c, e, d) {
  571. b /= d / 2;
  572. if (1 > b) return e / 2 * b * b + c;
  573. b--;
  574. return -e / 2 * (b * (b - 2) - 1) + c
  575. };
  576. d.easeInSine = function (a, b, c, e, d) {
  577. return -e * Math.cos(b / d * (Math.PI / 2)) + e + c
  578. };
  579. d.easeOutSine = function (a, b, c, e, d) {
  580. return e * Math.sin(b / d * (Math.PI / 2)) + c
  581. };
  582. d.easeOutElastic = function (a, b, c, e, d) {
  583. a = 1.70158;
  584. var f = 0, g = e;
  585. if (0 === b) return c;
  586. if (1 == (b /= d)) return c + e;
  587. f || (f = .3 * d);
  588. g < Math.abs(e) ? (g = e, a = f / 4) : a = f / (2 * Math.PI) * Math.asin(e /
  589. g);
  590. return g * Math.pow(2, -10 * b) * Math.sin(2 * (b * d - a) * Math.PI / f) + e + c
  591. };
  592. d.fixStepE = function (a) {
  593. a = a.toExponential(0).split("e");
  594. var b = Number(a[1]);
  595. 9 == Number(a[0]) && b++;
  596. return d.generateNumber(1, b)
  597. };
  598. d.generateNumber = function (a, b) {
  599. var c = "", e;
  600. e = 0 > b ? Math.abs(b) - 1 : Math.abs(b);
  601. var d;
  602. for (d = 0; d < e; d++) c += "0";
  603. return 0 > b ? Number("0." + c + String(a)) : Number(String(a) + c)
  604. };
  605. d.setCN = function (a, b, c, e) {
  606. if (a.addClassNames && b && (b = b.node) && c) {
  607. var d = b.getAttribute("class");
  608. a = a.classNamePrefix + "-";
  609. e && (a = "");
  610. d ? b.setAttribute("class",
  611. d + " " + a + c) : b.setAttribute("class", a + c)
  612. }
  613. };
  614. d.parseDefs = function (a, b) {
  615. for (var c in a) {
  616. var e = typeof a[c];
  617. if (0 < a[c].length && "object" == e) for (var h = 0; h < a[c].length; h++) e = document.createElementNS(d.SVG_NS, c), b.appendChild(e), d.parseDefs(a[c][h], e); else "object" == e ? (e = document.createElementNS(d.SVG_NS, c), b.appendChild(e), d.parseDefs(a[c], e)) : b.setAttribute(c, a[c])
  618. }
  619. }
  620. })();
  621. (function () {
  622. var d = window.AmCharts;
  623. d.AxisBase = d.Class({
  624. construct: function (a) {
  625. this.createEvents("clickItem", "rollOverItem", "rollOutItem");
  626. this.titleDY = this.y = this.x = this.dy = this.dx = 0;
  627. this.axisThickness = 1;
  628. this.axisColor = "#000000";
  629. this.axisAlpha = 1;
  630. this.gridCount = this.tickLength = 5;
  631. this.gridAlpha = .15;
  632. this.gridThickness = 1;
  633. this.gridColor = "#000000";
  634. this.dashLength = 0;
  635. this.labelFrequency = 1;
  636. this.showLastLabel = this.showFirstLabel = !0;
  637. this.fillColor = "#FFFFFF";
  638. this.fillAlpha = 0;
  639. this.labelsEnabled = !0;
  640. this.labelRotation =
  641. 0;
  642. this.autoGridCount = !0;
  643. this.offset = 0;
  644. this.guides = [];
  645. this.visible = !0;
  646. this.counter = 0;
  647. this.guides = [];
  648. this.ignoreAxisWidth = this.inside = !1;
  649. this.minHorizontalGap = 75;
  650. this.minVerticalGap = 35;
  651. this.titleBold = !0;
  652. this.minorGridEnabled = !1;
  653. this.minorGridAlpha = .07;
  654. this.autoWrap = !1;
  655. this.titleAlign = "middle";
  656. this.labelOffset = 0;
  657. this.bcn = "axis-";
  658. this.centerLabels = !1;
  659. this.firstDayOfWeek = 1;
  660. this.centerLabelOnFullPeriod = this.markPeriodChange = this.boldPeriodBeginning = !0;
  661. this.periods = [{period: "ss", count: 1}, {period: "ss", count: 5},
  662. {period: "ss", count: 10}, {period: "ss", count: 30}, {period: "mm", count: 1}, {
  663. period: "mm",
  664. count: 5
  665. }, {period: "mm", count: 10}, {period: "mm", count: 30}, {period: "hh", count: 1}, {
  666. period: "hh",
  667. count: 3
  668. }, {period: "hh", count: 6}, {period: "hh", count: 12}, {period: "DD", count: 1}, {
  669. period: "DD",
  670. count: 2
  671. }, {period: "DD", count: 3}, {period: "DD", count: 4}, {period: "DD", count: 5}, {
  672. period: "WW",
  673. count: 1
  674. }, {period: "MM", count: 1}, {period: "MM", count: 2}, {period: "MM", count: 3}, {
  675. period: "MM",
  676. count: 6
  677. }, {period: "YYYY", count: 1}, {period: "YYYY", count: 2}, {
  678. period: "YYYY",
  679. count: 5
  680. }, {period: "YYYY", count: 10}, {period: "YYYY", count: 50}, {period: "YYYY", count: 100}];
  681. this.dateFormats = [{period: "fff", format: "JJ:NN:SS"}, {period: "ss", format: "JJ:NN:SS"}, {
  682. period: "mm",
  683. format: "JJ:NN"
  684. }, {period: "hh", format: "JJ:NN"}, {period: "DD", format: "MMM DD"}, {
  685. period: "WW",
  686. format: "MMM DD"
  687. }, {period: "MM", format: "MMM"}, {period: "YYYY", format: "YYYY"}];
  688. this.nextPeriod = {fff: "ss", ss: "mm", mm: "hh", hh: "DD", DD: "MM", MM: "YYYY"};
  689. d.applyTheme(this, a, "AxisBase")
  690. }, zoom: function (a, b) {
  691. this.start = a;
  692. this.end = b;
  693. this.dataChanged =
  694. !0;
  695. this.draw()
  696. }, fixAxisPosition: function () {
  697. var a = this.position;
  698. "H" == this.orientation ? ("left" == a && (a = "bottom"), "right" == a && (a = "top")) : ("bottom" == a && (a = "left"), "top" == a && (a = "right"));
  699. this.position = a
  700. }, init: function () {
  701. this.createBalloon()
  702. }, draw: function () {
  703. var a = this.chart;
  704. this.prevBY = this.prevBX = NaN;
  705. this.allLabels = [];
  706. this.counter = 0;
  707. this.destroy();
  708. this.fixAxisPosition();
  709. this.setBalloonBounds();
  710. this.labels = [];
  711. var b = a.container, c = b.set();
  712. a.gridSet.push(c);
  713. this.set = c;
  714. b = b.set();
  715. a.axesLabelsSet.push(b);
  716. this.labelsSet =
  717. b;
  718. this.axisLine = new this.axisRenderer(this);
  719. this.autoGridCount ? ("V" == this.orientation ? (a = this.height / this.minVerticalGap, 3 > a && (a = 3)) : a = this.width / this.minHorizontalGap, this.gridCountR = Math.max(a, 1)) : this.gridCountR = this.gridCount;
  720. this.axisWidth = this.axisLine.axisWidth;
  721. this.addTitle()
  722. }, setOrientation: function (a) {
  723. this.orientation = a ? "H" : "V"
  724. }, addTitle: function () {
  725. var a = this.title;
  726. this.titleLabel = null;
  727. if (a) {
  728. var b = this.chart, c = this.titleColor;
  729. void 0 === c && (c = b.color);
  730. var e = this.titleFontSize;
  731. isNaN(e) && (e =
  732. b.fontSize + 1);
  733. a = d.text(b.container, a, c, b.fontFamily, e, this.titleAlign, this.titleBold);
  734. d.setCN(b, a, this.bcn + "title");
  735. this.titleLabel = a
  736. }
  737. }, positionTitle: function () {
  738. var a = this.titleLabel;
  739. if (a) {
  740. var b, c, e = this.labelsSet, h = {};
  741. 0 < e.length() ? h = e.getBBox() : (h.x = 0, h.y = 0, h.width = this.width, h.height = this.height, d.VML && (h.y += this.y, h.x += this.x));
  742. e.push(a);
  743. var e = h.x, f = h.y;
  744. d.VML && (this.rotate ? e -= this.x : f -= this.y);
  745. var g = h.width, h = h.height, k = this.width, l = this.height, m = 0, n = a.getBBox().height / 2,
  746. q = this.inside, p = this.titleAlign;
  747. switch (this.position) {
  748. case "top":
  749. b = "left" == p ? -1 : "right" == p ? k : k / 2;
  750. c = f - 10 - n;
  751. break;
  752. case "bottom":
  753. b = "left" == p ? -1 : "right" == p ? k : k / 2;
  754. c = f + h + 10 + n;
  755. break;
  756. case "left":
  757. b = e - 10 - n;
  758. q && (b -= 5);
  759. m = -90;
  760. c = ("left" == p ? l + 1 : "right" == p ? -1 : l / 2) + this.titleDY;
  761. break;
  762. case "right":
  763. b = e + g + 10 + n, q && (b += 7), c = ("left" == p ? l + 2 : "right" == p ? -2 : l / 2) + this.titleDY, m = -90
  764. }
  765. this.marginsChanged ? (a.translate(b, c), this.tx = b, this.ty = c) : a.translate(this.tx, this.ty);
  766. this.marginsChanged = !1;
  767. isNaN(this.titleRotation) || (m = this.titleRotation);
  768. 0 !== m && a.rotate(m)
  769. }
  770. },
  771. pushAxisItem: function (a, b) {
  772. var c = this, e = a.graphics();
  773. 0 < e.length() && (b ? c.labelsSet.push(e) : c.set.push(e));
  774. if (e = a.getLabel()) this.labelsSet.push(e), e.click(function (b) {
  775. c.handleMouse(b, a, "clickItem")
  776. }).mouseover(function (b) {
  777. c.handleMouse(b, a, "rollOverItem")
  778. }).mouseout(function (b) {
  779. c.handleMouse(b, a, "rollOutItem")
  780. })
  781. }, handleMouse: function (a, b, c) {
  782. this.fire({
  783. type: c,
  784. value: b.value,
  785. serialDataItem: b.serialDataItem,
  786. axis: this,
  787. target: b.label,
  788. chart: this.chart,
  789. event: a
  790. })
  791. }, addGuide: function (a) {
  792. for (var b = this.guides,
  793. c = !1, e = b.length, h = 0; h < b.length; h++) b[h] == a && (c = !0, e = h);
  794. a = d.processObject(a, d.Guide, this.theme);
  795. a.id || (a.id = "guideAuto" + e + "_" + (new Date).getTime());
  796. c || b.push(a)
  797. }, removeGuide: function (a) {
  798. var b = this.guides, c;
  799. for (c = 0; c < b.length; c++) b[c] == a && b.splice(c, 1)
  800. }, handleGuideOver: function (a) {
  801. clearTimeout(this.chart.hoverInt);
  802. var b = a.graphics.getBBox(), c = this.x + b.x + b.width / 2, b = this.y + b.y + b.height / 2,
  803. e = a.fillColor;
  804. void 0 === e && (e = a.lineColor);
  805. this.chart.showBalloon(a.balloonText, e, !0, c, b)
  806. }, handleGuideOut: function () {
  807. this.chart.hideBalloon()
  808. },
  809. addEventListeners: function (a, b) {
  810. var c = this;
  811. a.mouseover(function () {
  812. c.handleGuideOver(b)
  813. });
  814. a.touchstart(function () {
  815. c.handleGuideOver(b)
  816. });
  817. a.mouseout(function () {
  818. c.handleGuideOut(b)
  819. })
  820. }, getBBox: function () {
  821. var a;
  822. this.labelsSet && (a = this.labelsSet.getBBox());
  823. a ? d.VML || (a = {x: a.x + this.x, y: a.y + this.y, width: a.width, height: a.height}) : a = {
  824. x: 0,
  825. y: 0,
  826. width: 0,
  827. height: 0
  828. };
  829. return a
  830. }, destroy: function () {
  831. d.remove(this.set);
  832. d.remove(this.labelsSet);
  833. var a = this.axisLine;
  834. a && d.remove(a.axisSet);
  835. d.remove(this.grid0)
  836. }, chooseMinorFrequency: function (a) {
  837. for (var b =
  838. 10; 0 < b; b--) if (a / b == Math.round(a / b)) return a / b
  839. }, parseDatesDraw: function () {
  840. var a, b = this.chart, c = this.showFirstLabel, e = this.showLastLabel, h, f = "",
  841. g = d.extractPeriod(this.minPeriod), k = d.getPeriodDuration(g.period, g.count), l, m, n, q, p,
  842. t = this.firstDayOfWeek, r = this.boldPeriodBeginning;
  843. a = this.minorGridEnabled;
  844. var u, y = this.gridAlpha, x, w = this.choosePeriod(0), B = w.period, w = w.count,
  845. z = d.getPeriodDuration(B, w);
  846. z < k && (B = g.period, w = g.count, z = k);
  847. g = B;
  848. "WW" == g && (g = "DD");
  849. this.stepWidth = this.getStepWidth(this.timeDifference);
  850. var A = Math.ceil(this.timeDifference / z) + 5,
  851. C = l = d.resetDateToMin(new Date(this.startTime - z), B, w, t).getTime();
  852. if (g == B && 1 == w && this.centerLabelOnFullPeriod || this.autoWrap || this.centerLabels) n = z * this.stepWidth, this.autoWrap && !this.centerLabels && (n = -n);
  853. this.cellWidth = k * this.stepWidth;
  854. q = Math.round(l / z);
  855. k = -1;
  856. q / 2 == Math.round(q / 2) && (k = -2, l -= z);
  857. q = this.firstTime;
  858. var D = 0, J = 0;
  859. a && 1 < w && (u = this.chooseMinorFrequency(w), x = d.getPeriodDuration(B, u), "DD" == B && (x += d.getPeriodDuration("hh")));
  860. if (0 < this.gridCountR) for (A - 5 - k >
  861. this.autoRotateCount && !isNaN(this.autoRotateAngle) && (this.labelRotationR = this.autoRotateAngle), a = k; a <= A; a++) {
  862. p = q + z * (a + Math.floor((C - q) / z)) - D;
  863. "DD" == B && (p += 36E5);
  864. p = d.resetDateToMin(new Date(p), B, w, t).getTime();
  865. "MM" == B && (h = (p - l) / z, 1.5 <= (p - l) / z && (p = p - (h - 1) * z + d.getPeriodDuration("DD", 3), p = d.resetDateToMin(new Date(p), B, 1).getTime(), D += z));
  866. h = (p - this.startTime) * this.stepWidth;
  867. if ("radar" == b.type) {
  868. if (h = this.axisWidth - h, 0 > h || h > this.axisWidth) continue
  869. } else this.rotate ? "date" == this.type && "middle" == this.gridPosition &&
  870. (J = -z * this.stepWidth / 2) : "date" == this.type && (h = this.axisWidth - h);
  871. f = !1;
  872. this.nextPeriod[g] && (f = this.checkPeriodChange(this.nextPeriod[g], 1, p, l, g));
  873. l = !1;
  874. f && this.markPeriodChange ? (f = this.dateFormatsObject[this.nextPeriod[g]], this.twoLineMode && (f = this.dateFormatsObject[g] + "\n" + f, f = d.fixBrakes(f)), l = !0) : f = this.dateFormatsObject[g];
  875. r || (l = !1);
  876. this.currentDateFormat = f;
  877. f = d.formatDate(new Date(p), f, b);
  878. if (a == k && !c || a == A && !e) f = " ";
  879. this.labelFunction && (f = this.labelFunction(f, new Date(p), this, B, w, m).toString());
  880. this.boldLabels && (l = !0);
  881. m = new this.axisItemRenderer(this, h, f, !1, n, J, !1, l);
  882. this.pushAxisItem(m);
  883. m = l = p;
  884. if (!isNaN(u)) for (h = 1; h < w; h += u) this.gridAlpha = this.minorGridAlpha, f = p + x * h, f = d.resetDateToMin(new Date(f), B, u, t).getTime(), f = new this.axisItemRenderer(this, (f - this.startTime) * this.stepWidth, void 0, void 0, void 0, void 0, void 0, void 0, void 0, !0), this.pushAxisItem(f);
  885. this.gridAlpha = y
  886. }
  887. }, choosePeriod: function (a) {
  888. var b = d.getPeriodDuration(this.periods[a].period, this.periods[a].count), c = this.periods;
  889. return this.timeDifference <
  890. b && 0 < a ? c[a - 1] : Math.ceil(this.timeDifference / b) <= this.gridCountR ? c[a] : a + 1 < c.length ? this.choosePeriod(a + 1) : c[a]
  891. }, getStepWidth: function (a) {
  892. var b;
  893. this.startOnAxis ? (b = this.axisWidth / (a - 1), 1 == a && (b = this.axisWidth)) : b = this.axisWidth / a;
  894. return b
  895. }, timeZoom: function (a, b) {
  896. this.startTime = a;
  897. this.endTime = b
  898. }, minDuration: function () {
  899. var a = d.extractPeriod(this.minPeriod);
  900. return d.getPeriodDuration(a.period, a.count)
  901. }, checkPeriodChange: function (a, b, c, e, h) {
  902. c = new Date(c);
  903. var f = new Date(e), g = this.firstDayOfWeek;
  904. e = b;
  905. "DD" ==
  906. a && (b = 1);
  907. c = d.resetDateToMin(c, a, b, g).getTime();
  908. b = d.resetDateToMin(f, a, b, g).getTime();
  909. return "DD" == a && "hh" != h && c - b < d.getPeriodDuration(a, e) ? !1 : c != b ? !0 : !1
  910. }, generateDFObject: function () {
  911. this.dateFormatsObject = {};
  912. var a;
  913. for (a = 0; a < this.dateFormats.length; a++) {
  914. var b = this.dateFormats[a];
  915. this.dateFormatsObject[b.period] = b.format
  916. }
  917. }, hideBalloon: function () {
  918. this.balloon && this.balloon.hide && this.balloon.hide();
  919. this.prevBY = this.prevBX = NaN
  920. }, formatBalloonText: function (a) {
  921. return a
  922. }, showBalloon: function (a, b, c, e) {
  923. var d =
  924. this.offset;
  925. switch (this.position) {
  926. case "bottom":
  927. b = this.height + d;
  928. break;
  929. case "top":
  930. b = -d;
  931. break;
  932. case "left":
  933. a = -d;
  934. break;
  935. case "right":
  936. a = this.width + d
  937. }
  938. c || (c = this.currentDateFormat);
  939. if ("V" == this.orientation) {
  940. if (0 > b || b > this.height) return;
  941. if (isNaN(b)) {
  942. this.hideBalloon();
  943. return
  944. }
  945. b = this.adjustBalloonCoordinate(b, e);
  946. e = this.coordinateToValue(b)
  947. } else {
  948. if (0 > a || a > this.width) return;
  949. if (isNaN(a)) {
  950. this.hideBalloon();
  951. return
  952. }
  953. a = this.adjustBalloonCoordinate(a, e);
  954. e = this.coordinateToValue(a)
  955. }
  956. var f;
  957. if (d = this.chart.chartCursor) f =
  958. d.index;
  959. this.balloon && void 0 !== e && this.balloon.enabled && (this.balloonTextFunction ? e = this.balloonTextFunction(e) : this.balloonText ? e = this.formatBalloonText(this.balloonText, f, c) : isNaN(e) || (e = this.formatValue(e, c)), a != this.prevBX || b != this.prevBY) && (this.balloon.setPosition(a, b), this.prevBX = a, this.prevBY = b, e && this.balloon.showBalloon(e))
  960. }, adjustBalloonCoordinate: function (a) {
  961. return a
  962. }, createBalloon: function () {
  963. var a = this.chart, b = a.chartCursor;
  964. b && (b = b.cursorPosition, "mouse" != b && (this.stickBalloonToCategory =
  965. !0), "start" == b && (this.stickBalloonToStart = !0), "ValueAxis" == this.cname && (this.stickBalloonToCategory = !1));
  966. this.balloon && (this.balloon.destroy && this.balloon.destroy(), d.extend(this.balloon, a.balloon, !0))
  967. }, setBalloonBounds: function () {
  968. var a = this.balloon;
  969. if (a) {
  970. var b = this.chart;
  971. a.cornerRadius = 0;
  972. a.shadowAlpha = 0;
  973. a.borderThickness = 1;
  974. a.borderAlpha = 1;
  975. a.adjustBorderColor = !1;
  976. a.showBullet = !1;
  977. this.balloon = a;
  978. a.chart = b;
  979. a.mainSet = b.plotBalloonsSet;
  980. a.pointerWidth = this.tickLength;
  981. if (this.parseDates || "date" == this.type) a.pointerWidth =
  982. 0;
  983. b = "V";
  984. "V" == this.orientation && (b = "H");
  985. this.stickBalloonToCategory || (a.animationDuration = 0);
  986. var c, e, d, f, g = this.inside, k = this.width, l = this.height;
  987. switch (this.position) {
  988. case "bottom":
  989. c = 0;
  990. e = k;
  991. g ? (d = 0, f = l) : (d = l, f = l + 1E3);
  992. break;
  993. case "top":
  994. c = 0;
  995. e = k;
  996. g ? (d = 0, f = l) : (d = -1E3, f = 0);
  997. break;
  998. case "left":
  999. d = 0;
  1000. f = l;
  1001. g ? (c = 0, e = k) : (c = -1E3, e = 0);
  1002. break;
  1003. case "right":
  1004. d = 0, f = l, g ? (c = 0, e = k) : (c = k, e = k + 1E3)
  1005. }
  1006. a.drop || (a.pointerOrientation = b);
  1007. a.setBounds(c, d, e, f)
  1008. }
  1009. }
  1010. })
  1011. })();
  1012. (function () {
  1013. var d = window.AmCharts;
  1014. d.ValueAxis = d.Class({
  1015. inherits: d.AxisBase, construct: function (a) {
  1016. this.cname = "ValueAxis";
  1017. this.createEvents("axisChanged", "logarithmicAxisFailed", "axisZoomed");
  1018. d.ValueAxis.base.construct.call(this, a);
  1019. this.dataChanged = !0;
  1020. this.stackType = "none";
  1021. this.position = "left";
  1022. this.unitPosition = "right";
  1023. this.includeAllValues = this.recalculateToPercents = this.includeHidden = this.includeGuidesInMinMax = this.integersOnly = !1;
  1024. this.durationUnits = {DD: "d. ", hh: ":", mm: ":", ss: ""};
  1025. this.scrollbar = !1;
  1026. this.baseValue = 0;
  1027. this.radarCategoriesEnabled = !0;
  1028. this.gridType = "polygons";
  1029. this.useScientificNotation = !1;
  1030. this.axisTitleOffset = 10;
  1031. this.pointPosition = "axis";
  1032. this.minMaxMultiplier = 1;
  1033. this.logGridLimit = 2;
  1034. this.totalTextOffset = this.treatZeroAs = 0;
  1035. this.minPeriod = "ss";
  1036. this.relativeStart = 0;
  1037. this.relativeEnd = 1;
  1038. d.applyTheme(this, a, this.cname)
  1039. }, updateData: function () {
  1040. 0 >= this.gridCountR && (this.gridCountR = 1);
  1041. this.totals = [];
  1042. this.data = this.chart.chartData;
  1043. var a = this.chart;
  1044. "xy" != a.type && (this.stackGraphs("smoothedLine"),
  1045. this.stackGraphs("line"), this.stackGraphs("column"), this.stackGraphs("step"));
  1046. this.recalculateToPercents && this.recalculate();
  1047. this.synchronizationMultiplier && this.synchronizeWith ? (d.isString(this.synchronizeWith) && (this.synchronizeWith = a.getValueAxisById(this.synchronizeWith)), this.synchronizeWith && (this.synchronizeWithAxis(this.synchronizeWith), this.foundGraphs = !0)) : (this.foundGraphs = !1, this.getMinMax(), 0 === this.start && this.end == this.data.length - 1 && isNaN(this.minZoom) && isNaN(this.maxZoom) && (this.fullMin =
  1048. this.min, this.fullMax = this.max, "date" != this.type && (isNaN(this.minimum) || (this.fullMin = this.minimum), isNaN(this.maximum) || (this.fullMax = this.maximum)), this.logarithmic && (this.fullMin = this.logMin, 0 === this.fullMin && (this.fullMin = this.treatZeroAs)), "date" == this.type && (this.minimumDate || (this.fullMin = this.minRR), this.maximumDate || (this.fullMax = this.maxRR))))
  1049. }, draw: function () {
  1050. d.ValueAxis.base.draw.call(this);
  1051. var a = this.chart, b = this.set;
  1052. this.labelRotationR = this.labelRotation;
  1053. d.setCN(a, this.set, "value-axis value-axis-" +
  1054. this.id);
  1055. d.setCN(a, this.labelsSet, "value-axis value-axis-" + this.id);
  1056. d.setCN(a, this.axisLine.axisSet, "value-axis value-axis-" + this.id);
  1057. var c = this.type;
  1058. "duration" == c && (this.duration = "ss");
  1059. !0 === this.dataChanged && (this.updateData(), this.dataChanged = !1);
  1060. "date" == c && (this.logarithmic = !1, this.min = this.minRR, this.max = this.maxRR, this.reversed = !1, this.getDateMinMax());
  1061. if (this.logarithmic) {
  1062. var e = this.treatZeroAs, h = this.getExtremes(0, this.data.length - 1).min;
  1063. this.logMin = h;
  1064. this.minReal < h && (this.minReal = h);
  1065. isNaN(this.minReal) &&
  1066. (this.minReal = h);
  1067. 0 < e && 0 === h && (this.minReal = h = e);
  1068. if (0 >= h || 0 >= this.minimum) {
  1069. this.fire({type: "logarithmicAxisFailed", chart: a});
  1070. return
  1071. }
  1072. }
  1073. this.grid0 = null;
  1074. var f, g, k = a.dx, l = a.dy, e = !1, h = this.logarithmic;
  1075. if (isNaN(this.min) || isNaN(this.max) || !this.foundGraphs || Infinity == this.min || -Infinity == this.max) e = !0; else {
  1076. var m = this.labelFrequency, n = this.showFirstLabel, q = this.showLastLabel, p = 1;
  1077. f = 0;
  1078. this.minCalc = this.min;
  1079. this.maxCalc = this.max;
  1080. this.strictMinMax && (isNaN(this.minimum) || (this.min = this.minimum), isNaN(this.maximum) ||
  1081. (this.max = this.maximum));
  1082. isNaN(this.minZoom) || (this.minReal = this.min = this.minZoom);
  1083. isNaN(this.maxZoom) || (this.max = this.maxZoom);
  1084. if (this.logarithmic) {
  1085. var t = Math.log(this.fullMax) * Math.LOG10E - Math.log(this.fullMin) * Math.LOG10E,
  1086. r = Math.log(this.max) / Math.LN10 - Math.log(this.fullMin) * Math.LOG10E;
  1087. this.relativeStart = (Math.log(this.minReal) / Math.LN10 - Math.log(this.fullMin) * Math.LOG10E) / t;
  1088. this.relativeEnd = r / t
  1089. } else this.relativeStart = d.fitToBounds((this.min - this.fullMin) / (this.fullMax - this.fullMin), 0, 1), this.relativeEnd =
  1090. d.fitToBounds((this.max - this.fullMin) / (this.fullMax - this.fullMin), 0, 1);
  1091. var t = Math.round((this.maxCalc - this.minCalc) / this.step) + 1, u;
  1092. !0 === h ? (u = Math.log(this.max) * Math.LOG10E - Math.log(this.minReal) * Math.LOG10E, this.stepWidth = this.axisWidth / u, u > this.logGridLimit && (t = Math.ceil(Math.log(this.max) * Math.LOG10E) + 1, f = Math.round(Math.log(this.minReal) * Math.LOG10E), t > this.gridCountR && (p = Math.ceil(t / this.gridCountR)))) : this.stepWidth = this.axisWidth / (this.max - this.min);
  1093. var y = 0;
  1094. 1 > this.step && -1 < this.step && (y = d.getDecimals(this.step));
  1095. this.integersOnly && (y = 0);
  1096. y > this.maxDecCount && (y = this.maxDecCount);
  1097. r = this.precision;
  1098. isNaN(r) || (y = r);
  1099. isNaN(this.maxZoom) && (this.max = d.roundTo(this.max, this.maxDecCount), this.min = d.roundTo(this.min, this.maxDecCount));
  1100. g = {};
  1101. g.precision = y;
  1102. g.decimalSeparator = a.nf.decimalSeparator;
  1103. g.thousandsSeparator = a.nf.thousandsSeparator;
  1104. this.numberFormatter = g;
  1105. var x, w = this.guides, B = w.length;
  1106. if (0 < B) {
  1107. var z = this.fillAlpha;
  1108. for (g = this.fillAlpha = 0; g < B; g++) {
  1109. var A = w[g], C = NaN, D = A.above;
  1110. isNaN(A.toValue) || (C = this.getCoordinate(A.toValue),
  1111. x = new this.axisItemRenderer(this, C, "", !0, NaN, NaN, A), this.pushAxisItem(x, D));
  1112. var J = NaN;
  1113. isNaN(A.value) || (J = this.getCoordinate(A.value), x = new this.axisItemRenderer(this, J, A.label, !0, NaN, (C - J) / 2, A), this.pushAxisItem(x, D));
  1114. isNaN(C) && (J -= 3, C = J + 3);
  1115. isNaN(C - J) || (x = new this.guideFillRenderer(this, J, C, A), this.pushAxisItem(x, D), x = x.graphics(), A.graphics = x, A.balloonText && this.addEventListeners(x, A))
  1116. }
  1117. this.fillAlpha = z
  1118. }
  1119. this.exponential = !1;
  1120. for (g = f; g < t; g += p) w = d.roundTo(this.step * g + this.min, y), -1 != String(w).indexOf("e") &&
  1121. (this.exponential = !0);
  1122. this.duration && (this.maxInterval = d.getMaxInterval(this.max, this.duration));
  1123. var y = this.step, H, w = this.minorGridAlpha;
  1124. this.minorGridEnabled && (H = this.getMinorGridStep(y, this.stepWidth * y));
  1125. if (this.autoGridCount || 0 !== this.gridCount) if ("date" == c) this.generateDFObject(), this.timeDifference = this.max - this.min, this.maxTime = this.lastTime = this.max, this.startTime = this.firstTime = this.min, this.parseDatesDraw(); else for (t >= this.autoRotateCount && !isNaN(this.autoRotateAngle) && (this.labelRotationR =
  1126. this.autoRotateAngle), h && t++, g = f; g < t; g += p) if (c = y * g + this.minCalc, c = d.roundTo(c, this.maxDecCount + 1), !this.integersOnly || Math.round(c) == c) if (isNaN(r) || Number(d.toFixed(c, r)) == c) {
  1127. !0 === h && (0 === c && (c = this.minReal), u > this.logGridLimit && (c = Math.pow(10, g)));
  1128. x = this.formatValue(c, !1, g);
  1129. Math.round(g / m) != g / m && (x = void 0);
  1130. if (0 === g && !n || g == t - 1 && !q) x = " ";
  1131. f = this.getCoordinate(c);
  1132. var R;
  1133. this.rotate && this.autoWrap && (R = this.stepWidth * y - 10);
  1134. x = new this.axisItemRenderer(this, f, x, void 0, R, void 0, void 0, this.boldLabels);
  1135. this.pushAxisItem(x);
  1136. if (c == this.baseValue && "radar" != a.type) {
  1137. var L, P;
  1138. x = this.width;
  1139. B = this.height;
  1140. "H" == this.orientation ? 0 <= f && f <= x + 1 && (L = [f, f, f + k], P = [B, 0, l]) : 0 <= f && f <= B + 1 && (L = [0, x, x + k], P = [f, f, f + l]);
  1141. L && (f = d.fitToBounds(2 * this.gridAlpha, 0, 1), isNaN(this.zeroGridAlpha) || (f = this.zeroGridAlpha), f = d.line(a.container, L, P, this.gridColor, f, 1, this.dashLength), f.translate(this.x, this.y), this.grid0 = f, a.axesSet.push(f), f.toBack(), d.setCN(a, f, this.bcn + "zero-grid-" + this.id), d.setCN(a, f, this.bcn + "zero-grid"))
  1142. }
  1143. if (!isNaN(H) && 0 < w && g < t - 1) {
  1144. f =
  1145. y / H;
  1146. h && (H = y * (g + p) + this.minCalc, H = d.roundTo(H, this.maxDecCount + 1), u > this.logGridLimit && (H = Math.pow(10, g + p)), f = 10, H = (H - c) / f);
  1147. x = this.gridAlpha;
  1148. this.gridAlpha = this.minorGridAlpha;
  1149. for (B = 1; B < f; B++) z = this.getCoordinate(c + H * B), z = new this.axisItemRenderer(this, z, "", !1, 0, 0, !1, !1, 0, !0), this.pushAxisItem(z);
  1150. this.gridAlpha = x
  1151. }
  1152. }
  1153. u = this.baseValue;
  1154. this.min > this.baseValue && this.max > this.baseValue && (u = this.min);
  1155. this.min < this.baseValue && this.max < this.baseValue && (u = this.max);
  1156. h && u < this.minReal && (u = this.minReal);
  1157. this.baseCoord =
  1158. this.getCoordinate(u, !0);
  1159. u = {type: "axisChanged", target: this, chart: a};
  1160. u.min = h ? this.minReal : this.min;
  1161. u.max = this.max;
  1162. this.fire(u);
  1163. this.axisCreated = !0
  1164. }
  1165. h = this.axisLine.set;
  1166. u = this.labelsSet;
  1167. b.translate(this.x, this.y);
  1168. u.translate(this.x, this.y);
  1169. this.positionTitle();
  1170. "radar" != a.type && h.toFront();
  1171. !this.visible || e ? (b.hide(), h.hide(), u.hide()) : (b.show(), h.show(), u.show());
  1172. this.axisY = this.y;
  1173. this.axisX = this.x
  1174. }, getDateMinMax: function () {
  1175. this.minimumDate && (this.minimumDate instanceof Date || (this.minimumDate = d.getDate(this.minimumDate,
  1176. this.chart.dataDateFormat, "fff")), this.min = this.minimumDate.getTime());
  1177. this.maximumDate && (this.maximumDate instanceof Date || (this.maximumDate = d.getDate(this.maximumDate, this.chart.dataDateFormat, "fff")), this.max = this.maximumDate.getTime())
  1178. }, formatValue: function (a, b, c) {
  1179. var e = this.exponential, h = this.logarithmic, f = this.numberFormatter, g = this.chart;
  1180. if (f) return !0 === this.logarithmic && (e = -1 != String(a).indexOf("e") ? !0 : !1), this.useScientificNotation && (e = !0), this.usePrefixes && (e = !1), e ? (c = -1 == String(a).indexOf("e") ?
  1181. a.toExponential(15) : String(a), e = c.split("e"), c = Number(e[0]), e = Number(e[1]), c = d.roundTo(c, 14), 10 == c && (c = 1, e += 1), c = c + "e" + e, 0 === a && (c = "0"), 1 == a && (c = "1")) : (h && (e = String(a).split("."), e[1] ? (f.precision = e[1].length, 0 > c && (f.precision = Math.abs(c)), b && 1 < a && (f.precision = 0)) : f.precision = -1), c = this.usePrefixes ? d.addPrefix(a, g.prefixesOfBigNumbers, g.prefixesOfSmallNumbers, f, !b) : d.formatNumber(a, f, f.precision)), this.duration && (b && (f.precision = 0), c = d.formatDuration(a, this.duration, "", this.durationUnits, this.maxInterval,
  1182. f)), "date" == this.type && (c = d.formatDate(new Date(a), this.currentDateFormat, g)), this.recalculateToPercents ? c += "%" : (b = this.unit) && (c = "left" == this.unitPosition ? b + c : c + b), this.labelFunction && (c = "date" == this.type ? this.labelFunction(c, new Date(a), this).toString() : this.labelFunction(a, c, this).toString()), c
  1183. }, getMinorGridStep: function (a, b) {
  1184. var c = [5, 4, 2];
  1185. 60 > b && c.shift();
  1186. for (var e = Math.floor(Math.log(Math.abs(a)) * Math.LOG10E), d = 0; d < c.length; d++) {
  1187. var f = a / c[d], g = Math.floor(Math.log(Math.abs(f)) * Math.LOG10E);
  1188. if (!(1 <
  1189. Math.abs(e - g))) if (1 > a) {
  1190. if (g = Math.pow(10, -g) * f, g == Math.round(g)) return f
  1191. } else if (f == Math.round(f)) return f
  1192. }
  1193. }, stackGraphs: function (a) {
  1194. var b = this.stackType;
  1195. "stacked" == b && (b = "regular");
  1196. "line" == b && (b = "none");
  1197. "100% stacked" == b && (b = "100%");
  1198. this.stackType = b;
  1199. var c = [], e = [], h = [], f = [], g, k = this.chart.graphs, l, m, n, q, p, t = this.baseValue, r = !1;
  1200. if ("line" == a || "step" == a || "smoothedLine" == a) r = !0;
  1201. if (r && ("regular" == b || "100%" == b)) for (q = 0; q < k.length; q++) n = k[q], n.stackGraph = null, n.hidden || (m = n.type, n.chart == this.chart && n.valueAxis ==
  1202. this && a == m && n.stackable && (l && (n.stackGraph = l), l = n));
  1203. n = this.start - 10;
  1204. l = this.end + 10;
  1205. q = this.data.length - 1;
  1206. n = d.fitToBounds(n, 0, q);
  1207. l = d.fitToBounds(l, 0, q);
  1208. for (p = n; p <= l; p++) {
  1209. var u = 0;
  1210. for (q = 0; q < k.length; q++) if (n = k[q], n.hidden) n.newStack && (h[p] = NaN, e[p] = NaN); else if (m = n.type, n.chart == this.chart && n.valueAxis == this && a == m && n.stackable) if (m = this.data[p].axes[this.id].graphs[n.id], g = m.values.value, isNaN(g)) n.newStack && (h[p] = NaN, e[p] = NaN); else {
  1211. var y = d.getDecimals(g);
  1212. u < y && (u = y);
  1213. isNaN(f[p]) ? f[p] = Math.abs(g) : f[p] +=
  1214. Math.abs(g);
  1215. f[p] = d.roundTo(f[p], u);
  1216. y = n.fillToGraph;
  1217. r && y && (y = this.data[p].axes[this.id].graphs[y.id]) && (m.values.open = y.values.value);
  1218. "regular" == b && (r && (isNaN(c[p]) ? (c[p] = g, m.values.close = g, m.values.open = this.baseValue) : (isNaN(g) ? m.values.close = c[p] : m.values.close = g + c[p], m.values.open = c[p], c[p] = m.values.close)), "column" == a && (n.newStack && (h[p] = NaN, e[p] = NaN), m.values.close = g, 0 > g ? (m.values.close = g, isNaN(e[p]) ? m.values.open = t : (m.values.close += e[p], m.values.open = e[p]), e[p] = m.values.close) : (m.values.close =
  1219. g, isNaN(h[p]) ? m.values.open = t : (m.values.close += h[p], m.values.open = h[p]), h[p] = m.values.close)))
  1220. }
  1221. }
  1222. for (p = this.start; p <= this.end; p++) for (q = 0; q < k.length; q++) (n = k[q], n.hidden) ? n.newStack && (h[p] = NaN, e[p] = NaN) : (m = n.type, n.chart == this.chart && n.valueAxis == this && a == m && n.stackable && (m = this.data[p].axes[this.id].graphs[n.id], g = m.values.value, isNaN(g) || (c = g / f[p] * 100, m.values.percents = c, m.values.total = f[p], n.newStack && (h[p] = NaN, e[p] = NaN), "100%" == b && (isNaN(e[p]) && (e[p] = 0), isNaN(h[p]) && (h[p] = 0), 0 > c ? (m.values.close =
  1223. d.fitToBounds(c + e[p], -100, 100), m.values.open = e[p], e[p] = m.values.close) : (m.values.close = d.fitToBounds(c + h[p], -100, 100), m.values.open = h[p], h[p] = m.values.close)))))
  1224. }, recalculate: function () {
  1225. var a = this.chart, b = a.graphs, c;
  1226. for (c = 0; c < b.length; c++) {
  1227. var e = b[c];
  1228. if (e.valueAxis == this) {
  1229. var h = "value";
  1230. if ("candlestick" == e.type || "ohlc" == e.type) h = "open";
  1231. var f, g, k = this.end + 2, k = d.fitToBounds(this.end + 1, 0, this.data.length - 1),
  1232. l = this.start;
  1233. 0 < l && l--;
  1234. var m;
  1235. g = this.start;
  1236. e.compareFromStart && (g = 0);
  1237. if (!isNaN(a.startTime) && (m =
  1238. a.categoryAxis)) {
  1239. var n = m.minDuration(), n = new Date(a.startTime + n / 2),
  1240. q = d.resetDateToMin(new Date(a.startTime), m.minPeriod).getTime();
  1241. d.resetDateToMin(new Date(n), m.minPeriod).getTime() > q && g++
  1242. }
  1243. if (m = a.recalculateFromDate) m = d.getDate(m, a.dataDateFormat, "fff"), g = a.getClosestIndex(a.chartData, "time", m.getTime(), !0, 0, a.chartData.length), k = a.chartData.length - 1;
  1244. for (m = g; m <= k && (g = this.data[m].axes[this.id].graphs[e.id], f = g.values[h], e.recalculateValue && (f = g.dataContext[e.valueField + e.recalculateValue]), isNaN(f)); m++) ;
  1245. this.recBaseValue = f;
  1246. for (h = l; h <= k; h++) {
  1247. g = this.data[h].axes[this.id].graphs[e.id];
  1248. g.percents = {};
  1249. var l = g.values, p;
  1250. for (p in l) g.percents[p] = "percents" != p ? l[p] / f * 100 - 100 : l[p]
  1251. }
  1252. }
  1253. }
  1254. }, getMinMax: function () {
  1255. var a = !1, b = this.chart, c = b.graphs, e;
  1256. for (e = 0; e < c.length; e++) {
  1257. var h = c[e].type;
  1258. ("line" == h || "step" == h || "smoothedLine" == h) && this.expandMinMax && (a = !0)
  1259. }
  1260. a && (0 < this.start && this.start--, this.end < this.data.length - 1 && this.end++);
  1261. "serial" == b.type && (!0 !== b.categoryAxis.parseDates || a || this.end < this.data.length - 1 && this.end++);
  1262. this.includeAllValues && (this.start = 0, this.end = this.data.length - 1);
  1263. a = this.minMaxMultiplier;
  1264. b = this.getExtremes(this.start, this.end);
  1265. this.min = b.min;
  1266. this.max = b.max;
  1267. this.minRR = this.min;
  1268. this.maxRR = this.max;
  1269. a = (this.max - this.min) * (a - 1);
  1270. this.min -= a;
  1271. this.max += a;
  1272. a = this.guides.length;
  1273. if (this.includeGuidesInMinMax && 0 < a) for (b = 0; b < a; b++) c = this.guides[b], c.toValue < this.min && (this.min = c.toValue), c.value < this.min && (this.min = c.value), c.toValue > this.max && (this.max = c.toValue), c.value > this.max && (this.max = c.value);
  1274. isNaN(this.minimum) ||
  1275. (this.min = this.minimum);
  1276. isNaN(this.maximum) || (this.max = this.maximum);
  1277. "date" == this.type && this.getDateMinMax();
  1278. this.min > this.max && (a = this.max, this.max = this.min, this.min = a);
  1279. isNaN(this.minZoom) || (this.min = this.minZoom);
  1280. isNaN(this.maxZoom) || (this.max = this.maxZoom);
  1281. this.minCalc = this.min;
  1282. this.maxCalc = this.max;
  1283. this.minReal = this.min;
  1284. this.maxReal = this.max;
  1285. 0 === this.min && 0 === this.max && (this.max = 9);
  1286. this.min > this.max && (this.min = this.max - 1);
  1287. a = this.min;
  1288. b = this.max;
  1289. c = this.max - this.min;
  1290. e = 0 === c ? Math.pow(10, Math.floor(Math.log(Math.abs(this.max)) *
  1291. Math.LOG10E)) / 10 : Math.pow(10, Math.floor(Math.log(Math.abs(c)) * Math.LOG10E)) / 10;
  1292. isNaN(this.maximum) && (this.max = Math.ceil(this.max / e) * e + e);
  1293. isNaN(this.minimum) && (this.min = Math.floor(this.min / e) * e - e);
  1294. 0 > this.min && 0 <= a && (this.min = 0);
  1295. 0 < this.max && 0 >= b && (this.max = 0);
  1296. "100%" == this.stackType && (this.min = 0 > this.min ? -100 : 0, this.max = 0 > this.max ? 0 : 100);
  1297. c = this.max - this.min;
  1298. e = Math.pow(10, Math.floor(Math.log(Math.abs(c)) * Math.LOG10E)) / 10;
  1299. this.step = Math.ceil(c / this.gridCountR / e) * e;
  1300. c = Math.pow(10, Math.floor(Math.log(Math.abs(this.step)) *
  1301. Math.LOG10E));
  1302. c = d.fixStepE(c);
  1303. e = Math.ceil(this.step / c);
  1304. 5 < e && (e = 10);
  1305. 5 >= e && 2 < e && (e = 5);
  1306. this.step = Math.ceil(this.step / (c * e)) * c * e;
  1307. 1 > c ? (this.maxDecCount = Math.abs(Math.log(Math.abs(c)) * Math.LOG10E), this.maxDecCount = Math.round(this.maxDecCount), this.step = d.roundTo(this.step, this.maxDecCount + 1)) : this.maxDecCount = 0;
  1308. this.min = this.step * Math.floor(this.min / this.step);
  1309. this.max = this.step * Math.ceil(this.max / this.step);
  1310. 0 > this.min && 0 <= a && (this.min = 0);
  1311. 0 < this.max && 0 >= b && (this.max = 0);
  1312. 1 < this.minReal && 1 < this.max - this.minReal &&
  1313. (this.minReal = Math.floor(this.minReal));
  1314. c = Math.pow(10, Math.floor(Math.log(Math.abs(this.minReal)) * Math.LOG10E));
  1315. 0 === this.min && (this.minReal = c);
  1316. 0 === this.min && 1 < this.minReal && (this.minReal = 1);
  1317. 0 < this.min && 0 < this.minReal - this.step && (this.minReal = this.min + this.step < this.minReal ? this.min + this.step : this.min);
  1318. this.logarithmic && (2 < Math.log(b) * Math.LOG10E - Math.log(a) * Math.LOG10E ? (this.minReal = this.min = Math.pow(10, Math.floor(Math.log(Math.abs(a)) * Math.LOG10E)), this.max = Math.pow(10, Math.ceil(Math.log(Math.abs(b)) *
  1319. Math.LOG10E))) : (a = Math.pow(10, Math.floor(Math.log(Math.abs(a)) * Math.LOG10E)) / 10, Math.pow(10, Math.floor(Math.log(Math.abs(this.min)) * Math.LOG10E)) / 10 < a && (this.minReal = this.min = 10 * a)))
  1320. }, getExtremes: function (a, b) {
  1321. var c, e, d;
  1322. for (d = a; d <= b; d++) {
  1323. var f = this.data[d].axes[this.id].graphs, g;
  1324. for (g in f) if (f.hasOwnProperty(g)) {
  1325. var k = this.chart.graphsById[g];
  1326. if (k.includeInMinMax && (!k.hidden || this.includeHidden)) {
  1327. isNaN(c) && (c = Infinity);
  1328. isNaN(e) && (e = -Infinity);
  1329. this.foundGraphs = !0;
  1330. k = f[g].values;
  1331. this.recalculateToPercents &&
  1332. (k = f[g].percents);
  1333. var l;
  1334. if (this.minMaxField) l = k[this.minMaxField], l < c && (c = l), l > e && (e = l); else for (var m in k) k.hasOwnProperty(m) && "percents" != m && "total" != m && (l = k[m], l < c && (c = l), l > e && (e = l))
  1335. }
  1336. }
  1337. }
  1338. return {min: c, max: e}
  1339. }, zoomOut: function () {
  1340. this.zoomToRelativeValues(0, 1);
  1341. this.maxZoom = this.minZoom = NaN
  1342. }, zoomToRelativeValues: function (a, b, c) {
  1343. if (this.reversed) {
  1344. var e = a;
  1345. a = 1 - b;
  1346. b = 1 - e
  1347. }
  1348. var d = this.fullMax, e = this.fullMin, f = e + (d - e) * a, g = e + (d - e) * b;
  1349. this.logarithmic && (d = Math.log(d) * Math.LOG10E - Math.log(e) * Math.LOG10E, f = Math.pow(10,
  1350. d * a + Math.log(e) * Math.LOG10E), g = Math.pow(10, d * b + Math.log(e) * Math.LOG10E));
  1351. return this.zoomToValues(f, g, c)
  1352. }, zoomToValues: function (a, b, c) {
  1353. if (b < a) {
  1354. var e = b;
  1355. b = a;
  1356. a = e
  1357. }
  1358. var d = this.fullMax, e = this.fullMin;
  1359. this.relativeStart = (a - e) / (d - e);
  1360. this.relativeEnd = (b - e) / (d - e);
  1361. if (this.logarithmic) {
  1362. var d = Math.log(d) * Math.LOG10E - Math.log(e) * Math.LOG10E,
  1363. f = Math.log(b) / Math.LN10 - Math.log(e) * Math.LOG10E;
  1364. this.relativeStart = (Math.log(a) / Math.LN10 - Math.log(e) * Math.LOG10E) / d;
  1365. this.relativeEnd = f / d
  1366. }
  1367. if (this.minZoom != a || this.maxZoom != b) return this.minZoom =
  1368. a, this.maxZoom = b, c || (c = {type: "axisZoomed"}, c.chart = this.chart, c.valueAxis = this, c.startValue = a, c.endValue = b, c.relativeStart = this.relativeStart, c.relativeEnd = this.relativeEnd, this.fire(c)), !0
  1369. }, coordinateToValue: function (a) {
  1370. if (isNaN(a)) return NaN;
  1371. var b = this.axisWidth, c = this.stepWidth, e = this.reversed, d = this.rotate, f = this.min,
  1372. g = this.minReal;
  1373. return !0 === this.logarithmic ? Math.pow(10, (d ? !0 === e ? (b - a) / c : a / c : !0 === e ? a / c : (b - a) / c) + Math.log(g) * Math.LOG10E) : !0 === e ? d ? f - (a - b) / c : a / c + f : d ? a / c + f : f - (a - b) / c
  1374. }, getCoordinate: function (a,
  1375. b) {
  1376. if (isNaN(a)) return NaN;
  1377. var c = this.rotate, e = this.reversed, d = this.axisWidth, f = this.stepWidth, g = this.min,
  1378. k = this.minReal;
  1379. !0 === this.logarithmic ? (0 === a && (a = this.treatZeroAs), g = Math.log(a) * Math.LOG10E - Math.log(k) * Math.LOG10E, c = c ? !0 === e ? d - f * g : f * g : !0 === e ? f * g : d - f * g) : c = !0 === e ? c ? d - f * (a - g) : f * (a - g) : c ? f * (a - g) : d - f * (a - g);
  1380. 1E7 < Math.abs(c) && (c = c / Math.abs(c) * 1E7);
  1381. b || (c = Math.round(c));
  1382. return c
  1383. }, synchronizeWithAxis: function (a) {
  1384. this.synchronizeWith = a;
  1385. this.listenTo(this.synchronizeWith, "axisChanged", this.handleSynchronization)
  1386. },
  1387. handleSynchronization: function () {
  1388. if (this.synchronizeWith) {
  1389. d.isString(this.synchronizeWith) && (this.synchronizeWith = this.chart.getValueAxisById(this.synchronizeWith));
  1390. var a = this.synchronizeWith, b = a.min, c = a.max, a = a.step, e = this.synchronizationMultiplier;
  1391. e && (this.min = b * e, this.max = c * e, this.step = a * e, b = Math.abs(Math.log(Math.abs(Math.pow(10, Math.floor(Math.log(Math.abs(this.step)) * Math.LOG10E)))) * Math.LOG10E), this.maxDecCount = b = Math.round(b), this.draw())
  1392. }
  1393. }
  1394. })
  1395. })();
  1396. (function () {
  1397. var d = window.AmCharts;
  1398. d.RecAxis = d.Class({
  1399. construct: function (a) {
  1400. var b = a.chart, c = a.axisThickness, e = a.axisColor, h = a.axisAlpha, f = a.offset, g = a.dx, k = a.dy,
  1401. l = a.x, m = a.y, n = a.height, q = a.width, p = b.container;
  1402. "H" == a.orientation ? (e = d.line(p, [0, q], [0, 0], e, h, c), this.axisWidth = a.width, "bottom" == a.position ? (k = c / 2 + f + n + m - 1, c = l) : (k = -c / 2 - f + m + k, c = g + l)) : (this.axisWidth = a.height, "right" == a.position ? (e = d.line(p, [0, 0, -g], [0, n, n - k], e, h, c), k = m + k, c = c / 2 + f + g + q + l - 1) : (e = d.line(p, [0, 0], [0, n], e, h, c), k = m, c = -c / 2 - f + l));
  1403. e.translate(c,
  1404. k);
  1405. c = b.container.set();
  1406. c.push(e);
  1407. b.axesSet.push(c);
  1408. d.setCN(b, e, a.bcn + "line");
  1409. this.axisSet = c;
  1410. this.set = e
  1411. }
  1412. })
  1413. })();
  1414. (function () {
  1415. var d = window.AmCharts;
  1416. d.RecItem = d.Class({
  1417. construct: function (a, b, c, e, h, f, g, k, l, m, n, q) {
  1418. b = Math.round(b);
  1419. var p = a.chart;
  1420. this.value = c;
  1421. void 0 == c && (c = "");
  1422. l || (l = 0);
  1423. void 0 == e && (e = !0);
  1424. var t = p.fontFamily, r = a.fontSize;
  1425. void 0 == r && (r = p.fontSize);
  1426. var u = a.color;
  1427. void 0 == u && (u = p.color);
  1428. void 0 !== n && (u = n);
  1429. var y = a.chart.container, x = y.set();
  1430. this.set = x;
  1431. var w = a.axisThickness, B = a.axisColor, z = a.axisAlpha, A = a.tickLength, C = a.gridAlpha,
  1432. D = a.gridThickness, J = a.gridColor, H = a.dashLength, R = a.fillColor, L = a.fillAlpha,
  1433. P = a.labelsEnabled;
  1434. n = a.labelRotationR;
  1435. var ia = a.counter, I = a.inside, Z = a.labelOffset, va = a.dx, la = a.dy, Oa = a.orientation,
  1436. ea = a.position, ca = a.previousCoord, X = a.height, ya = a.width, da = a.offset, fa, za;
  1437. g ? (void 0 !== g.id && (q = p.classNamePrefix + "-guide-" + g.id), P = !0, isNaN(g.tickLength) || (A = g.tickLength), void 0 != g.lineColor && (J = g.lineColor), void 0 != g.color && (u = g.color), isNaN(g.lineAlpha) || (C = g.lineAlpha), isNaN(g.dashLength) || (H = g.dashLength), isNaN(g.lineThickness) || (D = g.lineThickness), !0 === g.inside && (I = !0, 0 < da && (da = 0)), isNaN(g.labelRotation) ||
  1438. (n = g.labelRotation), isNaN(g.fontSize) || (r = g.fontSize), g.position && (ea = g.position), void 0 !== g.boldLabel && (k = g.boldLabel), isNaN(g.labelOffset) || (Z = g.labelOffset)) : "" === c && (A = 0);
  1439. m && !isNaN(a.minorTickLength) && (A = a.minorTickLength);
  1440. var ga = "start";
  1441. 0 < h && (ga = "middle");
  1442. a.centerLabels && (ga = "middle");
  1443. var T = n * Math.PI / 180, Y, Ca, G = 0, v = 0, ma = 0, ha = Y = 0, Pa = 0;
  1444. "V" == Oa && (n = 0);
  1445. var ba;
  1446. P && "" !== c && (ba = a.autoWrap && 0 === n ? d.wrappedText(y, c, u, t, r, ga, k, Math.abs(h), 0) : d.text(y, c, u, t, r, ga, k), ga = ba.getBBox(), ha = ga.width, Pa = ga.height);
  1447. if ("H" == Oa) {
  1448. if (0 <= b && b <= ya + 1 && (0 < A && 0 < z && b + l <= ya + 1 && (fa = d.line(y, [b + l, b + l], [0, A], B, z, D), x.push(fa)), 0 < C && (za = d.line(y, [b, b + va, b + va], [X, X + la, la], J, C, D, H), x.push(za))), v = 0, G = b, g && 90 == n && I && (G -= r), !1 === e ? (ga = "start", v = "bottom" == ea ? I ? v + A : v - A : I ? v - A : v + A, G += 3, 0 < h && (G += h / 2 - 3, ga = "middle"), 0 < n && (ga = "middle")) : ga = "middle", 1 == ia && 0 < L && !g && !m && ca < ya && (e = d.fitToBounds(b, 0, ya), ca = d.fitToBounds(ca, 0, ya), Y = e - ca, 0 < Y && (Ca = d.rect(y, Y, a.height, R, L), Ca.translate(e - Y + va, la), x.push(Ca))), "bottom" == ea ? (v += X + r / 2 + da, I ? (0 < n ?
  1449. (v = X - ha / 2 * Math.sin(T) - A - 3, G += ha / 2 * Math.cos(T) - 4 + 2) : 0 > n ? (v = X + ha * Math.sin(T) - A - 3 + 2, G += -ha * Math.cos(T) - Pa * Math.sin(T) - 4) : v -= A + r + 3 + 3, v -= Z) : (0 < n ? (v = X + ha / 2 * Math.sin(T) + A + 3, G -= ha / 2 * Math.cos(T)) : 0 > n ? (v = X + A + 3 - ha / 2 * Math.sin(T) + 2, G += ha / 2 * Math.cos(T)) : v += A + w + 3 + 3, v += Z)) : (v += la + r / 2 - da, G += va, I ? (0 < n ? (v = ha / 2 * Math.sin(T) + A + 3, G -= ha / 2 * Math.cos(T)) : v += A + 3, v += Z) : (0 < n ? (v = -(ha / 2) * Math.sin(T) - A - 6, G += ha / 2 * Math.cos(T)) : v -= A + r + 3 + w + 3, v -= Z)), "bottom" == ea ? Y = (I ? X - A - 1 : X + w - 1) + da : (ma = va, Y = (I ? la : la - A - w + 1) - da), f && (G += f), f = G, 0 < n && (f +=
  1450. ha / 2 * Math.cos(T)), ba && (r = 0, I && (r = ha / 2 * Math.cos(T)), f + r > ya + 2 || 0 > f)) ba.remove(), ba = null
  1451. } else {
  1452. 0 <= b && b <= X + 1 && (0 < A && 0 < z && b + l <= X + 1 && (fa = d.line(y, [0, A + 1], [b + l, b + l], B, z, D), x.push(fa)), 0 < C && (za = d.line(y, [0, va, ya + va], [b, b + la, b + la], J, C, D, H), x.push(za)));
  1453. ga = "end";
  1454. if (!0 === I && "left" == ea || !1 === I && "right" == ea) ga = "start";
  1455. v = b - Pa / 2 + 2;
  1456. 1 == ia && 0 < L && !g && !m && (e = d.fitToBounds(b, 0, X), ca = d.fitToBounds(ca, 0, X), T = e - ca, Ca = d.polygon(y, [0, a.width, a.width, 0], [0, 0, T, T], R, L), Ca.translate(va, e - T + la), x.push(Ca));
  1457. v += r / 2;
  1458. "right" == ea ? (G +=
  1459. va + ya + da, v += la, I ? (f || (v -= r / 2 + 3), G = G - (A + 4) - Z) : (G += A + 4 + w, v -= 2, G += Z)) : I ? (G += A + 4 - da, f || (v -= r / 2 + 3), g && (G += va, v += la), G += Z) : (G += -A - w - 4 - 2 - da, v -= 2, G -= Z);
  1460. fa && ("right" == ea ? (ma += va + da + ya - 1, Y += la, ma = I ? ma - w : ma + w) : (ma -= da, I || (ma -= A + w)));
  1461. f && (v += f);
  1462. I = -3;
  1463. "right" == ea && (I += la);
  1464. ba && (v > X + 1 || v < I) && (ba.remove(), ba = null)
  1465. }
  1466. fa && (fa.translate(ma, Y), d.setCN(p, fa, a.bcn + "tick"), d.setCN(p, fa, q, !0), g && d.setCN(p, fa, "guide"));
  1467. !1 === a.visible && (fa && fa.remove(), ba && (ba.remove(), ba = null));
  1468. ba && (ba.attr({"text-anchor": ga}), ba.translate(G,
  1469. v, NaN, !0), 0 !== n && ba.rotate(-n, a.chart.backgroundColor), a.allLabels.push(ba), this.label = ba, d.setCN(p, ba, a.bcn + "label"), d.setCN(p, ba, q, !0), g && d.setCN(p, ba, "guide"));
  1470. za && (d.setCN(p, za, a.bcn + "grid"), d.setCN(p, za, q, !0), g && d.setCN(p, za, "guide"));
  1471. Ca && (d.setCN(p, Ca, a.bcn + "fill"), d.setCN(p, Ca, q, !0));
  1472. m ? za && d.setCN(p, za, a.bcn + "grid-minor") : (a.counter = 0 === ia ? 1 : 0, a.previousCoord = b);
  1473. 0 === this.set.node.childNodes.length && this.set.remove()
  1474. }, graphics: function () {
  1475. return this.set
  1476. }, getLabel: function () {
  1477. return this.label
  1478. }
  1479. })
  1480. })();
  1481. (function () {
  1482. var d = window.AmCharts;
  1483. d.RecFill = d.Class({
  1484. construct: function (a, b, c, e) {
  1485. var h = a.dx, f = a.dy, g = a.orientation, k = 0;
  1486. if (c < b) {
  1487. var l = b;
  1488. b = c;
  1489. c = l
  1490. }
  1491. var m = e.fillAlpha;
  1492. isNaN(m) && (m = 0);
  1493. var l = a.chart.container, n = e.fillColor;
  1494. "V" == g ? (b = d.fitToBounds(b, 0, a.height), c = d.fitToBounds(c, 0, a.height)) : (b = d.fitToBounds(b, 0, a.width), c = d.fitToBounds(c, 0, a.width));
  1495. c -= b;
  1496. isNaN(c) && (c = 4, k = 2, m = 0);
  1497. 0 > c && "object" == typeof n && (n = n.join(",").split(",").reverse());
  1498. "V" == g ? (g = d.rect(l, a.width, c, n, m), g.translate(h, b - k + f)) : (g = d.rect(l,
  1499. c, a.height, n, m), g.translate(b - k + h, f));
  1500. d.setCN(a.chart, g, "guide-fill");
  1501. e.id && d.setCN(a.chart, g, "guide-fill-" + e.id);
  1502. this.set = l.set([g])
  1503. }, graphics: function () {
  1504. return this.set
  1505. }, getLabel: function () {
  1506. }
  1507. })
  1508. })();
  1509. (function () {
  1510. var d = window.AmCharts;
  1511. d.AmChart = d.Class({
  1512. construct: function (a) {
  1513. this.svgIcons = this.tapToActivate = !0;
  1514. this.theme = a;
  1515. this.classNamePrefix = "amcharts";
  1516. this.addClassNames = !1;
  1517. this.version = "3.18.6";
  1518. d.addChart(this);
  1519. this.createEvents("buildStarted", "dataUpdated", "init", "rendered", "drawn", "failed", "resized", "animationFinished");
  1520. this.height = this.width = "100%";
  1521. this.dataChanged = !0;
  1522. this.chartCreated = !1;
  1523. this.previousWidth = this.previousHeight = 0;
  1524. this.backgroundColor = "#FFFFFF";
  1525. this.borderAlpha = this.backgroundAlpha =
  1526. 0;
  1527. this.color = this.borderColor = "#000000";
  1528. this.fontFamily = "Verdana";
  1529. this.fontSize = 11;
  1530. this.usePrefixes = !1;
  1531. this.autoResize = !0;
  1532. this.autoDisplay = !1;
  1533. this.addCodeCredits = !0;
  1534. this.precision = -1;
  1535. this.percentPrecision = 2;
  1536. this.decimalSeparator = ".";
  1537. this.thousandsSeparator = ",";
  1538. this.labels = [];
  1539. this.allLabels = [];
  1540. this.titles = [];
  1541. this.marginRight = this.marginLeft = this.autoMarginOffset = 0;
  1542. this.timeOuts = [];
  1543. this.creditsPosition = "top-left";
  1544. var b = document.createElement("div"), c = b.style;
  1545. c.overflow = "hidden";
  1546. c.position = "relative";
  1547. c.textAlign = "left";
  1548. this.chartDiv = b;
  1549. b = document.createElement("div");
  1550. c = b.style;
  1551. c.overflow = "hidden";
  1552. c.position = "relative";
  1553. c.textAlign = "left";
  1554. this.legendDiv = b;
  1555. this.titleHeight = 0;
  1556. this.hideBalloonTime = 150;
  1557. this.handDrawScatter = 2;
  1558. this.handDrawThickness = 1;
  1559. this.prefixesOfBigNumbers = [{number: 1E3, prefix: "k"}, {number: 1E6, prefix: "M"}, {
  1560. number: 1E9,
  1561. prefix: "G"
  1562. }, {number: 1E12, prefix: "T"}, {number: 1E15, prefix: "P"}, {number: 1E18, prefix: "E"}, {
  1563. number: 1E21,
  1564. prefix: "Z"
  1565. }, {number: 1E24, prefix: "Y"}];
  1566. this.prefixesOfSmallNumbers = [{
  1567. number: 1E-24,
  1568. prefix: "y"
  1569. }, {number: 1E-21, prefix: "z"}, {number: 1E-18, prefix: "a"}, {number: 1E-15, prefix: "f"}, {
  1570. number: 1E-12,
  1571. prefix: "p"
  1572. }, {number: 1E-9, prefix: "n"}, {number: 1E-6, prefix: "\u03bc"}, {number: .001, prefix: "m"}];
  1573. this.panEventsEnabled = !0;
  1574. this.product = "amcharts";
  1575. this.animations = [];
  1576. this.balloon = new d.AmBalloon(this.theme);
  1577. this.balloon.chart = this;
  1578. this.processTimeout = 0;
  1579. this.processCount = 1E3;
  1580. this.animatable = [];
  1581. d.applyTheme(this, a, "AmChart")
  1582. }, drawChart: function () {
  1583. 0 < this.realWidth && 0 < this.realHeight && (this.drawBackground(),
  1584. this.redrawLabels(), this.drawTitles(), this.brr(), this.renderFix(), this.chartDiv && (this.boundingRect = this.chartDiv.getBoundingClientRect()))
  1585. }, drawBackground: function () {
  1586. d.remove(this.background);
  1587. var a = this.container, b = this.backgroundColor, c = this.backgroundAlpha, e = this.set;
  1588. d.isModern || 0 !== c || (c = .001);
  1589. var h = this.updateWidth();
  1590. this.realWidth = h;
  1591. var f = this.updateHeight();
  1592. this.realHeight = f;
  1593. b = d.polygon(a, [0, h - 1, h - 1, 0], [0, 0, f - 1, f - 1], b, c, 1, this.borderColor, this.borderAlpha);
  1594. d.setCN(this, b, "bg");
  1595. this.background =
  1596. b;
  1597. e.push(b);
  1598. if (b = this.backgroundImage) a = a.image(b, 0, 0, h, f), d.setCN(this, b, "bg-image"), this.bgImg = a, e.push(a)
  1599. }, drawTitles: function (a) {
  1600. var b = this.titles;
  1601. this.titleHeight = 0;
  1602. if (d.ifArray(b)) {
  1603. var c = 20, e;
  1604. for (e = 0; e < b.length; e++) {
  1605. var h = b[e], h = d.processObject(h, d.Title, this.theme);
  1606. if (!1 !== h.enabled) {
  1607. var f = h.color;
  1608. void 0 === f && (f = this.color);
  1609. var g = h.size;
  1610. isNaN(g) && (g = this.fontSize + 2);
  1611. isNaN(h.alpha);
  1612. var k = this.marginLeft, l = !0;
  1613. void 0 !== h.bold && (l = h.bold);
  1614. f = d.wrappedText(this.container, h.text, f, this.fontFamily,
  1615. g, "middle", l, this.realWidth - 35);
  1616. f.translate(k + (this.realWidth - this.marginRight - k) / 2, c);
  1617. f.node.style.pointerEvents = "none";
  1618. h.sprite = f;
  1619. d.setCN(this, f, "title");
  1620. h.id && d.setCN(this, f, "title-" + h.id);
  1621. f.attr({opacity: h.alpha});
  1622. c += f.getBBox().height + 5;
  1623. a ? f.remove() : this.freeLabelsSet.push(f)
  1624. }
  1625. }
  1626. this.titleHeight = c - 10
  1627. }
  1628. }, write: function (a) {
  1629. var b = this;
  1630. if (b.listeners) for (var c = 0; c < b.listeners.length; c++) {
  1631. var e = b.listeners[c];
  1632. b.addListener(e.event, e.method)
  1633. }
  1634. b.fire({type: "buildStarted", chart: b});
  1635. b.afterWriteTO && clearTimeout(b.afterWriteTO);
  1636. 0 < b.processTimeout ? b.afterWriteTO = setTimeout(function () {
  1637. b.afterWrite.call(b, a)
  1638. }, b.processTimeout) : b.afterWrite(a)
  1639. }, afterWrite: function (a) {
  1640. if (a = "object" != typeof a ? document.getElementById(a) : a) {
  1641. for (; a.firstChild;) a.removeChild(a.firstChild);
  1642. this.div = a;
  1643. a.style.overflow = "hidden";
  1644. a.style.textAlign = "left";
  1645. var b = this.chartDiv, c = this.legendDiv, e = this.legend, h = c.style, f = b.style;
  1646. this.measure();
  1647. this.previousHeight = this.divRealHeight;
  1648. this.previousWidth = this.divRealWidth;
  1649. var g, k = document.createElement("div");
  1650. g = k.style;
  1651. g.position = "relative";
  1652. this.containerDiv = k;
  1653. k.className = this.classNamePrefix + "-main-div";
  1654. b.className = this.classNamePrefix + "-chart-div";
  1655. a.appendChild(k);
  1656. var l = this.exportConfig;
  1657. l && d.AmExport && !this.AmExport && (this.AmExport = new d.AmExport(this, l));
  1658. this.amExport && d.AmExport && (this.AmExport = d.extend(this.amExport, new d.AmExport(this), !0));
  1659. this.AmExport && this.AmExport.init && this.AmExport.init();
  1660. if (e) if (e = this.addLegend(e, e.divId), e.enabled) switch (e.position) {
  1661. case "bottom":
  1662. k.appendChild(b);
  1663. k.appendChild(c);
  1664. break;
  1665. case "top":
  1666. k.appendChild(c);
  1667. k.appendChild(b);
  1668. break;
  1669. case "absolute":
  1670. g.width = a.style.width;
  1671. g.height = a.style.height;
  1672. h.position = "absolute";
  1673. f.position = "absolute";
  1674. void 0 !== e.left && (h.left = e.left + "px");
  1675. void 0 !== e.right && (h.right = e.right + "px");
  1676. void 0 !== e.top && (h.top = e.top + "px");
  1677. void 0 !== e.bottom && (h.bottom = e.bottom + "px");
  1678. e.marginLeft = 0;
  1679. e.marginRight = 0;
  1680. k.appendChild(b);
  1681. k.appendChild(c);
  1682. break;
  1683. case "right":
  1684. g.width = a.style.width;
  1685. g.height = a.style.height;
  1686. h.position = "relative";
  1687. f.position = "absolute";
  1688. k.appendChild(b);
  1689. k.appendChild(c);
  1690. break;
  1691. case "left":
  1692. g.width = a.style.width;
  1693. g.height = a.style.height;
  1694. h.position = "absolute";
  1695. f.position = "relative";
  1696. k.appendChild(b);
  1697. k.appendChild(c);
  1698. break;
  1699. case "outside":
  1700. k.appendChild(b)
  1701. } else k.appendChild(b); else k.appendChild(b);
  1702. this.listenersAdded || (this.addListeners(), this.listenersAdded = !0);
  1703. this.initChart()
  1704. }
  1705. }, createLabelsSet: function () {
  1706. d.remove(this.labelsSet);
  1707. this.labelsSet = this.container.set();
  1708. this.freeLabelsSet.push(this.labelsSet)
  1709. }, initChart: function () {
  1710. this.balloon = d.processObject(this.balloon,
  1711. d.AmBalloon, this.theme);
  1712. window.AmCharts_path && (this.path = window.AmCharts_path);
  1713. void 0 === this.path && (this.path = d.getPath());
  1714. void 0 === this.path && (this.path = "amcharts/");
  1715. this.path = d.normalizeUrl(this.path);
  1716. void 0 === this.pathToImages && (this.pathToImages = this.path + "images/");
  1717. this.initHC || (d.callInitHandler(this), this.initHC = !0);
  1718. d.applyLang(this.language, this);
  1719. var a = this.numberFormatter;
  1720. a && (isNaN(a.precision) || (this.precision = a.precision), void 0 !== a.thousandsSeparator && (this.thousandsSeparator = a.thousandsSeparator),
  1721. void 0 !== a.decimalSeparator && (this.decimalSeparator = a.decimalSeparator));
  1722. (a = this.percentFormatter) && !isNaN(a.precision) && (this.percentPrecision = a.precision);
  1723. this.nf = {
  1724. precision: this.precision,
  1725. thousandsSeparator: this.thousandsSeparator,
  1726. decimalSeparator: this.decimalSeparator
  1727. };
  1728. this.pf = {
  1729. precision: this.percentPrecision,
  1730. thousandsSeparator: this.thousandsSeparator,
  1731. decimalSeparator: this.decimalSeparator
  1732. };
  1733. this.destroy();
  1734. (a = this.container) ? (a.container.innerHTML = "", a.width = this.realWidth, a.height = this.realHeight,
  1735. a.addDefs(this), this.chartDiv.appendChild(a.container)) : a = new d.AmDraw(this.chartDiv, this.realWidth, this.realHeight, this);
  1736. this.container = a;
  1737. this.extension = ".png";
  1738. this.svgIcons && d.SVG && (this.extension = ".svg");
  1739. this.checkDisplay();
  1740. a.chart = this;
  1741. d.VML || d.SVG ? (a.handDrawn = this.handDrawn, a.handDrawScatter = this.handDrawScatter, a.handDrawThickness = this.handDrawThickness, d.remove(this.set), this.set = a.set(), d.remove(this.gridSet), this.gridSet = a.set(), d.remove(this.cursorLineSet), this.cursorLineSet = a.set(), d.remove(this.graphsBehindSet),
  1742. this.graphsBehindSet = a.set(), d.remove(this.bulletBehindSet), this.bulletBehindSet = a.set(), d.remove(this.columnSet), this.columnSet = a.set(), d.remove(this.graphsSet), this.graphsSet = a.set(), d.remove(this.trendLinesSet), this.trendLinesSet = a.set(), d.remove(this.axesSet), this.axesSet = a.set(), d.remove(this.cursorSet), this.cursorSet = a.set(), d.remove(this.scrollbarsSet), this.scrollbarsSet = a.set(), d.remove(this.bulletSet), this.bulletSet = a.set(), d.remove(this.freeLabelsSet), this.freeLabelsSet = a.set(), d.remove(this.axesLabelsSet),
  1743. this.axesLabelsSet = a.set(), d.remove(this.balloonsSet), this.balloonsSet = a.set(), d.remove(this.plotBalloonsSet), this.plotBalloonsSet = a.set(), d.remove(this.zoomButtonSet), this.zoomButtonSet = a.set(), d.remove(this.zbSet), this.zbSet = null, d.remove(this.linkSet), this.linkSet = a.set()) : this.fire({
  1744. type: "failed",
  1745. chart: this
  1746. })
  1747. }, premeasure: function () {
  1748. var a = this.div;
  1749. if (a) {
  1750. this.boundingRect = this.chartDiv.getBoundingClientRect();
  1751. var b = a.offsetWidth, c = a.offsetHeight;
  1752. a.clientHeight && (b = a.clientWidth, c = a.clientHeight);
  1753. if (b != this.mw || c != this.mh) this.mw = b, this.mh = c, this.measure()
  1754. }
  1755. }, measure: function () {
  1756. var a = this.div;
  1757. if (a) {
  1758. var b = this.chartDiv, c = a.offsetWidth, e = a.offsetHeight, h = this.container;
  1759. a.clientHeight && (c = a.clientWidth, e = a.clientHeight);
  1760. var f = d.removePx(d.getStyle(a, "padding-left")), g = d.removePx(d.getStyle(a, "padding-right")),
  1761. k = d.removePx(d.getStyle(a, "padding-top")), l = d.removePx(d.getStyle(a, "padding-bottom"));
  1762. isNaN(f) || (c -= f);
  1763. isNaN(g) || (c -= g);
  1764. isNaN(k) || (e -= k);
  1765. isNaN(l) || (e -= l);
  1766. f = a.style;
  1767. a = f.width;
  1768. f = f.height;
  1769. -1 != a.indexOf("px") && (c = d.removePx(a));
  1770. -1 != f.indexOf("px") && (e = d.removePx(f));
  1771. e = Math.round(e);
  1772. c = Math.round(c);
  1773. a = Math.round(d.toCoordinate(this.width, c));
  1774. f = Math.round(d.toCoordinate(this.height, e));
  1775. (c != this.previousWidth || e != this.previousHeight) && 0 < a && 0 < f && (b.style.width = a + "px", b.style.height = f + "px", b.style.padding = 0, h && h.setSize(a, f), this.balloon = d.processObject(this.balloon, d.AmBalloon, this.theme), this.balloon.setBounds(2, 2, a - 2, f));
  1776. this.balloon.chart = this;
  1777. this.realWidth = a;
  1778. this.realHeight = f;
  1779. this.divRealWidth =
  1780. c;
  1781. this.divRealHeight = e
  1782. }
  1783. }, checkDisplay: function () {
  1784. if (this.autoDisplay && this.container) {
  1785. var a = d.rect(this.container, 10, 10), b = a.getBBox();
  1786. 0 === b.width && 0 === b.height && (this.divRealHeight = this.divRealWidth = this.realHeight = this.realWidth = 0, this.previousWidth = this.previousHeight = NaN);
  1787. a.remove()
  1788. }
  1789. }, destroy: function () {
  1790. this.chartDiv.innerHTML = "";
  1791. this.clearTimeOuts();
  1792. this.legend && this.legend.destroy()
  1793. }, clearTimeOuts: function () {
  1794. var a = this.timeOuts;
  1795. if (a) {
  1796. var b;
  1797. for (b = 0; b < a.length; b++) clearTimeout(a[b])
  1798. }
  1799. this.timeOuts =
  1800. []
  1801. }, clear: function (a) {
  1802. d.callMethod("clear", [this.chartScrollbar, this.scrollbarV, this.scrollbarH, this.chartCursor]);
  1803. this.chartCursor = this.scrollbarH = this.scrollbarV = this.chartScrollbar = null;
  1804. this.clearTimeOuts();
  1805. this.container && (this.container.remove(this.chartDiv), this.container.remove(this.legendDiv));
  1806. a || d.removeChart(this);
  1807. if (a = this.div) for (; a.firstChild;) a.removeChild(a.firstChild);
  1808. this.legend && this.legend.destroy()
  1809. }, setMouseCursor: function (a) {
  1810. "auto" == a && d.isNN && (a = "default");
  1811. this.chartDiv.style.cursor =
  1812. a;
  1813. this.legendDiv.style.cursor = a
  1814. }, redrawLabels: function () {
  1815. this.labels = [];
  1816. var a = this.allLabels;
  1817. this.createLabelsSet();
  1818. var b;
  1819. for (b = 0; b < a.length; b++) this.drawLabel(a[b])
  1820. }, drawLabel: function (a) {
  1821. if (this.container && !1 !== a.enabled) {
  1822. a = d.processObject(a, d.Label, this.theme);
  1823. var b = a.y, c = a.text, e = a.align, h = a.size, f = a.color, g = a.rotation, k = a.alpha, l = a.bold,
  1824. m = d.toCoordinate(a.x, this.realWidth), b = d.toCoordinate(b, this.realHeight);
  1825. m || (m = 0);
  1826. b || (b = 0);
  1827. void 0 === f && (f = this.color);
  1828. isNaN(h) && (h = this.fontSize);
  1829. e || (e = "start");
  1830. "left" == e && (e = "start");
  1831. "right" == e && (e = "end");
  1832. "center" == e && (e = "middle", g ? b = this.realHeight - b + b / 2 : m = this.realWidth / 2 - m);
  1833. void 0 === k && (k = 1);
  1834. void 0 === g && (g = 0);
  1835. b += h / 2;
  1836. c = d.text(this.container, c, f, this.fontFamily, h, e, l, k);
  1837. c.translate(m, b);
  1838. d.setCN(this, c, "label");
  1839. a.id && d.setCN(this, c, "label-" + a.id);
  1840. 0 !== g && c.rotate(g);
  1841. a.url ? (c.setAttr("cursor", "pointer"), c.click(function () {
  1842. d.getURL(a.url)
  1843. })) : c.node.style.pointerEvents = "none";
  1844. this.labelsSet.push(c);
  1845. this.labels.push(c)
  1846. }
  1847. }, addLabel: function (a, b, c, e, d, f, g, k, l, m) {
  1848. a =
  1849. {x: a, y: b, text: c, align: e, size: d, color: f, alpha: k, rotation: g, bold: l, url: m, enabled: !0};
  1850. this.container && this.drawLabel(a);
  1851. this.allLabels.push(a)
  1852. }, clearLabels: function () {
  1853. var a = this.labels, b;
  1854. for (b = a.length - 1; 0 <= b; b--) a[b].remove();
  1855. this.labels = [];
  1856. this.allLabels = []
  1857. }, updateHeight: function () {
  1858. var a = this.divRealHeight, b = this.legend;
  1859. if (b) {
  1860. var c = this.legendDiv.offsetHeight, b = b.position;
  1861. if ("top" == b || "bottom" == b) {
  1862. a -= c;
  1863. if (0 > a || isNaN(a)) a = 0;
  1864. this.chartDiv.style.height = a + "px"
  1865. }
  1866. }
  1867. return a
  1868. }, updateWidth: function () {
  1869. var a = this.divRealWidth,
  1870. b = this.divRealHeight, c = this.legend;
  1871. if (c) {
  1872. var e = this.legendDiv, d = e.offsetWidth;
  1873. isNaN(c.width) || (d = c.width);
  1874. c.ieW && (d = c.ieW);
  1875. var f = e.offsetHeight, e = e.style, g = this.chartDiv.style, c = c.position;
  1876. if ("right" == c || "left" == c) {
  1877. a -= d;
  1878. if (0 > a || isNaN(a)) a = 0;
  1879. g.width = a + "px";
  1880. this.balloon.setBounds(2, 2, a - 2, this.realHeight);
  1881. "left" == c ? (g.left = d + "px", e.left = "0px") : (g.left = "0px", e.left = a + "px");
  1882. b > f && (e.top = (b - f) / 2 + "px")
  1883. }
  1884. }
  1885. return a
  1886. }, getTitleHeight: function () {
  1887. this.drawTitles(!0);
  1888. return this.titleHeight
  1889. }, addTitle: function (a, b,
  1890. c, e, d) {
  1891. isNaN(b) && (b = this.fontSize + 2);
  1892. a = {text: a, size: b, color: c, alpha: e, bold: d, enabled: !0};
  1893. this.titles.push(a);
  1894. return a
  1895. }, handleWheel: function (a) {
  1896. var b = 0;
  1897. a || (a = window.event);
  1898. a.wheelDelta ? b = a.wheelDelta / 120 : a.detail && (b = -a.detail / 3);
  1899. b && this.handleWheelReal(b, a.shiftKey);
  1900. a.preventDefault && a.preventDefault()
  1901. }, handleWheelReal: function () {
  1902. }, handleDocTouchStart: function () {
  1903. this.hideBalloonReal();
  1904. this.handleMouseMove();
  1905. this.tmx = this.mouseX;
  1906. this.tmy = this.mouseY
  1907. }, handleDocTouchEnd: function () {
  1908. -.5 < this.tmx && this.tmx <
  1909. this.divRealWidth + 1 && 0 < this.tmy && this.tmy < this.divRealHeight ? (this.handleMouseMove(), 4 > Math.abs(this.mouseX - this.tmx) && 4 > Math.abs(this.mouseY - this.tmy) && (this.tapped = !0)) : this.tapped = !1
  1910. }, addListeners: function () {
  1911. var a = this, b = a.chartDiv;
  1912. document.addEventListener ? (a.panEventsEnabled && (b.style.msTouchAction = "none", b.style.touchAction = "none"), "ontouchstart" in document.documentElement && (b.addEventListener("touchstart", function (b) {
  1913. a.handleTouchStart.call(a, b)
  1914. }, !0), b.addEventListener("touchmove", function (b) {
  1915. a.handleMouseMove.call(a,
  1916. b)
  1917. }, !0), b.addEventListener("touchend", function (b) {
  1918. a.handleTouchEnd.call(a, b)
  1919. }, !0), document.addEventListener("touchstart", function (b) {
  1920. a.handleDocTouchStart.call(a, b)
  1921. }), document.addEventListener("touchend", function (b) {
  1922. a.handleDocTouchEnd.call(a, b)
  1923. })), b.addEventListener("mousedown", function (b) {
  1924. a.mouseIsOver = !0;
  1925. a.handleMouseMove.call(a, b);
  1926. a.handleMouseDown.call(a, b)
  1927. }, !0), b.addEventListener("mouseover", function (b) {
  1928. a.handleMouseOver.call(a, b)
  1929. }, !0), b.addEventListener("mouseout", function (b) {
  1930. a.handleMouseOut.call(a,
  1931. b)
  1932. }, !0)) : (b.attachEvent("onmousedown", function (b) {
  1933. a.handleMouseDown.call(a, b)
  1934. }), b.attachEvent("onmouseover", function (b) {
  1935. a.handleMouseOver.call(a, b)
  1936. }), b.attachEvent("onmouseout", function (b) {
  1937. a.handleMouseOut.call(a, b)
  1938. }))
  1939. }, dispDUpd: function () {
  1940. this.skipEvents || (this.dispatchDataUpdated && (this.dispatchDataUpdated = !1, this.fire({
  1941. type: "dataUpdated",
  1942. chart: this
  1943. })), this.chartCreated || (this.chartCreated = !0, this.fire({
  1944. type: "init",
  1945. chart: this
  1946. })), this.chartRendered || (this.fire({type: "rendered", chart: this}), this.chartRendered =
  1947. !0), this.fire({type: "drawn", chart: this}));
  1948. this.skipEvents = !1
  1949. }, validateSize: function () {
  1950. var a = this;
  1951. a.premeasure();
  1952. a.checkDisplay();
  1953. if (a.divRealWidth != a.previousWidth || a.divRealHeight != a.previousHeight) {
  1954. var b = a.legend;
  1955. if (0 < a.realWidth && 0 < a.realHeight) {
  1956. a.sizeChanged = !0;
  1957. if (b) {
  1958. a.legendInitTO && clearTimeout(a.legendInitTO);
  1959. var c = setTimeout(function () {
  1960. b.invalidateSize()
  1961. }, 10);
  1962. a.timeOuts.push(c);
  1963. a.legendInitTO = c
  1964. }
  1965. a.marginsUpdated = "xy" != a.type ? !1 : !0;
  1966. clearTimeout(a.initTO);
  1967. c = setTimeout(function () {
  1968. a.initChart()
  1969. },
  1970. 10);
  1971. a.timeOuts.push(c);
  1972. a.initTO = c
  1973. }
  1974. a.renderFix();
  1975. b && b.renderFix && b.renderFix();
  1976. clearTimeout(a.resizedTO);
  1977. a.resizedTO = setTimeout(function () {
  1978. a.fire({type: "resized", chart: a})
  1979. }, 10);
  1980. a.previousHeight = a.divRealHeight;
  1981. a.previousWidth = a.divRealWidth
  1982. }
  1983. }, invalidateSize: function () {
  1984. this.previousHeight = this.previousWidth = NaN;
  1985. this.invalidateSizeReal()
  1986. }, invalidateSizeReal: function () {
  1987. var a = this;
  1988. a.marginsUpdated = !1;
  1989. clearTimeout(a.validateTO);
  1990. var b = setTimeout(function () {
  1991. a.validateSize()
  1992. }, 5);
  1993. a.timeOuts.push(b);
  1994. a.validateTO =
  1995. b
  1996. }, validateData: function (a) {
  1997. this.chartCreated && (this.dataChanged = !0, this.marginsUpdated = !1, this.initChart(a))
  1998. }, validateNow: function (a, b) {
  1999. this.initTO && clearTimeout(this.initTO);
  2000. a && (this.dataChanged = !0, this.marginsUpdated = !1);
  2001. this.skipEvents = b;
  2002. this.chartRendered = !1;
  2003. this.write(this.div)
  2004. }, showItem: function (a) {
  2005. a.hidden = !1;
  2006. this.initChart()
  2007. }, hideItem: function (a) {
  2008. a.hidden = !0;
  2009. this.initChart()
  2010. }, hideBalloon: function () {
  2011. var a = this;
  2012. clearTimeout(a.hoverInt);
  2013. clearTimeout(a.balloonTO);
  2014. a.hoverInt = setTimeout(function () {
  2015. a.hideBalloonReal.call(a)
  2016. },
  2017. a.hideBalloonTime)
  2018. }, cleanChart: function () {
  2019. }, hideBalloonReal: function () {
  2020. var a = this.balloon;
  2021. a && a.hide()
  2022. }, showBalloon: function (a, b, c, e, d) {
  2023. var f = this;
  2024. clearTimeout(f.balloonTO);
  2025. clearTimeout(f.hoverInt);
  2026. f.balloonTO = setTimeout(function () {
  2027. f.showBalloonReal.call(f, a, b, c, e, d)
  2028. }, 1)
  2029. }, showBalloonReal: function (a, b, c, e, d) {
  2030. this.handleMouseMove();
  2031. var f = this.balloon;
  2032. f.enabled && (f.followCursor(!1), f.changeColor(b), !c || f.fixedPosition ? (f.setPosition(e, d), isNaN(e) || isNaN(d) ? f.followCursor(!0) : f.followCursor(!1)) : f.followCursor(!0),
  2033. a && f.showBalloon(a))
  2034. }, handleMouseOver: function () {
  2035. this.outTO && clearTimeout(this.outTO);
  2036. d.resetMouseOver();
  2037. this.mouseIsOver = !0
  2038. }, handleMouseOut: function () {
  2039. var a = this;
  2040. d.resetMouseOver();
  2041. a.outTO && clearTimeout(a.outTO);
  2042. a.outTO = setTimeout(function () {
  2043. a.handleMouseOutReal()
  2044. }, 10)
  2045. }, handleMouseOutReal: function () {
  2046. this.mouseIsOver = !1
  2047. }, handleMouseMove: function (a) {
  2048. a || (a = window.event);
  2049. this.mouse2Y = this.mouse2X = NaN;
  2050. var b, c, e, d;
  2051. if (a) {
  2052. if (a.touches) {
  2053. var f = a.touches.item(1);
  2054. f && this.panEventsEnabled && this.boundingRect &&
  2055. (e = f.clientX - this.boundingRect.left, d = f.clientY - this.boundingRect.top);
  2056. a = a.touches.item(0);
  2057. if (!a) return
  2058. } else this.wasTouched = !1;
  2059. this.boundingRect && a.clientX && (b = a.clientX - this.boundingRect.left, c = a.clientY - this.boundingRect.top);
  2060. isNaN(e) ? this.mouseX = b : (this.mouseX = Math.min(b, e), this.mouse2X = Math.max(b, e));
  2061. isNaN(d) ? this.mouseY = c : (this.mouseY = Math.min(c, d), this.mouse2Y = Math.max(c, d))
  2062. }
  2063. }, handleTouchStart: function (a) {
  2064. this.hideBalloonReal();
  2065. a && (a.touches && this.tapToActivate && !this.tapped || !this.panRequired) ||
  2066. (this.handleMouseMove(a), this.handleMouseDown(a))
  2067. }, handleTouchEnd: function (a) {
  2068. this.wasTouched = !0;
  2069. this.handleMouseMove(a);
  2070. d.resetMouseOver();
  2071. this.handleReleaseOutside(a)
  2072. }, handleReleaseOutside: function () {
  2073. }, handleMouseDown: function (a) {
  2074. d.resetMouseOver();
  2075. this.mouseIsOver = !0;
  2076. a && a.preventDefault && (this.panEventsEnabled ? a.preventDefault() : a.touches || a.preventDefault())
  2077. }, addLegend: function (a, b) {
  2078. a = d.processObject(a, d.AmLegend, this.theme);
  2079. a.divId = b;
  2080. a.ieW = 0;
  2081. var c;
  2082. c = "object" != typeof b && b ? document.getElementById(b) :
  2083. b;
  2084. this.legend = a;
  2085. a.chart = this;
  2086. c ? (a.div = c, a.position = "outside", a.autoMargins = !1) : a.div = this.legendDiv;
  2087. return a
  2088. }, removeLegend: function () {
  2089. this.legend = void 0;
  2090. this.legendDiv.innerHTML = ""
  2091. }, handleResize: function () {
  2092. (d.isPercents(this.width) || d.isPercents(this.height)) && this.invalidateSizeReal();
  2093. this.renderFix()
  2094. }, renderFix: function () {
  2095. if (!d.VML) {
  2096. var a = this.container;
  2097. a && a.renderFix()
  2098. }
  2099. }, getSVG: function () {
  2100. if (d.hasSVG) return this.container
  2101. }, animate: function (a, b, c, e, h, f, g) {
  2102. a["an_" + b] && d.removeFromArray(this.animations,
  2103. a["an_" + b]);
  2104. c = {obj: a, frame: 0, attribute: b, from: c, to: e, time: h, effect: f, suffix: g};
  2105. a["an_" + b] = c;
  2106. this.animations.push(c);
  2107. return c
  2108. }, setLegendData: function (a) {
  2109. var b = this.legend;
  2110. b && b.setData(a)
  2111. }, stopAnim: function (a) {
  2112. d.removeFromArray(this.animations, a)
  2113. }, updateAnimations: function () {
  2114. var a;
  2115. this.container && this.container.update();
  2116. if (this.animations) for (a = this.animations.length - 1; 0 <= a; a--) {
  2117. var b = this.animations[a], c = d.updateRate * b.time, e = b.frame + 1, h = b.obj, f = b.attribute;
  2118. if (e <= c) {
  2119. b.frame++;
  2120. var g = Number(b.from),
  2121. k = Number(b.to) - g, c = d[b.effect](0, e, g, k, c);
  2122. 0 === k ? (this.animations.splice(a, 1), h.node.style[f] = Number(b.to) + b.suffix) : h.node.style[f] = c + b.suffix
  2123. } else h.node.style[f] = Number(b.to) + b.suffix, h.animationFinished = !0, this.animations.splice(a, 1)
  2124. }
  2125. }, update: function () {
  2126. this.updateAnimations();
  2127. var a = this.animatable;
  2128. if (0 < a.length) {
  2129. for (var b = !0, c = a.length - 1; 0 <= c; c--) {
  2130. var e = a[c];
  2131. e && (e.animationFinished ? a.splice(c, 1) : b = !1)
  2132. }
  2133. b && (this.fire({type: "animationFinished", chart: this}), this.animatable = [])
  2134. }
  2135. }, inIframe: function () {
  2136. try {
  2137. return window.self !==
  2138. window.top
  2139. } catch (a) {
  2140. return !0
  2141. }
  2142. }, brr: function () {
  2143. if (!this.hideCredits) {
  2144. var a = "amcharts.com", b = window.location.hostname.split("."), c;
  2145. 2 <= b.length && (c = b[b.length - 2] + "." + b[b.length - 1]);
  2146. this.amLink && (b = this.amLink.parentNode) && b.removeChild(this.amLink);
  2147. b = this.creditsPosition;
  2148. if (c != a || !0 === this.inIframe()) {
  2149. var a = "http://www." + a, e = c = 0, d = this.realWidth, f = this.realHeight, g = this.type;
  2150. if ("serial" == g || "xy" == g || "gantt" == g) c = this.marginLeftReal, e = this.marginTopReal, d = c + this.plotAreaWidth, f = e + this.plotAreaHeight;
  2151. var g = a + "/javascript-charts/", k = "JavaScript charts", l = "JS chart by amCharts";
  2152. "ammap" == this.product && (g = a + "/javascript-maps/", k = "Interactive JavaScript maps", l = "JS map by amCharts");
  2153. a = document.createElement("a");
  2154. l = document.createTextNode(l);
  2155. a.setAttribute("href", g);
  2156. a.setAttribute("title", k);
  2157. a.appendChild(l);
  2158. this.chartDiv.appendChild(a);
  2159. this.amLink = a;
  2160. g = a.style;
  2161. g.position = "absolute";
  2162. g.textDecoration = "none";
  2163. g.color = this.color;
  2164. g.fontFamily = this.fontFamily;
  2165. g.fontSize = this.fontSize + "px";
  2166. g.opacity = .7;
  2167. g.display =
  2168. "block";
  2169. var k = a.offsetWidth, a = a.offsetHeight, l = 5 + c, m = e + 5;
  2170. "bottom-left" == b && (l = 5 + c, m = f - a - 3);
  2171. "bottom-right" == b && (l = d - k - 5, m = f - a - 3);
  2172. "top-right" == b && (l = d - k - 5, m = e + 5);
  2173. g.left = l + "px";
  2174. g.top = m + "px"
  2175. }
  2176. }
  2177. }
  2178. });
  2179. d.Slice = d.Class({
  2180. construct: function () {
  2181. }
  2182. });
  2183. d.SerialDataItem = d.Class({
  2184. construct: function () {
  2185. }
  2186. });
  2187. d.GraphDataItem = d.Class({
  2188. construct: function () {
  2189. }
  2190. });
  2191. d.Guide = d.Class({
  2192. construct: function (a) {
  2193. this.cname = "Guide";
  2194. d.applyTheme(this, a, this.cname)
  2195. }
  2196. });
  2197. d.Title = d.Class({
  2198. construct: function (a) {
  2199. this.cname = "Title";
  2200. d.applyTheme(this,
  2201. a, this.cname)
  2202. }
  2203. });
  2204. d.Label = d.Class({
  2205. construct: function (a) {
  2206. this.cname = "Label";
  2207. d.applyTheme(this, a, this.cname)
  2208. }
  2209. })
  2210. })();
  2211. (function () {
  2212. var d = window.AmCharts;
  2213. d.AmGraph = d.Class({
  2214. construct: function (a) {
  2215. this.cname = "AmGraph";
  2216. this.createEvents("rollOverGraphItem", "rollOutGraphItem", "clickGraphItem", "doubleClickGraphItem", "rightClickGraphItem", "clickGraph", "rollOverGraph", "rollOutGraph");
  2217. this.type = "line";
  2218. this.stackable = !0;
  2219. this.columnCount = 1;
  2220. this.columnIndex = 0;
  2221. this.centerCustomBullets = this.showBalloon = !0;
  2222. this.maxBulletSize = 50;
  2223. this.minBulletSize = 4;
  2224. this.balloonText = "[[value]]";
  2225. this.hidden = this.scrollbar = this.animationPlayed = !1;
  2226. this.pointPosition = "middle";
  2227. this.depthCount = 1;
  2228. this.includeInMinMax = !0;
  2229. this.negativeBase = 0;
  2230. this.visibleInLegend = !0;
  2231. this.showAllValueLabels = !1;
  2232. this.showBulletsAt = this.showBalloonAt = "close";
  2233. this.lineThickness = 1;
  2234. this.dashLength = 0;
  2235. this.connect = !0;
  2236. this.lineAlpha = 1;
  2237. this.bullet = "none";
  2238. this.bulletBorderThickness = 2;
  2239. this.bulletBorderAlpha = 0;
  2240. this.bulletAlpha = 1;
  2241. this.bulletSize = 8;
  2242. this.cornerRadiusTop = this.hideBulletsCount = this.bulletOffset = 0;
  2243. this.cursorBulletAlpha = 1;
  2244. this.gradientOrientation = "vertical";
  2245. this.dy =
  2246. this.dx = 0;
  2247. this.periodValue = "";
  2248. this.clustered = !0;
  2249. this.periodSpan = 1;
  2250. this.y = this.x = 0;
  2251. this.switchable = !0;
  2252. this.tcc = this.minDistance = 1;
  2253. this.labelRotation = 0;
  2254. this.labelAnchor = "auto";
  2255. this.labelOffset = 3;
  2256. this.bcn = "graph-";
  2257. this.dateFormat = "MMM DD, YYYY";
  2258. this.noRounding = !0;
  2259. d.applyTheme(this, a, this.cname)
  2260. }, init: function () {
  2261. this.createBalloon()
  2262. }, draw: function () {
  2263. var a = this.chart, b = a.type;
  2264. if (a.drawGraphs) {
  2265. isNaN(this.precision) || (this.numberFormatter ? this.numberFormatter.precision = this.precision : this.numberFormatter =
  2266. {
  2267. precision: this.precision,
  2268. decimalSeparator: a.decimalSeparator,
  2269. thousandsSeparator: a.thousandsSeparator
  2270. });
  2271. var c = a.container;
  2272. this.container = c;
  2273. this.destroy();
  2274. var e = c.set();
  2275. this.set = e;
  2276. e.translate(this.x, this.y);
  2277. var h = c.set();
  2278. this.bulletSet = h;
  2279. h.translate(this.x, this.y);
  2280. this.behindColumns ? (a.graphsBehindSet.push(e), a.bulletBehindSet.push(h)) : (a.graphsSet.push(e), a.bulletSet.push(h));
  2281. var f = this.bulletAxis;
  2282. d.isString(f) && (this.bulletAxis = a.getValueAxisById(f));
  2283. c = c.set();
  2284. d.remove(this.columnsSet);
  2285. this.columnsSet =
  2286. c;
  2287. d.setCN(a, e, "graph-" + this.type);
  2288. d.setCN(a, e, "graph-" + this.id);
  2289. d.setCN(a, h, "graph-" + this.type);
  2290. d.setCN(a, h, "graph-" + this.id);
  2291. this.columnsArray = [];
  2292. this.ownColumns = [];
  2293. this.allBullets = [];
  2294. this.animationArray = [];
  2295. h = this.labelPosition;
  2296. h || (f = this.valueAxis.stackType, h = "top", "column" == this.type && (a.rotate && (h = "right"), "100%" == f || "regular" == f) && (h = "middle"), this.labelPosition = h);
  2297. d.ifArray(this.data) && (a = !1, "xy" == b ? this.xAxis.axisCreated && this.yAxis.axisCreated && (a = !0) : this.valueAxis.axisCreated && (a = !0), !this.hidden &&
  2298. a && this.createGraph());
  2299. e.push(c)
  2300. }
  2301. }, createGraph: function () {
  2302. var a = this, b = a.chart;
  2303. a.startAlpha = b.startAlpha;
  2304. a.seqAn = b.sequencedAnimation;
  2305. a.baseCoord = a.valueAxis.baseCoord;
  2306. void 0 === a.fillAlphas && (a.fillAlphas = 0);
  2307. a.bulletColorR = a.bulletColor;
  2308. void 0 === a.bulletColorR && (a.bulletColorR = a.lineColorR, a.bulletColorNegative = a.negativeLineColor);
  2309. void 0 === a.bulletAlpha && (a.bulletAlpha = a.lineAlpha);
  2310. if ("step" == c || d.VML) a.noRounding = !1;
  2311. var c = b.type;
  2312. "gantt" == c && (c = "serial");
  2313. clearTimeout(a.playedTO);
  2314. if (!isNaN(a.valueAxis.min) &&
  2315. !isNaN(a.valueAxis.max)) {
  2316. switch (c) {
  2317. case "serial":
  2318. a.categoryAxis && (a.createSerialGraph(), "candlestick" == a.type && 1 > a.valueAxis.minMaxMultiplier && a.positiveClip(a.set));
  2319. break;
  2320. case "radar":
  2321. a.createRadarGraph();
  2322. break;
  2323. case "xy":
  2324. a.createXYGraph(), a.positiveClip(a.set)
  2325. }
  2326. a.playedTO = setTimeout(function () {
  2327. a.setAnimationPlayed.call(a)
  2328. }, 500 * a.chart.startDuration)
  2329. }
  2330. }, setAnimationPlayed: function () {
  2331. this.animationPlayed = !0
  2332. }, createXYGraph: function () {
  2333. var a = [], b = [], c = this.xAxis, e = this.yAxis;
  2334. this.pmh = e.height;
  2335. this.pmw =
  2336. c.width;
  2337. this.pmy = this.pmx = 0;
  2338. var d;
  2339. for (d = this.start; d <= this.end; d++) {
  2340. var f = this.data[d].axes[c.id].graphs[this.id], g = f.values, k = g.x, l = g.y,
  2341. g = c.getCoordinate(k, this.noRounding), m = e.getCoordinate(l, this.noRounding);
  2342. if (!isNaN(k) && !isNaN(l) && (a.push(g), b.push(m), f.x = g, f.y = m, k = this.createBullet(f, g, m, d), l = this.labelText)) {
  2343. var l = this.createLabel(f, l), n = 0;
  2344. k && (n = k.size);
  2345. this.positionLabel(f, g, m, l, n)
  2346. }
  2347. }
  2348. this.drawLineGraph(a, b);
  2349. this.launchAnimation()
  2350. }, createRadarGraph: function () {
  2351. var a = this.valueAxis.stackType,
  2352. b = [], c = [], e = [], d = [], f, g, k, l, m;
  2353. for (m = this.start; m <= this.end; m++) {
  2354. var n = this.data[m].axes[this.valueAxis.id].graphs[this.id], q, p;
  2355. "none" == a || "3d" == a ? q = n.values.value : (q = n.values.close, p = n.values.open);
  2356. if (isNaN(q)) this.connect || (this.drawLineGraph(b, c, e, d), b = [], c = [], e = [], d = []); else {
  2357. var t = this.valueAxis.getCoordinate(q, this.noRounding) - this.height,
  2358. t = t * this.valueAxis.rMultiplier, r = -360 / (this.end - this.start + 1) * m;
  2359. "middle" == this.valueAxis.pointPosition && (r -= 180 / (this.end - this.start + 1));
  2360. q = t * Math.sin(r / 180 *
  2361. Math.PI);
  2362. t *= Math.cos(r / 180 * Math.PI);
  2363. b.push(q);
  2364. c.push(t);
  2365. if (!isNaN(p)) {
  2366. var u = this.valueAxis.getCoordinate(p, this.noRounding) - this.height,
  2367. u = u * this.valueAxis.rMultiplier, y = u * Math.sin(r / 180 * Math.PI),
  2368. r = u * Math.cos(r / 180 * Math.PI);
  2369. e.push(y);
  2370. d.push(r);
  2371. isNaN(k) && (k = y);
  2372. isNaN(l) && (l = r)
  2373. }
  2374. r = this.createBullet(n, q, t, m);
  2375. n.x = q;
  2376. n.y = t;
  2377. if (y = this.labelText) y = this.createLabel(n, y), u = 0, r && (u = r.size), this.positionLabel(n, q, t, y, u);
  2378. isNaN(f) && (f = q);
  2379. isNaN(g) && (g = t)
  2380. }
  2381. }
  2382. b.push(f);
  2383. c.push(g);
  2384. isNaN(k) || (e.push(k), d.push(l));
  2385. this.drawLineGraph(b,
  2386. c, e, d);
  2387. this.launchAnimation()
  2388. }, positionLabel: function (a, b, c, e, d) {
  2389. if (e) {
  2390. var f = this.chart, g = this.valueAxis, k = "middle", l = !1, m = this.labelPosition, n = e.getBBox(),
  2391. q = this.chart.rotate, p = a.isNegative;
  2392. c -= n.height / 4 / 2;
  2393. void 0 !== a.labelIsNegative && (p = a.labelIsNegative);
  2394. switch (m) {
  2395. case "right":
  2396. m = q ? p ? "left" : "right" : "right";
  2397. break;
  2398. case "top":
  2399. m = q ? "top" : p ? "bottom" : "top";
  2400. break;
  2401. case "bottom":
  2402. m = q ? "bottom" : p ? "top" : "bottom";
  2403. break;
  2404. case "left":
  2405. m = q ? p ? "right" : "left" : "left"
  2406. }
  2407. var t = a.columnGraphics, r = 0, u = 0;
  2408. t && (r = t.x, u = t.y);
  2409. var y =
  2410. this.labelOffset;
  2411. switch (m) {
  2412. case "right":
  2413. k = "start";
  2414. b += d / 2 + y;
  2415. break;
  2416. case "top":
  2417. c = g.reversed ? c + (d / 2 + n.height / 2 + y) : c - (d / 2 + n.height / 2 + y);
  2418. break;
  2419. case "bottom":
  2420. c = g.reversed ? c - (d / 2 + n.height / 2 + y) : c + (d / 2 + n.height / 2 + y);
  2421. break;
  2422. case "left":
  2423. k = "end";
  2424. b -= d / 2 + y;
  2425. break;
  2426. case "inside":
  2427. "column" == this.type && (l = !0, q ? p ? (k = "end", b = r - 3 - y) : (k = "start", b = r + 3 + y) : c = p ? u + 7 + y : u - 10 - y);
  2428. break;
  2429. case "middle":
  2430. "column" == this.type && (l = !0, q ? b -= (b - r) / 2 + y - 3 : c -= (c - u) / 2 + y - 3)
  2431. }
  2432. "auto" != this.labelAnchor && (k = this.labelAnchor);
  2433. e.attr({"text-anchor": k});
  2434. this.labelRotation && e.rotate(this.labelRotation);
  2435. e.translate(b, c);
  2436. !this.showAllValueLabels && t && l && (n = e.getBBox(), n.height > a.columnHeight || n.width > a.columnWidth) && (e.remove(), e = null);
  2437. e && (0 > b || b > this.width || 0 > c || c > this.height) && (e.remove(), e = null);
  2438. if (e && ("serial" == f.type || "gantt" == f.type)) if (q) {
  2439. if (0 > c || c > this.height) e.remove(), e = null
  2440. } else if (0 > b || b > this.width) e.remove(), e = null;
  2441. e && this.allBullets.push(e);
  2442. return e
  2443. }
  2444. }, getGradRotation: function () {
  2445. var a = 270;
  2446. "horizontal" == this.gradientOrientation && (a = 0);
  2447. return this.gradientRotation =
  2448. a
  2449. }, createSerialGraph: function () {
  2450. this.dashLengthSwitched = this.fillColorsSwitched = this.lineColorSwitched = void 0;
  2451. var a = this.chart, b = this.id, c = this.index, e = this.data, h = this.chart.container,
  2452. f = this.valueAxis, g = this.type, k = this.columnWidthReal, l = this.showBulletsAt;
  2453. isNaN(this.columnWidth) || (k = this.columnWidth);
  2454. isNaN(k) && (k = .8);
  2455. var m = this.useNegativeColorIfDown, n = this.width, q = this.height, p = this.y, t = this.rotate,
  2456. r = this.columnCount, u = d.toCoordinate(this.cornerRadiusTop, k / 2), y = this.connect, x = [], w = [],
  2457. B, z, A, C, D =
  2458. this.chart.graphs.length, J, H = this.dx / this.tcc, R = this.dy / this.tcc, L = f.stackType,
  2459. P = this.start, ia = this.end, I = this.scrollbar, Z = "graph-column-";
  2460. I && (Z = "scrollbar-graph-column-");
  2461. var va = this.categoryAxis, la = this.baseCoord, Oa = this.negativeBase, ea = this.columnIndex,
  2462. ca = this.lineThickness, X = this.lineAlpha, ya = this.lineColorR, da = this.dashLength, fa = this.set,
  2463. za, ga = this.getGradRotation(), T = this.chart.columnSpacing, Y = va.cellWidth, Ca = (Y * k - r) / r;
  2464. T > Ca && (T = Ca);
  2465. var G, v, ma, ha = q, Pa = n, ba = 0, tb = 0, ub, vb, gb, hb, wb = this.fillColorsR,
  2466. Qa = this.negativeFillColors, Ja = this.negativeLineColor, Ya = this.fillAlphas,
  2467. Za = this.negativeFillAlphas;
  2468. "object" == typeof Ya && (Ya = Ya[0]);
  2469. "object" == typeof Za && (Za = Za[0]);
  2470. var xb = this.noRounding;
  2471. "step" == g && (xb = !1);
  2472. var ib = f.getCoordinate(f.min);
  2473. f.logarithmic && (ib = f.getCoordinate(f.minReal));
  2474. this.minCoord = ib;
  2475. this.resetBullet && (this.bullet = "none");
  2476. if (!(I || "line" != g && "smoothedLine" != g && "step" != g || (1 == e.length && "step" != g && "none" == this.bullet && (this.bullet = "round", this.resetBullet = !0), !Qa && void 0 == Ja || m))) {
  2477. var Ua =
  2478. Oa;
  2479. Ua > f.max && (Ua = f.max);
  2480. Ua < f.min && (Ua = f.min);
  2481. f.logarithmic && (Ua = f.minReal);
  2482. var Ka = f.getCoordinate(Ua), Nb = f.getCoordinate(f.max);
  2483. t ? (ha = q, Pa = Math.abs(Nb - Ka), ub = q, vb = Math.abs(ib - Ka), hb = tb = 0, f.reversed ? (ba = 0, gb = Ka) : (ba = Ka, gb = 0)) : (Pa = n, ha = Math.abs(Nb - Ka), vb = n, ub = Math.abs(ib - Ka), gb = ba = 0, f.reversed ? (hb = p, tb = Ka) : hb = Ka)
  2484. }
  2485. var La = Math.round;
  2486. this.pmx = La(ba);
  2487. this.pmy = La(tb);
  2488. this.pmh = La(ha);
  2489. this.pmw = La(Pa);
  2490. this.nmx = La(gb);
  2491. this.nmy = La(hb);
  2492. this.nmh = La(ub);
  2493. this.nmw = La(vb);
  2494. d.isModern || (this.nmy = this.nmx = 0, this.nmh =
  2495. this.height);
  2496. this.clustered || (r = 1);
  2497. k = "column" == g ? (Y * k - T * (r - 1)) / r : Y * k;
  2498. 1 > k && (k = 1);
  2499. var Ob = this.fixedColumnWidth;
  2500. isNaN(Ob) || (k = Ob);
  2501. var M;
  2502. if ("line" == g || "step" == g || "smoothedLine" == g) {
  2503. if (0 < P) {
  2504. for (M = P - 1; -1 < M; M--) if (G = e[M], v = G.axes[f.id].graphs[b], ma = v.values.value, !isNaN(ma)) {
  2505. P = M;
  2506. break
  2507. }
  2508. if (this.lineColorField) for (M = P; -1 < M; M--) if (G = e[M], v = G.axes[f.id].graphs[b], v.lineColor) {
  2509. this.bulletColorSwitched = this.lineColorSwitched = v.lineColor;
  2510. break
  2511. }
  2512. if (this.fillColorsField) for (M = P; -1 < M; M--) if (G = e[M], v = G.axes[f.id].graphs[b],
  2513. v.fillColors) {
  2514. this.fillColorsSwitched = v.fillColors;
  2515. break
  2516. }
  2517. if (this.dashLengthField) for (M = P; -1 < M; M--) if (G = e[M], v = G.axes[f.id].graphs[b], !isNaN(v.dashLength)) {
  2518. this.dashLengthSwitched = v.dashLength;
  2519. break
  2520. }
  2521. }
  2522. if (ia < e.length - 1) for (M = ia + 1; M < e.length; M++) if (G = e[M], v = G.axes[f.id].graphs[b], ma = v.values.value, !isNaN(ma)) {
  2523. ia = M;
  2524. break
  2525. }
  2526. }
  2527. ia < e.length - 1 && ia++;
  2528. var U = [], V = [], Ra = !1;
  2529. if ("line" == g || "step" == g || "smoothedLine" == g) if (this.stackable && "regular" == L || "100%" == L || this.fillToGraph) Ra = !0;
  2530. var Pb = this.noStepRisers, jb = -1E3,
  2531. kb = -1E3, lb = this.minDistance, Sa = !0, $a = !1, yb = 0, zb = 0;
  2532. for (M = P; M <= ia; M++) {
  2533. G = e[M];
  2534. v = G.axes[f.id].graphs[b];
  2535. v.index = M;
  2536. var ab, Ta = NaN;
  2537. if (m && void 0 == this.openField) for (var Ab = M + 1; Ab < e.length && (!e[Ab] || !(ab = e[M + 1].axes[f.id].graphs[b]) || !ab.values || (Ta = ab.values.value, isNaN(Ta))); Ab++) ;
  2538. var S, Q, K, aa, na = NaN, E = NaN, F = NaN, O = NaN, N = NaN, pa = NaN, qa = NaN, ra = NaN, sa = NaN,
  2539. wa = NaN, Da = NaN, ja = NaN, ka = NaN, W = NaN, Bb = NaN, Cb = NaN, ta = NaN, ua = void 0, Ma = wb,
  2540. Va = Ya, Ha = ya, Aa, Ea, Db = this.proCandlesticks, mb = this.topRadius, Fa = q - 1, oa = n - 1,
  2541. bb = this.pattern;
  2542. void 0 != v.pattern && (bb = v.pattern);
  2543. isNaN(v.alpha) || (Va = v.alpha);
  2544. isNaN(v.dashLength) || (da = v.dashLength);
  2545. var Ia = v.values;
  2546. f.recalculateToPercents && (Ia = v.percents);
  2547. if (Ia) {
  2548. W = this.stackable && "none" != L && "3d" != L ? Ia.close : Ia.value;
  2549. if ("candlestick" == g || "ohlc" == g) W = Ia.close, Cb = Ia.low, qa = f.getCoordinate(Cb), Bb = Ia.high, sa = f.getCoordinate(Bb);
  2550. ta = Ia.open;
  2551. F = f.getCoordinate(W, xb);
  2552. isNaN(ta) || (N = f.getCoordinate(ta, xb), m && "regular" != L && "100%" != L && (Ta = ta, ta = N = NaN));
  2553. m && (void 0 == this.openField ? ab && (ab.isNegative = Ta < W ? !0 :
  2554. !1, isNaN(Ta) && (v.isNegative = !Sa)) : v.isNegative = Ta > W ? !0 : !1);
  2555. if (!I) switch (this.showBalloonAt) {
  2556. case "close":
  2557. v.y = F;
  2558. break;
  2559. case "open":
  2560. v.y = N;
  2561. break;
  2562. case "high":
  2563. v.y = sa;
  2564. break;
  2565. case "low":
  2566. v.y = qa
  2567. }
  2568. var na = G.x[va.id], Wa = this.periodSpan - 1;
  2569. "step" != g || isNaN(G.cellWidth) || (Y = G.cellWidth);
  2570. var xa = Math.floor(Y / 2) + Math.floor(Wa * Y / 2), Ga = xa, nb = 0;
  2571. "left" == this.stepDirection && (nb = (2 * Y + Wa * Y) / 2, na -= nb);
  2572. "center" == this.stepDirection && (nb = Y / 2, na -= nb);
  2573. "start" == this.pointPosition && (na -= Y / 2 + Math.floor(Wa * Y / 2), xa = 0, Ga = Math.floor(Y) +
  2574. Math.floor(Wa * Y));
  2575. "end" == this.pointPosition && (na += Y / 2 + Math.floor(Wa * Y / 2), xa = Math.floor(Y) + Math.floor(Wa * Y), Ga = 0);
  2576. if (Pb) {
  2577. var Eb = this.columnWidth;
  2578. isNaN(Eb) || (xa *= Eb, Ga *= Eb)
  2579. }
  2580. I || (v.x = na);
  2581. -1E5 > na && (na = -1E5);
  2582. na > n + 1E5 && (na = n + 1E5);
  2583. t ? (E = F, O = N, N = F = na, isNaN(ta) && !this.fillToGraph && (O = la), pa = qa, ra = sa) : (O = E = na, isNaN(ta) && !this.fillToGraph && (N = la));
  2584. if (!Db && W < ta || Db && W < za) v.isNegative = !0, Qa && (Ma = Qa), Za && (Va = Za), void 0 != Ja && (Ha = Ja);
  2585. $a = !1;
  2586. isNaN(W) || (m ? W > Ta ? (Sa && ($a = !0), Sa = !1) : (Sa || ($a = !0), Sa = !0) : v.isNegative = W < Oa ?
  2587. !0 : !1, za = W);
  2588. var Qb = !1;
  2589. I && a.chartScrollbar.ignoreCustomColors && (Qb = !0);
  2590. Qb || (void 0 != v.color && (Ma = v.color), v.fillColors && (Ma = v.fillColors));
  2591. switch (g) {
  2592. case "line":
  2593. if (isNaN(W)) y || (this.drawLineGraph(x, w, U, V), x = [], w = [], U = [], V = []); else {
  2594. if (Math.abs(E - jb) >= lb || Math.abs(F - kb) >= lb) x.push(E), w.push(F), jb = E, kb = F;
  2595. wa = E;
  2596. Da = F;
  2597. ja = E;
  2598. ka = F;
  2599. !Ra || isNaN(N) || isNaN(O) || (U.push(O), V.push(N));
  2600. if ($a || void 0 != v.lineColor && v.lineColor != this.lineColorSwitched || void 0 != v.fillColors && v.fillColors != this.fillColorsSwitched || !isNaN(v.dashLength)) this.drawLineGraph(x,
  2601. w, U, V), x = [E], w = [F], U = [], V = [], !Ra || isNaN(N) || isNaN(O) || (U.push(O), V.push(N)), m ? Sa ? (this.lineColorSwitched = ya, this.fillColorsSwitched = wb) : (this.lineColorSwitched = Ja, this.fillColorsSwitched = Qa) : (this.lineColorSwitched = v.lineColor, this.fillColorsSwitched = v.fillColors), this.dashLengthSwitched = v.dashLength;
  2602. v.gap && (this.drawLineGraph(x, w, U, V), x = [], w = [], U = [], V = [])
  2603. }
  2604. break;
  2605. case "smoothedLine":
  2606. if (isNaN(W)) y || (this.drawSmoothedGraph(x, w, U, V), x = [], w = [], U = [], V = []); else {
  2607. if (Math.abs(E - jb) >= lb || Math.abs(F - kb) >= lb) x.push(E),
  2608. w.push(F), jb = E, kb = F;
  2609. wa = E;
  2610. Da = F;
  2611. ja = E;
  2612. ka = F;
  2613. !Ra || isNaN(N) || isNaN(O) || (U.push(O), V.push(N));
  2614. void 0 == v.lineColor && void 0 == v.fillColors && isNaN(v.dashLength) || (this.drawSmoothedGraph(x, w, U, V), x = [E], w = [F], U = [], V = [], !Ra || isNaN(N) || isNaN(O) || (U.push(O), V.push(N)), this.lineColorSwitched = v.lineColor, this.fillColorsSwitched = v.fillColors, this.dashLengthSwitched = v.dashLength);
  2615. v.gap && (this.drawSmoothedGraph(x, w, U, V), x = [], w = [], U = [], V = [])
  2616. }
  2617. break;
  2618. case "step":
  2619. if (!isNaN(W)) {
  2620. t ? (isNaN(B) || (x.push(B), w.push(F - xa)), w.push(F -
  2621. xa), x.push(E), w.push(F + Ga), x.push(E), !Ra || isNaN(N) || isNaN(O) || (isNaN(A) || (U.push(A), V.push(N - xa)), U.push(O), V.push(N - xa), U.push(O), V.push(N + Ga))) : (isNaN(z) || (w.push(z), x.push(E - xa)), x.push(E - xa), w.push(F), x.push(E + Ga), w.push(F), !Ra || isNaN(N) || isNaN(O) || (isNaN(C) || (U.push(O - xa), V.push(C)), U.push(O - xa), V.push(N), U.push(O + Ga), V.push(N)));
  2622. B = E;
  2623. z = F;
  2624. A = O;
  2625. C = N;
  2626. wa = E;
  2627. Da = F;
  2628. ja = E;
  2629. ka = F;
  2630. if ($a || void 0 != v.lineColor || void 0 != v.fillColors || !isNaN(v.dashLength)) {
  2631. var ec = x[x.length - 2], fc = w[w.length - 2];
  2632. x.pop();
  2633. w.pop();
  2634. this.drawLineGraph(x,
  2635. w, U, V);
  2636. x = [ec];
  2637. w = [fc];
  2638. t ? (w.push(F + Ga), x.push(E)) : (x.push(E + Ga), w.push(F));
  2639. U = [];
  2640. V = [];
  2641. this.lineColorSwitched = v.lineColor;
  2642. this.fillColorsSwitched = v.fillColors;
  2643. this.dashLengthSwitched = v.dashLength;
  2644. m && (Sa ? (this.lineColorSwitched = ya, this.fillColorsSwitched = wb) : (this.lineColorSwitched = Ja, this.fillColorsSwitched = Qa))
  2645. }
  2646. if (Pb || v.gap) B = z = NaN, this.drawLineGraph(x, w, U, V), x = [], w = [], U = [], V = []
  2647. } else if (!y) {
  2648. if (1 >= this.periodSpan || 1 < this.periodSpan && E - B > xa + Ga) B = z = NaN;
  2649. this.drawLineGraph(x, w, U, V);
  2650. x = [];
  2651. w = [];
  2652. U = [];
  2653. V = []
  2654. }
  2655. break;
  2656. case "column":
  2657. Aa = Ha;
  2658. void 0 != v.lineColor && (Aa = v.lineColor);
  2659. if (!isNaN(W)) {
  2660. m || (v.isNegative = W < Oa ? !0 : !1);
  2661. v.isNegative && (Qa && (Ma = Qa), void 0 != Ja && (Aa = Ja));
  2662. var Rb = f.min, Sb = f.max, ob = ta;
  2663. isNaN(ob) && (ob = Oa);
  2664. if (!(W < Rb && ob < Rb || W > Sb && ob > Sb)) {
  2665. var Ba;
  2666. if (t) {
  2667. "3d" == L ? (Q = F - (r / 2 - this.depthCount + 1) * (k + T) + T / 2 + R * ea, S = O + H * ea, Ba = ea) : (Q = Math.floor(F - (r / 2 - ea) * (k + T) + T / 2), S = O, Ba = 0);
  2668. K = k;
  2669. wa = E;
  2670. Da = Q + k / 2;
  2671. ja = E;
  2672. ka = Q + k / 2;
  2673. Q + K > q + Ba * R && (K = q - Q + Ba * R);
  2674. Q < Ba * R && (K += Q, Q = Ba * R);
  2675. aa = E - O;
  2676. var gc = S;
  2677. S = d.fitToBounds(S, 0, n);
  2678. aa += gc - S;
  2679. aa = d.fitToBounds(aa,
  2680. -S, n - S + H * ea);
  2681. v.labelIsNegative = 0 > aa ? !0 : !1;
  2682. 0 === aa && 1 / W === 1 / -0 && (v.labelIsNegative = !0);
  2683. isNaN(G.percentWidthValue) || (K = this.height * G.percentWidthValue / 100, Q = zb, zb += K, Da = Q + K / 2);
  2684. K = d.roundTo(K, 2);
  2685. aa = d.roundTo(aa, 2);
  2686. Q < q && 0 < K && (ua = new d.Cuboid(h, aa, K, H - a.d3x, R - a.d3y, Ma, Va, ca, Aa, X, ga, u, t, da, bb, mb, Z), v.columnWidth = Math.abs(aa), v.columnHeight = Math.abs(K))
  2687. } else {
  2688. "3d" == L ? (S = E - (r / 2 - this.depthCount + 1) * (k + T) + T / 2 + H * ea, Q = N + R * ea, Ba = ea) : (S = E - (r / 2 - ea) * (k + T) + T / 2, Q = N, Ba = 0);
  2689. K = k;
  2690. wa = S + k / 2;
  2691. Da = F;
  2692. ja = S + k / 2;
  2693. ka = F;
  2694. S + K > n + Ba * H && (K =
  2695. n - S + Ba * H);
  2696. S < Ba * H && (K += S - Ba * H, S = Ba * H);
  2697. aa = F - N;
  2698. v.labelIsNegative = 0 < aa ? !0 : !1;
  2699. 0 === aa && -0 === W && (v.labelIsNegative = !0);
  2700. var hc = Q;
  2701. Q = d.fitToBounds(Q, this.dy, q);
  2702. aa += hc - Q;
  2703. aa = d.fitToBounds(aa, -Q + R * ea, q - Q);
  2704. isNaN(G.percentWidthValue) || (K = this.width * G.percentWidthValue / 100, S = yb, yb += K, wa = S + K / 2);
  2705. K = d.roundTo(K, 2);
  2706. aa = d.roundTo(aa, 2);
  2707. S < n + ea * H && 0 < K && (this.showOnAxis && (Q -= R / 2), ua = new d.Cuboid(h, K, aa, H - a.d3x, R - a.d3y, Ma, Va, ca, Aa, this.lineAlpha, ga, u, t, da, bb, mb, Z), v.columnHeight = Math.abs(aa), v.columnWidth = Math.abs(K))
  2708. }
  2709. }
  2710. if (ua) {
  2711. Ea =
  2712. ua.set;
  2713. d.setCN(a, ua.set, "graph-" + this.type);
  2714. d.setCN(a, ua.set, "graph-" + this.id);
  2715. v.className && d.setCN(a, ua.set, v.className, !0);
  2716. v.columnGraphics = Ea;
  2717. S = d.roundTo(S, 2);
  2718. Q = d.roundTo(Q, 2);
  2719. Ea.translate(S, Q);
  2720. (v.url || this.showHandOnHover) && Ea.setAttr("cursor", "pointer");
  2721. if (!I) {
  2722. "none" == L && (J = t ? (this.end + 1 - M) * D - c : D * M + c);
  2723. "3d" == L && (t ? (J = (this.end + 1 - M) * D - c - 1E3 * this.depthCount, wa += H * this.columnIndex, ja += H * this.columnIndex, v.y += H * this.columnIndex) : (J = (D - c) * (M + 1) + 1E3 * this.depthCount, Da += R * this.columnIndex, ka += R * this.columnIndex,
  2724. v.y += R * this.columnIndex));
  2725. if ("regular" == L || "100%" == L) J = t ? 0 < Ia.value ? (this.end + 1 - M) * D + c : (this.end + 1 - M) * D - c : 0 < Ia.value ? D * M + c : D * M - c;
  2726. this.columnsArray.push({column: ua, depth: J});
  2727. v.x = t ? Q + K / 2 : S + K / 2;
  2728. this.ownColumns.push(ua);
  2729. this.animateColumns(ua, M, E, O, F, N);
  2730. this.addListeners(Ea, v)
  2731. }
  2732. this.columnsSet.push(Ea)
  2733. }
  2734. }
  2735. break;
  2736. case "candlestick":
  2737. if (!isNaN(ta) && !isNaN(W)) {
  2738. var Xa, cb;
  2739. Aa = Ha;
  2740. void 0 != v.lineColor && (Aa = v.lineColor);
  2741. wa = E;
  2742. ka = Da = F;
  2743. ja = E;
  2744. if (t) {
  2745. "open" == l && (ja = O);
  2746. "high" == l && (ja = ra);
  2747. "low" == l && (ja = pa);
  2748. E = d.fitToBounds(E,
  2749. 0, oa);
  2750. O = d.fitToBounds(O, 0, oa);
  2751. pa = d.fitToBounds(pa, 0, oa);
  2752. ra = d.fitToBounds(ra, 0, oa);
  2753. if (0 === E && 0 === O && 0 === pa && 0 === ra) continue;
  2754. if (E == oa && O == oa && pa == oa && ra == oa) continue;
  2755. Q = F - k / 2;
  2756. S = O;
  2757. K = k;
  2758. Q + K > q && (K = q - Q);
  2759. 0 > Q && (K += Q, Q = 0);
  2760. if (Q < q && 0 < K) {
  2761. var Fb, Gb;
  2762. W > ta ? (Fb = [E, ra], Gb = [O, pa]) : (Fb = [O, ra], Gb = [E, pa]);
  2763. !isNaN(ra) && !isNaN(pa) && F < q && 0 < F && (Xa = d.line(h, Fb, [F, F], Aa, X, ca), cb = d.line(h, Gb, [F, F], Aa, X, ca));
  2764. aa = E - O;
  2765. ua = new d.Cuboid(h, aa, K, H, R, Ma, Ya, ca, Aa, X, ga, u, t, da, bb, mb, Z)
  2766. }
  2767. } else {
  2768. "open" == l && (ka = N);
  2769. "high" == l && (ka = sa);
  2770. "low" == l && (ka =
  2771. qa);
  2772. F = d.fitToBounds(F, 0, Fa);
  2773. N = d.fitToBounds(N, 0, Fa);
  2774. qa = d.fitToBounds(qa, 0, Fa);
  2775. sa = d.fitToBounds(sa, 0, Fa);
  2776. if (0 === F && 0 === N && 0 === qa && 0 === sa) continue;
  2777. if (F == Fa && N == Fa && qa == Fa && sa == Fa) continue;
  2778. S = E - k / 2;
  2779. Q = N + ca / 2;
  2780. K = k;
  2781. S + K > n && (K = n - S);
  2782. 0 > S && (K += S, S = 0);
  2783. aa = F - N;
  2784. if (S < n && 0 < K) {
  2785. Db && W >= ta && (Va = 0);
  2786. var ua = new d.Cuboid(h, K, aa, H, R, Ma, Va, ca, Aa, X, ga, u, t, da, bb, mb, Z),
  2787. Hb, Ib;
  2788. W > ta ? (Hb = [F, sa], Ib = [N, qa]) : (Hb = [N, sa], Ib = [F, qa]);
  2789. !isNaN(sa) && !isNaN(qa) && E < n && 0 < E && (Xa = d.line(h, [E, E], Hb, Aa, X, ca), cb = d.line(h, [E, E], Ib, Aa, X, ca), d.setCN(a, Xa,
  2790. this.bcn + "line-high"), v.className && d.setCN(a, Xa, v.className, !0), d.setCN(a, cb, this.bcn + "line-low"), v.className && d.setCN(a, cb, v.className, !0))
  2791. }
  2792. }
  2793. ua && (Ea = ua.set, v.columnGraphics = Ea, fa.push(Ea), Ea.translate(S, Q - ca / 2), (v.url || this.showHandOnHover) && Ea.setAttr("cursor", "pointer"), Xa && (fa.push(Xa), fa.push(cb)), I || (v.x = t ? Q + K / 2 : S + K / 2, this.animateColumns(ua, M, E, O, F, N), this.addListeners(Ea, v)))
  2794. }
  2795. break;
  2796. case "ohlc":
  2797. if (!(isNaN(ta) || isNaN(Bb) || isNaN(Cb) || isNaN(W))) {
  2798. var Tb = h.set();
  2799. fa.push(Tb);
  2800. W < ta && (v.isNegative = !0,
  2801. void 0 != Ja && (Ha = Ja));
  2802. var pb, qb, rb;
  2803. if (t) {
  2804. ka = F;
  2805. ja = E;
  2806. "open" == l && (ja = O);
  2807. "high" == l && (ja = ra);
  2808. "low" == l && (ja = pa);
  2809. pa = d.fitToBounds(pa, 0, oa);
  2810. ra = d.fitToBounds(ra, 0, oa);
  2811. if (0 === E && 0 === O && 0 === pa && 0 === ra) continue;
  2812. if (E == oa && O == oa && pa == oa && ra == oa) continue;
  2813. var Jb = F - k / 2, Jb = d.fitToBounds(Jb, 0, q), Ub = d.fitToBounds(F, 0, q),
  2814. Kb = F + k / 2, Kb = d.fitToBounds(Kb, 0, q);
  2815. 0 <= O && O <= oa && (qb = d.line(h, [O, O], [Jb, Ub], Ha, X, ca, da));
  2816. 0 < F && F < q && (pb = d.line(h, [pa, ra], [F, F], Ha, X, ca, da));
  2817. 0 <= E && E <= oa && (rb = d.line(h, [E, E], [Ub, Kb], Ha, X, ca, da))
  2818. } else {
  2819. ka = F;
  2820. "open" == l && (ka = N);
  2821. "high" == l && (ka = sa);
  2822. "low" == l && (ka = qa);
  2823. var ja = E, qa = d.fitToBounds(qa, 0, Fa), sa = d.fitToBounds(sa, 0, Fa),
  2824. Lb = E - k / 2, Lb = d.fitToBounds(Lb, 0, n), Vb = d.fitToBounds(E, 0, n),
  2825. Mb = E + k / 2, Mb = d.fitToBounds(Mb, 0, n);
  2826. 0 <= N && N <= Fa && (qb = d.line(h, [Lb, Vb], [N, N], Ha, X, ca, da));
  2827. 0 < E && E < n && (pb = d.line(h, [E, E], [qa, sa], Ha, X, ca, da));
  2828. 0 <= F && F <= Fa && (rb = d.line(h, [Vb, Mb], [F, F], Ha, X, ca, da))
  2829. }
  2830. fa.push(qb);
  2831. fa.push(pb);
  2832. fa.push(rb);
  2833. d.setCN(a, qb, this.bcn + "stroke-open");
  2834. d.setCN(a, rb, this.bcn + "stroke-close");
  2835. d.setCN(a, pb, this.bcn + "stroke");
  2836. v.className && d.setCN(a, Tb, v.className, !0);
  2837. wa = E;
  2838. Da = F
  2839. }
  2840. }
  2841. if (!I && !isNaN(W)) {
  2842. var Wb = this.hideBulletsCount;
  2843. if (this.end - this.start <= Wb || 0 === Wb) {
  2844. var Xb = this.createBullet(v, ja, ka, M), Yb = this.labelText;
  2845. if (Yb && !isNaN(wa) && !isNaN(wa)) {
  2846. var ic = this.createLabel(v, Yb), Zb = 0;
  2847. Xb && (Zb = Xb.size);
  2848. this.positionLabel(v, wa, Da, ic, Zb)
  2849. }
  2850. if ("regular" == L || "100%" == L) {
  2851. var $b = f.totalText;
  2852. if ($b) {
  2853. var Na = this.createLabel(v, $b, f.totalTextColor);
  2854. d.setCN(a, Na, this.bcn + "label-total");
  2855. this.allBullets.push(Na);
  2856. if (Na) {
  2857. var ac = Na.getBBox(), bc = ac.width,
  2858. cc = ac.height, db, eb, sb = f.totalTextOffset, dc = f.totals[M];
  2859. dc && dc.remove();
  2860. var fb = 0;
  2861. "column" != g && (fb = this.bulletSize);
  2862. t ? (eb = Da, db = 0 > W ? E - bc / 2 - 2 - fb - sb : E + bc / 2 + 3 + fb + sb) : (db = wa, eb = 0 > W ? F + cc / 2 + fb + sb : F - cc / 2 - 3 - fb - sb);
  2863. Na.translate(db, eb);
  2864. f.totals[M] = Na;
  2865. t ? (0 > eb || eb > q) && Na.remove() : (0 > db || db > n) && Na.remove()
  2866. }
  2867. }
  2868. }
  2869. }
  2870. }
  2871. }
  2872. }
  2873. if ("line" == g || "step" == g || "smoothedLine" == g) "smoothedLine" == g ? this.drawSmoothedGraph(x, w, U, V) : this.drawLineGraph(x, w, U, V), I || this.launchAnimation();
  2874. this.bulletsHidden && this.hideBullets();
  2875. this.customBulletsHidden &&
  2876. this.hideCustomBullets()
  2877. }, animateColumns: function (a, b) {
  2878. var c = this, e = c.chart.startDuration;
  2879. 0 < e && !c.animationPlayed && (c.seqAn ? (a.set.hide(), c.animationArray.push(a), e = setTimeout(function () {
  2880. c.animate.call(c)
  2881. }, e / (c.end - c.start + 1) * (b - c.start) * 1E3), c.timeOuts.push(e)) : c.animate(a), c.chart.animatable.push(a))
  2882. }, createLabel: function (a, b, c) {
  2883. var e = this.chart, h = a.labelColor;
  2884. h || (h = this.color);
  2885. h || (h = e.color);
  2886. c && (h = c);
  2887. c = this.fontSize;
  2888. void 0 === c && (this.fontSize = c = e.fontSize);
  2889. var f = this.labelFunction;
  2890. b = e.formatString(b,
  2891. a);
  2892. b = d.cleanFromEmpty(b);
  2893. f && (b = f(a, b));
  2894. if (void 0 !== b && "" !== b) return a = d.text(this.container, b, h, e.fontFamily, c), a.node.style.pointerEvents = "none", d.setCN(e, a, this.bcn + "label"), this.bulletSet.push(a), a
  2895. }, positiveClip: function (a) {
  2896. a.clipRect(this.pmx, this.pmy, this.pmw, this.pmh)
  2897. }, negativeClip: function (a) {
  2898. a.clipRect(this.nmx, this.nmy, this.nmw, this.nmh)
  2899. }, drawLineGraph: function (a, b, c, e) {
  2900. var h = this;
  2901. if (1 < a.length) {
  2902. var f = h.noRounding, g = h.set, k = h.chart, l = h.container, m = l.set(), n = l.set();
  2903. g.push(n);
  2904. g.push(m);
  2905. var q =
  2906. h.lineAlpha, p = h.lineThickness, g = h.fillAlphas, t = h.lineColorR, r = h.negativeLineAlpha;
  2907. isNaN(r) && (r = q);
  2908. var u = h.lineColorSwitched;
  2909. u && (t = u);
  2910. var u = h.fillColorsR, y = h.fillColorsSwitched;
  2911. y && (u = y);
  2912. var x = h.dashLength;
  2913. (y = h.dashLengthSwitched) && (x = y);
  2914. var y = h.negativeLineColor, w = h.negativeFillColors, B = h.negativeFillAlphas, z = h.baseCoord;
  2915. 0 !== h.negativeBase && (z = h.valueAxis.getCoordinate(h.negativeBase, f), z > h.height && (z = h.height), 0 > z && (z = 0));
  2916. q = d.line(l, a, b, t, q, p, x, !1, !0, f);
  2917. d.setCN(k, q, h.bcn + "stroke");
  2918. m.push(q);
  2919. m.click(function (a) {
  2920. h.handleGraphEvent(a,
  2921. "clickGraph")
  2922. }).mouseover(function (a) {
  2923. h.handleGraphEvent(a, "rollOverGraph")
  2924. }).mouseout(function (a) {
  2925. h.handleGraphEvent(a, "rollOutGraph")
  2926. }).touchmove(function (a) {
  2927. h.chart.handleMouseMove(a)
  2928. }).touchend(function (a) {
  2929. h.chart.handleTouchEnd(a)
  2930. });
  2931. void 0 === y || h.useNegativeColorIfDown || (p = d.line(l, a, b, y, r, p, x, !1, !0, f), d.setCN(k, p, h.bcn + "stroke"), d.setCN(k, p, h.bcn + "stroke-negative"), n.push(p));
  2932. if (0 < g || 0 < B) if (p = a.join(";").split(";"), r = b.join(";").split(";"), q = k.type, "serial" == q || "radar" == q ? 0 < c.length ? (c.reverse(),
  2933. e.reverse(), p = a.concat(c), r = b.concat(e)) : "radar" == q ? (r.push(0), p.push(0)) : h.rotate ? (r.push(r[r.length - 1]), p.push(z), r.push(r[0]), p.push(z), r.push(r[0]), p.push(p[0])) : (p.push(p[p.length - 1]), r.push(z), p.push(p[0]), r.push(z), p.push(a[0]), r.push(r[0])) : "xy" == q && (b = h.fillToAxis) && (d.isString(b) && (b = k.getValueAxisById(b)), "H" == b.orientation ? (z = "top" == b.position ? 0 : b.height, p.push(p[p.length - 1]), r.push(z), p.push(p[0]), r.push(z), p.push(a[0]), r.push(r[0])) : (z = "left" == b.position ? 0 : b.width, r.push(r[r.length -
  2934. 1]), p.push(z), r.push(r[0]), p.push(z), r.push(r[0]), p.push(p[0]))), a = h.gradientRotation, 0 < g && (b = d.polygon(l, p, r, u, g, 1, "#000", 0, a, f), b.pattern(h.pattern, NaN, k.path), d.setCN(k, b, h.bcn + "fill"), m.push(b)), w || void 0 !== y) isNaN(B) && (B = g), w || (w = y), f = d.polygon(l, p, r, w, B, 1, "#000", 0, a, f), d.setCN(k, f, h.bcn + "fill"), d.setCN(k, f, h.bcn + "fill-negative"), f.pattern(h.pattern, NaN, k.path), n.push(f), n.click(function (a) {
  2935. h.handleGraphEvent(a, "clickGraph")
  2936. }).mouseover(function (a) {
  2937. h.handleGraphEvent(a, "rollOverGraph")
  2938. }).mouseout(function (a) {
  2939. h.handleGraphEvent(a,
  2940. "rollOutGraph")
  2941. }).touchmove(function (a) {
  2942. h.chart.handleMouseMove(a)
  2943. }).touchend(function (a) {
  2944. h.chart.handleTouchEnd(a)
  2945. });
  2946. h.applyMask(n, m)
  2947. }
  2948. }, applyMask: function (a, b) {
  2949. var c = a.length();
  2950. "serial" != this.chart.type || this.scrollbar || (this.positiveClip(b), 0 < c && this.negativeClip(a))
  2951. }, drawSmoothedGraph: function (a, b, c, e) {
  2952. if (1 < a.length) {
  2953. var h = this.set, f = this.chart, g = this.container, k = g.set(), l = g.set();
  2954. h.push(l);
  2955. h.push(k);
  2956. var m = this.lineAlpha, n = this.lineThickness, h = this.dashLength, q = this.fillAlphas,
  2957. p = this.lineColorR,
  2958. t = this.fillColorsR, r = this.negativeLineColor, u = this.negativeFillColors,
  2959. y = this.negativeFillAlphas, x = this.baseCoord, w = this.lineColorSwitched;
  2960. w && (p = w);
  2961. (w = this.fillColorsSwitched) && (t = w);
  2962. w = this.negativeLineAlpha;
  2963. isNaN(w) && (w = m);
  2964. m = new d.Bezier(g, a, b, p, m, n, t, 0, h);
  2965. d.setCN(f, m, this.bcn + "stroke");
  2966. k.push(m.path);
  2967. void 0 !== r && (n = new d.Bezier(g, a, b, r, w, n, t, 0, h), d.setCN(f, n, this.bcn + "stroke"), d.setCN(f, n, this.bcn + "stroke-negative"), l.push(n.path));
  2968. 0 < q && (m = a.join(";").split(";"), p = b.join(";").split(";"), n = "", 0 < c.length ?
  2969. (c.push("M"), e.push("M"), c.reverse(), e.reverse(), m = a.concat(c), p = b.concat(e)) : (this.rotate ? (n += " L" + x + "," + b[b.length - 1], n += " L" + x + "," + b[0]) : (n += " L" + a[a.length - 1] + "," + x, n += " L" + a[0] + "," + x), n += " L" + a[0] + "," + b[0]), c = new d.Bezier(g, m, p, NaN, 0, 0, t, q, h, n), d.setCN(f, c, this.bcn + "fill"), c.path.pattern(this.pattern, NaN, f.path), k.push(c.path), u || void 0 !== r) && (y || (y = q), u || (u = r), a = new d.Bezier(g, a, b, NaN, 0, 0, u, y, h, n), a.path.pattern(this.pattern, NaN, f.path), d.setCN(f, a, this.bcn + "fill"), d.setCN(f, a, this.bcn + "fill-negative"),
  2970. l.push(a.path));
  2971. this.applyMask(l, k)
  2972. }
  2973. }, launchAnimation: function () {
  2974. var a = this, b = a.chart.startDuration;
  2975. if (0 < b && !a.animationPlayed) {
  2976. var c = a.set, e = a.bulletSet;
  2977. d.VML || (c.attr({opacity: a.startAlpha}), e.attr({opacity: a.startAlpha}));
  2978. c.hide();
  2979. e.hide();
  2980. a.seqAn ? (b = setTimeout(function () {
  2981. a.animateGraphs.call(a)
  2982. }, a.index * b * 1E3), a.timeOuts.push(b)) : a.animateGraphs()
  2983. }
  2984. }, animateGraphs: function () {
  2985. var a = this.chart, b = this.set, c = this.bulletSet, e = this.x, d = this.y;
  2986. b.show();
  2987. c.show();
  2988. var f = a.startDuration, g = a.startEffect;
  2989. b &&
  2990. (this.rotate ? (b.translate(-1E3, d), c.translate(-1E3, d)) : (b.translate(e, -1E3), c.translate(e, -1E3)), b.animate({
  2991. opacity: 1,
  2992. translate: e + "," + d
  2993. }, f, g), c.animate({opacity: 1, translate: e + "," + d}, f, g), a.animatable.push(b))
  2994. }, animate: function (a) {
  2995. var b = this.chart, c = this.animationArray;
  2996. !a && 0 < c.length && (a = c[0], c.shift());
  2997. c = d[d.getEffect(b.startEffect)];
  2998. b = b.startDuration;
  2999. a && (this.rotate ? a.animateWidth(b, c) : a.animateHeight(b, c), a.set.show())
  3000. }, legendKeyColor: function () {
  3001. var a = this.legendColor, b = this.lineAlpha;
  3002. void 0 ===
  3003. a && (a = this.lineColorR, 0 === b && (b = this.fillColorsR) && (a = "object" == typeof b ? b[0] : b));
  3004. return a
  3005. }, legendKeyAlpha: function () {
  3006. var a = this.legendAlpha;
  3007. void 0 === a && (a = this.lineAlpha, this.fillAlphas > a && (a = this.fillAlphas), 0 === a && (a = this.bulletAlpha), 0 === a && (a = 1));
  3008. return a
  3009. }, createBullet: function (a, b, c) {
  3010. if (!isNaN(b) && !isNaN(c) && ("none" != this.bullet || this.customBullet || a.bullet || a.customBullet)) {
  3011. var e = this.chart, h = this.container, f = this.bulletOffset, g = this.bulletSize;
  3012. isNaN(a.bulletSize) || (g = a.bulletSize);
  3013. var k = a.values.value,
  3014. l = this.maxValue, m = this.minValue, n = this.maxBulletSize, q = this.minBulletSize;
  3015. isNaN(l) || (isNaN(k) || (g = (k - m) / (l - m) * (n - q) + q), m == l && (g = n));
  3016. l = g;
  3017. this.bulletAxis && (g = a.values.error, isNaN(g) || (k = g), g = this.bulletAxis.stepWidth * k);
  3018. g < this.minBulletSize && (g = this.minBulletSize);
  3019. this.rotate ? b = a.isNegative ? b - f : b + f : c = a.isNegative ? c + f : c - f;
  3020. q = this.bulletColorR;
  3021. a.lineColor && (this.bulletColorSwitched = a.lineColor);
  3022. this.bulletColorSwitched && (q = this.bulletColorSwitched);
  3023. a.isNegative && void 0 !== this.bulletColorNegative && (q = this.bulletColorNegative);
  3024. void 0 !== a.color && (q = a.color);
  3025. var p;
  3026. "xy" == e.type && this.valueField && (p = this.pattern, a.pattern && (p = a.pattern));
  3027. f = this.bullet;
  3028. a.bullet && (f = a.bullet);
  3029. var k = this.bulletBorderThickness, m = this.bulletBorderColorR, n = this.bulletBorderAlpha,
  3030. t = this.bulletAlpha;
  3031. m || (m = q);
  3032. this.useLineColorForBulletBorder && (m = this.lineColorR, this.lineColorSwitched && (m = this.lineColorSwitched));
  3033. var r = a.alpha;
  3034. isNaN(r) || (t = r);
  3035. p = d.bullet(h, f, g, q, t, k, m, n, l, 0, p, e.path);
  3036. l = this.customBullet;
  3037. a.customBullet && (l = a.customBullet);
  3038. l && (p && p.remove(),
  3039. "function" == typeof l ? (l = new l, l.chart = e, a.bulletConfig && (l.availableSpace = c, l.graph = this, l.graphDataItem = a, l.bulletY = c, a.bulletConfig.minCoord = this.minCoord - c, l.bulletConfig = a.bulletConfig), l.write(h), p && l.showBullet && l.set.push(p), a.customBulletGraphics = l.cset, p = l.set) : (p = h.set(), h = h.image(l, 0, 0, g, g), p.push(h), this.centerCustomBullets && h.translate(-g / 2, -g / 2)));
  3040. if (p) {
  3041. (a.url || this.showHandOnHover) && p.setAttr("cursor", "pointer");
  3042. if ("serial" == e.type || "gantt" == e.type) if (-.5 > b || b > this.width || c < -g / 2 || c >
  3043. this.height) p.remove(), p = null;
  3044. p && (this.bulletSet.push(p), p.translate(b, c), this.addListeners(p, a), this.allBullets.push(p));
  3045. a.bx = b;
  3046. a.by = c;
  3047. d.setCN(e, p, this.bcn + "bullet");
  3048. a.className && d.setCN(e, p, a.className, !0)
  3049. }
  3050. p ? (p.size = g || 0, a.bulletGraphics = p) : p = {size: 0};
  3051. p.graphDataItem = a;
  3052. return p
  3053. }
  3054. }, showBullets: function () {
  3055. var a = this.allBullets, b;
  3056. this.bulletsHidden = !1;
  3057. for (b = 0; b < a.length; b++) a[b].show()
  3058. }, hideBullets: function () {
  3059. var a = this.allBullets, b;
  3060. this.bulletsHidden = !0;
  3061. for (b = 0; b < a.length; b++) a[b].hide()
  3062. }, showCustomBullets: function () {
  3063. var a =
  3064. this.allBullets, b;
  3065. this.customBulletsHidden = !1;
  3066. for (b = 0; b < a.length; b++) {
  3067. var c = a[b].graphDataItem;
  3068. c.customBulletGraphics && c.customBulletGraphics.show()
  3069. }
  3070. }, hideCustomBullets: function () {
  3071. var a = this.allBullets, b;
  3072. this.customBulletsHidden = !0;
  3073. for (b = 0; b < a.length; b++) {
  3074. var c = a[b].graphDataItem;
  3075. c.customBulletGraphics && c.customBulletGraphics.hide()
  3076. }
  3077. }, addListeners: function (a, b) {
  3078. var c = this;
  3079. a.mouseover(function (a) {
  3080. c.handleRollOver(b, a)
  3081. }).mouseout(function (a) {
  3082. c.handleRollOut(b, a)
  3083. }).touchend(function (a) {
  3084. c.handleRollOver(b,
  3085. a);
  3086. c.chart.panEventsEnabled && c.handleClick(b, a)
  3087. }).touchstart(function (a) {
  3088. c.handleRollOver(b, a)
  3089. }).click(function (a) {
  3090. c.handleClick(b, a)
  3091. }).dblclick(function (a) {
  3092. c.handleDoubleClick(b, a)
  3093. }).contextmenu(function (a) {
  3094. c.handleRightClick(b, a)
  3095. })
  3096. }, handleRollOver: function (a, b) {
  3097. this.handleGraphEvent(b, "rollOverGraph");
  3098. if (a) {
  3099. var c = this.chart, e = {
  3100. type: "rollOverGraphItem",
  3101. item: a,
  3102. index: a.index,
  3103. graph: this,
  3104. target: this,
  3105. chart: this.chart,
  3106. event: b
  3107. };
  3108. this.fire(e);
  3109. c.fire(e);
  3110. clearTimeout(c.hoverInt);
  3111. (c = c.chartCursor) && c.valueBalloonsEnabled ||
  3112. this.showGraphBalloon(a, "V", !0)
  3113. }
  3114. }, handleRollOut: function (a, b) {
  3115. if (a) {
  3116. var c = {
  3117. type: "rollOutGraphItem",
  3118. item: a,
  3119. index: a.index,
  3120. graph: this,
  3121. target: this,
  3122. chart: this.chart,
  3123. event: b
  3124. };
  3125. this.fire(c);
  3126. this.chart.fire(c)
  3127. }
  3128. this.handleGraphEvent(b, "rollOutGraph");
  3129. (c = this.chart.chartCursor) && c.valueBalloonsEnabled || this.hideBalloon()
  3130. }, handleClick: function (a, b) {
  3131. if (a) {
  3132. var c = {
  3133. type: "clickGraphItem",
  3134. item: a,
  3135. index: a.index,
  3136. graph: this,
  3137. target: this,
  3138. chart: this.chart,
  3139. event: b
  3140. };
  3141. this.fire(c);
  3142. this.chart.fire(c);
  3143. d.getURL(a.url, this.urlTarget)
  3144. }
  3145. this.handleGraphEvent(b,
  3146. "clickGraph")
  3147. }, handleGraphEvent: function (a, b) {
  3148. var c = {type: b, graph: this, target: this, chart: this.chart, event: a};
  3149. this.fire(c);
  3150. this.chart.fire(c)
  3151. }, handleRightClick: function (a, b) {
  3152. if (a) {
  3153. var c = {
  3154. type: "rightClickGraphItem",
  3155. item: a,
  3156. index: a.index,
  3157. graph: this,
  3158. target: this,
  3159. chart: this.chart,
  3160. event: b
  3161. };
  3162. this.fire(c);
  3163. this.chart.fire(c)
  3164. }
  3165. }, handleDoubleClick: function (a, b) {
  3166. if (a) {
  3167. var c = {
  3168. type: "doubleClickGraphItem",
  3169. item: a,
  3170. index: a.index,
  3171. graph: this,
  3172. target: this,
  3173. chart: this.chart,
  3174. event: b
  3175. };
  3176. this.fire(c);
  3177. this.chart.fire(c)
  3178. }
  3179. }, zoom: function (a,
  3180. b) {
  3181. this.start = a;
  3182. this.end = b;
  3183. this.draw()
  3184. }, changeOpacity: function (a) {
  3185. var b = this.set;
  3186. b && b.setAttr("opacity", a);
  3187. if (b = this.ownColumns) {
  3188. var c;
  3189. for (c = 0; c < b.length; c++) {
  3190. var e = b[c].set;
  3191. e && e.setAttr("opacity", a)
  3192. }
  3193. }
  3194. (b = this.bulletSet) && b.setAttr("opacity", a)
  3195. }, destroy: function () {
  3196. d.remove(this.set);
  3197. d.remove(this.bulletSet);
  3198. var a = this.timeOuts;
  3199. if (a) {
  3200. var b;
  3201. for (b = 0; b < a.length; b++) clearTimeout(a[b])
  3202. }
  3203. this.timeOuts = []
  3204. }, createBalloon: function () {
  3205. var a = this.chart;
  3206. this.balloon ? this.balloon.destroy && this.balloon.destroy() : this.balloon =
  3207. {};
  3208. var b = this.balloon;
  3209. d.extend(b, a.balloon, !0);
  3210. b.chart = a;
  3211. b.mainSet = a.plotBalloonsSet
  3212. }, hideBalloon: function () {
  3213. var a = this, b = a.chart;
  3214. b.chartCursor ? b.chartCursor.valueBalloonsEnabled || b.hideBalloon() : b.hideBalloon();
  3215. clearTimeout(a.hoverInt);
  3216. a.hoverInt = setTimeout(function () {
  3217. a.hideBalloonReal.call(a)
  3218. }, b.hideBalloonTime)
  3219. }, hideBalloonReal: function () {
  3220. this.balloon && this.balloon.hide();
  3221. this.fixBulletSize()
  3222. }, fixBulletSize: function () {
  3223. if (d.isModern) {
  3224. var a = this.resizedDItem;
  3225. if (a) {
  3226. var b = a.bulletGraphics;
  3227. b && !b.doNotScale &&
  3228. (b.translate(a.bx, a.by, 1), b.setAttr("fill-opacity", this.bulletAlpha), b.setAttr("stroke-opacity", this.bulletBorderAlpha))
  3229. }
  3230. this.resizedDItem = null
  3231. }
  3232. }, showGraphBalloon: function (a, b, c, e, h) {
  3233. var f = this.chart, g = this.balloon, k = 0, l = 0, m = f.chartCursor, n = !0;
  3234. m ? m.valueBalloonsEnabled || (g = f.balloon, k = this.x, l = this.y, n = !1) : (g = f.balloon, k = this.x, l = this.y, n = !1);
  3235. clearTimeout(this.hoverInt);
  3236. f.chartCursor && (this.currentDataItem = a);
  3237. this.resizeBullet(a, e, h);
  3238. if (g && g.enabled && this.showBalloon && !this.hidden) {
  3239. var m = f.formatString(this.balloonText,
  3240. a, !0), q = this.balloonFunction;
  3241. q && (m = q(a, a.graph));
  3242. m && (m = d.cleanFromEmpty(m));
  3243. m && "" !== m ? (e = f.getBalloonColor(this, a), g.drop || (g.pointerOrientation = b), b = a.x, h = a.y, f.rotate && (b = a.y, h = a.x), b += k, h += l, isNaN(b) || isNaN(h) ? this.hideBalloonReal() : (a = this.width, q = this.height, n && g.setBounds(k, l, a + k, q + l), g.changeColor(e), g.setPosition(b, h), g.fixPrevious(), g.fixedPosition && (c = !1), !c && "radar" != f.type && (b < k || b > a + k || h < l || h > q + l) ? (g.showBalloon(m), g.hide(0)) : (g.followCursor(c), g.showBalloon(m)))) : (this.hideBalloonReal(),
  3244. this.resizeBullet(a, e, h))
  3245. } else this.hideBalloonReal()
  3246. }, resizeBullet: function (a, b, c) {
  3247. this.fixBulletSize();
  3248. if (a && d.isModern && (1 != b || !isNaN(c))) {
  3249. var e = a.bulletGraphics;
  3250. e && !e.doNotScale && (e.translate(a.bx, a.by, b), isNaN(c) || (e.setAttr("fill-opacity", c), e.setAttr("stroke-opacity", c)), this.resizedDItem = a)
  3251. }
  3252. }
  3253. })
  3254. })();
  3255. (function () {
  3256. var d = window.AmCharts;
  3257. d.ChartCursor = d.Class({
  3258. construct: function (a) {
  3259. this.cname = "ChartCursor";
  3260. this.createEvents("changed", "zoomed", "onHideCursor", "onShowCursor", "draw", "selected", "moved", "panning", "zoomStarted");
  3261. this.enabled = !0;
  3262. this.cursorAlpha = 1;
  3263. this.selectionAlpha = .2;
  3264. this.cursorColor = "#ea4c89";
  3265. this.categoryBalloonAlpha = 1;
  3266. this.color = "#FFFFFF";
  3267. this.type = "cursor";
  3268. this.zoomed = !1;
  3269. this.zoomable = !0;
  3270. this.pan = !1;
  3271. this.categoryBalloonDateFormat = "MMM DD, YYYY";
  3272. this.categoryBalloonText = "[[category]]";
  3273. this.categoryBalloonEnabled = this.valueBalloonsEnabled = !0;
  3274. this.rolledOver = !1;
  3275. this.cursorPosition = "middle";
  3276. this.bulletsEnabled = this.skipZoomDispatch = !1;
  3277. this.bulletSize = 8;
  3278. this.selectWithoutZooming = this.oneBalloonOnly = !1;
  3279. this.graphBulletSize = 1.7;
  3280. this.animationDuration = .3;
  3281. this.zooming = !1;
  3282. this.adjustment = 0;
  3283. this.avoidBalloonOverlapping = !0;
  3284. this.leaveCursor = !1;
  3285. this.leaveAfterTouch = !0;
  3286. this.valueZoomable = !1;
  3287. this.balloonPointerOrientation = "horizontal";
  3288. this.hLineEnabled = this.vLineEnabled = !0;
  3289. this.vZoomEnabled =
  3290. this.hZoomEnabled = !1;
  3291. d.applyTheme(this, a, this.cname)
  3292. }, draw: function () {
  3293. this.destroy();
  3294. var a = this.chart;
  3295. a.panRequired = !0;
  3296. var b = a.container;
  3297. this.rotate = a.rotate;
  3298. this.container = b;
  3299. this.prevLineHeight = this.prevLineWidth = NaN;
  3300. b = b.set();
  3301. b.translate(this.x, this.y);
  3302. this.set = b;
  3303. a.cursorSet.push(b);
  3304. this.createElements();
  3305. d.isString(this.limitToGraph) && (this.limitToGraph = d.getObjById(a.graphs, this.limitToGraph), this.fullWidth = !1, this.cursorPosition = "middle");
  3306. this.pointer = this.balloonPointerOrientation.substr(0, 1).toUpperCase();
  3307. this.isHidden = !1;
  3308. this.hideLines();
  3309. this.valueLineAxis || (this.valueLineAxis = a.valueAxes[0])
  3310. }, createElements: function () {
  3311. var a = this.chart, b = a.dx, c = a.dy, e = this.width, h = this.height, f, g, k = this.cursorAlpha;
  3312. f = this.valueLineAlpha;
  3313. this.rotate ? g = k : (g = f, f = k);
  3314. "xy" == a.type && (f = g = k);
  3315. this.vvLine = d.line(this.container, [b, 0, 0], [c, 0, h], this.cursorColor, f, 1);
  3316. d.setCN(a, this.vvLine, "cursor-line");
  3317. d.setCN(a, this.vvLine, "cursor-line-vertical");
  3318. this.hhLine = d.line(this.container, [0, e, e + b], [0, 0, c], this.cursorColor, g, 1);
  3319. d.setCN(a,
  3320. this.hhLine, "cursor-line");
  3321. d.setCN(a, this.hhLine, "cursor-line-horizontal");
  3322. this.vLine = this.rotate ? this.vvLine : this.hhLine;
  3323. this.set.push(this.vvLine);
  3324. this.set.push(this.hhLine);
  3325. this.set.node.style.pointerEvents = "none";
  3326. this.fullLines = this.container.set();
  3327. a = a.cursorLineSet;
  3328. a.push(this.fullLines);
  3329. a.translate(this.x, this.y);
  3330. a.clipRect(0, 0, e, h);
  3331. this.set.clipRect(0, 0, e, h)
  3332. }, update: function () {
  3333. var a = this.chart, b = a.mouseX - this.x, c = a.mouseY - this.y;
  3334. this.mouseX = b;
  3335. this.mouseY = c;
  3336. this.mouse2X = a.mouse2X - this.x;
  3337. this.mouse2Y =
  3338. a.mouse2Y - this.y;
  3339. var e;
  3340. if (a.chartData && 0 < a.chartData.length) {
  3341. this.mouseIsOver() ? (this.hideGraphBalloons = !1, this.rolledOver = e = !0, this.updateDrawing(), this.vvLine && isNaN(this.fx) && (a.rotate || !this.limitToGraph) && this.vvLine.translate(b, 0), !this.hhLine || !isNaN(this.fy) || a.rotate && this.limitToGraph || this.hhLine.translate(0, c), isNaN(this.mouse2X) ? this.dispatchMovedEvent(b, c) : e = !1) : this.forceShow || this.hideCursor();
  3342. if (this.zooming) {
  3343. if (!isNaN(this.mouse2X)) {
  3344. isNaN(this.mouse2X0) || this.dispatchPanEvent();
  3345. return
  3346. }
  3347. if (this.pan) {
  3348. this.dispatchPanEvent();
  3349. return
  3350. }
  3351. (this.hZoomEnabled || this.vZoomEnabled) && this.zooming && this.updateSelection()
  3352. }
  3353. e && this.showCursor()
  3354. }
  3355. }, updateDrawing: function () {
  3356. this.drawing && this.chart.setMouseCursor("crosshair");
  3357. this.drawingNow && (d.remove(this.drawingLine), this.drawingLine = d.line(this.container, [this.drawStartX, this.mouseX], [this.drawStartY, this.mouseY], this.cursorColor, 1, 1))
  3358. }, fixWidth: function (a) {
  3359. if (this.fullWidth && this.prevLineWidth != a) {
  3360. var b = this.vvLine, c = 0;
  3361. b && (b.remove(), c = b.x);
  3362. b = this.container.set();
  3363. b.translate(c, 0);
  3364. c = d.rect(this.container, a, this.height, this.cursorColor, this.cursorAlpha, 0);
  3365. d.setCN(this.chart, c, "cursor-fill");
  3366. c.translate(-a / 2, 0);
  3367. b.push(c);
  3368. this.vvLine = b;
  3369. this.fullLines.push(b);
  3370. this.prevLineWidth = a
  3371. }
  3372. }, fixHeight: function (a) {
  3373. if (this.fullWidth && this.prevLineHeight != a) {
  3374. var b = this.hhLine, c = 0;
  3375. b && (b.remove(), c = b.y);
  3376. b = this.container.set();
  3377. b.translate(0, c);
  3378. c = d.rect(this.container, this.width, a, this.cursorColor, this.cursorAlpha);
  3379. c.translate(0, -a / 2);
  3380. b.push(c);
  3381. this.fullLines.push(b);
  3382. this.hhLine = b;
  3383. this.prevLineHeight = a
  3384. }
  3385. }, fixVLine: function (a, b) {
  3386. if (!isNaN(a)) {
  3387. if (isNaN(this.prevLineX)) {
  3388. var c = 0, e = this.mouseX;
  3389. if (this.limitToGraph) {
  3390. var d = this.chart.categoryAxis;
  3391. d && (this.chart.rotate || (c = "bottom" == d.position ? this.height : -this.height), e = a)
  3392. }
  3393. this.vvLine.translate(e, c)
  3394. } else this.prevLineX != a && this.vvLine.translate(this.prevLineX, this.prevLineY);
  3395. this.fx = a;
  3396. this.prevLineX != a && (c = this.animationDuration, this.zooming && (c = 0), this.vvLine.stop(), this.vvLine.animate({translate: a + "," + b}, c, "easeOutSine"),
  3397. this.prevLineX = a, this.prevLineY = b)
  3398. }
  3399. }, fixHLine: function (a, b) {
  3400. if (!isNaN(a)) {
  3401. if (isNaN(this.prevLineY)) {
  3402. var c = 0, e = this.mouseY;
  3403. if (this.limitToGraph) {
  3404. var d = this.chart.categoryAxis;
  3405. d && (this.chart.rotate && (c = "right" == d.position ? this.width : -this.width), e = a)
  3406. }
  3407. this.hhLine.translate(c, e)
  3408. } else this.prevLineY != a && this.hhLine.translate(this.prevLineX, this.prevLineY);
  3409. this.fy = a;
  3410. this.prevLineY != a && (c = this.animationDuration, this.zooming && (c = 0), this.hhLine.stop(), this.hhLine.animate({translate: b + "," + a}, c, "easeOutSine"),
  3411. this.prevLineY = a, this.prevLineX = b)
  3412. }
  3413. }, hideCursor: function (a) {
  3414. this.forceShow = !1;
  3415. this.chart.wasTouched && this.leaveAfterTouch || this.isHidden || this.leaveCursor || (this.hideLines(), this.isHidden = !0, this.index = this.prevLineY = this.prevLineX = this.mouseY0 = this.mouseX0 = this.fy = this.fx = NaN, a ? this.chart.handleCursorHide() : this.fire({
  3416. target: this,
  3417. chart: this.chart,
  3418. type: "onHideCursor"
  3419. }), this.chart.setMouseCursor("auto"))
  3420. }, hideLines: function () {
  3421. this.vvLine && this.vvLine.hide();
  3422. this.hhLine && this.hhLine.hide();
  3423. this.fullLines &&
  3424. this.fullLines.hide();
  3425. this.isHidden = !0;
  3426. this.chart.handleCursorHide()
  3427. }, showCursor: function (a) {
  3428. this.drawing || (this.vLineEnabled && this.vvLine && this.vvLine.show(), this.hLineEnabled && this.hhLine && this.hhLine.show(), this.isHidden = !1, this.updateFullLine(), a || this.fire({
  3429. target: this,
  3430. chart: this.chart,
  3431. type: "onShowCursor"
  3432. }), this.pan && this.chart.setMouseCursor("move"))
  3433. }, updateFullLine: function () {
  3434. this.zooming && this.fullWidth && this.selection && (this.rotate ? 0 < this.selection.height && this.hhLine.hide() : 0 < this.selection.width &&
  3435. this.vvLine.hide())
  3436. }, updateSelection: function () {
  3437. if (!this.pan) {
  3438. var a = this.mouseX, b = this.mouseY;
  3439. isNaN(this.fx) || (a = this.fx);
  3440. isNaN(this.fy) || (b = this.fy);
  3441. this.clearSelection();
  3442. var c = this.mouseX0, e = this.mouseY0, h = this.width, f = this.height, a = d.fitToBounds(a, 0, h),
  3443. b = d.fitToBounds(b, 0, f), g;
  3444. a < c && (g = a, a = c, c = g);
  3445. b < e && (g = b, b = e, e = g);
  3446. this.hZoomEnabled ? h = a - c : c = 0;
  3447. this.vZoomEnabled ? f = b - e : e = 0;
  3448. isNaN(this.mouse2X) && 0 < Math.abs(h) && 0 < Math.abs(f) && (a = this.chart, b = d.rect(this.container, h, f, this.cursorColor, this.selectionAlpha),
  3449. d.setCN(a, b, "cursor-selection"), b.width = h, b.height = f, b.translate(c, e), this.set.push(b), this.selection = b);
  3450. this.updateFullLine()
  3451. }
  3452. }, mouseIsOver: function () {
  3453. var a = this.mouseX, b = this.mouseY;
  3454. if (this.justReleased) return this.justReleased = !1, !0;
  3455. if (this.mouseIsDown) return !0;
  3456. if (!this.chart.mouseIsOver) return this.handleMouseOut(), !1;
  3457. if (0 < a && a < this.width && 0 < b && b < this.height) return !0;
  3458. this.handleMouseOut()
  3459. }, fixPosition: function () {
  3460. this.prevY = this.prevX = NaN
  3461. }, handleMouseDown: function () {
  3462. this.update();
  3463. if (this.mouseIsOver()) if (this.mouseIsDown =
  3464. !0, this.mouseX0 = this.mouseX, this.mouseY0 = this.mouseY, this.mouse2X0 = this.mouse2X, this.mouse2Y0 = this.mouse2Y, this.drawing) this.drawStartY = this.mouseY, this.drawStartX = this.mouseX, this.drawingNow = !0; else if (this.dispatchMovedEvent(this.mouseX, this.mouseY), !this.pan && isNaN(this.mouse2X0) && (isNaN(this.fx) || (this.mouseX0 = this.fx), isNaN(this.fy) || (this.mouseY0 = this.fy)), this.hZoomEnabled || this.vZoomEnabled) {
  3465. this.zooming = !0;
  3466. var a = {chart: this.chart, target: this, type: "zoomStarted"};
  3467. a.x = this.mouseX / this.width;
  3468. a.y = this.mouseY / this.height;
  3469. this.index0 = a.index = this.index;
  3470. this.timestamp0 = this.timestamp;
  3471. this.fire(a)
  3472. }
  3473. }, registerInitialMouse: function () {
  3474. }, handleReleaseOutside: function () {
  3475. this.mouseIsDown = !1;
  3476. if (this.drawingNow) {
  3477. this.drawingNow = !1;
  3478. d.remove(this.drawingLine);
  3479. var a = this.drawStartX, b = this.drawStartY, c = this.mouseX, e = this.mouseY, h = this.chart;
  3480. (2 < Math.abs(a - c) || 2 < Math.abs(b - e)) && this.fire({
  3481. type: "draw",
  3482. target: this,
  3483. chart: h,
  3484. initialX: a,
  3485. initialY: b,
  3486. finalX: c,
  3487. finalY: e
  3488. })
  3489. }
  3490. this.zooming && (this.zooming = !1, this.selectWithoutZooming ?
  3491. this.dispatchZoomEvent("selected") : (this.hZoomEnabled || this.vZoomEnabled) && this.dispatchZoomEvent("zoomed"), this.rolledOver && this.dispatchMovedEvent(this.mouseX, this.mouseY));
  3492. this.mouse2Y0 = this.mouse2X0 = this.mouseY0 = this.mouseX0 = NaN
  3493. }, dispatchZoomEvent: function (a) {
  3494. if (!this.pan) {
  3495. var b = this.selection;
  3496. if (b && 3 < Math.abs(b.width) && 3 < Math.abs(b.height)) {
  3497. var c = Math.min(this.index, this.index0), e = Math.max(this.index, this.index0), d = c, f = e,
  3498. g = this.chart, k = g.chartData, l = g.categoryAxis;
  3499. l && l.parseDates && !l.equalSpacing &&
  3500. (d = k[c] ? k[c].time : Math.min(this.timestamp0, this.timestamp), f = k[e] ? g.getEndTime(k[e].time) : Math.max(this.timestamp0, this.timestamp));
  3501. var b = {
  3502. type: a,
  3503. chart: this.chart,
  3504. target: this,
  3505. end: f,
  3506. start: d,
  3507. startIndex: c,
  3508. endIndex: e,
  3509. selectionHeight: b.height,
  3510. selectionWidth: b.width,
  3511. selectionY: b.y,
  3512. selectionX: b.x
  3513. }, m;
  3514. this.hZoomEnabled && 4 < Math.abs(this.mouseX0 - this.mouseX) && (b.startX = this.mouseX0 / this.width, b.endX = this.mouseX / this.width, m = !0);
  3515. this.vZoomEnabled && 4 < Math.abs(this.mouseY0 - this.mouseY) && (b.startY = 1 - this.mouseY0 /
  3516. this.height, b.endY = 1 - this.mouseY / this.height, m = !0);
  3517. m && (this.prevY = this.prevX = NaN, this.fire(b), "selected" != a && this.clearSelection());
  3518. this.hideCursor()
  3519. }
  3520. }
  3521. }, dispatchMovedEvent: function (a, b, c, e) {
  3522. a = Math.round(a);
  3523. b = Math.round(b);
  3524. if (!this.isHidden && (a != this.prevX || b != this.prevY || "changed" == c)) {
  3525. c || (c = "moved");
  3526. var d = this.fx, f = this.fy;
  3527. isNaN(d) && (d = a);
  3528. isNaN(f) && (f = b);
  3529. var g = !1;
  3530. this.zooming && this.pan && (g = !0);
  3531. g = {
  3532. hidden: this.isHidden,
  3533. type: c,
  3534. chart: this.chart,
  3535. target: this,
  3536. x: a,
  3537. y: b,
  3538. finalX: d,
  3539. finalY: f,
  3540. zooming: this.zooming,
  3541. panning: g,
  3542. mostCloseGraph: this.mostCloseGraph,
  3543. index: this.index,
  3544. skip: e,
  3545. hideBalloons: this.hideGraphBalloons
  3546. };
  3547. this.rotate ? (g.position = b, g.finalPosition = f) : (g.position = a, g.finalPosition = d);
  3548. this.prevX = a;
  3549. this.prevY = b;
  3550. e ? this.chart.handleCursorMove(g) : (this.fire(g), "changed" == c && this.chart.fire(g))
  3551. }
  3552. }, dispatchPanEvent: function () {
  3553. if (this.mouseIsDown) {
  3554. var a = d.roundTo((this.mouseX - this.mouseX0) / this.width, 3),
  3555. b = d.roundTo((this.mouseY - this.mouseY0) / this.height, 3),
  3556. c = d.roundTo((this.mouse2X - this.mouse2X0) / this.width,
  3557. 3), e = d.roundTo((this.mouse2Y - this.mouse2Y0) / this.height, 2), h = !1;
  3558. 0 !== Math.abs(a) && 0 !== Math.abs(b) && (h = !0);
  3559. if (this.prevDeltaX == a || this.prevDeltaY == b) h = !1;
  3560. isNaN(c) || isNaN(e) || (0 !== Math.abs(c) && 0 !== Math.abs(e) && (h = !0), this.prevDelta2X != c && this.prevDelta2Y != e) || (h = !1);
  3561. h && (this.hideLines(), this.fire({
  3562. type: "panning",
  3563. chart: this.chart,
  3564. target: this,
  3565. deltaX: a,
  3566. deltaY: b,
  3567. delta2X: c,
  3568. delta2Y: e,
  3569. index: this.index
  3570. }), this.prevDeltaX = a, this.prevDeltaY = b, this.prevDelta2X = c, this.prevDelta2Y = e)
  3571. }
  3572. }, clearSelection: function () {
  3573. var a =
  3574. this.selection;
  3575. a && (a.width = 0, a.height = 0, a.remove())
  3576. }, destroy: function () {
  3577. this.clear();
  3578. d.remove(this.selection);
  3579. this.selection = null;
  3580. clearTimeout(this.syncTO);
  3581. d.remove(this.set)
  3582. }, clear: function () {
  3583. }, setTimestamp: function (a) {
  3584. this.timestamp = a
  3585. }, setIndex: function (a, b) {
  3586. a != this.index && (this.index = a, b || this.isHidden || this.dispatchMovedEvent(this.mouseX, this.mouseY, "changed"))
  3587. }, handleMouseOut: function () {
  3588. this.enabled && this.rolledOver && (this.leaveCursor || this.setIndex(void 0), this.forceShow = !1, this.hideCursor(),
  3589. this.rolledOver = !1)
  3590. }, showCursorAt: function (a) {
  3591. var b = this.chart.categoryAxis;
  3592. b && this.setPosition(b.categoryToCoordinate(a))
  3593. }, setPosition: function (a) {
  3594. var b = this.chart, c = b.categoryAxis;
  3595. if (c) {
  3596. var e, d, f = c.coordinateToValue(a);
  3597. c.showBalloonAt(f);
  3598. this.forceShow = !0;
  3599. c.stickBalloonToCategory ? b.rotate ? this.fixHLine(a, 0) : this.fixVLine(a, 0) : (this.showCursor(), b.rotate ? this.hhLine.translate(0, a) : this.vvLine.translate(a, 0));
  3600. b.rotate ? e = a : d = a;
  3601. this.dispatchMovedEvent(d, e);
  3602. b.rotate ? (this.vvLine && this.vvLine.hide(),
  3603. this.hhLine && this.hhLine.show()) : (this.hhLine && this.hhLine.hide(), this.vvLine && this.vvLine.show());
  3604. this.updateFullLine();
  3605. this.isHidden = !1;
  3606. this.dispatchMovedEvent(d, e, "moved", !0)
  3607. }
  3608. }, enableDrawing: function (a) {
  3609. this.enabled = !a;
  3610. this.hideCursor();
  3611. this.drawing = a
  3612. }, syncWithCursor: function (a, b) {
  3613. clearTimeout(this.syncTO);
  3614. a && (a.isHidden ? this.hideCursor(!0) : this.syncWithCursorReal(a, b))
  3615. }, isZooming: function (a) {
  3616. this.zooming = a
  3617. }, syncWithCursorReal: function (a, b) {
  3618. var c = a.vvLine, e = a.hhLine;
  3619. this.index = a.index;
  3620. this.forceShow =
  3621. !0;
  3622. this.zooming && this.pan || this.showCursor(!0);
  3623. this.hideGraphBalloons = b;
  3624. this.justReleased = a.justReleased;
  3625. this.zooming = a.zooming;
  3626. this.index0 = a.index0;
  3627. this.mouseX0 = a.mouseX0;
  3628. this.mouseY0 = a.mouseY0;
  3629. this.mouse2X0 = a.mouse2X0;
  3630. this.mouse2Y0 = a.mouse2Y0;
  3631. this.timestamp0 = a.timestamp0;
  3632. this.prevDeltaX = a.prevDeltaX;
  3633. this.prevDeltaY = a.prevDeltaY;
  3634. this.prevDelta2X = a.prevDelta2X;
  3635. this.prevDelta2Y = a.prevDelta2Y;
  3636. this.fx = a.fx;
  3637. this.fy = a.fy;
  3638. this.index = a.index;
  3639. a.zooming && this.updateSelection();
  3640. var d = a.mouseX, f = a.mouseY;
  3641. this.rotate ?
  3642. (d = NaN, this.vvLine && this.vvLine.hide(), this.hhLine && e && (isNaN(a.fy) ? this.hhLine.translate(0, a.mouseY) : this.fixHLine(a.fy, 0))) : (f = NaN, this.hhLine && this.hhLine.hide(), this.vvLine && c && (isNaN(a.fx) ? this.vvLine.translate(a.mouseX, 0) : this.fixVLine(a.fx, 0)));
  3643. this.dispatchMovedEvent(d, f, "moved", !0)
  3644. }
  3645. })
  3646. })();
  3647. (function () {
  3648. var d = window.AmCharts;
  3649. d.SimpleChartScrollbar = d.Class({
  3650. construct: function (a) {
  3651. this.createEvents("zoomed", "zoomStarted", "zoomEnded");
  3652. this.backgroundColor = "#D4D4D4";
  3653. this.backgroundAlpha = 1;
  3654. this.selectedBackgroundColor = "#EFEFEF";
  3655. this.scrollDuration = this.selectedBackgroundAlpha = 1;
  3656. this.resizeEnabled = !0;
  3657. this.hideResizeGrips = !1;
  3658. this.scrollbarHeight = 20;
  3659. this.updateOnReleaseOnly = !1;
  3660. 9 > document.documentMode && (this.updateOnReleaseOnly = !0);
  3661. this.dragIconHeight = this.dragIconWidth = 35;
  3662. this.dragIcon = "dragIconRoundBig";
  3663. this.enabled = !0;
  3664. this.percentStart = this.offset = 0;
  3665. this.percentEnd = 1;
  3666. d.applyTheme(this, a, "SimpleChartScrollbar")
  3667. }, draw: function () {
  3668. var a = this;
  3669. a.destroy();
  3670. if (a.enabled) {
  3671. var b = a.chart.container, c = a.rotate, e = a.chart;
  3672. e.panRequired = !0;
  3673. var h = b.set();
  3674. a.set = h;
  3675. e.scrollbarsSet.push(h);
  3676. var f, g;
  3677. c ? (f = a.scrollbarHeight, g = e.plotAreaHeight) : (g = a.scrollbarHeight, f = e.plotAreaWidth);
  3678. a.width = f;
  3679. if ((a.height = g) && f) {
  3680. var k = d.rect(b, f, g, a.backgroundColor, a.backgroundAlpha, 1, a.backgroundColor, a.backgroundAlpha);
  3681. d.setCN(e, k, "scrollbar-bg");
  3682. a.bg = k;
  3683. h.push(k);
  3684. k = d.rect(b, f, g, "#000", .005);
  3685. h.push(k);
  3686. a.invisibleBg = k;
  3687. k.click(function () {
  3688. a.handleBgClick()
  3689. }).mouseover(function () {
  3690. a.handleMouseOver()
  3691. }).mouseout(function () {
  3692. a.handleMouseOut()
  3693. }).touchend(function () {
  3694. a.handleBgClick()
  3695. });
  3696. k = d.rect(b, f, g, a.selectedBackgroundColor, a.selectedBackgroundAlpha);
  3697. d.setCN(e, k, "scrollbar-bg-selected");
  3698. a.selectedBG = k;
  3699. h.push(k);
  3700. f = d.rect(b, f, g, "#000", .005);
  3701. a.dragger = f;
  3702. h.push(f);
  3703. f.mousedown(function (b) {
  3704. a.handleDragStart(b)
  3705. }).mouseup(function () {
  3706. a.handleDragStop()
  3707. }).mouseover(function () {
  3708. a.handleDraggerOver()
  3709. }).mouseout(function () {
  3710. a.handleMouseOut()
  3711. }).touchstart(function (b) {
  3712. a.handleDragStart(b)
  3713. }).touchend(function () {
  3714. a.handleDragStop()
  3715. });
  3716. f = e.pathToImages;
  3717. g = a.dragIcon.replace(/\.[a-z]*$/i, "");
  3718. c ? (k = f + g + "H" + e.extension, f = a.dragIconWidth, c = a.dragIconHeight) : (k = f + g + e.extension, c = a.dragIconWidth, f = a.dragIconHeight);
  3719. g = b.image(k, 0, 0, c, f);
  3720. d.setCN(e, g, "scrollbar-grip-left");
  3721. k = b.image(k, 0, 0, c, f);
  3722. d.setCN(e, k, "scrollbar-grip-right");
  3723. var l = 10, m = 20;
  3724. e.panEventsEnabled && (l = 25, m = a.scrollbarHeight);
  3725. var n = d.rect(b, l, m, "#000", .005), q = d.rect(b, l, m, "#000", .005);
  3726. q.translate(-(l - c) / 2, -(m - f) / 2);
  3727. n.translate(-(l - c) / 2, -(m - f) / 2);
  3728. c = b.set([g, q]);
  3729. b = b.set([k, n]);
  3730. a.iconLeft = c;
  3731. h.push(a.iconLeft);
  3732. a.iconRight = b;
  3733. h.push(b);
  3734. c.mousedown(function () {
  3735. a.leftDragStart()
  3736. }).mouseup(function () {
  3737. a.leftDragStop()
  3738. }).mouseover(function () {
  3739. a.iconRollOver()
  3740. }).mouseout(function () {
  3741. a.iconRollOut()
  3742. }).touchstart(function () {
  3743. a.leftDragStart()
  3744. }).touchend(function () {
  3745. a.leftDragStop()
  3746. });
  3747. b.mousedown(function () {
  3748. a.rightDragStart()
  3749. }).mouseup(function () {
  3750. a.rightDragStop()
  3751. }).mouseover(function () {
  3752. a.iconRollOver()
  3753. }).mouseout(function () {
  3754. a.iconRollOut()
  3755. }).touchstart(function () {
  3756. a.rightDragStart()
  3757. }).touchend(function () {
  3758. a.rightDragStop()
  3759. });
  3760. d.ifArray(e.chartData) ? h.show() : h.hide();
  3761. a.hideDragIcons();
  3762. a.clipDragger(!1)
  3763. }
  3764. h.translate(a.x, a.y);
  3765. h.node.style.msTouchAction = "none";
  3766. h.node.style.touchAction = "none"
  3767. }
  3768. }, updateScrollbarSize: function (a, b) {
  3769. if (!isNaN(a) && !isNaN(b)) {
  3770. a = Math.round(a);
  3771. b = Math.round(b);
  3772. var c = this.dragger, e, d, f, g, k;
  3773. this.rotate ? (e = 0, d = a, f = this.width + 1, g = b - a, c.setAttr("height", b - a), c.setAttr("y", d)) : (e = a, d = 0, f = b - a, g = this.height + 1, k = b - a, c.setAttr("x", e), c.setAttr("width", k));
  3774. this.clipAndUpdate(e, d, f, g)
  3775. }
  3776. }, update: function () {
  3777. var a, b =
  3778. !1, c, e, d = this.x, f = this.y, g = this.dragger, k = this.getDBox();
  3779. if (k) {
  3780. c = k.x + d;
  3781. e = k.y + f;
  3782. var l = k.width, k = k.height, m = this.rotate, n = this.chart, q = this.width, p = this.height,
  3783. t = n.mouseX, r = n.mouseY;
  3784. a = this.initialMouse;
  3785. this.forceClip && this.clipDragger(!0);
  3786. n.mouseIsOver && (this.dragging && (n = this.initialCoord, m ? (a = n + (r - a), 0 > a && (a = 0), n = p - k, a > n && (a = n), g.setAttr("y", a)) : (a = n + (t - a), 0 > a && (a = 0), n = q - l, a > n && (a = n), g.setAttr("x", a)), this.clipDragger(!0)), this.resizingRight && (m ? (a = r - e, a + e > p + f && (a = p - e + f), 0 > a ? (this.resizingRight = !1,
  3787. b = this.resizingLeft = !0) : (0 === a && (a = .1), g.setAttr("height", a))) : (a = t - c, a + c > q + d && (a = q - c + d), 0 > a ? (this.resizingRight = !1, b = this.resizingLeft = !0) : (0 === a && (a = .1), g.setAttr("width", a))), this.clipDragger(!0)), this.resizingLeft && (m ? (c = e, e = r, e < f && (e = f), e > p + f && (e = p + f), a = !0 === b ? c - e : k + c - e, 0 > a ? (this.resizingRight = !0, this.resizingLeft = !1, g.setAttr("y", c + k - f)) : (0 === a && (a = .1), g.setAttr("y", e - f), g.setAttr("height", a))) : (e = t, e < d && (e = d), e > q + d && (e = q + d), a = !0 === b ? c - e : l + c - e, 0 > a ? (this.resizingRight = !0, this.resizingLeft = !1,
  3788. g.setAttr("x", c + l - d)) : (0 === a && (a = .1), g.setAttr("x", e - d), g.setAttr("width", a))), this.clipDragger(!0)))
  3789. }
  3790. }, stopForceClip: function () {
  3791. this.animating = this.forceClip = !1
  3792. }, clipDragger: function (a) {
  3793. var b = this.getDBox();
  3794. if (b) {
  3795. var c = b.x, d = b.y, h = b.width, b = b.height, f = !1;
  3796. if (this.rotate) {
  3797. if (c = 0, h = this.width + 1, this.clipY != d || this.clipH != b) f = !0
  3798. } else if (d = 0, b = this.height + 1, this.clipX != c || this.clipW != h) f = !0;
  3799. f && (this.clipAndUpdate(c, d, h, b), a && (this.updateOnReleaseOnly || this.dispatchScrollbarEvent()))
  3800. }
  3801. }, maskGraphs: function () {
  3802. },
  3803. clipAndUpdate: function (a, b, c, d) {
  3804. this.clipX = a;
  3805. this.clipY = b;
  3806. this.clipW = c;
  3807. this.clipH = d;
  3808. this.selectedBG.setAttr("width", c);
  3809. this.selectedBG.setAttr("height", d);
  3810. this.selectedBG.translate(a, b);
  3811. this.updateDragIconPositions();
  3812. this.maskGraphs(a, b, c, d)
  3813. }, dispatchScrollbarEvent: function () {
  3814. if (this.skipEvent) this.skipEvent = !1; else {
  3815. var a = this.chart;
  3816. a.hideBalloon();
  3817. var b = this.getDBox(), c = b.x, d = b.y, h = b.width, f = b.height, g, k;
  3818. this.rotate ? (b = d, g = this.height / f, k = 1 - d / this.height, c = 1 - (d + f) / this.height) : (b = c, g = this.width /
  3819. h, k = c / this.width, c = (c + h) / this.width);
  3820. this.fire({
  3821. type: "zoomed",
  3822. position: b,
  3823. chart: a,
  3824. target: this,
  3825. multiplier: g,
  3826. relativeStart: c,
  3827. relativeEnd: k
  3828. })
  3829. }
  3830. }, updateDragIconPositions: function () {
  3831. var a = this.getDBox(), b = a.x, c = a.y, d = this.iconLeft, h = this.iconRight, f, g,
  3832. k = this.scrollbarHeight;
  3833. this.rotate ? (f = this.dragIconWidth, g = this.dragIconHeight, d.translate((k - g) / 2, c - f / 2), h.translate((k - g) / 2, c + a.height - f / 2)) : (f = this.dragIconHeight, g = this.dragIconWidth, d.translate(b - g / 2, (k - f) / 2), h.translate(b - g / 2 + a.width, (k - f) / 2))
  3834. }, showDragIcons: function () {
  3835. this.resizeEnabled &&
  3836. (this.iconLeft.show(), this.iconRight.show())
  3837. }, hideDragIcons: function () {
  3838. if (!this.resizingLeft && !this.resizingRight && !this.dragging) {
  3839. if (this.hideResizeGrips || !this.resizeEnabled) this.iconLeft.hide(), this.iconRight.hide();
  3840. this.removeCursors()
  3841. }
  3842. }, removeCursors: function () {
  3843. this.chart.setMouseCursor("auto")
  3844. }, fireZoomEvent: function (a) {
  3845. this.fire({type: a, chart: this.chart, target: this})
  3846. }, percentZoom: function (a, b) {
  3847. if (this.dragger && this.enabled) {
  3848. this.dragger.stop();
  3849. isNaN(a) && (a = 0);
  3850. isNaN(b) && (b = 1);
  3851. var c, d, h;
  3852. this.rotate ?
  3853. (c = this.height, d = c - c * b, h = c - c * a) : (c = this.width, h = c * b, d = c * a);
  3854. this.updateScrollbarSize(d, h);
  3855. this.clipDragger(!1);
  3856. this.percentStart = a;
  3857. this.percentEnd = b
  3858. }
  3859. }, destroy: function () {
  3860. this.clear();
  3861. d.remove(this.set);
  3862. d.remove(this.iconRight);
  3863. d.remove(this.iconLeft)
  3864. }, clear: function () {
  3865. }, handleDragStart: function () {
  3866. if (this.enabled) {
  3867. this.fireZoomEvent("zoomStarted");
  3868. var a = this.chart;
  3869. this.dragger.stop();
  3870. this.removeCursors();
  3871. this.dragging = !0;
  3872. var b = this.getDBox();
  3873. this.rotate ? (this.initialCoord = b.y, this.initialMouse = a.mouseY) :
  3874. (this.initialCoord = b.x, this.initialMouse = a.mouseX)
  3875. }
  3876. }, handleDragStop: function () {
  3877. this.updateOnReleaseOnly && (this.update(), this.skipEvent = !1, this.dispatchScrollbarEvent());
  3878. this.dragging = !1;
  3879. this.mouseIsOver && this.removeCursors();
  3880. this.update();
  3881. this.fireZoomEvent("zoomEnded")
  3882. }, handleDraggerOver: function () {
  3883. this.handleMouseOver()
  3884. }, leftDragStart: function () {
  3885. this.fireZoomEvent("zoomStarted");
  3886. this.dragger.stop();
  3887. this.resizingLeft = !0
  3888. }, leftDragStop: function () {
  3889. this.resizingLeft = !1;
  3890. this.mouseIsOver || this.removeCursors();
  3891. this.updateOnRelease();
  3892. this.fireZoomEvent("zoomEnded")
  3893. }, rightDragStart: function () {
  3894. this.fireZoomEvent("zoomStarted");
  3895. this.dragger.stop();
  3896. this.resizingRight = !0
  3897. }, rightDragStop: function () {
  3898. this.resizingRight = !1;
  3899. this.mouseIsOver || this.removeCursors();
  3900. this.updateOnRelease();
  3901. this.fireZoomEvent("zoomEnded")
  3902. }, iconRollOut: function () {
  3903. this.removeCursors()
  3904. }, iconRollOver: function () {
  3905. this.rotate ? this.chart.setMouseCursor("ns-resize") : this.chart.setMouseCursor("ew-resize");
  3906. this.handleMouseOver()
  3907. }, getDBox: function () {
  3908. if (this.dragger) return this.dragger.getBBox()
  3909. },
  3910. handleBgClick: function () {
  3911. var a = this;
  3912. if (!a.resizingRight && !a.resizingLeft) {
  3913. a.zooming = !0;
  3914. var b, c, e = a.scrollDuration, h = a.dragger;
  3915. b = a.getDBox();
  3916. var f = b.height, g = b.width;
  3917. c = a.chart;
  3918. var k = a.y, l = a.x, m = a.rotate;
  3919. m ? (b = "y", c = c.mouseY - f / 2 - k, c = d.fitToBounds(c, 0, a.height - f)) : (b = "x", c = c.mouseX - g / 2 - l, c = d.fitToBounds(c, 0, a.width - g));
  3920. a.updateOnReleaseOnly ? (a.skipEvent = !1, h.setAttr(b, c), a.dispatchScrollbarEvent(), a.clipDragger()) : (a.animating = !0, c = Math.round(c), m ? h.animate({y: c}, e, ">") : h.animate({x: c}, e, ">"), a.forceClip =
  3921. !0, clearTimeout(a.forceTO), a.forceTO = setTimeout(function () {
  3922. a.stopForceClip.call(a)
  3923. }, 5E3 * e))
  3924. }
  3925. }, updateOnRelease: function () {
  3926. this.updateOnReleaseOnly && (this.update(), this.skipEvent = !1, this.dispatchScrollbarEvent())
  3927. }, handleReleaseOutside: function () {
  3928. if (this.set) {
  3929. if (this.resizingLeft || this.resizingRight || this.dragging) this.updateOnRelease(), this.removeCursors();
  3930. this.animating = this.mouseIsOver = this.dragging = this.resizingRight = this.resizingLeft = !1;
  3931. this.hideDragIcons();
  3932. this.update()
  3933. }
  3934. }, handleMouseOver: function () {
  3935. this.mouseIsOver =
  3936. !0;
  3937. this.showDragIcons()
  3938. }, handleMouseOut: function () {
  3939. this.mouseIsOver = !1;
  3940. this.hideDragIcons()
  3941. }
  3942. })
  3943. })();
  3944. (function () {
  3945. var d = window.AmCharts;
  3946. d.ChartScrollbar = d.Class({
  3947. inherits: d.SimpleChartScrollbar, construct: function (a) {
  3948. this.cname = "ChartScrollbar";
  3949. d.ChartScrollbar.base.construct.call(this, a);
  3950. this.graphLineColor = "#BBBBBB";
  3951. this.graphLineAlpha = 0;
  3952. this.graphFillColor = "#BBBBBB";
  3953. this.graphFillAlpha = 1;
  3954. this.selectedGraphLineColor = "#888888";
  3955. this.selectedGraphLineAlpha = 0;
  3956. this.selectedGraphFillColor = "#888888";
  3957. this.selectedGraphFillAlpha = 1;
  3958. this.gridCount = 0;
  3959. this.gridColor = "#FFFFFF";
  3960. this.gridAlpha = .7;
  3961. this.skipEvent =
  3962. this.autoGridCount = !1;
  3963. this.color = "#FFFFFF";
  3964. this.scrollbarCreated = !1;
  3965. this.oppositeAxis = !0;
  3966. d.applyTheme(this, a, this.cname)
  3967. }, init: function () {
  3968. var a = this.categoryAxis, b = this.chart, c = this.gridAxis;
  3969. a || ("CategoryAxis" == this.gridAxis.cname ? (this.catScrollbar = !0, a = new d.CategoryAxis, a.id = "scrollbar") : (a = new d.ValueAxis, a.data = b.chartData, a.id = c.id, a.type = c.type, a.maximumDate = c.maximumDate, a.minimumDate = c.minimumDate, a.minPeriod = c.minPeriod), this.categoryAxis = a);
  3970. a.chart = b;
  3971. a.dateFormats = c.dateFormats;
  3972. a.markPeriodChange =
  3973. c.markPeriodChange;
  3974. a.boldPeriodBeginning = c.boldPeriodBeginning;
  3975. a.labelFunction = c.labelFunction;
  3976. a.axisItemRenderer = d.RecItem;
  3977. a.axisRenderer = d.RecAxis;
  3978. a.guideFillRenderer = d.RecFill;
  3979. a.inside = !0;
  3980. a.fontSize = this.fontSize;
  3981. a.tickLength = 0;
  3982. a.axisAlpha = 0;
  3983. d.isString(this.graph) && (this.graph = d.getObjById(b.graphs, this.graph));
  3984. (a = this.graph) && this.catScrollbar && (c = this.valueAxis, c || (this.valueAxis = c = new d.ValueAxis, c.visible = !1, c.scrollbar = !0, c.axisItemRenderer = d.RecItem, c.axisRenderer = d.RecAxis, c.guideFillRenderer =
  3985. d.RecFill, c.labelsEnabled = !1, c.chart = b), b = this.unselectedGraph, b || (b = new d.AmGraph, b.scrollbar = !0, this.unselectedGraph = b, b.negativeBase = a.negativeBase, b.noStepRisers = a.noStepRisers), b = this.selectedGraph, b || (b = new d.AmGraph, b.scrollbar = !0, this.selectedGraph = b, b.negativeBase = a.negativeBase, b.noStepRisers = a.noStepRisers));
  3986. this.scrollbarCreated = !0
  3987. }, draw: function () {
  3988. var a = this;
  3989. d.ChartScrollbar.base.draw.call(a);
  3990. if (a.enabled) {
  3991. a.scrollbarCreated || a.init();
  3992. var b = a.chart, c = b.chartData, e = a.categoryAxis, h = a.rotate,
  3993. f = a.x, g = a.y, k = a.width, l = a.height, m = a.gridAxis, n = a.set;
  3994. e.setOrientation(!h);
  3995. e.parseDates = m.parseDates;
  3996. "ValueAxis" == a.categoryAxis.cname && (e.rotate = !h);
  3997. e.equalSpacing = m.equalSpacing;
  3998. e.minPeriod = m.minPeriod;
  3999. e.startOnAxis = m.startOnAxis;
  4000. e.width = k - 1;
  4001. e.height = l;
  4002. e.gridCount = a.gridCount;
  4003. e.gridColor = a.gridColor;
  4004. e.gridAlpha = a.gridAlpha;
  4005. e.color = a.color;
  4006. e.tickLength = 0;
  4007. e.axisAlpha = 0;
  4008. e.autoGridCount = a.autoGridCount;
  4009. e.parseDates && !e.equalSpacing && e.timeZoom(b.firstTime, b.lastTime);
  4010. e.minimum = a.gridAxis.fullMin;
  4011. e.maximum =
  4012. a.gridAxis.fullMax;
  4013. e.strictMinMax = !0;
  4014. e.zoom(0, c.length - 1);
  4015. if ((m = a.graph) && a.catScrollbar) {
  4016. var q = a.valueAxis, p = m.valueAxis;
  4017. q.id = p.id;
  4018. q.rotate = h;
  4019. q.setOrientation(h);
  4020. q.width = k;
  4021. q.height = l;
  4022. q.dataProvider = c;
  4023. q.reversed = p.reversed;
  4024. q.logarithmic = p.logarithmic;
  4025. q.gridAlpha = 0;
  4026. q.axisAlpha = 0;
  4027. n.push(q.set);
  4028. h ? (q.y = g, q.x = 0) : (q.x = f, q.y = 0);
  4029. var f = Infinity, g = -Infinity, t;
  4030. for (t = 0; t < c.length; t++) {
  4031. var r = c[t].axes[p.id].graphs[m.id].values, u;
  4032. for (u in r) if (r.hasOwnProperty(u) && "percents" != u && "total" != u) {
  4033. var y = r[u];
  4034. y < f && (f =
  4035. y);
  4036. y > g && (g = y)
  4037. }
  4038. }
  4039. Infinity != f && (q.minimum = f);
  4040. -Infinity != g && (q.maximum = g + .1 * (g - f));
  4041. f == g && (--q.minimum, q.maximum += 1);
  4042. void 0 !== a.minimum && (q.minimum = a.minimum);
  4043. void 0 !== a.maximum && (q.maximum = a.maximum);
  4044. q.zoom(0, c.length - 1);
  4045. u = a.unselectedGraph;
  4046. u.id = m.id;
  4047. u.bcn = "scrollbar-graph-";
  4048. u.rotate = h;
  4049. u.chart = b;
  4050. u.data = c;
  4051. u.valueAxis = q;
  4052. u.chart = m.chart;
  4053. u.categoryAxis = a.categoryAxis;
  4054. u.periodSpan = m.periodSpan;
  4055. u.valueField = m.valueField;
  4056. u.openField = m.openField;
  4057. u.closeField = m.closeField;
  4058. u.highField = m.highField;
  4059. u.lowField = m.lowField;
  4060. u.lineAlpha = a.graphLineAlpha;
  4061. u.lineColorR = a.graphLineColor;
  4062. u.fillAlphas = a.graphFillAlpha;
  4063. u.fillColorsR = a.graphFillColor;
  4064. u.connect = m.connect;
  4065. u.hidden = m.hidden;
  4066. u.width = k;
  4067. u.height = l;
  4068. u.pointPosition = m.pointPosition;
  4069. u.stepDirection = m.stepDirection;
  4070. u.periodSpan = m.periodSpan;
  4071. p = a.selectedGraph;
  4072. p.id = m.id;
  4073. p.bcn = u.bcn + "selected-";
  4074. p.rotate = h;
  4075. p.chart = b;
  4076. p.data = c;
  4077. p.valueAxis = q;
  4078. p.chart = m.chart;
  4079. p.categoryAxis = e;
  4080. p.periodSpan = m.periodSpan;
  4081. p.valueField = m.valueField;
  4082. p.openField = m.openField;
  4083. p.closeField = m.closeField;
  4084. p.highField =
  4085. m.highField;
  4086. p.lowField = m.lowField;
  4087. p.lineAlpha = a.selectedGraphLineAlpha;
  4088. p.lineColorR = a.selectedGraphLineColor;
  4089. p.fillAlphas = a.selectedGraphFillAlpha;
  4090. p.fillColorsR = a.selectedGraphFillColor;
  4091. p.connect = m.connect;
  4092. p.hidden = m.hidden;
  4093. p.width = k;
  4094. p.height = l;
  4095. p.pointPosition = m.pointPosition;
  4096. p.stepDirection = m.stepDirection;
  4097. p.periodSpan = m.periodSpan;
  4098. b = a.graphType;
  4099. b || (b = m.type);
  4100. u.type = b;
  4101. p.type = b;
  4102. c = c.length - 1;
  4103. u.zoom(0, c);
  4104. p.zoom(0, c);
  4105. p.set.click(function () {
  4106. a.handleBackgroundClick()
  4107. }).mouseover(function () {
  4108. a.handleMouseOver()
  4109. }).mouseout(function () {
  4110. a.handleMouseOut()
  4111. });
  4112. u.set.click(function () {
  4113. a.handleBackgroundClick()
  4114. }).mouseover(function () {
  4115. a.handleMouseOver()
  4116. }).mouseout(function () {
  4117. a.handleMouseOut()
  4118. });
  4119. n.push(u.set);
  4120. n.push(p.set)
  4121. }
  4122. n.push(e.set);
  4123. n.push(e.labelsSet);
  4124. a.bg.toBack();
  4125. a.invisibleBg.toFront();
  4126. a.dragger.toFront();
  4127. a.iconLeft.toFront();
  4128. a.iconRight.toFront()
  4129. }
  4130. }, timeZoom: function (a, b, c) {
  4131. this.startTime = a;
  4132. this.endTime = b;
  4133. this.timeDifference = b - a;
  4134. this.skipEvent = !d.toBoolean(c);
  4135. this.zoomScrollbar();
  4136. this.skipEvent || this.dispatchScrollbarEvent()
  4137. }, zoom: function (a, b) {
  4138. this.start =
  4139. a;
  4140. this.end = b;
  4141. this.skipEvent = !0;
  4142. this.zoomScrollbar()
  4143. }, dispatchScrollbarEvent: function () {
  4144. if ("ValueAxis" == this.categoryAxis.cname) d.ChartScrollbar.base.dispatchScrollbarEvent.call(this); else if (this.skipEvent) this.skipEvent = !1; else {
  4145. var a = this.chart.chartData, b, c, e = this.dragger.getBBox();
  4146. b = e.x;
  4147. var h = e.y, f = e.width, e = e.height, g = this.chart;
  4148. this.rotate ? (b = h, c = e) : c = f;
  4149. f = {type: "zoomed", target: this};
  4150. f.chart = g;
  4151. var k = this.categoryAxis, l = this.stepWidth, h = g.minSelectedTime, e = !1;
  4152. if (k.parseDates && !k.equalSpacing) {
  4153. if (a =
  4154. g.lastTime, g = g.firstTime, k = Math.round(b / l) + g, b = this.dragging ? k + this.timeDifference : Math.round((b + c) / l) + g, k > b && (k = b), 0 < h && b - k < h && (b = Math.round(k + (b - k) / 2), e = Math.round(h / 2), k = b - e, b += e, e = !0), b > a && (b = a), b - h < k && (k = b - h), k < g && (k = g), k + h > b && (b = k + h), k != this.startTime || b != this.endTime) this.startTime = k, this.endTime = b, f.start = k, f.end = b, f.startDate = new Date(k), f.endDate = new Date(b), this.fire(f)
  4155. } else if (k.startOnAxis || (b += l / 2), c -= this.stepWidth / 2, h = k.xToIndex(b), b = k.xToIndex(b + c), h != this.start || this.end != b) k.startOnAxis &&
  4156. (this.resizingRight && h == b && b++, this.resizingLeft && h == b && (0 < h ? h-- : b = 1)), this.start = h, this.end = this.dragging ? this.start + this.difference : b, f.start = this.start, f.end = this.end, k.parseDates && (a[this.start] && (f.startDate = new Date(a[this.start].time)), a[this.end] && (f.endDate = new Date(a[this.end].time))), this.fire(f);
  4157. e && this.zoomScrollbar()
  4158. }
  4159. }, zoomScrollbar: function () {
  4160. if (!(this.dragging || this.resizingLeft || this.resizingRight || this.animating) && this.dragger && this.enabled) {
  4161. var a, b;
  4162. a = this.chart;
  4163. var c = a.chartData,
  4164. d = this.categoryAxis;
  4165. d.parseDates && !d.equalSpacing ? (c = d.stepWidth, d = a.firstTime, a = c * (this.startTime - d), b = c * (this.endTime - d)) : (a = c[this.start].x[d.id], b = c[this.end].x[d.id], c = d.stepWidth, d.startOnAxis || (d = c / 2, a -= d, b += d));
  4166. this.stepWidth = c;
  4167. this.updateScrollbarSize(a, b)
  4168. }
  4169. }, maskGraphs: function (a, b, c, d) {
  4170. var h = this.selectedGraph;
  4171. h && h.set.clipRect(a, b, c, d)
  4172. }, handleDragStart: function () {
  4173. d.ChartScrollbar.base.handleDragStart.call(this);
  4174. this.difference = this.end - this.start;
  4175. this.timeDifference = this.endTime - this.startTime;
  4176. 0 > this.timeDifference && (this.timeDifference = 0)
  4177. }, handleBackgroundClick: function () {
  4178. d.ChartScrollbar.base.handleBackgroundClick.call(this);
  4179. this.dragging || (this.difference = this.end - this.start, this.timeDifference = this.endTime - this.startTime, 0 > this.timeDifference && (this.timeDifference = 0))
  4180. }
  4181. })
  4182. })();
  4183. (function () {
  4184. var d = window.AmCharts;
  4185. d.AmBalloon = d.Class({
  4186. construct: function (a) {
  4187. this.cname = "AmBalloon";
  4188. this.enabled = !0;
  4189. this.fillColor = "#FFFFFF";
  4190. this.fillAlpha = .8;
  4191. this.borderThickness = 2;
  4192. this.borderColor = "#FFFFFF";
  4193. this.borderAlpha = 1;
  4194. this.cornerRadius = 0;
  4195. this.maxWidth = 220;
  4196. this.horizontalPadding = 8;
  4197. this.verticalPadding = 4;
  4198. this.pointerWidth = 6;
  4199. this.pointerOrientation = "V";
  4200. this.color = "#000000";
  4201. this.adjustBorderColor = !0;
  4202. this.show = this.follow = this.showBullet = !1;
  4203. this.bulletSize = 3;
  4204. this.shadowAlpha = .4;
  4205. this.shadowColor =
  4206. "#000000";
  4207. this.fadeOutDuration = this.animationDuration = .3;
  4208. this.fixedPosition = !0;
  4209. this.offsetY = 6;
  4210. this.offsetX = 1;
  4211. this.textAlign = "center";
  4212. this.disableMouseEvents = !0;
  4213. this.deltaSignX = this.deltaSignY = 1;
  4214. d.isModern || (this.offsetY *= 1.5);
  4215. this.sdy = this.sdx = 0;
  4216. d.applyTheme(this, a, this.cname)
  4217. }, draw: function () {
  4218. var a = this.pointToX, b = this.pointToY;
  4219. d.isModern || (this.drop = !1);
  4220. var c = this.chart;
  4221. d.VML && (this.fadeOutDuration = 0);
  4222. this.xAnim && c.stopAnim(this.xAnim);
  4223. this.yAnim && c.stopAnim(this.yAnim);
  4224. this.sdy = this.sdx = 0;
  4225. if (!isNaN(a)) {
  4226. var e =
  4227. this.follow, h = c.container, f = this.set;
  4228. d.remove(f);
  4229. this.removeDiv();
  4230. f = h.set();
  4231. f.node.style.pointerEvents = "none";
  4232. this.set = f;
  4233. this.mainSet ? (this.mainSet.push(this.set), this.sdx = this.mainSet.x, this.sdy = this.mainSet.y) : c.balloonsSet.push(f);
  4234. if (this.show) {
  4235. var g = this.l, k = this.t, l = this.r, m = this.b, n = this.balloonColor, q = this.fillColor,
  4236. p = this.borderColor, t = q;
  4237. void 0 != n && (this.adjustBorderColor ? t = p = n : q = n);
  4238. var r = this.horizontalPadding, u = this.verticalPadding, y = this.pointerWidth,
  4239. x = this.pointerOrientation, w = this.cornerRadius,
  4240. B = c.fontFamily, z = this.fontSize;
  4241. void 0 == z && (z = c.fontSize);
  4242. var n = document.createElement("div"), A = c.classNamePrefix;
  4243. n.className = A + "-balloon-div";
  4244. this.className && (n.className = n.className + " " + A + "-balloon-div-" + this.className);
  4245. A = n.style;
  4246. this.disableMouseEvents && (A.pointerEvents = "none");
  4247. A.position = "absolute";
  4248. var C = this.minWidth, D = "";
  4249. isNaN(C) || (D = "min-width:" + (C - 2 * r) + "px; ");
  4250. n.innerHTML = '<div style="text-align:' + this.textAlign + "; " + D + "max-width:" + this.maxWidth + "px; font-size:" + z + "px; color:" + this.color + "; font-family:" +
  4251. B + '">' + this.text + "</div>";
  4252. c.chartDiv.appendChild(n);
  4253. this.textDiv = n;
  4254. var J = n.offsetWidth, H = n.offsetHeight;
  4255. n.clientHeight && (J = n.clientWidth, H = n.clientHeight);
  4256. B = H + 2 * u;
  4257. D = J + 2 * r;
  4258. !isNaN(C) && D < C && (D = C);
  4259. window.opera && (B += 2);
  4260. var R = !1, z = this.offsetY;
  4261. c.handDrawn && (z += c.handDrawScatter + 2);
  4262. "H" != x ? (C = a - D / 2, b < k + B + 10 && "down" != x ? (R = !0, e && (b += z), z = b + y, this.deltaSignY = -1) : (e && (b -= z), z = b - B - y, this.deltaSignY = 1)) : (2 * y > B && (y = B / 2), z = b - B / 2, a < g + (l - g) / 2 ? (C = a + y, this.deltaSignX = -1) : (C = a - D - y, this.deltaSignX = 1));
  4263. z + B >= m && (z = m - B);
  4264. z < k && (z = k);
  4265. C < g && (C = g);
  4266. C + D > l && (C = l - D);
  4267. var k = z + u, m = C + r, L = this.shadowAlpha, P = this.shadowColor, r = this.borderThickness,
  4268. ia = this.bulletSize, I, u = this.fillAlpha, Z = this.borderAlpha;
  4269. this.showBullet && (I = d.circle(h, ia, t, u), f.push(I));
  4270. this.drop ? (g = D / 1.6, l = 0, "V" == x && (x = "down"), "H" == x && (x = "left"), "down" == x && (C = a + 1, z = b - g - g / 3), "up" == x && (l = 180, C = a + 1, z = b + g + g / 3), "left" == x && (l = 270, C = a + g + g / 3 + 2, z = b), "right" == x && (l = 90, C = a - g - g / 3 + 2, z = b), k = z - H / 2 + 1, m = C - J / 2 - 1, q = d.drop(h, g, l, q, u, r, p, Z)) : 0 < w || 0 === y ? (0 < L && (a = d.rect(h, D, B, q, 0, r + 1,
  4271. P, L, w), d.isModern ? a.translate(1, 1) : a.translate(4, 4), f.push(a)), q = d.rect(h, D, B, q, u, r, p, Z, w)) : (t = [], w = [], "H" != x ? (g = a - C, g > D - y && (g = D - y), g < y && (g = y), t = [0, g - y, a - C, g + y, D, D, 0, 0], w = R ? [0, 0, b - z, 0, 0, B, B, 0] : [B, B, b - z, B, B, 0, 0, B]) : (x = b - z, x > B - y && (x = B - y), x < y && (x = y), w = [0, x - y, b - z, x + y, B, B, 0, 0], t = a < g + (l - g) / 2 ? [0, 0, C < a ? 0 : a - C, 0, 0, D, D, 0] : [D, D, C + D > a ? D : a - C, D, D, 0, 0, D]), 0 < L && (a = d.polygon(h, t, w, q, 0, r, P, L), a.translate(1, 1), f.push(a)), q = d.polygon(h, t, w, q, u, r, p, Z));
  4272. this.bg = q;
  4273. f.push(q);
  4274. q.toFront();
  4275. d.setCN(c, q, "balloon-bg");
  4276. this.className &&
  4277. d.setCN(c, q, "balloon-bg-" + this.className);
  4278. h = 1 * this.deltaSignX;
  4279. m += this.sdx;
  4280. k += this.sdy;
  4281. A.left = m + "px";
  4282. A.top = k + "px";
  4283. f.translate(C - h, z, 1, !0);
  4284. q = q.getBBox();
  4285. this.bottom = z + B + 1;
  4286. this.yPos = q.y + z;
  4287. I && I.translate(this.pointToX - C + h, b - z);
  4288. b = this.animationDuration;
  4289. 0 < this.animationDuration && !e && !isNaN(this.prevX) && (f.translate(this.prevX, this.prevY, NaN, !0), f.animate({translate: C - h + "," + z}, b, "easeOutSine"), n && (A.left = this.prevTX + "px", A.top = this.prevTY + "px", this.xAnim = c.animate({node: n}, "left", this.prevTX, m, b, "easeOutSine",
  4290. "px"), this.yAnim = c.animate({node: n}, "top", this.prevTY, k, b, "easeOutSine", "px")));
  4291. this.prevX = C - h;
  4292. this.prevY = z;
  4293. this.prevTX = m;
  4294. this.prevTY = k
  4295. }
  4296. }
  4297. }, fixPrevious: function () {
  4298. this.rPrevX = this.prevX;
  4299. this.rPrevY = this.prevY;
  4300. this.rPrevTX = this.prevTX;
  4301. this.rPrevTY = this.prevTY
  4302. }, restorePrevious: function () {
  4303. this.prevX = this.rPrevX;
  4304. this.prevY = this.rPrevY;
  4305. this.prevTX = this.rPrevTX;
  4306. this.prevTY = this.rPrevTY
  4307. }, followMouse: function () {
  4308. if (this.follow && this.show) {
  4309. var a = this.chart.mouseX - this.offsetX * this.deltaSignX - this.sdx, b = this.chart.mouseY -
  4310. this.sdy;
  4311. this.pointToX = a;
  4312. this.pointToY = b;
  4313. if (a != this.previousX || b != this.previousY) if (this.previousX = a, this.previousY = b, 0 === this.cornerRadius) this.draw(); else {
  4314. var c = this.set;
  4315. if (c) {
  4316. var d = c.getBBox(), a = a - d.width / 2, h = b - d.height - 10;
  4317. a < this.l && (a = this.l);
  4318. a > this.r - d.width && (a = this.r - d.width);
  4319. h < this.t && (h = b + 10);
  4320. c.translate(a, h);
  4321. b = this.textDiv.style;
  4322. b.left = a + this.horizontalPadding + "px";
  4323. b.top = h + this.verticalPadding + "px"
  4324. }
  4325. }
  4326. }
  4327. }, changeColor: function (a) {
  4328. this.balloonColor = a
  4329. }, setBounds: function (a, b, c, d) {
  4330. this.l = a;
  4331. this.t =
  4332. b;
  4333. this.r = c;
  4334. this.b = d;
  4335. this.destroyTO && clearTimeout(this.destroyTO)
  4336. }, showBalloon: function (a) {
  4337. if (this.text != a || this.positionChanged) this.text = a, this.isHiding = !1, this.show = !0, this.destroyTO && clearTimeout(this.destroyTO), a = this.chart, this.fadeAnim1 && a.stopAnim(this.fadeAnim1), this.fadeAnim2 && a.stopAnim(this.fadeAnim2), this.draw(), this.positionChanged = !1
  4338. }, hide: function (a) {
  4339. var b = this;
  4340. b.text = void 0;
  4341. isNaN(a) && (a = b.fadeOutDuration);
  4342. var c = b.chart;
  4343. if (0 < a && !b.isHiding) {
  4344. b.isHiding = !0;
  4345. b.destroyTO && clearTimeout(b.destroyTO);
  4346. b.destroyTO = setTimeout(function () {
  4347. b.destroy.call(b)
  4348. }, 1E3 * a);
  4349. b.follow = !1;
  4350. b.show = !1;
  4351. var d = b.set;
  4352. d && (d.setAttr("opacity", b.fillAlpha), b.fadeAnim1 = d.animate({opacity: 0}, a, "easeInSine"));
  4353. b.textDiv && (b.fadeAnim2 = c.animate({node: b.textDiv}, "opacity", 1, 0, a, "easeInSine", ""))
  4354. } else b.show = !1, b.follow = !1, b.destroy()
  4355. }, setPosition: function (a, b) {
  4356. if (a != this.pointToX || b != this.pointToY) this.previousX = this.pointToX, this.previousY = this.pointToY, this.pointToX = a, this.pointToY = b, this.positionChanged = !0
  4357. }, followCursor: function (a) {
  4358. var b =
  4359. this;
  4360. b.follow = a;
  4361. clearInterval(b.interval);
  4362. var c = b.chart.mouseX - b.sdx, d = b.chart.mouseY - b.sdy;
  4363. !isNaN(c) && a && (b.pointToX = c - b.offsetX * b.deltaSignX, b.pointToY = d, b.followMouse(), b.interval = setInterval(function () {
  4364. b.followMouse.call(b)
  4365. }, 40))
  4366. }, removeDiv: function () {
  4367. if (this.textDiv) {
  4368. var a = this.textDiv.parentNode;
  4369. a && a.removeChild(this.textDiv)
  4370. }
  4371. }, destroy: function () {
  4372. clearInterval(this.interval);
  4373. d.remove(this.set);
  4374. this.removeDiv();
  4375. this.set = null
  4376. }
  4377. })
  4378. })();
  4379. (function () {
  4380. var d = window.AmCharts;
  4381. d.AmCoordinateChart = d.Class({
  4382. inherits: d.AmChart, construct: function (a) {
  4383. d.AmCoordinateChart.base.construct.call(this, a);
  4384. this.theme = a;
  4385. this.createEvents("rollOverGraphItem", "rollOutGraphItem", "clickGraphItem", "doubleClickGraphItem", "rightClickGraphItem", "clickGraph", "rollOverGraph", "rollOutGraph");
  4386. this.startAlpha = 1;
  4387. this.startDuration = 0;
  4388. this.startEffect = "elastic";
  4389. this.sequencedAnimation = !0;
  4390. this.colors = "#ea4c89 #00C6D7 #052963 #0D8ECF #2A0CD0 #CD0D74 #021f4e #ea4c89 #ea4c89 #DDDDDD #999999 #333333 #990000".split(" ");
  4391. this.balloonDateFormat = "MMM DD, YYYY";
  4392. this.valueAxes = [];
  4393. this.graphs = [];
  4394. this.guides = [];
  4395. this.gridAboveGraphs = !1;
  4396. d.applyTheme(this, a, "AmCoordinateChart")
  4397. }, initChart: function () {
  4398. d.AmCoordinateChart.base.initChart.call(this);
  4399. this.drawGraphs = !0;
  4400. var a = this.categoryAxis;
  4401. a && (this.categoryAxis = d.processObject(a, d.CategoryAxis, this.theme));
  4402. this.processValueAxes();
  4403. this.createValueAxes();
  4404. this.processGraphs();
  4405. this.processGuides();
  4406. d.VML && (this.startAlpha = 1);
  4407. this.setLegendData(this.graphs);
  4408. this.gridAboveGraphs && this.gridSet.toFront()
  4409. },
  4410. createValueAxes: function () {
  4411. if (0 === this.valueAxes.length) {
  4412. var a = new d.ValueAxis;
  4413. this.addValueAxis(a)
  4414. }
  4415. }, parseData: function () {
  4416. this.processValueAxes();
  4417. this.processGraphs()
  4418. }, parseSerialData: function (a) {
  4419. this.chartData = [];
  4420. if (a) if (0 < this.processTimeout) {
  4421. var b = a.length / this.processCount;
  4422. this.parseCount = Math.ceil(b) - 1;
  4423. for (var c = 0; c < b; c++) this.delayParseSerialData(a, c)
  4424. } else this.parseCount = 0, this.parsePartSerialData(a, 0, a.length, 0); else this.onDataUpdated()
  4425. }, delayParseSerialData: function (a, b) {
  4426. var c = this, d = c.processCount;
  4427. setTimeout(function () {
  4428. c.parsePartSerialData.call(c, a, b * d, (b + 1) * d, b)
  4429. }, c.processTimeout)
  4430. }, parsePartSerialData: function (a, b, c, e) {
  4431. c > a.length && (c = a.length);
  4432. var h = this.graphs, f = {}, g = this.seriesIdField;
  4433. g || (g = this.categoryField);
  4434. var k = !1, l, m = this.categoryAxis, n, q, p;
  4435. m && (k = m.parseDates, n = m.forceShowField, p = m.classNameField, q = m.labelColorField, l = m.categoryFunction);
  4436. var t, r, u = {}, y;
  4437. k && (t = d.extractPeriod(m.minPeriod), r = t.period, t = t.count, y = d.getPeriodDuration(r, t));
  4438. var x = {};
  4439. this.lookupTable = x;
  4440. var w, B = this.dataDateFormat,
  4441. z = {};
  4442. for (w = b; w < c; w++) {
  4443. var A = {}, C = a[w];
  4444. b = C[this.categoryField];
  4445. A.dataContext = C;
  4446. A.category = l ? l(b, C, m) : String(b);
  4447. n && (A.forceShow = C[n]);
  4448. p && (A.className = C[p]);
  4449. q && (A.labelColor = C[q]);
  4450. x[C[g]] = A;
  4451. if (k && (m.categoryFunction ? b = m.categoryFunction(b, C, m) : (!B || b instanceof Date || (b = b.toString() + " |"), b = d.getDate(b, B, m.minPeriod)), b = d.resetDateToMin(b, r, t, m.firstDayOfWeek), A.category = b, A.time = b.getTime(), isNaN(A.time))) continue;
  4452. var D = this.valueAxes;
  4453. A.axes = {};
  4454. A.x = {};
  4455. var J;
  4456. for (J = 0; J < D.length; J++) {
  4457. var H = D[J].id;
  4458. A.axes[H] =
  4459. {};
  4460. A.axes[H].graphs = {};
  4461. var R;
  4462. for (R = 0; R < h.length; R++) {
  4463. b = h[R];
  4464. var L = b.id, P = 1.1;
  4465. isNaN(b.gapPeriod) || (P = b.gapPeriod);
  4466. var ia = b.periodValue;
  4467. if (b.valueAxis.id == H) {
  4468. A.axes[H].graphs[L] = {};
  4469. var I = {};
  4470. I.index = w;
  4471. var Z = C;
  4472. b.dataProvider && (Z = f);
  4473. I.values = this.processValues(Z, b, ia);
  4474. !b.connect && z && z[L] && 0 < P && A.time - u[L] >= y * P && (z[L].gap = !0);
  4475. this.processFields(b, I, Z);
  4476. I.category = A.category;
  4477. I.serialDataItem = A;
  4478. I.graph = b;
  4479. A.axes[H].graphs[L] = I;
  4480. u[L] = A.time;
  4481. z[L] = I
  4482. }
  4483. }
  4484. }
  4485. this.chartData[w] = A
  4486. }
  4487. if (this.parseCount == e) {
  4488. for (a = 0; a < h.length; a++) b =
  4489. h[a], b.dataProvider && this.parseGraphData(b);
  4490. this.dataChanged = !1;
  4491. this.dispatchDataUpdated = !0;
  4492. this.onDataUpdated()
  4493. }
  4494. }, processValues: function (a, b, c) {
  4495. var e = {}, h, f = !1;
  4496. "candlestick" != b.type && "ohlc" != b.type || "" === c || (f = !0);
  4497. for (var g = "value error open close low high".split(" "), k = 0; k < g.length; k++) {
  4498. var l = g[k];
  4499. "value" != l && "error" != l && f && (c = l.charAt(0).toUpperCase() + l.slice(1));
  4500. var m = a[b[l + "Field"] + c];
  4501. null !== m && (h = Number(m), isNaN(h) || (e[l] = h), "date" == b.valueAxis.type && void 0 !== m && (h = d.getDate(m, b.chart.dataDateFormat),
  4502. e[l] = h.getTime()))
  4503. }
  4504. return e
  4505. }, parseGraphData: function (a) {
  4506. var b = a.dataProvider, c = a.seriesIdField;
  4507. c || (c = this.seriesIdField);
  4508. c || (c = this.categoryField);
  4509. var d;
  4510. for (d = 0; d < b.length; d++) {
  4511. var h = b[d], f = this.lookupTable[String(h[c])], g = a.valueAxis.id;
  4512. f && (g = f.axes[g].graphs[a.id], g.serialDataItem = f, g.values = this.processValues(h, a, a.periodValue), this.processFields(a, g, h))
  4513. }
  4514. }, addValueAxis: function (a) {
  4515. a.chart = this;
  4516. this.valueAxes.push(a);
  4517. this.validateData()
  4518. }, removeValueAxesAndGraphs: function () {
  4519. var a = this.valueAxes,
  4520. b;
  4521. for (b = a.length - 1; -1 < b; b--) this.removeValueAxis(a[b])
  4522. }, removeValueAxis: function (a) {
  4523. var b = this.graphs, c;
  4524. for (c = b.length - 1; 0 <= c; c--) {
  4525. var d = b[c];
  4526. d && d.valueAxis == a && this.removeGraph(d)
  4527. }
  4528. b = this.valueAxes;
  4529. for (c = b.length - 1; 0 <= c; c--) b[c] == a && b.splice(c, 1);
  4530. this.validateData()
  4531. }, addGraph: function (a) {
  4532. this.graphs.push(a);
  4533. this.chooseGraphColor(a, this.graphs.length - 1);
  4534. this.validateData()
  4535. }, removeGraph: function (a) {
  4536. var b = this.graphs, c;
  4537. for (c = b.length - 1; 0 <= c; c--) b[c] == a && (b.splice(c, 1), a.destroy());
  4538. this.validateData()
  4539. },
  4540. handleValueAxisZoom: function () {
  4541. }, processValueAxes: function () {
  4542. var a = this.valueAxes, b;
  4543. for (b = 0; b < a.length; b++) {
  4544. var c = a[b], c = d.processObject(c, d.ValueAxis, this.theme);
  4545. a[b] = c;
  4546. c.chart = this;
  4547. c.init();
  4548. this.listenTo(c, "axisZoomed", this.handleValueAxisZoom);
  4549. c.id || (c.id = "valueAxisAuto" + b + "_" + (new Date).getTime());
  4550. void 0 === c.usePrefixes && (c.usePrefixes = this.usePrefixes)
  4551. }
  4552. }, processGuides: function () {
  4553. var a = this.guides, b = this.categoryAxis;
  4554. if (a) for (var c = 0; c < a.length; c++) {
  4555. var e = a[c];
  4556. (void 0 !== e.category || void 0 !== e.date) &&
  4557. b && b.addGuide(e);
  4558. e.id || (e.id = "guideAuto" + c + "_" + (new Date).getTime());
  4559. var h = e.valueAxis;
  4560. h ? (d.isString(h) && (h = this.getValueAxisById(h)), h ? h.addGuide(e) : this.valueAxes[0].addGuide(e)) : isNaN(e.value) || this.valueAxes[0].addGuide(e)
  4561. }
  4562. }, processGraphs: function () {
  4563. var a = this.graphs, b;
  4564. this.graphsById = {};
  4565. for (b = 0; b < a.length; b++) {
  4566. var c = a[b], c = d.processObject(c, d.AmGraph, this.theme);
  4567. a[b] = c;
  4568. this.chooseGraphColor(c, b);
  4569. c.chart = this;
  4570. c.init();
  4571. d.isString(c.valueAxis) && (c.valueAxis = this.getValueAxisById(c.valueAxis));
  4572. c.valueAxis ||
  4573. (c.valueAxis = this.valueAxes[0]);
  4574. c.id || (c.id = "graphAuto" + b + "_" + (new Date).getTime());
  4575. this.graphsById[c.id] = c
  4576. }
  4577. }, formatString: function (a, b, c) {
  4578. var e = b.graph, h = e.valueAxis;
  4579. h.duration && b.values.value && (h = d.formatDuration(b.values.value, h.duration, "", h.durationUnits, h.maxInterval, h.numberFormatter), a = a.split("[[value]]").join(h));
  4580. a = d.massReplace(a, {"[[title]]": e.title, "[[description]]": b.description});
  4581. a = c ? d.fixNewLines(a) : d.fixBrakes(a);
  4582. return a = d.cleanFromEmpty(a)
  4583. }, getBalloonColor: function (a, b, c) {
  4584. var e =
  4585. a.lineColor, h = a.balloonColor;
  4586. c && (h = e);
  4587. c = a.fillColorsR;
  4588. "object" == typeof c ? e = c[0] : void 0 !== c && (e = c);
  4589. b.isNegative && (c = a.negativeLineColor, a = a.negativeFillColors, "object" == typeof a ? c = a[0] : void 0 !== a && (c = a), void 0 !== c && (e = c));
  4590. void 0 !== b.color && (e = b.color);
  4591. void 0 !== b.lineColor && (e = b.lineColor);
  4592. b = b.fillColors;
  4593. void 0 !== b && (e = b, d.ifArray(b) && (e = b[0]));
  4594. void 0 === h && (h = e);
  4595. return h
  4596. }, getGraphById: function (a) {
  4597. return d.getObjById(this.graphs, a)
  4598. }, getValueAxisById: function (a) {
  4599. return d.getObjById(this.valueAxes, a)
  4600. },
  4601. processFields: function (a, b, c) {
  4602. if (a.itemColors) {
  4603. var e = a.itemColors, h = b.index;
  4604. b.color = h < e.length ? e[h] : d.randomColor()
  4605. }
  4606. e = "lineColor color alpha fillColors description bullet customBullet bulletSize bulletConfig url labelColor dashLength pattern gap className".split(" ");
  4607. for (h = 0; h < e.length; h++) {
  4608. var f = e[h], g = a[f + "Field"];
  4609. g && (g = c[g], d.isDefined(g) && (b[f] = g))
  4610. }
  4611. b.dataContext = c
  4612. }, chooseGraphColor: function (a, b) {
  4613. if (a.lineColor) a.lineColorR = a.lineColor; else {
  4614. var c;
  4615. c = this.colors.length > b ? this.colors[b] : a.lineColorR ?
  4616. a.lineColorR : d.randomColor();
  4617. a.lineColorR = c
  4618. }
  4619. a.fillColorsR = a.fillColors ? a.fillColors : a.lineColorR;
  4620. a.bulletBorderColorR = a.bulletBorderColor ? a.bulletBorderColor : a.useLineColorForBulletBorder ? a.lineColorR : a.bulletColor;
  4621. a.bulletColorR = a.bulletColor ? a.bulletColor : a.lineColorR;
  4622. if (c = this.patterns) a.pattern = c[b]
  4623. }, handleLegendEvent: function (a) {
  4624. var b = a.type;
  4625. a = a.dataItem;
  4626. if (!this.legend.data && a) {
  4627. var c = a.hidden, d = a.showBalloon;
  4628. switch (b) {
  4629. case "clickMarker":
  4630. this.textClickEnabled && (d ? this.hideGraphsBalloon(a) : this.showGraphsBalloon(a));
  4631. break;
  4632. case "clickLabel":
  4633. d ? this.hideGraphsBalloon(a) : this.showGraphsBalloon(a);
  4634. break;
  4635. case "rollOverItem":
  4636. c || this.highlightGraph(a);
  4637. break;
  4638. case "rollOutItem":
  4639. c || this.unhighlightGraph();
  4640. break;
  4641. case "hideItem":
  4642. this.hideGraph(a);
  4643. break;
  4644. case "showItem":
  4645. this.showGraph(a)
  4646. }
  4647. }
  4648. }, highlightGraph: function (a) {
  4649. var b = this.graphs, c, d = .2;
  4650. this.legend && (d = this.legend.rollOverGraphAlpha);
  4651. if (1 != d) for (c = 0; c < b.length; c++) {
  4652. var h = b[c];
  4653. h != a && h.changeOpacity(d)
  4654. }
  4655. }, unhighlightGraph: function () {
  4656. var a;
  4657. this.legend && (a = this.legend.rollOverGraphAlpha);
  4658. if (1 != a) {
  4659. a = this.graphs;
  4660. var b;
  4661. for (b = 0; b < a.length; b++) a[b].changeOpacity(1)
  4662. }
  4663. }, showGraph: function (a) {
  4664. a.switchable && (a.hidden = !1, this.dataChanged = !0, "xy" != this.type && (this.marginsUpdated = !1), this.chartCreated && this.initChart())
  4665. }, hideGraph: function (a) {
  4666. a.switchable && (this.dataChanged = !0, "xy" != this.type && (this.marginsUpdated = !1), a.hidden = !0, this.chartCreated && this.initChart())
  4667. }, hideGraphsBalloon: function (a) {
  4668. a.showBalloon = !1;
  4669. this.updateLegend()
  4670. }, showGraphsBalloon: function (a) {
  4671. a.showBalloon = !0;
  4672. this.updateLegend()
  4673. },
  4674. updateLegend: function () {
  4675. this.legend && this.legend.invalidateSize()
  4676. }, resetAnimation: function () {
  4677. var a = this.graphs;
  4678. if (a) {
  4679. var b;
  4680. for (b = 0; b < a.length; b++) a[b].animationPlayed = !1
  4681. }
  4682. }, animateAgain: function () {
  4683. this.resetAnimation();
  4684. this.validateNow()
  4685. }
  4686. })
  4687. })();
  4688. (function () {
  4689. var d = window.AmCharts;
  4690. d.TrendLine = d.Class({
  4691. construct: function (a) {
  4692. this.cname = "TrendLine";
  4693. this.createEvents("click");
  4694. this.isProtected = !1;
  4695. this.dashLength = 0;
  4696. this.lineColor = "#00CC00";
  4697. this.lineThickness = this.lineAlpha = 1;
  4698. d.applyTheme(this, a, this.cname)
  4699. }, draw: function () {
  4700. var a = this;
  4701. a.destroy();
  4702. var b = a.chart, c = b.container, e, h, f, g, k = a.categoryAxis, l = a.initialDate, m = a.initialCategory,
  4703. n = a.finalDate, q = a.finalCategory, p = a.valueAxis, t = a.valueAxisX, r = a.initialXValue,
  4704. u = a.finalXValue, y = a.initialValue, x =
  4705. a.finalValue, w = p.recalculateToPercents, B = b.dataDateFormat;
  4706. k && (l && (l = d.getDate(l, B, "fff"), a.initialDate = l, e = k.dateToCoordinate(l)), m && (e = k.categoryToCoordinate(m)), n && (n = d.getDate(n, B, "fff"), a.finalDate = n, h = k.dateToCoordinate(n)), q && (h = k.categoryToCoordinate(q)));
  4707. t && !w && (isNaN(r) || (e = t.getCoordinate(r)), isNaN(u) || (h = t.getCoordinate(u)));
  4708. p && !w && (isNaN(y) || (f = p.getCoordinate(y)), isNaN(x) || (g = p.getCoordinate(x)));
  4709. if (!(isNaN(e) || isNaN(h) || isNaN(f) || isNaN(f))) {
  4710. b.rotate ? (k = [f, g], g = [e, h]) : (k = [e, h], g = [f, g]);
  4711. l = a.lineColor;
  4712. f = d.line(c, k, g, l, a.lineAlpha, a.lineThickness, a.dashLength);
  4713. e = k;
  4714. h = g;
  4715. q = k[1] - k[0];
  4716. p = g[1] - g[0];
  4717. 0 === q && (q = .01);
  4718. 0 === p && (p = .01);
  4719. m = q / Math.abs(q);
  4720. n = p / Math.abs(p);
  4721. p = 90 * Math.PI / 180 - Math.asin(q / (q * p / Math.abs(q * p) * Math.sqrt(Math.pow(q, 2) + Math.pow(p, 2))));
  4722. q = Math.abs(5 * Math.cos(p));
  4723. p = Math.abs(5 * Math.sin(p));
  4724. e.push(k[1] - m * p, k[0] - m * p);
  4725. h.push(g[1] + n * q, g[0] + n * q);
  4726. g = d.polygon(c, e, h, l, .005, 0);
  4727. c = c.set([g, f]);
  4728. c.translate(b.marginLeftReal, b.marginTopReal);
  4729. b.trendLinesSet.push(c);
  4730. d.setCN(b, f, "trend-line");
  4731. d.setCN(b,
  4732. f, "trend-line-" + a.id);
  4733. a.line = f;
  4734. a.set = c;
  4735. if (f = a.initialImage) f = d.processObject(f, d.Image, a.theme), f.chart = b, f.draw(), f.translate(e[0] + f.offsetX, h[0] + f.offsetY), c.push(f.set);
  4736. if (f = a.finalImage) f = d.processObject(f, d.Image, a.theme), f.chart = b, f.draw(), f.translate(e[1] + f.offsetX, h[1] + f.offsetY), c.push(f.set);
  4737. g.mouseup(function () {
  4738. a.handleLineClick()
  4739. }).mouseover(function () {
  4740. a.handleLineOver()
  4741. }).mouseout(function () {
  4742. a.handleLineOut()
  4743. });
  4744. g.touchend && g.touchend(function () {
  4745. a.handleLineClick()
  4746. });
  4747. c.clipRect(0, 0, b.plotAreaWidth,
  4748. b.plotAreaHeight)
  4749. }
  4750. }, handleLineClick: function () {
  4751. this.fire({type: "click", trendLine: this, chart: this.chart})
  4752. }, handleLineOver: function () {
  4753. var a = this.rollOverColor;
  4754. void 0 !== a && this.line.attr({stroke: a});
  4755. this.balloonText && (clearTimeout(this.chart.hoverInt), a = this.line.getBBox(), this.chart.showBalloon(this.balloonText, this.lineColor, !0, this.x + a.x + a.width / 2, this.y + a.y + a.height / 2))
  4756. }, handleLineOut: function () {
  4757. this.line.attr({stroke: this.lineColor});
  4758. this.balloonText && this.chart.hideBalloon()
  4759. }, destroy: function () {
  4760. d.remove(this.set)
  4761. }
  4762. })
  4763. })();
  4764. (function () {
  4765. var d = window.AmCharts;
  4766. d.Image = d.Class({
  4767. construct: function (a) {
  4768. this.cname = "Image";
  4769. this.height = this.width = 20;
  4770. this.rotation = this.offsetY = this.offsetX = 0;
  4771. this.balloonColor = this.color = "#000000";
  4772. this.opacity = 1;
  4773. d.applyTheme(this, a, this.cname)
  4774. }, draw: function () {
  4775. var a = this;
  4776. a.set && a.set.remove();
  4777. var b = a.chart.container;
  4778. a.set = b.set();
  4779. var c, d;
  4780. a.url ? (c = b.image(a.url, 0, 0, a.width, a.height), d = 1) : a.svgPath && (c = b.path(a.svgPath), c.setAttr("fill", a.color), c.setAttr("stroke", a.outlineColor), b = c.getBBox(), d =
  4781. Math.min(a.width / b.width, a.height / b.height));
  4782. c && (c.setAttr("opacity", a.opacity), a.set.rotate(a.rotation), c.translate(-a.width / 2, -a.height / 2, d), a.balloonText && c.mouseover(function () {
  4783. a.chart.showBalloon(a.balloonText, a.balloonColor, !0)
  4784. }).mouseout(function () {
  4785. a.chart.hideBalloon()
  4786. }).touchend(function () {
  4787. a.chart.hideBalloon()
  4788. }).touchstart(function () {
  4789. a.chart.showBalloon(a.balloonText, a.balloonColor, !0)
  4790. }), a.set.push(c))
  4791. }, translate: function (a, b) {
  4792. this.set && this.set.translate(a, b)
  4793. }
  4794. })
  4795. })();
  4796. (function () {
  4797. var d = window.AmCharts;
  4798. d.circle = function (a, b, c, e, h, f, g, k, l) {
  4799. 0 >= b && (b = .001);
  4800. if (void 0 == h || 0 === h) h = .01;
  4801. void 0 === f && (f = "#000000");
  4802. void 0 === g && (g = 0);
  4803. e = {fill: c, stroke: f, "fill-opacity": e, "stroke-width": h, "stroke-opacity": g};
  4804. a = isNaN(l) ? a.circle(0, 0, b).attr(e) : a.ellipse(0, 0, b, l).attr(e);
  4805. k && a.gradient("radialGradient", [c, d.adjustLuminosity(c, -.6)]);
  4806. return a
  4807. };
  4808. d.text = function (a, b, c, e, h, f, g, k) {
  4809. f || (f = "middle");
  4810. "right" == f && (f = "end");
  4811. "left" == f && (f = "start");
  4812. isNaN(k) && (k = 1);
  4813. void 0 !== b && (b = String(b), d.isIE &&
  4814. !d.isModern && (b = b.replace("&amp;", "&"), b = b.replace("&", "&amp;")));
  4815. c = {fill: c, "font-family": e, "font-size": h + "px", opacity: k};
  4816. !0 === g && (c["font-weight"] = "bold");
  4817. c["text-anchor"] = f;
  4818. return a.text(b, c)
  4819. };
  4820. d.polygon = function (a, b, c, e, h, f, g, k, l, m, n) {
  4821. isNaN(f) && (f = .01);
  4822. isNaN(k) && (k = h);
  4823. var q = e, p = !1;
  4824. "object" == typeof q && 1 < q.length && (p = !0, q = q[0]);
  4825. void 0 === g && (g = q);
  4826. h = {fill: q, stroke: g, "fill-opacity": h, "stroke-width": f, "stroke-opacity": k};
  4827. void 0 !== n && 0 < n && (h["stroke-dasharray"] = n);
  4828. n = d.dx;
  4829. f = d.dy;
  4830. a.handDrawn && (c = d.makeHD(b,
  4831. c, a.handDrawScatter), b = c[0], c = c[1]);
  4832. g = Math.round;
  4833. m && (b[t] = d.roundTo(b[t], 5), c[t] = d.roundTo(c[t], 5), g = Number);
  4834. k = "M" + (g(b[0]) + n) + "," + (g(c[0]) + f);
  4835. for (var t = 1; t < b.length; t++) m && (b[t] = d.roundTo(b[t], 5), c[t] = d.roundTo(c[t], 5)), k += " L" + (g(b[t]) + n) + "," + (g(c[t]) + f);
  4836. a = a.path(k + " Z").attr(h);
  4837. p && a.gradient("linearGradient", e, l);
  4838. return a
  4839. };
  4840. d.rect = function (a, b, c, e, h, f, g, k, l, m, n) {
  4841. if (isNaN(b) || isNaN(c)) return a.set();
  4842. isNaN(f) && (f = 0);
  4843. void 0 === l && (l = 0);
  4844. void 0 === m && (m = 270);
  4845. isNaN(h) && (h = 0);
  4846. var q = e, p = !1;
  4847. "object" == typeof q &&
  4848. (q = q[0], p = !0);
  4849. void 0 === g && (g = q);
  4850. void 0 === k && (k = h);
  4851. b = Math.round(b);
  4852. c = Math.round(c);
  4853. var t = 0, r = 0;
  4854. 0 > b && (b = Math.abs(b), t = -b);
  4855. 0 > c && (c = Math.abs(c), r = -c);
  4856. t += d.dx;
  4857. r += d.dy;
  4858. h = {fill: q, stroke: g, "fill-opacity": h, "stroke-opacity": k};
  4859. void 0 !== n && 0 < n && (h["stroke-dasharray"] = n);
  4860. a = a.rect(t, r, b, c, l, f).attr(h);
  4861. p && a.gradient("linearGradient", e, m);
  4862. return a
  4863. };
  4864. d.bullet = function (a, b, c, e, h, f, g, k, l, m, n, q, p) {
  4865. var t;
  4866. "circle" == b && (b = "round");
  4867. switch (b) {
  4868. case "round":
  4869. t = d.circle(a, c / 2, e, h, f, g, k);
  4870. break;
  4871. case "square":
  4872. t = d.polygon(a, [-c /
  4873. 2, c / 2, c / 2, -c / 2], [c / 2, c / 2, -c / 2, -c / 2], e, h, f, g, k, m - 180, void 0, p);
  4874. break;
  4875. case "rectangle":
  4876. t = d.polygon(a, [-c, c, c, -c], [c / 2, c / 2, -c / 2, -c / 2], e, h, f, g, k, m - 180, void 0, p);
  4877. break;
  4878. case "diamond":
  4879. t = d.polygon(a, [-c / 2, 0, c / 2, 0], [0, -c / 2, 0, c / 2], e, h, f, g, k);
  4880. break;
  4881. case "triangleUp":
  4882. t = d.triangle(a, c, 0, e, h, f, g, k);
  4883. break;
  4884. case "triangleDown":
  4885. t = d.triangle(a, c, 180, e, h, f, g, k);
  4886. break;
  4887. case "triangleLeft":
  4888. t = d.triangle(a, c, 270, e, h, f, g, k);
  4889. break;
  4890. case "triangleRight":
  4891. t = d.triangle(a, c, 90, e, h, f, g, k);
  4892. break;
  4893. case "bubble":
  4894. t = d.circle(a, c / 2, e, h,
  4895. f, g, k, !0);
  4896. break;
  4897. case "line":
  4898. t = d.line(a, [-c / 2, c / 2], [0, 0], e, h, f, g, k);
  4899. break;
  4900. case "yError":
  4901. t = a.set();
  4902. t.push(d.line(a, [0, 0], [-c / 2, c / 2], e, h, f));
  4903. t.push(d.line(a, [-l, l], [-c / 2, -c / 2], e, h, f));
  4904. t.push(d.line(a, [-l, l], [c / 2, c / 2], e, h, f));
  4905. break;
  4906. case "xError":
  4907. t = a.set(), t.push(d.line(a, [-c / 2, c / 2], [0, 0], e, h, f)), t.push(d.line(a, [-c / 2, -c / 2], [-l, l], e, h, f)), t.push(d.line(a, [c / 2, c / 2], [-l, l], e, h, f))
  4908. }
  4909. t && t.pattern(n, NaN, q);
  4910. return t
  4911. };
  4912. d.triangle = function (a, b, c, d, h, f, g, k) {
  4913. if (void 0 === f || 0 === f) f = 1;
  4914. void 0 === g && (g = "#000");
  4915. void 0 ===
  4916. k && (k = 0);
  4917. d = {fill: d, stroke: g, "fill-opacity": h, "stroke-width": f, "stroke-opacity": k};
  4918. b /= 2;
  4919. var l;
  4920. 0 === c && (l = " M" + -b + "," + b + " L0," + -b + " L" + b + "," + b + " Z");
  4921. 180 == c && (l = " M" + -b + "," + -b + " L0," + b + " L" + b + "," + -b + " Z");
  4922. 90 == c && (l = " M" + -b + "," + -b + " L" + b + ",0 L" + -b + "," + b + " Z");
  4923. 270 == c && (l = " M" + -b + ",0 L" + b + "," + b + " L" + b + "," + -b + " Z");
  4924. return a.path(l).attr(d)
  4925. };
  4926. d.line = function (a, b, c, e, h, f, g, k, l, m, n) {
  4927. if (a.handDrawn && !n) return d.handDrawnLine(a, b, c, e, h, f, g, k, l, m, n);
  4928. f = {fill: "none", "stroke-width": f};
  4929. void 0 !== g && 0 < g && (f["stroke-dasharray"] =
  4930. g);
  4931. isNaN(h) || (f["stroke-opacity"] = h);
  4932. e && (f.stroke = e);
  4933. e = Math.round;
  4934. m && (e = Number, b[0] = d.roundTo(b[0], 5), c[0] = d.roundTo(c[0], 5));
  4935. m = d.dx;
  4936. h = d.dy;
  4937. g = "M" + (e(b[0]) + m) + "," + (e(c[0]) + h);
  4938. for (k = 1; k < b.length; k++) b[k] = d.roundTo(b[k], 5), c[k] = d.roundTo(c[k], 5), g += " L" + (e(b[k]) + m) + "," + (e(c[k]) + h);
  4939. if (d.VML) return a.path(g, void 0, !0).attr(f);
  4940. l && (g += " M0,0 L0,0");
  4941. return a.path(g).attr(f)
  4942. };
  4943. d.makeHD = function (a, b, c) {
  4944. for (var d = [], h = [], f = 1; f < a.length; f++) for (var g = Number(a[f - 1]), k = Number(b[f - 1]), l = Number(a[f]), m = Number(b[f]),
  4945. n = Math.round(Math.sqrt(Math.pow(l - g, 2) + Math.pow(m - k, 2)) / 50) + 1, l = (l - g) / n, m = (m - k) / n, q = 0; q <= n; q++) {
  4946. var p = k + q * m + Math.random() * c;
  4947. d.push(g + q * l + Math.random() * c);
  4948. h.push(p)
  4949. }
  4950. return [d, h]
  4951. };
  4952. d.handDrawnLine = function (a, b, c, e, h, f, g, k, l, m) {
  4953. var n, q = a.set();
  4954. for (n = 1; n < b.length; n++) for (var p = [b[n - 1], b[n]], t = [c[n - 1], c[n]], t = d.makeHD(p, t, a.handDrawScatter), p = t[0], t = t[1], r = 1; r < p.length; r++) q.push(d.line(a, [p[r - 1], p[r]], [t[r - 1], t[r]], e, h, f + Math.random() * a.handDrawThickness - a.handDrawThickness / 2, g, k, l, m, !0));
  4955. return q
  4956. };
  4957. d.doNothing =
  4958. function (a) {
  4959. return a
  4960. };
  4961. d.drop = function (a, b, c, d, h, f, g, k) {
  4962. var l = 1 / 180 * Math.PI, m = c - 20, n = Math.sin(m * l) * b, q = Math.cos(m * l) * b,
  4963. p = Math.sin((m + 40) * l) * b, t = Math.cos((m + 40) * l) * b, r = .8 * b, u = -b / 3, y = b / 3;
  4964. 0 === c && (u = -u, y = 0);
  4965. 180 == c && (y = 0);
  4966. 90 == c && (u = 0);
  4967. 270 == c && (u = 0, y = -y);
  4968. c = {fill: d, stroke: g, "stroke-width": f, "stroke-opacity": k, "fill-opacity": h};
  4969. b = "M" + n + "," + q + " A" + b + "," + b + ",0,1,1," + p + "," + t + (" A" + r + "," + r + ",0,0,0," + (Math.sin((m + 20) * l) * b + y) + "," + (Math.cos((m + 20) * l) * b + u));
  4970. b += " A" + r + "," + r + ",0,0,0," + n + "," + q;
  4971. return a.path(b, void 0,
  4972. void 0, "1000,1000").attr(c)
  4973. };
  4974. d.wedge = function (a, b, c, e, h, f, g, k, l, m, n, q, p, t) {
  4975. var r = Math.round;
  4976. f = r(f);
  4977. g = r(g);
  4978. k = r(k);
  4979. var u = r(g / f * k), y = d.VML, x = 359.5 + f / 100;
  4980. 359.94 < x && (x = 359.94);
  4981. h >= x && (h = x);
  4982. var w = 1 / 180 * Math.PI, x = b + Math.sin(e * w) * k, B = c - Math.cos(e * w) * u,
  4983. z = b + Math.sin(e * w) * f, A = c - Math.cos(e * w) * g, C = b + Math.sin((e + h) * w) * f,
  4984. D = c - Math.cos((e + h) * w) * g, J = b + Math.sin((e + h) * w) * k, w = c - Math.cos((e + h) * w) * u,
  4985. H = {fill: d.adjustLuminosity(m.fill, -.2), "stroke-opacity": 0, "fill-opacity": m["fill-opacity"]}, R = 0;
  4986. 180 < Math.abs(h) && (R = 1);
  4987. e = a.set();
  4988. var L;
  4989. y && (x = r(10 * x), z = r(10 * z), C = r(10 * C), J = r(10 * J), B = r(10 * B), A = r(10 * A), D = r(10 * D), w = r(10 * w), b = r(10 * b), l = r(10 * l), c = r(10 * c), f *= 10, g *= 10, k *= 10, u *= 10, 1 > Math.abs(h) && 1 >= Math.abs(C - z) && 1 >= Math.abs(D - A) && (L = !0));
  4990. h = "";
  4991. var P;
  4992. q && (H["fill-opacity"] = 0, H["stroke-opacity"] = m["stroke-opacity"] / 2, H.stroke = m.stroke);
  4993. if (0 < l) {
  4994. P = " M" + x + "," + (B + l) + " L" + z + "," + (A + l);
  4995. y ? (L || (P += " A" + (b - f) + "," + (l + c - g) + "," + (b + f) + "," + (l + c + g) + "," + z + "," + (A + l) + "," + C + "," + (D + l)), P += " L" + J + "," + (w + l), 0 < k && (L || (P += " B" + (b - k) + "," + (l + c - u) + "," + (b + k) + "," +
  4996. (l + c + u) + "," + J + "," + (l + w) + "," + x + "," + (l + B)))) : (P += " A" + f + "," + g + ",0," + R + ",1," + C + "," + (D + l) + " L" + J + "," + (w + l), 0 < k && (P += " A" + k + "," + u + ",0," + R + ",0," + x + "," + (B + l)));
  4997. P += " Z";
  4998. var ia = l;
  4999. y && (ia /= 10);
  5000. for (var I = 0; I < ia; I += 10) {
  5001. var Z = a.path(P, void 0, void 0, "1000,1000").attr(H);
  5002. e.push(Z);
  5003. Z.translate(0, -I)
  5004. }
  5005. P = a.path(" M" + x + "," + B + " L" + x + "," + (B + l) + " L" + z + "," + (A + l) + " L" + z + "," + A + " L" + x + "," + B + " Z", void 0, void 0, "1000,1000").attr(H);
  5006. l = a.path(" M" + C + "," + D + " L" + C + "," + (D + l) + " L" + J + "," + (w + l) + " L" + J + "," + w + " L" + C + "," + D + " Z", void 0, void 0,
  5007. "1000,1000").attr(H);
  5008. e.push(P);
  5009. e.push(l)
  5010. }
  5011. y ? (L || (h = " A" + r(b - f) + "," + r(c - g) + "," + r(b + f) + "," + r(c + g) + "," + r(z) + "," + r(A) + "," + r(C) + "," + r(D)), g = " M" + r(x) + "," + r(B) + " L" + r(z) + "," + r(A) + h + " L" + r(J) + "," + r(w)) : g = " M" + x + "," + B + " L" + z + "," + A + (" A" + f + "," + g + ",0," + R + ",1," + C + "," + D) + " L" + J + "," + w;
  5012. 0 < k && (y ? L || (g += " B" + (b - k) + "," + (c - u) + "," + (b + k) + "," + (c + u) + "," + J + "," + w + "," + x + "," + B) : g += " A" + k + "," + u + ",0," + R + ",0," + x + "," + B);
  5013. a.handDrawn && (k = d.line(a, [x, z], [B, A], m.stroke, m.thickness * Math.random() * a.handDrawThickness, m["stroke-opacity"]),
  5014. e.push(k));
  5015. k = a.path(g + " Z", void 0, void 0, "1000,1000").attr(m);
  5016. if (n) {
  5017. u = [];
  5018. for (y = 0; y < n.length; y++) u.push(d.adjustLuminosity(m.fill, n[y]));
  5019. "radial" != t || d.isModern || (u = []);
  5020. 0 < u.length && k.gradient(t + "Gradient", u)
  5021. }
  5022. d.isModern && "radial" == t && k.grad && (k.grad.setAttribute("gradientUnits", "userSpaceOnUse"), k.grad.setAttribute("r", f), k.grad.setAttribute("gradientTransform", "translate(" + (b - a.width / 2) + "," + (c - a.height / 2) + ")"));
  5023. k.pattern(q, NaN, p);
  5024. e.wedge = k;
  5025. e.push(k);
  5026. return e
  5027. };
  5028. d.rgb2hex = function (a) {
  5029. return (a = a.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i)) &&
  5030. 4 === a.length ? "#" + ("0" + parseInt(a[1], 10).toString(16)).slice(-2) + ("0" + parseInt(a[2], 10).toString(16)).slice(-2) + ("0" + parseInt(a[3], 10).toString(16)).slice(-2) : ""
  5031. };
  5032. d.adjustLuminosity = function (a, b) {
  5033. a && -1 != a.indexOf("rgb") && (a = d.rgb2hex(a));
  5034. a = String(a).replace(/[^0-9a-f]/gi, "");
  5035. 6 > a.length && (a = String(a[0]) + String(a[0]) + String(a[1]) + String(a[1]) + String(a[2]) + String(a[2]));
  5036. b = b || 0;
  5037. var c = "#", e, h;
  5038. for (h = 0; 3 > h; h++) e = parseInt(a.substr(2 * h, 2), 16), e = Math.round(Math.min(Math.max(0, e + e * b), 255)).toString(16), c += ("00" +
  5039. e).substr(e.length);
  5040. return c
  5041. }
  5042. })();
  5043. (function () {
  5044. var d = window.AmCharts;
  5045. d.Bezier = d.Class({
  5046. construct: function (a, b, c, e, h, f, g, k, l, m) {
  5047. "object" == typeof g && (g = g[0]);
  5048. "object" == typeof k && (k = k[0]);
  5049. 0 === k && (g = "none");
  5050. f = {fill: g, "fill-opacity": k, "stroke-width": f};
  5051. void 0 !== l && 0 < l && (f["stroke-dasharray"] = l);
  5052. isNaN(h) || (f["stroke-opacity"] = h);
  5053. e && (f.stroke = e);
  5054. e = "M" + Math.round(b[0]) + "," + Math.round(c[0]);
  5055. h = [];
  5056. for (l = 0; l < b.length; l++) h.push({x: Number(b[l]), y: Number(c[l])});
  5057. 1 < h.length && (b = this.interpolate(h), e += this.drawBeziers(b));
  5058. m ? e += m : d.VML || (e += "M0,0 L0,0");
  5059. this.path = a.path(e).attr(f);
  5060. this.node = this.path.node
  5061. }, interpolate: function (a) {
  5062. var b = [];
  5063. b.push({x: a[0].x, y: a[0].y});
  5064. var c = a[1].x - a[0].x, e = a[1].y - a[0].y, h = d.bezierX, f = d.bezierY;
  5065. b.push({x: a[0].x + c / h, y: a[0].y + e / f});
  5066. var g;
  5067. for (g = 1; g < a.length - 1; g++) {
  5068. var k = a[g - 1], l = a[g], e = a[g + 1];
  5069. isNaN(e.x) && (e = l);
  5070. isNaN(l.x) && (l = k);
  5071. isNaN(k.x) && (k = l);
  5072. c = e.x - l.x;
  5073. e = e.y - k.y;
  5074. k = l.x - k.x;
  5075. k > c && (k = c);
  5076. b.push({x: l.x - k / h, y: l.y - e / f});
  5077. b.push({x: l.x, y: l.y});
  5078. b.push({x: l.x + k / h, y: l.y + e / f})
  5079. }
  5080. e = a[a.length - 1].y - a[a.length - 2].y;
  5081. c = a[a.length - 1].x -
  5082. a[a.length - 2].x;
  5083. b.push({x: a[a.length - 1].x - c / h, y: a[a.length - 1].y - e / f});
  5084. b.push({x: a[a.length - 1].x, y: a[a.length - 1].y});
  5085. return b
  5086. }, drawBeziers: function (a) {
  5087. var b = "", c;
  5088. for (c = 0; c < (a.length - 1) / 3; c++) b += this.drawBezierMidpoint(a[3 * c], a[3 * c + 1], a[3 * c + 2], a[3 * c + 3]);
  5089. return b
  5090. }, drawBezierMidpoint: function (a, b, c, d) {
  5091. var h = Math.round, f = this.getPointOnSegment(a, b, .75), g = this.getPointOnSegment(d, c, .75),
  5092. k = (d.x - a.x) / 16, l = (d.y - a.y) / 16, m = this.getPointOnSegment(a, b, .375);
  5093. a = this.getPointOnSegment(f, g, .375);
  5094. a.x -= k;
  5095. a.y -= l;
  5096. b = this.getPointOnSegment(g,
  5097. f, .375);
  5098. b.x += k;
  5099. b.y += l;
  5100. c = this.getPointOnSegment(d, c, .375);
  5101. k = this.getMiddle(m, a);
  5102. f = this.getMiddle(f, g);
  5103. g = this.getMiddle(b, c);
  5104. m = " Q" + h(m.x) + "," + h(m.y) + "," + h(k.x) + "," + h(k.y);
  5105. m += " Q" + h(a.x) + "," + h(a.y) + "," + h(f.x) + "," + h(f.y);
  5106. m += " Q" + h(b.x) + "," + h(b.y) + "," + h(g.x) + "," + h(g.y);
  5107. return m += " Q" + h(c.x) + "," + h(c.y) + "," + h(d.x) + "," + h(d.y)
  5108. }, getMiddle: function (a, b) {
  5109. return {x: (a.x + b.x) / 2, y: (a.y + b.y) / 2}
  5110. }, getPointOnSegment: function (a, b, c) {
  5111. return {x: a.x + (b.x - a.x) * c, y: a.y + (b.y - a.y) * c}
  5112. }
  5113. })
  5114. })();
  5115. (function () {
  5116. var d = window.AmCharts;
  5117. d.AmDraw = d.Class({
  5118. construct: function (a, b, c, e) {
  5119. d.SVG_NS = "http://www.w3.org/2000/svg";
  5120. d.SVG_XLINK = "http://www.w3.org/1999/xlink";
  5121. d.hasSVG = !!document.createElementNS && !!document.createElementNS(d.SVG_NS, "svg").createSVGRect;
  5122. 1 > b && (b = 10);
  5123. 1 > c && (c = 10);
  5124. this.div = a;
  5125. this.width = b;
  5126. this.height = c;
  5127. this.rBin = document.createElement("div");
  5128. d.hasSVG ? (d.SVG = !0, b = this.createSvgElement("svg"), a.appendChild(b), this.container = b, this.addDefs(e), this.R = new d.SVGRenderer(this)) : d.isIE && d.VMLRenderer &&
  5129. (d.VML = !0, d.vmlStyleSheet || (document.namespaces.add("amvml", "urn:schemas-microsoft-com:vml"), 31 > document.styleSheets.length ? (b = document.createStyleSheet(), b.addRule(".amvml", "behavior:url(#default#VML); display:inline-block; antialias:true"), d.vmlStyleSheet = b) : document.styleSheets[0].addRule(".amvml", "behavior:url(#default#VML); display:inline-block; antialias:true")), this.container = a, this.R = new d.VMLRenderer(this, e), this.R.disableSelection(a))
  5130. }, createSvgElement: function (a) {
  5131. return document.createElementNS(d.SVG_NS,
  5132. a)
  5133. }, circle: function (a, b, c, e) {
  5134. var h = new d.AmDObject("circle", this);
  5135. h.attr({r: c, cx: a, cy: b});
  5136. this.addToContainer(h.node, e);
  5137. return h
  5138. }, ellipse: function (a, b, c, e, h) {
  5139. var f = new d.AmDObject("ellipse", this);
  5140. f.attr({rx: c, ry: e, cx: a, cy: b});
  5141. this.addToContainer(f.node, h);
  5142. return f
  5143. }, setSize: function (a, b) {
  5144. 0 < a && 0 < b && (this.container.style.width = a + "px", this.container.style.height = b + "px")
  5145. }, rect: function (a, b, c, e, h, f, g) {
  5146. var k = new d.AmDObject("rect", this);
  5147. d.VML && (h = Math.round(100 * h / Math.min(c, e)), c += 2 * f, e += 2 * f, k.bw = f, k.node.style.marginLeft =
  5148. -f, k.node.style.marginTop = -f);
  5149. 1 > c && (c = 1);
  5150. 1 > e && (e = 1);
  5151. k.attr({x: a, y: b, width: c, height: e, rx: h, ry: h, "stroke-width": f});
  5152. this.addToContainer(k.node, g);
  5153. return k
  5154. }, image: function (a, b, c, e, h, f) {
  5155. var g = new d.AmDObject("image", this);
  5156. g.attr({x: b, y: c, width: e, height: h});
  5157. this.R.path(g, a);
  5158. this.addToContainer(g.node, f);
  5159. return g
  5160. }, addToContainer: function (a, b) {
  5161. b || (b = this.container);
  5162. b.appendChild(a)
  5163. }, text: function (a, b, c) {
  5164. return this.R.text(a, b, c)
  5165. }, path: function (a, b, c, e) {
  5166. var h = new d.AmDObject("path", this);
  5167. e || (e = "100,100");
  5168. h.attr({cs: e});
  5169. c ? h.attr({dd: a}) : h.attr({d: a});
  5170. this.addToContainer(h.node, b);
  5171. return h
  5172. }, set: function (a) {
  5173. return this.R.set(a)
  5174. }, remove: function (a) {
  5175. if (a) {
  5176. var b = this.rBin;
  5177. b.appendChild(a);
  5178. b.innerHTML = ""
  5179. }
  5180. }, renderFix: function () {
  5181. var a = this.container, b = a.style;
  5182. b.top = "0px";
  5183. b.left = "0px";
  5184. try {
  5185. var c = a.getBoundingClientRect(), d = c.left - Math.round(c.left), h = c.top - Math.round(c.top);
  5186. d && (b.left = d + "px");
  5187. h && (b.top = h + "px")
  5188. } catch (f) {
  5189. }
  5190. }, update: function () {
  5191. this.R.update()
  5192. }, addDefs: function (a) {
  5193. if (d.hasSVG) {
  5194. var b = this.createSvgElement("desc"),
  5195. c = this.container;
  5196. c.setAttribute("version", "1.1");
  5197. c.style.position = "absolute";
  5198. this.setSize(this.width, this.height);
  5199. d.rtl && (c.setAttribute("direction", "rtl"), c.style.left = "auto", c.style.right = "0px");
  5200. a && (a.addCodeCredits && b.appendChild(document.createTextNode("JavaScript chart by amCharts " + a.version)), c.appendChild(b), a.defs && (b = this.createSvgElement("defs"), c.appendChild(b), d.parseDefs(a.defs, b), this.defs = b))
  5201. }
  5202. }
  5203. })
  5204. })();
  5205. (function () {
  5206. var d = window.AmCharts;
  5207. d.AmDObject = d.Class({
  5208. construct: function (a, b) {
  5209. this.D = b;
  5210. this.R = b.R;
  5211. this.node = this.R.create(this, a);
  5212. this.y = this.x = 0;
  5213. this.scale = 1
  5214. }, attr: function (a) {
  5215. this.R.attr(this, a);
  5216. return this
  5217. }, getAttr: function (a) {
  5218. return this.node.getAttribute(a)
  5219. }, setAttr: function (a, b) {
  5220. this.R.setAttr(this, a, b);
  5221. return this
  5222. }, clipRect: function (a, b, c, d) {
  5223. this.R.clipRect(this, a, b, c, d)
  5224. }, translate: function (a, b, c, d) {
  5225. d || (a = Math.round(a), b = Math.round(b));
  5226. this.R.move(this, a, b, c);
  5227. this.x = a;
  5228. this.y = b;
  5229. this.scale =
  5230. c;
  5231. this.angle && this.rotate(this.angle)
  5232. }, rotate: function (a, b) {
  5233. this.R.rotate(this, a, b);
  5234. this.angle = a
  5235. }, animate: function (a, b, c) {
  5236. for (var e in a) if (a.hasOwnProperty(e)) {
  5237. var h = e, f = a[e];
  5238. c = d.getEffect(c);
  5239. this.R.animate(this, h, f, b, c)
  5240. }
  5241. }, push: function (a) {
  5242. if (a) {
  5243. var b = this.node;
  5244. b.appendChild(a.node);
  5245. var c = a.clipPath;
  5246. c && b.appendChild(c);
  5247. (a = a.grad) && b.appendChild(a)
  5248. }
  5249. }, text: function (a) {
  5250. this.R.setText(this, a)
  5251. }, remove: function () {
  5252. this.stop();
  5253. this.R.remove(this)
  5254. }, clear: function () {
  5255. var a = this.node;
  5256. if (a.hasChildNodes()) for (; 1 <=
  5257. a.childNodes.length;) a.removeChild(a.firstChild)
  5258. }, hide: function () {
  5259. this.setAttr("visibility", "hidden")
  5260. }, show: function () {
  5261. this.setAttr("visibility", "visible")
  5262. }, getBBox: function () {
  5263. return this.R.getBBox(this)
  5264. }, toFront: function () {
  5265. var a = this.node;
  5266. if (a) {
  5267. this.prevNextNode = a.nextSibling;
  5268. var b = a.parentNode;
  5269. b && b.appendChild(a)
  5270. }
  5271. }, toPrevious: function () {
  5272. var a = this.node;
  5273. a && this.prevNextNode && (a = a.parentNode) && a.insertBefore(this.prevNextNode, null)
  5274. }, toBack: function () {
  5275. var a = this.node;
  5276. if (a) {
  5277. this.prevNextNode = a.nextSibling;
  5278. var b = a.parentNode;
  5279. if (b) {
  5280. var c = b.firstChild;
  5281. c && b.insertBefore(a, c)
  5282. }
  5283. }
  5284. }, mouseover: function (a) {
  5285. this.R.addListener(this, "mouseover", a);
  5286. return this
  5287. }, mouseout: function (a) {
  5288. this.R.addListener(this, "mouseout", a);
  5289. return this
  5290. }, click: function (a) {
  5291. this.R.addListener(this, "click", a);
  5292. return this
  5293. }, dblclick: function (a) {
  5294. this.R.addListener(this, "dblclick", a);
  5295. return this
  5296. }, mousedown: function (a) {
  5297. this.R.addListener(this, "mousedown", a);
  5298. return this
  5299. }, mouseup: function (a) {
  5300. this.R.addListener(this, "mouseup", a);
  5301. return this
  5302. }, touchmove: function (a) {
  5303. this.R.addListener(this,
  5304. "touchmove", a);
  5305. return this
  5306. }, touchstart: function (a) {
  5307. this.R.addListener(this, "touchstart", a);
  5308. return this
  5309. }, touchend: function (a) {
  5310. this.R.addListener(this, "touchend", a);
  5311. return this
  5312. }, contextmenu: function (a) {
  5313. this.node.addEventListener ? this.node.addEventListener("contextmenu", a, !0) : this.R.addListener(this, "contextmenu", a);
  5314. return this
  5315. }, stop: function () {
  5316. d.removeFromArray(this.R.animations, this.an_translate);
  5317. d.removeFromArray(this.R.animations, this.an_y);
  5318. d.removeFromArray(this.R.animations, this.an_x)
  5319. }, length: function () {
  5320. return this.node.childNodes.length
  5321. },
  5322. gradient: function (a, b, c) {
  5323. this.R.gradient(this, a, b, c)
  5324. }, pattern: function (a, b, c) {
  5325. a && this.R.pattern(this, a, b, c)
  5326. }
  5327. })
  5328. })();
  5329. (function () {
  5330. var d = window.AmCharts;
  5331. d.VMLRenderer = d.Class({
  5332. construct: function (a, b) {
  5333. this.chart = b;
  5334. this.D = a;
  5335. this.cNames = {circle: "oval", ellipse: "oval", rect: "roundrect", path: "shape"};
  5336. this.styleMap = {
  5337. x: "left",
  5338. y: "top",
  5339. width: "width",
  5340. height: "height",
  5341. "font-family": "fontFamily",
  5342. "font-size": "fontSize",
  5343. visibility: "visibility"
  5344. }
  5345. }, create: function (a, b) {
  5346. var c;
  5347. if ("group" == b) c = document.createElement("div"), a.type = "div"; else if ("text" == b) c = document.createElement("div"), a.type = "text"; else if ("image" == b) c = document.createElement("img"),
  5348. a.type = "image"; else {
  5349. a.type = "shape";
  5350. a.shapeType = this.cNames[b];
  5351. c = document.createElement("amvml:" + this.cNames[b]);
  5352. var d = document.createElement("amvml:stroke");
  5353. c.appendChild(d);
  5354. a.stroke = d;
  5355. var h = document.createElement("amvml:fill");
  5356. c.appendChild(h);
  5357. a.fill = h;
  5358. h.className = "amvml";
  5359. d.className = "amvml";
  5360. c.className = "amvml"
  5361. }
  5362. c.style.position = "absolute";
  5363. c.style.top = 0;
  5364. c.style.left = 0;
  5365. return c
  5366. }, path: function (a, b) {
  5367. a.node.setAttribute("src", b)
  5368. }, setAttr: function (a, b, c) {
  5369. if (void 0 !== c) {
  5370. var e;
  5371. 8 === document.documentMode &&
  5372. (e = !0);
  5373. var h = a.node, f = a.type, g = h.style;
  5374. "r" == b && (g.width = 2 * c, g.height = 2 * c);
  5375. "oval" == a.shapeType && ("rx" == b && (g.width = 2 * c), "ry" == b && (g.height = 2 * c));
  5376. "roundrect" == a.shapeType && ("width" != b && "height" != b || --c);
  5377. "cursor" == b && (g.cursor = c);
  5378. "cx" == b && (g.left = c - d.removePx(g.width) / 2);
  5379. "cy" == b && (g.top = c - d.removePx(g.height) / 2);
  5380. var k = this.styleMap[b];
  5381. "width" == k && 0 > c && (c = 0);
  5382. void 0 !== k && (g[k] = c);
  5383. "text" == f && ("text-anchor" == b && (a.anchor = c, k = h.clientWidth, "end" == c && (g.marginLeft = -k + "px"), "middle" == c && (g.marginLeft = -(k / 2) +
  5384. "px", g.textAlign = "center"), "start" == c && (g.marginLeft = "0px")), "fill" == b && (g.color = c), "font-weight" == b && (g.fontWeight = c));
  5385. if (g = a.children) for (k = 0; k < g.length; k++) g[k].setAttr(b, c);
  5386. if ("shape" == f) {
  5387. "cs" == b && (h.style.width = "100px", h.style.height = "100px", h.setAttribute("coordsize", c));
  5388. "d" == b && h.setAttribute("path", this.svgPathToVml(c));
  5389. "dd" == b && h.setAttribute("path", c);
  5390. f = a.stroke;
  5391. a = a.fill;
  5392. "stroke" == b && (e ? f.color = c : f.setAttribute("color", c));
  5393. "stroke-width" == b && (e ? f.weight = c : f.setAttribute("weight", c));
  5394. "stroke-opacity" ==
  5395. b && (e ? f.opacity = c : f.setAttribute("opacity", c));
  5396. "stroke-dasharray" == b && (g = "solid", 0 < c && 3 > c && (g = "dot"), 3 <= c && 6 >= c && (g = "dash"), 6 < c && (g = "longdash"), e ? f.dashstyle = g : f.setAttribute("dashstyle", g));
  5397. if ("fill-opacity" == b || "opacity" == b) 0 === c ? e ? a.on = !1 : a.setAttribute("on", !1) : e ? a.opacity = c : a.setAttribute("opacity", c);
  5398. "fill" == b && (e ? a.color = c : a.setAttribute("color", c));
  5399. "rx" == b && (e ? h.arcSize = c + "%" : h.setAttribute("arcsize", c + "%"))
  5400. }
  5401. }
  5402. }, attr: function (a, b) {
  5403. for (var c in b) b.hasOwnProperty(c) && this.setAttr(a, c, b[c])
  5404. },
  5405. text: function (a, b, c) {
  5406. var e = new d.AmDObject("text", this.D), h = e.node;
  5407. h.style.whiteSpace = "pre";
  5408. h.innerHTML = a;
  5409. this.D.addToContainer(h, c);
  5410. this.attr(e, b);
  5411. return e
  5412. }, getBBox: function (a) {
  5413. return this.getBox(a.node)
  5414. }, getBox: function (a) {
  5415. var b = a.offsetLeft, c = a.offsetTop, d = a.offsetWidth, h = a.offsetHeight, f;
  5416. if (a.hasChildNodes()) {
  5417. var g, k, l;
  5418. for (l = 0; l < a.childNodes.length; l++) {
  5419. f = this.getBox(a.childNodes[l]);
  5420. var m = f.x;
  5421. isNaN(m) || (isNaN(g) ? g = m : m < g && (g = m));
  5422. var n = f.y;
  5423. isNaN(n) || (isNaN(k) ? k = n : n < k && (k = n));
  5424. m = f.width + m;
  5425. isNaN(m) ||
  5426. (d = Math.max(d, m));
  5427. f = f.height + n;
  5428. isNaN(f) || (h = Math.max(h, f))
  5429. }
  5430. 0 > g && (b += g);
  5431. 0 > k && (c += k)
  5432. }
  5433. return {x: b, y: c, width: d, height: h}
  5434. }, setText: function (a, b) {
  5435. var c = a.node;
  5436. c && (c.innerHTML = b);
  5437. this.setAttr(a, "text-anchor", a.anchor)
  5438. }, addListener: function (a, b, c) {
  5439. a.node["on" + b] = c
  5440. }, move: function (a, b, c) {
  5441. var e = a.node, h = e.style;
  5442. "text" == a.type && (c -= d.removePx(h.fontSize) / 2 - 1);
  5443. "oval" == a.shapeType && (b -= d.removePx(h.width) / 2, c -= d.removePx(h.height) / 2);
  5444. a = a.bw;
  5445. isNaN(a) || (b -= a, c -= a);
  5446. isNaN(b) || isNaN(c) || (e.style.left = b + "px", e.style.top =
  5447. c + "px")
  5448. }, svgPathToVml: function (a) {
  5449. var b = a.split(" ");
  5450. a = "";
  5451. var c, d = Math.round, h;
  5452. for (h = 0; h < b.length; h++) {
  5453. var f = b[h], g = f.substring(0, 1), f = f.substring(1), k = f.split(","), l = d(k[0]) + "," + d(k[1]);
  5454. "M" == g && (a += " m " + l);
  5455. "L" == g && (a += " l " + l);
  5456. "Z" == g && (a += " x e");
  5457. if ("Q" == g) {
  5458. var m = c.length, n = c[m - 1], q = k[0], p = k[1], l = k[2], t = k[3];
  5459. c = d(c[m - 2] / 3 + 2 / 3 * q);
  5460. n = d(n / 3 + 2 / 3 * p);
  5461. q = d(2 / 3 * q + l / 3);
  5462. p = d(2 / 3 * p + t / 3);
  5463. a += " c " + c + "," + n + "," + q + "," + p + "," + l + "," + t
  5464. }
  5465. "A" == g && (a += " wa " + f);
  5466. "B" == g && (a += " at " + f);
  5467. c = k
  5468. }
  5469. return a
  5470. }, animate: function (a, b, c, d,
  5471. h) {
  5472. var f = a.node, g = this.chart;
  5473. a.animationFinished = !1;
  5474. if ("translate" == b) {
  5475. b = c.split(",");
  5476. c = b[1];
  5477. var k = f.offsetTop;
  5478. g.animate(a, "left", f.offsetLeft, b[0], d, h, "px");
  5479. g.animate(a, "top", k, c, d, h, "px")
  5480. }
  5481. }, clipRect: function (a, b, c, d, h) {
  5482. a = a.node;
  5483. 0 === b && 0 === c ? (a.style.width = d + "px", a.style.height = h + "px", a.style.overflow = "hidden") : a.style.clip = "rect(" + c + "px " + (b + d) + "px " + (c + h) + "px " + b + "px)"
  5484. }, rotate: function (a, b, c) {
  5485. if (0 !== Number(b)) {
  5486. var e = a.node;
  5487. a = e.style;
  5488. c || (c = this.getBGColor(e.parentNode));
  5489. a.backgroundColor = c;
  5490. a.paddingLeft =
  5491. 1;
  5492. c = b * Math.PI / 180;
  5493. var h = Math.cos(c), f = Math.sin(c), g = d.removePx(a.left), k = d.removePx(a.top), l = e.offsetWidth,
  5494. e = e.offsetHeight;
  5495. b /= Math.abs(b);
  5496. a.left = g + l / 2 - l / 2 * Math.cos(c) - b * e / 2 * Math.sin(c) + 3;
  5497. a.top = k - b * l / 2 * Math.sin(c) + b * e / 2 * Math.sin(c);
  5498. a.cssText = a.cssText + "; filter:progid:DXImageTransform.Microsoft.Matrix(M11='" + h + "', M12='" + -f + "', M21='" + f + "', M22='" + h + "', sizingmethod='auto expand');"
  5499. }
  5500. }, getBGColor: function (a) {
  5501. var b = "#FFFFFF";
  5502. if (a.style) {
  5503. var c = a.style.backgroundColor;
  5504. "" !== c ? b = c : a.parentNode && (b = this.getBGColor(a.parentNode))
  5505. }
  5506. return b
  5507. },
  5508. set: function (a) {
  5509. var b = new d.AmDObject("group", this.D);
  5510. this.D.container.appendChild(b.node);
  5511. if (a) {
  5512. var c;
  5513. for (c = 0; c < a.length; c++) b.push(a[c])
  5514. }
  5515. return b
  5516. }, gradient: function (a, b, c, d) {
  5517. var h = "";
  5518. "radialGradient" == b && (b = "gradientradial", c.reverse());
  5519. "linearGradient" == b && (b = "gradient");
  5520. var f;
  5521. for (f = 0; f < c.length; f++) h += Math.round(100 * f / (c.length - 1)) + "% " + c[f], f < c.length - 1 && (h += ",");
  5522. a = a.fill;
  5523. 90 == d ? d = 0 : 270 == d ? d = 180 : 180 == d ? d = 90 : 0 === d && (d = 270);
  5524. 8 === document.documentMode ? (a.type = b, a.angle = d) : (a.setAttribute("type", b),
  5525. a.setAttribute("angle", d));
  5526. h && (a.colors.value = h)
  5527. }, remove: function (a) {
  5528. a.clipPath && this.D.remove(a.clipPath);
  5529. this.D.remove(a.node)
  5530. }, disableSelection: function (a) {
  5531. void 0 !== typeof a.onselectstart && (a.onselectstart = function () {
  5532. return !1
  5533. });
  5534. a.style.cursor = "default"
  5535. }, pattern: function (a, b, c, e) {
  5536. c = a.node;
  5537. a = a.fill;
  5538. var h = "none";
  5539. b.color && (h = b.color);
  5540. c.fillColor = h;
  5541. b = b.url;
  5542. d.isAbsolute(b) || (b = e + b);
  5543. 8 === document.documentMode ? (a.type = "tile", a.src = b) : (a.setAttribute("type", "tile"), a.setAttribute("src", b))
  5544. }, update: function () {
  5545. }
  5546. })
  5547. })();
  5548. (function () {
  5549. var d = window.AmCharts;
  5550. d.SVGRenderer = d.Class({
  5551. construct: function (a) {
  5552. this.D = a;
  5553. this.animations = []
  5554. }, create: function (a, b) {
  5555. return document.createElementNS(d.SVG_NS, b)
  5556. }, attr: function (a, b) {
  5557. for (var c in b) b.hasOwnProperty(c) && this.setAttr(a, c, b[c])
  5558. }, setAttr: function (a, b, c) {
  5559. void 0 !== c && a.node.setAttribute(b, c)
  5560. }, animate: function (a, b, c, e, h) {
  5561. a.animationFinished = !1;
  5562. var f = a.node;
  5563. a["an_" + b] && d.removeFromArray(this.animations, a["an_" + b]);
  5564. "translate" == b ? (f = (f = f.getAttribute("transform")) ? String(f).substring(10,
  5565. f.length - 1) : "0,0", f = f.split(", ").join(" "), f = f.split(" ").join(","), 0 === f && (f = "0,0")) : f = Number(f.getAttribute(b));
  5566. c = {obj: a, frame: 0, attribute: b, from: f, to: c, time: e, effect: h};
  5567. this.animations.push(c);
  5568. a["an_" + b] = c
  5569. }, update: function () {
  5570. var a, b = this.animations;
  5571. for (a = b.length - 1; 0 <= a; a--) {
  5572. var c = b[a], e = c.time * d.updateRate, h = c.frame + 1, f = c.obj, g = c.attribute, k, l, m;
  5573. h <= e ? (c.frame++, "translate" == g ? (k = c.from.split(","), g = Number(k[0]), k = Number(k[1]), isNaN(k) && (k = 0), l = c.to.split(","), m = Number(l[0]), l = Number(l[1]), m =
  5574. 0 === m - g ? m : Math.round(d[c.effect](0, h, g, m - g, e)), c = 0 === l - k ? l : Math.round(d[c.effect](0, h, k, l - k, e)), g = "transform", c = "translate(" + m + "," + c + ")") : (l = Number(c.from), k = Number(c.to), m = k - l, c = d[c.effect](0, h, l, m, e), isNaN(c) && (c = k), 0 === m && this.animations.splice(a, 1)), this.setAttr(f, g, c)) : ("translate" == g ? (l = c.to.split(","), m = Number(l[0]), l = Number(l[1]), f.translate(m, l)) : (k = Number(c.to), this.setAttr(f, g, k)), f.animationFinished = !0, this.animations.splice(a, 1))
  5575. }
  5576. }, getBBox: function (a) {
  5577. if (a = a.node) try {
  5578. return a.getBBox()
  5579. } catch (b) {
  5580. }
  5581. return {
  5582. width: 0,
  5583. height: 0, x: 0, y: 0
  5584. }
  5585. }, path: function (a, b) {
  5586. a.node.setAttributeNS(d.SVG_XLINK, "xlink:href", b)
  5587. }, clipRect: function (a, b, c, e, h) {
  5588. var f = a.node, g = a.clipPath;
  5589. g && this.D.remove(g);
  5590. var k = f.parentNode;
  5591. k && (f = document.createElementNS(d.SVG_NS, "clipPath"), g = d.getUniqueId(), f.setAttribute("id", g), this.D.rect(b, c, e, h, 0, 0, f), k.appendChild(f), b = "#", d.baseHref && !d.isIE && (b = this.removeTarget(window.location.href) + b), this.setAttr(a, "clip-path", "url(" + b + g + ")"), this.clipPathC++, a.clipPath = f)
  5592. }, text: function (a, b, c) {
  5593. var e = new d.AmDObject("text",
  5594. this.D);
  5595. a = String(a).split("\n");
  5596. var h = d.removePx(b["font-size"]), f;
  5597. for (f = 0; f < a.length; f++) {
  5598. var g = this.create(null, "tspan");
  5599. g.appendChild(document.createTextNode(a[f]));
  5600. g.setAttribute("y", (h + 2) * f + Math.round(h / 2));
  5601. g.setAttribute("x", 0);
  5602. e.node.appendChild(g)
  5603. }
  5604. e.node.setAttribute("y", Math.round(h / 2));
  5605. this.attr(e, b);
  5606. this.D.addToContainer(e.node, c);
  5607. return e
  5608. }, setText: function (a, b) {
  5609. var c = a.node;
  5610. c && (c.removeChild(c.firstChild), c.appendChild(document.createTextNode(b)))
  5611. }, move: function (a, b, c, d) {
  5612. isNaN(b) && (b =
  5613. 0);
  5614. isNaN(c) && (c = 0);
  5615. b = "translate(" + b + "," + c + ")";
  5616. d && (b = b + " scale(" + d + ")");
  5617. this.setAttr(a, "transform", b)
  5618. }, rotate: function (a, b) {
  5619. var c = a.node.getAttribute("transform"), d = "rotate(" + b + ")";
  5620. c && (d = c + " " + d);
  5621. this.setAttr(a, "transform", d)
  5622. }, set: function (a) {
  5623. var b = new d.AmDObject("g", this.D);
  5624. this.D.container.appendChild(b.node);
  5625. if (a) {
  5626. var c;
  5627. for (c = 0; c < a.length; c++) b.push(a[c])
  5628. }
  5629. return b
  5630. }, addListener: function (a, b, c) {
  5631. a.node["on" + b] = c
  5632. }, gradient: function (a, b, c, e) {
  5633. var h = a.node, f = a.grad;
  5634. f && this.D.remove(f);
  5635. b = document.createElementNS(d.SVG_NS,
  5636. b);
  5637. f = d.getUniqueId();
  5638. b.setAttribute("id", f);
  5639. if (!isNaN(e)) {
  5640. var g = 0, k = 0, l = 0, m = 0;
  5641. 90 == e ? l = 100 : 270 == e ? m = 100 : 180 == e ? g = 100 : 0 === e && (k = 100);
  5642. b.setAttribute("x1", g + "%");
  5643. b.setAttribute("x2", k + "%");
  5644. b.setAttribute("y1", l + "%");
  5645. b.setAttribute("y2", m + "%")
  5646. }
  5647. for (e = 0; e < c.length; e++) g = document.createElementNS(d.SVG_NS, "stop"), k = 100 * e / (c.length - 1), 0 === e && (k = 0), g.setAttribute("offset", k + "%"), g.setAttribute("stop-color", c[e]), b.appendChild(g);
  5648. h.parentNode.appendChild(b);
  5649. c = "#";
  5650. d.baseHref && !d.isIE && (c = this.removeTarget(window.location.href) +
  5651. c);
  5652. h.setAttribute("fill", "url(" + c + f + ")");
  5653. a.grad = b
  5654. }, removeTarget: function (a) {
  5655. return a.split("#")[0]
  5656. }, pattern: function (a, b, c, e) {
  5657. var h = a.node;
  5658. isNaN(c) && (c = 1);
  5659. var f = a.patternNode;
  5660. f && this.D.remove(f);
  5661. var f = document.createElementNS(d.SVG_NS, "pattern"), g = d.getUniqueId(), k = b;
  5662. b.url && (k = b.url);
  5663. d.isAbsolute(k) || (k = e + k);
  5664. e = Number(b.width);
  5665. isNaN(e) && (e = 4);
  5666. var l = Number(b.height);
  5667. isNaN(l) && (l = 4);
  5668. e /= c;
  5669. l /= c;
  5670. c = b.x;
  5671. isNaN(c) && (c = 0);
  5672. var m = -Math.random() * Number(b.randomX);
  5673. isNaN(m) || (c = m);
  5674. m = b.y;
  5675. isNaN(m) && (m = 0);
  5676. var n = -Math.random() *
  5677. Number(b.randomY);
  5678. isNaN(n) || (m = n);
  5679. f.setAttribute("id", g);
  5680. f.setAttribute("width", e);
  5681. f.setAttribute("height", l);
  5682. f.setAttribute("patternUnits", "userSpaceOnUse");
  5683. f.setAttribute("xlink:href", k);
  5684. b.color && (n = document.createElementNS(d.SVG_NS, "rect"), n.setAttributeNS(null, "height", e), n.setAttributeNS(null, "width", l), n.setAttributeNS(null, "fill", b.color), f.appendChild(n));
  5685. this.D.image(k, 0, 0, e, l, f).translate(c, m);
  5686. k = "#";
  5687. d.baseHref && !d.isIE && (k = this.removeTarget(window.location.href) + k);
  5688. h.setAttribute("fill",
  5689. "url(" + k + g + ")");
  5690. a.patternNode = f;
  5691. h.parentNode.appendChild(f)
  5692. }, remove: function (a) {
  5693. a.clipPath && this.D.remove(a.clipPath);
  5694. a.grad && this.D.remove(a.grad);
  5695. a.patternNode && this.D.remove(a.patternNode);
  5696. this.D.remove(a.node)
  5697. }
  5698. })
  5699. })();
  5700. (function () {
  5701. var d = window.AmCharts;
  5702. d.AmLegend = d.Class({
  5703. construct: function (a) {
  5704. this.enabled = !0;
  5705. this.cname = "AmLegend";
  5706. this.createEvents("rollOverMarker", "rollOverItem", "rollOutMarker", "rollOutItem", "showItem", "hideItem", "clickMarker", "rollOverItem", "rollOutItem", "clickLabel");
  5707. this.position = "bottom";
  5708. this.borderColor = this.color = "#052963";
  5709. this.borderAlpha = 0;
  5710. this.markerLabelGap = 5;
  5711. this.verticalGap = 10;
  5712. this.align = "left";
  5713. this.horizontalGap = 0;
  5714. this.spacing = 10;
  5715. this.markerDisabledColor = "#AAB3B3";
  5716. this.markerType =
  5717. "square";
  5718. this.markerSize = 16;
  5719. this.markerBorderThickness = this.markerBorderAlpha = 1;
  5720. this.marginBottom = this.marginTop = 0;
  5721. this.marginLeft = this.marginRight = 20;
  5722. this.autoMargins = !0;
  5723. this.valueWidth = 50;
  5724. this.switchable = !0;
  5725. this.switchType = "x";
  5726. this.switchColor = "#FFFFFF";
  5727. this.rollOverColor = "#CC0000";
  5728. this.reversedOrder = !1;
  5729. this.labelText = "[[title]]";
  5730. this.valueText = "[[value]]";
  5731. this.useMarkerColorForLabels = !1;
  5732. this.rollOverGraphAlpha = 1;
  5733. this.textClickEnabled = !1;
  5734. this.equalWidths = !0;
  5735. this.backgroundColor = "#FFFFFF";
  5736. this.backgroundAlpha =
  5737. 0;
  5738. this.useGraphSettings = !1;
  5739. this.showEntries = !0;
  5740. d.applyTheme(this, a, this.cname)
  5741. }, setData: function (a) {
  5742. this.legendData = a;
  5743. this.invalidateSize()
  5744. }, invalidateSize: function () {
  5745. this.destroy();
  5746. this.entries = [];
  5747. this.valueLabels = [];
  5748. var a = this.legendData;
  5749. this.enabled && (d.ifArray(a) || d.ifArray(this.data)) && this.drawLegend()
  5750. }, drawLegend: function () {
  5751. var a = this.chart, b = this.position, c = this.width, e = a.divRealWidth, h = a.divRealHeight,
  5752. f = this.div, g = this.legendData;
  5753. this.data && (g = this.data);
  5754. isNaN(this.fontSize) && (this.fontSize =
  5755. a.fontSize);
  5756. if ("right" == b || "left" == b) this.maxColumns = 1, this.autoMargins && (this.marginLeft = this.marginRight = 10); else if (this.autoMargins) {
  5757. this.marginRight = a.marginRight;
  5758. this.marginLeft = a.marginLeft;
  5759. var k = a.autoMarginOffset;
  5760. "bottom" == b ? (this.marginBottom = k, this.marginTop = 0) : (this.marginTop = k, this.marginBottom = 0)
  5761. }
  5762. c = void 0 !== c ? d.toCoordinate(c, e) : "right" != b && "left" != b ? a.realWidth : 0 < this.ieW ? this.ieW : a.realWidth;
  5763. "outside" == b ? (c = f.offsetWidth, h = f.offsetHeight, f.clientHeight && (c = f.clientWidth, h = f.clientHeight)) :
  5764. (isNaN(c) || (f.style.width = c + "px"), f.className = "amChartsLegend " + a.classNamePrefix + "-legend-div");
  5765. this.divWidth = c;
  5766. (b = this.container) ? (b.container.innerHTML = "", f.appendChild(b.container), b.width = c, b.height = h, b.setSize(c, h), b.addDefs(a)) : b = new d.AmDraw(f, c, h, a);
  5767. this.container = b;
  5768. this.lx = 0;
  5769. this.ly = 8;
  5770. h = this.markerSize;
  5771. h > this.fontSize && (this.ly = h / 2 - 1);
  5772. 0 < h && (this.lx += h + this.markerLabelGap);
  5773. this.titleWidth = 0;
  5774. if (h = this.title) h = d.text(this.container, h, this.color, a.fontFamily, this.fontSize, "start", !0), d.setCN(a,
  5775. h, "legend-title"), h.translate(this.marginLeft, this.marginTop + this.verticalGap + this.ly + 1), a = h.getBBox(), this.titleWidth = a.width + 15, this.titleHeight = a.height + 6;
  5776. this.index = this.maxLabelWidth = 0;
  5777. if (this.showEntries) {
  5778. for (a = 0; a < g.length; a++) this.createEntry(g[a]);
  5779. for (a = this.index = 0; a < g.length; a++) this.createValue(g[a])
  5780. }
  5781. this.arrangeEntries();
  5782. this.updateValues()
  5783. }, arrangeEntries: function () {
  5784. var a = this.position, b = this.marginLeft + this.titleWidth, c = this.marginRight, e = this.marginTop,
  5785. h = this.marginBottom, f = this.horizontalGap,
  5786. g = this.div, k = this.divWidth, l = this.maxColumns, m = this.verticalGap, n = this.spacing,
  5787. q = k - c - b, p = 0, t = 0, r = this.container;
  5788. this.set && this.set.remove();
  5789. var u = r.set();
  5790. this.set = u;
  5791. var y = r.set();
  5792. u.push(y);
  5793. var x = this.entries, w, B;
  5794. for (B = 0; B < x.length; B++) {
  5795. w = x[B].getBBox();
  5796. var z = w.width;
  5797. z > p && (p = z);
  5798. w = w.height;
  5799. w > t && (t = w)
  5800. }
  5801. var z = t = 0, A = f, C = 0, D = 0;
  5802. for (B = 0; B < x.length; B++) {
  5803. var J = x[B];
  5804. this.reversedOrder && (J = x[x.length - B - 1]);
  5805. w = J.getBBox();
  5806. var H;
  5807. this.equalWidths ? H = z * (p + n + this.markerLabelGap) : (H = A, A = A + w.width + f + n);
  5808. w.height > D && (D =
  5809. w.height);
  5810. H + w.width > q && 0 < B && 0 !== z && (t++, H = z = 0, A = H + w.width + f + n, C = C + D + m, D = 0);
  5811. J.translate(H, C);
  5812. z++;
  5813. !isNaN(l) && z >= l && (z = 0, t++, C = C + D + m, A = f, D = 0);
  5814. y.push(J)
  5815. }
  5816. w = y.getBBox();
  5817. l = w.height + 2 * m - 1;
  5818. "left" == a || "right" == a ? (n = w.width + 2 * f, k = n + b + c, g.style.width = k + "px", this.ieW = k) : n = k - b - c - 1;
  5819. c = d.polygon(this.container, [0, n, n, 0], [0, 0, l, l], this.backgroundColor, this.backgroundAlpha, 1, this.borderColor, this.borderAlpha);
  5820. d.setCN(this.chart, c, "legend-bg");
  5821. u.push(c);
  5822. u.translate(b, e);
  5823. c.toBack();
  5824. b = f;
  5825. if ("top" == a || "bottom" == a || "absolute" ==
  5826. a || "outside" == a) "center" == this.align ? b = f + (n - w.width) / 2 : "right" == this.align && (b = f + n - w.width);
  5827. y.translate(b, m + 1);
  5828. this.titleHeight > l && (l = this.titleHeight);
  5829. a = l + e + h + 1;
  5830. 0 > a && (a = 0);
  5831. a > this.chart.divRealHeight && (g.style.top = "0px");
  5832. g.style.height = Math.round(a) + "px";
  5833. r.setSize(this.divWidth, a)
  5834. }, createEntry: function (a) {
  5835. if (!1 !== a.visibleInLegend && !a.hideFromLegend) {
  5836. var b = this.chart, c = a.markerType;
  5837. a.legendEntryWidth = this.markerSize;
  5838. c || (c = this.markerType);
  5839. var e = a.color, h = a.alpha;
  5840. a.legendKeyColor && (e = a.legendKeyColor());
  5841. a.legendKeyAlpha && (h = a.legendKeyAlpha());
  5842. var f;
  5843. !0 === a.hidden && (f = e = this.markerDisabledColor);
  5844. var g = a.pattern, k = a.customMarker;
  5845. k || (k = this.customMarker);
  5846. var l = this.container, m = this.markerSize, n = 0, q = 0, p = m / 2;
  5847. if (this.useGraphSettings) {
  5848. c = a.type;
  5849. this.switchType = void 0;
  5850. if ("line" == c || "step" == c || "smoothedLine" == c || "ohlc" == c) g = l.set(), a.hidden || (e = a.lineColorR, f = a.bulletBorderColorR), n = d.line(l, [0, 2 * m], [m / 2, m / 2], e, a.lineAlpha, a.lineThickness, a.dashLength), d.setCN(b, n, "graph-stroke"), g.push(n), a.bullet && (a.hidden ||
  5851. (e = a.bulletColorR), n = d.bullet(l, a.bullet, a.bulletSize, e, a.bulletAlpha, a.bulletBorderThickness, f, a.bulletBorderAlpha)) && (d.setCN(b, n, "graph-bullet"), n.translate(m + 1, m / 2), g.push(n)), p = 0, n = m, q = m / 3; else {
  5852. var t;
  5853. a.getGradRotation && (t = a.getGradRotation(), 0 === t && (t = 180));
  5854. n = a.fillColorsR;
  5855. !0 === a.hidden && (n = e);
  5856. if (g = this.createMarker("rectangle", n, a.fillAlphas, a.lineThickness, e, a.lineAlpha, t, g, a.dashLength)) p = m, g.translate(p, m / 2);
  5857. n = m
  5858. }
  5859. d.setCN(b, g, "graph-" + c);
  5860. d.setCN(b, g, "graph-" + a.id)
  5861. } else if (k) g = l.image(k, 0, 0,
  5862. m, m); else {
  5863. var r;
  5864. isNaN(this.gradientRotation) || (r = 180 + this.gradientRotation);
  5865. (g = this.createMarker(c, e, h, void 0, void 0, void 0, r, g)) && g.translate(m / 2, m / 2)
  5866. }
  5867. d.setCN(b, g, "legend-marker");
  5868. this.addListeners(g, a);
  5869. l = l.set([g]);
  5870. this.switchable && a.switchable && l.setAttr("cursor", "pointer");
  5871. void 0 !== a.id && d.setCN(b, l, "legend-item-" + a.id);
  5872. d.setCN(b, l, a.className, !0);
  5873. (f = this.switchType) && "none" != f && 0 < m && ("x" == f ? (t = this.createX(), t.translate(m / 2, m / 2)) : t = this.createV(), t.dItem = a, !0 !== a.hidden ? "x" == f ? t.hide() : t.show() :
  5874. "x" != f && t.hide(), this.switchable || t.hide(), this.addListeners(t, a), a.legendSwitch = t, l.push(t), d.setCN(b, t, "legend-switch"));
  5875. f = this.color;
  5876. a.showBalloon && this.textClickEnabled && void 0 !== this.selectedColor && (f = this.selectedColor);
  5877. this.useMarkerColorForLabels && (f = e);
  5878. !0 === a.hidden && (f = this.markerDisabledColor);
  5879. e = d.massReplace(this.labelText, {"[[title]]": a.title});
  5880. t = this.fontSize;
  5881. g && (m <= t && g.translate(p, m / 2 + this.ly - t / 2 + (t + 2 - m) / 2 - q), a.legendEntryWidth = g.getBBox().width);
  5882. var u;
  5883. e && (e = d.fixBrakes(e), a.legendTextReal =
  5884. e, u = this.labelWidth, u = isNaN(u) ? d.text(this.container, e, f, b.fontFamily, t, "start") : d.wrappedText(this.container, e, f, b.fontFamily, t, "start", !1, u, 0), d.setCN(b, u, "legend-label"), u.translate(this.lx + n, this.ly), l.push(u), b = u.getBBox().width, this.maxLabelWidth < b && (this.maxLabelWidth = b));
  5885. this.entries[this.index] = l;
  5886. a.legendEntry = this.entries[this.index];
  5887. a.legendLabel = u;
  5888. this.index++
  5889. }
  5890. }, addListeners: function (a, b) {
  5891. var c = this;
  5892. a && a.mouseover(function (a) {
  5893. c.rollOverMarker(b, a)
  5894. }).mouseout(function (a) {
  5895. c.rollOutMarker(b,
  5896. a)
  5897. }).click(function (a) {
  5898. c.clickMarker(b, a)
  5899. })
  5900. }, rollOverMarker: function (a, b) {
  5901. this.switchable && this.dispatch("rollOverMarker", a, b);
  5902. this.dispatch("rollOverItem", a, b)
  5903. }, rollOutMarker: function (a, b) {
  5904. this.switchable && this.dispatch("rollOutMarker", a, b);
  5905. this.dispatch("rollOutItem", a, b)
  5906. }, clickMarker: function (a, b) {
  5907. this.switchable && (!0 === a.hidden ? this.dispatch("showItem", a, b) : this.dispatch("hideItem", a, b));
  5908. this.dispatch("clickMarker", a, b)
  5909. }, rollOverLabel: function (a, b) {
  5910. a.hidden || (this.textClickEnabled && a.legendLabel &&
  5911. a.legendLabel.attr({fill: this.rollOverColor}), this.dispatch("rollOverItem", a, b))
  5912. }, rollOutLabel: function (a, b) {
  5913. if (!a.hidden) {
  5914. if (this.textClickEnabled && a.legendLabel) {
  5915. var c = this.color;
  5916. void 0 !== this.selectedColor && a.showBalloon && (c = this.selectedColor);
  5917. this.useMarkerColorForLabels && (c = a.lineColor, void 0 === c && (c = a.color));
  5918. a.legendLabel.attr({fill: c})
  5919. }
  5920. this.dispatch("rollOutItem", a, b)
  5921. }
  5922. }, clickLabel: function (a, b) {
  5923. this.textClickEnabled ? a.hidden || this.dispatch("clickLabel", a, b) : this.switchable && (!0 === a.hidden ?
  5924. this.dispatch("showItem", a, b) : this.dispatch("hideItem", a, b))
  5925. }, dispatch: function (a, b, c) {
  5926. a = {type: a, dataItem: b, target: this, event: c, chart: this.chart};
  5927. this.chart && this.chart.handleLegendEvent(a);
  5928. this.fire(a)
  5929. }, createValue: function (a) {
  5930. var b = this, c = b.fontSize, e = b.chart;
  5931. if (!1 !== a.visibleInLegend && !a.hideFromLegend) {
  5932. var h = b.maxLabelWidth;
  5933. b.forceWidth && (h = b.labelWidth);
  5934. b.equalWidths || (b.valueAlign = "left");
  5935. "left" == b.valueAlign && (h = a.legendEntry.getBBox().width);
  5936. var f = h;
  5937. if (b.valueText && 0 < b.valueWidth) {
  5938. var g = b.color;
  5939. b.useMarkerColorForValues && (g = a.color, a.legendKeyColor && (g = a.legendKeyColor()));
  5940. !0 === a.hidden && (g = b.markerDisabledColor);
  5941. var k = b.valueText, h = h + b.lx + b.markerLabelGap + b.valueWidth, l = "end";
  5942. "left" == b.valueAlign && (h -= b.valueWidth, l = "start");
  5943. g = d.text(b.container, k, g, b.chart.fontFamily, c, l);
  5944. d.setCN(e, g, "legend-value");
  5945. g.translate(h, b.ly);
  5946. b.entries[b.index].push(g);
  5947. f += b.valueWidth + 2 * b.markerLabelGap;
  5948. g.dItem = a;
  5949. b.valueLabels.push(g)
  5950. }
  5951. b.index++;
  5952. e = b.markerSize;
  5953. e < c + 7 && (e = c + 7, d.VML && (e += 3));
  5954. c = b.container.rect(a.legendEntryWidth,
  5955. 0, f, e, 0, 0).attr({stroke: "none", fill: "#fff", "fill-opacity": .005});
  5956. c.dItem = a;
  5957. b.entries[b.index - 1].push(c);
  5958. c.mouseover(function (c) {
  5959. b.rollOverLabel(a, c)
  5960. }).mouseout(function (c) {
  5961. b.rollOutLabel(a, c)
  5962. }).click(function (c) {
  5963. b.clickLabel(a, c)
  5964. })
  5965. }
  5966. }, createV: function () {
  5967. var a = this.markerSize;
  5968. return d.polygon(this.container, [a / 5, a / 2, a - a / 5, a / 2], [a / 3, a - a / 5, a / 5, a / 1.7], this.switchColor)
  5969. }, createX: function () {
  5970. var a = (this.markerSize - 4) / 2, b = {stroke: this.switchColor, "stroke-width": 3}, c = this.container,
  5971. e = d.line(c, [-a, a], [-a, a]).attr(b),
  5972. a = d.line(c, [-a, a], [a, -a]).attr(b);
  5973. return this.container.set([e, a])
  5974. }, createMarker: function (a, b, c, e, h, f, g, k, l) {
  5975. var m = this.markerSize, n = this.container;
  5976. h || (h = this.markerBorderColor);
  5977. h || (h = b);
  5978. isNaN(e) && (e = this.markerBorderThickness);
  5979. isNaN(f) && (f = this.markerBorderAlpha);
  5980. return d.bullet(n, a, m, b, c, e, h, f, m, g, k, this.chart.path, l)
  5981. }, validateNow: function () {
  5982. this.invalidateSize()
  5983. }, updateValues: function () {
  5984. var a = this.valueLabels, b = this.chart, c, e = this.data;
  5985. if (a) for (c = 0; c < a.length; c++) {
  5986. var h = a[c], f = h.dItem, g = " ";
  5987. if (e) f.value ?
  5988. h.text(f.value) : h.text(""); else {
  5989. var k;
  5990. if (void 0 !== f.type) {
  5991. k = f.currentDataItem;
  5992. var l = this.periodValueText;
  5993. f.legendPeriodValueText && (l = f.legendPeriodValueText);
  5994. k ? (g = this.valueText, f.legendValueText && (g = f.legendValueText), g = b.formatString(g, k)) : l && b.formatPeriodString && (l = d.massReplace(l, {"[[title]]": f.title}), g = b.formatPeriodString(l, f))
  5995. } else g = b.formatString(this.valueText, f);
  5996. if (l = this.valueFunction) k && (f = k), g = l(f, g);
  5997. h.text(g)
  5998. }
  5999. }
  6000. }, renderFix: function () {
  6001. if (!d.VML && this.enabled) {
  6002. var a = this.container;
  6003. a &&
  6004. a.renderFix()
  6005. }
  6006. }, destroy: function () {
  6007. this.div.innerHTML = "";
  6008. d.remove(this.set)
  6009. }
  6010. })
  6011. })();
  6012. (function () {
  6013. var d = window.AmCharts;
  6014. d.formatMilliseconds = function (a, b) {
  6015. if (-1 != a.indexOf("fff")) {
  6016. var c = b.getMilliseconds(), d = String(c);
  6017. 10 > c && (d = "00" + c);
  6018. 10 <= c && 100 > c && (d = "0" + c);
  6019. a = a.replace(/fff/g, d)
  6020. }
  6021. return a
  6022. };
  6023. d.extractPeriod = function (a) {
  6024. var b = d.stripNumbers(a), c = 1;
  6025. b != a && (c = Number(a.slice(0, a.indexOf(b))));
  6026. return {period: b, count: c}
  6027. };
  6028. d.getDate = function (a, b, c) {
  6029. return a instanceof Date ? d.newDate(a, c) : b && isNaN(a) ? d.stringToDate(a, b) : new Date(a)
  6030. };
  6031. d.daysInMonth = function (a) {
  6032. return (new Date(a.getYear(), a.getMonth() +
  6033. 1, 0)).getDate()
  6034. };
  6035. d.newDate = function (a, b) {
  6036. return b && -1 == b.indexOf("fff") ? new Date(a) : new Date(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds(), a.getMilliseconds())
  6037. };
  6038. d.resetDateToMin = function (a, b, c, e) {
  6039. void 0 === e && (e = 1);
  6040. var h, f, g, k, l, m, n;
  6041. d.useUTC ? (h = a.getUTCFullYear(), f = a.getUTCMonth(), g = a.getUTCDate(), k = a.getUTCHours(), l = a.getUTCMinutes(), m = a.getUTCSeconds(), n = a.getUTCMilliseconds(), a = a.getUTCDay()) : (h = a.getFullYear(), f = a.getMonth(), g = a.getDate(), k = a.getHours(), l =
  6042. a.getMinutes(), m = a.getSeconds(), n = a.getMilliseconds(), a = a.getDay());
  6043. switch (b) {
  6044. case "YYYY":
  6045. h = Math.floor(h / c) * c;
  6046. f = 0;
  6047. g = 1;
  6048. n = m = l = k = 0;
  6049. break;
  6050. case "MM":
  6051. f = Math.floor(f / c) * c;
  6052. g = 1;
  6053. n = m = l = k = 0;
  6054. break;
  6055. case "WW":
  6056. g = a >= e ? g - a + e : g - (7 + a) + e;
  6057. n = m = l = k = 0;
  6058. break;
  6059. case "DD":
  6060. n = m = l = k = 0;
  6061. break;
  6062. case "hh":
  6063. k = Math.floor(k / c) * c;
  6064. n = m = l = 0;
  6065. break;
  6066. case "mm":
  6067. l = Math.floor(l / c) * c;
  6068. n = m = 0;
  6069. break;
  6070. case "ss":
  6071. m = Math.floor(m / c) * c;
  6072. n = 0;
  6073. break;
  6074. case "fff":
  6075. n = Math.floor(n / c) * c
  6076. }
  6077. d.useUTC ? (a = new Date, a.setUTCFullYear(h, f, g), a.setUTCHours(k, l, m, n)) : a = new Date(h, f, g,
  6078. k, l, m, n);
  6079. return a
  6080. };
  6081. d.getPeriodDuration = function (a, b) {
  6082. void 0 === b && (b = 1);
  6083. var c;
  6084. switch (a) {
  6085. case "YYYY":
  6086. c = 316224E5;
  6087. break;
  6088. case "MM":
  6089. c = 26784E5;
  6090. break;
  6091. case "WW":
  6092. c = 6048E5;
  6093. break;
  6094. case "DD":
  6095. c = 864E5;
  6096. break;
  6097. case "hh":
  6098. c = 36E5;
  6099. break;
  6100. case "mm":
  6101. c = 6E4;
  6102. break;
  6103. case "ss":
  6104. c = 1E3;
  6105. break;
  6106. case "fff":
  6107. c = 1
  6108. }
  6109. return c * b
  6110. };
  6111. d.intervals = {
  6112. s: {nextInterval: "ss", contains: 1E3},
  6113. ss: {nextInterval: "mm", contains: 60, count: 0},
  6114. mm: {nextInterval: "hh", contains: 60, count: 1},
  6115. hh: {nextInterval: "DD", contains: 24, count: 2},
  6116. DD: {nextInterval: "", contains: Infinity, count: 3}
  6117. };
  6118. d.getMaxInterval = function (a, b) {
  6119. var c = d.intervals;
  6120. return a >= c[b].contains ? (a = Math.round(a / c[b].contains), b = c[b].nextInterval, d.getMaxInterval(a, b)) : "ss" == b ? c[b].nextInterval : b
  6121. };
  6122. d.dayNames = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ");
  6123. d.shortDayNames = "Sun Mon Tue Wed Thu Fri Sat".split(" ");
  6124. d.monthNames = "January February March April May June July August September October November December".split(" ");
  6125. d.shortMonthNames = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");
  6126. d.getWeekNumber = function (a) {
  6127. a = new Date(a);
  6128. a.setHours(0, 0, 0);
  6129. a.setDate(a.getDate() + 4 - (a.getDay() || 7));
  6130. var b = new Date(a.getFullYear(), 0, 1);
  6131. return Math.ceil(((a - b) / 864E5 + 1) / 7)
  6132. };
  6133. d.stringToDate = function (a, b) {
  6134. var c = {}, e = [{pattern: "YYYY", period: "year"}, {pattern: "YY", period: "year"}, {
  6135. pattern: "MM",
  6136. period: "month"
  6137. }, {pattern: "M", period: "month"}, {pattern: "DD", period: "date"}, {
  6138. pattern: "D",
  6139. period: "date"
  6140. }, {pattern: "JJ", period: "hours"}, {pattern: "J", period: "hours"}, {
  6141. pattern: "HH",
  6142. period: "hours"
  6143. }, {pattern: "H", period: "hours"},
  6144. {pattern: "KK", period: "hours"}, {pattern: "K", period: "hours"}, {
  6145. pattern: "LL",
  6146. period: "hours"
  6147. }, {pattern: "L", period: "hours"}, {pattern: "NN", period: "minutes"}, {
  6148. pattern: "N",
  6149. period: "minutes"
  6150. }, {pattern: "SS", period: "seconds"}, {pattern: "S", period: "seconds"}, {
  6151. pattern: "QQQ",
  6152. period: "milliseconds"
  6153. }, {pattern: "QQ", period: "milliseconds"}, {pattern: "Q", period: "milliseconds"}], h = !0,
  6154. f = b.indexOf("AA");
  6155. -1 != f && (a.substr(f, 2), "pm" == a.toLowerCase && (h = !1));
  6156. var f = b, g, k, l;
  6157. for (l = 0; l < e.length; l++) k = e[l].period, c[k] = 0, "date" == k && (c[k] =
  6158. 1);
  6159. for (l = 0; l < e.length; l++) if (g = e[l].pattern, k = e[l].period, -1 != b.indexOf(g)) {
  6160. var m = d.getFromDateString(g, a, f);
  6161. b = b.replace(g, "");
  6162. if ("KK" == g || "K" == g || "LL" == g || "L" == g) h || (m += 12);
  6163. c[k] = m
  6164. }
  6165. d.useUTC ? (e = new Date, e.setUTCFullYear(c.year, c.month, c.date), e.setUTCHours(c.hours, c.minutes, c.seconds, c.milliseconds)) : e = new Date(c.year, c.month, c.date, c.hours, c.minutes, c.seconds, c.milliseconds);
  6166. return e
  6167. };
  6168. d.getFromDateString = function (a, b, c) {
  6169. if (void 0 !== b) return c = c.indexOf(a), b = String(b), b = b.substr(c, a.length), "0" == b.charAt(0) &&
  6170. (b = b.substr(1, b.length - 1)), b = Number(b), isNaN(b) && (b = 0), -1 != a.indexOf("M") && b--, b
  6171. };
  6172. d.formatDate = function (a, b, c) {
  6173. c || (c = d);
  6174. var e, h, f, g, k, l, m, n, q = d.getWeekNumber(a);
  6175. d.useUTC ? (e = a.getUTCFullYear(), h = a.getUTCMonth(), f = a.getUTCDate(), g = a.getUTCDay(), k = a.getUTCHours(), l = a.getUTCMinutes(), m = a.getUTCSeconds(), n = a.getUTCMilliseconds()) : (e = a.getFullYear(), h = a.getMonth(), f = a.getDate(), g = a.getDay(), k = a.getHours(), l = a.getMinutes(), m = a.getSeconds(), n = a.getMilliseconds());
  6176. var p = String(e).substr(2, 2), t = "0" + g;
  6177. b = b.replace(/W/g,
  6178. q);
  6179. q = k;
  6180. 24 == q && (q = 0);
  6181. var r = q;
  6182. 10 > r && (r = "0" + r);
  6183. b = b.replace(/JJ/g, r);
  6184. b = b.replace(/J/g, q);
  6185. r = k;
  6186. 0 === r && (r = 24, -1 != b.indexOf("H") && (f--, 0 === f && (e = new Date(a), e.setDate(e.getDate() - 1), h = e.getMonth(), f = e.getDate(), e = e.getFullYear())));
  6187. a = h + 1;
  6188. 9 > h && (a = "0" + a);
  6189. q = f;
  6190. 10 > f && (q = "0" + f);
  6191. var u = r;
  6192. 10 > u && (u = "0" + u);
  6193. b = b.replace(/HH/g, u);
  6194. b = b.replace(/H/g, r);
  6195. r = k;
  6196. 11 < r && (r -= 12);
  6197. u = r;
  6198. 10 > u && (u = "0" + u);
  6199. b = b.replace(/KK/g, u);
  6200. b = b.replace(/K/g, r);
  6201. r = k;
  6202. 0 === r && (r = 12);
  6203. 12 < r && (r -= 12);
  6204. u = r;
  6205. 10 > u && (u = "0" + u);
  6206. b = b.replace(/LL/g, u);
  6207. b = b.replace(/L/g, r);
  6208. r = l;
  6209. 10 > r && (r = "0" + r);
  6210. b = b.replace(/NN/g, r);
  6211. b = b.replace(/N/g, l);
  6212. l = m;
  6213. 10 > l && (l = "0" + l);
  6214. b = b.replace(/SS/g, l);
  6215. b = b.replace(/S/g, m);
  6216. m = n;
  6217. 10 > m && (m = "00" + m);
  6218. 100 > m && (m = "0" + m);
  6219. l = n;
  6220. 10 > l && (l = "00" + l);
  6221. b = b.replace(/QQQ/g, m);
  6222. b = b.replace(/QQ/g, l);
  6223. b = b.replace(/Q/g, n);
  6224. b = 12 > k ? b.replace(/A/g, c.amString) : b.replace(/A/g, c.pmString);
  6225. b = b.replace(/YYYY/g, "@IIII@");
  6226. b = b.replace(/YY/g, "@II@");
  6227. b = b.replace(/MMMM/g, "@XXXX@");
  6228. b = b.replace(/MMM/g, "@XXX@");
  6229. b = b.replace(/MM/g, "@XX@");
  6230. b = b.replace(/M/g, "@X@");
  6231. b = b.replace(/DD/g, "@RR@");
  6232. b = b.replace(/D/g,
  6233. "@R@");
  6234. b = b.replace(/EEEE/g, "@PPPP@");
  6235. b = b.replace(/EEE/g, "@PPP@");
  6236. b = b.replace(/EE/g, "@PP@");
  6237. b = b.replace(/E/g, "@P@");
  6238. b = b.replace(/@IIII@/g, e);
  6239. b = b.replace(/@II@/g, p);
  6240. b = b.replace(/@XXXX@/g, c.monthNames[h]);
  6241. b = b.replace(/@XXX@/g, c.shortMonthNames[h]);
  6242. b = b.replace(/@XX@/g, a);
  6243. b = b.replace(/@X@/g, h + 1);
  6244. b = b.replace(/@RR@/g, q);
  6245. b = b.replace(/@R@/g, f);
  6246. b = b.replace(/@PPPP@/g, c.dayNames[g]);
  6247. b = b.replace(/@PPP@/g, c.shortDayNames[g]);
  6248. b = b.replace(/@PP@/g, t);
  6249. return b = b.replace(/@P@/g, g)
  6250. };
  6251. d.changeDate = function (a, b, c, e, h) {
  6252. if (d.useUTC) return d.changeUTCDate(a,
  6253. b, c, e, h);
  6254. var f = -1;
  6255. void 0 === e && (e = !0);
  6256. void 0 === h && (h = !1);
  6257. !0 === e && (f = 1);
  6258. switch (b) {
  6259. case "YYYY":
  6260. a.setFullYear(a.getFullYear() + c * f);
  6261. e || h || a.setDate(a.getDate() + 1);
  6262. break;
  6263. case "MM":
  6264. b = a.getMonth();
  6265. a.setMonth(a.getMonth() + c * f);
  6266. a.getMonth() > b + c * f && a.setDate(a.getDate() - 1);
  6267. e || h || a.setDate(a.getDate() + 1);
  6268. break;
  6269. case "DD":
  6270. a.setDate(a.getDate() + c * f);
  6271. break;
  6272. case "WW":
  6273. a.setDate(a.getDate() + c * f * 7);
  6274. break;
  6275. case "hh":
  6276. a.setHours(a.getHours() + c * f);
  6277. break;
  6278. case "mm":
  6279. a.setMinutes(a.getMinutes() + c * f);
  6280. break;
  6281. case "ss":
  6282. a.setSeconds(a.getSeconds() +
  6283. c * f);
  6284. break;
  6285. case "fff":
  6286. a.setMilliseconds(a.getMilliseconds() + c * f)
  6287. }
  6288. return a
  6289. };
  6290. d.changeUTCDate = function (a, b, c, d, h) {
  6291. var f = -1;
  6292. void 0 === d && (d = !0);
  6293. void 0 === h && (h = !1);
  6294. !0 === d && (f = 1);
  6295. switch (b) {
  6296. case "YYYY":
  6297. a.setUTCFullYear(a.getUTCFullYear() + c * f);
  6298. d || h || a.setUTCDate(a.getUTCDate() + 1);
  6299. break;
  6300. case "MM":
  6301. b = a.getUTCMonth();
  6302. a.setUTCMonth(a.getUTCMonth() + c * f);
  6303. a.getUTCMonth() > b + c * f && a.setUTCDate(a.getUTCDate() - 1);
  6304. d || h || a.setUTCDate(a.getUTCDate() + 1);
  6305. break;
  6306. case "DD":
  6307. a.setUTCDate(a.getUTCDate() + c * f);
  6308. break;
  6309. case "WW":
  6310. a.setUTCDate(a.getUTCDate() +
  6311. c * f * 7);
  6312. break;
  6313. case "hh":
  6314. a.setUTCHours(a.getUTCHours() + c * f);
  6315. break;
  6316. case "mm":
  6317. a.setUTCMinutes(a.getUTCMinutes() + c * f);
  6318. break;
  6319. case "ss":
  6320. a.setUTCSeconds(a.getUTCSeconds() + c * f);
  6321. break;
  6322. case "fff":
  6323. a.setUTCMilliseconds(a.getUTCMilliseconds() + c * f)
  6324. }
  6325. return a
  6326. }
  6327. })();