amcharts.js 367 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241
  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 = 30, 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({
  14. handler: c,
  15. scope: this
  16. })
  17. }, b.prototype.addListener = function (a, b, c) {
  18. this.removeListener(this, a, b);
  19. this.events[a].push({
  20. handler: b,
  21. scope: c
  22. })
  23. }, b.prototype.removeListener = function (a, b, c) {
  24. if (a && a.events)
  25. for (a = a.events[b], b = a.length - 1; 0 <= b; b--) a[b].handler === c && a.splice(b, 1)
  26. }, b.prototype.fire = function (a, b) {
  27. for (var c = this.events[a], d = 0, k = c.length; d <
  28. k; d++) {
  29. var l = c[d];
  30. l.handler.call(l.scope, b)
  31. }
  32. });
  33. for (var c in a) b.prototype[c] = a[c];
  34. return b
  35. };
  36. d.addChart = function (a) {
  37. d.updateInt || (d.updateInt = setInterval(function () {
  38. d.update()
  39. }, Math.round(1E3 / d.updateRate)));
  40. d.charts.push(a)
  41. };
  42. d.removeChart = function (a) {
  43. for (var b = d.charts, c = b.length - 1; 0 <= c; c--) b[c] == a && b.splice(c, 1);
  44. 0 === b.length && d.updateInt && (clearInterval(d.updateInt), d.updateInt = NaN)
  45. };
  46. d.isModern = !0;
  47. d.getIEVersion = function () {
  48. var a = 0,
  49. b, c;
  50. "Microsoft Internet Explorer" == navigator.appName && (b = navigator.userAgent,
  51. c = /MSIE ([0-9]{1,}[.0-9]{0,})/, null !== c.exec(b) && (a = parseFloat(RegExp.$1)));
  52. return a
  53. };
  54. d.applyLang = function (a, b) {
  55. var c = d.translations;
  56. b.dayNames = d.extend({}, d.dayNames);
  57. b.shortDayNames = d.extend({}, d.shortDayNames);
  58. b.monthNames = d.extend({}, d.monthNames);
  59. b.shortMonthNames = d.extend({}, d.shortMonthNames);
  60. c && (c = c[a]) && (d.lang = c, c.monthNames && (b.dayNames = d.extend({}, c.dayNames), b.shortDayNames = d.extend({}, c.shortDayNames), b.monthNames = d.extend({}, c.monthNames), b.shortMonthNames = d.extend({}, c.shortMonthNames)))
  61. };
  62. d.IEversion = d.getIEVersion();
  63. 9 > d.IEversion && 0 < d.IEversion && (d.isModern = !1, d.isIE = !0);
  64. d.dx = 0;
  65. d.dy = 0;
  66. if (document.addEventListener || window.opera) d.isNN = !0, d.isIE = !1, d.dx = .5, d.dy = .5;
  67. document.attachEvent && (d.isNN = !1, d.isIE = !0, d.isModern || (d.dx = 0, d.dy = 0));
  68. window.chrome && (d.chrome = !0);
  69. d.handleMouseUp = function (a) {
  70. for (var b = d.charts, c = 0; c < b.length; c++) {
  71. var e = b[c];
  72. e && e.handleReleaseOutside && e.handleReleaseOutside(a)
  73. }
  74. };
  75. d.handleMouseMove = function (a) {
  76. for (var b = d.charts, c = 0; c < b.length; c++) {
  77. var e = b[c];
  78. e && e.handleMouseMove &&
  79. e.handleMouseMove(a)
  80. }
  81. };
  82. d.handleWheel = function (a) {
  83. for (var b = d.charts, c = 0; c < b.length; c++) {
  84. var e = b[c];
  85. if (e && e.mouseIsOver) {
  86. e.mouseWheelScrollEnabled || e.mouseWheelZoomEnabled ? e.handleWheel && e.handleWheel(a) : a.stopPropagation && a.stopPropagation();
  87. break
  88. }
  89. }
  90. };
  91. d.resetMouseOver = function () {
  92. for (var a = d.charts, b = 0; b < a.length; b++) {
  93. var c = a[b];
  94. c && (c.mouseIsOver = !1)
  95. }
  96. };
  97. d.ready = function (a) {
  98. d.onReadyArray.push(a)
  99. };
  100. d.handleLoad = function () {
  101. d.isReady = !0;
  102. for (var a = d.onReadyArray, b = 0; b < a.length; b++) {
  103. var c = a[b];
  104. isNaN(d.processDelay) ?
  105. c() : setTimeout(c, d.processDelay * b)
  106. }
  107. };
  108. d.addInitHandler = function (a, b) {
  109. d.initHandlers.push({
  110. method: a,
  111. types: b
  112. })
  113. };
  114. d.callInitHandler = function (a) {
  115. var b = d.initHandlers;
  116. if (d.initHandlers)
  117. for (var c = 0; c < b.length; c++) {
  118. var e = b[c];
  119. e.types ? d.isInArray(e.types, a.type) && e.method(a) : e.method(a)
  120. }
  121. };
  122. d.getUniqueId = function () {
  123. d.uid++;
  124. return "AmChartsEl-" + d.uid
  125. };
  126. d.isNN && (document.addEventListener("mousemove", d.handleMouseMove, !0), document.addEventListener("mouseup", d.handleMouseUp, !0), window.addEventListener("load", d.handleLoad,
  127. !0), window.addEventListener("DOMMouseScroll", d.handleWheel, !0), document.addEventListener("mousewheel", d.handleWheel, !0));
  128. d.isIE && (document.attachEvent("onmousemove", d.handleMouseMove), document.attachEvent("onmouseup", d.handleMouseUp), window.attachEvent("onload", d.handleLoad));
  129. d.clear = function () {
  130. var a = d.charts;
  131. if (a)
  132. for (var b = a.length - 1; 0 <= b; b--) a[b].clear();
  133. d.updateInt && clearInterval(d.updateInt);
  134. d.charts = [];
  135. d.isNN && (document.removeEventListener("mousemove", d.handleMouseMove, !0), document.removeEventListener("mouseup",
  136. d.handleMouseUp, !0), window.removeEventListener("load", d.handleLoad, !0), window.removeEventListener("DOMMouseScroll", d.handleWheel, !0), document.removeEventListener("mousewheel", d.handleWheel, !0));
  137. d.isIE && (document.detachEvent("onmousemove", d.handleMouseMove), document.detachEvent("onmouseup", d.handleMouseUp), window.detachEvent("onload", d.handleLoad))
  138. };
  139. d.makeChart = function (a, b, c) {
  140. var e = b.type,
  141. h = b.theme;
  142. d.isString(h) && (h = d.themes[h], b.theme = h);
  143. var f;
  144. switch (e) {
  145. case "serial":
  146. f = new d.AmSerialChart(h);
  147. break;
  148. case "xy":
  149. f = new d.AmXYChart(h);
  150. break;
  151. case "pie":
  152. f = new d.AmPieChart(h);
  153. break;
  154. case "radar":
  155. f = new d.AmRadarChart(h);
  156. break;
  157. case "gauge":
  158. f = new d.AmAngularGauge(h);
  159. break;
  160. case "funnel":
  161. f = new d.AmFunnelChart(h);
  162. break;
  163. case "map":
  164. f = new d.AmMap(h);
  165. break;
  166. case "stock":
  167. f = new d.AmStockChart(h);
  168. break;
  169. case "gantt":
  170. f = new d.AmGanttChart(h)
  171. }
  172. d.extend(f, b);
  173. d.isReady ? isNaN(c) ? f.write(a) : setTimeout(function () {
  174. d.realWrite(f, a)
  175. }, c) : d.ready(function () {
  176. isNaN(c) ? f.write(a) : setTimeout(function () {
  177. d.realWrite(f, a)
  178. }, c)
  179. });
  180. return f
  181. };
  182. d.realWrite = function (a, b) {
  183. a.write(b)
  184. };
  185. d.updateCount = 0;
  186. d.validateAt = Math.round(d.updateRate / 5);
  187. d.update = function () {
  188. var a = d.charts;
  189. d.updateCount++;
  190. var b = !1;
  191. d.updateCount == d.validateAt && (b = !0, d.updateCount = 0);
  192. if (a)
  193. for (var c = 0; c < a.length; c++) a[c].update && a[c].update(), b && a[c].autoResize && a[c].validateSize && a[c].validateSize()
  194. };
  195. d.bezierX = 3;
  196. d.bezierY = 6
  197. })();
  198. (function () {
  199. var d = window.AmCharts;
  200. d.toBoolean = function (a, b) {
  201. if (void 0 === a) return b;
  202. switch (String(a).toLowerCase()) {
  203. case "true":
  204. case "yes":
  205. case "1":
  206. return !0;
  207. case "false":
  208. case "no":
  209. case "0":
  210. case null:
  211. return !1;
  212. default:
  213. return Boolean(a)
  214. }
  215. };
  216. d.removeFromArray = function (a, b) {
  217. var c;
  218. if (void 0 !== b && void 0 !== a)
  219. for (c = a.length - 1; 0 <= c; c--) a[c] == b && a.splice(c, 1)
  220. };
  221. d.getPath = function () {
  222. var a = document.getElementsByTagName("script");
  223. if (a)
  224. for (var b = 0; b < a.length; b++) {
  225. var c = a[b].src;
  226. if (-1 !== c.search(/\/(amcharts|ammap)\.js/)) return c.replace(/\/(amcharts|ammap)\.js.*/,
  227. "/")
  228. }
  229. };
  230. d.normalizeUrl = function (a) {
  231. return "" !== a && -1 === a.search(/\/$/) ? a + "/" : a
  232. };
  233. d.isAbsolute = function (a) {
  234. return 0 === a.search(/^http[s]?:|^\//)
  235. };
  236. d.isInArray = function (a, b) {
  237. for (var c = 0; c < a.length; c++)
  238. if (a[c] == b) return !0;
  239. return !1
  240. };
  241. d.getDecimals = function (a) {
  242. var b = 0;
  243. isNaN(a) || (a = String(a), -1 != a.indexOf("e-") ? b = Number(a.split("-")[1]) : -1 != a.indexOf(".") && (b = a.split(".")[1].length));
  244. return b
  245. };
  246. d.wrappedText = function (a, b, c, e, h, f, g, k, l) {
  247. var m = d.text(a, b, c, e, h, f, g),
  248. n = "\n";
  249. d.isModern || (n = "<br>");
  250. if (10 < l) return m;
  251. if (m) {
  252. var q = m.getBBox();
  253. if (q.width > k) {
  254. q = Math.ceil(q.width / k);
  255. m.remove();
  256. for (var m = [], p = 0; - 1 < (p = b.indexOf(" ", p));) m.push(p), p += 1;
  257. for (var r, p = 0; p < m.length; p += Math.ceil(m.length / q)) r = m[p], b = b.substr(0, r) + n + b.substr(r + 1);
  258. if (isNaN(r)) {
  259. if (0 === l)
  260. for (p = 1; p < q; p++) r = Math.round(b.length / q * p), b = b.substr(0, r) + n + b.substr(r);
  261. return d.text(a, b, c, e, h, f, g)
  262. }
  263. return d.wrappedText(a, b, c, e, h, f, g, k, l + 1)
  264. }
  265. return m
  266. }
  267. };
  268. d.getStyle = function (a, b) {
  269. var c = "";
  270. document.defaultView && document.defaultView.getComputedStyle ? c = document.defaultView.getComputedStyle(a,
  271. "").getPropertyValue(b) : a.currentStyle && (b = b.replace(/\-(\w)/g, function (a, b) {
  272. return b.toUpperCase()
  273. }), c = a.currentStyle[b]);
  274. return c
  275. };
  276. d.removePx = function (a) {
  277. if (void 0 !== a) return Number(a.substring(0, a.length - 2))
  278. };
  279. d.getURL = function (a, b) {
  280. if (a)
  281. if ("_self" != b && b)
  282. if ("_top" == b && window.top) window.top.location.href = a;
  283. else if ("_parent" == b && window.parent) window.parent.location.href = a;
  284. else if ("_blank" == b) window.open(a);
  285. else {
  286. var c = document.getElementsByName(b)[0];
  287. c ? c.src = a : (c = d.windows[b]) ? c.opener && !c.opener.closed ?
  288. c.location.href = a : d.windows[b] = window.open(a) : d.windows[b] = window.open(a)
  289. } else window.location.href = a
  290. };
  291. d.ifArray = function (a) {
  292. return a && 0 < a.length ? !0 : !1
  293. };
  294. d.callMethod = function (a, b) {
  295. var c;
  296. for (c = 0; c < b.length; c++) {
  297. var e = b[c];
  298. if (e) {
  299. if (e[a]) e[a]();
  300. var h = e.length;
  301. if (0 < h) {
  302. var d;
  303. for (d = 0; d < h; d++) {
  304. var g = e[d];
  305. if (g && g[a]) g[a]()
  306. }
  307. }
  308. }
  309. }
  310. };
  311. d.toNumber = function (a) {
  312. return "number" == typeof a ? a : Number(String(a).replace(/[^0-9\-.]+/g, ""))
  313. };
  314. d.toColor = function (a) {
  315. if ("" !== a && void 0 !== a)
  316. if (-1 != a.indexOf(",")) {
  317. a = a.split(",");
  318. var b;
  319. for (b = 0; b < a.length; b++) {
  320. var c = a[b].substring(a[b].length - 6, a[b].length);
  321. a[b] = "#" + c
  322. }
  323. } else a = a.substring(a.length - 6, a.length), a = "#" + a;
  324. return a
  325. };
  326. d.toCoordinate = function (a, b, c) {
  327. var e;
  328. void 0 !== a && (a = String(a), c && c < b && (b = c), e = Number(a), -1 != a.indexOf("!") && (e = b - Number(a.substr(1))), -1 != a.indexOf("%") && (e = b * Number(a.substr(0, a.length - 1)) / 100));
  329. return e
  330. };
  331. d.fitToBounds = function (a, b, c) {
  332. a < b && (a = b);
  333. a > c && (a = c);
  334. return a
  335. };
  336. d.isDefined = function (a) {
  337. return void 0 === a ? !1 : !0
  338. };
  339. d.stripNumbers = function (a) {
  340. return a.replace(/[0-9]+/g,
  341. "")
  342. };
  343. d.roundTo = function (a, b) {
  344. if (0 > b) return a;
  345. var c = Math.pow(10, b);
  346. return Math.round(a * c) / c
  347. };
  348. d.toFixed = function (a, b) {
  349. var c = String(Math.round(a * Math.pow(10, b)));
  350. if (0 < b) {
  351. var e = c.length;
  352. if (e < b) {
  353. var h;
  354. for (h = 0; h < b - e; h++) c = "0" + c
  355. }
  356. e = c.substring(0, c.length - b);
  357. "" === e && (e = 0);
  358. return e + "." + c.substring(c.length - b, c.length)
  359. }
  360. return String(c)
  361. };
  362. d.formatDuration = function (a, b, c, e, h, f) {
  363. var g = d.intervals,
  364. k = f.decimalSeparator;
  365. if (a >= g[b].contains) {
  366. var l = a - Math.floor(a / g[b].contains) * g[b].contains;
  367. "ss" == b && (l = d.formatNumber(l,
  368. f), 1 == l.split(k)[0].length && (l = "0" + l));
  369. ("mm" == b || "hh" == b) && 10 > l && (l = "0" + l);
  370. c = l + "" + e[b] + "" + c;
  371. a = Math.floor(a / g[b].contains);
  372. b = g[b].nextInterval;
  373. return d.formatDuration(a, b, c, e, h, f)
  374. }
  375. "ss" == b && (a = d.formatNumber(a, f), 1 == a.split(k)[0].length && (a = "0" + a));
  376. ("mm" == b || "hh" == b) && 10 > a && (a = "0" + a);
  377. c = a + "" + e[b] + "" + c;
  378. if (g[h].count > g[b].count)
  379. 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);
  380. ":" == c.charAt(c.length - 1) && (c = c.substring(0, c.length -
  381. 1));
  382. return c
  383. };
  384. d.formatNumber = function (a, b, c, e, h) {
  385. a = d.roundTo(a, b.precision);
  386. isNaN(c) && (c = b.precision);
  387. var f = b.decimalSeparator;
  388. b = b.thousandsSeparator;
  389. var g;
  390. g = 0 > a ? "-" : "";
  391. a = Math.abs(a);
  392. var k = String(a),
  393. l = !1; - 1 != k.indexOf("e") && (l = !0);
  394. 0 <= c && !l && (k = d.toFixed(a, c));
  395. var m = "";
  396. if (l) m = k;
  397. else {
  398. var k = k.split("."),
  399. l = String(k[0]),
  400. n;
  401. 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);
  402. void 0 !== k[1] && (m = m + f + k[1]);
  403. void 0 !== c && 0 < c && "0" != m && (m = d.addZeroes(m, f, c))
  404. }
  405. m =
  406. g + m;
  407. "" === g && !0 === e && 0 !== a && (m = "+" + m);
  408. !0 === h && (m += "%");
  409. return m
  410. };
  411. d.addZeroes = function (a, b, c) {
  412. a = a.split(b);
  413. void 0 === a[1] && 0 < c && (a[1] = "0");
  414. 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]
  415. };
  416. d.scientificToNormal = function (a) {
  417. var b;
  418. a = String(a).split("e");
  419. var c;
  420. if ("-" == a[1].substr(0, 1)) {
  421. b = "0.";
  422. for (c = 0; c < Math.abs(Number(a[1])) - 1; c++) b += "0";
  423. b += a[0].split(".").join("")
  424. } else {
  425. var e = 0;
  426. b = a[0].split(".");
  427. b[1] && (e = b[1].length);
  428. b = a[0].split(".").join("");
  429. for (c = 0; c < Math.abs(Number(a[1])) -
  430. e; c++) b += "0"
  431. }
  432. return b
  433. };
  434. d.toScientific = function (a, b) {
  435. if (0 === a) return "0";
  436. var c = Math.floor(Math.log(Math.abs(a)) * Math.LOG10E),
  437. e = String(e).split(".").join(b);
  438. return String(e) + "e" + c
  439. };
  440. d.randomColor = function () {
  441. return "#" + ("00000" + (16777216 * Math.random() << 0).toString(16)).substr(-6)
  442. };
  443. d.hitTest = function (a, b, c) {
  444. var e = !1,
  445. h = a.x,
  446. f = a.x + a.width,
  447. g = a.y,
  448. k = a.y + a.height,
  449. l = d.isInRectangle;
  450. e || (e = l(h, g, b));
  451. e || (e = l(h, k, b));
  452. e || (e = l(f, g, b));
  453. e || (e = l(f, k, b));
  454. e || !0 === c || (e = d.hitTest(b, a, !0));
  455. return e
  456. };
  457. d.isInRectangle = function (a,
  458. b, c) {
  459. return a >= c.x - 5 && a <= c.x + c.width + 5 && b >= c.y - 5 && b <= c.y + c.height + 5 ? !0 : !1
  460. };
  461. d.isPercents = function (a) {
  462. if (-1 != String(a).indexOf("%")) return !0
  463. };
  464. d.findPosX = function (a) {
  465. var b = a,
  466. c = a.offsetLeft;
  467. if (a.offsetParent) {
  468. for (; a = a.offsetParent;) c += a.offsetLeft;
  469. for (;
  470. (b = b.parentNode) && b != document.body;) c -= b.scrollLeft || 0
  471. }
  472. return c
  473. };
  474. d.findPosY = function (a) {
  475. var b = a,
  476. c = a.offsetTop;
  477. if (a.offsetParent) {
  478. for (; a = a.offsetParent;) c += a.offsetTop;
  479. for (;
  480. (b = b.parentNode) && b != document.body;) c -= b.scrollTop || 0
  481. }
  482. return c
  483. };
  484. d.findIfFixed = function (a) {
  485. if (a.offsetParent)
  486. for (; a =
  487. a.offsetParent;)
  488. if ("fixed" == d.getStyle(a, "position")) return !0;
  489. return !1
  490. };
  491. d.findIfAuto = function (a) {
  492. return a.style && "auto" == d.getStyle(a, "overflow") ? !0 : a.parentNode ? d.findIfAuto(a.parentNode) : !1
  493. };
  494. d.findScrollLeft = function (a, b) {
  495. a.scrollLeft && (b += a.scrollLeft);
  496. return a.parentNode ? d.findScrollLeft(a.parentNode, b) : b
  497. };
  498. d.findScrollTop = function (a, b) {
  499. a.scrollTop && (b += a.scrollTop);
  500. return a.parentNode ? d.findScrollTop(a.parentNode, b) : b
  501. };
  502. d.formatValue = function (a, b, c, e, h, f, g, k) {
  503. if (b) {
  504. void 0 === h && (h = "");
  505. var l;
  506. for (l =
  507. 0; l < c.length; l++) {
  508. var m = c[l],
  509. n = b[m];
  510. void 0 !== n && (n = f ? d.addPrefix(n, k, g, e) : d.formatNumber(n, e), a = a.replace(new RegExp("\\[\\[" + h + "" + m + "\\]\\]", "g"), n))
  511. }
  512. }
  513. return a
  514. };
  515. d.formatDataContextValue = function (a, b) {
  516. if (a) {
  517. var c = a.match(/\[\[.*?\]\]/g),
  518. e;
  519. for (e = 0; e < c.length; e++) {
  520. var h = c[e],
  521. h = h.substr(2, h.length - 4);
  522. void 0 !== b[h] && (a = a.replace(new RegExp("\\[\\[" + h + "\\]\\]", "g"), b[h]))
  523. }
  524. }
  525. return a
  526. };
  527. d.massReplace = function (a, b) {
  528. for (var c in b)
  529. if (b.hasOwnProperty(c)) {
  530. var e = b[c];
  531. void 0 === e && (e = "");
  532. a = a.replace(c, e)
  533. } return a
  534. };
  535. d.cleanFromEmpty = function (a) {
  536. return a.replace(/\[\[[^\]]*\]\]/g, "")
  537. };
  538. d.addPrefix = function (a, b, c, e, h) {
  539. var f = d.formatNumber(a, e),
  540. g = "",
  541. k, l, m;
  542. if (0 === a) return "0";
  543. 0 > a && (g = "-");
  544. a = Math.abs(a);
  545. if (1 < a)
  546. for (k = b.length - 1; - 1 < k; k--) {
  547. 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, {
  548. precision: -1,
  549. decimalSeparator: e.decimalSeparator,
  550. thousandsSeparator: e.thousandsSeparator
  551. }), !h || l == c)) {
  552. f = g + "" + m + "" + b[k].prefix;
  553. break
  554. }
  555. } else
  556. for (k = 0; k < c.length; k++)
  557. if (a <= c[k].number) {
  558. l =
  559. a / c[k].number;
  560. m = Math.abs(Math.round(Math.log(l) * Math.LOG10E));
  561. l = d.roundTo(l, m);
  562. f = g + "" + l + "" + c[k].prefix;
  563. break
  564. } return f
  565. };
  566. d.remove = function (a) {
  567. a && a.remove()
  568. };
  569. d.getEffect = function (a) {
  570. ">" == a && (a = "easeOutSine");
  571. "<" == a && (a = "easeInSine");
  572. "elastic" == a && (a = "easeOutElastic");
  573. return a
  574. };
  575. d.getObjById = function (a, b) {
  576. var c, e;
  577. for (e = 0; e < a.length; e++) {
  578. var h = a[e];
  579. h.id == b && (c = h)
  580. }
  581. return c
  582. };
  583. d.applyTheme = function (a, b, c) {
  584. b || (b = d.theme);
  585. b && b[c] && d.extend(a, b[c])
  586. };
  587. d.isString = function (a) {
  588. return "string" == typeof a ? !0 : !1
  589. };
  590. d.extend =
  591. function (a, b, c) {
  592. var e;
  593. a || (a = {});
  594. for (e in b) c ? a.hasOwnProperty(e) || (a[e] = b[e]) : a[e] = b[e];
  595. return a
  596. };
  597. d.copyProperties = function (a, b) {
  598. for (var c in a) a.hasOwnProperty(c) && "events" != c && void 0 !== a[c] && "function" != typeof a[c] && "cname" != c && (b[c] = a[c])
  599. };
  600. d.processObject = function (a, b, c, e) {
  601. !1 === a instanceof b && (a = e ? d.extend(new b(c), a) : d.extend(a, new b(c), !0));
  602. return a
  603. };
  604. d.fixNewLines = function (a) {
  605. var b = RegExp("\\n", "g");
  606. a && (a = a.replace(b, "<br />"));
  607. return a
  608. };
  609. d.fixBrakes = function (a) {
  610. if (d.isModern) {
  611. var b = RegExp("<br>",
  612. "g");
  613. a && (a = a.replace(b, "\n"))
  614. } else a = d.fixNewLines(a);
  615. return a
  616. };
  617. d.deleteObject = function (a, b) {
  618. if (a) {
  619. if (void 0 === b || null === b) b = 20;
  620. if (0 !== b)
  621. if ("[object Array]" === Object.prototype.toString.call(a))
  622. for (var c = 0; c < a.length; c++) d.deleteObject(a[c], b - 1), a[c] = null;
  623. else if (a && !a.tagName) try {
  624. for (c in a) a[c] && ("object" == typeof a[c] && d.deleteObject(a[c], b - 1), "function" != typeof a[c] && (a[c] = null))
  625. } catch (e) {}
  626. }
  627. };
  628. d.bounce = function (a, b, c, e, h) {
  629. return (b /= h) < 1 / 2.75 ? 7.5625 * e * b * b + c : b < 2 / 2.75 ? e * (7.5625 * (b -= 1.5 / 2.75) * b + .75) +
  630. 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
  631. };
  632. d.easeInSine = function (a, b, c, e, h) {
  633. return -e * Math.cos(b / h * (Math.PI / 2)) + e + c
  634. };
  635. d.easeOutSine = function (a, b, c, e, h) {
  636. return e * Math.sin(b / h * (Math.PI / 2)) + c
  637. };
  638. d.easeOutElastic = function (a, b, c, e, h) {
  639. a = 1.70158;
  640. var d = 0,
  641. g = e;
  642. if (0 === b) return c;
  643. if (1 == (b /= h)) return c + e;
  644. d || (d = .3 * h);
  645. g < Math.abs(e) ? (g = e, a = d / 4) : a = d / (2 * Math.PI) * Math.asin(e / g);
  646. return g * Math.pow(2, -10 * b) * Math.sin(2 * (b * h - a) * Math.PI / d) + e + c
  647. };
  648. d.fixStepE = function (a) {
  649. a = a.toExponential(0).split("e");
  650. var b = Number(a[1]);
  651. 9 == Number(a[0]) && b++;
  652. return d.generateNumber(1, b)
  653. };
  654. d.generateNumber = function (a, b) {
  655. var c = "",
  656. e;
  657. e = 0 > b ? Math.abs(b) - 1 : Math.abs(b);
  658. var h;
  659. for (h = 0; h < e; h++) c += "0";
  660. return 0 > b ? Number("0." + c + String(a)) : Number(String(a) + c)
  661. };
  662. d.setCN = function (a, b, c, e) {
  663. if (a.addClassNames && b && (b = b.node) && c) {
  664. var h = b.getAttribute("class");
  665. a = a.classNamePrefix + "-";
  666. e && (a = "");
  667. h ? b.setAttribute("class", h + " " + a + c) : b.setAttribute("class", a + c)
  668. }
  669. };
  670. d.parseDefs = function (a, b) {
  671. for (var c in a) {
  672. var e = typeof a[c];
  673. if (0 < a[c].length &&
  674. "object" == e)
  675. 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);
  676. else "object" == e ? (e = document.createElementNS(d.SVG_NS, c), b.appendChild(e), d.parseDefs(a[c], e)) : b.setAttribute(c, a[c])
  677. }
  678. }
  679. })();
  680. (function () {
  681. var d = window.AmCharts;
  682. d.AxisBase = d.Class({
  683. construct: function (a) {
  684. this.createEvents("clickItem", "rollOverItem", "rollOutItem");
  685. this.viY = this.viX = this.y = this.x = this.dy = this.dx = 0;
  686. this.axisThickness = 1;
  687. this.axisColor = "#000000";
  688. this.axisAlpha = 1;
  689. this.gridCount = this.tickLength = 5;
  690. this.gridAlpha = .15;
  691. this.gridThickness = 1;
  692. this.gridColor = "#000000";
  693. this.dashLength = 0;
  694. this.labelFrequency = 1;
  695. this.showLastLabel = this.showFirstLabel = !0;
  696. this.fillColor = "#FFFFFF";
  697. this.fillAlpha = 0;
  698. this.labelsEnabled = !0;
  699. this.labelRotation =
  700. 0;
  701. this.autoGridCount = !0;
  702. this.offset = 0;
  703. this.guides = [];
  704. this.visible = !0;
  705. this.counter = 0;
  706. this.guides = [];
  707. this.ignoreAxisWidth = this.inside = !1;
  708. this.minHorizontalGap = 75;
  709. this.minVerticalGap = 35;
  710. this.titleBold = !0;
  711. this.minorGridEnabled = !1;
  712. this.minorGridAlpha = .07;
  713. this.autoWrap = !1;
  714. this.titleAlign = "middle";
  715. this.labelOffset = 0;
  716. this.bcn = "axis-";
  717. this.periods = [{
  718. period: "ss",
  719. count: 1
  720. }, {
  721. period: "ss",
  722. count: 5
  723. }, {
  724. period: "ss",
  725. count: 10
  726. }, {
  727. period: "ss",
  728. count: 30
  729. }, {
  730. period: "mm",
  731. count: 1
  732. }, {
  733. period: "mm",
  734. count: 5
  735. }, {
  736. period: "mm",
  737. count: 10
  738. }, {
  739. period: "mm",
  740. count: 30
  741. }, {
  742. period: "hh",
  743. count: 1
  744. }, {
  745. period: "hh",
  746. count: 3
  747. }, {
  748. period: "hh",
  749. count: 6
  750. }, {
  751. period: "hh",
  752. count: 12
  753. }, {
  754. period: "DD",
  755. count: 1
  756. }, {
  757. period: "DD",
  758. count: 2
  759. }, {
  760. period: "DD",
  761. count: 3
  762. }, {
  763. period: "DD",
  764. count: 4
  765. }, {
  766. period: "DD",
  767. count: 5
  768. }, {
  769. period: "WW",
  770. count: 1
  771. }, {
  772. period: "MM",
  773. count: 1
  774. }, {
  775. period: "MM",
  776. count: 2
  777. }, {
  778. period: "MM",
  779. count: 3
  780. }, {
  781. period: "MM",
  782. count: 6
  783. }, {
  784. period: "YYYY",
  785. count: 1
  786. }, {
  787. period: "YYYY",
  788. count: 2
  789. }, {
  790. period: "YYYY",
  791. count: 5
  792. }, {
  793. period: "YYYY",
  794. count: 10
  795. }, {
  796. period: "YYYY",
  797. count: 50
  798. }, {
  799. period: "YYYY",
  800. count: 100
  801. }];
  802. this.dateFormats = [{
  803. period: "fff",
  804. format: "JJ:NN:SS"
  805. },
  806. {
  807. period: "ss",
  808. format: "JJ:NN:SS"
  809. }, {
  810. period: "mm",
  811. format: "JJ:NN"
  812. }, {
  813. period: "hh",
  814. format: "JJ:NN"
  815. }, {
  816. period: "DD",
  817. format: "MMM DD"
  818. }, {
  819. period: "WW",
  820. format: "MMM DD"
  821. }, {
  822. period: "MM",
  823. format: "MMM"
  824. }, {
  825. period: "YYYY",
  826. format: "YYYY"
  827. }
  828. ];
  829. this.nextPeriod = {
  830. fff: "ss",
  831. ss: "mm",
  832. mm: "hh",
  833. hh: "DD",
  834. DD: "MM",
  835. MM: "YYYY"
  836. };
  837. d.applyTheme(this, a, "AxisBase")
  838. },
  839. zoom: function (a, b) {
  840. this.start = a;
  841. this.end = b;
  842. this.dataChanged = !0;
  843. this.draw()
  844. },
  845. fixAxisPosition: function () {
  846. var a = this.position;
  847. "H" == this.orientation ? ("left" == a && (a = "bottom"), "right" == a && (a = "top")) :
  848. ("bottom" == a && (a = "left"), "top" == a && (a = "right"));
  849. this.position = a
  850. },
  851. draw: function () {
  852. var a = this.chart;
  853. this.allLabels = [];
  854. this.counter = 0;
  855. this.destroy();
  856. this.fixAxisPosition();
  857. this.labels = [];
  858. var b = a.container,
  859. c = b.set();
  860. a.gridSet.push(c);
  861. this.set = c;
  862. b = b.set();
  863. a.axesLabelsSet.push(b);
  864. this.labelsSet = b;
  865. this.axisLine = new this.axisRenderer(this);
  866. 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 =
  867. this.gridCount;
  868. this.axisWidth = this.axisLine.axisWidth;
  869. this.addTitle()
  870. },
  871. setOrientation: function (a) {
  872. this.orientation = a ? "H" : "V"
  873. },
  874. addTitle: function () {
  875. var a = this.title;
  876. this.titleLabel = null;
  877. if (a) {
  878. var b = this.chart,
  879. c = this.titleColor;
  880. void 0 === c && (c = b.color);
  881. var e = this.titleFontSize;
  882. isNaN(e) && (e = b.fontSize + 1);
  883. a = d.text(b.container, a, c, b.fontFamily, e, this.titleAlign, this.titleBold);
  884. d.setCN(b, a, this.bcn + "title");
  885. this.titleLabel = a
  886. }
  887. },
  888. positionTitle: function () {
  889. var a = this.titleLabel;
  890. if (a) {
  891. var b, c, e = this.labelsSet,
  892. h = {};
  893. 0 < e.length() ? h = e.getBBox() : (h.x = 0, h.y = 0, h.width = this.viW, h.height = this.viH, d.VML && (h.y += this.y, h.x += this.x));
  894. e.push(a);
  895. var e = h.x,
  896. f = h.y;
  897. d.VML && (this.rotate ? e -= this.x : f -= this.y);
  898. var g = h.width,
  899. h = h.height,
  900. k = this.viW,
  901. l = this.viH,
  902. m = 0,
  903. n = a.getBBox().height / 2,
  904. q = this.inside,
  905. p = this.titleAlign;
  906. switch (this.position) {
  907. case "top":
  908. b = "left" == p ? -1 : "right" == p ? k : k / 2;
  909. c = f - 10 - n;
  910. break;
  911. case "bottom":
  912. b = "left" == p ? -1 : "right" == p ? k : k / 2;
  913. c = f + h + 10 + n;
  914. break;
  915. case "left":
  916. b = e - 10 - n;
  917. q && (b -= 5);
  918. c = "left" == p ? l + 1 : "right" == p ? -1 : l / 2;
  919. m = -90;
  920. break;
  921. case "right":
  922. b = e + g + 10 + n - 3, q && (b += 7), c = "left" == p ? l + 2 : "right" == p ? -2 : l / 2, m = -90
  923. }
  924. this.marginsChanged ? (a.translate(b, c), this.tx = b, this.ty = c) : a.translate(this.tx, this.ty);
  925. this.marginsChanged = !1;
  926. 0 !== m && a.rotate(m)
  927. }
  928. },
  929. pushAxisItem: function (a, b) {
  930. var c = this,
  931. e = a.graphics();
  932. 0 < e.length() && (b ? c.labelsSet.push(e) : c.set.push(e));
  933. if (e = a.getLabel()) this.labelsSet.push(e), e.click(function (b) {
  934. c.handleMouse(b, a, "clickItem")
  935. }).mouseover(function (b) {
  936. c.handleMouse(b, a, "rollOverItem")
  937. }).mouseout(function (b) {
  938. c.handleMouse(b,
  939. a, "rollOutItem")
  940. })
  941. },
  942. handleMouse: function (a, b, c) {
  943. this.fire(c, {
  944. type: c,
  945. value: b.value,
  946. serialDataItem: b.serialDataItem,
  947. axis: this,
  948. target: b.label,
  949. chart: this.chart,
  950. event: a
  951. })
  952. },
  953. addGuide: function (a) {
  954. for (var b = this.guides, c = !1, e = b.length, h = 0; h < b.length; h++) b[h] == a && (c = !0, e = h);
  955. a = d.processObject(a, d.Guide, this.theme);
  956. a.id || (a.id = "guideAuto" + e + "_" + (new Date).getTime());
  957. c || b.push(a)
  958. },
  959. removeGuide: function (a) {
  960. var b = this.guides,
  961. c;
  962. for (c = 0; c < b.length; c++) b[c] == a && b.splice(c, 1)
  963. },
  964. handleGuideOver: function (a) {
  965. clearTimeout(this.chart.hoverInt);
  966. var b = a.graphics.getBBox(),
  967. c = b.x + b.width / 2,
  968. b = b.y + b.height / 2,
  969. e = a.fillColor;
  970. void 0 === e && (e = a.lineColor);
  971. this.chart.showBalloon(a.balloonText, e, !0, c, b)
  972. },
  973. handleGuideOut: function () {
  974. this.chart.hideBalloon()
  975. },
  976. addEventListeners: function (a, b) {
  977. var c = this;
  978. a.mouseover(function () {
  979. c.handleGuideOver(b)
  980. });
  981. a.touchstart(function () {
  982. c.handleGuideOver(b)
  983. });
  984. a.mouseout(function () {
  985. c.handleGuideOut(b)
  986. })
  987. },
  988. getBBox: function () {
  989. var a = this.labelsSet.getBBox();
  990. d.VML || (a = {
  991. x: a.x + this.x,
  992. y: a.y + this.y,
  993. width: a.width,
  994. height: a.height
  995. });
  996. return a
  997. },
  998. destroy: function () {
  999. d.remove(this.set);
  1000. d.remove(this.labelsSet);
  1001. var a = this.axisLine;
  1002. a && d.remove(a.set);
  1003. d.remove(this.grid0)
  1004. },
  1005. chooseMinorFrequency: function (a) {
  1006. for (var b = 10; 0 < b; b--)
  1007. if (a / b == Math.round(a / b)) return a / b
  1008. },
  1009. parseDatesDraw: function () {
  1010. var a, b = this.chart,
  1011. c = this.showFirstLabel,
  1012. e = this.showLastLabel,
  1013. h, f = "",
  1014. g = d.extractPeriod(this.minPeriod),
  1015. k = d.getPeriodDuration(g.period, g.count),
  1016. l, m, n, q, p, r = this.firstDayOfWeek,
  1017. t = this.boldPeriodBeginning;
  1018. a = this.minorGridEnabled;
  1019. var u, z = this.gridAlpha,
  1020. w,
  1021. x = this.choosePeriod(0),
  1022. v = x.period,
  1023. x = x.count,
  1024. A = d.getPeriodDuration(v, x);
  1025. A < k && (v = g.period, x = g.count, A = k);
  1026. g = v;
  1027. "WW" == g && (g = "DD");
  1028. this.stepWidth = this.getStepWidth(this.timeDifference);
  1029. var B = Math.ceil(this.timeDifference / A) + 5,
  1030. D = l = d.resetDateToMin(new Date(this.startTime - A), v, x, r).getTime();
  1031. g == v && 1 == x && this.centerLabelOnFullPeriod && (n = A * this.stepWidth);
  1032. this.cellWidth = k * this.stepWidth;
  1033. q = Math.round(l / A);
  1034. k = -1;
  1035. q / 2 == Math.round(q / 2) && (k = -2, l -= A);
  1036. q = this.firstTime;
  1037. var C = 0;
  1038. a && 1 < x && (u = this.chooseMinorFrequency(x),
  1039. w = d.getPeriodDuration(v, u));
  1040. if (0 < this.gridCountR)
  1041. for (a = k; a <= B; a++) {
  1042. p = q + A * (a + Math.floor((D - q) / A)) - C;
  1043. "DD" == v && (p += 36E5);
  1044. p = d.resetDateToMin(new Date(p), v, x, r).getTime();
  1045. "MM" == v && (h = (p - l) / A, 1.5 <= (p - l) / A && (p = p - (h - 1) * A + d.getPeriodDuration("DD", 3), p = d.resetDateToMin(new Date(p), v, 1).getTime(), C += A));
  1046. h = (p - this.startTime) * this.stepWidth;
  1047. h = this.rotate ? h + (this.x - this.viX) : "date" == this.type ? this.axisWidth - h + (this.y - this.viY) : h + (this.y - this.viY);
  1048. f = !1;
  1049. this.nextPeriod[g] && (f = this.checkPeriodChange(this.nextPeriod[g],
  1050. 1, p, l, g));
  1051. l = !1;
  1052. 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];
  1053. t || (l = !1);
  1054. this.currentDateFormat = f;
  1055. f = d.formatDate(new Date(p), f, b);
  1056. if (a == k && !c || a == B && !e) f = " ";
  1057. this.labelFunction && (f = this.labelFunction(f, new Date(p), this, v, x, m).toString());
  1058. this.boldLabels && (l = !0);
  1059. m = new this.axisItemRenderer(this, h, f, !1, n, 0, !1, l);
  1060. this.pushAxisItem(m);
  1061. m = l = p;
  1062. if (!isNaN(u))
  1063. for (h = 1; h < x; h += u) this.gridAlpha =
  1064. this.minorGridAlpha, f = p + w * h, f = d.resetDateToMin(new Date(f), v, u, r).getTime(), f = new this.axisItemRenderer(this, (f - this.startTime) * this.stepWidth), this.pushAxisItem(f);
  1065. this.gridAlpha = z
  1066. }
  1067. },
  1068. choosePeriod: function (a) {
  1069. var b = d.getPeriodDuration(this.periods[a].period, this.periods[a].count),
  1070. c = Math.ceil(this.timeDifference / b),
  1071. e = this.periods;
  1072. return this.timeDifference < b && 0 < a ? e[a - 1] : c <= this.gridCountR ? e[a] : a + 1 < e.length ? this.choosePeriod(a + 1) : e[a]
  1073. },
  1074. getStepWidth: function (a) {
  1075. var b;
  1076. this.startOnAxis ? (b = this.axisWidth /
  1077. (a - 1), 1 == a && (b = this.axisWidth)) : b = this.axisWidth / a;
  1078. return b
  1079. },
  1080. timeZoom: function (a, b) {
  1081. this.startTime = a;
  1082. this.endTime = b
  1083. },
  1084. minDuration: function () {
  1085. var a = d.extractPeriod(this.minPeriod);
  1086. return d.getPeriodDuration(a.period, a.count)
  1087. },
  1088. checkPeriodChange: function (a, b, c, e, h) {
  1089. c = new Date(c);
  1090. var f = new Date(e),
  1091. g = this.firstDayOfWeek;
  1092. e = b;
  1093. "DD" == a && (b = 1);
  1094. c = d.resetDateToMin(c, a, b, g).getTime();
  1095. b = d.resetDateToMin(f, a, b, g).getTime();
  1096. return "DD" == a && "hh" != h && c - b <= d.getPeriodDuration(a, e) ? !1 : c != b ? !0 : !1
  1097. },
  1098. generateDFObject: function () {
  1099. this.dateFormatsObject = {};
  1100. var a;
  1101. for (a = 0; a < this.dateFormats.length; a++) {
  1102. var b = this.dateFormats[a];
  1103. this.dateFormatsObject[b.period] = b.format
  1104. }
  1105. }
  1106. })
  1107. })();
  1108. (function () {
  1109. var d = window.AmCharts;
  1110. d.ValueAxis = d.Class({
  1111. inherits: d.AxisBase,
  1112. construct: function (a) {
  1113. this.cname = "ValueAxis";
  1114. this.createEvents("axisChanged", "logarithmicAxisFailed", "axisSelfZoomed", "axisZoomed");
  1115. d.ValueAxis.base.construct.call(this, a);
  1116. this.dataChanged = !0;
  1117. this.stackType = "none";
  1118. this.position = "left";
  1119. this.unitPosition = "right";
  1120. this.recalculateToPercents = this.includeHidden = this.includeGuidesInMinMax = this.integersOnly = !1;
  1121. this.durationUnits = {
  1122. DD: "d. ",
  1123. hh: ":",
  1124. mm: ":",
  1125. ss: ""
  1126. };
  1127. this.scrollbar = !1;
  1128. this.baseValue =
  1129. 0;
  1130. this.radarCategoriesEnabled = !0;
  1131. this.gridType = "polygons";
  1132. this.useScientificNotation = !1;
  1133. this.axisTitleOffset = 10;
  1134. this.minMaxMultiplier = 1;
  1135. this.logGridLimit = 2;
  1136. this.totalTextOffset = this.treatZeroAs = 0;
  1137. this.minPeriod = "ss";
  1138. d.applyTheme(this, a, this.cname)
  1139. },
  1140. updateData: function () {
  1141. 0 >= this.gridCountR && (this.gridCountR = 1);
  1142. this.totals = [];
  1143. this.data = this.chart.chartData;
  1144. var a = this.chart;
  1145. "xy" != a.type && (this.stackGraphs("smoothedLine"), this.stackGraphs("line"), this.stackGraphs("column"), this.stackGraphs("step"));
  1146. this.recalculateToPercents &&
  1147. this.recalculate();
  1148. 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())
  1149. },
  1150. draw: function () {
  1151. d.ValueAxis.base.draw.call(this);
  1152. var a = this.chart,
  1153. b = this.set;
  1154. d.setCN(a, this.set, "value-axis value-axis-" + this.id);
  1155. d.setCN(a, this.labelsSet, "value-axis value-axis-" + this.id);
  1156. d.setCN(a,
  1157. this.axisLine.axisSet, "value-axis value-axis-" + this.id);
  1158. var c = this.type;
  1159. "duration" == c && (this.duration = "ss");
  1160. !0 === this.dataChanged && (this.updateData(), this.dataChanged = !1);
  1161. "date" == c && (this.logarithmic = !1, this.min = this.minRR, this.max = this.maxRR, this.minimumDate && (this.min = this.minimumDate.getTime()), this.maximumDate && (this.max = this.maximumDate.getTime()));
  1162. if (this.logarithmic) {
  1163. var e = this.treatZeroAs,
  1164. h = this.getMin(0, this.data.length - 1);
  1165. this.minReal < h && (this.minReal = h);
  1166. isNaN(this.minReal) && (this.minReal =
  1167. h);
  1168. 0 < e && 0 === h && (this.minReal = h = e);
  1169. if (0 >= h || 0 >= this.minimum) {
  1170. this.fire("logarithmicAxisFailed", {
  1171. type: "logarithmicAxisFailed",
  1172. chart: a
  1173. });
  1174. return
  1175. }
  1176. }
  1177. this.grid0 = null;
  1178. var f, g, k = a.dx,
  1179. l = a.dy,
  1180. e = !1,
  1181. h = this.logarithmic;
  1182. if (isNaN(this.min) || isNaN(this.max) || !this.foundGraphs || Infinity == this.min || -Infinity == this.max) e = !0;
  1183. else {
  1184. var m = this.labelFrequency,
  1185. n = this.showFirstLabel,
  1186. q = this.showLastLabel,
  1187. p = 1;
  1188. f = 0;
  1189. this.minCalc = this.min;
  1190. this.maxCalc = this.max;
  1191. this.strictMinMax && (isNaN(this.minimum) || (this.min = this.minimum), isNaN(this.maximum) ||
  1192. (this.max = this.maximum));
  1193. isNaN(this.minZoom) || (this.min = this.minZoom);
  1194. isNaN(this.maxZoom) || (this.max = this.maxZoom);
  1195. var r = Math.round((this.maxCalc - this.minCalc) / this.step) + 1,
  1196. t;
  1197. !0 === h ? (t = Math.log(this.max) * Math.LOG10E - Math.log(this.minReal) * Math.LOG10E, this.stepWidth = this.axisWidth / t, t > this.logGridLimit && (r = Math.ceil(Math.log(this.max) * Math.LOG10E) + 1, f = Math.round(Math.log(this.minReal) * Math.LOG10E), r > this.gridCountR && (p = Math.ceil(r / this.gridCountR)))) : this.stepWidth = this.axisWidth / (this.max - this.min);
  1198. var u = 0;
  1199. 1 > this.step && -1 < this.step && (u = d.getDecimals(this.step));
  1200. this.integersOnly && (u = 0);
  1201. u > this.maxDecCount && (u = this.maxDecCount);
  1202. var z = this.precision;
  1203. isNaN(z) || (u = z);
  1204. this.max = d.roundTo(this.max, this.maxDecCount);
  1205. this.min = d.roundTo(this.min, this.maxDecCount);
  1206. g = {};
  1207. g.precision = u;
  1208. g.decimalSeparator = a.nf.decimalSeparator;
  1209. g.thousandsSeparator = a.nf.thousandsSeparator;
  1210. this.numberFormatter = g;
  1211. var w, x = this.guides,
  1212. v = x.length;
  1213. if (0 < v) {
  1214. var A = this.fillAlpha;
  1215. for (g = this.fillAlpha = 0; g < v; g++) {
  1216. var B = x[g],
  1217. D = NaN,
  1218. C = B.above;
  1219. isNaN(B.toValue) || (D = this.getCoordinate(B.toValue), w = new this.axisItemRenderer(this, D, "", !0, NaN, NaN, B), this.pushAxisItem(w, C));
  1220. var I = NaN;
  1221. isNaN(B.value) || (I = this.getCoordinate(B.value), w = new this.axisItemRenderer(this, I, B.label, !0, NaN, (D - I) / 2, B), this.pushAxisItem(w, C));
  1222. isNaN(D - I) || (w = new this.guideFillRenderer(this, I, D, B), this.pushAxisItem(w, C), w = w.graphics(), B.graphics = w, B.balloonText && this.addEventListeners(w, B))
  1223. }
  1224. this.fillAlpha = A
  1225. }
  1226. this.exponential = !1;
  1227. for (g = f; g < r; g += p) x = d.roundTo(this.step * g + this.min,
  1228. u), -1 != String(x).indexOf("e") && (this.exponential = !0);
  1229. this.duration && (this.maxInterval = d.getMaxInterval(this.max, this.duration));
  1230. var u = this.step,
  1231. H, x = this.minorGridAlpha;
  1232. this.minorGridEnabled && (H = this.getMinorGridStep(u, this.stepWidth * u));
  1233. 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();
  1234. else
  1235. for (g = f; g < r; g += p)
  1236. if (c = u * g + this.minCalc, h && this.max - this.min > 10 * this.min && (c -= this.min),
  1237. c = d.roundTo(c, this.maxDecCount + 1), !this.integersOnly || Math.round(c) == c)
  1238. if (isNaN(z) || Number(d.toFixed(c, z)) == c) {
  1239. !0 === h && (0 === c && (c = this.minReal), t > this.logGridLimit && (c = Math.pow(10, g)));
  1240. w = this.formatValue(c, !1, g);
  1241. Math.round(g / m) != g / m && (w = void 0);
  1242. if (0 === g && !n || g == r - 1 && !q) w = " ";
  1243. f = this.getCoordinate(c);
  1244. w = new this.axisItemRenderer(this, f, w, void 0, void 0, void 0, void 0, this.boldLabels);
  1245. this.pushAxisItem(w);
  1246. if (c == this.baseValue && "radar" != a.type) {
  1247. var O, J, A = this.viW,
  1248. B = this.viH;
  1249. w = this.viX;
  1250. v = this.viY;
  1251. "H" == this.orientation ?
  1252. 0 <= f && f <= A + 1 && (O = [f, f, f + k], J = [B, 0, l]) : 0 <= f && f <= B + 1 && (O = [0, A, A + k], J = [f, f, f + l]);
  1253. O && (f = d.fitToBounds(2 * this.gridAlpha, 0, 1), f = d.line(a.container, O, J, this.gridColor, f, 1, this.dashLength), f.translate(w, v), 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"))
  1254. }
  1255. if (!isNaN(H) && 0 < x && g < r - 1) {
  1256. f = this.gridAlpha;
  1257. this.gridAlpha = this.minorGridAlpha;
  1258. for (w = 1; w < u / H; w++) v = this.getCoordinate(c + H * w), v = new this.axisItemRenderer(this, v, "", !1, 0, 0, !1, !1, 0, !0), this.pushAxisItem(v);
  1259. this.gridAlpha = f
  1260. }
  1261. } t = this.baseValue;
  1262. this.min > this.baseValue && this.max > this.baseValue && (t = this.min);
  1263. this.min < this.baseValue && this.max < this.baseValue && (t = this.max);
  1264. h && t < this.minReal && (t = this.minReal);
  1265. this.baseCoord = this.getCoordinate(t);
  1266. t = {
  1267. type: "axisChanged",
  1268. target: this,
  1269. chart: a
  1270. };
  1271. t.min = h ? this.minReal : this.min;
  1272. t.max = this.max;
  1273. this.fire("axisChanged", t);
  1274. this.axisCreated = !0
  1275. }
  1276. h = this.axisLine.set;
  1277. t = this.labelsSet;
  1278. this.positionTitle();
  1279. "radar" != a.type ? (a = this.viX, H = this.viY, b.translate(a, H), t.translate(a, H)) :
  1280. h.toFront();
  1281. !this.visible || e ? (b.hide(), h.hide(), t.hide()) : (b.show(), h.show(), t.show());
  1282. this.axisY = this.y - this.viY;
  1283. this.axisX = this.x - this.viX
  1284. },
  1285. formatValue: function (a, b, c) {
  1286. var e = this.exponential,
  1287. h = this.logarithmic,
  1288. f = this.numberFormatter,
  1289. g = this.chart;
  1290. !0 === this.logarithmic && (e = -1 != String(a).indexOf("e") ? !0 : !1);
  1291. this.useScientificNotation && (e = !0);
  1292. this.usePrefixes && (e = !1);
  1293. e ? (b = -1 == String(a).indexOf("e") ? a.toExponential(15) : String(a), c = b.split("e"), b = Number(c[0]), c = Number(c[1]), b = d.roundTo(b, 14), 10 == b && (b =
  1294. 1, c += 1), b = b + "e" + c, 0 === a && (b = "0"), 1 == a && (b = "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), b = this.usePrefixes ? d.addPrefix(a, g.prefixesOfBigNumbers, g.prefixesOfSmallNumbers, f, !b) : d.formatNumber(a, f, f.precision));
  1295. this.duration && (b = d.formatDuration(a, this.duration, "", this.durationUnits, this.maxInterval, f));
  1296. "date" == this.type && (b = d.formatDate(new Date(a), this.currentDateFormat, g));
  1297. this.recalculateToPercents ? b += "%" : (f =
  1298. this.unit) && (b = "left" == this.unitPosition ? f + b : b + f);
  1299. this.labelFunction && (b = this.labelFunction(a, b, this).toString());
  1300. return b
  1301. },
  1302. getMinorGridStep: function (a, b) {
  1303. var c = [5, 4, 2];
  1304. 60 > b && c.shift();
  1305. for (var e = Math.floor(Math.log(Math.abs(a)) * Math.LOG10E), h = 0; h < c.length; h++) {
  1306. var d = a / c[h],
  1307. g = Math.floor(Math.log(Math.abs(d)) * Math.LOG10E);
  1308. if (!(0 < Math.abs(e - g)))
  1309. if (1 > a) {
  1310. if (g = Math.pow(10, -g) * d, g == Math.round(g)) return d
  1311. } else if (d == Math.round(d)) return d
  1312. }
  1313. },
  1314. stackGraphs: function (a) {
  1315. var b = this.stackType;
  1316. "stacked" == b && (b = "regular");
  1317. "line" == b && (b = "none");
  1318. "100% stacked" == b && (b = "100%");
  1319. this.stackType = b;
  1320. var c = [],
  1321. e = [],
  1322. h = [],
  1323. f = [],
  1324. g, k = this.chart.graphs,
  1325. l, m, n, q, p = this.baseValue,
  1326. r = !1;
  1327. if ("line" == a || "step" == a || "smoothedLine" == a) r = !0;
  1328. if (r && ("regular" == b || "100%" == b))
  1329. for (q = 0; q < k.length; q++) n = k[q], n.hidden || (m = n.type, n.chart == this.chart && n.valueAxis == this && a == m && n.stackable && (l && (n.stackGraph = l), l = n));
  1330. for (l = this.start; l <= this.end; l++) {
  1331. var t = 0;
  1332. for (q = 0; q < k.length; q++)
  1333. if (n = k[q], n.hidden) n.newStack && (h[l] = NaN, e[l] = NaN);
  1334. else if (m = n.type, n.chart ==
  1335. this.chart && n.valueAxis == this && a == m && n.stackable)
  1336. if (m = this.data[l].axes[this.id].graphs[n.id], g = m.values.value, isNaN(g)) n.newStack && (h[l] = NaN, e[l] = NaN);
  1337. else {
  1338. var u = d.getDecimals(g);
  1339. t < u && (t = u);
  1340. isNaN(f[l]) ? f[l] = Math.abs(g) : f[l] += Math.abs(g);
  1341. f[l] = d.roundTo(f[l], t);
  1342. u = n.fillToGraph;
  1343. r && u && (u = this.data[l].axes[this.id].graphs[u.id]) && (m.values.open = u.values.value);
  1344. "regular" == b && (r && (isNaN(c[l]) ? (c[l] = g, m.values.close = g, m.values.open = this.baseValue) : (isNaN(g) ? m.values.close = c[l] : m.values.close = g + c[l], m.values.open =
  1345. c[l], c[l] = m.values.close)), "column" == a && (n.newStack && (h[l] = NaN, e[l] = NaN), m.values.close = g, 0 > g ? (m.values.close = g, isNaN(e[l]) ? m.values.open = p : (m.values.close += e[l], m.values.open = e[l]), e[l] = m.values.close) : (m.values.close = g, isNaN(h[l]) ? m.values.open = p : (m.values.close += h[l], m.values.open = h[l]), h[l] = m.values.close)))
  1346. }
  1347. }
  1348. for (l = this.start; l <= this.end; l++)
  1349. for (q = 0; q < k.length; q++)(n = k[q], n.hidden) ? n.newStack && (h[l] = NaN, e[l] = NaN) : (m = n.type, n.chart == this.chart && n.valueAxis == this && a == m && n.stackable && (m = this.data[l].axes[this.id].graphs[n.id],
  1350. g = m.values.value, isNaN(g) || (c = g / f[l] * 100, m.values.percents = c, m.values.total = f[l], n.newStack && (h[l] = NaN, e[l] = NaN), "100%" == b && (isNaN(e[l]) && (e[l] = 0), isNaN(h[l]) && (h[l] = 0), 0 > c ? (m.values.close = d.fitToBounds(c + e[l], -100, 100), m.values.open = e[l], e[l] = m.values.close) : (m.values.close = d.fitToBounds(c + h[l], -100, 100), m.values.open = h[l], h[l] = m.values.close)))))
  1351. },
  1352. recalculate: function () {
  1353. var a = this.chart,
  1354. b = a.graphs,
  1355. c;
  1356. for (c = 0; c < b.length; c++) {
  1357. var e = b[c];
  1358. if (e.valueAxis == this) {
  1359. var h = "value";
  1360. if ("candlestick" == e.type ||
  1361. "ohlc" == e.type) h = "open";
  1362. var f, g, k = this.end + 2,
  1363. k = d.fitToBounds(this.end + 1, 0, this.data.length - 1),
  1364. l = this.start;
  1365. 0 < l && l--;
  1366. var m;
  1367. g = this.start;
  1368. e.compareFromStart && (g = 0);
  1369. if (!isNaN(a.startTime) && (m = a.categoryAxis)) {
  1370. var n = m.minDuration(),
  1371. n = new Date(a.startTime + n / 2),
  1372. q = d.resetDateToMin(new Date(a.startTime), m.minPeriod).getTime();
  1373. d.resetDateToMin(new Date(n), m.minPeriod).getTime() > q && g++
  1374. }
  1375. if (m = a.recalculateFromDate) m = d.getDate(m, a.dataDateFormat, "fff"), g = a.getClosestIndex(a.chartData, "time", m.getTime(), !0, 0, a.chartData.length),
  1376. k = a.chartData.length - 1;
  1377. for (m = g; m <= k && (g = this.data[m].axes[this.id].graphs[e.id], f = g.values[h], isNaN(f)); m++);
  1378. this.recBaseValue = f;
  1379. for (h = l; h <= k; h++) {
  1380. g = this.data[h].axes[this.id].graphs[e.id];
  1381. g.percents = {};
  1382. var l = g.values,
  1383. p;
  1384. for (p in l) g.percents[p] = "percents" != p ? l[p] / f * 100 - 100 : l[p]
  1385. }
  1386. }
  1387. }
  1388. },
  1389. getMinMax: function () {
  1390. var a = !1,
  1391. b = this.chart,
  1392. c = b.graphs,
  1393. e;
  1394. for (e = 0; e < c.length; e++) {
  1395. var h = c[e].type;
  1396. ("line" == h || "step" == h || "smoothedLine" == h) && this.expandMinMax && (a = !0)
  1397. }
  1398. a && (0 < this.start && this.start--, this.end < this.data.length -
  1399. 1 && this.end++);
  1400. "serial" == b.type && (!0 !== b.categoryAxis.parseDates || a || this.end < this.data.length - 1 && this.end++);
  1401. a = this.minMaxMultiplier;
  1402. this.min = this.getMin(this.start, this.end);
  1403. this.max = this.getMax();
  1404. this.minRR = this.min;
  1405. this.maxRR = this.max;
  1406. a = (this.max - this.min) * (a - 1);
  1407. this.min -= a;
  1408. this.max += a;
  1409. a = this.guides.length;
  1410. if (this.includeGuidesInMinMax && 0 < a)
  1411. 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 >
  1412. this.max && (this.max = c.value);
  1413. isNaN(this.minimum) || (this.min = this.minimum);
  1414. isNaN(this.maximum) || (this.max = this.maximum);
  1415. this.minimumDate && (this.min = this.minimumDate.getTime());
  1416. this.maximumDate && (this.max = this.maximumDate.getTime());
  1417. this.min > this.max && (a = this.max, this.max = this.min, this.min = a);
  1418. isNaN(this.minTemp) || (this.min = this.minTemp);
  1419. isNaN(this.maxTemp) || (this.max = this.maxTemp);
  1420. this.minReal = this.min;
  1421. this.maxReal = this.max;
  1422. 0 === this.min && 0 === this.max && (this.max = 9);
  1423. this.min > this.max && (this.min = this.max -
  1424. 1);
  1425. a = this.min;
  1426. b = this.max;
  1427. c = this.max - this.min;
  1428. e = 0 === c ? Math.pow(10, Math.floor(Math.log(Math.abs(this.max)) * Math.LOG10E)) / 10 : Math.pow(10, Math.floor(Math.log(Math.abs(c)) * Math.LOG10E)) / 10;
  1429. isNaN(this.maximum) && isNaN(this.maxTemp) && (this.max = Math.ceil(this.max / e) * e + e);
  1430. isNaN(this.minimum) && isNaN(this.minTemp) && (this.min = Math.floor(this.min / e) * e - e);
  1431. 0 > this.min && 0 <= a && (this.min = 0);
  1432. 0 < this.max && 0 >= b && (this.max = 0);
  1433. "100%" == this.stackType && (this.min = 0 > this.min ? -100 : 0, this.max = 0 > this.max ? 0 : 100);
  1434. c = this.max - this.min;
  1435. e = Math.pow(10, Math.floor(Math.log(Math.abs(c)) * Math.LOG10E)) / 10;
  1436. this.step = Math.ceil(c / this.gridCountR / e) * e;
  1437. c = Math.pow(10, Math.floor(Math.log(Math.abs(this.step)) * Math.LOG10E));
  1438. c = d.fixStepE(c);
  1439. e = Math.ceil(this.step / c);
  1440. 5 < e && (e = 10);
  1441. 5 >= e && 2 < e && (e = 5);
  1442. this.step = Math.ceil(this.step / (c * e)) * c * e;
  1443. 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;
  1444. this.min = this.step * Math.floor(this.min /
  1445. this.step);
  1446. this.max = this.step * Math.ceil(this.max / this.step);
  1447. 0 > this.min && 0 <= a && (this.min = 0);
  1448. 0 < this.max && 0 >= b && (this.max = 0);
  1449. 1 < this.minReal && 1 < this.max - this.minReal && (this.minReal = Math.floor(this.minReal));
  1450. c = Math.pow(10, Math.floor(Math.log(Math.abs(this.minReal)) * Math.LOG10E));
  1451. 0 === this.min && (this.minReal = c);
  1452. 0 === this.min && 1 < this.minReal && (this.minReal = 1);
  1453. 0 < this.min && 0 < this.minReal - this.step && (this.minReal = this.min + this.step < this.minReal ? this.min + this.step : this.min);
  1454. this.logarithmic && (2 < Math.log(b) * Math.LOG10E -
  1455. 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)) * Math.LOG10E))) : (b = Math.pow(10, Math.floor(Math.log(Math.abs(this.min)) * Math.LOG10E)) / 10, a = Math.pow(10, Math.floor(Math.log(Math.abs(a)) * Math.LOG10E)) / 10, b < a && (this.minReal = this.min = 10 * a)))
  1456. },
  1457. getMin: function (a, b) {
  1458. var c, e;
  1459. for (e = a; e <= b; e++) {
  1460. var h = this.data[e].axes[this.id].graphs,
  1461. d;
  1462. for (d in h)
  1463. if (h.hasOwnProperty(d)) {
  1464. var g = this.chart.getGraphById(d);
  1465. if (g.includeInMinMax && (!g.hidden || this.includeHidden)) {
  1466. isNaN(c) && (c = Infinity);
  1467. this.foundGraphs = !0;
  1468. g = h[d].values;
  1469. this.recalculateToPercents && (g = h[d].percents);
  1470. var k;
  1471. if (this.minMaxField) k = g[this.minMaxField], k < c && (c = k);
  1472. else
  1473. for (var l in g) g.hasOwnProperty(l) && "percents" != l && "total" != l && (k = g[l], k < c && (c = k))
  1474. }
  1475. }
  1476. }
  1477. return c
  1478. },
  1479. getMax: function () {
  1480. var a, b;
  1481. for (b = this.start; b <= this.end; b++) {
  1482. var c = this.data[b].axes[this.id].graphs,
  1483. e;
  1484. for (e in c)
  1485. if (c.hasOwnProperty(e)) {
  1486. var d = this.chart.getGraphById(e);
  1487. if (d.includeInMinMax &&
  1488. (!d.hidden || this.includeHidden)) {
  1489. isNaN(a) && (a = -Infinity);
  1490. this.foundGraphs = !0;
  1491. d = c[e].values;
  1492. this.recalculateToPercents && (d = c[e].percents);
  1493. var f;
  1494. if (this.minMaxField) f = d[this.minMaxField], f > a && (a = f);
  1495. else
  1496. for (var g in d) d.hasOwnProperty(g) && "percents" != g && "total" != g && (f = d[g], f > a && (a = f))
  1497. }
  1498. }
  1499. }
  1500. return a
  1501. },
  1502. dispatchZoomEvent: function (a, b) {
  1503. var c = {
  1504. type: "axisZoomed",
  1505. startValue: a,
  1506. endValue: b,
  1507. target: this,
  1508. chart: this.chart
  1509. };
  1510. this.fire(c.type, c)
  1511. },
  1512. zoomOut: function () {
  1513. var a = this.chart;
  1514. "xy" != a.type && (this.maxZoom = this.minZoom =
  1515. void 0, a.updateAfterValueZoom())
  1516. },
  1517. zoomToValues: function (a, b) {
  1518. var c = this.chart;
  1519. "xy" == c.type ? (b < a && (c = b, b = a, a = c), a < this.min && (a = this.min), b > this.max && (b = this.max), c = {
  1520. type: "axisSelfZoomed"
  1521. }, c.chart = this.chart, c.valueAxis = this, c.multiplier = this.axisWidth / Math.abs(this.getCoordinate(b) - this.getCoordinate(a)), c.startValue = a, c.endValue = b, c.position = "V" == this.orientation ? this.reversed ? this.getCoordinate(a) : this.getCoordinate(b) : this.reversed ? this.getCoordinate(b) : this.getCoordinate(a), this.fire(c.type, c)) :
  1522. (this.minZoom = a, this.maxZoom = b, c.updateAfterValueZoom())
  1523. },
  1524. coordinateToValue: function (a) {
  1525. if (isNaN(a)) return NaN;
  1526. var b = this.axisWidth,
  1527. c = this.stepWidth,
  1528. e = this.reversed,
  1529. d = this.rotate,
  1530. f = this.min,
  1531. g = this.minReal;
  1532. 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
  1533. },
  1534. getCoordinate: function (a) {
  1535. if (isNaN(a)) return NaN;
  1536. var b = this.rotate,
  1537. c = this.reversed,
  1538. e = this.axisWidth,
  1539. d = this.stepWidth,
  1540. f = this.min,
  1541. g = this.minReal;
  1542. !0 ===
  1543. this.logarithmic ? (0 === a && (a = this.treatZeroAs), a = Math.log(a) * Math.LOG10E - Math.log(g) * Math.LOG10E, b = b ? !0 === c ? e - d * a : d * a : !0 === c ? d * a : e - d * a) : b = !0 === c ? b ? e - d * (a - f) : d * (a - f) : b ? d * (a - f) : e - d * (a - f);
  1544. b = this.rotate ? b + (this.x - this.viX) : b + (this.y - this.viY);
  1545. 1E7 < Math.abs(b) && (b = 1E7 * (b / Math.abs(b)));
  1546. return Math.round(b)
  1547. },
  1548. synchronizeWithAxis: function (a) {
  1549. this.synchronizeWith = a;
  1550. this.listenTo(this.synchronizeWith, "axisChanged", this.handleSynchronization)
  1551. },
  1552. handleSynchronization: function () {
  1553. var a = this.synchronizeWith,
  1554. b = a.min,
  1555. c = a.max,
  1556. a = a.step,
  1557. e = this.synchronizationMultiplier;
  1558. e && (this.min = b * e, this.max = c * e, this.step = a * e, b = Math.pow(10, Math.floor(Math.log(Math.abs(this.step)) * Math.LOG10E)), b = Math.abs(Math.log(Math.abs(b)) * Math.LOG10E), this.maxDecCount = b = Math.round(b), this.draw())
  1559. }
  1560. })
  1561. })();
  1562. (function () {
  1563. var d = window.AmCharts;
  1564. d.RecAxis = d.Class({
  1565. construct: function (a) {
  1566. var b = a.chart,
  1567. c = a.axisThickness,
  1568. e = a.axisColor,
  1569. h = a.axisAlpha,
  1570. f = a.offset,
  1571. g = a.dx,
  1572. k = a.dy,
  1573. l = a.viX,
  1574. m = a.viY,
  1575. n = a.viH,
  1576. q = a.viW,
  1577. p = b.container;
  1578. "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));
  1579. e.translate(c,
  1580. k);
  1581. c = b.container.set();
  1582. c.push(e);
  1583. b.axesSet.push(c);
  1584. d.setCN(b, e, a.bcn + "line");
  1585. this.axisSet = c;
  1586. this.set = e
  1587. }
  1588. })
  1589. })();
  1590. (function () {
  1591. var d = window.AmCharts;
  1592. d.RecItem = d.Class({
  1593. construct: function (a, b, c, e, h, f, g, k, l, m, n, q) {
  1594. b = Math.round(b);
  1595. var p = a.chart;
  1596. this.value = c;
  1597. void 0 == c && (c = "");
  1598. l || (l = 0);
  1599. void 0 == e && (e = !0);
  1600. var r = p.fontFamily,
  1601. t = a.fontSize;
  1602. void 0 == t && (t = p.fontSize);
  1603. var u = a.color;
  1604. void 0 == u && (u = p.color);
  1605. void 0 !== n && (u = n);
  1606. var z = a.chart.container,
  1607. w = z.set();
  1608. this.set = w;
  1609. var x = a.axisThickness,
  1610. v = a.axisColor,
  1611. A = a.axisAlpha,
  1612. B = a.tickLength,
  1613. D = a.gridAlpha,
  1614. C = a.gridThickness,
  1615. I = a.gridColor,
  1616. H = a.dashLength,
  1617. O = a.fillColor,
  1618. J = a.fillAlpha,
  1619. da = a.labelsEnabled;
  1620. n = a.labelRotation;
  1621. var pa = a.counter,
  1622. U = a.inside,
  1623. na = a.labelOffset,
  1624. qa = a.dx,
  1625. ja = a.dy,
  1626. Pa = a.orientation,
  1627. aa = a.position,
  1628. Z = a.previousCoord,
  1629. V = a.viH,
  1630. sa = a.viW,
  1631. ba = a.offset,
  1632. ca, ta;
  1633. g ? (void 0 !== g.id && (q = p.classNamePrefix + "-guide-" + g.id), da = !0, isNaN(g.tickLength) || (B = g.tickLength), void 0 != g.lineColor && (I = g.lineColor), void 0 != g.color && (u = g.color), isNaN(g.lineAlpha) || (D = g.lineAlpha), isNaN(g.dashLength) || (H = g.dashLength), isNaN(g.lineThickness) || (C = g.lineThickness), !0 === g.inside && (U = !0), isNaN(g.labelRotation) || (n = g.labelRotation),
  1634. isNaN(g.fontSize) || (t = g.fontSize), g.position && (aa = g.position), void 0 !== g.boldLabel && (k = g.boldLabel), isNaN(g.labelOffset) || (na = g.labelOffset)) : "" === c && (B = 0);
  1635. var ia = "start";
  1636. h && (ia = "middle");
  1637. var Q = n * Math.PI / 180,
  1638. W, wa, G = 0,
  1639. y = 0,
  1640. ka = 0,
  1641. ea = W = 0,
  1642. Qa = 0;
  1643. "V" == Pa && (n = 0);
  1644. var Y;
  1645. da && "" !== c && (Y = a.autoWrap && 0 === n ? d.wrappedText(z, c, u, r, t, ia, k, h, 0) : d.text(z, c, u, r, t, ia, k), ia = Y.getBBox(), ea = ia.width, Qa = ia.height);
  1646. if ("H" == Pa) {
  1647. if (0 <= b && b <= sa + 1 && (0 < B && 0 < A && b + l <= sa + 1 && (ca = d.line(z, [b + l, b + l], [0, B], v, A, C), w.push(ca)), 0 < D && (ta = d.line(z,
  1648. [b, b + qa, b + qa], [V, V + ja, ja], I, D, C, H), w.push(ta))), y = 0, G = b, g && 90 == n && U && (G -= t), !1 === e ? (ia = "start", y = "bottom" == aa ? U ? y + B : y - B : U ? y - B : y + B, G += 3, h && (G += h / 2 - 3, ia = "middle"), 0 < n && (ia = "middle")) : ia = "middle", 1 == pa && 0 < J && !g && !m && Z < sa && (e = d.fitToBounds(b, 0, sa), Z = d.fitToBounds(Z, 0, sa), W = e - Z, 0 < W && (wa = d.rect(z, W, a.height, O, J), wa.translate(e - W + qa, ja), w.push(wa))), "bottom" == aa ? (y += V + t / 2 + ba, U ? (0 < n ? (y = V - ea / 2 * Math.sin(Q) - B - 3, G += ea / 2 * Math.cos(Q) - 4 + 2) : 0 > n ? (y = V + ea * Math.sin(Q) - B - 3 + 2, G += -ea * Math.cos(Q) - Qa * Math.sin(Q) - 4) : y -= B +
  1649. t + 3 + 3, y -= na) : (0 < n ? (y = V + ea / 2 * Math.sin(Q) + B + 3, G -= ea / 2 * Math.cos(Q)) : 0 > n ? (y = V + B + 3 - ea / 2 * Math.sin(Q) + 2, G += ea / 2 * Math.cos(Q)) : y += B + x + 3 + 3, y += na)) : (y += ja + t / 2 - ba, G += qa, U ? (0 < n ? (y = ea / 2 * Math.sin(Q) + B + 3, G -= ea / 2 * Math.cos(Q)) : y += B + 3, y += na) : (0 < n ? (y = -(ea / 2) * Math.sin(Q) - B - 6, G += ea / 2 * Math.cos(Q)) : y -= B + t + 3 + x + 3, y -= na)), "bottom" == aa ? W = (U ? V - B - 1 : V + x - 1) + ba : (ka = qa, W = (U ? ja : ja - B - x + 1) - ba), f && (G += f), f = G, 0 < n && (f += ea / 2 * Math.cos(Q)), Y && (t = 0, U && (t = ea / 2 * Math.cos(Q)), f + t > sa + 2 || 0 > f)) Y.remove(), Y = null
  1650. } else {
  1651. 0 <= b && b <= V + 1 && (0 < B && 0 < A && b + l <=
  1652. V + 1 && (ca = d.line(z, [0, B], [b + l, b + l], v, A, C), w.push(ca)), 0 < D && (ta = d.line(z, [0, qa, sa + qa], [b, b + ja, b + ja], I, D, C, H), w.push(ta)));
  1653. ia = "end";
  1654. if (!0 === U && "left" == aa || !1 === U && "right" == aa) ia = "start";
  1655. y = b - t / 2;
  1656. 1 == pa && 0 < J && !g && !m && (e = d.fitToBounds(b, 0, V), Z = d.fitToBounds(Z, 0, V), Q = e - Z, wa = d.polygon(z, [0, a.width, a.width, 0], [0, 0, Q, Q], O, J), wa.translate(qa, e - Q + ja), w.push(wa));
  1657. y += t / 2;
  1658. "right" == aa ? (G += qa + sa + ba, y += ja, U ? (f || (y -= t / 2 + 3), G = G - (B + 4) - na) : (G += B + 4 + x, y -= 2, G += na)) : U ? (G += B + 4 - ba, f || (y -= t / 2 + 3), g && (G += qa, y += ja), G += na) : (G += -B -
  1659. x - 4 - 2 - ba, y -= 2, G -= na);
  1660. ca && ("right" == aa ? (ka += qa + ba + sa, W += ja, ka = U ? ka - x : ka + x) : (ka -= ba, U || (ka -= B + x)));
  1661. f && (y += f);
  1662. U = -3;
  1663. "right" == aa && (U += ja);
  1664. Y && (y > V + 1 || y < U) && (Y.remove(), Y = null)
  1665. }
  1666. ca && (ca.translate(ka, W), d.setCN(p, ca, a.bcn + "tick"), d.setCN(p, ca, q, !0), g && d.setCN(p, ca, "guide"));
  1667. !1 === a.visible && (ca && ca.remove(), Y && (Y.remove(), Y = null));
  1668. Y && (Y.attr({
  1669. "text-anchor": ia
  1670. }), Y.translate(G, y), 0 !== n && Y.rotate(-n, a.chart.backgroundColor), a.allLabels.push(Y), this.label = Y, d.setCN(p, Y, a.bcn + "label"), d.setCN(p, Y, q, !0), g && d.setCN(p,
  1671. Y, "guide"));
  1672. ta && (d.setCN(p, ta, a.bcn + "grid"), d.setCN(p, ta, q, !0), g && d.setCN(p, ta, "guide"));
  1673. wa && (d.setCN(p, wa, a.bcn + "fill"), d.setCN(p, wa, q, !0));
  1674. m ? ta && d.setCN(p, ta, a.bcn + "grid-minor") : (a.counter = 0 === pa ? 1 : 0, a.previousCoord = b);
  1675. 0 === this.set.node.childNodes.length && this.set.remove()
  1676. },
  1677. graphics: function () {
  1678. return this.set
  1679. },
  1680. getLabel: function () {
  1681. return this.label
  1682. }
  1683. })
  1684. })();
  1685. (function () {
  1686. var d = window.AmCharts;
  1687. d.RecFill = d.Class({
  1688. construct: function (a, b, c, e) {
  1689. var h = a.dx,
  1690. f = a.dy,
  1691. g = a.orientation,
  1692. k = 0;
  1693. if (c < b) {
  1694. var l = b;
  1695. b = c;
  1696. c = l
  1697. }
  1698. var m = e.fillAlpha;
  1699. isNaN(m) && (m = 0);
  1700. var l = a.chart.container,
  1701. n = e.fillColor;
  1702. "V" == g ? (b = d.fitToBounds(b, 0, a.viH), c = d.fitToBounds(c, 0, a.viH)) : (b = d.fitToBounds(b, 0, a.viW), c = d.fitToBounds(c, 0, a.viW));
  1703. c -= b;
  1704. isNaN(c) && (c = 4, k = 2, m = 0);
  1705. 0 > c && "object" == typeof n && (n = n.join(",").split(",").reverse());
  1706. "V" == g ? (g = d.rect(l, a.viW, c, n, m), g.translate(h, b - k + f)) : (g = d.rect(l, c, a.viH, n,
  1707. m), g.translate(b - k + h, f));
  1708. d.setCN(a.chart, g, "guide-fill");
  1709. e.id && d.setCN(a.chart, g, "guide-fill-" + e.id);
  1710. this.set = l.set([g])
  1711. },
  1712. graphics: function () {
  1713. return this.set
  1714. },
  1715. getLabel: function () {}
  1716. })
  1717. })();
  1718. (function () {
  1719. var d = window.AmCharts;
  1720. d.AmChart = d.Class({
  1721. construct: function (a) {
  1722. this.theme = a;
  1723. this.classNamePrefix = "amcharts";
  1724. this.addClassNames = !1;
  1725. this.version = "3.14.4";
  1726. d.addChart(this);
  1727. this.createEvents("dataUpdated", "init", "rendered", "drawn", "failed", "resized");
  1728. this.height = this.width = "100%";
  1729. this.dataChanged = !0;
  1730. this.chartCreated = !1;
  1731. this.previousWidth = this.previousHeight = 0;
  1732. this.backgroundColor = "#FFFFFF";
  1733. this.borderAlpha = this.backgroundAlpha = 0;
  1734. this.color = this.borderColor = "#000000";
  1735. this.fontFamily = "Verdana";
  1736. this.fontSize = 11;
  1737. this.usePrefixes = !1;
  1738. this.addCodeCredits = this.autoResize = !0;
  1739. this.precision = -1;
  1740. this.percentPrecision = 2;
  1741. this.decimalSeparator = ".";
  1742. this.thousandsSeparator = ",";
  1743. this.labels = [];
  1744. this.allLabels = [];
  1745. this.titles = [];
  1746. this.marginRight = this.marginLeft = this.autoMarginOffset = 0;
  1747. this.timeOuts = [];
  1748. this.creditsPosition = "top-left";
  1749. var b = document.createElement("div"),
  1750. c = b.style;
  1751. c.overflow = "hidden";
  1752. c.position = "relative";
  1753. c.textAlign = "left";
  1754. this.chartDiv = b;
  1755. b = document.createElement("div");
  1756. c = b.style;
  1757. c.overflow =
  1758. "hidden";
  1759. c.position = "relative";
  1760. c.textAlign = "left";
  1761. this.legendDiv = b;
  1762. this.titleHeight = 0;
  1763. this.hideBalloonTime = 150;
  1764. this.handDrawScatter = 2;
  1765. this.handDrawThickness = 1;
  1766. this.prefixesOfBigNumbers = [{
  1767. number: 1E3,
  1768. prefix: "k"
  1769. }, {
  1770. number: 1E6,
  1771. prefix: "M"
  1772. }, {
  1773. number: 1E9,
  1774. prefix: "G"
  1775. }, {
  1776. number: 1E12,
  1777. prefix: "T"
  1778. }, {
  1779. number: 1E15,
  1780. prefix: "P"
  1781. }, {
  1782. number: 1E18,
  1783. prefix: "E"
  1784. }, {
  1785. number: 1E21,
  1786. prefix: "Z"
  1787. }, {
  1788. number: 1E24,
  1789. prefix: "Y"
  1790. }];
  1791. this.prefixesOfSmallNumbers = [{
  1792. number: 1E-24,
  1793. prefix: "y"
  1794. }, {
  1795. number: 1E-21,
  1796. prefix: "z"
  1797. }, {
  1798. number: 1E-18,
  1799. prefix: "a"
  1800. }, {
  1801. number: 1E-15,
  1802. prefix: "f"
  1803. }, {
  1804. number: 1E-12,
  1805. prefix: "p"
  1806. }, {
  1807. number: 1E-9,
  1808. prefix: "n"
  1809. }, {
  1810. number: 1E-6,
  1811. prefix: "\u03bc"
  1812. }, {
  1813. number: .001,
  1814. prefix: "m"
  1815. }];
  1816. this.panEventsEnabled = !0;
  1817. this.product = "amcharts";
  1818. this.animations = [];
  1819. this.balloon = new d.AmBalloon(this.theme);
  1820. this.balloon.chart = this;
  1821. d.applyTheme(this, a, "AmChart")
  1822. },
  1823. drawChart: function () {
  1824. this.drawBackground();
  1825. this.redrawLabels();
  1826. this.drawTitles();
  1827. this.brr()
  1828. },
  1829. drawBackground: function () {
  1830. d.remove(this.background);
  1831. var a = this.container,
  1832. b = this.backgroundColor,
  1833. c = this.backgroundAlpha,
  1834. e = this.set;
  1835. d.isModern || 0 !== c || (c = .001);
  1836. var h = this.updateWidth();
  1837. this.realWidth = h;
  1838. var f = this.updateHeight();
  1839. this.realHeight = f;
  1840. b = d.polygon(a, [0, h - 1, h - 1, 0], [0, 0, f - 1, f - 1], b, c, 1, this.borderColor, this.borderAlpha);
  1841. d.setCN(this, b, "bg");
  1842. this.background = b;
  1843. e.push(b);
  1844. if (b = this.backgroundImage) a = a.image(b, 0, 0, h, f), d.setCN(this, b, "bg-image"), this.bgImg = a, e.push(a)
  1845. },
  1846. drawTitles: function () {
  1847. var a = this.titles;
  1848. if (d.ifArray(a)) {
  1849. var b = 20,
  1850. c;
  1851. for (c = 0; c < a.length; c++) {
  1852. var e = a[c],
  1853. e = d.processObject(e, d.Title, this.theme);
  1854. if (!1 !== e.enabled) {
  1855. var h =
  1856. e.color;
  1857. void 0 === h && (h = this.color);
  1858. var f = e.size;
  1859. isNaN(f) && (f = this.fontSize + 2);
  1860. isNaN(e.alpha);
  1861. var g = this.marginLeft,
  1862. h = d.text(this.container, e.text, h, this.fontFamily, f);
  1863. h.translate(g + (this.realWidth - this.marginRight - g) / 2, b);
  1864. h.node.style.pointerEvents = "none";
  1865. d.setCN(this, h, "title");
  1866. e.id && d.setCN(this, h, "title-" + e.id);
  1867. g = !0;
  1868. void 0 !== e.bold && (g = e.bold);
  1869. g && h.attr({
  1870. "font-weight": "bold"
  1871. });
  1872. h.attr({
  1873. opacity: e.alpha
  1874. });
  1875. b += f + 6;
  1876. this.freeLabelsSet.push(h)
  1877. }
  1878. }
  1879. }
  1880. },
  1881. write: function (a) {
  1882. if (a = "object" != typeof a ? document.getElementById(a) :
  1883. a) {
  1884. for (; a.firstChild;) a.removeChild(a.firstChild);
  1885. this.div = a;
  1886. a.style.overflow = "hidden";
  1887. a.style.textAlign = "left";
  1888. var b = this.chartDiv,
  1889. c = this.legendDiv,
  1890. e = this.legend,
  1891. h = c.style,
  1892. f = b.style;
  1893. this.measure();
  1894. this.previousHeight = this.divRealHeight;
  1895. this.previousWidth = this.divRealWidth;
  1896. var g, k = document.createElement("div");
  1897. g = k.style;
  1898. g.position = "relative";
  1899. this.containerDiv = k;
  1900. k.className = this.classNamePrefix + "-main-div";
  1901. b.className = this.classNamePrefix + "-chart-div";
  1902. a.appendChild(k);
  1903. var l = this.exportConfig;
  1904. l && d.AmExport &&
  1905. !this.AmExport && (this.AmExport = new d.AmExport(this, l));
  1906. this.amExport && d.AmExport && (this.AmExport = d.extend(this.amExport, new d.AmExport(this), !0));
  1907. this.AmExport && this.AmExport.init && this.AmExport.init();
  1908. if (e)
  1909. if (e = this.addLegend(e, e.divId), e.enabled) switch (e.position) {
  1910. case "bottom":
  1911. k.appendChild(b);
  1912. k.appendChild(c);
  1913. break;
  1914. case "top":
  1915. k.appendChild(c);
  1916. k.appendChild(b);
  1917. break;
  1918. case "absolute":
  1919. g.width = a.style.width;
  1920. g.height = a.style.height;
  1921. h.position = "absolute";
  1922. f.position = "absolute";
  1923. void 0 !== e.left && (h.left =
  1924. e.left + "px");
  1925. void 0 !== e.right && (h.right = e.right + "px");
  1926. void 0 !== e.top && (h.top = e.top + "px");
  1927. void 0 !== e.bottom && (h.bottom = e.bottom + "px");
  1928. e.marginLeft = 0;
  1929. e.marginRight = 0;
  1930. k.appendChild(b);
  1931. k.appendChild(c);
  1932. break;
  1933. case "right":
  1934. g.width = a.style.width;
  1935. g.height = a.style.height;
  1936. h.position = "relative";
  1937. f.position = "absolute";
  1938. k.appendChild(b);
  1939. k.appendChild(c);
  1940. break;
  1941. case "left":
  1942. g.width = a.style.width;
  1943. g.height = a.style.height;
  1944. h.position = "absolute";
  1945. f.position = "relative";
  1946. k.appendChild(b);
  1947. k.appendChild(c);
  1948. break;
  1949. case "outside":
  1950. k.appendChild(b)
  1951. } else k.appendChild(b);
  1952. else k.appendChild(b);
  1953. this.listenersAdded || (this.addListeners(), this.listenersAdded = !0);
  1954. this.initChart()
  1955. }
  1956. },
  1957. createLabelsSet: function () {
  1958. d.remove(this.labelsSet);
  1959. this.labelsSet = this.container.set();
  1960. this.freeLabelsSet.push(this.labelsSet)
  1961. },
  1962. initChart: function () {
  1963. window.AmCharts_path && (this.path = window.AmCharts_path);
  1964. void 0 === this.path && (this.path = d.getPath());
  1965. void 0 === this.path && (this.path = "amcharts/");
  1966. this.path = d.normalizeUrl(this.path);
  1967. void 0 === this.pathToImages && (this.pathToImages = this.path + "images/");
  1968. this.initHC || (d.callInitHandler(this), this.initHC = !0);
  1969. this.renderFix();
  1970. d.applyLang(this.language, this);
  1971. var a = this.numberFormatter;
  1972. a && (isNaN(a.precision) || (this.precision = a.precision), void 0 !== a.thousandsSeparator && (this.thousandsSeparator = a.thousandsSeparator), void 0 !== a.decimalSeparator && (this.decimalSeparator = a.decimalSeparator));
  1973. (a = this.percentFormatter) && !isNaN(a.precision) && (this.percentPrecision = a.precision);
  1974. this.nf = {
  1975. precision: this.precision,
  1976. thousandsSeparator: this.thousandsSeparator,
  1977. decimalSeparator: this.decimalSeparator
  1978. };
  1979. this.pf = {
  1980. precision: this.percentPrecision,
  1981. thousandsSeparator: this.thousandsSeparator,
  1982. decimalSeparator: this.decimalSeparator
  1983. };
  1984. this.divIsFixed = d.findIfFixed(this.chartDiv);
  1985. this.destroy();
  1986. a = 0;
  1987. document.attachEvent && !window.opera && (a = 1);
  1988. this.dmouseX = this.dmouseY = 0;
  1989. var b = document.getElementsByTagName("html")[0];
  1990. b && window.getComputedStyle && (b = window.getComputedStyle(b, null)) && (this.dmouseY = d.removePx(b.getPropertyValue("margin-top")), this.dmouseX = d.removePx(b.getPropertyValue("margin-left")));
  1991. this.mouseMode =
  1992. a;
  1993. (a = this.container) ? (a.container.innerHTML = "", a.width = this.realWidth, a.height = this.realHeight, a.addDefs(this), this.chartDiv.appendChild(a.container)) : a = new d.AmDraw(this.chartDiv, this.realWidth, this.realHeight, this);
  1994. a.chart = this;
  1995. d.VML || d.SVG ? (a.handDrawn = this.handDrawn, a.handDrawScatter = this.handDrawScatter, a.handDrawThickness = this.handDrawThickness, this.container = a, this.set && this.set.remove(), this.set = a.set(), this.gridSet && this.gridSet.remove(), this.gridSet = a.set(), this.cursorLineSet && this.cursorLineSet.remove(),
  1996. this.cursorLineSet = a.set(), this.graphsBehindSet && this.graphsBehindSet.remove(), this.graphsBehindSet = a.set(), this.bulletBehindSet && this.bulletBehindSet.remove(), this.bulletBehindSet = a.set(), this.columnSet && this.columnSet.remove(), this.columnSet = a.set(), this.graphsSet && this.graphsSet.remove(), this.graphsSet = a.set(), this.trendLinesSet && this.trendLinesSet.remove(), this.trendLinesSet = a.set(), this.axesSet && this.axesSet.remove(), this.axesSet = a.set(), this.cursorSet && this.cursorSet.remove(), this.cursorSet =
  1997. a.set(), this.scrollbarsSet && this.scrollbarsSet.remove(), this.scrollbarsSet = a.set(), this.bulletSet && this.bulletSet.remove(), this.bulletSet = a.set(), this.freeLabelsSet && this.freeLabelsSet.remove(), this.axesLabelsSet && this.axesLabelsSet.remove(), this.axesLabelsSet = a.set(), this.freeLabelsSet = a.set(), this.balloonsSet && this.balloonsSet.remove(), this.balloonsSet = a.set(), this.zoomButtonSet && this.zoomButtonSet.remove(), this.zbSet && (this.zbSet.remove(), this.zbSet = null), this.zoomButtonSet = a.set(), this.linkSet &&
  1998. this.linkSet.remove(), this.linkSet = a.set()) : this.fire("failed", {
  1999. type: "failed",
  2000. chart: this
  2001. })
  2002. },
  2003. premeasure: function () {
  2004. var a = this.div;
  2005. if (a) {
  2006. var b = a.offsetWidth,
  2007. c = a.offsetHeight;
  2008. a.clientHeight && (b = a.clientWidth, c = a.clientHeight);
  2009. if (b != this.mw || c != this.mh) this.mw = b, this.mh = c, this.measure()
  2010. }
  2011. },
  2012. measure: function () {
  2013. var a = this.div;
  2014. if (a) {
  2015. var b = this.chartDiv,
  2016. c = a.offsetWidth,
  2017. e = a.offsetHeight,
  2018. h = this.container;
  2019. a.clientHeight && (c = a.clientWidth, e = a.clientHeight);
  2020. var f = d.removePx(d.getStyle(a, "padding-left")),
  2021. g = d.removePx(d.getStyle(a,
  2022. "padding-right")),
  2023. k = d.removePx(d.getStyle(a, "padding-top")),
  2024. l = d.removePx(d.getStyle(a, "padding-bottom"));
  2025. isNaN(f) || (c -= f);
  2026. isNaN(g) || (c -= g);
  2027. isNaN(k) || (e -= k);
  2028. isNaN(l) || (e -= l);
  2029. f = a.style;
  2030. a = f.width;
  2031. f = f.height; - 1 != a.indexOf("px") && (c = d.removePx(a)); - 1 != f.indexOf("px") && (e = d.removePx(f));
  2032. e = Math.round(e);
  2033. c = Math.round(c);
  2034. a = Math.round(d.toCoordinate(this.width, c));
  2035. f = Math.round(d.toCoordinate(this.height, e));
  2036. (c != this.previousWidth || e != this.previousHeight) && 0 < a && 0 < f && (b.style.width = a + "px", b.style.height = f + "px",
  2037. h && h.setSize(a, f), this.balloon = d.processObject(this.balloon, d.AmBalloon, this.theme), this.balloon.setBounds(2, 2, a - 2, f));
  2038. this.balloon.chart = this;
  2039. this.realWidth = a;
  2040. this.realHeight = f;
  2041. this.divRealWidth = c;
  2042. this.divRealHeight = e
  2043. }
  2044. },
  2045. destroy: function () {
  2046. this.chartDiv.innerHTML = "";
  2047. this.clearTimeOuts();
  2048. this.legend && this.legend.destroy()
  2049. },
  2050. clearTimeOuts: function () {
  2051. var a = this.timeOuts;
  2052. if (a) {
  2053. var b;
  2054. for (b = 0; b < a.length; b++) clearTimeout(a[b])
  2055. }
  2056. this.timeOuts = []
  2057. },
  2058. clear: function (a) {
  2059. d.callMethod("clear", [this.chartScrollbar,
  2060. this.scrollbarV, this.scrollbarH, this.chartCursor
  2061. ]);
  2062. this.chartCursor = this.scrollbarH = this.scrollbarV = this.chartScrollbar = null;
  2063. this.clearTimeOuts();
  2064. this.container && (this.container.remove(this.chartDiv), this.container.remove(this.legendDiv));
  2065. a || d.removeChart(this);
  2066. if (a = this.div)
  2067. for (; a.firstChild;) a.removeChild(a.firstChild);
  2068. this.legend && this.legend.destroy()
  2069. },
  2070. setMouseCursor: function (a) {
  2071. "auto" == a && d.isNN && (a = "default");
  2072. this.chartDiv.style.cursor = a;
  2073. this.legendDiv.style.cursor = a
  2074. },
  2075. redrawLabels: function () {
  2076. this.labels = [];
  2077. var a = this.allLabels;
  2078. this.createLabelsSet();
  2079. var b;
  2080. for (b = 0; b < a.length; b++) this.drawLabel(a[b])
  2081. },
  2082. drawLabel: function (a) {
  2083. if (this.container && !1 !== a.enabled) {
  2084. a = d.processObject(a, d.Label, this.theme);
  2085. var b = a.y,
  2086. c = a.text,
  2087. e = a.align,
  2088. h = a.size,
  2089. f = a.color,
  2090. g = a.rotation,
  2091. k = a.alpha,
  2092. l = a.bold,
  2093. m = d.toCoordinate(a.x, this.realWidth),
  2094. b = d.toCoordinate(b, this.realHeight);
  2095. m || (m = 0);
  2096. b || (b = 0);
  2097. void 0 === f && (f = this.color);
  2098. isNaN(h) && (h = this.fontSize);
  2099. e || (e = "start");
  2100. "left" == e && (e = "start");
  2101. "right" == e && (e = "end");
  2102. "center" == e && (e = "middle",
  2103. g ? b = this.realHeight - b + b / 2 : m = this.realWidth / 2 - m);
  2104. void 0 === k && (k = 1);
  2105. void 0 === g && (g = 0);
  2106. b += h / 2;
  2107. c = d.text(this.container, c, f, this.fontFamily, h, e, l, k);
  2108. c.translate(m, b);
  2109. d.setCN(this, c, "label");
  2110. a.id && d.setCN(this, c, "label-" + a.id);
  2111. 0 !== g && c.rotate(g);
  2112. a.url ? (c.setAttr("cursor", "pointer"), c.click(function () {
  2113. d.getURL(a.url)
  2114. })) : c.node.style.pointerEvents = "none";
  2115. this.labelsSet.push(c);
  2116. this.labels.push(c)
  2117. }
  2118. },
  2119. addLabel: function (a, b, c, e, d, f, g, k, l, m) {
  2120. a = {
  2121. x: a,
  2122. y: b,
  2123. text: c,
  2124. align: e,
  2125. size: d,
  2126. color: f,
  2127. alpha: k,
  2128. rotation: g,
  2129. bold: l,
  2130. url: m,
  2131. enabled: !0
  2132. };
  2133. this.container && this.drawLabel(a);
  2134. this.allLabels.push(a)
  2135. },
  2136. clearLabels: function () {
  2137. var a = this.labels,
  2138. b;
  2139. for (b = a.length - 1; 0 <= b; b--) a[b].remove();
  2140. this.labels = [];
  2141. this.allLabels = []
  2142. },
  2143. updateHeight: function () {
  2144. var a = this.divRealHeight,
  2145. b = this.legend;
  2146. if (b) {
  2147. var c = this.legendDiv.offsetHeight,
  2148. b = b.position;
  2149. if ("top" == b || "bottom" == b) {
  2150. a -= c;
  2151. if (0 > a || isNaN(a)) a = 0;
  2152. this.chartDiv.style.height = a + "px"
  2153. }
  2154. }
  2155. return a
  2156. },
  2157. updateWidth: function () {
  2158. var a = this.divRealWidth,
  2159. b = this.divRealHeight,
  2160. c = this.legend;
  2161. if (c) {
  2162. var e = this.legendDiv,
  2163. d = e.offsetWidth;
  2164. isNaN(c.width) || (d = c.width);
  2165. c.ieW && (d = c.ieW);
  2166. var f = e.offsetHeight,
  2167. e = e.style,
  2168. g = this.chartDiv.style,
  2169. c = c.position;
  2170. if ("right" == c || "left" == c) {
  2171. a -= d;
  2172. if (0 > a || isNaN(a)) a = 0;
  2173. g.width = a + "px";
  2174. "left" == c ? (g.left = d + "px", e.left = "0px") : (g.left = "0px", e.left = a + "px");
  2175. b > f && (e.top = (b - f) / 2 + "px")
  2176. }
  2177. }
  2178. return a
  2179. },
  2180. getTitleHeight: function () {
  2181. var a = 0,
  2182. b = this.titles,
  2183. c = !0;
  2184. if (0 < b.length) {
  2185. var a = 20,
  2186. e;
  2187. for (e = 0; e < b.length; e++) {
  2188. var d = b[e];
  2189. !1 !== d.enabled && (c = !1, d = d.size, isNaN(d) && (d = this.fontSize + 2), a += d + 6)
  2190. }
  2191. c && (a = 0)
  2192. }
  2193. return a
  2194. },
  2195. addTitle: function (a, b, c, e, d) {
  2196. isNaN(b) && (b = this.fontSize + 2);
  2197. a = {
  2198. text: a,
  2199. size: b,
  2200. color: c,
  2201. alpha: e,
  2202. bold: d,
  2203. enabled: !0
  2204. };
  2205. this.titles.push(a);
  2206. return a
  2207. },
  2208. handleWheel: function (a) {
  2209. var b = 0;
  2210. a || (a = window.event);
  2211. a.wheelDelta ? b = a.wheelDelta / 120 : a.detail && (b = -a.detail / 3);
  2212. b && this.handleWheelReal(b, a.shiftKey);
  2213. a.preventDefault && a.preventDefault()
  2214. },
  2215. handleWheelReal: function () {},
  2216. addListeners: function () {
  2217. var a = this,
  2218. b = a.chartDiv;
  2219. document.addEventListener ? (a.panEventsEnabled && (b.style.msTouchAction = "none"), "ontouchstart" in document.documentElement &&
  2220. (b.addEventListener("touchstart", function (b) {
  2221. a.handleTouchMove.call(a, b);
  2222. a.handleTouchStart.call(a, b)
  2223. }, !0), b.addEventListener("touchmove", function (b) {
  2224. a.handleTouchMove.call(a, b)
  2225. }, !0), b.addEventListener("touchend", function (b) {
  2226. a.handleTouchEnd.call(a, b)
  2227. }, !0)), b.addEventListener("mousedown", function (b) {
  2228. a.mouseIsOver = !0;
  2229. a.handleMouseMove.call(a, b);
  2230. a.handleMouseDown.call(a, b)
  2231. }, !0), b.addEventListener("mouseover", function (b) {
  2232. a.handleMouseOver.call(a, b)
  2233. }, !0), b.addEventListener("mouseout", function (b) {
  2234. a.handleMouseOut.call(a,
  2235. b)
  2236. }, !0)) : (b.attachEvent("onmousedown", function (b) {
  2237. a.handleMouseDown.call(a, b)
  2238. }), b.attachEvent("onmouseover", function (b) {
  2239. a.handleMouseOver.call(a, b)
  2240. }), b.attachEvent("onmouseout", function (b) {
  2241. a.handleMouseOut.call(a, b)
  2242. }))
  2243. },
  2244. dispDUpd: function () {
  2245. if (!this.skipEvents) {
  2246. var a;
  2247. this.dispatchDataUpdated && (this.dispatchDataUpdated = !1, a = "dataUpdated", this.fire(a, {
  2248. type: a,
  2249. chart: this
  2250. }));
  2251. this.chartCreated || (a = "init", this.fire(a, {
  2252. type: a,
  2253. chart: this
  2254. }));
  2255. this.chartRendered || (a = "rendered", this.fire(a, {
  2256. type: a,
  2257. chart: this
  2258. }),
  2259. this.chartRendered = !0);
  2260. a = "drawn";
  2261. this.fire(a, {
  2262. type: a,
  2263. chart: this
  2264. })
  2265. }
  2266. this.skipEvents = !1
  2267. },
  2268. validateSize: function () {
  2269. var a = this;
  2270. a.premeasure();
  2271. if (a.divRealWidth != a.previousWidth || a.divRealHeight != a.previousHeight) {
  2272. var b = a.legend;
  2273. if (0 < a.realWidth && 0 < a.realHeight) {
  2274. a.sizeChanged = !0;
  2275. if (b) {
  2276. clearTimeout(a.legendInitTO);
  2277. var c = setTimeout(function () {
  2278. b.invalidateSize()
  2279. }, 100);
  2280. a.timeOuts.push(c);
  2281. a.legendInitTO = c
  2282. }
  2283. "xy" != a.type ? a.marginsUpdated = !1 : (a.marginsUpdated = !0, a.selfZoom = !0);
  2284. clearTimeout(a.initTO);
  2285. c = setTimeout(function () {
  2286. a.initChart()
  2287. },
  2288. 10);
  2289. a.timeOuts.push(c);
  2290. a.initTO = c
  2291. }
  2292. a.fire("resized", {
  2293. type: "resized",
  2294. chart: a
  2295. });
  2296. a.renderFix();
  2297. b && b.renderFix && b.renderFix();
  2298. a.previousHeight = a.divRealHeight;
  2299. a.previousWidth = a.divRealWidth
  2300. }
  2301. },
  2302. invalidateSize: function () {
  2303. this.previousHeight = this.previousWidth = NaN;
  2304. this.invalidateSizeReal()
  2305. },
  2306. invalidateSizeReal: function () {
  2307. var a = this;
  2308. a.marginsUpdated = !1;
  2309. clearTimeout(a.validateTO);
  2310. var b = setTimeout(function () {
  2311. a.validateSize()
  2312. }, 5);
  2313. a.timeOuts.push(b);
  2314. a.validateTO = b
  2315. },
  2316. validateData: function (a) {
  2317. this.chartCreated && (this.dataChanged = !0, this.marginsUpdated = "xy" != this.type ? !1 : !0, this.initChart(a))
  2318. },
  2319. validateNow: function (a, b) {
  2320. this.initTO && clearTimeout(this.initTO);
  2321. a && (this.dataChanged = !0);
  2322. this.skipEvents = b;
  2323. this.chartRendered = !1;
  2324. this.write(this.div)
  2325. },
  2326. showItem: function (a) {
  2327. a.hidden = !1;
  2328. this.initChart()
  2329. },
  2330. hideItem: function (a) {
  2331. a.hidden = !0;
  2332. this.initChart()
  2333. },
  2334. hideBalloon: function () {
  2335. var a = this;
  2336. clearTimeout(a.hoverInt);
  2337. clearTimeout(a.balloonTO);
  2338. a.hoverInt = setTimeout(function () {
  2339. a.hideBalloonReal.call(a)
  2340. }, a.hideBalloonTime)
  2341. },
  2342. cleanChart: function () {},
  2343. hideBalloonReal: function () {
  2344. var a = this.balloon;
  2345. a && a.hide()
  2346. },
  2347. showBalloon: function (a, b, c, e, d) {
  2348. var f = this;
  2349. clearTimeout(f.balloonTO);
  2350. clearTimeout(f.hoverInt);
  2351. f.balloonTO = setTimeout(function () {
  2352. f.showBalloonReal.call(f, a, b, c, e, d)
  2353. }, 1)
  2354. },
  2355. showBalloonReal: function (a, b, c, e, d) {
  2356. this.handleMouseMove();
  2357. var f = this.balloon;
  2358. f.enabled && (f.followCursor(!1), f.changeColor(b), !c || f.fixedPosition ? (f.setPosition(e, d), f.followCursor(!1)) : f.followCursor(!0), a && f.showBalloon(a))
  2359. },
  2360. handleTouchMove: function (a) {
  2361. this.hideBalloon();
  2362. var b = this.chartDiv;
  2363. a.touches && (a = a.touches.item(0), this.mouseX = a.pageX - d.findPosX(b), this.mouseY = a.pageY - d.findPosY(b))
  2364. },
  2365. handleMouseOver: function () {
  2366. this.outTO && clearTimeout(this.outTO);
  2367. d.resetMouseOver();
  2368. this.mouseIsOver = !0
  2369. },
  2370. handleMouseOut: function () {
  2371. var a = this;
  2372. a.outTO && clearTimeout(a.outTO);
  2373. a.outTO = setTimeout(function () {
  2374. a.handleMouseOutReal()
  2375. }, 10)
  2376. },
  2377. handleMouseOutReal: function () {
  2378. d.resetMouseOver();
  2379. this.mouseIsOver = !1
  2380. },
  2381. handleMouseMove: function (a) {
  2382. if (this.mouseIsOver) {
  2383. var b = this.chartDiv;
  2384. a || (a = window.event);
  2385. var c, e;
  2386. if (a) {
  2387. this.posX = d.findPosX(b);
  2388. this.posY = d.findPosY(b);
  2389. switch (this.mouseMode) {
  2390. case 1:
  2391. c = a.clientX - this.posX;
  2392. e = a.clientY - this.posY;
  2393. if (!this.divIsFixed) {
  2394. var b = document.body,
  2395. h, f, g, k;
  2396. b && (h = b.scrollLeft, g = b.scrollTop);
  2397. if (b = document.documentElement) f = b.scrollLeft, k = b.scrollTop;
  2398. h = Math.max(h, f);
  2399. g = Math.max(g, k);
  2400. c += h;
  2401. e += g
  2402. }
  2403. break;
  2404. case 0:
  2405. this.divIsFixed ? (c = a.clientX - this.posX, e = a.clientY - this.posY) : (c = a.pageX - this.posX, e = a.pageY - this.posY)
  2406. }
  2407. a.touches && (a = a.touches.item(0), c = a.pageX - this.posX, e = a.pageY - this.posY);
  2408. this.mouseX = c - this.dmouseX;
  2409. this.mouseY = e - this.dmouseY
  2410. }
  2411. }
  2412. },
  2413. handleTouchStart: function (a) {
  2414. this.handleMouseDown(a)
  2415. },
  2416. handleTouchEnd: function (a) {
  2417. d.resetMouseOver();
  2418. this.handleReleaseOutside(a)
  2419. },
  2420. handleReleaseOutside: function () {},
  2421. handleMouseDown: function (a) {
  2422. d.resetMouseOver();
  2423. this.mouseIsOver = !0;
  2424. a && a.preventDefault && (this.panEventsEnabled ? a.preventDefault() : a.touches || a.preventDefault())
  2425. },
  2426. addLegend: function (a, b) {
  2427. a = d.processObject(a, d.AmLegend, this.theme);
  2428. a.divId = b;
  2429. a.ieW = 0;
  2430. var c;
  2431. c = "object" != typeof b && b ? document.getElementById(b) :
  2432. b;
  2433. this.legend = a;
  2434. a.chart = this;
  2435. c ? (a.div = c, a.position = "outside", a.autoMargins = !1) : a.div = this.legendDiv;
  2436. c = this.handleLegendEvent;
  2437. this.listenTo(a, "showItem", c);
  2438. this.listenTo(a, "hideItem", c);
  2439. this.listenTo(a, "clickMarker", c);
  2440. this.listenTo(a, "rollOverItem", c);
  2441. this.listenTo(a, "rollOutItem", c);
  2442. this.listenTo(a, "rollOverMarker", c);
  2443. this.listenTo(a, "rollOutMarker", c);
  2444. this.listenTo(a, "clickLabel", c);
  2445. return a
  2446. },
  2447. removeLegend: function () {
  2448. this.legend = void 0;
  2449. this.legendDiv.innerHTML = ""
  2450. },
  2451. handleResize: function () {
  2452. (d.isPercents(this.width) ||
  2453. d.isPercents(this.height)) && this.invalidateSizeReal();
  2454. this.renderFix()
  2455. },
  2456. renderFix: function () {
  2457. if (!d.VML) {
  2458. var a = this.container;
  2459. a && a.renderFix()
  2460. }
  2461. },
  2462. getSVG: function () {
  2463. if (d.hasSVG) return this.container
  2464. },
  2465. animate: function (a, b, c, e, h, f, g) {
  2466. a["an_" + b] && d.removeFromArray(this.animations, a["an_" + b]);
  2467. c = {
  2468. obj: a,
  2469. frame: 0,
  2470. attribute: b,
  2471. from: c,
  2472. to: e,
  2473. time: h,
  2474. effect: f,
  2475. suffix: g
  2476. };
  2477. a["an_" + b] = c;
  2478. this.animations.push(c);
  2479. return c
  2480. },
  2481. setLegendData: function (a) {
  2482. var b = this.legend;
  2483. b && b.setData(a)
  2484. },
  2485. stopAnim: function (a) {
  2486. d.removeFromArray(this.animations,
  2487. a)
  2488. },
  2489. updateAnimations: function () {
  2490. var a;
  2491. this.container && this.container.update();
  2492. if (this.animations)
  2493. for (a = this.animations.length - 1; 0 <= a; a--) {
  2494. var b = this.animations[a],
  2495. c = 1E3 * b.time / d.updateRate,
  2496. e = b.frame + 1,
  2497. h = b.obj,
  2498. f = b.attribute;
  2499. if (e <= c) {
  2500. b.frame++;
  2501. var g = Number(b.from),
  2502. k = Number(b.to) - g,
  2503. c = d[b.effect](0, e, g, k, c);
  2504. 0 === k ? (this.animations.splice(a, 1), h.node.style[f] = Number(b.to) + b.suffix) : h.node.style[f] = c + b.suffix
  2505. } else h.node.style[f] = Number(b.to) + b.suffix, this.animations.splice(a, 1)
  2506. }
  2507. },
  2508. update: function () {
  2509. this.updateAnimations()
  2510. },
  2511. inIframe: function () {
  2512. try {
  2513. return window.self !== window.top
  2514. } catch (a) {
  2515. return !0
  2516. }
  2517. },
  2518. brr: function () {
  2519. var a = window.location.hostname.split("."),
  2520. b;
  2521. 2 <= a.length && (b = a[a.length - 2] + "." + a[a.length - 1]);
  2522. this.amLink && (a = this.amLink.parentNode) && a.removeChild(this.amLink);
  2523. a = this.creditsPosition;
  2524. if ("amcharts.com" != b || !0 === this.inIframe()) {
  2525. var c = b = 0,
  2526. e = this.realWidth,
  2527. d = this.realHeight,
  2528. f = this.type;
  2529. if ("serial" == f || "xy" == f || "gantt" == f) b = this.marginLeftReal, c = this.marginTopReal, e = b + this.plotAreaWidth, d = c + this.plotAreaHeight;
  2530. var g = "http://www.amcharts.com/javascript-charts/",
  2531. k = "JavaScript charts",
  2532. l = "JS chart by amCharts";
  2533. "ammap" == this.product && (g = "http://www.ammap.com/javascript-maps/", k = "Interactive JavaScript maps", l = "JS map by amCharts");
  2534. f = document.createElement("a");
  2535. l = document.createTextNode(l);
  2536. f.setAttribute("href", g);
  2537. f.setAttribute("title", k);
  2538. // f.appendChild(l);
  2539. this.chartDiv.appendChild(f);
  2540. this.amLink = f;
  2541. g = f.style;
  2542. g.position = "absolute";
  2543. g.textDecoration = "none";
  2544. g.color = this.color;
  2545. g.fontFamily = this.fontFamily;
  2546. g.fontSize =
  2547. this.fontSize + "px";
  2548. g.opacity = .7;
  2549. g.display = "block";
  2550. var k = f.offsetWidth,
  2551. f = f.offsetHeight,
  2552. l = 5 + b,
  2553. m = c + 5;
  2554. "bottom-left" == a && (l = 5 + b, m = d - f - 3);
  2555. "bottom-right" == a && (l = e - k - 5, m = d - f - 3);
  2556. "top-right" == a && (l = e - k - 5, m = c + 5);
  2557. g.left = l + "px";
  2558. g.top = m + "px"
  2559. }
  2560. }
  2561. });
  2562. d.Slice = d.Class({
  2563. construct: function () {}
  2564. });
  2565. d.SerialDataItem = d.Class({
  2566. construct: function () {}
  2567. });
  2568. d.GraphDataItem = d.Class({
  2569. construct: function () {}
  2570. });
  2571. d.Guide = d.Class({
  2572. construct: function (a) {
  2573. this.cname = "Guide";
  2574. d.applyTheme(this, a, this.cname)
  2575. }
  2576. });
  2577. d.Title = d.Class({
  2578. construct: function (a) {
  2579. this.cname =
  2580. "Title";
  2581. d.applyTheme(this, a, this.cname)
  2582. }
  2583. });
  2584. d.Label = d.Class({
  2585. construct: function (a) {
  2586. this.cname = "Label";
  2587. d.applyTheme(this, a, this.cname)
  2588. }
  2589. })
  2590. })();
  2591. (function () {
  2592. var d = window.AmCharts;
  2593. d.AmGraph = d.Class({
  2594. construct: function (a) {
  2595. this.cname = "AmGraph";
  2596. this.createEvents("rollOverGraphItem", "rollOutGraphItem", "clickGraphItem", "doubleClickGraphItem", "rightClickGraphItem", "clickGraph", "rollOverGraph", "rollOutGraph");
  2597. this.type = "line";
  2598. this.stackable = !0;
  2599. this.columnCount = 1;
  2600. this.columnIndex = 0;
  2601. this.centerCustomBullets = this.showBalloon = !0;
  2602. this.maxBulletSize = 50;
  2603. this.minBulletSize = 4;
  2604. this.balloonText = "[[value]]";
  2605. this.hidden = this.scrollbar = this.animationPlayed = !1;
  2606. this.pointPosition = "middle";
  2607. this.depthCount = 1;
  2608. this.includeInMinMax = !0;
  2609. this.negativeBase = 0;
  2610. this.visibleInLegend = !0;
  2611. this.showAllValueLabels = !1;
  2612. this.showBulletsAt = this.showBalloonAt = "close";
  2613. this.lineThickness = 1;
  2614. this.dashLength = 0;
  2615. this.connect = !0;
  2616. this.lineAlpha = 1;
  2617. this.bullet = "none";
  2618. this.bulletBorderThickness = 2;
  2619. this.bulletBorderAlpha = 0;
  2620. this.bulletAlpha = 1;
  2621. this.bulletSize = 8;
  2622. this.cornerRadiusTop = this.hideBulletsCount = this.bulletOffset = 0;
  2623. this.cursorBulletAlpha = 1;
  2624. this.gradientOrientation = "vertical";
  2625. this.dy =
  2626. this.dx = 0;
  2627. this.periodValue = "";
  2628. this.clustered = !0;
  2629. this.periodSpan = 1;
  2630. this.y = this.x = 0;
  2631. this.switchable = !0;
  2632. this.tcc = this.minDistance = 1;
  2633. this.labelRotation = 0;
  2634. this.labelAnchor = "auto";
  2635. this.labelOffset = 3;
  2636. this.bcn = "graph-";
  2637. this.dateFormat = "MMM DD, YYYY";
  2638. d.applyTheme(this, a, this.cname)
  2639. },
  2640. draw: function () {
  2641. var a = this.chart,
  2642. b = a.type;
  2643. isNaN(this.precision) || (this.numberFormatter ? this.numberFormatter.precision = this.precision : this.numberFormatter = {
  2644. precision: this.precision,
  2645. decimalSeparator: a.decimalSeparator,
  2646. thousandsSeparator: a.thousandsSeparator
  2647. });
  2648. var c = a.container;
  2649. this.container = c;
  2650. this.destroy();
  2651. var e = c.set(),
  2652. h = c.set();
  2653. this.behindColumns ? (a.graphsBehindSet.push(e), a.bulletBehindSet.push(h)) : (a.graphsSet.push(e), a.bulletSet.push(h));
  2654. var f = this.bulletAxis;
  2655. d.isString(f) && (this.bulletAxis = a.getValueAxisById(f));
  2656. this.bulletSet = h;
  2657. if (!this.scrollbar) {
  2658. var f = a.marginLeftReal,
  2659. g = a.marginTopReal;
  2660. e.translate(f, g);
  2661. h.translate(f, g)
  2662. }
  2663. c = c.set();
  2664. d.remove(this.columnsSet);
  2665. e.push(c);
  2666. this.set = e;
  2667. d.setCN(a, e, "graph-" + this.type);
  2668. d.setCN(a, e, "graph-" + this.id);
  2669. d.setCN(a,
  2670. h, "graph-" + this.type);
  2671. d.setCN(a, h, "graph-" + this.id);
  2672. this.columnsSet = c;
  2673. this.columnsArray = [];
  2674. this.ownColumns = [];
  2675. this.allBullets = [];
  2676. this.animationArray = [];
  2677. e = this.labelPosition;
  2678. e || (h = this.valueAxis.stackType, e = "top", "column" == this.type && (a.rotate && (e = "right"), "100%" == h || "regular" == h) && (e = "middle"), this.labelPosition = e);
  2679. d.ifArray(this.data) && (a = !1, "xy" == b ? this.xAxis.axisCreated && this.yAxis.axisCreated && (a = !0) : this.valueAxis.axisCreated && (a = !0), !this.hidden && a && this.createGraph())
  2680. },
  2681. createGraph: function () {
  2682. var a =
  2683. this,
  2684. b = a.chart;
  2685. a.startAlpha = b.startAlpha;
  2686. a.seqAn = b.sequencedAnimation;
  2687. a.baseCoord = a.valueAxis.baseCoord;
  2688. void 0 === a.fillAlphas && (a.fillAlphas = 0);
  2689. a.bulletColorR = a.bulletColor;
  2690. void 0 === a.bulletColorR && (a.bulletColorR = a.lineColorR, a.bulletColorNegative = a.negativeLineColor);
  2691. void 0 === a.bulletAlpha && (a.bulletAlpha = a.lineAlpha);
  2692. b = b.type;
  2693. "gantt" == b && (b = "serial");
  2694. clearTimeout(a.playedTO);
  2695. if (!isNaN(a.valueAxis.min) && !isNaN(a.valueAxis.max)) {
  2696. switch (b) {
  2697. case "serial":
  2698. a.categoryAxis && (a.createSerialGraph(), "candlestick" ==
  2699. a.type && 1 > a.valueAxis.minMaxMultiplier && a.positiveClip(a.set));
  2700. break;
  2701. case "radar":
  2702. a.createRadarGraph();
  2703. break;
  2704. case "xy":
  2705. a.createXYGraph(), a.positiveClip(a.set)
  2706. }
  2707. a.playedTO = setTimeout(function () {
  2708. a.setAnimationPlayed.call(a)
  2709. }, 500 * a.chart.startDuration)
  2710. }
  2711. },
  2712. setAnimationPlayed: function () {
  2713. this.animationPlayed = !0
  2714. },
  2715. createXYGraph: function () {
  2716. var a = [],
  2717. b = [],
  2718. c = this.xAxis,
  2719. e = this.yAxis;
  2720. this.pmh = e.viH + 1;
  2721. this.pmw = c.viW + 1;
  2722. this.pmy = this.pmx = 0;
  2723. var d;
  2724. for (d = this.start; d <= this.end; d++) {
  2725. var f = this.data[d].axes[c.id].graphs[this.id],
  2726. g = f.values,
  2727. k = g.x,
  2728. l = g.y,
  2729. g = c.getCoordinate(k),
  2730. m = e.getCoordinate(l);
  2731. !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) && (f = this.createLabel(f, g, m, l), this.positionLabel(g, m, f, k), this.allBullets.push(f))
  2732. }
  2733. this.drawLineGraph(a, b);
  2734. this.launchAnimation()
  2735. },
  2736. createRadarGraph: function () {
  2737. var a = this.valueAxis.stackType,
  2738. b = [],
  2739. c = [],
  2740. e, d, f;
  2741. for (f = this.start; f <= this.end; f++) {
  2742. var g = this.data[f].axes[this.valueAxis.id].graphs[this.id],
  2743. k;
  2744. k = "none" == a || "3d" == a ? g.values.value :
  2745. g.values.close;
  2746. if (isNaN(k)) this.drawLineGraph(b, c), b = [], c = [];
  2747. else {
  2748. var l = this.y - (this.valueAxis.getCoordinate(k) - this.height),
  2749. m = 180 - 360 / (this.end - this.start + 1) * f;
  2750. k = l * Math.sin(m / 180 * Math.PI);
  2751. l *= Math.cos(m / 180 * Math.PI);
  2752. b.push(k);
  2753. c.push(l);
  2754. var m = this.createBullet(g, k, l, f),
  2755. n = this.labelText;
  2756. n && (g = this.createLabel(g, k, l, n), this.positionLabel(k, l, g, m), this.allBullets.push(g));
  2757. isNaN(e) && (e = k);
  2758. isNaN(d) && (d = l)
  2759. }
  2760. }
  2761. b.push(e);
  2762. c.push(d);
  2763. this.drawLineGraph(b, c);
  2764. this.launchAnimation()
  2765. },
  2766. positionLabel: function (a, b, c,
  2767. e) {
  2768. var d = "middle",
  2769. f = !1,
  2770. g = this.labelPosition,
  2771. k = c.getBBox();
  2772. if (e) {
  2773. var l = e.graphDataItem,
  2774. m = this.chart.rotate,
  2775. n = l.isNegative,
  2776. q = this.chart;
  2777. b -= k.height / 4 / 2;
  2778. switch (g) {
  2779. case "top":
  2780. g = m ? "top" : n ? "bottom" : "top";
  2781. break;
  2782. case "right":
  2783. g = m ? n ? "left" : "right" : "right";
  2784. break;
  2785. case "bottom":
  2786. g = m ? "bottom" : n ? "top" : "bottom";
  2787. break;
  2788. case "left":
  2789. g = m ? n ? "right" : "left" : "left"
  2790. }
  2791. var p = l.columnGraphics,
  2792. r = 0,
  2793. t = 0;
  2794. p && (r = p.x, t = p.y);
  2795. var u = this.labelOffset;
  2796. switch (g) {
  2797. case "top":
  2798. b -= e.size / 2 + k.height / 2 + u;
  2799. break;
  2800. case "right":
  2801. d = "start";
  2802. a += e.size / 2 + u;
  2803. break;
  2804. case "bottom":
  2805. b += e.size / 2 + k.height / 2 + u;
  2806. break;
  2807. case "left":
  2808. d = "end";
  2809. a -= e.size / 2 + u;
  2810. break;
  2811. case "inside":
  2812. "column" == this.type && (f = !0, m ? n ? (d = "end", a = r - 3 - u) : (d = "start", a = r + 3 + u) : b = n ? t + 7 + u : t - 10 - u);
  2813. break;
  2814. case "middle":
  2815. "column" == this.type && (f = !0, m ? a -= (a - r) / 2 + u - 3 : b -= (b - t) / 2 + u - 3)
  2816. }
  2817. "auto" != this.labelAnchor && (d = this.labelAnchor);
  2818. c.attr({
  2819. "text-anchor": d
  2820. });
  2821. this.labelRotation && c.rotate(this.labelRotation);
  2822. c.translate(a, b);
  2823. k = c.getBBox();
  2824. !this.showAllValueLabels && p && f && (k.height > l.columnHeight || k.width > l.columnWidth) &&
  2825. (c.remove(), c = !1);
  2826. if (c && ("serial" == q.type || "gantt" == q.type))
  2827. if (m) {
  2828. if (0 > b || b > this.height) c.remove(), c = !1
  2829. } else if (0 > a || a > this.width) c.remove(), c = !1;
  2830. return c
  2831. }
  2832. },
  2833. getGradRotation: function () {
  2834. var a = 270;
  2835. "horizontal" == this.gradientOrientation && (a = 0);
  2836. return this.gradientRotation = a
  2837. },
  2838. createSerialGraph: function () {
  2839. this.dashLengthSwitched = this.fillColorsSwitched = this.lineColorSwitched = void 0;
  2840. var a = this.chart,
  2841. b = this.id,
  2842. c = this.index,
  2843. e = this.data,
  2844. h = this.chart.container,
  2845. f = this.valueAxis,
  2846. g = this.type,
  2847. k = this.columnWidthReal,
  2848. l = this.showBulletsAt;
  2849. isNaN(this.columnWidth) || (k = this.columnWidth);
  2850. isNaN(k) && (k = .8);
  2851. var m = this.useNegativeColorIfDown,
  2852. n = this.width,
  2853. q = this.height,
  2854. p = this.y,
  2855. r = this.rotate,
  2856. t = this.columnCount,
  2857. u = d.toCoordinate(this.cornerRadiusTop, k / 2),
  2858. z = this.connect,
  2859. w = [],
  2860. x = [],
  2861. v, A, B, D, C = this.chart.graphs.length,
  2862. I, H = this.dx / this.tcc,
  2863. O = this.dy / this.tcc,
  2864. J = f.stackType,
  2865. da = this.start,
  2866. pa = this.end,
  2867. U = this.scrollbar,
  2868. na = "graph-column-";
  2869. U && (na = "scrollbar-graph-column-");
  2870. var qa = this.categoryAxis,
  2871. ja = this.baseCoord,
  2872. Pa = this.negativeBase,
  2873. aa = this.columnIndex,
  2874. Z = this.lineThickness,
  2875. V = this.lineAlpha,
  2876. sa = this.lineColorR,
  2877. ba = this.dashLength,
  2878. ca = this.set,
  2879. ta, ia = this.getGradRotation(),
  2880. Q = this.chart.columnSpacing,
  2881. W = qa.cellWidth,
  2882. wa = (W * k - t) / t;
  2883. Q > wa && (Q = wa);
  2884. var G, y, ka, ea = q + 1,
  2885. Qa = n + 1,
  2886. Y = 0,
  2887. qb = 0,
  2888. rb, sb, eb, fb, tb = this.fillColorsR,
  2889. Ja = this.negativeFillColors,
  2890. Ca = this.negativeLineColor,
  2891. Wa = this.fillAlphas,
  2892. Xa = this.negativeFillAlphas;
  2893. "object" == typeof Wa && (Wa = Wa[0]);
  2894. "object" == typeof Xa && (Xa = Xa[0]);
  2895. var gb = f.getCoordinate(f.min);
  2896. f.logarithmic && (gb = f.getCoordinate(f.minReal));
  2897. this.minCoord = gb;
  2898. this.resetBullet && (this.bullet = "none");
  2899. if (!(U || "line" != g && "smoothedLine" != g && "step" != g || (1 == e.length && "step" != g && "none" == this.bullet && (this.bullet = "round", this.resetBullet = !0), !Ja && void 0 == Ca || m))) {
  2900. var Ra = Pa;
  2901. Ra > f.max && (Ra = f.max);
  2902. Ra < f.min && (Ra = f.min);
  2903. f.logarithmic && (Ra = f.minReal);
  2904. var Ga = f.getCoordinate(Ra),
  2905. Ib = f.getCoordinate(f.max);
  2906. r ? (ea = q, Qa = Math.abs(Ib - Ga) + 1, rb = q, sb = Math.abs(gb - Ga) + 1, fb = qb = 0, f.reversed ? (Y = 0, eb = Ga) : (Y = Ga, eb = 0)) : (Qa = n, ea = Math.abs(Ib - Ga) + 1, sb = n, rb = Math.abs(gb - Ga) + 1,
  2907. eb = Y = 0, f.reversed ? (fb = p, qb = Ga) : fb = Ga + 1)
  2908. }
  2909. var Ha = Math.round;
  2910. this.pmx = Ha(Y);
  2911. this.pmy = Ha(qb);
  2912. this.pmh = Ha(ea);
  2913. this.pmw = Ha(Qa);
  2914. this.nmx = Ha(eb);
  2915. this.nmy = Ha(fb);
  2916. this.nmh = Ha(rb);
  2917. this.nmw = Ha(sb);
  2918. d.isModern || (this.nmy = this.nmx = 0, this.nmh = this.height);
  2919. this.clustered || (t = 1);
  2920. k = "column" == g ? (W * k - Q * (t - 1)) / t : W * k;
  2921. 1 > k && (k = 1);
  2922. var Jb = this.fixedColumnWidth;
  2923. isNaN(Jb) || (k = Jb);
  2924. var K;
  2925. if ("line" == g || "step" == g || "smoothedLine" == g) {
  2926. if (0 < da) {
  2927. for (K = da - 1; - 1 < K; K--)
  2928. if (G = e[K], y = G.axes[f.id].graphs[b], ka = y.values.value, !isNaN(ka)) {
  2929. da =
  2930. K;
  2931. break
  2932. } if (this.lineColorField)
  2933. for (K = da; - 1 < K; K--)
  2934. if (G = e[K], y = G.axes[f.id].graphs[b], y.lineColor) {
  2935. this.bulletColorSwitched = this.lineColorSwitched = y.lineColor;
  2936. break
  2937. } if (this.fillColorsField)
  2938. for (K = da; - 1 < K; K--)
  2939. if (G = e[K], y = G.axes[f.id].graphs[b], y.fillColors) {
  2940. this.fillColorsSwitched = y.fillColors;
  2941. break
  2942. } if (this.dashLengthField)
  2943. for (K = da; - 1 < K; K--)
  2944. if (G = e[K], y = G.axes[f.id].graphs[b], !isNaN(y.dashLength)) {
  2945. this.dashLengthSwitched = y.dashLength;
  2946. break
  2947. }
  2948. }
  2949. if (pa < e.length - 1)
  2950. for (K = pa + 1; K < e.length; K++)
  2951. if (G = e[K], y = G.axes[f.id].graphs[b],
  2952. ka = y.values.value, !isNaN(ka)) {
  2953. pa = K;
  2954. break
  2955. }
  2956. }
  2957. pa < e.length - 1 && pa++;
  2958. var R = [],
  2959. S = [],
  2960. Ka = !1;
  2961. if ("line" == g || "step" == g || "smoothedLine" == g)
  2962. if (this.stackable && "regular" == J || "100%" == J || this.fillToGraph) Ka = !0;
  2963. var Kb = this.noStepRisers,
  2964. hb = -1E3,
  2965. ib = -1E3,
  2966. jb = this.minDistance,
  2967. La = !0,
  2968. Ya = !1;
  2969. for (K = da; K <= pa; K++) {
  2970. G = e[K];
  2971. y = G.axes[f.id].graphs[b];
  2972. y.index = K;
  2973. var Za, Ma = NaN;
  2974. if (m && void 0 == this.openField)
  2975. for (var ub = K + 1; ub < e.length && (!e[ub] || !(Za = e[K + 1].axes[f.id].graphs[b]) || !Za.values || (Ma = Za.values.value, isNaN(Ma))); ub++);
  2976. var T, P, M,
  2977. fa, la = NaN,
  2978. F = NaN,
  2979. E = NaN,
  2980. N = NaN,
  2981. L = NaN,
  2982. Na = NaN,
  2983. Da = NaN,
  2984. Oa = NaN,
  2985. Ea = NaN,
  2986. ya = NaN,
  2987. za = NaN,
  2988. ga = NaN,
  2989. ha = NaN,
  2990. X = NaN,
  2991. vb = NaN,
  2992. wb = NaN,
  2993. ma = NaN,
  2994. oa = void 0,
  2995. Ia = tb,
  2996. Sa = Wa,
  2997. Aa = sa,
  2998. ua, xa, xb = this.proCandlesticks,
  2999. kb = this.topRadius,
  3000. $a = this.pattern;
  3001. void 0 != y.pattern && ($a = y.pattern);
  3002. isNaN(y.alpha) || (Sa = y.alpha);
  3003. isNaN(y.dashLength) || (ba = y.dashLength);
  3004. var Ba = y.values;
  3005. f.recalculateToPercents && (Ba = y.percents);
  3006. if (Ba) {
  3007. X = this.stackable && "none" != J && "3d" != J ? Ba.close : Ba.value;
  3008. if ("candlestick" == g || "ohlc" == g) X = Ba.close, wb = Ba.low, Da = f.getCoordinate(wb),
  3009. vb = Ba.high, Ea = f.getCoordinate(vb);
  3010. ma = Ba.open;
  3011. E = f.getCoordinate(X);
  3012. isNaN(ma) || (L = f.getCoordinate(ma), m && (Ma = ma, ma = L = NaN));
  3013. m && (void 0 == this.openField ? Za && (Za.isNegative = Ma < X ? !0 : !1, isNaN(Ma) && (y.isNegative = !La)) : y.isNegative = Ma > X ? !0 : !1);
  3014. if (!U) switch (this.showBalloonAt) {
  3015. case "close":
  3016. y.y = E;
  3017. break;
  3018. case "open":
  3019. y.y = L;
  3020. break;
  3021. case "high":
  3022. y.y = Ea;
  3023. break;
  3024. case "low":
  3025. y.y = Da
  3026. }
  3027. var la = G.x[qa.id],
  3028. Ta = this.periodSpan - 1,
  3029. ra = Math.floor(W / 2) + Math.floor(Ta * W / 2),
  3030. Fa = ra,
  3031. lb = 0;
  3032. "left" == this.stepDirection && (lb = (2 * W + Ta * W) / 2, la -= lb);
  3033. "center" ==
  3034. this.stepDirection && (lb = W / 2, la -= lb);
  3035. "start" == this.pointPosition && (la -= W / 2 + Math.floor(Ta * W / 2), ra = 0, Fa = Math.floor(W) + Math.floor(Ta * W));
  3036. "end" == this.pointPosition && (la += W / 2 + Math.floor(Ta * W / 2), ra = Math.floor(W) + Math.floor(Ta * W), Fa = 0);
  3037. if (Kb) {
  3038. var yb = this.columnWidth;
  3039. isNaN(yb) || (ra *= yb, Fa *= yb)
  3040. }
  3041. U || (y.x = la); - 1E5 > la && (la = -1E5);
  3042. la > n + 1E5 && (la = n + 1E5);
  3043. r ? (F = E, N = L, L = E = la, isNaN(ma) && !this.fillToGraph && (N = ja), Na = Da, Oa = Ea) : (N = F = la, isNaN(ma) && !this.fillToGraph && (L = ja));
  3044. if (!xb && X < ma || xb && X < ta) y.isNegative = !0, Ja && (Ia = Ja),
  3045. Xa && (Sa = Xa), void 0 != Ca && (Aa = Ca);
  3046. Ya = !1;
  3047. isNaN(X) || (m ? X > Ma ? (La && (Ya = !0), La = !1) : (La || (Ya = !0), La = !0) : y.isNegative = X < Pa ? !0 : !1, ta = X);
  3048. void 0 != y.color && (Ia = y.color);
  3049. y.fillColors && (Ia = y.fillColors);
  3050. switch (g) {
  3051. case "line":
  3052. if (isNaN(X)) z || (this.drawLineGraph(w, x, R, S), w = [], x = [], R = [], S = []);
  3053. else {
  3054. if (Math.abs(F - hb) >= jb || Math.abs(E - ib) >= jb) w.push(F), x.push(E), hb = F, ib = E;
  3055. ya = F;
  3056. za = E;
  3057. ga = F;
  3058. ha = E;
  3059. !Ka || isNaN(L) || isNaN(N) || (R.push(N), S.push(L));
  3060. if (Ya || void 0 != y.lineColor || void 0 != y.fillColors || !isNaN(y.dashLength)) this.drawLineGraph(w,
  3061. x, R, S), w = [F], x = [E], R = [], S = [], !Ka || isNaN(L) || isNaN(N) || (R.push(N), S.push(L)), m ? La ? (this.lineColorSwitched = sa, this.fillColorsSwitched = tb) : (this.lineColorSwitched = Ca, this.fillColorsSwitched = Ja) : (this.lineColorSwitched = y.lineColor, this.fillColorsSwitched = y.fillColors), this.dashLengthSwitched = y.dashLength;
  3062. y.gap && (this.drawLineGraph(w, x, R, S), w = [], x = [], R = [], S = [])
  3063. }
  3064. break;
  3065. case "smoothedLine":
  3066. if (isNaN(X)) z || (this.drawSmoothedGraph(w, x, R, S), w = [], x = [], R = [], S = []);
  3067. else {
  3068. if (Math.abs(F - hb) >= jb || Math.abs(E - ib) >= jb) w.push(F),
  3069. x.push(E), hb = F, ib = E;
  3070. ya = F;
  3071. za = E;
  3072. ga = F;
  3073. ha = E;
  3074. !Ka || isNaN(L) || isNaN(N) || (R.push(N), S.push(L));
  3075. void 0 == y.lineColor && void 0 == y.fillColors && isNaN(y.dashLength) || (this.drawSmoothedGraph(w, x, R, S), w = [F], x = [E], R = [], S = [], !Ka || isNaN(L) || isNaN(N) || (R.push(N), S.push(L)), this.lineColorSwitched = y.lineColor, this.fillColorsSwitched = y.fillColors, this.dashLengthSwitched = y.dashLength);
  3076. y.gap && (this.drawSmoothedGraph(w, x, R, S), w = [], x = [], R = [], S = [])
  3077. }
  3078. break;
  3079. case "step":
  3080. if (!isNaN(X)) {
  3081. r ? (isNaN(v) || (w.push(v), x.push(E - ra)), x.push(E -
  3082. ra), w.push(F), x.push(E + Fa), w.push(F), !Ka || isNaN(L) || isNaN(N) || (isNaN(B) || (R.push(B), S.push(L - ra)), R.push(N), S.push(L - ra), R.push(N), S.push(L + Fa))) : (isNaN(A) || (x.push(A), w.push(v), x.push(A), w.push(F - ra)), w.push(F - ra), x.push(E), w.push(F + Fa), x.push(E), !Ka || isNaN(L) || isNaN(N) || (isNaN(D) || (R.push(N - ra), S.push(D)), R.push(N - ra), S.push(L), R.push(N + Fa), S.push(L)));
  3083. v = F;
  3084. A = E;
  3085. B = N;
  3086. D = L;
  3087. ya = F;
  3088. za = E;
  3089. ga = F;
  3090. ha = E;
  3091. if (Ya || void 0 != y.lineColor || void 0 != y.fillColors || !isNaN(y.dashLength)) {
  3092. var Yb = w[w.length - 2],
  3093. Zb = x[x.length - 2];
  3094. w.pop();
  3095. x.pop();
  3096. this.drawLineGraph(w, x, R, S);
  3097. w = [Yb];
  3098. x = [Zb];
  3099. R = [];
  3100. S = [];
  3101. this.lineColorSwitched = y.lineColor;
  3102. this.fillColorsSwitched = y.fillColors;
  3103. this.dashLengthSwitched = y.dashLength;
  3104. m && (La ? (this.lineColorSwitched = sa, this.fillColorsSwitched = tb) : (this.lineColorSwitched = Ca, this.fillColorsSwitched = Ja))
  3105. }
  3106. if (Kb || y.gap) v = A = NaN, this.drawLineGraph(w, x, R, S), w = [], x = [], R = [], S = []
  3107. } else if (!z) {
  3108. if (1 >= this.periodSpan || 1 < this.periodSpan && F - v > ra + Fa) v = A = NaN;
  3109. this.drawLineGraph(w, x, R, S);
  3110. w = [];
  3111. x = [];
  3112. R = [];
  3113. S = []
  3114. }
  3115. break;
  3116. case "column":
  3117. ua =
  3118. Aa;
  3119. void 0 != y.lineColor && (ua = y.lineColor);
  3120. if (!isNaN(X)) {
  3121. m || (y.isNegative = X < Pa ? !0 : !1);
  3122. y.isNegative && (Ja && (Ia = Ja), void 0 != Ca && (ua = Ca));
  3123. var Lb = f.min,
  3124. Mb = f.max;
  3125. if (!(X < Lb && ma < Lb || X > Mb && ma > Mb)) {
  3126. var va;
  3127. if (r) {
  3128. "3d" == J ? (P = E - (t / 2 - this.depthCount + 1) * (k + Q) + Q / 2 + O * aa, T = N + H * aa, va = aa) : (P = Math.floor(E - (t / 2 - aa) * (k + Q) + Q / 2), T = N, va = 0);
  3129. M = k;
  3130. ya = F;
  3131. za = P + k / 2;
  3132. isNaN(N) || N > F && !y.isNegative && (ya = N);
  3133. ga = F;
  3134. ha = P + k / 2;
  3135. P + M > q + va * O && (M = q - P + va * O);
  3136. P < va * O && (M += P, P = va * O);
  3137. fa = F - N;
  3138. var $b = T;
  3139. T = d.fitToBounds(T, 0, n);
  3140. fa += $b - T;
  3141. fa = d.fitToBounds(fa, -T, n -
  3142. T + H * aa);
  3143. P < q && 0 < M && (oa = new d.Cuboid(h, fa, M, H - a.d3x, O - a.d3y, Ia, Sa, Z, ua, V, ia, u, r, ba, $a, kb, na), y.columnWidth = Math.abs(fa), y.columnHeight = Math.abs(M))
  3144. } else {
  3145. "3d" == J ? (T = F - (t / 2 - this.depthCount + 1) * (k + Q) + Q / 2 + H * aa, P = L + O * aa, va = aa) : (T = F - (t / 2 - aa) * (k + Q) + Q / 2, P = L, va = 0);
  3146. M = k;
  3147. ya = T + k / 2;
  3148. za = E;
  3149. isNaN(L) || L < E && !y.isNegative && (za = L);
  3150. ga = T + k / 2;
  3151. ha = E;
  3152. T + M > n + va * H && (M = n - T + va * H);
  3153. T < va * H && (M += T - va * H, T = va * H);
  3154. fa = E - L;
  3155. var ac = P;
  3156. P = d.fitToBounds(P, this.dy, q);
  3157. fa += ac - P;
  3158. fa = d.fitToBounds(fa, -P + O * aa, q - P);
  3159. T < n + aa * H && 0 < M && (this.showOnAxis && (P -= O / 2),
  3160. oa = new d.Cuboid(h, M, fa, H - a.d3x, O - a.d3y, Ia, Sa, Z, ua, this.lineAlpha, ia, u, r, ba, $a, kb, na), y.columnHeight = Math.abs(fa), y.columnWidth = Math.abs(M))
  3161. }
  3162. }
  3163. if (oa && (xa = oa.set, d.setCN(a, oa.set, "graph-" + this.type), d.setCN(a, oa.set, "graph-" + this.id), y.className && d.setCN(a, oa.set, y.className, !0), y.columnGraphics = xa, xa.translate(T, P), this.columnsSet.push(xa), (y.url || this.showHandOnHover) && xa.setAttr("cursor", "pointer"), !U)) {
  3164. "none" == J && (I = r ? (this.end + 1 - K) * C - c : C * K + c);
  3165. "3d" == J && (r ? (I = (this.end + 1 - K) * C - c - 1E3 * this.depthCount,
  3166. ya += H * this.columnIndex, ga += H * this.columnIndex, y.y += H * this.columnIndex) : (I = (C - c) * (K + 1) + 1E3 * this.depthCount, za += O * this.columnIndex, ha += O * this.columnIndex, y.y += O * this.columnIndex));
  3167. if ("regular" == J || "100%" == J) I = r ? 0 < Ba.value ? (this.end + 1 - K) * C + c : (this.end + 1 - K) * C - c : 0 < Ba.value ? C * K + c : C * K - c;
  3168. this.columnsArray.push({
  3169. column: oa,
  3170. depth: I
  3171. });
  3172. y.x = r ? P + M / 2 : T + M / 2;
  3173. this.ownColumns.push(oa);
  3174. this.animateColumns(oa, K, F, N, E, L);
  3175. this.addListeners(xa, y)
  3176. }
  3177. }
  3178. break;
  3179. case "candlestick":
  3180. if (!isNaN(ma) && !isNaN(X)) {
  3181. var Ua, ab;
  3182. ua = Aa;
  3183. void 0 !=
  3184. y.lineColor && (ua = y.lineColor);
  3185. if (r) {
  3186. if (P = E - k / 2, T = N, M = k, P + M > q && (M = q - P), 0 > P && (M += P, P = 0), P < q && 0 < M) {
  3187. var zb, Ab;
  3188. X > ma ? (zb = [F, Oa], Ab = [N, Na]) : (zb = [N, Oa], Ab = [F, Na]);
  3189. !isNaN(Oa) && !isNaN(Na) && E < q && 0 < E && (Ua = d.line(h, zb, [E, E], ua, V, Z), ab = d.line(h, Ab, [E, E], ua, V, Z));
  3190. fa = F - N;
  3191. oa = new d.Cuboid(h, fa, M, H, O, Ia, Wa, Z, ua, V, ia, u, r, ba, $a, kb, na)
  3192. }
  3193. } else if (T = F - k / 2, P = L + Z / 2, M = k, T + M > n && (M = n - T), 0 > T && (M += T, T = 0), fa = E - L, T < n && 0 < M) {
  3194. xb && X >= ma && (Sa = 0);
  3195. var oa = new d.Cuboid(h, M, fa, H, O, Ia, Sa, Z, ua, V, ia, u, r, ba, $a, kb, na),
  3196. Bb, Cb;
  3197. X > ma ? (Bb = [E, Ea], Cb = [L,
  3198. Da
  3199. ]) : (Bb = [L, Ea], Cb = [E, Da]);
  3200. !isNaN(Ea) && !isNaN(Da) && F < n && 0 < F && (Ua = d.line(h, [F, F], Bb, ua, V, Z), ab = d.line(h, [F, F], Cb, ua, V, Z), d.setCN(a, Ua, this.bcn + "line-high"), y.className && d.setCN(a, Ua, y.className, !0), d.setCN(a, ab, this.bcn + "line-low"), y.className && d.setCN(a, ab, y.className, !0))
  3201. }
  3202. oa && (xa = oa.set, y.columnGraphics = xa, ca.push(xa), xa.translate(T, P - Z / 2), (y.url || this.showHandOnHover) && xa.setAttr("cursor", "pointer"), Ua && (ca.push(Ua), ca.push(ab)), ya = F, za = E, r ? (ha = E, ga = F, "open" == l && (ga = N), "high" == l && (ga = Oa), "low" ==
  3203. l && (ga = Na)) : (ha = E, "open" == l && (ha = L), "high" == l && (ha = Ea), "low" == l && (ha = Da), ga = F), U || (y.x = r ? P + M / 2 : T + M / 2, this.animateColumns(oa, K, F, N, E, L), this.addListeners(xa, y)))
  3204. }
  3205. break;
  3206. case "ohlc":
  3207. if (!(isNaN(ma) || isNaN(vb) || isNaN(wb) || isNaN(X))) {
  3208. var Nb = h.set();
  3209. ca.push(Nb);
  3210. X < ma && (y.isNegative = !0, void 0 != Ca && (Aa = Ca));
  3211. var mb, nb, ob;
  3212. if (r) {
  3213. var Db = E - k / 2,
  3214. Db = d.fitToBounds(Db, 0, q),
  3215. Ob = d.fitToBounds(E, 0, q),
  3216. Eb = E + k / 2,
  3217. Eb = d.fitToBounds(Eb, 0, q);
  3218. nb = d.line(h, [N, N], [Db, Ob], Aa, V, Z, ba);
  3219. 0 < E && E < q && (mb = d.line(h, [Na, Oa], [E, E], Aa, V, Z, ba));
  3220. ob =
  3221. d.line(h, [F, F], [Ob, Eb], Aa, V, Z, ba);
  3222. ha = E;
  3223. ga = F;
  3224. "open" == l && (ga = N);
  3225. "high" == l && (ga = Oa);
  3226. "low" == l && (ga = Na)
  3227. } else {
  3228. var Fb = F - k / 2,
  3229. Fb = d.fitToBounds(Fb, 0, n),
  3230. Pb = d.fitToBounds(F, 0, n),
  3231. Gb = F + k / 2,
  3232. Gb = d.fitToBounds(Gb, 0, n);
  3233. nb = d.line(h, [Fb, Pb], [L, L], Aa, V, Z, ba);
  3234. 0 < F && F < n && (mb = d.line(h, [F, F], [Da, Ea], Aa, V, Z, ba));
  3235. ob = d.line(h, [Pb, Gb], [E, E], Aa, V, Z, ba);
  3236. ha = E;
  3237. "open" == l && (ha = L);
  3238. "high" == l && (ha = Ea);
  3239. "low" == l && (ha = Da);
  3240. ga = F
  3241. }
  3242. ca.push(nb);
  3243. ca.push(mb);
  3244. ca.push(ob);
  3245. d.setCN(a, nb, this.bcn + "stroke-open");
  3246. d.setCN(a, ob, this.bcn + "stroke-close");
  3247. d.setCN(a,
  3248. mb, this.bcn + "stroke");
  3249. y.className && d.setCN(a, Nb, y.className, !0);
  3250. ya = F;
  3251. za = E
  3252. }
  3253. }
  3254. if (!U && !isNaN(X)) {
  3255. var Qb = this.hideBulletsCount;
  3256. if (this.end - this.start <= Qb || 0 === Qb) {
  3257. var Rb = this.createBullet(y, ga, ha, K),
  3258. Sb = this.labelText;
  3259. if (Sb && Rb) {
  3260. var Hb = this.createLabel(y, ga, ha, Sb);
  3261. (Hb = this.positionLabel(ya, za, Hb, Rb, M, fa)) && this.allBullets.push(Hb)
  3262. }
  3263. if ("regular" == J || "100%" == J) {
  3264. var Tb = f.totalText;
  3265. if (Tb) {
  3266. var Va = this.createLabel(y, 0, 0, Tb, f.totalTextColor);
  3267. this.allBullets.push(Va);
  3268. var Ub = Va.getBBox(),
  3269. Vb = Ub.width,
  3270. Wb = Ub.height,
  3271. bb, cb, pb = f.totalTextOffset,
  3272. Xb = f.totals[K];
  3273. Xb && Xb.remove();
  3274. var db = 0;
  3275. "column" != g && (db = this.bulletSize);
  3276. r ? (cb = E, bb = 0 > X ? F - Vb / 2 - 2 - db - pb : F + Vb / 2 + 3 + db + pb) : (bb = F, cb = 0 > X ? E + Wb / 2 + db + pb : E - Wb / 2 - 3 - db - pb);
  3277. Va.translate(bb, cb);
  3278. f.totals[K] = Va;
  3279. r ? (0 > cb || cb > q) && Va.remove() : (0 > bb || bb > n) && Va.remove()
  3280. }
  3281. }
  3282. }
  3283. }
  3284. }
  3285. }
  3286. if ("line" == g || "step" == g || "smoothedLine" == g) "smoothedLine" == g ? this.drawSmoothedGraph(w, x, R, S) : this.drawLineGraph(w, x, R, S), U || this.launchAnimation();
  3287. this.bulletsHidden && this.hideBullets();
  3288. this.customBulletsHidden && this.hideCustomBullets()
  3289. },
  3290. animateColumns: function (a, b) {
  3291. var c = this,
  3292. e = c.chart.startDuration;
  3293. 0 < e && !c.animationPlayed && (c.seqAn ? (a.set.hide(), c.animationArray.push(a), e = setTimeout(function () {
  3294. c.animate.call(c)
  3295. }, e / (c.end - c.start + 1) * (b - c.start) * 1E3), c.timeOuts.push(e)) : c.animate(a))
  3296. },
  3297. createLabel: function (a, b, c, e, h) {
  3298. var f = this.chart,
  3299. g = a.labelColor;
  3300. g || (g = this.color);
  3301. g || (g = f.color);
  3302. h && (g = h);
  3303. h = this.fontSize;
  3304. void 0 === h && (this.fontSize = h = f.fontSize);
  3305. var k = this.labelFunction;
  3306. e = f.formatString(e, a);
  3307. e = d.cleanFromEmpty(e);
  3308. k && (e = k(a, e));
  3309. a = d.text(this.container,
  3310. e, g, f.fontFamily, h);
  3311. a.node.style.pointerEvents = "none";
  3312. a.translate(b, c);
  3313. this.bulletSet.push(a);
  3314. return a
  3315. },
  3316. positiveClip: function (a) {
  3317. a.clipRect(this.pmx, this.pmy, this.pmw, this.pmh)
  3318. },
  3319. negativeClip: function (a) {
  3320. a.clipRect(this.nmx, this.nmy, this.nmw, this.nmh)
  3321. },
  3322. drawLineGraph: function (a, b, c, e) {
  3323. var h = this;
  3324. if (1 < a.length) {
  3325. var f = h.set,
  3326. g = h.chart,
  3327. k = h.container,
  3328. l = k.set(),
  3329. m = k.set();
  3330. f.push(m);
  3331. f.push(l);
  3332. var n = h.lineAlpha,
  3333. q = h.lineThickness,
  3334. f = h.fillAlphas,
  3335. p = h.lineColorR,
  3336. r = h.negativeLineAlpha;
  3337. isNaN(r) && (r = n);
  3338. var t = h.lineColorSwitched;
  3339. t && (p = t);
  3340. var t = h.fillColorsR,
  3341. u = h.fillColorsSwitched;
  3342. u && (t = u);
  3343. var z = h.dashLength;
  3344. (u = h.dashLengthSwitched) && (z = u);
  3345. var u = h.negativeLineColor,
  3346. w = h.negativeFillColors,
  3347. x = h.negativeFillAlphas,
  3348. v = h.baseCoord;
  3349. 0 !== h.negativeBase && (v = h.valueAxis.getCoordinate(h.negativeBase), v > h.height && (v = h.height), 0 > v && (v = 0));
  3350. n = d.line(k, a, b, p, n, q, z, !1, !0);
  3351. d.setCN(g, n, h.bcn + "stroke");
  3352. l.push(n);
  3353. l.click(function (a) {
  3354. h.handleGraphEvent(a, "clickGraph")
  3355. }).mouseover(function (a) {
  3356. h.handleGraphEvent(a, "rollOverGraph")
  3357. }).mouseout(function (a) {
  3358. h.handleGraphEvent(a,
  3359. "rollOutGraph")
  3360. });
  3361. void 0 === u || h.useNegativeColorIfDown || (q = d.line(k, a, b, u, r, q, z, !1, !0), d.setCN(g, q, h.bcn + "stroke"), d.setCN(g, q, h.bcn + "stroke-negative"), m.push(q));
  3362. if (0 < f || 0 < x)
  3363. if (q = a.join(";").split(";"), r = b.join(";").split(";"), n = g.type, "serial" == n ? 0 < c.length ? (c.reverse(), e.reverse(), q = a.concat(c), r = b.concat(e)) : h.rotate ? (r.push(r[r.length - 1]), q.push(v), r.push(r[0]), q.push(v), r.push(r[0]), q.push(q[0])) : (q.push(q[q.length - 1]), r.push(v), q.push(q[0]), r.push(v), q.push(a[0]), r.push(r[0])) : "xy" == n && (b =
  3364. h.fillToAxis) && (d.isString(b) && (b = g.getValueAxisById(b)), "H" == b.orientation ? (v = "top" == b.position ? 0 : b.viH, q.push(q[q.length - 1]), r.push(v), q.push(q[0]), r.push(v), q.push(a[0]), r.push(r[0])) : (v = "left" == b.position ? 0 : b.viW, r.push(r[r.length - 1]), q.push(v), r.push(r[0]), q.push(v), r.push(r[0]), q.push(q[0]))), a = h.gradientRotation, 0 < f && (b = d.polygon(k, q, r, t, f, 1, "#000", 0, a), b.pattern(h.pattern, NaN, g.path), d.setCN(g, b, h.bcn + "fill"), l.push(b)), w || void 0 !== u) isNaN(x) && (x = f), w || (w = u), k = d.polygon(k, q, r, w, x, 1, "#000",
  3365. 0, a), d.setCN(g, k, h.bcn + "fill"), d.setCN(g, k, h.bcn + "fill-negative"), k.pattern(h.pattern, NaN, g.path), m.push(k), m.click(function (a) {
  3366. h.handleGraphEvent(a, "clickGraph")
  3367. }).mouseover(function (a) {
  3368. h.handleGraphEvent(a, "rollOverGraph")
  3369. }).mouseout(function (a) {
  3370. h.handleGraphEvent(a, "rollOutGraph")
  3371. });
  3372. h.applyMask(m, l)
  3373. }
  3374. },
  3375. applyMask: function (a, b) {
  3376. var c = a.length();
  3377. "serial" != this.chart.type || this.scrollbar || (this.positiveClip(b), 0 < c && this.negativeClip(a))
  3378. },
  3379. drawSmoothedGraph: function (a, b, c, e) {
  3380. if (1 < a.length) {
  3381. var h = this.set,
  3382. f = this.chart,
  3383. g = this.container,
  3384. k = g.set(),
  3385. l = g.set();
  3386. h.push(l);
  3387. h.push(k);
  3388. var m = this.lineAlpha,
  3389. n = this.lineThickness,
  3390. h = this.dashLength,
  3391. q = this.fillAlphas,
  3392. p = this.lineColorR,
  3393. r = this.fillColorsR,
  3394. t = this.negativeLineColor,
  3395. u = this.negativeFillColors,
  3396. z = this.negativeFillAlphas,
  3397. w = this.baseCoord,
  3398. x = this.lineColorSwitched;
  3399. x && (p = x);
  3400. (x = this.fillColorsSwitched) && (r = x);
  3401. x = this.negativeLineAlpha;
  3402. isNaN(x) && (x = m);
  3403. m = new d.Bezier(g, a, b, p, m, n, r, 0, h);
  3404. d.setCN(f, m, this.bcn + "stroke");
  3405. k.push(m.path);
  3406. void 0 !== t && (n = new d.Bezier(g, a,
  3407. b, t, x, n, r, 0, h), d.setCN(f, n, this.bcn + "stroke"), d.setCN(f, n, this.bcn + "stroke-negative"), l.push(n.path));
  3408. 0 < q && (m = a.join(";").split(";"), p = b.join(";").split(";"), n = "", 0 < c.length ? (c.push("M"), e.push("M"), c.reverse(), e.reverse(), m = a.concat(c), p = b.concat(e)) : (this.rotate ? (n += " L" + w + "," + b[b.length - 1], n += " L" + w + "," + b[0]) : (n += " L" + a[a.length - 1] + "," + w, n += " L" + a[0] + "," + w), n += " L" + a[0] + "," + b[0]), c = new d.Bezier(g, m, p, NaN, 0, 0, r, q, h, n), d.setCN(f, c, this.bcn + "fill"), c.path.pattern(this.pattern, NaN, f.path), k.push(c.path),
  3409. u || void 0 !== t) && (z || (z = q), u || (u = t), a = new d.Bezier(g, a, b, NaN, 0, 0, u, z, 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"), l.push(a.path));
  3410. this.applyMask(l, k)
  3411. }
  3412. },
  3413. launchAnimation: function () {
  3414. var a = this,
  3415. b = a.chart.startDuration;
  3416. if (0 < b && !a.animationPlayed) {
  3417. var c = a.set,
  3418. e = a.bulletSet;
  3419. d.VML || (c.attr({
  3420. opacity: a.startAlpha
  3421. }), e.attr({
  3422. opacity: a.startAlpha
  3423. }));
  3424. c.hide();
  3425. e.hide();
  3426. a.seqAn ? (b = setTimeout(function () {
  3427. a.animateGraphs.call(a)
  3428. }, a.index * b * 1E3), a.timeOuts.push(b)) :
  3429. a.animateGraphs()
  3430. }
  3431. },
  3432. animateGraphs: function () {
  3433. var a = this.chart,
  3434. b = this.set,
  3435. c = this.bulletSet,
  3436. e = this.x,
  3437. d = this.y;
  3438. b.show();
  3439. c.show();
  3440. var f = a.startDuration,
  3441. a = a.startEffect;
  3442. b && (this.rotate ? (b.translate(-1E3, d), c.translate(-1E3, d)) : (b.translate(e, -1E3), c.translate(e, -1E3)), b.animate({
  3443. opacity: 1,
  3444. translate: e + "," + d
  3445. }, f, a), c.animate({
  3446. opacity: 1,
  3447. translate: e + "," + d
  3448. }, f, a))
  3449. },
  3450. animate: function (a) {
  3451. var b = this.chart,
  3452. c = this.animationArray;
  3453. !a && 0 < c.length && (a = c[0], c.shift());
  3454. c = d[d.getEffect(b.startEffect)];
  3455. b = b.startDuration;
  3456. a &&
  3457. (this.rotate ? a.animateWidth(b, c) : a.animateHeight(b, c), a.set.show())
  3458. },
  3459. legendKeyColor: function () {
  3460. var a = this.legendColor,
  3461. b = this.lineAlpha;
  3462. void 0 === a && (a = this.lineColorR, 0 === b && (b = this.fillColorsR) && (a = "object" == typeof b ? b[0] : b));
  3463. return a
  3464. },
  3465. legendKeyAlpha: function () {
  3466. var a = this.legendAlpha;
  3467. void 0 === a && (a = this.lineAlpha, this.fillAlphas > a && (a = this.fillAlphas), 0 === a && (a = this.bulletAlpha), 0 === a && (a = 1));
  3468. return a
  3469. },
  3470. createBullet: function (a, b, c) {
  3471. if (!isNaN(b) && !isNaN(c)) {
  3472. var e = this.chart,
  3473. h = this.container,
  3474. f = this.bulletOffset,
  3475. g = this.bulletSize;
  3476. isNaN(a.bulletSize) || (g = a.bulletSize);
  3477. var k = a.values.value,
  3478. l = this.maxValue,
  3479. m = this.minValue,
  3480. n = this.maxBulletSize,
  3481. q = this.minBulletSize;
  3482. isNaN(l) || (isNaN(k) || (g = (k - m) / (l - m) * (n - q) + q), m == l && (g = n));
  3483. l = g;
  3484. this.bulletAxis && (g = a.values.error, isNaN(g) || (k = g), g = this.bulletAxis.stepWidth * k);
  3485. g < this.minBulletSize && (g = this.minBulletSize);
  3486. this.rotate ? b = a.isNegative ? b - f : b + f : c = a.isNegative ? c + f : c - f;
  3487. var p, q = this.bulletColorR;
  3488. a.lineColor && (this.bulletColorSwitched = a.lineColor);
  3489. this.bulletColorSwitched &&
  3490. (q = this.bulletColorSwitched);
  3491. a.isNegative && void 0 !== this.bulletColorNegative && (q = this.bulletColorNegative);
  3492. void 0 !== a.color && (q = a.color);
  3493. var r;
  3494. "xy" == e.type && this.valueField && (r = this.pattern, a.pattern && (r = a.pattern));
  3495. f = this.bullet;
  3496. a.bullet && (f = a.bullet);
  3497. var k = this.bulletBorderThickness,
  3498. m = this.bulletBorderColorR,
  3499. n = this.bulletBorderAlpha,
  3500. t = this.bulletAlpha;
  3501. m || (m = q);
  3502. this.useLineColorForBulletBorder && (m = this.lineColorR);
  3503. var u = a.alpha;
  3504. isNaN(u) || (t = u);
  3505. if ("none" != this.bullet || a.bullet) p = d.bullet(h, f, g, q,
  3506. t, k, m, n, l, 0, r, e.path);
  3507. if (this.customBullet || a.customBullet) r = this.customBullet, a.customBullet && (r = a.customBullet), r && (p && p.remove(), "function" == typeof r ? (p = new r, p.chart = e, a.bulletConfig && (p.availableSpace = c, p.graph = this, p.graphDataItem = a, p.bulletY = c, a.bulletConfig.minCoord = this.minCoord - c, p.bulletConfig = a.bulletConfig), p.write(h), p = p.set) : (p = h.set(), h = h.image(r, 0, 0, g, g), p.push(h), this.centerCustomBullets && h.translate(-g / 2, -g / 2)));
  3508. if (p) {
  3509. (a.url || this.showHandOnHover) && p.setAttr("cursor", "pointer");
  3510. if ("serial" == e.type || "gantt" == e.type)
  3511. if (-.5 > b - 0 || b - 0 > this.width || c < -g / 2 || c - 0 > this.height) p.remove(), p = null;
  3512. p && (this.bulletSet.push(p), p.translate(b, c), this.addListeners(p, a), this.allBullets.push(p));
  3513. a.bx = b;
  3514. a.by = c;
  3515. d.setCN(e, p, this.bcn + "bullet");
  3516. a.className && d.setCN(e, p, a.className, !0)
  3517. }
  3518. p ? (p.size = g || 0, a.bulletGraphics = p) : p = {
  3519. size: 0
  3520. };
  3521. p.graphDataItem = a;
  3522. return p
  3523. }
  3524. },
  3525. showBullets: function () {
  3526. var a = this.allBullets,
  3527. b;
  3528. this.bulletsHidden = !1;
  3529. for (b = 0; b < a.length; b++) a[b].show()
  3530. },
  3531. hideBullets: function () {
  3532. var a = this.allBullets,
  3533. b;
  3534. this.bulletsHidden = !0;
  3535. for (b = 0; b < a.length; b++) a[b].hide()
  3536. },
  3537. showCustomBullets: function () {
  3538. var a = this.allBullets,
  3539. b;
  3540. this.customBulletsHidden = !1;
  3541. for (b = 0; b < a.length; b++) a[b].graphDataItem.customBullet && a[b].show()
  3542. },
  3543. hideCustomBullets: function () {
  3544. var a = this.allBullets,
  3545. b;
  3546. this.customBulletsHidden = !0;
  3547. for (b = 0; b < a.length; b++) a[b].graphDataItem.customBullet && a[b].hide()
  3548. },
  3549. addListeners: function (a, b) {
  3550. var c = this;
  3551. a.mouseover(function (a) {
  3552. c.handleRollOver(b, a)
  3553. }).mouseout(function (a) {
  3554. c.handleRollOut(b, a)
  3555. }).touchend(function (a) {
  3556. c.handleRollOver(b,
  3557. a);
  3558. c.chart.panEventsEnabled && c.handleClick(b, a)
  3559. }).touchstart(function (a) {
  3560. c.handleRollOver(b, a)
  3561. }).click(function (a) {
  3562. c.handleClick(b, a)
  3563. }).dblclick(function (a) {
  3564. c.handleDoubleClick(b, a)
  3565. }).contextmenu(function (a) {
  3566. c.handleRightClick(b, a)
  3567. })
  3568. },
  3569. handleRollOver: function (a, b) {
  3570. if (a) {
  3571. var c = this.chart,
  3572. e = {
  3573. type: "rollOverGraphItem",
  3574. item: a,
  3575. index: a.index,
  3576. graph: this,
  3577. target: this,
  3578. chart: this.chart,
  3579. event: b
  3580. };
  3581. this.fire("rollOverGraphItem", e);
  3582. c.fire("rollOverGraphItem", e);
  3583. clearTimeout(c.hoverInt);
  3584. e = this.showBalloon;
  3585. !c.chartCursor ||
  3586. "serial" != c.type && "gantt" != c.type || (e = !1, !c.chartCursor.valueBalloonsEnabled && this.showBalloon && (e = !0));
  3587. if (e) {
  3588. var e = c.formatString(this.balloonText, a, !0),
  3589. h = this.balloonFunction;
  3590. h && (e = h(a, a.graph));
  3591. e = d.cleanFromEmpty(e);
  3592. h = c.getBalloonColor(this, a);
  3593. c.balloon.showBullet = !1;
  3594. c.balloon.pointerOrientation = "V";
  3595. var f = a.x,
  3596. g = a.y;
  3597. c.rotate && (f = a.y, g = a.x);
  3598. "" !== e ? c.showBalloon(e, h, !0, f + c.marginLeftReal, g + c.marginTopReal) : this.chart.hideBalloonReal()
  3599. } else this.chart.hideBalloonReal()
  3600. }
  3601. this.handleGraphEvent(b, "rollOverGraph")
  3602. },
  3603. handleRollOut: function (a, b) {
  3604. this.chart.hideBalloon();
  3605. if (a) {
  3606. var c = {
  3607. type: "rollOutGraphItem",
  3608. item: a,
  3609. index: a.index,
  3610. graph: this,
  3611. target: this,
  3612. chart: this.chart,
  3613. event: b
  3614. };
  3615. this.fire("rollOutGraphItem", c);
  3616. this.chart.fire("rollOutGraphItem", c)
  3617. }
  3618. this.handleGraphEvent(b, "rollOutGraph")
  3619. },
  3620. handleClick: function (a, b) {
  3621. if (a) {
  3622. var c = {
  3623. type: "clickGraphItem",
  3624. item: a,
  3625. index: a.index,
  3626. graph: this,
  3627. target: this,
  3628. chart: this.chart,
  3629. event: b
  3630. };
  3631. this.fire("clickGraphItem", c);
  3632. this.chart.fire("clickGraphItem", c);
  3633. d.getURL(a.url, this.urlTarget)
  3634. }
  3635. this.handleGraphEvent(b,
  3636. "clickGraph")
  3637. },
  3638. handleGraphEvent: function (a, b) {
  3639. var c = {
  3640. type: b,
  3641. graph: this,
  3642. target: this,
  3643. chart: this.chart,
  3644. event: a
  3645. };
  3646. this.fire(b, c);
  3647. this.chart.fire(b, c)
  3648. },
  3649. handleRightClick: function (a, b) {
  3650. if (a) {
  3651. var c = {
  3652. type: "rightClickGraphItem",
  3653. item: a,
  3654. index: a.index,
  3655. graph: this,
  3656. target: this,
  3657. chart: this.chart,
  3658. event: b
  3659. };
  3660. this.fire("rightClickGraphItem", c);
  3661. this.chart.fire("rightClickGraphItem", c)
  3662. }
  3663. },
  3664. handleDoubleClick: function (a, b) {
  3665. if (a) {
  3666. var c = {
  3667. type: "doubleClickGraphItem",
  3668. item: a,
  3669. index: a.index,
  3670. graph: this,
  3671. target: this,
  3672. chart: this.chart,
  3673. event: b
  3674. };
  3675. this.fire("doubleClickGraphItem", c);
  3676. this.chart.fire("doubleClickGraphItem", c)
  3677. }
  3678. },
  3679. zoom: function (a, b) {
  3680. this.start = a;
  3681. this.end = b;
  3682. this.draw()
  3683. },
  3684. changeOpacity: function (a) {
  3685. var b = this.set;
  3686. b && b.setAttr("opacity", a);
  3687. if (b = this.ownColumns) {
  3688. var c;
  3689. for (c = 0; c < b.length; c++) {
  3690. var e = b[c].set;
  3691. e && e.setAttr("opacity", a)
  3692. }
  3693. }(b = this.bulletSet) && b.setAttr("opacity", a)
  3694. },
  3695. destroy: function () {
  3696. d.remove(this.set);
  3697. d.remove(this.bulletSet);
  3698. var a = this.timeOuts;
  3699. if (a) {
  3700. var b;
  3701. for (b = 0; b < a.length; b++) clearTimeout(a[b])
  3702. }
  3703. this.timeOuts = []
  3704. }
  3705. })
  3706. })();
  3707. (function () {
  3708. var d = window.AmCharts;
  3709. d.ChartCursor = d.Class({
  3710. construct: function (a) {
  3711. this.cname = "ChartCursor";
  3712. this.createEvents("changed", "zoomed", "onHideCursor", "draw", "selected", "moved");
  3713. this.enabled = !0;
  3714. this.cursorAlpha = 1;
  3715. this.selectionAlpha = .2;
  3716. this.cursorColor = "#CC0000";
  3717. this.categoryBalloonAlpha = 1;
  3718. this.color = "#FFFFFF";
  3719. this.type = "cursor";
  3720. this.zoomed = !1;
  3721. this.zoomable = !0;
  3722. this.pan = !1;
  3723. this.categoryBalloonDateFormat = "MMM DD, YYYY";
  3724. this.categoryBalloonEnabled = this.valueBalloonsEnabled = !0;
  3725. this.rolledOver = !1;
  3726. this.cursorPosition = "middle";
  3727. this.bulletsEnabled = this.skipZoomDispatch = !1;
  3728. this.bulletSize = 8;
  3729. this.selectWithoutZooming = this.oneBalloonOnly = !1;
  3730. this.graphBulletSize = 1.7;
  3731. this.animationDuration = .3;
  3732. this.zooming = !1;
  3733. this.adjustment = 0;
  3734. this.avoidBalloonOverlapping = !0;
  3735. this.leaveCursor = !1;
  3736. d.applyTheme(this, a, this.cname)
  3737. },
  3738. draw: function () {
  3739. this.destroy();
  3740. var a = this.chart,
  3741. b = a.container;
  3742. this.rotate = a.rotate;
  3743. this.container = b;
  3744. b = b.set();
  3745. b.translate(this.x, this.y);
  3746. this.set = b;
  3747. a.cursorSet.push(b);
  3748. b = new d.AmBalloon;
  3749. b.className =
  3750. "category";
  3751. b.chart = a;
  3752. this.categoryBalloon = b;
  3753. d.copyProperties(a.balloon, b);
  3754. b.cornerRadius = 0;
  3755. b.shadowAlpha = 0;
  3756. b.borderThickness = 1;
  3757. b.borderAlpha = 1;
  3758. b.showBullet = !1;
  3759. var c = this.categoryBalloonColor;
  3760. void 0 === c && (c = this.cursorColor);
  3761. b.fillColor = c;
  3762. b.balloonColor = c;
  3763. b.fillAlpha = this.categoryBalloonAlpha;
  3764. b.borderColor = c;
  3765. b.color = this.color;
  3766. c = this.valueLineAxis;
  3767. d.isString(c) && (c = a.getValueAxisById(c));
  3768. c || (c = a.valueAxes[0]);
  3769. this.valueLineAxis = c;
  3770. this.valueLineBalloonEnabled && (this.vaBalloon = c = new d.AmBalloon, d.copyProperties(b,
  3771. c), c.animationDuration = 0, this.rotate || (c.pointerOrientation = "H"));
  3772. this.rotate && (b.pointerOrientation = "H");
  3773. this.extraWidth = 0;
  3774. this.prevX = [];
  3775. this.prevY = [];
  3776. this.prevTX = [];
  3777. this.prevTY = [];
  3778. if (this.valueBalloonsEnabled)
  3779. for (b = 0; b < a.graphs.length; b++) c = new d.AmBalloon, c.className = a.graphs[b].id, c.chart = a, d.copyProperties(a.balloon, c), a.graphs[b].valueBalloon = c;
  3780. "cursor" == this.type ? this.createCursor() : this.createCrosshair()
  3781. },
  3782. updateData: function () {
  3783. var a = this.chart;
  3784. this.data = a.chartData;
  3785. this.firstTime = a.firstTime;
  3786. this.lastTime = a.lastTime
  3787. },
  3788. createCursor: function () {
  3789. var a = this.chart,
  3790. b = this.cursorAlpha,
  3791. c = a.categoryAxis,
  3792. e = this.categoryBalloon,
  3793. h, f, g, k;
  3794. g = a.dx;
  3795. k = a.dy;
  3796. var l = this.width,
  3797. m = this.height,
  3798. n = a.rotate;
  3799. e.pointerWidth = c.tickLength;
  3800. n ? (h = [0, l, l + g], f = [0, 0, k], g = [g, 0, 0], k = [k, 0, m]) : (h = [g, 0, 0], f = [k, 0, m], g = [0, l, l + g], k = [0, 0, k]);
  3801. h = d.line(this.container, h, f, this.cursorColor, b, 1);
  3802. d.setCN(a, h, "cursor-line");
  3803. this.line = h;
  3804. h.node.style.pointerEvents = "none";
  3805. (f = this.fullRectSet) ? (f.push(h), f.translate(this.x, this.y)) : this.set.push(h);
  3806. this.valueLineEnabled && (h = this.valueLineAlpha, isNaN(h) || (b = h), b = d.line(this.container, g, k, this.cursorColor, b, 1), b.node.style.pointerEvents = "none", d.setCN(a, b, "cursor-value-line"), this.vLine = b, this.set.push(b));
  3807. this.setBalloonBounds(e, c, n);
  3808. (a = this.vaBalloon) && this.setBalloonBounds(a, this.valueLineAxis, !n);
  3809. this.hideCursor()
  3810. },
  3811. createCrosshair: function () {
  3812. var a = this.cursorAlpha,
  3813. b = this.container,
  3814. c = d.line(b, [0, 0], [0, this.height], this.cursorColor, a, 1),
  3815. a = d.line(b, [0, this.width], [0, 0], this.cursorColor, a, 1);
  3816. d.setCN(this.chart, c, "cursor-line");
  3817. d.setCN(this.chart, a, "cursor-line");
  3818. this.set.push(c);
  3819. this.set.push(a);
  3820. this.vLine = c;
  3821. this.hLine = a;
  3822. this.hideCursor()
  3823. },
  3824. update: function () {
  3825. var a = this.chart;
  3826. if (a.mouseIsOver) {
  3827. var b = a.mouseX - this.x,
  3828. c = a.mouseY - this.y; - .5 < b && b < this.width + 1 && 0 < c && c < this.height ? (this.drawing ? this.rolledOver || a.setMouseCursor("crosshair") : this.pan && (this.rolledOver || a.setMouseCursor("move")), this.rolledOver = !0, (this.valueLineEnabled || this.valueLineBalloonEnabled) && this.updateVLine(b, c), this.setPosition()) :
  3829. this.rolledOver && (this.handleMouseOut(), this.rolledOver = !1)
  3830. } else this.rolledOver && (this.handleMouseOut(), this.rolledOver = !1)
  3831. },
  3832. updateVLine: function (a, b) {
  3833. var c = this.vLine,
  3834. e = this.vaBalloon;
  3835. if ((c || e) && !this.panning && !this.drawing) {
  3836. c && c.show();
  3837. var d = this.valueLineAxis,
  3838. f, g = this.rotate;
  3839. g ? (c && c.translate(a, 0), d && (f = d.coordinateToValue(a)), c = a) : (c && c.translate(0, b), d && (f = d.coordinateToValue(b)), c = b - 1);
  3840. if (e && !isNaN(f) && this.prevLineValue != f) {
  3841. var k = d.formatValue(f, !0);
  3842. this.setBalloonPosition(e, d, c, !g);
  3843. e.showBalloon(k)
  3844. }
  3845. this.prevLineValue =
  3846. f
  3847. }
  3848. },
  3849. getMousePosition: function () {
  3850. var a, b = this.width,
  3851. c = this.height;
  3852. a = this.chart;
  3853. this.rotate ? (a = a.mouseY - this.y, 0 > a && (a = 0), a > c && (a = c)) : (a = a.mouseX - this.x - 1, 0 > a && (a = 0), a > b && (a = b));
  3854. return a
  3855. },
  3856. updateCrosshair: function () {
  3857. var a = this.chart,
  3858. b = a.mouseX - this.x,
  3859. c = a.mouseY - this.y,
  3860. e = this.vLine,
  3861. h = this.hLine,
  3862. b = d.fitToBounds(b, 0, this.width),
  3863. c = d.fitToBounds(c, 0, this.height);
  3864. 0 < this.cursorAlpha && (e.show(), h.show(), e.translate(b, 0), h.translate(0, c));
  3865. this.zooming && (a.hideXScrollbar && (b = NaN), a.hideYScrollbar && (c = NaN), this.updateSelectionSize(b,
  3866. c));
  3867. this.fireMoved();
  3868. a.mouseIsOver || this.zooming || this.hideCursor()
  3869. },
  3870. fireMoved: function () {
  3871. var a = this.chart,
  3872. b = {
  3873. type: "moved",
  3874. target: this
  3875. };
  3876. b.chart = a;
  3877. b.zooming = this.zooming;
  3878. b.x = a.mouseX - this.x;
  3879. b.y = a.mouseY - this.y;
  3880. this.fire("moved", b)
  3881. },
  3882. updateSelectionSize: function (a, b) {
  3883. d.remove(this.selection);
  3884. var c = this.selectionPosX,
  3885. e = this.selectionPosY,
  3886. h = 0,
  3887. f = 0,
  3888. g = this.width,
  3889. k = this.height;
  3890. isNaN(a) || (c > a && (h = a, g = c - a), c < a && (h = c, g = a - c), c == a && (h = a, g = 0), g += this.extraWidth, h -= this.extraWidth / 2);
  3891. isNaN(b) || (e > b && (f = b, k = e - b),
  3892. e < b && (f = e, k = b - e), e == b && (f = b, k = 0), k += this.extraWidth, f -= this.extraWidth / 2);
  3893. 0 < g && 0 < k && (c = d.rect(this.container, g, k, this.cursorColor, this.selectionAlpha), d.setCN(this.chart, c, "cursor-selection"), c.translate(h + this.x, f + this.y), this.selection = c)
  3894. },
  3895. arrangeBalloons: function () {
  3896. var a = this.valueBalloons,
  3897. b = this.x,
  3898. c = this.y,
  3899. e = this.height + c;
  3900. a.sort(this.compareY);
  3901. var d;
  3902. for (d = 0; d < a.length; d++) {
  3903. var f = a[d].balloon;
  3904. f.setBounds(b, c, b + this.width, e);
  3905. f.prevX = this.prevX[d];
  3906. f.prevY = this.prevY[d];
  3907. f.prevTX = this.prevTX[d];
  3908. f.prevTY =
  3909. this.prevTY[d];
  3910. f.draw();
  3911. e = f.yPos - 3
  3912. }
  3913. this.arrangeBalloons2()
  3914. },
  3915. compareY: function (a, b) {
  3916. return a.yy < b.yy ? 1 : -1
  3917. },
  3918. arrangeBalloons2: function () {
  3919. var a = this.valueBalloons;
  3920. a.reverse();
  3921. var b, c = this.x,
  3922. e, d, f = a.length;
  3923. for (d = 0; d < f; d++) {
  3924. var g = a[d].balloon;
  3925. b = g.bottom;
  3926. var k = g.bottom - g.yPos,
  3927. l = f - d - 1;
  3928. 0 < d && b - k < e + 3 && (g.setBounds(c, e + 3, c + this.width, e + k + 3), g.prevX = this.prevX[l], g.prevY = this.prevY[l], g.prevTX = this.prevTX[l], g.prevTY = this.prevTY[l], g.draw());
  3929. g.set && g.set.show();
  3930. this.prevX[l] = g.prevX;
  3931. this.prevY[l] = g.prevY;
  3932. this.prevTX[l] =
  3933. g.prevTX;
  3934. this.prevTY[l] = g.prevTY;
  3935. e = g.bottom
  3936. }
  3937. },
  3938. showBullets: function () {
  3939. d.remove(this.allBullets);
  3940. var a = this.container,
  3941. b = a.set();
  3942. this.set.push(b);
  3943. this.set.show();
  3944. this.allBullets = b;
  3945. var b = this.chart.graphs,
  3946. c;
  3947. for (c = 0; c < b.length; c++) {
  3948. var e = b[c];
  3949. if (!e.hidden && e.balloonText) {
  3950. var h = this.data[this.index].axes[e.valueAxis.id].graphs[e.id],
  3951. f = h.y;
  3952. if (!isNaN(f)) {
  3953. var g, k;
  3954. g = h.x;
  3955. this.rotate ? (k = f, f = g) : k = g;
  3956. e = d.circle(a, this.bulletSize / 2, this.chart.getBalloonColor(e, h, !0), e.cursorBulletAlpha);
  3957. e.translate(k, f);
  3958. this.allBullets.push(e)
  3959. }
  3960. }
  3961. }
  3962. },
  3963. destroy: function () {
  3964. this.clear();
  3965. d.remove(this.selection);
  3966. this.selection = null;
  3967. var a = this.categoryBalloon;
  3968. a && a.destroy();
  3969. (a = this.vaBalloon) && a.destroy();
  3970. this.destroyValueBalloons();
  3971. d.remove(this.set)
  3972. },
  3973. clear: function () {},
  3974. destroyValueBalloons: function () {
  3975. var a = this.valueBalloons;
  3976. if (a) {
  3977. var b;
  3978. for (b = 0; b < a.length; b++) a[b].balloon.hide()
  3979. }
  3980. },
  3981. zoom: function (a, b, c, e) {
  3982. var h = this.chart;
  3983. this.destroyValueBalloons();
  3984. this.zooming = !1;
  3985. var f;
  3986. this.rotate ? this.selectionPosY = f = h.mouseY : this.selectionPosX = f = h.mouseX;
  3987. this.start =
  3988. a;
  3989. this.end = b;
  3990. this.startTime = c;
  3991. this.endTime = e;
  3992. this.zoomed = !0;
  3993. e = h.categoryAxis;
  3994. f = this.rotate;
  3995. b = this.width;
  3996. c = this.height;
  3997. a = e.stepWidth;
  3998. if (this.fullWidth) {
  3999. var g = 1;
  4000. e.parseDates && !e.equalSpacing && (g = e.minDuration());
  4001. f ? this.extraWidth = c = a * g : (this.extraWidth = b = a * g, this.categoryBalloon.minWidth = b);
  4002. this.line && this.line.remove();
  4003. this.line = d.rect(this.container, b, c, this.cursorColor, this.cursorAlpha, 0);
  4004. this.line.node.style.pointerEvents = "none";
  4005. d.setCN(h, this.line, "cursor-fill");
  4006. this.fullRectSet && this.fullRectSet.push(this.line)
  4007. }
  4008. this.stepWidth =
  4009. a;
  4010. this.tempVal = this.valueBalloonsEnabled;
  4011. this.valueBalloonsEnabled = !1;
  4012. this.setPosition();
  4013. this.valueBalloonsEnabled = this.tempVal;
  4014. this.hideCursor()
  4015. },
  4016. hideObj: function (a) {
  4017. a && a.hide()
  4018. },
  4019. hideCursor: function (a) {
  4020. void 0 === a && (a = !0);
  4021. this.leaveCursor || (this.hideObj(this.set), this.hideObj(this.categoryBalloon), this.hideObj(this.line), this.hideObj(this.vLine), this.hideObj(this.hLine), this.hideObj(this.vaBalloon), this.hideObj(this.allBullets), this.destroyValueBalloons(), this.selectWithoutZooming || d.remove(this.selection),
  4022. this.previousIndex = NaN, a && this.fire("onHideCursor", {
  4023. type: "onHideCursor",
  4024. chart: this.chart,
  4025. target: this
  4026. }), this.drawing || this.chart.setMouseCursor("auto"), this.normalizeBulletSize())
  4027. },
  4028. setPosition: function (a, b, c) {
  4029. void 0 === b && (b = !0);
  4030. if ("cursor" == this.type) {
  4031. if (this.tempPosition = NaN, d.ifArray(this.data)) isNaN(a) && (a = this.getMousePosition()), (a != this.previousMousePosition || !0 === this.zoomed || this.oneBalloonOnly) && !isNaN(a) && ("mouse" == this.cursorPosition && (this.tempPosition = a), isNaN(c) && (c = this.chart.categoryAxis.xToIndex(a)),
  4032. c != this.previousIndex || this.zoomed || "mouse" == this.cursorPosition || this.oneBalloonOnly) && (this.updateCursor(c, b), this.zoomed = !1), this.previousMousePosition = a
  4033. } else this.updateCrosshair()
  4034. },
  4035. normalizeBulletSize: function () {
  4036. var a = this.resizedBullets;
  4037. if (a)
  4038. for (var b = 0; b < a.length; b++) {
  4039. var c = a[b],
  4040. e = c.bulletGraphics;
  4041. e && (e.translate(c.bx, c.by, 1), c = c.graph, isNaN(this.graphBulletAlpha) || (e.setAttr("fill-opacity", c.bulletAlpha), e.setAttr("stroke-opacity", c.bulletBorderAlpha)))
  4042. }
  4043. },
  4044. updateCursor: function (a, b) {
  4045. var c =
  4046. this.chart,
  4047. e = this.fullWidth,
  4048. h = c.mouseX - this.x,
  4049. f = c.mouseY - this.y;
  4050. this.drawingNow && (d.remove(this.drawingLine), this.drawingLine = d.line(this.container, [this.x + this.drawStartX, this.x + h], [this.y + this.drawStartY, this.y + f], this.cursorColor, 1, 1));
  4051. if (this.enabled) {
  4052. void 0 === b && (b = !0);
  4053. this.index = a += this.adjustment;
  4054. var g = c.categoryAxis,
  4055. k = c.dx,
  4056. l = c.dy,
  4057. m = this.x + 1,
  4058. n = this.y + 1,
  4059. q = this.width,
  4060. p = this.height,
  4061. r = this.data[a];
  4062. this.fireMoved();
  4063. if (r) {
  4064. var t = r.x[g.id],
  4065. u = c.rotate,
  4066. z = this.stepWidth,
  4067. w = this.categoryBalloon,
  4068. x = this.firstTime,
  4069. v = this.lastTime,
  4070. A = this.cursorPosition,
  4071. B = this.zooming,
  4072. D = this.panning,
  4073. C = c.graphs;
  4074. if (c.mouseIsOver || B || D || this.forceShow)
  4075. if (this.forceShow = !1, D) {
  4076. var k = this.panClickPos,
  4077. c = this.panClickEndTime,
  4078. B = this.panClickStartTime,
  4079. I = this.panClickEnd,
  4080. m = this.panClickStart,
  4081. h = (u ? k - f : k - h) / z;
  4082. if (!g.parseDates || g.equalSpacing) h = Math.round(h);
  4083. 0 !== h && (k = {
  4084. type: "zoomed",
  4085. target: this
  4086. }, k.chart = this.chart, g.parseDates && !g.equalSpacing ? (c + h > v && (h = v - c), B + h < x && (h = x - B), k.start = Math.round(B + h), k.end = Math.round(c + h), this.fire(k.type, k)) :
  4087. I + h >= this.data.length || 0 > m + h || (k.start = m + h, k.end = I + h, this.fire(k.type, k)))
  4088. } else {
  4089. "start" == A ? t -= g.cellWidth / 2 : "mouse" == A && (c.mouseIsOver ? t = u ? f - 2 : h - 2 : isNaN(this.tempPosition) || (t = this.tempPosition - 2));
  4090. if (u) {
  4091. if (0 > t)
  4092. if (B) t = 0;
  4093. else {
  4094. this.hideCursor();
  4095. return
  4096. } if (t > p + 1)
  4097. if (B) t = p + 1;
  4098. else {
  4099. this.hideCursor();
  4100. return
  4101. }
  4102. } else {
  4103. if (0 > t)
  4104. if (B) t = 0;
  4105. else {
  4106. this.hideCursor();
  4107. return
  4108. } if (t > q)
  4109. if (B) t = q;
  4110. else {
  4111. this.hideCursor();
  4112. return
  4113. }
  4114. }
  4115. x = this.line;
  4116. 0 < this.cursorAlpha && (u ? (v = 0, z = t + l, e && (z -= g.cellWidth / 2)) : (v = t, z = 0, e && (v -= g.cellWidth / 2)), A =
  4117. this.animationDuration, 0 < A && !this.zooming ? isNaN(this.previousX) ? x.translate(v, z) : (x.translate(this.previousX, this.previousY), x.animate({
  4118. translate: v + "," + z
  4119. }, A, "easeOutSine")) : x.translate(v, z), this.previousX = v, this.previousY = z, x.show());
  4120. this.linePos = u ? t + l : t;
  4121. B && (e && x.hide(), u ? this.updateSelectionSize(NaN, t) : this.updateSelectionSize(t, NaN));
  4122. z = !0;
  4123. B && (z = !1);
  4124. this.categoryBalloonEnabled && z ? (this.setBalloonPosition(w, g, t, u), (x = this.categoryBalloonFunction) ? w.showBalloon(x(r.category)) : g.parseDates ? (g = d.formatDate(r.category,
  4125. this.categoryBalloonDateFormat, c), -1 != g.indexOf("fff") && (g = d.formatMilliseconds(g, r.category)), w.showBalloon(g)) : w.showBalloon(d.fixNewLines(r.category))) : w.hide();
  4126. C && this.bulletsEnabled && this.showBullets();
  4127. if (this.oneBalloonOnly) {
  4128. t = Infinity;
  4129. for (g = 0; g < C.length; g++) w = C[g], w.showBalloon && !w.hidden && w.balloonText && (x = r.axes[w.valueAxis.id].graphs[w.id], v = x.y, isNaN(v) || (u ? Math.abs(h - v) < t && (t = Math.abs(h - v), I = w) : Math.abs(f - v) < t && (t = Math.abs(f - v), I = w)));
  4130. this.mostCloseGraph && (I = this.mostCloseGraph)
  4131. }
  4132. if (a !=
  4133. this.previousIndex || I != this.previousMostCloseGraph)
  4134. if (this.normalizeBulletSize(), this.destroyValueBalloons(), this.resizedBullets = [], C && this.valueBalloonsEnabled && z && c.balloon.enabled) {
  4135. this.valueBalloons = t = [];
  4136. for (g = 0; g < C.length; g++)
  4137. if (w = C[g], v = NaN, (!this.oneBalloonOnly || w == I) && w.showBalloon && !w.hidden && w.balloonText && ("step" == w.type && "left" == w.stepDirection && (r = this.data[a + 1]), r)) {
  4138. if (x = r.axes[w.valueAxis.id].graphs[w.id]) v = x.y;
  4139. if (this.showNextAvailable && isNaN(v) && a + 1 < this.data.length)
  4140. for (z = a + 1; z < this.data.length; z++)
  4141. if (e =
  4142. this.data[z])
  4143. if (x = e.axes[w.valueAxis.id].graphs[w.id], v = x.y, !isNaN(v)) break;
  4144. if (!isNaN(v)) {
  4145. e = x.x;
  4146. l = !0;
  4147. if (u) {
  4148. if (z = v, 0 > e || e > p) l = !1
  4149. } else if (z = e, e = v, 0 > z || z > q + k + 1) l = !1;
  4150. l && (l = this.graphBulletSize, A = this.graphBulletAlpha, 1 == l && isNaN(A) || !d.isModern || !(D = x.bulletGraphics) || (D.translate(x.bx, x.by, l), this.resizedBullets.push(x), isNaN(A) || (D.setAttr("fill-opacity", A), D.setAttr("stroke-opacity", A))), l = w.valueBalloon, A = c.getBalloonColor(w, x), l.setBounds(m, n, m + q, n + p), l.pointerOrientation = "H", D = this.balloonPointerOrientation,
  4151. "vertical" == D && (l.pointerOrientation = "V"), "horizontal" == D && (l.pointerOrientation = "H"), l.changeColor(A), void 0 !== w.balloonAlpha && (l.fillAlpha = w.balloonAlpha), void 0 !== w.balloonTextColor && (l.color = w.balloonTextColor), l.setPosition(z + m, e + n), z = c.formatString(w.balloonText, x, !0), (e = w.balloonFunction) && (z = e(x, w).toString()), "" !== z && (u ? l.showBalloon(z) : (l.text = z, l.show = !0), t.push({
  4152. yy: v,
  4153. balloon: l
  4154. })), !u && l.set && (l.set.hide(), w = l.textDiv) && (w.style.visibility = "hidden"))
  4155. }
  4156. } this.avoidBalloonOverlapping && this.arrangeBalloons()
  4157. } b ?
  4158. (k = {
  4159. type: "changed"
  4160. }, k.index = a, k.chart = this.chart, k.zooming = B, k.mostCloseGraph = I, k.position = u ? f : h, k.target = this, c.fire("changed", k), this.fire("changed", k), this.skipZoomDispatch = !1) : (this.skipZoomDispatch = !0, c.updateLegendValues(a));
  4161. this.previousIndex = a;
  4162. this.previousMostCloseGraph = I
  4163. }
  4164. }
  4165. } else this.hideCursor()
  4166. },
  4167. setBalloonPosition: function (a, b, c, e) {
  4168. var d = b.position,
  4169. f = b.inside;
  4170. b = b.axisThickness;
  4171. var g = this.chart,
  4172. k = g.dx,
  4173. g = g.dy,
  4174. l = this.x,
  4175. m = this.y,
  4176. n = this.width,
  4177. q = this.height;
  4178. e ? (f && ("right" == d ? a.setBounds(l, m +
  4179. g, l + n + k, m + c + g) : a.setBounds(l, m + g, l + n + k, m + c)), "right" == d ? f ? a.setPosition(l + n + k, m + c + g) : a.setPosition(l + n + k + b, m + c + g) : f ? a.setPosition(l, m + c) : a.setPosition(l - b, m + c)) : "top" == d ? f ? a.setPosition(l + c + k, m + g) : a.setPosition(l + c + k, m + g - b + 1) : f ? a.setPosition(l + c, m + q) : a.setPosition(l + c, m + q + b - 1)
  4180. },
  4181. setBalloonBounds: function (a, b, c) {
  4182. var e = b.position,
  4183. d = b.inside,
  4184. f = b.axisThickness,
  4185. g = b.tickLength,
  4186. k = this.chart,
  4187. l = k.dx,
  4188. k = k.dy,
  4189. m = this.x,
  4190. n = this.y,
  4191. q = this.width,
  4192. p = this.height;
  4193. c ? (d && (a.pointerWidth = 0), "right" == e ? d ? a.setBounds(m, n + k,
  4194. m + q + l, n + p + k) : a.setBounds(m + q + l + f, n + k, m + q + 1E3, n + p + k) : d ? a.setBounds(m, n, q + m, p + n) : a.setBounds(-1E3, -1E3, m - g - f, n + p + 15)) : (a.maxWidth = q, b.parseDates && (g = 0, a.pointerWidth = 0), "top" == e ? d ? a.setBounds(m + l, n + k, q + l + m, p + n) : a.setBounds(m + l, -1E3, q + l + m, n + k - g - f) : d ? a.setBounds(m, n, q + m, p + n - g) : a.setBounds(m, n + p + g + f - 1, m + q, n + p + g + f))
  4195. },
  4196. enableDrawing: function (a) {
  4197. this.enabled = !a;
  4198. this.hideCursor();
  4199. this.rolledOver = !1;
  4200. this.drawing = a
  4201. },
  4202. isZooming: function (a) {
  4203. a && a != this.zooming && this.handleMouseDown("fake");
  4204. a || a == this.zooming || this.handleMouseUp()
  4205. },
  4206. handleMouseOut: function () {
  4207. if (this.enabled)
  4208. if (this.zooming) this.setPosition();
  4209. else {
  4210. this.index = void 0;
  4211. var a = {
  4212. type: "changed",
  4213. index: void 0,
  4214. target: this
  4215. };
  4216. a.chart = this.chart;
  4217. this.fire("changed", a);
  4218. this.hideCursor()
  4219. }
  4220. },
  4221. handleReleaseOutside: function () {
  4222. this.handleMouseUp()
  4223. },
  4224. handleMouseUp: function () {
  4225. var a = this.chart,
  4226. b = this.data,
  4227. c;
  4228. if (a) {
  4229. var e = a.mouseX - this.x,
  4230. h = a.mouseY - this.y;
  4231. if (this.drawingNow) {
  4232. this.drawingNow = !1;
  4233. d.remove(this.drawingLine);
  4234. c = this.drawStartX;
  4235. var f = this.drawStartY;
  4236. if (2 < Math.abs(c - e) || 2 < Math.abs(f -
  4237. h)) c = {
  4238. type: "draw",
  4239. target: this,
  4240. chart: a,
  4241. initialX: c,
  4242. initialY: f,
  4243. finalX: e,
  4244. finalY: h
  4245. }, this.fire(c.type, c)
  4246. }
  4247. if (this.enabled && 0 < b.length) {
  4248. if (this.pan) this.rolledOver = !1;
  4249. else if (this.zoomable && this.zooming) {
  4250. c = this.selectWithoutZooming ? {
  4251. type: "selected"
  4252. } : {
  4253. type: "zoomed"
  4254. };
  4255. c.target = this;
  4256. c.chart = a;
  4257. if ("cursor" == this.type) this.rotate ? this.selectionPosY = h : this.selectionPosX = h = e, 4 > Math.abs(h - this.initialMouse) && this.fromIndex == this.index || (this.index < this.fromIndex ? (c.end = this.fromIndex, c.start = this.index) : (c.end = this.index,
  4258. c.start = this.fromIndex), h = a.categoryAxis, h.parseDates && !h.equalSpacing && (b[c.start] && (c.start = b[c.start].time), b[c.end] && (c.end = a.getEndTime(b[c.end].time))), this.skipZoomDispatch || this.fire(c.type, c));
  4259. else {
  4260. var g = this.initialMouseX,
  4261. k = this.initialMouseY;
  4262. 3 > Math.abs(e - g) && 3 > Math.abs(h - k) || (b = Math.min(g, e), f = Math.min(k, h), e = Math.abs(g - e), h = Math.abs(k - h), a.hideXScrollbar && (b = 0, e = this.width), a.hideYScrollbar && (f = 0, h = this.height), c.selectionHeight = h, c.selectionWidth = e, c.selectionY = f, c.selectionX = b, this.skipZoomDispatch ||
  4263. this.fire(c.type, c))
  4264. }
  4265. this.selectWithoutZooming || d.remove(this.selection)
  4266. }
  4267. this.skipZoomDispatch = !1
  4268. }
  4269. }
  4270. this.panning = this.zooming = !1
  4271. },
  4272. showCursorAt: function (a) {
  4273. var b = this.chart.categoryAxis;
  4274. a = b.parseDates ? b.dateToCoordinate(a) : b.categoryToCoordinate(a);
  4275. this.previousMousePosition = NaN;
  4276. this.forceShow = !0;
  4277. this.setPosition(a, !1)
  4278. },
  4279. clearSelection: function () {
  4280. d.remove(this.selection)
  4281. },
  4282. handleMouseDown: function (a) {
  4283. if (this.zoomable || this.pan || this.drawing) {
  4284. var b = this.rotate,
  4285. c = this.chart,
  4286. e = c.mouseX - this.x,
  4287. h = c.mouseY -
  4288. this.y;
  4289. if (0 < e && e < this.width && 0 < h && h < this.height || "fake" == a) this.setPosition(), this.selectWithoutZooming && d.remove(this.selection), this.drawing ? (this.drawStartY = h, this.drawStartX = e, this.drawingNow = !0) : this.pan ? (this.zoomable = !1, c.setMouseCursor("move"), this.panning = !0, this.panClickPos = b ? h : e, this.panClickStart = this.start, this.panClickEnd = this.end, this.panClickStartTime = this.startTime, this.panClickEndTime = this.endTime) : this.zoomable && ("cursor" == this.type ? (this.fromIndex = this.index, b ? (this.initialMouse =
  4290. h, this.selectionPosY = this.linePos) : (this.initialMouse = e, this.selectionPosX = this.linePos)) : (this.initialMouseX = e, this.initialMouseY = h, this.selectionPosX = e, this.selectionPosY = h), this.zooming = !0)
  4291. }
  4292. }
  4293. })
  4294. })();
  4295. (function () {
  4296. var d = window.AmCharts;
  4297. d.SimpleChartScrollbar = d.Class({
  4298. construct: function (a) {
  4299. this.createEvents("zoomed");
  4300. this.backgroundColor = "#D4D4D4";
  4301. this.backgroundAlpha = 1;
  4302. this.selectedBackgroundColor = "#EFEFEF";
  4303. this.scrollDuration = this.selectedBackgroundAlpha = 1;
  4304. this.resizeEnabled = !0;
  4305. this.hideResizeGrips = !1;
  4306. this.scrollbarHeight = 20;
  4307. this.updateOnReleaseOnly = !1;
  4308. 9 > document.documentMode && (this.updateOnReleaseOnly = !0);
  4309. this.dragIconHeight = this.dragIconWidth = 35;
  4310. this.dragIcon = "dragIconRoundBig";
  4311. d.applyTheme(this,
  4312. a, "SimpleChartScrollbar")
  4313. },
  4314. draw: function () {
  4315. var a = this;
  4316. a.destroy();
  4317. if (a.enabled) {
  4318. var b = a.chart.container,
  4319. c = a.rotate,
  4320. e = a.chart,
  4321. h = b.set();
  4322. a.set = h;
  4323. e.scrollbarsSet.push(h);
  4324. var f, g;
  4325. c ? (f = a.scrollbarHeight, g = e.plotAreaHeight) : (g = a.scrollbarHeight, f = e.plotAreaWidth);
  4326. a.width = f;
  4327. if ((a.height = g) && f) {
  4328. var k = d.rect(b, f, g, a.backgroundColor, a.backgroundAlpha, 1, a.backgroundColor, a.backgroundAlpha);
  4329. d.setCN(e, k, "scrollbar-bg");
  4330. a.bg = k;
  4331. h.push(k);
  4332. k = d.rect(b, f, g, "#000", .005);
  4333. h.push(k);
  4334. a.invisibleBg = k;
  4335. k.click(function () {
  4336. a.handleBgClick()
  4337. }).mouseover(function () {
  4338. a.handleMouseOver()
  4339. }).mouseout(function () {
  4340. a.handleMouseOut()
  4341. }).touchend(function () {
  4342. a.handleBgClick()
  4343. });
  4344. k = d.rect(b, f, g, a.selectedBackgroundColor, a.selectedBackgroundAlpha);
  4345. d.setCN(e, k, "scrollbar-bg-selected");
  4346. a.selectedBG = k;
  4347. h.push(k);
  4348. f = d.rect(b, f, g, "#000", .005);
  4349. a.dragger = f;
  4350. h.push(f);
  4351. f.mousedown(function (b) {
  4352. a.handleDragStart(b)
  4353. }).mouseup(function () {
  4354. a.handleDragStop()
  4355. }).mouseover(function () {
  4356. a.handleDraggerOver()
  4357. }).mouseout(function () {
  4358. a.handleMouseOut()
  4359. }).touchstart(function (b) {
  4360. a.handleDragStart(b)
  4361. }).touchend(function () {
  4362. a.handleDragStop()
  4363. });
  4364. f = e.pathToImages;
  4365. c ? (k = f + a.dragIcon + "H.png", f = a.dragIconWidth,
  4366. c = a.dragIconHeight) : (k = f + a.dragIcon + ".png", c = a.dragIconWidth, f = a.dragIconHeight);
  4367. g = b.image(k, 0, 0, c, f);
  4368. d.setCN(e, g, "scrollbar-grip-left");
  4369. k = b.image(k, 0, 0, c, f);
  4370. d.setCN(e, k, "scrollbar-grip-right");
  4371. var l = 10,
  4372. m = 20;
  4373. e.panEventsEnabled && (l = 25, m = a.scrollbarHeight);
  4374. var n = d.rect(b, l, m, "#000", .005),
  4375. q = d.rect(b, l, m, "#000", .005);
  4376. q.translate(-(l - c) / 2, -(m - f) / 2);
  4377. n.translate(-(l - c) / 2, -(m - f) / 2);
  4378. c = b.set([g, q]);
  4379. b = b.set([k, n]);
  4380. a.iconLeft = c;
  4381. h.push(a.iconLeft);
  4382. a.iconRight = b;
  4383. h.push(b);
  4384. c.mousedown(function () {
  4385. a.leftDragStart()
  4386. }).mouseup(function () {
  4387. a.leftDragStop()
  4388. }).mouseover(function () {
  4389. a.iconRollOver()
  4390. }).mouseout(function () {
  4391. a.iconRollOut()
  4392. }).touchstart(function () {
  4393. a.leftDragStart()
  4394. }).touchend(function () {
  4395. a.leftDragStop()
  4396. });
  4397. b.mousedown(function () {
  4398. a.rightDragStart()
  4399. }).mouseup(function () {
  4400. a.rightDragStop()
  4401. }).mouseover(function () {
  4402. a.iconRollOver()
  4403. }).mouseout(function () {
  4404. a.iconRollOut()
  4405. }).touchstart(function () {
  4406. a.rightDragStart()
  4407. }).touchend(function () {
  4408. a.rightDragStop()
  4409. });
  4410. d.ifArray(e.chartData) ? h.show() : h.hide();
  4411. a.hideDragIcons();
  4412. a.clipDragger(!1)
  4413. }
  4414. h.translate(a.x, a.y);
  4415. h.node.style.msTouchAction = "none"
  4416. }
  4417. },
  4418. updateScrollbarSize: function (a, b) {
  4419. a = Math.round(a);
  4420. b = Math.round(b);
  4421. var c = this.dragger,
  4422. e, d, f, g;
  4423. this.rotate ? (e = 0, d = a, f = this.width +
  4424. 1, g = b - a, c.setAttr("height", b - a), c.setAttr("y", d)) : (e = a, d = 0, f = b - a, g = this.height + 1, c.setAttr("width", b - a), c.setAttr("x", e));
  4425. this.clipAndUpdate(e, d, f, g)
  4426. },
  4427. update: function () {
  4428. var a, b = !1,
  4429. c, e, d = this.x,
  4430. f = this.y,
  4431. g = this.dragger,
  4432. k = this.getDBox();
  4433. if (k) {
  4434. c = k.x + d;
  4435. e = k.y + f;
  4436. var l = k.width,
  4437. k = k.height,
  4438. m = this.rotate,
  4439. n = this.chart,
  4440. q = this.width,
  4441. p = this.height,
  4442. r = n.mouseX,
  4443. t = n.mouseY;
  4444. a = this.initialMouse;
  4445. this.forceClip && this.clipDragger(!0);
  4446. n.mouseIsOver && (this.dragging && (n = this.initialCoord, m ? (a = n + (t - a), 0 > a && (a = 0), n = p - k, a > n &&
  4447. (a = n), g.setAttr("y", a)) : (a = n + (r - a), 0 > a && (a = 0), n = q - l, a > n && (a = n), g.setAttr("x", a)), this.clipDragger(!0)), this.resizingRight && (m ? (a = t - e, a + e > p + f && (a = p - e + f), 0 > a ? (this.resizingRight = !1, b = this.resizingLeft = !0) : (0 === a && (a = .1), g.setAttr("height", a))) : (a = r - 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 = t, 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,
  4448. g.setAttr("y", c + k - f)) : (0 === a && (a = .1), g.setAttr("y", e - f), g.setAttr("height", a))) : (e = r, 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, g.setAttr("x", c + l - d)) : (0 === a && (a = .1), g.setAttr("x", e - d), g.setAttr("width", a))), this.clipDragger(!0)))
  4449. }
  4450. },
  4451. stopForceClip: function () {
  4452. this.forceClip = !1
  4453. },
  4454. clipDragger: function (a) {
  4455. var b = this.getDBox();
  4456. if (b) {
  4457. var c = b.x,
  4458. e = b.y,
  4459. d = b.width,
  4460. b = b.height,
  4461. f = !1;
  4462. if (this.rotate) {
  4463. if (c = 0, d = this.width + 1, this.clipY != e || this.clipH != b) f = !0
  4464. } else if (e =
  4465. 0, b = this.height + 1, this.clipX != c || this.clipW != d) f = !0;
  4466. f && (this.clipAndUpdate(c, e, d, b), a && (this.updateOnReleaseOnly || this.dispatchScrollbarEvent()))
  4467. }
  4468. },
  4469. maskGraphs: function () {},
  4470. clipAndUpdate: function (a, b, c, e) {
  4471. this.clipX = a;
  4472. this.clipY = b;
  4473. this.clipW = c;
  4474. this.clipH = e;
  4475. this.selectedBG.clipRect(a, b, c, e);
  4476. this.updateDragIconPositions();
  4477. this.maskGraphs(a, b, c, e)
  4478. },
  4479. dispatchScrollbarEvent: function () {
  4480. if (this.skipEvent) this.skipEvent = !1;
  4481. else {
  4482. var a = this.chart;
  4483. a.hideBalloon();
  4484. var b = this.getDBox(),
  4485. c = b.x,
  4486. e = b.y,
  4487. d = b.width,
  4488. b = b.height;
  4489. this.rotate ? (c = e, d = this.height / b) : d = this.width / d;
  4490. a = {
  4491. type: "zoomed",
  4492. position: c,
  4493. chart: a,
  4494. target: this,
  4495. multiplier: d
  4496. };
  4497. this.fire(a.type, a)
  4498. }
  4499. },
  4500. updateDragIconPositions: function () {
  4501. var a = this.getDBox(),
  4502. b = a.x,
  4503. c = a.y,
  4504. e = this.iconLeft,
  4505. d = this.iconRight,
  4506. f, g, k = this.scrollbarHeight;
  4507. this.rotate ? (f = this.dragIconWidth, g = this.dragIconHeight, e.translate((k - g) / 2, c - f / 2), d.translate((k - g) / 2, c + a.height - f / 2)) : (f = this.dragIconHeight, g = this.dragIconWidth, e.translate(b - g / 2, (k - f) / 2), d.translate(b - g / 2 + a.width, (k - f) / 2))
  4508. },
  4509. showDragIcons: function () {
  4510. this.resizeEnabled &&
  4511. (this.iconLeft.show(), this.iconRight.show())
  4512. },
  4513. hideDragIcons: function () {
  4514. if (!this.resizingLeft && !this.resizingRight && !this.dragging) {
  4515. if (this.hideResizeGrips || !this.resizeEnabled) this.iconLeft.hide(), this.iconRight.hide();
  4516. this.removeCursors()
  4517. }
  4518. },
  4519. removeCursors: function () {
  4520. this.chart.setMouseCursor("auto")
  4521. },
  4522. relativeZoom: function (a, b) {
  4523. this.enabled && (this.dragger.stop(), this.multiplier = a, this.position = b, this.updateScrollbarSize(b, this.rotate ? b + this.height / a : b + this.width / a), this.clipDragger())
  4524. },
  4525. destroy: function () {
  4526. this.clear();
  4527. d.remove(this.set);
  4528. d.remove(this.iconRight);
  4529. d.remove(this.iconLeft)
  4530. },
  4531. clear: function () {},
  4532. handleDragStart: function () {
  4533. if (this.enabled) {
  4534. var a = this.chart;
  4535. this.dragger.stop();
  4536. this.removeCursors();
  4537. this.dragging = !0;
  4538. var b = this.getDBox();
  4539. this.rotate ? (this.initialCoord = b.y, this.initialMouse = a.mouseY) : (this.initialCoord = b.x, this.initialMouse = a.mouseX)
  4540. }
  4541. },
  4542. handleDragStop: function () {
  4543. this.updateOnReleaseOnly && (this.update(), this.skipEvent = !1, this.dispatchScrollbarEvent());
  4544. this.dragging = !1;
  4545. this.mouseIsOver && this.removeCursors();
  4546. this.update()
  4547. },
  4548. handleDraggerOver: function () {
  4549. this.handleMouseOver()
  4550. },
  4551. leftDragStart: function () {
  4552. this.dragger.stop();
  4553. this.resizingLeft = !0
  4554. },
  4555. leftDragStop: function () {
  4556. this.resizingLeft = !1;
  4557. this.mouseIsOver || this.removeCursors();
  4558. this.updateOnRelease()
  4559. },
  4560. rightDragStart: function () {
  4561. this.dragger.stop();
  4562. this.resizingRight = !0
  4563. },
  4564. rightDragStop: function () {
  4565. this.resizingRight = !1;
  4566. this.mouseIsOver || this.removeCursors();
  4567. this.updateOnRelease()
  4568. },
  4569. iconRollOut: function () {
  4570. this.removeCursors()
  4571. },
  4572. iconRollOver: function () {
  4573. this.rotate ?
  4574. this.chart.setMouseCursor("n-resize") : this.chart.setMouseCursor("e-resize");
  4575. this.handleMouseOver()
  4576. },
  4577. getDBox: function () {
  4578. if (this.dragger) return this.dragger.getBBox()
  4579. },
  4580. handleBgClick: function () {
  4581. var a = this;
  4582. if (!a.resizingRight && !a.resizingLeft) {
  4583. a.zooming = !0;
  4584. var b, c, e = a.scrollDuration,
  4585. h = a.dragger;
  4586. b = a.getDBox();
  4587. var f = b.height,
  4588. g = b.width;
  4589. c = a.chart;
  4590. var k = a.y,
  4591. l = a.x,
  4592. m = a.rotate;
  4593. 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));
  4594. a.updateOnReleaseOnly ?
  4595. (a.skipEvent = !1, h.setAttr(b, c), a.dispatchScrollbarEvent(), a.clipDragger()) : (c = Math.round(c), m ? h.animate({
  4596. y: c
  4597. }, e, ">") : h.animate({
  4598. x: c
  4599. }, e, ">"), a.forceClip = !0, clearTimeout(a.forceTO), a.forceTO = setTimeout(function () {
  4600. a.stopForceClip.call(a)
  4601. }, 5E3 * e))
  4602. }
  4603. },
  4604. updateOnRelease: function () {
  4605. this.updateOnReleaseOnly && (this.update(), this.skipEvent = !1, this.dispatchScrollbarEvent())
  4606. },
  4607. handleReleaseOutside: function () {
  4608. if (this.set) {
  4609. if (this.resizingLeft || this.resizingRight || this.dragging) this.updateOnRelease(), this.removeCursors();
  4610. this.mouseIsOver = this.dragging = this.resizingRight = this.resizingLeft = !1;
  4611. this.hideDragIcons();
  4612. this.update()
  4613. }
  4614. },
  4615. handleMouseOver: function () {
  4616. this.mouseIsOver = !0;
  4617. this.showDragIcons()
  4618. },
  4619. handleMouseOut: function () {
  4620. this.mouseIsOver = !1;
  4621. this.hideDragIcons()
  4622. }
  4623. })
  4624. })();
  4625. (function () {
  4626. var d = window.AmCharts;
  4627. d.ChartScrollbar = d.Class({
  4628. inherits: d.SimpleChartScrollbar,
  4629. construct: function (a) {
  4630. this.cname = "ChartScrollbar";
  4631. d.ChartScrollbar.base.construct.call(this, a);
  4632. this.enabled = !0;
  4633. this.graphLineColor = "#BBBBBB";
  4634. this.graphLineAlpha = 0;
  4635. this.graphFillColor = "#BBBBBB";
  4636. this.graphFillAlpha = 1;
  4637. this.selectedGraphLineColor = "#888888";
  4638. this.selectedGraphLineAlpha = 0;
  4639. this.selectedGraphFillColor = "#888888";
  4640. this.selectedGraphFillAlpha = 1;
  4641. this.gridCount = 0;
  4642. this.gridColor = "#FFFFFF";
  4643. this.gridAlpha = .7;
  4644. this.skipEvent = this.autoGridCount = !1;
  4645. this.color = "#FFFFFF";
  4646. this.scrollbarCreated = !1;
  4647. this.offset = 0;
  4648. d.applyTheme(this, a, this.cname)
  4649. },
  4650. init: function () {
  4651. var a = this.categoryAxis,
  4652. b = this.chart;
  4653. a || (this.categoryAxis = a = new d.CategoryAxis);
  4654. a.chart = b;
  4655. a.id = "scrollbar";
  4656. a.dateFormats = b.categoryAxis.dateFormats;
  4657. a.markPeriodChange = b.categoryAxis.markPeriodChange;
  4658. a.boldPeriodBeginning = b.categoryAxis.boldPeriodBeginning;
  4659. a.axisItemRenderer = d.RecItem;
  4660. a.axisRenderer = d.RecAxis;
  4661. a.guideFillRenderer = d.RecFill;
  4662. a.inside = !0;
  4663. a.fontSize =
  4664. this.fontSize;
  4665. a.tickLength = 0;
  4666. a.axisAlpha = 0;
  4667. d.isString(this.graph) && (this.graph = d.getObjById(b.graphs, this.graph));
  4668. if (a = this.graph) {
  4669. var c = this.valueAxis;
  4670. c || (this.valueAxis = c = new d.ValueAxis, c.visible = !1, c.scrollbar = !0, c.axisItemRenderer = d.RecItem, c.axisRenderer = d.RecAxis, c.guideFillRenderer = d.RecFill, c.labelsEnabled = !1, c.chart = b);
  4671. b = this.unselectedGraph;
  4672. b || (b = new d.AmGraph, b.scrollbar = !0, this.unselectedGraph = b, b.negativeBase = a.negativeBase, b.noStepRisers = a.noStepRisers);
  4673. b = this.selectedGraph;
  4674. b || (b = new d.AmGraph,
  4675. b.scrollbar = !0, this.selectedGraph = b, b.negativeBase = a.negativeBase, b.noStepRisers = a.noStepRisers)
  4676. }
  4677. this.scrollbarCreated = !0
  4678. },
  4679. draw: function () {
  4680. var a = this;
  4681. d.ChartScrollbar.base.draw.call(a);
  4682. if (a.enabled) {
  4683. a.scrollbarCreated || a.init();
  4684. var b = a.chart,
  4685. c = b.chartData,
  4686. e = a.categoryAxis,
  4687. h = a.rotate,
  4688. f = a.x,
  4689. g = a.y,
  4690. k = a.width,
  4691. l = a.height,
  4692. m = b.categoryAxis,
  4693. n = a.set;
  4694. e.setOrientation(!h);
  4695. e.parseDates = m.parseDates;
  4696. e.rotate = h;
  4697. e.equalSpacing = m.equalSpacing;
  4698. e.minPeriod = m.minPeriod;
  4699. e.startOnAxis = m.startOnAxis;
  4700. e.viW = k;
  4701. e.viH = l;
  4702. e.width =
  4703. k;
  4704. e.height = l;
  4705. e.gridCount = a.gridCount;
  4706. e.gridColor = a.gridColor;
  4707. e.gridAlpha = a.gridAlpha;
  4708. e.color = a.color;
  4709. e.tickLength = 0;
  4710. e.axisAlpha = 0;
  4711. e.autoGridCount = a.autoGridCount;
  4712. e.parseDates && !e.equalSpacing && e.timeZoom(b.firstTime, b.lastTime);
  4713. e.zoom(0, c.length - 1);
  4714. if (m = a.graph) {
  4715. var q = a.valueAxis,
  4716. p = m.valueAxis;
  4717. q.id = p.id;
  4718. q.rotate = h;
  4719. q.setOrientation(h);
  4720. q.width = k;
  4721. q.height = l;
  4722. q.viW = k;
  4723. q.viH = l;
  4724. q.dataProvider = c;
  4725. q.reversed = p.reversed;
  4726. q.logarithmic = p.logarithmic;
  4727. q.gridAlpha = 0;
  4728. q.axisAlpha = 0;
  4729. n.push(q.set);
  4730. h ? (q.y = g, q.x = 0) : (q.x =
  4731. f, q.y = 0);
  4732. var f = Infinity,
  4733. g = -Infinity,
  4734. r;
  4735. for (r = 0; r < c.length; r++) {
  4736. var t = c[r].axes[p.id].graphs[m.id].values,
  4737. u;
  4738. for (u in t)
  4739. if (t.hasOwnProperty(u) && "percents" != u && "total" != u) {
  4740. var z = t[u];
  4741. z < f && (f = z);
  4742. z > g && (g = z)
  4743. }
  4744. }
  4745. Infinity != f && (q.minimum = f); - Infinity != g && (q.maximum = g + .1 * (g - f));
  4746. f == g && (--q.minimum, q.maximum += 1);
  4747. void 0 !== a.minimum && (q.minimum = a.minimum);
  4748. void 0 !== a.maximum && (q.maximum = a.maximum);
  4749. q.zoom(0, c.length - 1);
  4750. u = a.unselectedGraph;
  4751. u.id = m.id;
  4752. u.bcn = "scrollbar-graph-";
  4753. u.rotate = h;
  4754. u.chart = b;
  4755. u.data = c;
  4756. u.valueAxis =
  4757. q;
  4758. u.chart = m.chart;
  4759. u.categoryAxis = a.categoryAxis;
  4760. u.periodSpan = m.periodSpan;
  4761. u.valueField = m.valueField;
  4762. u.openField = m.openField;
  4763. u.closeField = m.closeField;
  4764. u.highField = m.highField;
  4765. u.lowField = m.lowField;
  4766. u.lineAlpha = a.graphLineAlpha;
  4767. u.lineColorR = a.graphLineColor;
  4768. u.fillAlphas = a.graphFillAlpha;
  4769. u.fillColorsR = a.graphFillColor;
  4770. u.connect = m.connect;
  4771. u.hidden = m.hidden;
  4772. u.width = k;
  4773. u.height = l;
  4774. u.pointPosition = m.pointPosition;
  4775. u.stepDirection = m.stepDirection;
  4776. u.periodSpan = m.periodSpan;
  4777. p = a.selectedGraph;
  4778. p.id = m.id;
  4779. p.bcn = u.bcn +
  4780. "selected-";
  4781. p.rotate = h;
  4782. p.chart = b;
  4783. p.data = c;
  4784. p.valueAxis = q;
  4785. p.chart = m.chart;
  4786. p.categoryAxis = e;
  4787. p.periodSpan = m.periodSpan;
  4788. p.valueField = m.valueField;
  4789. p.openField = m.openField;
  4790. p.closeField = m.closeField;
  4791. p.highField = m.highField;
  4792. p.lowField = m.lowField;
  4793. p.lineAlpha = a.selectedGraphLineAlpha;
  4794. p.lineColorR = a.selectedGraphLineColor;
  4795. p.fillAlphas = a.selectedGraphFillAlpha;
  4796. p.fillColorsR = a.selectedGraphFillColor;
  4797. p.connect = m.connect;
  4798. p.hidden = m.hidden;
  4799. p.width = k;
  4800. p.height = l;
  4801. p.pointPosition = m.pointPosition;
  4802. p.stepDirection = m.stepDirection;
  4803. p.periodSpan = m.periodSpan;
  4804. b = a.graphType;
  4805. b || (b = m.type);
  4806. u.type = b;
  4807. p.type = b;
  4808. c = c.length - 1;
  4809. u.zoom(0, c);
  4810. p.zoom(0, c);
  4811. p.set.click(function () {
  4812. a.handleBackgroundClick()
  4813. }).mouseover(function () {
  4814. a.handleMouseOver()
  4815. }).mouseout(function () {
  4816. a.handleMouseOut()
  4817. });
  4818. u.set.click(function () {
  4819. a.handleBackgroundClick()
  4820. }).mouseover(function () {
  4821. a.handleMouseOver()
  4822. }).mouseout(function () {
  4823. a.handleMouseOut()
  4824. });
  4825. n.push(u.set);
  4826. n.push(p.set)
  4827. }
  4828. n.push(e.set);
  4829. n.push(e.labelsSet);
  4830. a.bg.toBack();
  4831. a.invisibleBg.toFront();
  4832. a.dragger.toFront();
  4833. a.iconLeft.toFront();
  4834. a.iconRight.toFront()
  4835. }
  4836. },
  4837. timeZoom: function (a, b, c) {
  4838. this.startTime = a;
  4839. this.endTime = b;
  4840. this.timeDifference = b - a;
  4841. this.skipEvent = !d.toBoolean(c);
  4842. this.zoomScrollbar();
  4843. this.skipEvent || this.dispatchScrollbarEvent()
  4844. },
  4845. zoom: function (a, b) {
  4846. this.start = a;
  4847. this.end = b;
  4848. this.skipEvent = !0;
  4849. this.zoomScrollbar()
  4850. },
  4851. dispatchScrollbarEvent: function () {
  4852. if (this.skipEvent) this.skipEvent = !1;
  4853. else {
  4854. var a = this.chart.chartData,
  4855. b, c, e = this.dragger.getBBox();
  4856. b = e.x;
  4857. var d = e.y,
  4858. f = e.width,
  4859. e = e.height,
  4860. g = this.chart;
  4861. this.rotate ? (b = d, c = e) : c = f;
  4862. f = {
  4863. type: "zoomed",
  4864. target: this
  4865. };
  4866. f.chart = g;
  4867. var k = this.categoryAxis,
  4868. l = this.stepWidth,
  4869. d = g.minSelectedTime,
  4870. e = !1;
  4871. if (k.parseDates && !k.equalSpacing) {
  4872. if (a = 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 < d && b - k < d && (b = Math.round(k + (b - k) / 2), e = Math.round(d / 2), k = b - e, b += e, e = !0), b > a && (b = a), b - d < k && (k = b - d), k < g && (k = g), k + d > b && (b = k + d), 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.type,
  4873. f)
  4874. } else if (k.startOnAxis || (b += l / 2), c -= this.stepWidth / 2, d = k.xToIndex(b), b = k.xToIndex(b + c), d != this.start || this.end != b) k.startOnAxis && (this.resizingRight && d == b && b++, this.resizingLeft && d == b && (0 < d ? d-- : b = 1)), this.start = d, 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.type, f);
  4875. e && this.zoomScrollbar()
  4876. }
  4877. },
  4878. zoomScrollbar: function () {
  4879. var a,
  4880. b;
  4881. a = this.chart;
  4882. var c = a.chartData,
  4883. e = this.categoryAxis;
  4884. e.parseDates && !e.equalSpacing ? (c = e.stepWidth, e = a.firstTime, a = c * (this.startTime - e), b = c * (this.endTime - e)) : (a = c[this.start].x[e.id], b = c[this.end].x[e.id], c = e.stepWidth, e.startOnAxis || (e = c / 2, a -= e, b += e));
  4885. this.stepWidth = c;
  4886. this.updateScrollbarSize(a, b)
  4887. },
  4888. maskGraphs: function (a, b, c, e) {
  4889. var d = this.selectedGraph;
  4890. d && d.set.clipRect(a, b, c, e)
  4891. },
  4892. handleDragStart: function () {
  4893. d.ChartScrollbar.base.handleDragStart.call(this);
  4894. this.difference = this.end - this.start;
  4895. this.timeDifference =
  4896. this.endTime - this.startTime;
  4897. 0 > this.timeDifference && (this.timeDifference = 0)
  4898. },
  4899. handleBackgroundClick: function () {
  4900. d.ChartScrollbar.base.handleBackgroundClick.call(this);
  4901. this.dragging || (this.difference = this.end - this.start, this.timeDifference = this.endTime - this.startTime, 0 > this.timeDifference && (this.timeDifference = 0))
  4902. }
  4903. })
  4904. })();
  4905. (function () {
  4906. var d = window.AmCharts;
  4907. d.AmBalloon = d.Class({
  4908. construct: function (a) {
  4909. this.cname = "AmBalloon";
  4910. this.enabled = !0;
  4911. this.fillColor = "#FFFFFF";
  4912. this.fillAlpha = .8;
  4913. this.borderThickness = 2;
  4914. this.borderColor = "#FFFFFF";
  4915. this.borderAlpha = 1;
  4916. this.cornerRadius = 0;
  4917. this.maxWidth = 220;
  4918. this.horizontalPadding = 8;
  4919. this.verticalPadding = 4;
  4920. this.pointerWidth = 6;
  4921. this.pointerOrientation = "V";
  4922. this.color = "#000000";
  4923. this.adjustBorderColor = !0;
  4924. this.show = this.follow = this.showBullet = !1;
  4925. this.bulletSize = 3;
  4926. this.shadowAlpha = .4;
  4927. this.shadowColor =
  4928. "#000000";
  4929. this.fadeOutDuration = this.animationDuration = .3;
  4930. this.fixedPosition = !1;
  4931. this.offsetY = 6;
  4932. this.offsetX = 1;
  4933. this.textAlign = "center";
  4934. this.deltaSignX = this.deltaSignY = 1;
  4935. d.isModern || (this.offsetY *= 1.5);
  4936. d.applyTheme(this, a, this.cname)
  4937. },
  4938. draw: function () {
  4939. var a = this.pointToX,
  4940. b = this.pointToY,
  4941. c = this.chart;
  4942. d.VML && (this.fadeOutDuration = 0);
  4943. this.xAnim && c.stopAnim(this.xAnim);
  4944. this.yAnim && c.stopAnim(this.yAnim);
  4945. if (!isNaN(a)) {
  4946. var e = this.follow,
  4947. h = c.container,
  4948. f = this.set;
  4949. d.remove(f);
  4950. this.removeDiv();
  4951. f = h.set();
  4952. f.node.style.pointerEvents =
  4953. "none";
  4954. this.set = f;
  4955. c.balloonsSet.push(f);
  4956. if (this.show) {
  4957. var g = this.l,
  4958. k = this.t,
  4959. l = this.r,
  4960. m = this.b,
  4961. n = this.balloonColor,
  4962. q = this.fillColor,
  4963. p = this.borderColor,
  4964. r = q;
  4965. void 0 != n && (this.adjustBorderColor ? r = p = n : q = n);
  4966. var t = this.horizontalPadding,
  4967. u = this.verticalPadding,
  4968. z = this.pointerWidth,
  4969. w = this.pointerOrientation,
  4970. x = this.cornerRadius,
  4971. v = c.fontFamily,
  4972. A = this.fontSize;
  4973. void 0 == A && (A = c.fontSize);
  4974. var n = document.createElement("div"),
  4975. B = c.classNamePrefix;
  4976. n.className = B + "-balloon-div";
  4977. this.className && (n.className = n.className +
  4978. " " + B + "-balloon-div-" + this.className);
  4979. B = n.style;
  4980. B.pointerEvents = "none";
  4981. B.position = "absolute";
  4982. var D = this.minWidth,
  4983. C = "";
  4984. isNaN(D) || (C = "min-width:" + (D - 2 * t) + "px; ");
  4985. n.innerHTML = "<div style='text-align:" + this.textAlign + "; " + C + "max-width:" + this.maxWidth + "px; font-size:" + A + "px; color:" + this.color + "; font-family:" + v + "'>" + this.text + "</div>";
  4986. c.chartDiv.appendChild(n);
  4987. this.textDiv = n;
  4988. A = n.offsetWidth;
  4989. v = n.offsetHeight;
  4990. n.clientHeight && (A = n.clientWidth, v = n.clientHeight);
  4991. v += 2 * u;
  4992. C = A + 2 * t;
  4993. !isNaN(D) && C < D && (C = D);
  4994. window.opera &&
  4995. (v += 2);
  4996. var I = !1,
  4997. A = this.offsetY;
  4998. c.handDrawn && (A += c.handDrawScatter + 2);
  4999. "H" != w ? (D = a - C / 2, b < k + v + 10 && "down" != w ? (I = !0, e && (b += A), A = b + z, this.deltaSignY = -1) : (e && (b -= A), A = b - v - z, this.deltaSignY = 1)) : (2 * z > v && (z = v / 2), A = b - v / 2, a < g + (l - g) / 2 ? (D = a + z, this.deltaSignX = -1) : (D = a - C - z, this.deltaSignX = 1));
  5000. A + v >= m && (A = m - v);
  5001. A < k && (A = k);
  5002. D < g && (D = g);
  5003. D + C > l && (D = l - C);
  5004. var k = A + u,
  5005. m = D + t,
  5006. u = this.shadowAlpha,
  5007. H = this.shadowColor,
  5008. t = this.borderThickness,
  5009. O = this.bulletSize,
  5010. J;
  5011. 0 < x || 0 === z ? (0 < u && (a = d.rect(h, C, v, q, 0, t + 1, H, u, this.cornerRadius), d.isModern ?
  5012. a.translate(1, 1) : a.translate(4, 4), f.push(a)), q = d.rect(h, C, v, q, this.fillAlpha, t, p, this.borderAlpha, this.cornerRadius), this.showBullet && (J = d.circle(h, O, r, this.fillAlpha), f.push(J))) : (r = [], x = [], "H" != w ? (g = a - D, g > C - z && (g = C - z), g < z && (g = z), r = [0, g - z, a - D, g + z, C, C, 0, 0], x = I ? [0, 0, b - A, 0, 0, v, v, 0] : [v, v, b - A, v, v, 0, 0, v]) : (r = b - A, r > v - z && (r = v - z), r < z && (r = z), x = [0, r - z, b - A, r + z, v, v, 0, 0], r = a < g + (l - g) / 2 ? [0, 0, D < a ? 0 : a - D, 0, 0, C, C, 0] : [C, C, D + C > a ? C : a - D, C, C, 0, 0, C]), 0 < u && (a = d.polygon(h, r, x, q, 0, t, H, u), a.translate(1, 1), f.push(a)), q = d.polygon(h,
  5013. r, x, q, this.fillAlpha, t, p, this.borderAlpha));
  5014. this.bg = q;
  5015. f.push(q);
  5016. q.toFront();
  5017. d.setCN(c, q, "balloon-bg");
  5018. this.className && d.setCN(c, q, "balloon-bg-" + this.className);
  5019. h = 1 * this.deltaSignX;
  5020. B.left = m + "px";
  5021. B.top = k + "px";
  5022. f.translate(D - h, A);
  5023. q = q.getBBox();
  5024. this.bottom = A + v + 1;
  5025. this.yPos = q.y + A;
  5026. J && J.translate(this.pointToX - D + h, b - A);
  5027. b = this.animationDuration;
  5028. 0 < this.animationDuration && !e && !isNaN(this.prevX) && (f.translate(this.prevX, this.prevY), f.animate({
  5029. translate: D - h + "," + A
  5030. }, b, "easeOutSine"), n && (B.left = this.prevTX + "px", B.top =
  5031. this.prevTY + "px", this.xAnim = c.animate({
  5032. node: n
  5033. }, "left", this.prevTX, m, b, "easeOutSine", "px"), this.yAnim = c.animate({
  5034. node: n
  5035. }, "top", this.prevTY, k, b, "easeOutSine", "px")));
  5036. this.prevX = D - h;
  5037. this.prevY = A;
  5038. this.prevTX = m;
  5039. this.prevTY = k
  5040. }
  5041. }
  5042. },
  5043. followMouse: function () {
  5044. if (this.follow && this.show) {
  5045. var a = this.chart.mouseX - this.offsetX * this.deltaSignX,
  5046. b = this.chart.mouseY;
  5047. this.pointToX = a;
  5048. this.pointToY = b;
  5049. if (a != this.previousX || b != this.previousY)
  5050. if (this.previousX = a, this.previousY = b, 0 === this.cornerRadius) this.draw();
  5051. else {
  5052. var c = this.set;
  5053. if (c) {
  5054. var e = c.getBBox(),
  5055. a = a - e.width / 2,
  5056. d = b - e.height - 10;
  5057. a < this.l && (a = this.l);
  5058. a > this.r - e.width && (a = this.r - e.width);
  5059. d < this.t && (d = b + 10);
  5060. c.translate(a, d);
  5061. b = this.textDiv.style;
  5062. b.left = a + this.horizontalPadding + "px";
  5063. b.top = d + this.verticalPadding + "px"
  5064. }
  5065. }
  5066. }
  5067. },
  5068. changeColor: function (a) {
  5069. this.balloonColor = a
  5070. },
  5071. setBounds: function (a, b, c, e) {
  5072. this.l = a;
  5073. this.t = b;
  5074. this.r = c;
  5075. this.b = e;
  5076. this.destroyTO && clearTimeout(this.destroyTO)
  5077. },
  5078. showBalloon: function (a) {
  5079. this.text = a;
  5080. this.show = !0;
  5081. this.destroyTO && clearTimeout(this.destroyTO);
  5082. a = this.chart;
  5083. this.fadeAnim1 && a.stopAnim(this.fadeAnim1);
  5084. this.fadeAnim2 && a.stopAnim(this.fadeAnim2);
  5085. this.draw()
  5086. },
  5087. hide: function () {
  5088. var a = this,
  5089. b = a.fadeOutDuration,
  5090. c = a.chart;
  5091. if (0 < b) {
  5092. a.destroyTO && clearTimeout(a.destroyTO);
  5093. a.destroyTO = setTimeout(function () {
  5094. a.destroy.call(a)
  5095. }, 1E3 * b);
  5096. a.follow = !1;
  5097. a.show = !1;
  5098. var e = a.set;
  5099. e && (e.setAttr("opacity", a.fillAlpha), a.fadeAnim1 = e.animate({
  5100. opacity: 0
  5101. }, b, "easeInSine"));
  5102. a.textDiv && (a.fadeAnim2 = c.animate({
  5103. node: a.textDiv
  5104. }, "opacity", 1, 0, b, "easeInSine", ""))
  5105. } else a.show = !1, a.follow = !1, a.destroy()
  5106. },
  5107. setPosition: function (a, b, c) {
  5108. this.pointToX = a;
  5109. this.pointToY = b;
  5110. c && (a == this.previousX && b == this.previousY || this.draw());
  5111. this.previousX = a;
  5112. this.previousY = b
  5113. },
  5114. followCursor: function (a) {
  5115. var b = this;
  5116. (b.follow = a) ? (b.pShowBullet = b.showBullet, b.showBullet = !1) : void 0 !== b.pShowBullet && (b.showBullet = b.pShowBullet);
  5117. clearInterval(b.interval);
  5118. var c = b.chart.mouseX,
  5119. e = b.chart.mouseY;
  5120. !isNaN(c) && a && (b.pointToX = c - b.offsetX * b.deltaSignX, b.pointToY = e, b.followMouse(), b.interval = setInterval(function () {
  5121. b.followMouse.call(b)
  5122. }, 40))
  5123. },
  5124. removeDiv: function () {
  5125. if (this.textDiv) {
  5126. var a = this.textDiv.parentNode;
  5127. a && a.removeChild(this.textDiv)
  5128. }
  5129. },
  5130. destroy: function () {
  5131. clearInterval(this.interval);
  5132. d.remove(this.set);
  5133. this.removeDiv();
  5134. this.set = null
  5135. }
  5136. })
  5137. })();
  5138. (function () {
  5139. var d = window.AmCharts;
  5140. d.AmCoordinateChart = d.Class({
  5141. inherits: d.AmChart,
  5142. construct: function (a) {
  5143. d.AmCoordinateChart.base.construct.call(this, a);
  5144. this.theme = a;
  5145. this.createEvents("rollOverGraphItem", "rollOutGraphItem", "clickGraphItem", "doubleClickGraphItem", "rightClickGraphItem", "clickGraph", "rollOverGraph", "rollOutGraph");
  5146. this.startAlpha = 1;
  5147. this.startDuration = 0;
  5148. this.startEffect = "elastic";
  5149. this.sequencedAnimation = !0;
  5150. this.colors = "#FF6600 #FCD202 #B0DE09 #0D8ECF #2A0CD0 #CD0D74 #CC0000 #00CC00 #0000CC #DDDDDD #999999 #333333 #990000".split(" ");
  5151. this.balloonDateFormat = "MMM DD, YYYY";
  5152. this.valueAxes = [];
  5153. this.graphs = [];
  5154. this.guides = [];
  5155. this.gridAboveGraphs = !1;
  5156. d.applyTheme(this, a, "AmCoordinateChart")
  5157. },
  5158. initChart: function () {
  5159. d.AmCoordinateChart.base.initChart.call(this);
  5160. var a = this.categoryAxis;
  5161. a && (this.categoryAxis = d.processObject(a, d.CategoryAxis, this.theme));
  5162. this.processValueAxes();
  5163. this.createValueAxes();
  5164. this.processGraphs();
  5165. this.processGuides();
  5166. d.VML && (this.startAlpha = 1);
  5167. this.setLegendData(this.graphs);
  5168. this.gridAboveGraphs && this.gridSet.toFront()
  5169. },
  5170. createValueAxes: function () {
  5171. if (0 === this.valueAxes.length) {
  5172. var a = new d.ValueAxis;
  5173. this.addValueAxis(a)
  5174. }
  5175. },
  5176. parseData: function () {
  5177. this.processValueAxes();
  5178. this.processGraphs()
  5179. },
  5180. parseSerialData: function (a) {
  5181. var b = this.graphs,
  5182. c, e = {},
  5183. h = this.seriesIdField;
  5184. h || (h = this.categoryField);
  5185. this.chartData = [];
  5186. if (a) {
  5187. var f = !1,
  5188. g, k = this.categoryAxis,
  5189. l, m, n;
  5190. k && (f = k.parseDates, l = k.forceShowField, n = k.classNameField, m = k.labelColorField, g = k.categoryFunction);
  5191. var q, p, r = {},
  5192. t;
  5193. f && (c = d.extractPeriod(k.minPeriod), q = c.period, p = c.count, t =
  5194. d.getPeriodDuration(q, p));
  5195. var u = {};
  5196. this.lookupTable = u;
  5197. var z, w = this.dataDateFormat,
  5198. x = {};
  5199. for (z = 0; z < a.length; z++) {
  5200. var v = {},
  5201. A = a[z];
  5202. c = A[this.categoryField];
  5203. v.dataContext = A;
  5204. v.category = g ? g(c, A, k) : String(c);
  5205. l && (v.forceShow = A[l]);
  5206. n && (v.className = A[n]);
  5207. m && (v.labelColor = A[m]);
  5208. u[A[h]] = v;
  5209. if (f && (k.categoryFunction ? c = k.categoryFunction(c, A, k) : (!w || c instanceof Date || (c = c.toString() + " |"), c = d.getDate(c, w, k.minPeriod)), c = d.resetDateToMin(c, q, p, k.firstDayOfWeek), v.category = c, v.time = c.getTime(), isNaN(v.time))) continue;
  5210. var B = this.valueAxes;
  5211. v.axes = {};
  5212. v.x = {};
  5213. var D;
  5214. for (D = 0; D < B.length; D++) {
  5215. var C = B[D].id;
  5216. v.axes[C] = {};
  5217. v.axes[C].graphs = {};
  5218. var I;
  5219. for (I = 0; I < b.length; I++) {
  5220. c = b[I];
  5221. var H = c.id,
  5222. O = 1.1;
  5223. isNaN(c.gapPeriod) || (O = c.gapPeriod);
  5224. var J = c.periodValue;
  5225. if (c.valueAxis.id == C) {
  5226. v.axes[C].graphs[H] = {};
  5227. var da = {};
  5228. da.index = z;
  5229. var pa = A;
  5230. c.dataProvider && (pa = e);
  5231. da.values = this.processValues(pa, c, J);
  5232. !c.connect && x && x[H] && v.time - r[H] >= t * O && (x[H].gap = !0);
  5233. this.processFields(c, da, pa);
  5234. da.category = v.category;
  5235. da.serialDataItem = v;
  5236. da.graph = c;
  5237. v.axes[C].graphs[H] =
  5238. da;
  5239. r[H] = v.time;
  5240. x[H] = da
  5241. }
  5242. }
  5243. }
  5244. this.chartData[z] = v
  5245. }
  5246. }
  5247. for (a = 0; a < b.length; a++) c = b[a], c.dataProvider && this.parseGraphData(c)
  5248. },
  5249. processValues: function (a, b, c) {
  5250. var e = {},
  5251. h, f = !1;
  5252. "candlestick" != b.type && "ohlc" != b.type || "" === c || (f = !0);
  5253. for (var g = "value error open close low high".split(" "), k = 0; k < g.length; k++) {
  5254. var l = g[k];
  5255. "value" != l && "error" != l && f && (c = l.charAt(0).toUpperCase() + l.slice(1));
  5256. var m = a[b[l + "Field"] + c];
  5257. h = Number(m);
  5258. isNaN(h) || (e[l] = h);
  5259. "date" == b.valueAxis.type && void 0 !== m && (h = d.getDate(m, b.chart.dataDateFormat),
  5260. e[l] = h.getTime())
  5261. }
  5262. return e
  5263. },
  5264. parseGraphData: function (a) {
  5265. var b = a.dataProvider,
  5266. c = a.seriesIdField;
  5267. c || (c = this.seriesIdField);
  5268. c || (c = this.categoryField);
  5269. var e;
  5270. for (e = 0; e < b.length; e++) {
  5271. var d = b[e],
  5272. f = this.lookupTable[String(d[c])],
  5273. g = a.valueAxis.id;
  5274. f && (g = f.axes[g].graphs[a.id], g.serialDataItem = f, g.values = this.processValues(d, a, a.periodValue), this.processFields(a, g, d))
  5275. }
  5276. },
  5277. addValueAxis: function (a) {
  5278. a.chart = this;
  5279. this.valueAxes.push(a);
  5280. this.validateData()
  5281. },
  5282. removeValueAxesAndGraphs: function () {
  5283. var a = this.valueAxes,
  5284. b;
  5285. for (b = a.length - 1; - 1 < b; b--) this.removeValueAxis(a[b])
  5286. },
  5287. removeValueAxis: function (a) {
  5288. var b = this.graphs,
  5289. c;
  5290. for (c = b.length - 1; 0 <= c; c--) {
  5291. var e = b[c];
  5292. e && e.valueAxis == a && this.removeGraph(e)
  5293. }
  5294. b = this.valueAxes;
  5295. for (c = b.length - 1; 0 <= c; c--) b[c] == a && b.splice(c, 1);
  5296. this.validateData()
  5297. },
  5298. addGraph: function (a) {
  5299. this.graphs.push(a);
  5300. this.chooseGraphColor(a, this.graphs.length - 1);
  5301. this.validateData()
  5302. },
  5303. removeGraph: function (a) {
  5304. var b = this.graphs,
  5305. c;
  5306. for (c = b.length - 1; 0 <= c; c--) b[c] == a && (b.splice(c, 1), a.destroy());
  5307. this.validateData()
  5308. },
  5309. processValueAxes: function () {
  5310. var a = this.valueAxes,
  5311. b;
  5312. for (b = 0; b < a.length; b++) {
  5313. var c = a[b],
  5314. c = d.processObject(c, d.ValueAxis, this.theme);
  5315. a[b] = c;
  5316. c.chart = this;
  5317. c.id || (c.id = "valueAxisAuto" + b + "_" + (new Date).getTime());
  5318. void 0 === c.usePrefixes && (c.usePrefixes = this.usePrefixes)
  5319. }
  5320. },
  5321. processGuides: function () {
  5322. var a = this.guides,
  5323. b = this.categoryAxis;
  5324. if (a)
  5325. for (var c = 0; c < a.length; c++) {
  5326. var e = a[c];
  5327. (void 0 !== e.category || void 0 !== e.date) && b && b.addGuide(e);
  5328. e.id || (e.id = "guideAuto" + c + "_" + (new Date).getTime());
  5329. var h = e.valueAxis;
  5330. h ?
  5331. (d.isString(h) && (h = this.getValueAxisById(h)), h ? h.addGuide(e) : this.valueAxes[0].addGuide(e)) : isNaN(e.value) || this.valueAxes[0].addGuide(e)
  5332. }
  5333. },
  5334. processGraphs: function () {
  5335. var a = this.graphs,
  5336. b;
  5337. for (b = 0; b < a.length; b++) {
  5338. var c = a[b],
  5339. c = d.processObject(c, d.AmGraph, this.theme);
  5340. a[b] = c;
  5341. this.chooseGraphColor(c, b);
  5342. c.chart = this;
  5343. d.isString(c.valueAxis) && (c.valueAxis = this.getValueAxisById(c.valueAxis));
  5344. c.valueAxis || (c.valueAxis = this.valueAxes[0]);
  5345. c.id || (c.id = "graphAuto" + b + "_" + (new Date).getTime())
  5346. }
  5347. },
  5348. formatString: function (a,
  5349. b, c) {
  5350. var e = b.graph,
  5351. h = e.valueAxis;
  5352. 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));
  5353. a = d.massReplace(a, {
  5354. "[[title]]": e.title,
  5355. "[[description]]": b.description
  5356. });
  5357. a = c ? d.fixNewLines(a) : d.fixBrakes(a);
  5358. return a = d.cleanFromEmpty(a)
  5359. },
  5360. getBalloonColor: function (a, b, c) {
  5361. var e = a.lineColor,
  5362. d = a.balloonColor;
  5363. c && (d = e);
  5364. c = a.fillColorsR;
  5365. "object" == typeof c ? e = c[0] : void 0 !== c && (e = c);
  5366. b.isNegative && (c = a.negativeLineColor,
  5367. a = a.negativeFillColors, "object" == typeof a ? c = a[0] : void 0 !== a && (c = a), void 0 !== c && (e = c));
  5368. void 0 !== b.color && (e = b.color);
  5369. void 0 === d && (d = e);
  5370. return d
  5371. },
  5372. getGraphById: function (a) {
  5373. return d.getObjById(this.graphs, a)
  5374. },
  5375. getValueAxisById: function (a) {
  5376. return d.getObjById(this.valueAxes, a)
  5377. },
  5378. processFields: function (a, b, c) {
  5379. if (a.itemColors) {
  5380. var e = a.itemColors,
  5381. h = b.index;
  5382. b.color = h < e.length ? e[h] : d.randomColor()
  5383. }
  5384. e = "lineColor color alpha fillColors description bullet customBullet bulletSize bulletConfig url labelColor dashLength pattern gap className".split(" ");
  5385. for (h = 0; h < e.length; h++) {
  5386. var f = e[h],
  5387. g = a[f + "Field"];
  5388. g && (g = c[g], d.isDefined(g) && (b[f] = g))
  5389. }
  5390. b.dataContext = c
  5391. },
  5392. chooseGraphColor: function (a, b) {
  5393. if (a.lineColor) a.lineColorR = a.lineColor;
  5394. else {
  5395. var c;
  5396. c = this.colors.length > b ? this.colors[b] : d.randomColor();
  5397. a.lineColorR = c
  5398. }
  5399. a.fillColorsR = a.fillColors ? a.fillColors : a.lineColorR;
  5400. a.bulletBorderColorR = a.bulletBorderColor ? a.bulletBorderColor : a.useLineColorForBulletBorder ? a.lineColorR : a.bulletColor;
  5401. a.bulletColorR = a.bulletColor ? a.bulletColor : a.lineColorR;
  5402. if (c = this.patterns) a.pattern =
  5403. c[b]
  5404. },
  5405. handleLegendEvent: function (a) {
  5406. var b = a.type;
  5407. a = a.dataItem;
  5408. if (!this.legend.data && a) {
  5409. var c = a.hidden,
  5410. e = a.showBalloon;
  5411. switch (b) {
  5412. case "clickMarker":
  5413. this.textClickEnabled && (e ? this.hideGraphsBalloon(a) : this.showGraphsBalloon(a));
  5414. break;
  5415. case "clickLabel":
  5416. e ? this.hideGraphsBalloon(a) : this.showGraphsBalloon(a);
  5417. break;
  5418. case "rollOverItem":
  5419. c || this.highlightGraph(a);
  5420. break;
  5421. case "rollOutItem":
  5422. c || this.unhighlightGraph();
  5423. break;
  5424. case "hideItem":
  5425. this.hideGraph(a);
  5426. break;
  5427. case "showItem":
  5428. this.showGraph(a)
  5429. }
  5430. }
  5431. },
  5432. highlightGraph: function (a) {
  5433. var b =
  5434. this.graphs,
  5435. c, e = .2;
  5436. this.legend && (e = this.legend.rollOverGraphAlpha);
  5437. if (1 != e)
  5438. for (c = 0; c < b.length; c++) {
  5439. var d = b[c];
  5440. d != a && d.changeOpacity(e)
  5441. }
  5442. },
  5443. unhighlightGraph: function () {
  5444. var a;
  5445. this.legend && (a = this.legend.rollOverGraphAlpha);
  5446. if (1 != a) {
  5447. a = this.graphs;
  5448. var b;
  5449. for (b = 0; b < a.length; b++) a[b].changeOpacity(1)
  5450. }
  5451. },
  5452. showGraph: function (a) {
  5453. a.switchable && (a.hidden = !1, this.dataChanged = !0, "xy" != this.type && (this.marginsUpdated = !1), this.chartCreated && this.initChart())
  5454. },
  5455. hideGraph: function (a) {
  5456. a.switchable && (this.dataChanged = !0,
  5457. "xy" != this.type && (this.marginsUpdated = !1), a.hidden = !0, this.chartCreated && this.initChart())
  5458. },
  5459. hideGraphsBalloon: function (a) {
  5460. a.showBalloon = !1;
  5461. this.updateLegend()
  5462. },
  5463. showGraphsBalloon: function (a) {
  5464. a.showBalloon = !0;
  5465. this.updateLegend()
  5466. },
  5467. updateLegend: function () {
  5468. this.legend && this.legend.invalidateSize()
  5469. },
  5470. resetAnimation: function () {
  5471. var a = this.graphs;
  5472. if (a) {
  5473. var b;
  5474. for (b = 0; b < a.length; b++) a[b].animationPlayed = !1
  5475. }
  5476. },
  5477. animateAgain: function () {
  5478. this.resetAnimation();
  5479. this.validateNow()
  5480. }
  5481. })
  5482. })();
  5483. (function () {
  5484. var d = window.AmCharts;
  5485. d.AmSlicedChart = d.Class({
  5486. inherits: d.AmChart,
  5487. construct: function (a) {
  5488. this.createEvents("rollOverSlice", "rollOutSlice", "clickSlice", "pullOutSlice", "pullInSlice", "rightClickSlice");
  5489. d.AmSlicedChart.base.construct.call(this, a);
  5490. this.colors = "#FF0F00 #FF6600 #FF9E01 #FCD202 #F8FF01 #B0DE09 #04D215 #0D8ECF #0D52D1 #2A0CD0 #8A0CCF #CD0D74 #754DEB #DDDDDD #999999 #333333 #000000 #57032A #CA9726 #990000 #4B0C25".split(" ");
  5491. this.alpha = 1;
  5492. this.groupPercent = 0;
  5493. this.groupedTitle = "Other";
  5494. this.groupedPulled = !1;
  5495. this.groupedAlpha = 1;
  5496. this.marginLeft = 0;
  5497. this.marginBottom = this.marginTop = 10;
  5498. this.marginRight = 0;
  5499. this.hoverAlpha = 1;
  5500. this.outlineColor = "#FFFFFF";
  5501. this.outlineAlpha = 0;
  5502. this.outlineThickness = 1;
  5503. this.startAlpha = 0;
  5504. this.startDuration = 1;
  5505. this.startEffect = "bounce";
  5506. this.sequencedAnimation = !0;
  5507. this.pullOutDuration = 1;
  5508. this.pullOutEffect = "bounce";
  5509. this.pullOnHover = this.pullOutOnlyOne = !1;
  5510. this.labelsEnabled = !0;
  5511. this.labelTickColor = "#000000";
  5512. this.labelTickAlpha = .2;
  5513. this.hideLabelsPercent = 0;
  5514. this.urlTarget =
  5515. "_self";
  5516. this.autoMarginOffset = 10;
  5517. this.gradientRatio = [];
  5518. this.maxLabelWidth = 200;
  5519. d.applyTheme(this, a, "AmSlicedChart")
  5520. },
  5521. initChart: function () {
  5522. d.AmSlicedChart.base.initChart.call(this);
  5523. this.dataChanged && (this.parseData(), this.dispatchDataUpdated = !0, this.dataChanged = !1, this.setLegendData(this.chartData));
  5524. this.drawChart()
  5525. },
  5526. handleLegendEvent: function (a) {
  5527. var b = a.type,
  5528. c = a.dataItem,
  5529. e = this.legend;
  5530. if (!e.data && c) {
  5531. var d = c.hidden;
  5532. a = a.event;
  5533. switch (b) {
  5534. case "clickMarker":
  5535. d || e.switchable || this.clickSlice(c, a);
  5536. break;
  5537. case "clickLabel":
  5538. d ||
  5539. this.clickSlice(c, a, !1);
  5540. break;
  5541. case "rollOverItem":
  5542. d || this.rollOverSlice(c, !1, a);
  5543. break;
  5544. case "rollOutItem":
  5545. d || this.rollOutSlice(c, a);
  5546. break;
  5547. case "hideItem":
  5548. this.hideSlice(c, a);
  5549. break;
  5550. case "showItem":
  5551. this.showSlice(c, a)
  5552. }
  5553. }
  5554. },
  5555. invalidateVisibility: function () {
  5556. this.recalculatePercents();
  5557. this.initChart();
  5558. var a = this.legend;
  5559. a && a.invalidateSize()
  5560. },
  5561. addEventListeners: function (a, b) {
  5562. var c = this;
  5563. a.mouseover(function (a) {
  5564. c.rollOverSlice(b, !0, a)
  5565. }).mouseout(function (a) {
  5566. c.rollOutSlice(b, a)
  5567. }).touchend(function (a) {
  5568. c.rollOverSlice(b,
  5569. a);
  5570. c.panEventsEnabled && c.clickSlice(b, a)
  5571. }).touchstart(function (a) {
  5572. c.rollOverSlice(b, a)
  5573. }).click(function (a) {
  5574. c.clickSlice(b, a)
  5575. }).contextmenu(function (a) {
  5576. c.handleRightClick(b, a)
  5577. })
  5578. },
  5579. formatString: function (a, b, c) {
  5580. a = d.formatValue(a, b, ["value"], this.nf, "", this.usePrefixes, this.prefixesOfSmallNumbers, this.prefixesOfBigNumbers);
  5581. var e = this.pf.precision;
  5582. isNaN(this.tempPrec) || (this.pf.precision = this.tempPrec);
  5583. a = d.formatValue(a, b, ["percents"], this.pf);
  5584. a = d.massReplace(a, {
  5585. "[[title]]": b.title,
  5586. "[[description]]": b.description
  5587. });
  5588. this.pf.precision = e; - 1 != a.indexOf("[[") && (a = d.formatDataContextValue(a, b.dataContext));
  5589. a = c ? d.fixNewLines(a) : d.fixBrakes(a);
  5590. return a = d.cleanFromEmpty(a)
  5591. },
  5592. startSlices: function () {
  5593. var a;
  5594. for (a = 0; a < this.chartData.length; a++) 0 < this.startDuration && this.sequencedAnimation ? this.setStartTO(a) : this.startSlice(this.chartData[a])
  5595. },
  5596. setStartTO: function (a) {
  5597. var b = this;
  5598. a = setTimeout(function () {
  5599. b.startSequenced.call(b)
  5600. }, b.startDuration / b.chartData.length * 500 * a);
  5601. b.timeOuts.push(a)
  5602. },
  5603. pullSlices: function (a) {
  5604. var b = this.chartData,
  5605. c;
  5606. for (c = 0; c < b.length; c++) {
  5607. var e = b[c];
  5608. e.pulled && this.pullSlice(e, 1, a)
  5609. }
  5610. },
  5611. startSequenced: function () {
  5612. var a = this.chartData,
  5613. b;
  5614. for (b = 0; b < a.length; b++)
  5615. if (!a[b].started) {
  5616. this.startSlice(this.chartData[b]);
  5617. break
  5618. }
  5619. },
  5620. startSlice: function (a) {
  5621. a.started = !0;
  5622. var b = a.wedge,
  5623. c = this.startDuration;
  5624. b && 0 < c && (0 < a.alpha && b.show(), b.translate(a.startX, a.startY), b.animate({
  5625. opacity: 1,
  5626. translate: "0,0"
  5627. }, c, this.startEffect))
  5628. },
  5629. showLabels: function () {
  5630. var a = this.chartData,
  5631. b;
  5632. for (b = 0; b < a.length; b++) {
  5633. var c = a[b];
  5634. if (0 < c.alpha) {
  5635. var e = c.label;
  5636. e && e.show();
  5637. (c = c.tick) && c.show()
  5638. }
  5639. }
  5640. },
  5641. showSlice: function (a) {
  5642. isNaN(a) ? a.hidden = !1 : this.chartData[a].hidden = !1;
  5643. this.invalidateVisibility()
  5644. },
  5645. hideSlice: function (a) {
  5646. isNaN(a) ? a.hidden = !0 : this.chartData[a].hidden = !0;
  5647. this.hideBalloon();
  5648. this.invalidateVisibility()
  5649. },
  5650. rollOverSlice: function (a, b, c) {
  5651. isNaN(a) || (a = this.chartData[a]);
  5652. clearTimeout(this.hoverInt);
  5653. if (!a.hidden) {
  5654. this.pullOnHover && this.pullSlice(a, 1);
  5655. 1 > this.hoverAlpha && a.wedge && a.wedge.attr({
  5656. opacity: this.hoverAlpha
  5657. });
  5658. var e = a.balloonX,
  5659. h = a.balloonY;
  5660. a.pulled &&
  5661. (e += a.pullX, h += a.pullY);
  5662. var f = this.formatString(this.balloonText, a, !0),
  5663. g = this.balloonFunction;
  5664. g && (f = g(a, f));
  5665. g = d.adjustLuminosity(a.color, -.15);
  5666. f ? this.showBalloon(f, g, b, e, h) : this.hideBalloon();
  5667. 0 === a.value && this.hideBalloon();
  5668. a = {
  5669. type: "rollOverSlice",
  5670. dataItem: a,
  5671. chart: this,
  5672. event: c
  5673. };
  5674. this.fire(a.type, a)
  5675. }
  5676. },
  5677. rollOutSlice: function (a, b) {
  5678. isNaN(a) || (a = this.chartData[a]);
  5679. a.wedge && a.wedge.attr({
  5680. opacity: 1
  5681. });
  5682. this.hideBalloon();
  5683. var c = {
  5684. type: "rollOutSlice",
  5685. dataItem: a,
  5686. chart: this,
  5687. event: b
  5688. };
  5689. this.fire(c.type, c)
  5690. },
  5691. clickSlice: function (a,
  5692. b, c) {
  5693. isNaN(a) || (a = this.chartData[a]);
  5694. a.pulled ? this.pullSlice(a, 0) : this.pullSlice(a, 1);
  5695. d.getURL(a.url, this.urlTarget);
  5696. c || (a = {
  5697. type: "clickSlice",
  5698. dataItem: a,
  5699. chart: this,
  5700. event: b
  5701. }, this.fire(a.type, a))
  5702. },
  5703. handleRightClick: function (a, b) {
  5704. isNaN(a) || (a = this.chartData[a]);
  5705. var c = {
  5706. type: "rightClickSlice",
  5707. dataItem: a,
  5708. chart: this,
  5709. event: b
  5710. };
  5711. this.fire(c.type, c)
  5712. },
  5713. drawTicks: function () {
  5714. var a = this.chartData,
  5715. b;
  5716. for (b = 0; b < a.length; b++) {
  5717. var c = a[b];
  5718. if (c.label) {
  5719. var e = c.ty,
  5720. e = d.line(this.container, [c.tx0, c.tx, c.tx2], [c.ty0, e, e], this.labelTickColor,
  5721. this.labelTickAlpha);
  5722. d.setCN(this, e, this.type + "-tick");
  5723. d.setCN(this, e, c.className, !0);
  5724. c.tick = e;
  5725. c.wedge.push(e)
  5726. }
  5727. }
  5728. },
  5729. initialStart: function () {
  5730. var a = this,
  5731. b = a.startDuration,
  5732. c = setTimeout(function () {
  5733. a.showLabels.call(a)
  5734. }, 1E3 * b);
  5735. a.timeOuts.push(c);
  5736. a.chartCreated ? a.pullSlices(!0) : (a.startSlices(), 0 < b ? (b = setTimeout(function () {
  5737. a.pullSlices.call(a)
  5738. }, 1200 * b), a.timeOuts.push(b)) : a.pullSlices(!0))
  5739. },
  5740. pullSlice: function (a, b, c) {
  5741. var e = this.pullOutDuration;
  5742. !0 === c && (e = 0);
  5743. (c = a.wedge) && (0 < e ? c.animate({
  5744. translate: b * a.pullX +
  5745. "," + b * a.pullY
  5746. }, e, this.pullOutEffect) : c.translate(b * a.pullX, b * a.pullY));
  5747. 1 == b ? (a.pulled = !0, this.pullOutOnlyOne && this.pullInAll(a.index), a = {
  5748. type: "pullOutSlice",
  5749. dataItem: a,
  5750. chart: this
  5751. }) : (a.pulled = !1, a = {
  5752. type: "pullInSlice",
  5753. dataItem: a,
  5754. chart: this
  5755. });
  5756. this.fire(a.type, a)
  5757. },
  5758. pullInAll: function (a) {
  5759. var b = this.chartData,
  5760. c;
  5761. for (c = 0; c < this.chartData.length; c++) c != a && b[c].pulled && this.pullSlice(b[c], 0)
  5762. },
  5763. pullOutAll: function () {
  5764. var a = this.chartData,
  5765. b;
  5766. for (b = 0; b < a.length; b++) a[b].pulled || this.pullSlice(a[b], 1)
  5767. },
  5768. parseData: function () {
  5769. var a = [];
  5770. this.chartData = a;
  5771. var b = this.dataProvider;
  5772. isNaN(this.pieAlpha) || (this.alpha = this.pieAlpha);
  5773. if (void 0 !== b) {
  5774. var c = b.length,
  5775. e = 0,
  5776. h, f, g;
  5777. for (h = 0; h < c; h++) {
  5778. f = {};
  5779. var k = b[h];
  5780. f.dataContext = k;
  5781. f.value = Number(k[this.valueField]);
  5782. (g = k[this.titleField]) || (g = "");
  5783. f.title = g;
  5784. f.pulled = d.toBoolean(k[this.pulledField], !1);
  5785. (g = k[this.descriptionField]) || (g = "");
  5786. f.description = g;
  5787. f.labelRadius = Number(k[this.labelRadiusField]);
  5788. f.switchable = !0;
  5789. f.className = k[this.classNameField];
  5790. f.url = k[this.urlField];
  5791. g = k[this.patternField];
  5792. !g &&
  5793. this.patterns && (g = this.patterns[h]);
  5794. f.pattern = g;
  5795. f.visibleInLegend = d.toBoolean(k[this.visibleInLegendField], !0);
  5796. g = k[this.alphaField];
  5797. f.alpha = void 0 !== g ? Number(g) : this.alpha;
  5798. g = k[this.colorField];
  5799. void 0 !== g && (f.color = g);
  5800. f.labelColor = d.toColor(k[this.labelColorField]);
  5801. e += f.value;
  5802. f.hidden = !1;
  5803. a[h] = f
  5804. }
  5805. for (h = b = 0; h < c; h++) f = a[h], f.percents = f.value / e * 100, f.percents < this.groupPercent && b++;
  5806. 1 < b && (this.groupValue = 0, this.removeSmallSlices(), a.push({
  5807. title: this.groupedTitle,
  5808. value: this.groupValue,
  5809. percents: this.groupValue /
  5810. e * 100,
  5811. pulled: this.groupedPulled,
  5812. color: this.groupedColor,
  5813. url: this.groupedUrl,
  5814. description: this.groupedDescription,
  5815. alpha: this.groupedAlpha,
  5816. pattern: this.groupedPattern,
  5817. className: this.groupedClassName,
  5818. dataContext: {}
  5819. }));
  5820. c = this.baseColor;
  5821. c || (c = this.pieBaseColor);
  5822. e = this.brightnessStep;
  5823. e || (e = this.pieBrightnessStep);
  5824. for (h = 0; h < a.length; h++) c ? g = d.adjustLuminosity(c, h * e / 100) : (g = this.colors[h], void 0 === g && (g = d.randomColor())), void 0 === a[h].color && (a[h].color = g);
  5825. this.recalculatePercents()
  5826. }
  5827. },
  5828. recalculatePercents: function () {
  5829. var a =
  5830. this.chartData,
  5831. b = 0,
  5832. c, e;
  5833. for (c = 0; c < a.length; c++) e = a[c], !e.hidden && 0 < e.value && (b += e.value);
  5834. for (c = 0; c < a.length; c++) e = this.chartData[c], e.percents = !e.hidden && 0 < e.value ? 100 * e.value / b : 0
  5835. },
  5836. removeSmallSlices: function () {
  5837. var a = this.chartData,
  5838. b;
  5839. for (b = a.length - 1; 0 <= b; b--) a[b].percents < this.groupPercent && (this.groupValue += a[b].value, a.splice(b, 1))
  5840. },
  5841. animateAgain: function () {
  5842. var a = this;
  5843. a.startSlices();
  5844. for (var b = 0; b < a.chartData.length; b++) {
  5845. var c = a.chartData[b];
  5846. c.started = !1;
  5847. var e = c.wedge;
  5848. e && e.translate(c.startX, c.startY)
  5849. }
  5850. b =
  5851. a.startDuration;
  5852. 0 < b ? (b = setTimeout(function () {
  5853. a.pullSlices.call(a)
  5854. }, 1200 * b), a.timeOuts.push(b)) : a.pullSlices()
  5855. },
  5856. measureMaxLabel: function () {
  5857. var a = this.chartData,
  5858. b = 0,
  5859. c;
  5860. for (c = 0; c < a.length; c++) {
  5861. var e = a[c],
  5862. h = this.formatString(this.labelText, e),
  5863. f = this.labelFunction;
  5864. f && (h = f(e, h));
  5865. e = d.text(this.container, h, this.color, this.fontFamily, this.fontSize);
  5866. h = e.getBBox().width;
  5867. h > b && (b = h);
  5868. e.remove()
  5869. }
  5870. return b
  5871. }
  5872. })
  5873. })();
  5874. (function () {
  5875. var d = window.AmCharts;
  5876. d.AmRectangularChart = d.Class({
  5877. inherits: d.AmCoordinateChart,
  5878. construct: function (a) {
  5879. d.AmRectangularChart.base.construct.call(this, a);
  5880. this.theme = a;
  5881. this.createEvents("zoomed");
  5882. this.marginRight = this.marginBottom = this.marginTop = this.marginLeft = 20;
  5883. this.verticalPosition = this.horizontalPosition = this.depth3D = this.angle = 0;
  5884. this.heightMultiplier = this.widthMultiplier = 1;
  5885. this.plotAreaFillColors = "#FFFFFF";
  5886. this.plotAreaFillAlphas = 0;
  5887. this.plotAreaBorderColor = "#000000";
  5888. this.plotAreaBorderAlpha =
  5889. 0;
  5890. this.zoomOutButtonImageSize = 19;
  5891. this.zoomOutButtonImage = "lens.png";
  5892. this.zoomOutText = "Show all";
  5893. this.zoomOutButtonColor = "#e5e5e5";
  5894. this.zoomOutButtonAlpha = 0;
  5895. this.zoomOutButtonRollOverAlpha = 1;
  5896. this.zoomOutButtonPadding = 8;
  5897. this.trendLines = [];
  5898. this.autoMargins = !0;
  5899. this.marginsUpdated = !1;
  5900. this.autoMarginOffset = 10;
  5901. d.applyTheme(this, a, "AmRectangularChart")
  5902. },
  5903. initChart: function () {
  5904. d.AmRectangularChart.base.initChart.call(this);
  5905. this.updateDxy();
  5906. var a = !0;
  5907. !this.marginsUpdated && this.autoMargins && (this.resetMargins(),
  5908. a = !1);
  5909. this.processScrollbars();
  5910. this.updateMargins();
  5911. this.updatePlotArea();
  5912. this.updateScrollbars();
  5913. this.updateTrendLines();
  5914. this.updateChartCursor();
  5915. this.updateValueAxes();
  5916. a && (this.scrollbarOnly || this.updateGraphs())
  5917. },
  5918. drawChart: function () {
  5919. d.AmRectangularChart.base.drawChart.call(this);
  5920. this.drawPlotArea();
  5921. if (d.ifArray(this.chartData)) {
  5922. var a = this.chartCursor;
  5923. a && a.draw()
  5924. }
  5925. },
  5926. resetMargins: function () {
  5927. var a = {},
  5928. b;
  5929. if ("xy" == this.type) {
  5930. var c = this.xAxes,
  5931. e = this.yAxes;
  5932. for (b = 0; b < c.length; b++) {
  5933. var d = c[b];
  5934. d.ignoreAxisWidth ||
  5935. (d.setOrientation(!0), d.fixAxisPosition(), a[d.position] = !0)
  5936. }
  5937. for (b = 0; b < e.length; b++) c = e[b], c.ignoreAxisWidth || (c.setOrientation(!1), c.fixAxisPosition(), a[c.position] = !0)
  5938. } else {
  5939. e = this.valueAxes;
  5940. for (b = 0; b < e.length; b++) c = e[b], c.ignoreAxisWidth || (c.setOrientation(this.rotate), c.fixAxisPosition(), a[c.position] = !0);
  5941. (b = this.categoryAxis) && !b.ignoreAxisWidth && (b.setOrientation(!this.rotate), b.fixAxisPosition(), b.fixAxisPosition(), a[b.position] = !0)
  5942. }
  5943. a.left && (this.marginLeft = 0);
  5944. a.right && (this.marginRight = 0);
  5945. a.top &&
  5946. (this.marginTop = 0);
  5947. a.bottom && (this.marginBottom = 0);
  5948. this.fixMargins = a
  5949. },
  5950. measureMargins: function () {
  5951. var a = this.valueAxes,
  5952. b, c = this.autoMarginOffset,
  5953. e = this.fixMargins,
  5954. d = this.realWidth,
  5955. f = this.realHeight,
  5956. g = c,
  5957. k = c,
  5958. l = d;
  5959. b = f;
  5960. var m;
  5961. for (m = 0; m < a.length; m++) b = this.getAxisBounds(a[m], g, l, k, b), g = Math.round(b.l), l = Math.round(b.r), k = Math.round(b.t), b = Math.round(b.b);
  5962. if (a = this.categoryAxis) b = this.getAxisBounds(a, g, l, k, b), g = Math.round(b.l), l = Math.round(b.r), k = Math.round(b.t), b = Math.round(b.b);
  5963. e.left && g < c && (this.marginLeft =
  5964. Math.round(-g + c));
  5965. e.right && l >= d - c && (this.marginRight = Math.round(l - d + c));
  5966. e.top && k < c + this.titleHeight && (this.marginTop = Math.round(this.marginTop - k + c + this.titleHeight));
  5967. e.bottom && b > f - c && (this.marginBottom = Math.round(this.marginBottom + b - f + c));
  5968. this.initChart()
  5969. },
  5970. getAxisBounds: function (a, b, c, e, d) {
  5971. if (!a.ignoreAxisWidth) {
  5972. var f = a.labelsSet,
  5973. g = a.tickLength;
  5974. a.inside && (g = 0);
  5975. if (f) switch (f = a.getBBox(), a.position) {
  5976. case "top":
  5977. a = f.y;
  5978. e > a && (e = a);
  5979. break;
  5980. case "bottom":
  5981. a = f.y + f.height;
  5982. d < a && (d = a);
  5983. break;
  5984. case "right":
  5985. a = f.x + f.width +
  5986. g + 3;
  5987. c < a && (c = a);
  5988. break;
  5989. case "left":
  5990. a = f.x - g, b > a && (b = a)
  5991. }
  5992. }
  5993. return {
  5994. l: b,
  5995. t: e,
  5996. r: c,
  5997. b: d
  5998. }
  5999. },
  6000. drawZoomOutButton: function () {
  6001. var a = this;
  6002. if (!a.zbSet) {
  6003. var b = a.container.set();
  6004. a.zoomButtonSet.push(b);
  6005. var c = a.color,
  6006. e = a.fontSize,
  6007. h = a.zoomOutButtonImageSize,
  6008. f = a.zoomOutButtonImage,
  6009. g = d.lang.zoomOutText || a.zoomOutText,
  6010. k = a.zoomOutButtonColor,
  6011. l = a.zoomOutButtonAlpha,
  6012. m = a.zoomOutButtonFontSize,
  6013. n = a.zoomOutButtonPadding;
  6014. isNaN(m) || (e = m);
  6015. (m = a.zoomOutButtonFontColor) && (c = m);
  6016. var m = a.zoomOutButton,
  6017. q;
  6018. m && (m.fontSize && (e = m.fontSize), m.color &&
  6019. (c = m.color), m.backgroundColor && (k = m.backgroundColor), isNaN(m.backgroundAlpha) || (a.zoomOutButtonRollOverAlpha = m.backgroundAlpha));
  6020. var p = m = 0;
  6021. void 0 !== a.pathToImages && f && (q = a.container.image(a.pathToImages + f, 0, 0, h, h), d.setCN(a, q, "zoom-out-image"), b.push(q), q = q.getBBox(), m = q.width + 5);
  6022. void 0 !== g && (c = d.text(a.container, g, c, a.fontFamily, e, "start"), d.setCN(a, c, "zoom-out-label"), e = c.getBBox(), p = q ? q.height / 2 - 3 : e.height / 2, c.translate(m, p), b.push(c));
  6023. q = b.getBBox();
  6024. c = 1;
  6025. d.isModern || (c = 0);
  6026. k = d.rect(a.container, q.width +
  6027. 2 * n + 5, q.height + 2 * n - 2, k, 1, 1, k, c);
  6028. k.setAttr("opacity", l);
  6029. k.translate(-n, -n);
  6030. d.setCN(a, k, "zoom-out-bg");
  6031. b.push(k);
  6032. k.toBack();
  6033. a.zbBG = k;
  6034. q = k.getBBox();
  6035. b.translate(a.marginLeftReal + a.plotAreaWidth - q.width + n, a.marginTopReal + n);
  6036. b.hide();
  6037. b.mouseover(function () {
  6038. a.rollOverZB()
  6039. }).mouseout(function () {
  6040. a.rollOutZB()
  6041. }).click(function () {
  6042. a.clickZB()
  6043. }).touchstart(function () {
  6044. a.rollOverZB()
  6045. }).touchend(function () {
  6046. a.rollOutZB();
  6047. a.clickZB()
  6048. });
  6049. for (l = 0; l < b.length; l++) b[l].attr({
  6050. cursor: "pointer"
  6051. });
  6052. a.zbSet = b
  6053. }
  6054. },
  6055. rollOverZB: function () {
  6056. this.zbBG.setAttr("opacity",
  6057. this.zoomOutButtonRollOverAlpha)
  6058. },
  6059. rollOutZB: function () {
  6060. this.zbBG.setAttr("opacity", this.zoomOutButtonAlpha)
  6061. },
  6062. clickZB: function () {
  6063. this.zoomOut()
  6064. },
  6065. zoomOut: function () {
  6066. this.updateScrollbar = !0;
  6067. this.zoom()
  6068. },
  6069. drawPlotArea: function () {
  6070. var a = this.dx,
  6071. b = this.dy,
  6072. c = this.marginLeftReal,
  6073. e = this.marginTopReal,
  6074. h = this.plotAreaWidth - 1,
  6075. f = this.plotAreaHeight - 1,
  6076. g = this.plotAreaFillColors,
  6077. k = this.plotAreaFillAlphas,
  6078. l = this.plotAreaBorderColor,
  6079. m = this.plotAreaBorderAlpha;
  6080. "object" == typeof k && (k = k[0]);
  6081. g = d.polygon(this.container, [0,
  6082. h, h, 0, 0
  6083. ], [0, 0, f, f, 0], g, k, 1, l, m, this.plotAreaGradientAngle);
  6084. d.setCN(this, g, "plot-area");
  6085. g.translate(c + a, e + b);
  6086. this.set.push(g);
  6087. 0 !== a && 0 !== b && (g = this.plotAreaFillColors, "object" == typeof g && (g = g[0]), g = d.adjustLuminosity(g, -.15), h = d.polygon(this.container, [0, a, h + a, h, 0], [0, b, b, 0, 0], g, k, 1, l, m), d.setCN(this, h, "plot-area-bottom"), h.translate(c, e + f), this.set.push(h), a = d.polygon(this.container, [0, 0, a, a, 0], [0, f, f + b, b, 0], g, k, 1, l, m), d.setCN(this, a, "plot-area-left"), a.translate(c, e), this.set.push(a));
  6088. (c = this.bbset) &&
  6089. this.scrollbarOnly && c.remove()
  6090. },
  6091. updatePlotArea: function () {
  6092. var a = this.updateWidth(),
  6093. b = this.updateHeight(),
  6094. c = this.container;
  6095. this.realWidth = a;
  6096. this.realWidth = b;
  6097. c && this.container.setSize(a, b);
  6098. a = a - this.marginLeftReal - this.marginRightReal - this.dx;
  6099. b = b - this.marginTopReal - this.marginBottomReal;
  6100. 1 > a && (a = 1);
  6101. 1 > b && (b = 1);
  6102. this.plotAreaWidth = Math.round(a);
  6103. this.plotAreaHeight = Math.round(b)
  6104. },
  6105. updateDxy: function () {
  6106. this.dx = Math.round(this.depth3D * Math.cos(this.angle * Math.PI / 180));
  6107. this.dy = Math.round(-this.depth3D * Math.sin(this.angle *
  6108. Math.PI / 180));
  6109. this.d3x = Math.round(this.columnSpacing3D * Math.cos(this.angle * Math.PI / 180));
  6110. this.d3y = Math.round(-this.columnSpacing3D * Math.sin(this.angle * Math.PI / 180))
  6111. },
  6112. updateMargins: function () {
  6113. var a = this.getTitleHeight();
  6114. this.titleHeight = a;
  6115. this.marginTopReal = this.marginTop - this.dy;
  6116. this.fixMargins && !this.fixMargins.top && (this.marginTopReal += a);
  6117. this.marginBottomReal = this.marginBottom;
  6118. this.marginLeftReal = this.marginLeft;
  6119. this.marginRightReal = this.marginRight
  6120. },
  6121. updateValueAxes: function () {
  6122. var a = this.valueAxes,
  6123. b = this.marginLeftReal,
  6124. c = this.marginTopReal,
  6125. e = this.plotAreaHeight,
  6126. h = this.plotAreaWidth,
  6127. f;
  6128. for (f = 0; f < a.length; f++) {
  6129. var g = a[f];
  6130. g.axisRenderer = d.RecAxis;
  6131. g.guideFillRenderer = d.RecFill;
  6132. g.axisItemRenderer = d.RecItem;
  6133. g.dx = this.dx;
  6134. g.dy = this.dy;
  6135. g.viW = h - 1;
  6136. g.viH = e - 1;
  6137. g.marginsChanged = !0;
  6138. g.viX = b;
  6139. g.viY = c;
  6140. this.updateObjectSize(g)
  6141. }
  6142. },
  6143. updateObjectSize: function (a) {
  6144. a.width = (this.plotAreaWidth - 1) * this.widthMultiplier;
  6145. a.height = (this.plotAreaHeight - 1) * this.heightMultiplier;
  6146. a.x = this.marginLeftReal + this.horizontalPosition;
  6147. a.y =
  6148. this.marginTopReal + this.verticalPosition
  6149. },
  6150. updateGraphs: function () {
  6151. var a = this.graphs,
  6152. b;
  6153. for (b = 0; b < a.length; b++) {
  6154. var c = a[b];
  6155. c.x = this.marginLeftReal + this.horizontalPosition;
  6156. c.y = this.marginTopReal + this.verticalPosition;
  6157. c.width = this.plotAreaWidth * this.widthMultiplier;
  6158. c.height = this.plotAreaHeight * this.heightMultiplier;
  6159. c.index = b;
  6160. c.dx = this.dx;
  6161. c.dy = this.dy;
  6162. c.rotate = this.rotate
  6163. }
  6164. },
  6165. updateChartCursor: function () {
  6166. var a = this.chartCursor;
  6167. a && (a = d.processObject(a, d.ChartCursor, this.theme), this.addChartCursor(a), a.x =
  6168. this.marginLeftReal, a.y = this.marginTopReal, a.width = this.plotAreaWidth - 1, a.height = this.plotAreaHeight - 1, a.chart = this)
  6169. },
  6170. processScrollbars: function () {
  6171. var a = this.chartScrollbar;
  6172. a && (a = d.processObject(a, d.ChartScrollbar, this.theme), this.addChartScrollbar(a))
  6173. },
  6174. updateScrollbars: function () {},
  6175. addChartCursor: function (a) {
  6176. d.callMethod("destroy", [this.chartCursor]);
  6177. a && (this.listenTo(a, "changed", this.handleCursorChange), this.listenTo(a, "zoomed", this.handleCursorZoom));
  6178. this.chartCursor = a
  6179. },
  6180. removeChartCursor: function () {
  6181. d.callMethod("destroy",
  6182. [this.chartCursor]);
  6183. this.chartCursor = null
  6184. },
  6185. zoomTrendLines: function () {
  6186. var a = this.trendLines,
  6187. b;
  6188. for (b = 0; b < a.length; b++) {
  6189. var c = a[b];
  6190. c.valueAxis.recalculateToPercents ? c.set && c.set.hide() : (c.x = this.marginLeftReal + this.horizontalPosition, c.y = this.marginTopReal + this.verticalPosition, c.draw())
  6191. }
  6192. },
  6193. addTrendLine: function (a) {
  6194. this.trendLines.push(a)
  6195. },
  6196. removeTrendLine: function (a) {
  6197. var b = this.trendLines,
  6198. c;
  6199. for (c = b.length - 1; 0 <= c; c--) b[c] == a && b.splice(c, 1)
  6200. },
  6201. adjustMargins: function (a, b) {
  6202. var c = a.position,
  6203. e = a.scrollbarHeight +
  6204. a.offset;
  6205. a.enabled && ("top" == c ? b ? this.marginLeftReal += e : this.marginTopReal += e : b ? this.marginRightReal += e : this.marginBottomReal += e)
  6206. },
  6207. getScrollbarPosition: function (a, b, c) {
  6208. a.position = b ? "bottom" == c || "left" == c ? "bottom" : "top" : "top" == c || "right" == c ? "bottom" : "top"
  6209. },
  6210. updateChartScrollbar: function (a, b) {
  6211. if (a) {
  6212. a.rotate = b;
  6213. var c = this.marginTopReal,
  6214. e = this.marginLeftReal,
  6215. d = a.scrollbarHeight,
  6216. f = this.dx,
  6217. g = this.dy,
  6218. k = a.offset;
  6219. "top" == a.position ? b ? (a.y = c, a.x = e - d - k) : (a.y = c - d + g - k, a.x = e + f) : b ? (a.y = c + g, a.x = e + this.plotAreaWidth +
  6220. f + k) : (a.y = c + this.plotAreaHeight + k, a.x = this.marginLeftReal)
  6221. }
  6222. },
  6223. showZB: function (a) {
  6224. var b = this.zbSet;
  6225. a && (b = this.zoomOutText, "" !== b && b && this.drawZoomOutButton());
  6226. if (b = this.zbSet) this.zoomButtonSet.push(b), a ? b.show() : b.hide(), this.rollOutZB()
  6227. },
  6228. handleReleaseOutside: function (a) {
  6229. d.AmRectangularChart.base.handleReleaseOutside.call(this, a);
  6230. (a = this.chartCursor) && a.handleReleaseOutside && a.handleReleaseOutside()
  6231. },
  6232. handleMouseDown: function (a) {
  6233. d.AmRectangularChart.base.handleMouseDown.call(this, a);
  6234. var b = this.chartCursor;
  6235. b && b.handleMouseDown(a)
  6236. },
  6237. handleCursorChange: function () {},
  6238. update: function () {
  6239. d.AmRectangularChart.base.update.call(this);
  6240. this.chartCursor && this.chartCursor.update && this.chartCursor.update()
  6241. }
  6242. })
  6243. })();
  6244. (function () {
  6245. var d = window.AmCharts;
  6246. d.TrendLine = d.Class({
  6247. construct: function (a) {
  6248. this.cname = "TrendLine";
  6249. this.createEvents("click");
  6250. this.isProtected = !1;
  6251. this.dashLength = 0;
  6252. this.lineColor = "#00CC00";
  6253. this.lineThickness = this.lineAlpha = 1;
  6254. d.applyTheme(this, a, this.cname)
  6255. },
  6256. draw: function () {
  6257. var a = this;
  6258. a.destroy();
  6259. var b = a.chart,
  6260. c = b.container,
  6261. e, h, f, g, k = a.categoryAxis,
  6262. l = a.initialDate,
  6263. m = a.initialCategory,
  6264. n = a.finalDate,
  6265. q = a.finalCategory,
  6266. p = a.valueAxis,
  6267. r = a.valueAxisX,
  6268. t = a.initialXValue,
  6269. u = a.finalXValue,
  6270. z = a.initialValue,
  6271. w =
  6272. a.finalValue,
  6273. x = p.recalculateToPercents,
  6274. v = b.dataDateFormat;
  6275. k && (l && (l = d.getDate(l, v, "fff"), a.initialDate = l, e = k.dateToCoordinate(l)), m && (e = k.categoryToCoordinate(m)), n && (n = d.getDate(n, v, "fff"), a.finalDate = n, h = k.dateToCoordinate(n)), q && (h = k.categoryToCoordinate(q)));
  6276. r && !x && (isNaN(t) || (e = r.getCoordinate(t)), isNaN(u) || (h = r.getCoordinate(u)));
  6277. p && !x && (isNaN(z) || (f = p.getCoordinate(z)), isNaN(w) || (g = p.getCoordinate(w)));
  6278. isNaN(e) || isNaN(h) || isNaN(f) || isNaN(f) || (b.rotate ? (k = [f, g], h = [e, h]) : (k = [e, h], h = [f, g]), f =
  6279. a.lineColor, e = d.line(c, k, h, f, a.lineAlpha, a.lineThickness, a.dashLength), g = k, l = h, q = k[1] - k[0], p = h[1] - h[0], 0 === q && (q = .01), 0 === p && (p = .01), m = q / Math.abs(q), n = p / Math.abs(p), p = q * p / Math.abs(q * p) * Math.sqrt(Math.pow(q, 2) + Math.pow(p, 2)), q = Math.asin(q / p), p = 90 * Math.PI / 180 - q, q = Math.abs(5 * Math.cos(p)), p = Math.abs(5 * Math.sin(p)), g.push(k[1] - m * p, k[0] - m * p), l.push(h[1] + n * q, h[0] + n * q), k = d.polygon(c, g, l, f, .005, 0), c = c.set([k, e]), c.translate(b.marginLeftReal, b.marginTopReal), b.trendLinesSet.push(c), d.setCN(b, e, "trend-line"),
  6280. d.setCN(b, e, "trend-line-" + a.id), a.line = e, a.set = c, k.mouseup(function () {
  6281. a.handleLineClick()
  6282. }).mouseover(function () {
  6283. a.handleLineOver()
  6284. }).mouseout(function () {
  6285. a.handleLineOut()
  6286. }), k.touchend && k.touchend(function () {
  6287. a.handleLineClick()
  6288. }), c.clipRect(0, 0, b.plotAreaWidth, b.plotAreaHeight))
  6289. },
  6290. handleLineClick: function () {
  6291. var a = {
  6292. type: "click",
  6293. trendLine: this,
  6294. chart: this.chart
  6295. };
  6296. this.fire(a.type, a)
  6297. },
  6298. handleLineOver: function () {
  6299. var a = this.rollOverColor;
  6300. void 0 !== a && this.line.attr({
  6301. stroke: a
  6302. })
  6303. },
  6304. handleLineOut: function () {
  6305. this.line.attr({
  6306. stroke: this.lineColor
  6307. })
  6308. },
  6309. destroy: function () {
  6310. d.remove(this.set)
  6311. }
  6312. })
  6313. })();
  6314. (function () {
  6315. var d = window.AmCharts;
  6316. d.circle = function (a, b, c, e, h, f, g, k, l) {
  6317. 0 >= b && (b = .001);
  6318. if (void 0 == h || 0 === h) h = .01;
  6319. void 0 === f && (f = "#000000");
  6320. void 0 === g && (g = 0);
  6321. e = {
  6322. fill: c,
  6323. stroke: f,
  6324. "fill-opacity": e,
  6325. "stroke-width": h,
  6326. "stroke-opacity": g
  6327. };
  6328. a = isNaN(l) ? a.circle(0, 0, b).attr(e) : a.ellipse(0, 0, b, l).attr(e);
  6329. k && a.gradient("radialGradient", [c, d.adjustLuminosity(c, -.6)]);
  6330. return a
  6331. };
  6332. d.text = function (a, b, c, e, h, f, g, k) {
  6333. f || (f = "middle");
  6334. "right" == f && (f = "end");
  6335. "left" == f && (f = "start");
  6336. isNaN(k) && (k = 1);
  6337. void 0 !== b && (b = String(b), d.isIE &&
  6338. !d.isModern && (b = b.replace("&amp;", "&"), b = b.replace("&", "&amp;")));
  6339. c = {
  6340. fill: c,
  6341. "font-family": e,
  6342. "font-size": h,
  6343. opacity: k
  6344. };
  6345. !0 === g && (c["font-weight"] = "bold");
  6346. c["text-anchor"] = f;
  6347. return a.text(b, c)
  6348. };
  6349. d.polygon = function (a, b, c, e, h, f, g, k, l, m, n) {
  6350. isNaN(f) && (f = .01);
  6351. isNaN(k) && (k = h);
  6352. var q = e,
  6353. p = !1;
  6354. "object" == typeof q && 1 < q.length && (p = !0, q = q[0]);
  6355. void 0 === g && (g = q);
  6356. h = {
  6357. fill: q,
  6358. stroke: g,
  6359. "fill-opacity": h,
  6360. "stroke-width": f,
  6361. "stroke-opacity": k
  6362. };
  6363. void 0 !== n && 0 < n && (h["stroke-dasharray"] = n);
  6364. n = d.dx;
  6365. f = d.dy;
  6366. a.handDrawn && (c = d.makeHD(b, c,
  6367. a.handDrawScatter), b = c[0], c = c[1]);
  6368. g = Math.round;
  6369. m && (g = d.doNothing);
  6370. m = "M" + (g(b[0]) + n) + "," + (g(c[0]) + f);
  6371. for (k = 1; k < b.length; k++) m += " L" + (g(b[k]) + n) + "," + (g(c[k]) + f);
  6372. a = a.path(m + " Z").attr(h);
  6373. p && a.gradient("linearGradient", e, l);
  6374. return a
  6375. };
  6376. d.rect = function (a, b, c, e, h, f, g, k, l, m, n) {
  6377. if (isNaN(b) || isNaN(c)) return a.set();
  6378. isNaN(f) && (f = 0);
  6379. void 0 === l && (l = 0);
  6380. void 0 === m && (m = 270);
  6381. isNaN(h) && (h = 0);
  6382. var q = e,
  6383. p = !1;
  6384. "object" == typeof q && (q = q[0], p = !0);
  6385. void 0 === g && (g = q);
  6386. void 0 === k && (k = h);
  6387. b = Math.round(b);
  6388. c = Math.round(c);
  6389. var r = 0,
  6390. t =
  6391. 0;
  6392. 0 > b && (b = Math.abs(b), r = -b);
  6393. 0 > c && (c = Math.abs(c), t = -c);
  6394. r += d.dx;
  6395. t += d.dy;
  6396. h = {
  6397. fill: q,
  6398. stroke: g,
  6399. "fill-opacity": h,
  6400. "stroke-opacity": k
  6401. };
  6402. void 0 !== n && 0 < n && (h["stroke-dasharray"] = n);
  6403. a = a.rect(r, t, b, c, l, f).attr(h);
  6404. p && a.gradient("linearGradient", e, m);
  6405. return a
  6406. };
  6407. d.bullet = function (a, b, c, e, h, f, g, k, l, m, n, q) {
  6408. var p;
  6409. "circle" == b && (b = "round");
  6410. switch (b) {
  6411. case "round":
  6412. p = d.circle(a, c / 2, e, h, f, g, k);
  6413. break;
  6414. case "square":
  6415. p = d.polygon(a, [-c / 2, c / 2, c / 2, -c / 2], [c / 2, c / 2, -c / 2, -c / 2], e, h, f, g, k, m - 180);
  6416. break;
  6417. case "rectangle":
  6418. p = d.polygon(a, [-c,
  6419. c, c, -c
  6420. ], [c / 2, c / 2, -c / 2, -c / 2], e, h, f, g, k, m - 180);
  6421. break;
  6422. case "diamond":
  6423. p = d.polygon(a, [-c / 2, 0, c / 2, 0], [0, -c / 2, 0, c / 2], e, h, f, g, k);
  6424. break;
  6425. case "triangleUp":
  6426. p = d.triangle(a, c, 0, e, h, f, g, k);
  6427. break;
  6428. case "triangleDown":
  6429. p = d.triangle(a, c, 180, e, h, f, g, k);
  6430. break;
  6431. case "triangleLeft":
  6432. p = d.triangle(a, c, 270, e, h, f, g, k);
  6433. break;
  6434. case "triangleRight":
  6435. p = d.triangle(a, c, 90, e, h, f, g, k);
  6436. break;
  6437. case "bubble":
  6438. p = d.circle(a, c / 2, e, h, f, g, k, !0);
  6439. break;
  6440. case "line":
  6441. p = d.line(a, [-c / 2, c / 2], [0, 0], e, h, f, g, k);
  6442. break;
  6443. case "yError":
  6444. p = a.set();
  6445. p.push(d.line(a,
  6446. [0, 0], [-c / 2, c / 2], e, h, f));
  6447. p.push(d.line(a, [-l, l], [-c / 2, -c / 2], e, h, f));
  6448. p.push(d.line(a, [-l, l], [c / 2, c / 2], e, h, f));
  6449. break;
  6450. case "xError":
  6451. p = a.set(), p.push(d.line(a, [-c / 2, c / 2], [0, 0], e, h, f)), p.push(d.line(a, [-c / 2, -c / 2], [-l, l], e, h, f)), p.push(d.line(a, [c / 2, c / 2], [-l, l], e, h, f))
  6452. }
  6453. p && p.pattern(n, NaN, q);
  6454. return p
  6455. };
  6456. d.triangle = function (a, b, c, e, d, f, g, k) {
  6457. if (void 0 === f || 0 === f) f = 1;
  6458. void 0 === g && (g = "#000");
  6459. void 0 === k && (k = 0);
  6460. e = {
  6461. fill: e,
  6462. stroke: g,
  6463. "fill-opacity": d,
  6464. "stroke-width": f,
  6465. "stroke-opacity": k
  6466. };
  6467. b /= 2;
  6468. var l;
  6469. 0 === c && (l = " M" + -b +
  6470. "," + b + " L0," + -b + " L" + b + "," + b + " Z");
  6471. 180 == c && (l = " M" + -b + "," + -b + " L0," + b + " L" + b + "," + -b + " Z");
  6472. 90 == c && (l = " M" + -b + "," + -b + " L" + b + ",0 L" + -b + "," + b + " Z");
  6473. 270 == c && (l = " M" + -b + ",0 L" + b + "," + b + " L" + b + "," + -b + " Z");
  6474. return a.path(l).attr(e)
  6475. };
  6476. d.line = function (a, b, c, e, h, f, g, k, l, m, n) {
  6477. if (a.handDrawn && !n) return d.handDrawnLine(a, b, c, e, h, f, g, k, l, m, n);
  6478. f = {
  6479. fill: "none",
  6480. "stroke-width": f
  6481. };
  6482. void 0 !== g && 0 < g && (f["stroke-dasharray"] = g);
  6483. isNaN(h) || (f["stroke-opacity"] = h);
  6484. e && (f.stroke = e);
  6485. e = Math.round;
  6486. m && (e = d.doNothing);
  6487. m = d.dx;
  6488. h = d.dy;
  6489. g =
  6490. "M" + (e(b[0]) + m) + "," + (e(c[0]) + h);
  6491. for (k = 1; k < b.length; k++) g += " L" + (e(b[k]) + m) + "," + (e(c[k]) + h);
  6492. if (d.VML) return a.path(g, void 0, !0).attr(f);
  6493. l && (g += " M0,0 L0,0");
  6494. return a.path(g).attr(f)
  6495. };
  6496. d.makeHD = function (a, b, c) {
  6497. for (var d = [], h = [], f = 1; f < a.length; f++)
  6498. for (var g = Number(a[f - 1]), k = Number(b[f - 1]), l = Number(a[f]), m = Number(b[f]), n = Math.sqrt(Math.pow(l - g, 2) + Math.pow(m - k, 2)), n = Math.round(n / 50) + 1, l = (l - g) / n, m = (m - k) / n, q = 0; q <= n; q++) {
  6499. var p = g + q * l + Math.random() * c,
  6500. r = k + q * m + Math.random() * c;
  6501. d.push(p);
  6502. h.push(r)
  6503. }
  6504. return [d, h]
  6505. };
  6506. d.handDrawnLine = function (a, b, c, e, h, f, g, k, l, m) {
  6507. var n, q = a.set();
  6508. for (n = 1; n < b.length; n++)
  6509. for (var p = [b[n - 1], b[n]], r = [c[n - 1], c[n]], r = d.makeHD(p, r, a.handDrawScatter), p = r[0], r = r[1], t = 1; t < p.length; t++) q.push(d.line(a, [p[t - 1], p[t]], [r[t - 1], r[t]], e, h, f + Math.random() * a.handDrawThickness - a.handDrawThickness / 2, g, k, l, m, !0));
  6510. return q
  6511. };
  6512. d.doNothing = function (a) {
  6513. return a
  6514. };
  6515. d.wedge = function (a, b, c, e, h, f, g, k, l, m, n, q, p) {
  6516. var r = Math.round;
  6517. f = r(f);
  6518. g = r(g);
  6519. k = r(k);
  6520. var t = r(g / f * k),
  6521. u = d.VML,
  6522. z = 359.5 + f / 100;
  6523. 359.94 < z && (z = 359.94);
  6524. h >= z &&
  6525. (h = z);
  6526. var w = 1 / 180 * Math.PI,
  6527. z = b + Math.sin(e * w) * k,
  6528. x = c - Math.cos(e * w) * t,
  6529. v = b + Math.sin(e * w) * f,
  6530. A = c - Math.cos(e * w) * g,
  6531. B = b + Math.sin((e + h) * w) * f,
  6532. D = c - Math.cos((e + h) * w) * g,
  6533. C = b + Math.sin((e + h) * w) * k,
  6534. w = c - Math.cos((e + h) * w) * t,
  6535. I = {
  6536. fill: d.adjustLuminosity(m.fill, -.2),
  6537. "stroke-opacity": 0,
  6538. "fill-opacity": m["fill-opacity"]
  6539. },
  6540. H = 0;
  6541. 180 < Math.abs(h) && (H = 1);
  6542. e = a.set();
  6543. var O;
  6544. u && (z = r(10 * z), v = r(10 * v), B = r(10 * B), C = r(10 * C), x = r(10 * x), 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, t *= 10, 1 > Math.abs(h) && 1 >= Math.abs(B -
  6545. v) && 1 >= Math.abs(D - A) && (O = !0));
  6546. h = "";
  6547. var J;
  6548. q && (I["fill-opacity"] = 0, I["stroke-opacity"] = m["stroke-opacity"] / 2, I.stroke = m.stroke);
  6549. 0 < l && (J = " M" + z + "," + (x + l) + " L" + v + "," + (A + l), u ? (O || (J += " A" + (b - f) + "," + (l + c - g) + "," + (b + f) + "," + (l + c + g) + "," + v + "," + (A + l) + "," + B + "," + (D + l)), J += " L" + C + "," + (w + l), 0 < k && (O || (J += " B" + (b - k) + "," + (l + c - t) + "," + (b + k) + "," + (l + c + t) + "," + C + "," + (l + w) + "," + z + "," + (l + x)))) : (J += " A" + f + "," + g + ",0," + H + ",1," + B + "," + (D + l) + " L" + C + "," + (w + l), 0 < k && (J += " A" + k + "," + t + ",0," + H + ",0," + z + "," + (x + l))), J = a.path(J + " Z", void 0,
  6550. void 0, "1000,1000").attr(I), e.push(J), J = a.path(" M" + z + "," + x + " L" + z + "," + (x + l) + " L" + v + "," + (A + l) + " L" + v + "," + A + " L" + z + "," + x + " Z", void 0, void 0, "1000,1000").attr(I), l = a.path(" M" + B + "," + D + " L" + B + "," + (D + l) + " L" + C + "," + (w + l) + " L" + C + "," + w + " L" + B + "," + D + " Z", void 0, void 0, "1000,1000").attr(I), e.push(J), e.push(l));
  6551. u ? (O || (h = " A" + r(b - f) + "," + r(c - g) + "," + r(b + f) + "," + r(c + g) + "," + r(v) + "," + r(A) + "," + r(B) + "," + r(D)), f = " M" + r(z) + "," + r(x) + " L" + r(v) + "," + r(A) + h + " L" + r(C) + "," + r(w)) : f = " M" + z + "," + x + " L" + v + "," + A + (" A" + f + "," + g + ",0," +
  6552. H + ",1," + B + "," + D) + " L" + C + "," + w;
  6553. 0 < k && (u ? O || (f += " B" + (b - k) + "," + (c - t) + "," + (b + k) + "," + (c + t) + "," + C + "," + w + "," + z + "," + x) : f += " A" + k + "," + t + ",0," + H + ",0," + z + "," + x);
  6554. a.handDrawn && (b = d.line(a, [z, v], [x, A], m.stroke, m.thickness * Math.random() * a.handDrawThickness, m["stroke-opacity"]), e.push(b));
  6555. a = a.path(f + " Z", void 0, void 0, "1000,1000").attr(m);
  6556. if (n) {
  6557. b = [];
  6558. for (c = 0; c < n.length; c++) b.push(d.adjustLuminosity(m.fill, n[c]));
  6559. 0 < b.length && a.gradient("linearGradient", b)
  6560. }
  6561. a.pattern(q, NaN, p);
  6562. e.wedge = a;
  6563. e.push(a);
  6564. return e
  6565. };
  6566. d.adjustLuminosity =
  6567. function (a, b) {
  6568. a = String(a).replace(/[^0-9a-f]/gi, "");
  6569. 6 > a.length && (a = String(a[0]) + String(a[0]) + String(a[1]) + String(a[1]) + String(a[2]) + String(a[2]));
  6570. b = b || 0;
  6571. var c = "#",
  6572. d, h;
  6573. for (h = 0; 3 > h; h++) d = parseInt(a.substr(2 * h, 2), 16), d = Math.round(Math.min(Math.max(0, d + d * b), 255)).toString(16), c += ("00" + d).substr(d.length);
  6574. return c
  6575. }
  6576. })();
  6577. (function () {
  6578. var d = window.AmCharts;
  6579. d.Bezier = d.Class({
  6580. construct: function (a, b, c, e, h, f, g, k, l, m) {
  6581. "object" == typeof g && (g = g[0]);
  6582. "object" == typeof k && (k = k[0]);
  6583. 0 === k && (g = "none");
  6584. f = {
  6585. fill: g,
  6586. "fill-opacity": k,
  6587. "stroke-width": f
  6588. };
  6589. void 0 !== l && 0 < l && (f["stroke-dasharray"] = l);
  6590. isNaN(h) || (f["stroke-opacity"] = h);
  6591. e && (f.stroke = e);
  6592. e = "M" + Math.round(b[0]) + "," + Math.round(c[0]);
  6593. h = [];
  6594. for (l = 0; l < b.length; l++) h.push({
  6595. x: Number(b[l]),
  6596. y: Number(c[l])
  6597. });
  6598. 1 < h.length && (b = this.interpolate(h), e += this.drawBeziers(b));
  6599. m ? e += m : d.VML || (e += "M0,0 L0,0");
  6600. this.path = a.path(e).attr(f);
  6601. this.node = this.path.node
  6602. },
  6603. interpolate: function (a) {
  6604. var b = [];
  6605. b.push({
  6606. x: a[0].x,
  6607. y: a[0].y
  6608. });
  6609. var c = a[1].x - a[0].x,
  6610. e = a[1].y - a[0].y,
  6611. h = d.bezierX,
  6612. f = d.bezierY;
  6613. b.push({
  6614. x: a[0].x + c / h,
  6615. y: a[0].y + e / f
  6616. });
  6617. var g;
  6618. for (g = 1; g < a.length - 1; g++) {
  6619. var k = a[g - 1],
  6620. l = a[g],
  6621. e = a[g + 1];
  6622. isNaN(e.x) && (e = l);
  6623. isNaN(l.x) && (l = k);
  6624. isNaN(k.x) && (k = l);
  6625. c = e.x - l.x;
  6626. e = e.y - k.y;
  6627. k = l.x - k.x;
  6628. k > c && (k = c);
  6629. b.push({
  6630. x: l.x - k / h,
  6631. y: l.y - e / f
  6632. });
  6633. b.push({
  6634. x: l.x,
  6635. y: l.y
  6636. });
  6637. b.push({
  6638. x: l.x + k / h,
  6639. y: l.y + e / f
  6640. })
  6641. }
  6642. e = a[a.length - 1].y - a[a.length - 2].y;
  6643. c = a[a.length - 1].x -
  6644. a[a.length - 2].x;
  6645. b.push({
  6646. x: a[a.length - 1].x - c / h,
  6647. y: a[a.length - 1].y - e / f
  6648. });
  6649. b.push({
  6650. x: a[a.length - 1].x,
  6651. y: a[a.length - 1].y
  6652. });
  6653. return b
  6654. },
  6655. drawBeziers: function (a) {
  6656. var b = "",
  6657. c;
  6658. 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]);
  6659. return b
  6660. },
  6661. drawBezierMidpoint: function (a, b, c, d) {
  6662. var h = Math.round,
  6663. f = this.getPointOnSegment(a, b, .75),
  6664. g = this.getPointOnSegment(d, c, .75),
  6665. k = (d.x - a.x) / 16,
  6666. l = (d.y - a.y) / 16,
  6667. m = this.getPointOnSegment(a, b, .375);
  6668. a = this.getPointOnSegment(f, g, .375);
  6669. a.x -= k;
  6670. a.y -= l;
  6671. b = this.getPointOnSegment(g,
  6672. f, .375);
  6673. b.x += k;
  6674. b.y += l;
  6675. c = this.getPointOnSegment(d, c, .375);
  6676. k = this.getMiddle(m, a);
  6677. f = this.getMiddle(f, g);
  6678. g = this.getMiddle(b, c);
  6679. m = " Q" + h(m.x) + "," + h(m.y) + "," + h(k.x) + "," + h(k.y);
  6680. m += " Q" + h(a.x) + "," + h(a.y) + "," + h(f.x) + "," + h(f.y);
  6681. m += " Q" + h(b.x) + "," + h(b.y) + "," + h(g.x) + "," + h(g.y);
  6682. return m += " Q" + h(c.x) + "," + h(c.y) + "," + h(d.x) + "," + h(d.y)
  6683. },
  6684. getMiddle: function (a, b) {
  6685. return {
  6686. x: (a.x + b.x) / 2,
  6687. y: (a.y + b.y) / 2
  6688. }
  6689. },
  6690. getPointOnSegment: function (a, b, c) {
  6691. return {
  6692. x: a.x + (b.x - a.x) * c,
  6693. y: a.y + (b.y - a.y) * c
  6694. }
  6695. }
  6696. })
  6697. })();
  6698. (function () {
  6699. var d = window.AmCharts;
  6700. d.AmDraw = d.Class({
  6701. construct: function (a, b, c, e) {
  6702. d.SVG_NS = "http://www.w3.org/2000/svg";
  6703. d.SVG_XLINK = "http://www.w3.org/1999/xlink";
  6704. d.hasSVG = !!document.createElementNS && !!document.createElementNS(d.SVG_NS, "svg").createSVGRect;
  6705. 1 > b && (b = 10);
  6706. 1 > c && (c = 10);
  6707. this.div = a;
  6708. this.width = b;
  6709. this.height = c;
  6710. this.rBin = document.createElement("div");
  6711. 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 &&
  6712. (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))
  6713. },
  6714. createSvgElement: function (a) {
  6715. return document.createElementNS(d.SVG_NS,
  6716. a)
  6717. },
  6718. circle: function (a, b, c, e) {
  6719. var h = new d.AmDObject("circle", this);
  6720. h.attr({
  6721. r: c,
  6722. cx: a,
  6723. cy: b
  6724. });
  6725. this.addToContainer(h.node, e);
  6726. return h
  6727. },
  6728. ellipse: function (a, b, c, e, h) {
  6729. var f = new d.AmDObject("ellipse", this);
  6730. f.attr({
  6731. rx: c,
  6732. ry: e,
  6733. cx: a,
  6734. cy: b
  6735. });
  6736. this.addToContainer(f.node, h);
  6737. return f
  6738. },
  6739. setSize: function (a, b) {
  6740. 0 < a && 0 < b && (this.container.style.width = a + "px", this.container.style.height = b + "px")
  6741. },
  6742. rect: function (a, b, c, e, h, f, g) {
  6743. var k = new d.AmDObject("rect", this);
  6744. d.VML && (h = Math.round(100 * h / Math.min(c, e)), c += 2 * f, e += 2 * f, k.bw = f, k.node.style.marginLeft = -f, k.node.style.marginTop = -f);
  6745. 1 > c && (c = 1);
  6746. 1 > e && (e = 1);
  6747. k.attr({
  6748. x: a,
  6749. y: b,
  6750. width: c,
  6751. height: e,
  6752. rx: h,
  6753. ry: h,
  6754. "stroke-width": f
  6755. });
  6756. this.addToContainer(k.node, g);
  6757. return k
  6758. },
  6759. image: function (a, b, c, e, h, f) {
  6760. var g = new d.AmDObject("image", this);
  6761. g.attr({
  6762. x: b,
  6763. y: c,
  6764. width: e,
  6765. height: h
  6766. });
  6767. this.R.path(g, a);
  6768. this.addToContainer(g.node, f);
  6769. return g
  6770. },
  6771. addToContainer: function (a, b) {
  6772. b || (b = this.container);
  6773. b.appendChild(a)
  6774. },
  6775. text: function (a, b, c) {
  6776. return this.R.text(a, b, c)
  6777. },
  6778. path: function (a, b, c, e) {
  6779. var h = new d.AmDObject("path", this);
  6780. e || (e = "100,100");
  6781. h.attr({
  6782. cs: e
  6783. });
  6784. c ? h.attr({
  6785. dd: a
  6786. }) : h.attr({
  6787. d: a
  6788. });
  6789. this.addToContainer(h.node, b);
  6790. return h
  6791. },
  6792. set: function (a) {
  6793. return this.R.set(a)
  6794. },
  6795. remove: function (a) {
  6796. if (a) {
  6797. var b = this.rBin;
  6798. b.appendChild(a);
  6799. b.innerHTML = ""
  6800. }
  6801. },
  6802. renderFix: function () {
  6803. var a = this.container,
  6804. b = a.style,
  6805. c;
  6806. try {
  6807. c = a.getScreenCTM() || a.createSVGMatrix()
  6808. } catch (d) {
  6809. c = a.createSVGMatrix()
  6810. }
  6811. a = 1 - c.e % 1;
  6812. c = 1 - c.f % 1;
  6813. .5 < a && --a;
  6814. .5 < c && --c;
  6815. a && (b.left = a + "px");
  6816. c && (b.top = c + "px")
  6817. },
  6818. update: function () {
  6819. this.R.update()
  6820. },
  6821. addDefs: function (a) {
  6822. if (d.hasSVG) {
  6823. var b = this.createSvgElement("desc"),
  6824. c = this.container;
  6825. c.setAttribute("version", "1.1");
  6826. c.style.position = "absolute";
  6827. this.setSize(this.width, this.height);
  6828. d.rtl && (c.setAttribute("direction", "rtl"), c.style.left = "auto", c.style.right = "0px");
  6829. a.addCodeCredits && b.appendChild(document.createTextNode("JavaScript chart by amCharts " + a.version));
  6830. c.appendChild(b);
  6831. a.defs && (b = this.createSvgElement("defs"), c.appendChild(b), d.parseDefs(a.defs, b), this.defs = b)
  6832. }
  6833. }
  6834. })
  6835. })();
  6836. (function () {
  6837. var d = window.AmCharts;
  6838. d.AmDObject = d.Class({
  6839. construct: function (a, b) {
  6840. this.D = b;
  6841. this.R = b.R;
  6842. this.node = this.R.create(this, a);
  6843. this.y = this.x = 0;
  6844. this.scale = 1
  6845. },
  6846. attr: function (a) {
  6847. this.R.attr(this, a);
  6848. return this
  6849. },
  6850. getAttr: function (a) {
  6851. return this.node.getAttribute(a)
  6852. },
  6853. setAttr: function (a, b) {
  6854. this.R.setAttr(this, a, b);
  6855. return this
  6856. },
  6857. clipRect: function (a, b, c, d) {
  6858. this.R.clipRect(this, a, b, c, d)
  6859. },
  6860. translate: function (a, b, c, d) {
  6861. d || (a = Math.round(a), b = Math.round(b));
  6862. this.R.move(this, a, b, c);
  6863. this.x = a;
  6864. this.y = b;
  6865. this.scale =
  6866. c;
  6867. this.angle && this.rotate(this.angle)
  6868. },
  6869. rotate: function (a, b) {
  6870. this.R.rotate(this, a, b);
  6871. this.angle = a
  6872. },
  6873. animate: function (a, b, c) {
  6874. for (var e in a)
  6875. if (a.hasOwnProperty(e)) {
  6876. var h = e,
  6877. f = a[e];
  6878. c = d.getEffect(c);
  6879. this.R.animate(this, h, f, b, c)
  6880. }
  6881. },
  6882. push: function (a) {
  6883. if (a) {
  6884. var b = this.node;
  6885. b.appendChild(a.node);
  6886. var c = a.clipPath;
  6887. c && b.appendChild(c);
  6888. (a = a.grad) && b.appendChild(a)
  6889. }
  6890. },
  6891. text: function (a) {
  6892. this.R.setText(this, a)
  6893. },
  6894. remove: function () {
  6895. this.R.remove(this)
  6896. },
  6897. clear: function () {
  6898. var a = this.node;
  6899. if (a.hasChildNodes())
  6900. for (; 1 <= a.childNodes.length;) a.removeChild(a.firstChild)
  6901. },
  6902. hide: function () {
  6903. this.setAttr("visibility", "hidden")
  6904. },
  6905. show: function () {
  6906. this.setAttr("visibility", "visible")
  6907. },
  6908. getBBox: function () {
  6909. return this.R.getBBox(this)
  6910. },
  6911. toFront: function () {
  6912. var a = this.node;
  6913. if (a) {
  6914. this.prevNextNode = a.nextSibling;
  6915. var b = a.parentNode;
  6916. b && b.appendChild(a)
  6917. }
  6918. },
  6919. toPrevious: function () {
  6920. var a = this.node;
  6921. a && this.prevNextNode && (a = a.parentNode) && a.insertBefore(this.prevNextNode, null)
  6922. },
  6923. toBack: function () {
  6924. var a = this.node;
  6925. if (a) {
  6926. this.prevNextNode = a.nextSibling;
  6927. var b = a.parentNode;
  6928. if (b) {
  6929. var c = b.firstChild;
  6930. c && b.insertBefore(a, c)
  6931. }
  6932. }
  6933. },
  6934. mouseover: function (a) {
  6935. this.R.addListener(this, "mouseover", a);
  6936. return this
  6937. },
  6938. mouseout: function (a) {
  6939. this.R.addListener(this, "mouseout", a);
  6940. return this
  6941. },
  6942. click: function (a) {
  6943. this.R.addListener(this, "click", a);
  6944. return this
  6945. },
  6946. dblclick: function (a) {
  6947. this.R.addListener(this, "dblclick", a);
  6948. return this
  6949. },
  6950. mousedown: function (a) {
  6951. this.R.addListener(this, "mousedown", a);
  6952. return this
  6953. },
  6954. mouseup: function (a) {
  6955. this.R.addListener(this, "mouseup", a);
  6956. return this
  6957. },
  6958. touchstart: function (a) {
  6959. this.R.addListener(this,
  6960. "touchstart", a);
  6961. return this
  6962. },
  6963. touchend: function (a) {
  6964. this.R.addListener(this, "touchend", a);
  6965. return this
  6966. },
  6967. contextmenu: function (a) {
  6968. this.node.addEventListener ? this.node.addEventListener("contextmenu", a, !0) : this.R.addListener(this, "contextmenu", a);
  6969. return this
  6970. },
  6971. stop: function () {
  6972. d.removeFromArray(this.R.animations, this.an_x);
  6973. d.removeFromArray(this.R.animations, this.an_y)
  6974. },
  6975. length: function () {
  6976. return this.node.childNodes.length
  6977. },
  6978. gradient: function (a, b, c) {
  6979. this.R.gradient(this, a, b, c)
  6980. },
  6981. pattern: function (a, b, c) {
  6982. a && this.R.pattern(this,
  6983. a, b, c)
  6984. }
  6985. })
  6986. })();
  6987. (function () {
  6988. var d = window.AmCharts;
  6989. d.VMLRenderer = d.Class({
  6990. construct: function (a, b) {
  6991. this.chart = b;
  6992. this.D = a;
  6993. this.cNames = {
  6994. circle: "oval",
  6995. ellipse: "oval",
  6996. rect: "roundrect",
  6997. path: "shape"
  6998. };
  6999. this.styleMap = {
  7000. x: "left",
  7001. y: "top",
  7002. width: "width",
  7003. height: "height",
  7004. "font-family": "fontFamily",
  7005. "font-size": "fontSize",
  7006. visibility: "visibility"
  7007. }
  7008. },
  7009. create: function (a, b) {
  7010. var c;
  7011. if ("group" == b) c = document.createElement("div"), a.type = "div";
  7012. else if ("text" == b) c = document.createElement("div"), a.type = "text";
  7013. else if ("image" == b) c = document.createElement("img"),
  7014. a.type = "image";
  7015. else {
  7016. a.type = "shape";
  7017. a.shapeType = this.cNames[b];
  7018. c = document.createElement("amvml:" + this.cNames[b]);
  7019. var d = document.createElement("amvml:stroke");
  7020. c.appendChild(d);
  7021. a.stroke = d;
  7022. var h = document.createElement("amvml:fill");
  7023. c.appendChild(h);
  7024. a.fill = h;
  7025. h.className = "amvml";
  7026. d.className = "amvml";
  7027. c.className = "amvml"
  7028. }
  7029. c.style.position = "absolute";
  7030. c.style.top = 0;
  7031. c.style.left = 0;
  7032. return c
  7033. },
  7034. path: function (a, b) {
  7035. a.node.setAttribute("src", b)
  7036. },
  7037. setAttr: function (a, b, c) {
  7038. if (void 0 !== c) {
  7039. var e;
  7040. 8 === document.documentMode &&
  7041. (e = !0);
  7042. var h = a.node,
  7043. f = a.type,
  7044. g = h.style;
  7045. "r" == b && (g.width = 2 * c, g.height = 2 * c);
  7046. "oval" == a.shapeType && ("rx" == b && (g.width = 2 * c), "ry" == b && (g.height = 2 * c));
  7047. "roundrect" == a.shapeType && ("width" != b && "height" != b || --c);
  7048. "cursor" == b && (g.cursor = c);
  7049. "cx" == b && (g.left = c - d.removePx(g.width) / 2);
  7050. "cy" == b && (g.top = c - d.removePx(g.height) / 2);
  7051. var k = this.styleMap[b];
  7052. void 0 !== k && (g[k] = c);
  7053. "text" == f && ("text-anchor" == b && (a.anchor = c, k = h.clientWidth, "end" == c && (g.marginLeft = -k + "px"), "middle" == c && (g.marginLeft = -(k / 2) + "px", g.textAlign = "center"),
  7054. "start" == c && (g.marginLeft = "0px")), "fill" == b && (g.color = c), "font-weight" == b && (g.fontWeight = c));
  7055. if (g = a.children)
  7056. for (k = 0; k < g.length; k++) g[k].setAttr(b, c);
  7057. if ("shape" == f) {
  7058. "cs" == b && (h.style.width = "100px", h.style.height = "100px", h.setAttribute("coordsize", c));
  7059. "d" == b && h.setAttribute("path", this.svgPathToVml(c));
  7060. "dd" == b && h.setAttribute("path", c);
  7061. f = a.stroke;
  7062. a = a.fill;
  7063. "stroke" == b && (e ? f.color = c : f.setAttribute("color", c));
  7064. "stroke-width" == b && (e ? f.weight = c : f.setAttribute("weight", c));
  7065. "stroke-opacity" == b && (e ? f.opacity =
  7066. c : f.setAttribute("opacity", c));
  7067. "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));
  7068. if ("fill-opacity" == b || "opacity" == b) 0 === c ? e ? a.on = !1 : a.setAttribute("on", !1) : e ? a.opacity = c : a.setAttribute("opacity", c);
  7069. "fill" == b && (e ? a.color = c : a.setAttribute("color", c));
  7070. "rx" == b && (e ? h.arcSize = c + "%" : h.setAttribute("arcsize", c + "%"))
  7071. }
  7072. }
  7073. },
  7074. attr: function (a, b) {
  7075. for (var c in b) b.hasOwnProperty(c) && this.setAttr(a, c, b[c])
  7076. },
  7077. text: function (a,
  7078. b, c) {
  7079. var e = new d.AmDObject("text", this.D),
  7080. h = e.node;
  7081. h.style.whiteSpace = "pre";
  7082. h.innerHTML = a;
  7083. this.D.addToContainer(h, c);
  7084. this.attr(e, b);
  7085. return e
  7086. },
  7087. getBBox: function (a) {
  7088. return this.getBox(a.node)
  7089. },
  7090. getBox: function (a) {
  7091. var b = a.offsetLeft,
  7092. c = a.offsetTop,
  7093. d = a.offsetWidth,
  7094. h = a.offsetHeight,
  7095. f;
  7096. if (a.hasChildNodes()) {
  7097. var g, k, l;
  7098. for (l = 0; l < a.childNodes.length; l++) {
  7099. f = this.getBox(a.childNodes[l]);
  7100. var m = f.x;
  7101. isNaN(m) || (isNaN(g) ? g = m : m < g && (g = m));
  7102. var n = f.y;
  7103. isNaN(n) || (isNaN(k) ? k = n : n < k && (k = n));
  7104. m = f.width + m;
  7105. isNaN(m) || (d = Math.max(d,
  7106. m));
  7107. f = f.height + n;
  7108. isNaN(f) || (h = Math.max(h, f))
  7109. }
  7110. 0 > g && (b += g);
  7111. 0 > k && (c += k)
  7112. }
  7113. return {
  7114. x: b,
  7115. y: c,
  7116. width: d,
  7117. height: h
  7118. }
  7119. },
  7120. setText: function (a, b) {
  7121. var c = a.node;
  7122. c && (c.innerHTML = b);
  7123. this.setAttr(a, "text-anchor", a.anchor)
  7124. },
  7125. addListener: function (a, b, c) {
  7126. a.node["on" + b] = c
  7127. },
  7128. move: function (a, b, c) {
  7129. var e = a.node,
  7130. h = e.style;
  7131. "text" == a.type && (c -= d.removePx(h.fontSize) / 2 - 1);
  7132. "oval" == a.shapeType && (b -= d.removePx(h.width) / 2, c -= d.removePx(h.height) / 2);
  7133. a = a.bw;
  7134. isNaN(a) || (b -= a, c -= a);
  7135. isNaN(b) || isNaN(c) || (e.style.left = b + "px", e.style.top = c + "px")
  7136. },
  7137. svgPathToVml: function (a) {
  7138. var b =
  7139. a.split(" ");
  7140. a = "";
  7141. var c, d = Math.round,
  7142. h;
  7143. for (h = 0; h < b.length; h++) {
  7144. var f = b[h],
  7145. g = f.substring(0, 1),
  7146. f = f.substring(1),
  7147. k = f.split(","),
  7148. l = d(k[0]) + "," + d(k[1]);
  7149. "M" == g && (a += " m " + l);
  7150. "L" == g && (a += " l " + l);
  7151. "Z" == g && (a += " x e");
  7152. if ("Q" == g) {
  7153. var m = c.length,
  7154. n = c[m - 1],
  7155. q = k[0],
  7156. p = k[1],
  7157. l = k[2],
  7158. r = k[3];
  7159. c = d(c[m - 2] / 3 + 2 / 3 * q);
  7160. n = d(n / 3 + 2 / 3 * p);
  7161. q = d(2 / 3 * q + l / 3);
  7162. p = d(2 / 3 * p + r / 3);
  7163. a += " c " + c + "," + n + "," + q + "," + p + "," + l + "," + r
  7164. }
  7165. "A" == g && (a += " wa " + f);
  7166. "B" == g && (a += " at " + f);
  7167. c = k
  7168. }
  7169. return a
  7170. },
  7171. animate: function (a, b, c, d, h) {
  7172. var f = a.node,
  7173. g = this.chart;
  7174. if ("translate" ==
  7175. b) {
  7176. b = c.split(",");
  7177. c = b[1];
  7178. var k = f.offsetTop;
  7179. g.animate(a, "left", f.offsetLeft, b[0], d, h, "px");
  7180. g.animate(a, "top", k, c, d, h, "px")
  7181. }
  7182. },
  7183. clipRect: function (a, b, c, d, h) {
  7184. a = a.node;
  7185. 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)"
  7186. },
  7187. rotate: function (a, b, c) {
  7188. if (0 !== Number(b)) {
  7189. var e = a.node;
  7190. a = e.style;
  7191. c || (c = this.getBGColor(e.parentNode));
  7192. a.backgroundColor = c;
  7193. a.paddingLeft = 1;
  7194. c = b * Math.PI / 180;
  7195. var h = Math.cos(c),
  7196. f = Math.sin(c),
  7197. g = d.removePx(a.left),
  7198. k = d.removePx(a.top),
  7199. l = e.offsetWidth,
  7200. e = e.offsetHeight;
  7201. b /= Math.abs(b);
  7202. a.left = g + l / 2 - l / 2 * Math.cos(c) - b * e / 2 * Math.sin(c) + 3;
  7203. a.top = k - b * l / 2 * Math.sin(c) + b * e / 2 * Math.sin(c);
  7204. a.cssText = a.cssText + "; filter:progid:DXImageTransform.Microsoft.Matrix(M11='" + h + "', M12='" + -f + "', M21='" + f + "', M22='" + h + "', sizingmethod='auto expand');"
  7205. }
  7206. },
  7207. getBGColor: function (a) {
  7208. var b = "#FFFFFF";
  7209. if (a.style) {
  7210. var c = a.style.backgroundColor;
  7211. "" !== c ? b = c : a.parentNode && (b = this.getBGColor(a.parentNode))
  7212. }
  7213. return b
  7214. },
  7215. set: function (a) {
  7216. var b = new d.AmDObject("group",
  7217. this.D);
  7218. this.D.container.appendChild(b.node);
  7219. if (a) {
  7220. var c;
  7221. for (c = 0; c < a.length; c++) b.push(a[c])
  7222. }
  7223. return b
  7224. },
  7225. gradient: function (a, b, c, d) {
  7226. var h = "";
  7227. "radialGradient" == b && (b = "gradientradial", c.reverse());
  7228. "linearGradient" == b && (b = "gradient");
  7229. var f;
  7230. for (f = 0; f < c.length; f++) {
  7231. var g = Math.round(100 * f / (c.length - 1)),
  7232. h = h + (g + "% " + c[f]);
  7233. f < c.length - 1 && (h += ",")
  7234. }
  7235. a = a.fill;
  7236. 90 == d ? d = 0 : 270 == d ? d = 180 : 180 == d ? d = 90 : 0 === d && (d = 270);
  7237. 8 === document.documentMode ? (a.type = b, a.angle = d) : (a.setAttribute("type", b), a.setAttribute("angle", d));
  7238. h && (a.colors.value =
  7239. h)
  7240. },
  7241. remove: function (a) {
  7242. a.clipPath && this.D.remove(a.clipPath);
  7243. this.D.remove(a.node)
  7244. },
  7245. disableSelection: function (a) {
  7246. void 0 !== typeof a.onselectstart && (a.onselectstart = function () {
  7247. return !1
  7248. });
  7249. a.style.cursor = "default"
  7250. },
  7251. pattern: function (a, b, c, e) {
  7252. c = a.node;
  7253. a = a.fill;
  7254. var h = "none";
  7255. b.color && (h = b.color);
  7256. c.fillColor = h;
  7257. b = b.url;
  7258. d.isAbsolute(b) || (b = e + b);
  7259. 8 === document.documentMode ? (a.type = "tile", a.src = b) : (a.setAttribute("type", "tile"), a.setAttribute("src", b))
  7260. },
  7261. update: function () {}
  7262. })
  7263. })();
  7264. (function () {
  7265. var d = window.AmCharts;
  7266. d.SVGRenderer = d.Class({
  7267. construct: function (a) {
  7268. this.D = a;
  7269. this.animations = []
  7270. },
  7271. create: function (a, b) {
  7272. return document.createElementNS(d.SVG_NS, b)
  7273. },
  7274. attr: function (a, b) {
  7275. for (var c in b) b.hasOwnProperty(c) && this.setAttr(a, c, b[c])
  7276. },
  7277. setAttr: function (a, b, c) {
  7278. void 0 !== c && a.node.setAttribute(b, c)
  7279. },
  7280. animate: function (a, b, c, e, h) {
  7281. var f = a.node;
  7282. a["an_" + b] && d.removeFromArray(this.animations, a["an_" + b]);
  7283. "translate" == b ? (f = (f = f.getAttribute("transform")) ? String(f).substring(10, f.length - 1) : "0,0",
  7284. f = f.split(", ").join(" "), f = f.split(" ").join(","), 0 === f && (f = "0,0")) : f = Number(f.getAttribute(b));
  7285. c = {
  7286. obj: a,
  7287. frame: 0,
  7288. attribute: b,
  7289. from: f,
  7290. to: c,
  7291. time: e,
  7292. effect: h
  7293. };
  7294. this.animations.push(c);
  7295. a["an_" + b] = c
  7296. },
  7297. update: function () {
  7298. var a, b = this.animations;
  7299. for (a = b.length - 1; 0 <= a; a--) {
  7300. var c = b[a],
  7301. e = 1E3 * c.time / d.updateRate,
  7302. h = c.frame + 1,
  7303. f = c.obj,
  7304. g = c.attribute,
  7305. k, l, m;
  7306. 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 = 0 === m - g ? m : Math.round(d[c.effect](0,
  7307. 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)), this.animations.splice(a, 1))
  7308. }
  7309. },
  7310. getBBox: function (a) {
  7311. if (a = a.node) try {
  7312. return a.getBBox()
  7313. } catch (b) {}
  7314. return {
  7315. width: 0,
  7316. height: 0,
  7317. x: 0,
  7318. y: 0
  7319. }
  7320. },
  7321. path: function (a,
  7322. b) {
  7323. a.node.setAttributeNS(d.SVG_XLINK, "xlink:href", b)
  7324. },
  7325. clipRect: function (a, b, c, e, h) {
  7326. var f = a.node,
  7327. g = a.clipPath;
  7328. g && this.D.remove(g);
  7329. var k = f.parentNode;
  7330. 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)
  7331. },
  7332. text: function (a, b, c) {
  7333. var e = new d.AmDObject("text", this.D);
  7334. a = String(a).split("\n");
  7335. var h = b["font-size"],
  7336. f;
  7337. for (f = 0; f < a.length; f++) {
  7338. var g = this.create(null, "tspan");
  7339. g.appendChild(document.createTextNode(a[f]));
  7340. g.setAttribute("y", (h + 2) * f + Math.round(h / 2));
  7341. g.setAttribute("x", 0);
  7342. g.style.fontSize = h + "px";
  7343. e.node.appendChild(g)
  7344. }
  7345. e.node.setAttribute("y", Math.round(h / 2));
  7346. this.attr(e, b);
  7347. this.D.addToContainer(e.node, c);
  7348. return e
  7349. },
  7350. setText: function (a, b) {
  7351. var c = a.node;
  7352. c && (c.removeChild(c.firstChild), c.appendChild(document.createTextNode(b)))
  7353. },
  7354. move: function (a, b, c, d) {
  7355. isNaN(b) && (b = 0);
  7356. isNaN(c) && (c = 0);
  7357. b =
  7358. "translate(" + b + "," + c + ")";
  7359. d && (b = b + " scale(" + d + ")");
  7360. this.setAttr(a, "transform", b)
  7361. },
  7362. rotate: function (a, b) {
  7363. var c = a.node.getAttribute("transform"),
  7364. d = "rotate(" + b + ")";
  7365. c && (d = c + " " + d);
  7366. this.setAttr(a, "transform", d)
  7367. },
  7368. set: function (a) {
  7369. var b = new d.AmDObject("g", this.D);
  7370. this.D.container.appendChild(b.node);
  7371. if (a) {
  7372. var c;
  7373. for (c = 0; c < a.length; c++) b.push(a[c])
  7374. }
  7375. return b
  7376. },
  7377. addListener: function (a, b, c) {
  7378. a.node["on" + b] = c
  7379. },
  7380. gradient: function (a, b, c, e) {
  7381. var h = a.node,
  7382. f = a.grad;
  7383. f && this.D.remove(f);
  7384. b = document.createElementNS(d.SVG_NS,
  7385. b);
  7386. f = d.getUniqueId();
  7387. b.setAttribute("id", f);
  7388. if (!isNaN(e)) {
  7389. var g = 0,
  7390. k = 0,
  7391. l = 0,
  7392. m = 0;
  7393. 90 == e ? l = 100 : 270 == e ? m = 100 : 180 == e ? g = 100 : 0 === e && (k = 100);
  7394. b.setAttribute("x1", g + "%");
  7395. b.setAttribute("x2", k + "%");
  7396. b.setAttribute("y1", l + "%");
  7397. b.setAttribute("y2", m + "%")
  7398. }
  7399. 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);
  7400. h.parentNode.appendChild(b);
  7401. c = "#";
  7402. d.baseHref && !d.isIE && (c = this.removeTarget(window.location.href) +
  7403. c);
  7404. h.setAttribute("fill", "url(" + c + f + ")");
  7405. a.grad = b
  7406. },
  7407. removeTarget: function (a) {
  7408. return a.split("#")[0]
  7409. },
  7410. pattern: function (a, b, c, e) {
  7411. var h = a.node;
  7412. isNaN(c) && (c = 1);
  7413. var f = a.patternNode;
  7414. f && this.D.remove(f);
  7415. var f = document.createElementNS(d.SVG_NS, "pattern"),
  7416. g = d.getUniqueId(),
  7417. k = b;
  7418. b.url && (k = b.url);
  7419. d.isAbsolute(k) || (k = e + k);
  7420. e = Number(b.width);
  7421. isNaN(e) && (e = 4);
  7422. var l = Number(b.height);
  7423. isNaN(l) && (l = 4);
  7424. e /= c;
  7425. l /= c;
  7426. c = b.x;
  7427. isNaN(c) && (c = 0);
  7428. var m = -Math.random() * Number(b.randomX);
  7429. isNaN(m) || (c = m);
  7430. m = b.y;
  7431. isNaN(m) && (m = 0);
  7432. var n = -Math.random() *
  7433. Number(b.randomY);
  7434. isNaN(n) || (m = n);
  7435. f.setAttribute("id", g);
  7436. f.setAttribute("width", e);
  7437. f.setAttribute("height", l);
  7438. f.setAttribute("patternUnits", "userSpaceOnUse");
  7439. f.setAttribute("xlink:href", k);
  7440. 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));
  7441. this.D.image(k, 0, 0, e, l, f).translate(c, m);
  7442. k = "#";
  7443. d.baseHref && !d.isIE && (k = this.removeTarget(window.location.href) + k);
  7444. h.setAttribute("fill",
  7445. "url(" + k + g + ")");
  7446. a.patternNode = f;
  7447. h.parentNode.appendChild(f)
  7448. },
  7449. remove: function (a) {
  7450. a.clipPath && this.D.remove(a.clipPath);
  7451. a.grad && this.D.remove(a.grad);
  7452. a.patternNode && this.D.remove(a.patternNode);
  7453. this.D.remove(a.node)
  7454. }
  7455. })
  7456. })();
  7457. AmCharts.AmDSet = AmCharts.Class({
  7458. construct: function (d) {
  7459. this.create("g")
  7460. },
  7461. attr: function (d) {
  7462. this.R.attr(this.node, d)
  7463. },
  7464. move: function (d, a) {
  7465. this.R.move(this.node, d, a)
  7466. }
  7467. });
  7468. (function () {
  7469. var d = window.AmCharts;
  7470. d.AmLegend = d.Class({
  7471. construct: function (a) {
  7472. this.enabled = !0;
  7473. this.cname = "AmLegend";
  7474. this.createEvents("rollOverMarker", "rollOverItem", "rollOutMarker", "rollOutItem", "showItem", "hideItem", "clickMarker", "rollOverItem", "rollOutItem", "clickLabel");
  7475. this.position = "bottom";
  7476. this.borderColor = this.color = "#000000";
  7477. this.borderAlpha = 0;
  7478. this.markerLabelGap = 5;
  7479. this.verticalGap = 10;
  7480. this.align = "left";
  7481. this.horizontalGap = 0;
  7482. this.spacing = 10;
  7483. this.markerDisabledColor = "#AAB3B3";
  7484. this.markerType =
  7485. "square";
  7486. this.markerSize = 16;
  7487. this.markerBorderThickness = this.markerBorderAlpha = 1;
  7488. this.marginBottom = this.marginTop = 0;
  7489. this.marginLeft = this.marginRight = 20;
  7490. this.autoMargins = !0;
  7491. this.valueWidth = 50;
  7492. this.switchable = !0;
  7493. this.switchType = "x";
  7494. this.switchColor = "#FFFFFF";
  7495. this.rollOverColor = "#CC0000";
  7496. this.reversedOrder = !1;
  7497. this.labelText = "[[title]]";
  7498. this.valueText = "[[value]]";
  7499. this.useMarkerColorForLabels = !1;
  7500. this.rollOverGraphAlpha = 1;
  7501. this.textClickEnabled = !1;
  7502. this.equalWidths = !0;
  7503. this.dateFormat = "DD-MM-YYYY";
  7504. this.backgroundColor =
  7505. "#FFFFFF";
  7506. this.backgroundAlpha = 0;
  7507. this.useGraphSettings = !1;
  7508. this.showEntries = !0;
  7509. d.applyTheme(this, a, this.cname)
  7510. },
  7511. setData: function (a) {
  7512. this.legendData = a;
  7513. this.invalidateSize()
  7514. },
  7515. invalidateSize: function () {
  7516. this.destroy();
  7517. this.entries = [];
  7518. this.valueLabels = [];
  7519. var a = this.legendData;
  7520. this.enabled && (d.ifArray(a) || d.ifArray(this.data)) && this.drawLegend()
  7521. },
  7522. drawLegend: function () {
  7523. var a = this.chart,
  7524. b = this.position,
  7525. c = this.width,
  7526. e = a.divRealWidth,
  7527. h = a.divRealHeight,
  7528. f = this.div,
  7529. g = this.legendData;
  7530. this.data && (g = this.data);
  7531. isNaN(this.fontSize) &&
  7532. (this.fontSize = a.fontSize);
  7533. if ("right" == b || "left" == b) this.maxColumns = 1, this.autoMargins && (this.marginLeft = this.marginRight = 10);
  7534. else if (this.autoMargins) {
  7535. this.marginRight = a.marginRight;
  7536. this.marginLeft = a.marginLeft;
  7537. var k = a.autoMarginOffset;
  7538. "bottom" == b ? (this.marginBottom = k, this.marginTop = 0) : (this.marginTop = k, this.marginBottom = 0)
  7539. }
  7540. c = void 0 !== c ? d.toCoordinate(c, e) : a.realWidth;
  7541. "outside" == b ? (c = f.offsetWidth, h = f.offsetHeight, f.clientHeight && (c = f.clientWidth, h = f.clientHeight)) : (isNaN(c) || (f.style.width = c + "px"),
  7542. f.className = "amChartsLegend " + a.classNamePrefix + "-legend-div");
  7543. this.divWidth = c;
  7544. (b = this.container) ? (b.container.innerHTML = "", f.appendChild(b.container), b.width = c, b.height = h, b.addDefs(a)) : b = new d.AmDraw(f, c, h, a);
  7545. this.container = b;
  7546. this.lx = 0;
  7547. this.ly = 8;
  7548. h = this.markerSize;
  7549. h > this.fontSize && (this.ly = h / 2 - 1);
  7550. 0 < h && (this.lx += h + this.markerLabelGap);
  7551. this.titleWidth = 0;
  7552. if (h = this.title) h = d.text(this.container, h, this.color, a.fontFamily, this.fontSize, "start", !0), d.setCN(a, h, "legend-title"), h.translate(this.marginLeft,
  7553. this.marginTop + this.verticalGap + this.ly + 1), a = h.getBBox(), this.titleWidth = a.width + 15, this.titleHeight = a.height + 6;
  7554. this.index = this.maxLabelWidth = 0;
  7555. if (this.showEntries) {
  7556. for (a = 0; a < g.length; a++) this.createEntry(g[a]);
  7557. for (a = this.index = 0; a < g.length; a++) this.createValue(g[a])
  7558. }
  7559. this.arrangeEntries();
  7560. this.updateValues()
  7561. },
  7562. arrangeEntries: function () {
  7563. var a = this.position,
  7564. b = this.marginLeft + this.titleWidth,
  7565. c = this.marginRight,
  7566. e = this.marginTop,
  7567. h = this.marginBottom,
  7568. f = this.horizontalGap,
  7569. g = this.div,
  7570. k = this.divWidth,
  7571. l = this.maxColumns,
  7572. m = this.verticalGap,
  7573. n = this.spacing,
  7574. q = k - c - b,
  7575. p = 0,
  7576. r = 0,
  7577. t = this.container;
  7578. this.set && this.set.remove();
  7579. var u = t.set();
  7580. this.set = u;
  7581. var z = t.set();
  7582. u.push(z);
  7583. var w = this.entries,
  7584. x, v;
  7585. for (v = 0; v < w.length; v++) {
  7586. x = w[v].getBBox();
  7587. var A = x.width;
  7588. A > p && (p = A);
  7589. x = x.height;
  7590. x > r && (r = x)
  7591. }
  7592. var A = r = 0,
  7593. B = f,
  7594. D = 0,
  7595. C = 0;
  7596. for (v = 0; v < w.length; v++) {
  7597. var I = w[v];
  7598. this.reversedOrder && (I = w[w.length - v - 1]);
  7599. x = I.getBBox();
  7600. var H;
  7601. this.equalWidths ? H = f + A * (p + n + this.markerLabelGap) : (H = B, B = B + x.width + f + n);
  7602. x.height > C && (C = x.height);
  7603. H + x.width > q && 0 < v && 0 !== A && (r++, A = 0,
  7604. H = f, B = H + x.width + f + n, D = D + C + m, C = 0);
  7605. I.translate(H, D);
  7606. A++;
  7607. !isNaN(l) && A >= l && (A = 0, r++, D = D + C + m, C = 0);
  7608. z.push(I)
  7609. }
  7610. x = z.getBBox();
  7611. l = x.height + 2 * m - 1;
  7612. "left" == a || "right" == a ? (n = x.width + 2 * f, k = n + b + c, g.style.width = k + "px", this.ieW = k) : n = k - b - c - 1;
  7613. c = d.polygon(this.container, [0, n, n, 0], [0, 0, l, l], this.backgroundColor, this.backgroundAlpha, 1, this.borderColor, this.borderAlpha);
  7614. d.setCN(this.chart, c, "legend-bg");
  7615. u.push(c);
  7616. u.translate(b, e);
  7617. c.toBack();
  7618. b = f;
  7619. if ("top" == a || "bottom" == a || "absolute" == a || "outside" == a) "center" == this.align ? b =
  7620. f + (n - x.width) / 2 : "right" == this.align && (b = f + n - x.width);
  7621. z.translate(b, m + 1);
  7622. this.titleHeight > l && (l = this.titleHeight);
  7623. a = l + e + h + 1;
  7624. 0 > a && (a = 0);
  7625. a > this.chart.divRealHeight && (g.style.top = "0px");
  7626. g.style.height = Math.round(a) + "px";
  7627. t.setSize(this.divWidth, a)
  7628. },
  7629. createEntry: function (a) {
  7630. if (!1 !== a.visibleInLegend) {
  7631. var b = this.chart,
  7632. c = a.markerType;
  7633. a.legendEntryWidth = this.markerSize;
  7634. c || (c = this.markerType);
  7635. var e = a.color,
  7636. h = a.alpha;
  7637. a.legendKeyColor && (e = a.legendKeyColor());
  7638. a.legendKeyAlpha && (h = a.legendKeyAlpha());
  7639. var f;
  7640. !0 ===
  7641. a.hidden && (f = e = this.markerDisabledColor);
  7642. var g = a.pattern,
  7643. k = a.customMarker;
  7644. k || (k = this.customMarker);
  7645. var l = this.container,
  7646. m = this.markerSize,
  7647. n = 0,
  7648. q = 0,
  7649. p = m / 2;
  7650. if (this.useGraphSettings) {
  7651. c = a.type;
  7652. this.switchType = void 0;
  7653. 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 || (e = a.bulletColorR), n = d.bullet(l, a.bullet, a.bulletSize,
  7654. 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;
  7655. else {
  7656. var r;
  7657. a.getGradRotation && (r = a.getGradRotation());
  7658. n = a.fillColorsR;
  7659. !0 === a.hidden && (n = e);
  7660. if (g = this.createMarker("rectangle", n, a.fillAlphas, a.lineThickness, e, a.lineAlpha, r, g)) p = m, g.translate(p, m / 2);
  7661. n = m
  7662. }
  7663. d.setCN(b, g, "graph-" + c);
  7664. d.setCN(b, g, "graph-" + a.id)
  7665. } else k ? (b.path && (k = b.path + k), g = l.image(k, 0, 0, m, m)) : (g = this.createMarker(c, e, h, void 0, void 0, void 0, void 0, g)) &&
  7666. g.translate(m / 2, m / 2);
  7667. d.setCN(b, g, "legend-marker");
  7668. this.addListeners(g, a);
  7669. l = l.set([g]);
  7670. this.switchable && a.switchable && l.setAttr("cursor", "pointer");
  7671. void 0 !== a.id && d.setCN(b, l, "legend-item-" + a.id);
  7672. d.setCN(b, l, a.className, !0);
  7673. (f = this.switchType) && "none" != f && 0 < m && ("x" == f ? (c = this.createX(), c.translate(m / 2, m / 2)) : c = this.createV(), c.dItem = a, !0 !== a.hidden ? "x" == f ? c.hide() : c.show() : "x" != f && c.hide(), this.switchable || c.hide(), this.addListeners(c, a), a.legendSwitch = c, l.push(c), d.setCN(b, c, "legend-switch"));
  7674. f = this.color;
  7675. a.showBalloon && this.textClickEnabled && void 0 !== this.selectedColor && (f = this.selectedColor);
  7676. this.useMarkerColorForLabels && (f = e);
  7677. !0 === a.hidden && (f = this.markerDisabledColor);
  7678. e = d.massReplace(this.labelText, {
  7679. "[[title]]": a.title
  7680. });
  7681. c = this.fontSize;
  7682. g && (m <= c && g.translate(p, m / 2 + this.ly - c / 2 + (c + 2 - m) / 2 - q), a.legendEntryWidth = g.getBBox().width);
  7683. var t;
  7684. e && (e = d.fixBrakes(e), a.legendTextReal = e, t = this.labelWidth, t = isNaN(t) ? d.text(this.container, e, f, b.fontFamily, c, "start") : d.wrappedText(this.container, e, f, b.fontFamily,
  7685. c, "start", !1, t, 0), d.setCN(b, t, "legend-label"), t.translate(this.lx + n, this.ly), l.push(t), b = t.getBBox().width, this.maxLabelWidth < b && (this.maxLabelWidth = b));
  7686. this.entries[this.index] = l;
  7687. a.legendEntry = this.entries[this.index];
  7688. a.legendLabel = t;
  7689. this.index++
  7690. }
  7691. },
  7692. addListeners: function (a, b) {
  7693. var c = this;
  7694. a && a.mouseover(function (a) {
  7695. c.rollOverMarker(b, a)
  7696. }).mouseout(function (a) {
  7697. c.rollOutMarker(b, a)
  7698. }).click(function (a) {
  7699. c.clickMarker(b, a)
  7700. })
  7701. },
  7702. rollOverMarker: function (a, b) {
  7703. this.switchable && this.dispatch("rollOverMarker", a,
  7704. b);
  7705. this.dispatch("rollOverItem", a, b)
  7706. },
  7707. rollOutMarker: function (a, b) {
  7708. this.switchable && this.dispatch("rollOutMarker", a, b);
  7709. this.dispatch("rollOutItem", a, b)
  7710. },
  7711. clickMarker: function (a, b) {
  7712. this.switchable && (!0 === a.hidden ? this.dispatch("showItem", a, b) : this.dispatch("hideItem", a, b));
  7713. this.dispatch("clickMarker", a, b)
  7714. },
  7715. rollOverLabel: function (a, b) {
  7716. a.hidden || (this.textClickEnabled && a.legendLabel && a.legendLabel.attr({
  7717. fill: this.rollOverColor
  7718. }), this.dispatch("rollOverItem", a, b))
  7719. },
  7720. rollOutLabel: function (a, b) {
  7721. if (!a.hidden) {
  7722. if (this.textClickEnabled &&
  7723. a.legendLabel) {
  7724. var c = this.color;
  7725. void 0 !== this.selectedColor && a.showBalloon && (c = this.selectedColor);
  7726. this.useMarkerColorForLabels && (c = a.lineColor, void 0 === c && (c = a.color));
  7727. a.legendLabel.attr({
  7728. fill: c
  7729. })
  7730. }
  7731. this.dispatch("rollOutItem", a, b)
  7732. }
  7733. },
  7734. clickLabel: function (a, b) {
  7735. this.textClickEnabled ? a.hidden || this.dispatch("clickLabel", a, b) : this.switchable && (!0 === a.hidden ? this.dispatch("showItem", a, b) : this.dispatch("hideItem", a, b))
  7736. },
  7737. dispatch: function (a, b, c) {
  7738. this.fire(a, {
  7739. type: a,
  7740. dataItem: b,
  7741. target: this,
  7742. event: c,
  7743. chart: this.chart
  7744. })
  7745. },
  7746. createValue: function (a) {
  7747. var b = this,
  7748. c = b.fontSize,
  7749. e = b.chart;
  7750. if (!1 !== a.visibleInLegend) {
  7751. var h = b.maxLabelWidth;
  7752. b.forceWidth && (h = b.labelWidth);
  7753. b.equalWidths || (b.valueAlign = "left");
  7754. "left" == b.valueAlign && (h = a.legendEntry.getBBox().width);
  7755. var f = h;
  7756. if (b.valueText && 0 < b.valueWidth) {
  7757. var g = b.color;
  7758. b.useMarkerColorForValues && (g = a.color, a.legendKeyColor && (g = a.legendKeyColor()));
  7759. !0 === a.hidden && (g = b.markerDisabledColor);
  7760. var k = b.valueText,
  7761. h = h + b.lx + b.markerLabelGap + b.valueWidth,
  7762. l = "end";
  7763. "left" == b.valueAlign && (h -= b.valueWidth,
  7764. l = "start");
  7765. g = d.text(b.container, k, g, b.chart.fontFamily, c, l);
  7766. d.setCN(e, g, "legend-value");
  7767. g.translate(h, b.ly);
  7768. b.entries[b.index].push(g);
  7769. f += b.valueWidth + 2 * b.markerLabelGap;
  7770. g.dItem = a;
  7771. b.valueLabels.push(g)
  7772. }
  7773. b.index++;
  7774. e = b.markerSize;
  7775. e < c + 7 && (e = c + 7, d.VML && (e += 3));
  7776. c = b.container.rect(a.legendEntryWidth, 0, f, e, 0, 0).attr({
  7777. stroke: "none",
  7778. fill: "#fff",
  7779. "fill-opacity": .005
  7780. });
  7781. c.dItem = a;
  7782. b.entries[b.index - 1].push(c);
  7783. c.mouseover(function (c) {
  7784. b.rollOverLabel(a, c)
  7785. }).mouseout(function (c) {
  7786. b.rollOutLabel(a, c)
  7787. }).click(function (c) {
  7788. b.clickLabel(a,
  7789. c)
  7790. })
  7791. }
  7792. },
  7793. createV: function () {
  7794. var a = this.markerSize;
  7795. 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)
  7796. },
  7797. createX: function () {
  7798. var a = (this.markerSize - 4) / 2,
  7799. b = {
  7800. stroke: this.switchColor,
  7801. "stroke-width": 3
  7802. },
  7803. c = this.container,
  7804. e = d.line(c, [-a, a], [-a, a]).attr(b),
  7805. a = d.line(c, [-a, a], [a, -a]).attr(b);
  7806. return this.container.set([e, a])
  7807. },
  7808. createMarker: function (a, b, c, e, h, f, g, k) {
  7809. var l = this.markerSize,
  7810. m = this.container;
  7811. h || (h = this.markerBorderColor);
  7812. h || (h = b);
  7813. isNaN(e) && (e = this.markerBorderThickness);
  7814. isNaN(f) && (f = this.markerBorderAlpha);
  7815. return d.bullet(m, a, l, b, c, e, h, f, l, g, k, this.chart.path)
  7816. },
  7817. validateNow: function () {
  7818. this.invalidateSize()
  7819. },
  7820. updateValues: function () {
  7821. var a = this.valueLabels,
  7822. b = this.chart,
  7823. c, d = this.data;
  7824. for (c = 0; c < a.length; c++) {
  7825. var h = a[c],
  7826. f = h.dItem,
  7827. g = " ";
  7828. if (d) f.value ? h.text(f.value) : h.text("");
  7829. else {
  7830. var k;
  7831. if (void 0 !== f.type) {
  7832. k = f.currentDataItem;
  7833. var l = this.periodValueText;
  7834. f.legendPeriodValueText && (l = f.legendPeriodValueText);
  7835. k ? (g = this.valueText, f.legendValueText && (g = f.legendValueText), g = b.formatString(g,
  7836. k)) : l && (g = b.formatPeriodString(l, f))
  7837. } else g = b.formatString(this.valueText, f);
  7838. if (l = this.valueFunction) k && (f = k), g = l(f, g);
  7839. h.text(g)
  7840. }
  7841. }
  7842. },
  7843. renderFix: function () {
  7844. if (!d.VML) {
  7845. var a = this.container;
  7846. a && a.renderFix()
  7847. }
  7848. },
  7849. destroy: function () {
  7850. this.div.innerHTML = "";
  7851. d.remove(this.set)
  7852. }
  7853. })
  7854. })();
  7855. (function () {
  7856. var d = window.AmCharts;
  7857. d.formatMilliseconds = function (a, b) {
  7858. if (-1 != a.indexOf("fff")) {
  7859. var c = b.getMilliseconds(),
  7860. d = String(c);
  7861. 10 > c && (d = "00" + c);
  7862. 10 <= c && 100 > c && (d = "0" + c);
  7863. a = a.replace(/fff/g, d)
  7864. }
  7865. return a
  7866. };
  7867. d.extractPeriod = function (a) {
  7868. var b = d.stripNumbers(a),
  7869. c = 1;
  7870. b != a && (c = Number(a.slice(0, a.indexOf(b))));
  7871. return {
  7872. period: b,
  7873. count: c
  7874. }
  7875. };
  7876. d.getDate = function (a, b, c) {
  7877. return a instanceof Date ? d.newDate(a, c) : b && isNaN(a) ? d.stringToDate(a, b) : new Date(a)
  7878. };
  7879. d.newDate = function (a, b) {
  7880. return b && "fff" != b ? new Date(a) : d.useUTC ?
  7881. new Date(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate(), a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()) : new Date(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds(), a.getMilliseconds())
  7882. };
  7883. d.resetDateToMin = function (a, b, c, e) {
  7884. void 0 === e && (e = 1);
  7885. var h, f, g, k, l, m, n;
  7886. 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(),
  7887. f = a.getMonth(), g = a.getDate(), k = a.getHours(), l = a.getMinutes(), m = a.getSeconds(), n = a.getMilliseconds(), a = a.getDay());
  7888. switch (b) {
  7889. case "YYYY":
  7890. h = Math.floor(h / c) * c;
  7891. f = 0;
  7892. g = 1;
  7893. n = m = l = k = 0;
  7894. break;
  7895. case "MM":
  7896. f = Math.floor(f / c) * c;
  7897. g = 1;
  7898. n = m = l = k = 0;
  7899. break;
  7900. case "WW":
  7901. g = a >= e ? g - a + e : g - (7 + a) + e;
  7902. n = m = l = k = 0;
  7903. break;
  7904. case "DD":
  7905. n = m = l = k = 0;
  7906. break;
  7907. case "hh":
  7908. k = Math.floor(k / c) * c;
  7909. n = m = l = 0;
  7910. break;
  7911. case "mm":
  7912. l = Math.floor(l / c) * c;
  7913. n = m = 0;
  7914. break;
  7915. case "ss":
  7916. m = Math.floor(m / c) * c;
  7917. n = 0;
  7918. break;
  7919. case "fff":
  7920. n = Math.floor(n / c) * c
  7921. }
  7922. d.useUTC ? (a = new Date, a.setUTCFullYear(h,
  7923. f, g), a.setUTCHours(k, l, m, n)) : a = new Date(h, f, g, k, l, m, n);
  7924. return a
  7925. };
  7926. d.getPeriodDuration = function (a, b) {
  7927. void 0 === b && (b = 1);
  7928. var c;
  7929. switch (a) {
  7930. case "YYYY":
  7931. c = 316224E5;
  7932. break;
  7933. case "MM":
  7934. c = 26784E5;
  7935. break;
  7936. case "WW":
  7937. c = 6048E5;
  7938. break;
  7939. case "DD":
  7940. c = 864E5;
  7941. break;
  7942. case "hh":
  7943. c = 36E5;
  7944. break;
  7945. case "mm":
  7946. c = 6E4;
  7947. break;
  7948. case "ss":
  7949. c = 1E3;
  7950. break;
  7951. case "fff":
  7952. c = 1
  7953. }
  7954. return c * b
  7955. };
  7956. d.intervals = {
  7957. s: {
  7958. nextInterval: "ss",
  7959. contains: 1E3
  7960. },
  7961. ss: {
  7962. nextInterval: "mm",
  7963. contains: 60,
  7964. count: 0
  7965. },
  7966. mm: {
  7967. nextInterval: "hh",
  7968. contains: 60,
  7969. count: 1
  7970. },
  7971. hh: {
  7972. nextInterval: "DD",
  7973. contains: 24,
  7974. count: 2
  7975. },
  7976. DD: {
  7977. nextInterval: "",
  7978. contains: Infinity,
  7979. count: 3
  7980. }
  7981. };
  7982. d.getMaxInterval = function (a, b) {
  7983. var c = d.intervals;
  7984. 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
  7985. };
  7986. d.dayNames = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ");
  7987. d.shortDayNames = "Sun Mon Tue Wed Thu Fri Sat".split(" ");
  7988. d.monthNames = "January February March April May June July August September October November December".split(" ");
  7989. d.shortMonthNames = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");
  7990. d.getWeekNumber = function (a) {
  7991. a = new Date(a);
  7992. a.setHours(0, 0, 0);
  7993. a.setDate(a.getDate() + 4 - (a.getDay() || 7));
  7994. var b = new Date(a.getFullYear(), 0, 1);
  7995. return Math.ceil(((a - b) / 864E5 + 1) / 7)
  7996. };
  7997. d.stringToDate = function (a, b) {
  7998. var c = {},
  7999. e = [{
  8000. pattern: "YYYY",
  8001. period: "year"
  8002. }, {
  8003. pattern: "YY",
  8004. period: "year"
  8005. }, {
  8006. pattern: "MM",
  8007. period: "month"
  8008. }, {
  8009. pattern: "M",
  8010. period: "month"
  8011. }, {
  8012. pattern: "DD",
  8013. period: "date"
  8014. }, {
  8015. pattern: "D",
  8016. period: "date"
  8017. }, {
  8018. pattern: "JJ",
  8019. period: "hours"
  8020. }, {
  8021. pattern: "J",
  8022. period: "hours"
  8023. }, {
  8024. pattern: "HH",
  8025. period: "hours"
  8026. }, {
  8027. pattern: "H",
  8028. period: "hours"
  8029. },
  8030. {
  8031. pattern: "KK",
  8032. period: "hours"
  8033. }, {
  8034. pattern: "K",
  8035. period: "hours"
  8036. }, {
  8037. pattern: "LL",
  8038. period: "hours"
  8039. }, {
  8040. pattern: "L",
  8041. period: "hours"
  8042. }, {
  8043. pattern: "NN",
  8044. period: "minutes"
  8045. }, {
  8046. pattern: "N",
  8047. period: "minutes"
  8048. }, {
  8049. pattern: "SS",
  8050. period: "seconds"
  8051. }, {
  8052. pattern: "S",
  8053. period: "seconds"
  8054. }, {
  8055. pattern: "QQQ",
  8056. period: "milliseconds"
  8057. }, {
  8058. pattern: "QQ",
  8059. period: "milliseconds"
  8060. }, {
  8061. pattern: "Q",
  8062. period: "milliseconds"
  8063. }
  8064. ],
  8065. h = !0,
  8066. f = b.indexOf("AA"); - 1 != f && (a.substr(f, 2), "pm" == a.toLowerCase && (h = !1));
  8067. var f = b,
  8068. g, k, l;
  8069. for (l = 0; l < e.length; l++) k = e[l].period, c[k] = 0, "date" == k && (c[k] =
  8070. 1);
  8071. for (l = 0; l < e.length; l++)
  8072. if (g = e[l].pattern, k = e[l].period, -1 != b.indexOf(g)) {
  8073. var m = d.getFromDateString(g, a, f);
  8074. b = b.replace(g, "");
  8075. if ("KK" == g || "K" == g || "LL" == g || "L" == g) h || (m += 12);
  8076. c[k] = m
  8077. } 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);
  8078. return e
  8079. };
  8080. d.getFromDateString = function (a, b, c) {
  8081. if (void 0 !== b) return c = c.indexOf(a), b = String(b), b = b.substr(c, a.length), "0" == b.charAt(0) &&
  8082. (b = b.substr(1, b.length - 1)), b = Number(b), isNaN(b) && (b = 0), -1 != a.indexOf("M") && b--, b
  8083. };
  8084. d.formatDate = function (a, b, c) {
  8085. c || (c = d);
  8086. var e, h, f, g, k, l, m, n = d.getWeekNumber(a);
  8087. d.useUTC ? (e = a.getUTCFullYear(), h = a.getUTCMonth(), f = a.getUTCDate(), g = a.getUTCDay(), k = a.getUTCHours(), l = a.getUTCMinutes(), m = a.getUTCSeconds(), a = a.getUTCMilliseconds()) : (e = a.getFullYear(), h = a.getMonth(), f = a.getDate(), g = a.getDay(), k = a.getHours(), l = a.getMinutes(), m = a.getSeconds(), a = a.getMilliseconds());
  8088. var q = String(e).substr(2, 2),
  8089. p = h + 1;
  8090. 9 > h && (p = "0" +
  8091. p);
  8092. var r = "0" + g;
  8093. b = b.replace(/W/g, n);
  8094. n = k;
  8095. 24 == n && (n = 0);
  8096. var t = n;
  8097. 10 > t && (t = "0" + t);
  8098. b = b.replace(/JJ/g, t);
  8099. b = b.replace(/J/g, n);
  8100. t = k;
  8101. 0 === t && (t = 24, -1 != b.indexOf("H") && f--);
  8102. n = f;
  8103. 10 > f && (n = "0" + f);
  8104. var u = t;
  8105. 10 > u && (u = "0" + u);
  8106. b = b.replace(/HH/g, u);
  8107. b = b.replace(/H/g, t);
  8108. t = k;
  8109. 11 < t && (t -= 12);
  8110. u = t;
  8111. 10 > u && (u = "0" + u);
  8112. b = b.replace(/KK/g, u);
  8113. b = b.replace(/K/g, t);
  8114. t = k;
  8115. 0 === t && (t = 12);
  8116. 12 < t && (t -= 12);
  8117. u = t;
  8118. 10 > u && (u = "0" + u);
  8119. b = b.replace(/LL/g, u);
  8120. b = b.replace(/L/g, t);
  8121. t = l;
  8122. 10 > t && (t = "0" + t);
  8123. b = b.replace(/NN/g, t);
  8124. b = b.replace(/N/g, l);
  8125. l = m;
  8126. 10 > l && (l = "0" + l);
  8127. b = b.replace(/SS/g,
  8128. l);
  8129. b = b.replace(/S/g, m);
  8130. m = a;
  8131. 10 > m && (m = "00" + m);
  8132. 100 > m && (m = "0" + m);
  8133. l = a;
  8134. 10 > l && (l = "00" + l);
  8135. b = b.replace(/QQQ/g, m);
  8136. b = b.replace(/QQ/g, l);
  8137. b = b.replace(/Q/g, a);
  8138. b = 12 > k ? b.replace(/A/g, "am") : b.replace(/A/g, "pm");
  8139. b = b.replace(/YYYY/g, "@IIII@");
  8140. b = b.replace(/YY/g, "@II@");
  8141. b = b.replace(/MMMM/g, "@XXXX@");
  8142. b = b.replace(/MMM/g, "@XXX@");
  8143. b = b.replace(/MM/g, "@XX@");
  8144. b = b.replace(/M/g, "@X@");
  8145. b = b.replace(/DD/g, "@RR@");
  8146. b = b.replace(/D/g, "@R@");
  8147. b = b.replace(/EEEE/g, "@PPPP@");
  8148. b = b.replace(/EEE/g, "@PPP@");
  8149. b = b.replace(/EE/g, "@PP@");
  8150. b = b.replace(/E/g,
  8151. "@P@");
  8152. b = b.replace(/@IIII@/g, e);
  8153. b = b.replace(/@II@/g, q);
  8154. b = b.replace(/@XXXX@/g, c.monthNames[h]);
  8155. b = b.replace(/@XXX@/g, c.shortMonthNames[h]);
  8156. b = b.replace(/@XX@/g, p);
  8157. b = b.replace(/@X@/g, h + 1);
  8158. b = b.replace(/@RR@/g, n);
  8159. b = b.replace(/@R@/g, f);
  8160. b = b.replace(/@PPPP@/g, c.dayNames[g]);
  8161. b = b.replace(/@PPP@/g, c.shortDayNames[g]);
  8162. b = b.replace(/@PP@/g, r);
  8163. return b = b.replace(/@P@/g, g)
  8164. };
  8165. d.changeDate = function (a, b, c, e, h) {
  8166. if (d.useUTC) return d.changeUTCDate(a, b, c, e, h);
  8167. var f = -1;
  8168. void 0 === e && (e = !0);
  8169. void 0 === h && (h = !1);
  8170. !0 === e && (f = 1);
  8171. switch (b) {
  8172. case "YYYY":
  8173. a.setFullYear(a.getFullYear() +
  8174. c * f);
  8175. e || h || a.setDate(a.getDate() + 1);
  8176. break;
  8177. case "MM":
  8178. b = a.getMonth();
  8179. a.setMonth(a.getMonth() + c * f);
  8180. a.getMonth() > b + c * f && a.setDate(a.getDate() - 1);
  8181. e || h || a.setDate(a.getDate() + 1);
  8182. break;
  8183. case "DD":
  8184. a.setDate(a.getDate() + c * f);
  8185. break;
  8186. case "WW":
  8187. a.setDate(a.getDate() + c * f * 7);
  8188. break;
  8189. case "hh":
  8190. a.setHours(a.getHours() + c * f);
  8191. break;
  8192. case "mm":
  8193. a.setMinutes(a.getMinutes() + c * f);
  8194. break;
  8195. case "ss":
  8196. a.setSeconds(a.getSeconds() + c * f);
  8197. break;
  8198. case "fff":
  8199. a.setMilliseconds(a.getMilliseconds() + c * f)
  8200. }
  8201. return a
  8202. };
  8203. d.changeUTCDate = function (a, b,
  8204. c, d, h) {
  8205. var f = -1;
  8206. void 0 === d && (d = !0);
  8207. void 0 === h && (h = !1);
  8208. !0 === d && (f = 1);
  8209. switch (b) {
  8210. case "YYYY":
  8211. a.setUTCFullYear(a.getUTCFullYear() + c * f);
  8212. d || h || a.setUTCDate(a.getUTCDate() + 1);
  8213. break;
  8214. case "MM":
  8215. b = a.getUTCMonth();
  8216. a.setUTCMonth(a.getUTCMonth() + c * f);
  8217. a.getUTCMonth() > b + c * f && a.setUTCDate(a.getUTCDate() - 1);
  8218. d || h || a.setUTCDate(a.getUTCDate() + 1);
  8219. break;
  8220. case "DD":
  8221. a.setUTCDate(a.getUTCDate() + c * f);
  8222. break;
  8223. case "WW":
  8224. a.setUTCDate(a.getUTCDate() + c * f * 7);
  8225. break;
  8226. case "hh":
  8227. a.setUTCHours(a.getUTCHours() + c * f);
  8228. break;
  8229. case "mm":
  8230. a.setUTCMinutes(a.getUTCMinutes() +
  8231. c * f);
  8232. break;
  8233. case "ss":
  8234. a.setUTCSeconds(a.getUTCSeconds() + c * f);
  8235. break;
  8236. case "fff":
  8237. a.setUTCMilliseconds(a.getUTCMilliseconds() + c * f)
  8238. }
  8239. return a
  8240. }
  8241. })();