highcharts.js 320 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758
  1. /*
  2. Highcharts JS v5.0.7 (2017-01-17)
  3. (c) 2009-2016 Torstein Honsi
  4. License: www.highcharts.com/license
  5. */
  6. (function (L, a) {
  7. "object" === typeof module && module.exports ? module.exports = L.document ? a(L) : a : L.Highcharts = a(L)
  8. })("undefined" !== typeof window ? window : this, function (L) {
  9. L = function () {
  10. var a = window, B = a.document, A = a.navigator && a.navigator.userAgent || "", H = B && B.createElementNS && !!B.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect, G = /(edge|msie|trident)/i.test(A) && !window.opera, r = !H, g = /Firefox/.test(A), f = g && 4 > parseInt(A.split("Firefox/")[1], 10);
  11. return a.Highcharts ? a.Highcharts.error(16, !0) : {
  12. product: "",
  13. version: "5.0.7",
  14. deg2rad: 2 * Math.PI / 360,
  15. doc: B,
  16. hasBidiBug: f,
  17. hasTouch: B && void 0 !== B.documentElement.ontouchstart,
  18. isMS: G,
  19. isWebKit: /AppleWebKit/.test(A),
  20. isFirefox: g,
  21. isTouchDevice: /(Mobile|Android|Windows Phone)/.test(A),
  22. SVG_NS: "http://www.w3.org/2000/svg",
  23. chartCount: 0,
  24. seriesTypes: {},
  25. symbolSizes: {},
  26. svg: H,
  27. vml: r,
  28. win: a,
  29. charts: [],
  30. marginNames: ["plotTop", "marginRight", "marginBottom", "plotLeft"],
  31. noop: function () {
  32. }
  33. }
  34. }();
  35. (function (a) {
  36. var B = [], A = a.charts, H = a.doc, G = a.win;
  37. a.error = function (r, g) {
  38. r = a.isNumber(r) ? "Highcharts error #" +
  39. r + ": www.highcharts.com/errors/" + r : r;
  40. if (g)throw Error(r);
  41. G.console && console.log(r)
  42. };
  43. a.Fx = function (a, g, f) {
  44. this.options = g;
  45. this.elem = a;
  46. this.prop = f
  47. };
  48. a.Fx.prototype = {
  49. dSetter: function () {
  50. var a = this.paths[0], g = this.paths[1], f = [], u = this.now, l = a.length, q;
  51. if (1 === u)f = this.toD; else if (l === g.length && 1 > u)for (; l--;)q = parseFloat(a[l]), f[l] = isNaN(q) ? a[l] : u * parseFloat(g[l] - q) + q; else f = g;
  52. this.elem.attr("d", f, null, !0)
  53. }, update: function () {
  54. var a = this.elem, g = this.prop, f = this.now, u = this.options.step;
  55. if (this[g + "Setter"])this[g +
  56. "Setter"](); else a.attr ? a.element && a.attr(g, f, null, !0) : a.style[g] = f + this.unit;
  57. u && u.call(a, f, this)
  58. }, run: function (a, g, f) {
  59. var r = this, l = function (a) {
  60. return l.stopped ? !1 : r.step(a)
  61. }, q;
  62. this.startTime = +new Date;
  63. this.start = a;
  64. this.end = g;
  65. this.unit = f;
  66. this.now = this.start;
  67. this.pos = 0;
  68. l.elem = this.elem;
  69. l.prop = this.prop;
  70. l() && 1 === B.push(l) && (l.timerId = setInterval(function () {
  71. for (q = 0; q < B.length; q++)B[q]() || B.splice(q--, 1);
  72. B.length || clearInterval(l.timerId)
  73. }, 13))
  74. }, step: function (a) {
  75. var r = +new Date, f, u = this.options;
  76. f = this.elem;
  77. var l = u.complete, q = u.duration, d = u.curAnim, b;
  78. if (f.attr && !f.element)f = !1; else if (a || r >= q + this.startTime) {
  79. this.now = this.end;
  80. this.pos = 1;
  81. this.update();
  82. a = d[this.prop] = !0;
  83. for (b in d)!0 !== d[b] && (a = !1);
  84. a && l && l.call(f);
  85. f = !1
  86. } else this.pos = u.easing((r - this.startTime) / q), this.now = this.start + (this.end - this.start) * this.pos, this.update(), f = !0;
  87. return f
  88. }, initPath: function (r, g, f) {
  89. function u(a) {
  90. var e, b;
  91. for (n = a.length; n--;)e = "M" === a[n] || "L" === a[n], b = /[a-zA-Z]/.test(a[n + 3]), e && b && a.splice(n + 1, 0, a[n + 1], a[n + 2], a[n + 1], a[n +
  92. 2])
  93. }
  94. function l(a, e) {
  95. for (; a.length < m;) {
  96. a[0] = e[m - a.length];
  97. var b = a.slice(0, t);
  98. [].splice.apply(a, [0, 0].concat(b));
  99. E && (b = a.slice(a.length - t), [].splice.apply(a, [a.length, 0].concat(b)), n--)
  100. }
  101. a[0] = "M"
  102. }
  103. function q(a, e) {
  104. for (var b = (m - a.length) / t; 0 < b && b--;)c = a.slice().splice(a.length / z - t, t * z), c[0] = e[m - t - b * t], C && (c[t - 6] = c[t - 2], c[t - 5] = c[t - 1]), [].splice.apply(a, [a.length / z, 0].concat(c)), E && b--
  105. }
  106. g = g || "";
  107. var d, b = r.startX, p = r.endX, C = -1 < g.indexOf("C"), t = C ? 7 : 3, m, c, n;
  108. g = g.split(" ");
  109. f = f.slice();
  110. var E = r.isArea, z = E ? 2 : 1, e;
  111. C && (u(g), u(f));
  112. if (b && p) {
  113. for (n = 0; n < b.length; n++)if (b[n] === p[0]) {
  114. d = n;
  115. break
  116. } else if (b[0] === p[p.length - b.length + n]) {
  117. d = n;
  118. e = !0;
  119. break
  120. }
  121. void 0 === d && (g = [])
  122. }
  123. g.length && a.isNumber(d) && (m = f.length + d * z * t, e ? (l(g, f), q(f, g)) : (l(f, g), q(g, f)));
  124. return [g, f]
  125. }
  126. };
  127. a.extend = function (a, g) {
  128. var f;
  129. a || (a = {});
  130. for (f in g)a[f] = g[f];
  131. return a
  132. };
  133. a.merge = function () {
  134. var r, g = arguments, f, u = {}, l = function (q, d) {
  135. var b, p;
  136. "object" !== typeof q && (q = {});
  137. for (p in d)d.hasOwnProperty(p) && (b = d[p], a.isObject(b, !0) && "renderTo" !== p && "number" !== typeof b.nodeType ?
  138. q[p] = l(q[p] || {}, b) : q[p] = d[p]);
  139. return q
  140. };
  141. !0 === g[0] && (u = g[1], g = Array.prototype.slice.call(g, 2));
  142. f = g.length;
  143. for (r = 0; r < f; r++)u = l(u, g[r]);
  144. return u
  145. };
  146. a.pInt = function (a, g) {
  147. return parseInt(a, g || 10)
  148. };
  149. a.isString = function (a) {
  150. return "string" === typeof a
  151. };
  152. a.isArray = function (a) {
  153. a = Object.prototype.toString.call(a);
  154. return "[object Array]" === a || "[object Array Iterator]" === a
  155. };
  156. a.isObject = function (r, g) {
  157. return r && "object" === typeof r && (!g || !a.isArray(r))
  158. };
  159. a.isNumber = function (a) {
  160. return "number" === typeof a && !isNaN(a)
  161. };
  162. a.erase =
  163. function (a, g) {
  164. for (var f = a.length; f--;)if (a[f] === g) {
  165. a.splice(f, 1);
  166. break
  167. }
  168. };
  169. a.defined = function (a) {
  170. return void 0 !== a && null !== a
  171. };
  172. a.attr = function (r, g, f) {
  173. var u, l;
  174. if (a.isString(g))a.defined(f) ? r.setAttribute(g, f) : r && r.getAttribute && (l = r.getAttribute(g)); else if (a.defined(g) && a.isObject(g))for (u in g)r.setAttribute(u, g[u]);
  175. return l
  176. };
  177. a.splat = function (r) {
  178. return a.isArray(r) ? r : [r]
  179. };
  180. a.syncTimeout = function (a, g, f) {
  181. if (g)return setTimeout(a, g, f);
  182. a.call(0, f)
  183. };
  184. a.pick = function () {
  185. var a = arguments, g, f, u = a.length;
  186. for (g =
  187. 0; g < u; g++)if (f = a[g], void 0 !== f && null !== f)return f
  188. };
  189. a.css = function (r, g) {
  190. a.isMS && !a.svg && g && void 0 !== g.opacity && (g.filter = "alpha(opacity\x3d" + 100 * g.opacity + ")");
  191. a.extend(r.style, g)
  192. };
  193. a.createElement = function (r, g, f, u, l) {
  194. r = H.createElement(r);
  195. var q = a.css;
  196. g && a.extend(r, g);
  197. l && q(r, {padding: 0, border: "none", margin: 0});
  198. f && q(r, f);
  199. u && u.appendChild(r);
  200. return r
  201. };
  202. a.extendClass = function (r, g) {
  203. var f = function () {
  204. };
  205. f.prototype = new r;
  206. a.extend(f.prototype, g);
  207. return f
  208. };
  209. a.pad = function (a, g, f) {
  210. return Array((g || 2) + 1 - String(a).length).join(f ||
  211. 0) + a
  212. };
  213. a.relativeLength = function (a, g) {
  214. return /%$/.test(a) ? g * parseFloat(a) / 100 : parseFloat(a)
  215. };
  216. a.wrap = function (a, g, f) {
  217. var r = a[g];
  218. a[g] = function () {
  219. var a = Array.prototype.slice.call(arguments), q = arguments, d = this;
  220. d.proceed = function () {
  221. r.apply(d, arguments.length ? arguments : q)
  222. };
  223. a.unshift(r);
  224. a = f.apply(this, a);
  225. d.proceed = null;
  226. return a
  227. }
  228. };
  229. a.getTZOffset = function (r) {
  230. var g = a.Date;
  231. return 6E4 * (g.hcGetTimezoneOffset && g.hcGetTimezoneOffset(r) || g.hcTimezoneOffset || 0)
  232. };
  233. a.dateFormat = function (r, g, f) {
  234. if (!a.defined(g) || isNaN(g))return a.defaultOptions.lang.invalidDate ||
  235. "";
  236. r = a.pick(r, "%Y-%m-%d %H:%M:%S");
  237. var u = a.Date, l = new u(g - a.getTZOffset(g)), q, d = l[u.hcGetHours](), b = l[u.hcGetDay](), p = l[u.hcGetDate](), C = l[u.hcGetMonth](), t = l[u.hcGetFullYear](), m = a.defaultOptions.lang, c = m.weekdays, n = m.shortWeekdays, E = a.pad, u = a.extend({
  238. a: n ? n[b] : c[b].substr(0, 3),
  239. A: c[b],
  240. d: E(p),
  241. e: E(p, 2, " "),
  242. w: b,
  243. b: m.shortMonths[C],
  244. B: m.months[C],
  245. m: E(C + 1),
  246. y: t.toString().substr(2, 2),
  247. Y: t,
  248. H: E(d),
  249. k: d,
  250. I: E(d % 12 || 12),
  251. l: d % 12 || 12,
  252. M: E(l[u.hcGetMinutes]()),
  253. p: 12 > d ? "AM" : "PM",
  254. P: 12 > d ? "am" : "pm",
  255. S: E(l.getSeconds()),
  256. L: E(Math.round(g %
  257. 1E3), 3)
  258. }, a.dateFormats);
  259. for (q in u)for (; -1 !== r.indexOf("%" + q);)r = r.replace("%" + q, "function" === typeof u[q] ? u[q](g) : u[q]);
  260. return f ? r.substr(0, 1).toUpperCase() + r.substr(1) : r
  261. };
  262. a.formatSingle = function (r, g) {
  263. var f = /\.([0-9])/, u = a.defaultOptions.lang;
  264. /f$/.test(r) ? (f = (f = r.match(f)) ? f[1] : -1, null !== g && (g = a.numberFormat(g, f, u.decimalPoint, -1 < r.indexOf(",") ? u.thousandsSep : ""))) : g = a.dateFormat(r, g);
  265. return g
  266. };
  267. a.format = function (r, g) {
  268. for (var f = "{", u = !1, l, q, d, b, p = [], C; r;) {
  269. f = r.indexOf(f);
  270. if (-1 === f)break;
  271. l = r.slice(0,
  272. f);
  273. if (u) {
  274. l = l.split(":");
  275. q = l.shift().split(".");
  276. b = q.length;
  277. C = g;
  278. for (d = 0; d < b; d++)C = C[q[d]];
  279. l.length && (C = a.formatSingle(l.join(":"), C));
  280. p.push(C)
  281. } else p.push(l);
  282. r = r.slice(f + 1);
  283. f = (u = !u) ? "}" : "{"
  284. }
  285. p.push(r);
  286. return p.join("")
  287. };
  288. a.getMagnitude = function (a) {
  289. return Math.pow(10, Math.floor(Math.log(a) / Math.LN10))
  290. };
  291. a.normalizeTickInterval = function (r, g, f, u, l) {
  292. var q, d = r;
  293. f = a.pick(f, 1);
  294. q = r / f;
  295. g || (g = l ? [1, 1.2, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 10] : [1, 2, 2.5, 5, 10], !1 === u && (1 === f ? g = a.grep(g, function (a) {
  296. return 0 === a % 1
  297. }) : .1 >= f && (g = [1 / f])));
  298. for (u = 0; u < g.length && !(d = g[u], l && d * f >= r || !l && q <= (g[u] + (g[u + 1] || g[u])) / 2); u++);
  299. return d = a.correctFloat(d * f, -Math.round(Math.log(.001) / Math.LN10))
  300. };
  301. a.stableSort = function (a, g) {
  302. var f = a.length, r, l;
  303. for (l = 0; l < f; l++)a[l].safeI = l;
  304. a.sort(function (a, d) {
  305. r = g(a, d);
  306. return 0 === r ? a.safeI - d.safeI : r
  307. });
  308. for (l = 0; l < f; l++)delete a[l].safeI
  309. };
  310. a.arrayMin = function (a) {
  311. for (var g = a.length, f = a[0]; g--;)a[g] < f && (f = a[g]);
  312. return f
  313. };
  314. a.arrayMax = function (a) {
  315. for (var g = a.length, f = a[0]; g--;)a[g] > f && (f = a[g]);
  316. return f
  317. };
  318. a.destroyObjectProperties =
  319. function (a, g) {
  320. for (var f in a)a[f] && a[f] !== g && a[f].destroy && a[f].destroy(), delete a[f]
  321. };
  322. a.discardElement = function (r) {
  323. var g = a.garbageBin;
  324. g || (g = a.createElement("div"));
  325. r && g.appendChild(r);
  326. g.innerHTML = ""
  327. };
  328. a.correctFloat = function (a, g) {
  329. return parseFloat(a.toPrecision(g || 14))
  330. };
  331. a.setAnimation = function (r, g) {
  332. g.renderer.globalAnimation = a.pick(r, g.options.chart.animation, !0)
  333. };
  334. a.animObject = function (r) {
  335. return a.isObject(r) ? a.merge(r) : {duration: r ? 500 : 0}
  336. };
  337. a.timeUnits = {
  338. millisecond: 1, second: 1E3, minute: 6E4, hour: 36E5,
  339. day: 864E5, week: 6048E5, month: 24192E5, year: 314496E5
  340. };
  341. a.numberFormat = function (r, g, f, u) {
  342. r = +r || 0;
  343. g = +g;
  344. var l = a.defaultOptions.lang, q = (r.toString().split(".")[1] || "").length, d, b;
  345. -1 === g ? g = Math.min(q, 20) : a.isNumber(g) || (g = 2);
  346. b = (Math.abs(r) + Math.pow(10, -Math.max(g, q) - 1)).toFixed(g);
  347. q = String(a.pInt(b));
  348. d = 3 < q.length ? q.length % 3 : 0;
  349. f = a.pick(f, l.decimalPoint);
  350. u = a.pick(u, l.thousandsSep);
  351. r = (0 > r ? "-" : "") + (d ? q.substr(0, d) + u : "");
  352. r += q.substr(d).replace(/(\d{3})(?=\d)/g, "$1" + u);
  353. g && (r += f + b.slice(-g));
  354. return r
  355. };
  356. Math.easeInOutSine =
  357. function (a) {
  358. return -.5 * (Math.cos(Math.PI * a) - 1)
  359. };
  360. a.getStyle = function (r, g) {
  361. return "width" === g ? Math.min(r.offsetWidth, r.scrollWidth) - a.getStyle(r, "padding-left") - a.getStyle(r, "padding-right") : "height" === g ? Math.min(r.offsetHeight, r.scrollHeight) - a.getStyle(r, "padding-top") - a.getStyle(r, "padding-bottom") : (r = G.getComputedStyle(r, void 0)) && a.pInt(r.getPropertyValue(g))
  362. };
  363. a.inArray = function (a, g) {
  364. return g.indexOf ? g.indexOf(a) : [].indexOf.call(g, a)
  365. };
  366. a.grep = function (a, g) {
  367. return [].filter.call(a, g)
  368. };
  369. a.find = function (a,
  370. g) {
  371. return [].find.call(a, g)
  372. };
  373. a.map = function (a, g) {
  374. for (var f = [], u = 0, l = a.length; u < l; u++)f[u] = g.call(a[u], a[u], u, a);
  375. return f
  376. };
  377. a.offset = function (a) {
  378. var g = H.documentElement;
  379. a = a.getBoundingClientRect();
  380. return {
  381. top: a.top + (G.pageYOffset || g.scrollTop) - (g.clientTop || 0),
  382. left: a.left + (G.pageXOffset || g.scrollLeft) - (g.clientLeft || 0)
  383. }
  384. };
  385. a.stop = function (a, g) {
  386. for (var f = B.length; f--;)B[f].elem !== a || g && g !== B[f].prop || (B[f].stopped = !0)
  387. };
  388. a.each = function (a, g, f) {
  389. return Array.prototype.forEach.call(a, g, f)
  390. };
  391. a.addEvent = function (r,
  392. g, f) {
  393. function u(a) {
  394. a.target = a.srcElement || G;
  395. f.call(r, a)
  396. }
  397. var l = r.hcEvents = r.hcEvents || {};
  398. r.addEventListener ? r.addEventListener(g, f, !1) : r.attachEvent && (r.hcEventsIE || (r.hcEventsIE = {}), r.hcEventsIE[f.toString()] = u, r.attachEvent("on" + g, u));
  399. l[g] || (l[g] = []);
  400. l[g].push(f);
  401. return function () {
  402. a.removeEvent(r, g, f)
  403. }
  404. };
  405. a.removeEvent = function (r, g, f) {
  406. function u(a, b) {
  407. r.removeEventListener ? r.removeEventListener(a, b, !1) : r.attachEvent && (b = r.hcEventsIE[b.toString()], r.detachEvent("on" + a, b))
  408. }
  409. function l() {
  410. var a, b;
  411. if (r.nodeName)for (b in g ?
  412. (a = {}, a[g] = !0) : a = d, a)if (d[b])for (a = d[b].length; a--;)u(b, d[b][a])
  413. }
  414. var q, d = r.hcEvents, b;
  415. d && (g ? (q = d[g] || [], f ? (b = a.inArray(f, q), -1 < b && (q.splice(b, 1), d[g] = q), u(g, f)) : (l(), d[g] = [])) : (l(), r.hcEvents = {}))
  416. };
  417. a.fireEvent = function (r, g, f, u) {
  418. var l;
  419. l = r.hcEvents;
  420. var q, d;
  421. f = f || {};
  422. if (H.createEvent && (r.dispatchEvent || r.fireEvent))l = H.createEvent("Events"), l.initEvent(g, !0, !0), a.extend(l, f), r.dispatchEvent ? r.dispatchEvent(l) : r.fireEvent(g, l); else if (l)for (l = l[g] || [], q = l.length, f.target || a.extend(f, {
  423. preventDefault: function () {
  424. f.defaultPrevented = !0
  425. }, target: r, type: g
  426. }), g = 0; g < q; g++)(d = l[g]) && !1 === d.call(r, f) && f.preventDefault();
  427. u && !f.defaultPrevented && u(f)
  428. };
  429. a.animate = function (r, g, f) {
  430. var u, l = "", q, d, b;
  431. a.isObject(f) || (u = arguments, f = {duration: u[2], easing: u[3], complete: u[4]});
  432. a.isNumber(f.duration) || (f.duration = 400);
  433. f.easing = "function" === typeof f.easing ? f.easing : Math[f.easing] || Math.easeInOutSine;
  434. f.curAnim = a.merge(g);
  435. for (b in g)a.stop(r, b), d = new a.Fx(r, f, b), q = null, "d" === b ? (d.paths = d.initPath(r, r.d, g.d), d.toD = g.d, u = 0, q = 1) : r.attr ? u = r.attr(b) : (u = parseFloat(a.getStyle(r,
  436. b)) || 0, "opacity" !== b && (l = "px")), q || (q = g[b]), q.match && q.match("px") && (q = q.replace(/px/g, "")), d.run(u, q, l)
  437. };
  438. a.seriesType = function (r, g, f, u, l) {
  439. var q = a.getOptions(), d = a.seriesTypes;
  440. q.plotOptions[r] = a.merge(q.plotOptions[g], f);
  441. d[r] = a.extendClass(d[g] || function () {
  442. }, u);
  443. d[r].prototype.type = r;
  444. l && (d[r].prototype.pointClass = a.extendClass(a.Point, l));
  445. return d[r]
  446. };
  447. a.uniqueKey = function () {
  448. var a = Math.random().toString(36).substring(2, 9), g = 0;
  449. return function () {
  450. return "highcharts-" + a + "-" + g++
  451. }
  452. }();
  453. G.jQuery && (G.jQuery.fn.highcharts =
  454. function () {
  455. var r = [].slice.call(arguments);
  456. if (this[0])return r[0] ? (new (a[a.isString(r[0]) ? r.shift() : "Chart"])(this[0], r[0], r[1]), this) : A[a.attr(this[0], "data-highcharts-chart")]
  457. });
  458. H && !H.defaultView && (a.getStyle = function (r, g) {
  459. var f = {width: "clientWidth", height: "clientHeight"}[g];
  460. if (r.style[g])return a.pInt(r.style[g]);
  461. "opacity" === g && (g = "filter");
  462. if (f)return r.style.zoom = 1, Math.max(r[f] - 2 * a.getStyle(r, "padding"), 0);
  463. r = r.currentStyle[g.replace(/\-(\w)/g, function (a, l) {
  464. return l.toUpperCase()
  465. })];
  466. "filter" ===
  467. g && (r = r.replace(/alpha\(opacity=([0-9]+)\)/, function (a, l) {
  468. return l / 100
  469. }));
  470. return "" === r ? 1 : a.pInt(r)
  471. });
  472. Array.prototype.forEach || (a.each = function (a, g, f) {
  473. for (var u = 0, l = a.length; u < l; u++)if (!1 === g.call(f, a[u], u, a))return u
  474. });
  475. Array.prototype.indexOf || (a.inArray = function (a, g) {
  476. var f, u = 0;
  477. if (g)for (f = g.length; u < f; u++)if (g[u] === a)return u;
  478. return -1
  479. });
  480. Array.prototype.filter || (a.grep = function (a, g) {
  481. for (var f = [], u = 0, l = a.length; u < l; u++)g(a[u], u) && f.push(a[u]);
  482. return f
  483. });
  484. Array.prototype.find || (a.find = function (a, g) {
  485. var f,
  486. u = a.length;
  487. for (f = 0; f < u; f++)if (g(a[f], f))return a[f]
  488. })
  489. })(L);
  490. (function (a) {
  491. var B = a.each, A = a.isNumber, H = a.map, G = a.merge, r = a.pInt;
  492. a.Color = function (g) {
  493. if (!(this instanceof a.Color))return new a.Color(g);
  494. this.init(g)
  495. };
  496. a.Color.prototype = {
  497. parsers: [{
  498. regex: /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,
  499. parse: function (a) {
  500. return [r(a[1]), r(a[2]), r(a[3]), parseFloat(a[4], 10)]
  501. }
  502. }, {
  503. regex: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/, parse: function (a) {
  504. return [r(a[1],
  505. 16), r(a[2], 16), r(a[3], 16), 1]
  506. }
  507. }, {
  508. regex: /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/, parse: function (a) {
  509. return [r(a[1]), r(a[2]), r(a[3]), 1]
  510. }
  511. }], names: {white: "#ffffff", black: "#000000"}, init: function (g) {
  512. var f, u, l, q;
  513. if ((this.input = g = this.names[g] || g) && g.stops)this.stops = H(g.stops, function (d) {
  514. return new a.Color(d[1])
  515. }); else for (l = this.parsers.length; l-- && !u;)q = this.parsers[l], (f = q.regex.exec(g)) && (u = q.parse(f));
  516. this.rgba = u || []
  517. }, get: function (a) {
  518. var f = this.input, g = this.rgba, l;
  519. this.stops ?
  520. (l = G(f), l.stops = [].concat(l.stops), B(this.stops, function (f, d) {
  521. l.stops[d] = [l.stops[d][0], f.get(a)]
  522. })) : l = g && A(g[0]) ? "rgb" === a || !a && 1 === g[3] ? "rgb(" + g[0] + "," + g[1] + "," + g[2] + ")" : "a" === a ? g[3] : "rgba(" + g.join(",") + ")" : f;
  523. return l
  524. }, brighten: function (a) {
  525. var f, g = this.rgba;
  526. if (this.stops)B(this.stops, function (l) {
  527. l.brighten(a)
  528. }); else if (A(a) && 0 !== a)for (f = 0; 3 > f; f++)g[f] += r(255 * a), 0 > g[f] && (g[f] = 0), 255 < g[f] && (g[f] = 255);
  529. return this
  530. }, setOpacity: function (a) {
  531. this.rgba[3] = a;
  532. return this
  533. }
  534. };
  535. a.color = function (g) {
  536. return new a.Color(g)
  537. }
  538. })(L);
  539. (function (a) {
  540. var B, A, H = a.addEvent, G = a.animate, r = a.attr, g = a.charts, f = a.color, u = a.css, l = a.createElement, q = a.defined, d = a.deg2rad, b = a.destroyObjectProperties, p = a.doc, C = a.each, t = a.extend, m = a.erase, c = a.grep, n = a.hasTouch, E = a.inArray, z = a.isArray, e = a.isFirefox, x = a.isMS, F = a.isObject, w = a.isString, h = a.isWebKit, y = a.merge, J = a.noop, K = a.pick, I = a.pInt, k = a.removeEvent, D = a.stop, P = a.svg, N = a.SVG_NS, S = a.symbolSizes, O = a.win;
  541. B = a.SVGElement = function () {
  542. return this
  543. };
  544. B.prototype = {
  545. opacity: 1,
  546. SVG_NS: N,
  547. textProps: "direction fontSize fontWeight fontFamily fontStyle color lineHeight width textDecoration textOverflow textOutline".split(" "),
  548. init: function (a, k) {
  549. this.element = "span" === k ? l(k) : p.createElementNS(this.SVG_NS, k);
  550. this.renderer = a
  551. },
  552. animate: function (v, k, e) {
  553. k = a.animObject(K(k, this.renderer.globalAnimation, !0));
  554. 0 !== k.duration ? (e && (k.complete = e), G(this, v, k)) : this.attr(v, null, e);
  555. return this
  556. },
  557. colorGradient: function (v, k, e) {
  558. var b = this.renderer, h, D, c, x, M, m, n, d, F, t, p, w = [], l;
  559. v.linearGradient ? D = "linearGradient" : v.radialGradient && (D = "radialGradient");
  560. if (D) {
  561. c = v[D];
  562. M = b.gradients;
  563. n = v.stops;
  564. t = e.radialReference;
  565. z(c) && (v[D] = c = {
  566. x1: c[0], y1: c[1], x2: c[2],
  567. y2: c[3], gradientUnits: "userSpaceOnUse"
  568. });
  569. "radialGradient" === D && t && !q(c.gradientUnits) && (x = c, c = y(c, b.getRadialAttr(t, x), {gradientUnits: "userSpaceOnUse"}));
  570. for (p in c)"id" !== p && w.push(p, c[p]);
  571. for (p in n)w.push(n[p]);
  572. w = w.join(",");
  573. M[w] ? t = M[w].attr("id") : (c.id = t = a.uniqueKey(), M[w] = m = b.createElement(D).attr(c).add(b.defs), m.radAttr = x, m.stops = [], C(n, function (v) {
  574. 0 === v[1].indexOf("rgba") ? (h = a.color(v[1]), d = h.get("rgb"), F = h.get("a")) : (d = v[1], F = 1);
  575. v = b.createElement("stop").attr({
  576. offset: v[0], "stop-color": d,
  577. "stop-opacity": F
  578. }).add(m);
  579. m.stops.push(v)
  580. }));
  581. l = "url(" + b.url + "#" + t + ")";
  582. e.setAttribute(k, l);
  583. e.gradient = w;
  584. v.toString = function () {
  585. return l
  586. }
  587. }
  588. },
  589. applyTextOutline: function (a) {
  590. var v = this.element, k, e, b, c;
  591. -1 !== a.indexOf("contrast") && (a = a.replace(/contrast/g, this.renderer.getContrast(v.style.fill)));
  592. this.fakeTS = !0;
  593. this.ySetter = this.xSetter;
  594. k = [].slice.call(v.getElementsByTagName("tspan"));
  595. a = a.split(" ");
  596. e = a[a.length - 1];
  597. (b = a[0]) && "none" !== b && (b = b.replace(/(^[\d\.]+)(.*?)$/g, function (a, v, k) {
  598. return 2 * v + k
  599. }), C(k, function (a) {
  600. "highcharts-text-outline" ===
  601. a.getAttribute("class") && m(k, v.removeChild(a))
  602. }), c = v.firstChild, C(k, function (a, k) {
  603. 0 === k && (a.setAttribute("x", v.getAttribute("x")), k = v.getAttribute("y"), a.setAttribute("y", k || 0), null === k && v.setAttribute("y", 0));
  604. a = a.cloneNode(1);
  605. r(a, {
  606. "class": "highcharts-text-outline",
  607. fill: e,
  608. stroke: e,
  609. "stroke-width": b,
  610. "stroke-linejoin": "round"
  611. });
  612. v.insertBefore(a, c)
  613. }))
  614. },
  615. attr: function (a, k, e, b) {
  616. var v, c = this.element, h, x = this, M;
  617. "string" === typeof a && void 0 !== k && (v = a, a = {}, a[v] = k);
  618. if ("string" === typeof a)x = (this[a + "Getter"] ||
  619. this._defaultGetter).call(this, a, c); else {
  620. for (v in a)k = a[v], M = !1, b || D(this, v), this.symbolName && /^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(v) && (h || (this.symbolAttr(a), h = !0), M = !0), !this.rotation || "x" !== v && "y" !== v || (this.doTransform = !0), M || (M = this[v + "Setter"] || this._defaultSetter, M.call(this, k, v, c), this.shadows && /^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(v) && this.updateShadows(v, k, M));
  621. this.doTransform && (this.updateTransform(), this.doTransform = !1)
  622. }
  623. e && e();
  624. return x
  625. },
  626. updateShadows: function (a,
  627. k, e) {
  628. for (var v = this.shadows, b = v.length; b--;)e.call(v[b], "height" === a ? Math.max(k - (v[b].cutHeight || 0), 0) : "d" === a ? this.d : k, a, v[b])
  629. },
  630. addClass: function (a, k) {
  631. var v = this.attr("class") || "";
  632. -1 === v.indexOf(a) && (k || (a = (v + (v ? " " : "") + a).replace(" ", " ")), this.attr("class", a));
  633. return this
  634. },
  635. hasClass: function (a) {
  636. return -1 !== r(this.element, "class").indexOf(a)
  637. },
  638. removeClass: function (a) {
  639. r(this.element, "class", (r(this.element, "class") || "").replace(a, ""));
  640. return this
  641. },
  642. symbolAttr: function (a) {
  643. var v = this;
  644. C("x y r start end width height innerR anchorX anchorY".split(" "),
  645. function (k) {
  646. v[k] = K(a[k], v[k])
  647. });
  648. v.attr({d: v.renderer.symbols[v.symbolName](v.x, v.y, v.width, v.height, v)})
  649. },
  650. clip: function (a) {
  651. return this.attr("clip-path", a ? "url(" + this.renderer.url + "#" + a.id + ")" : "none")
  652. },
  653. crisp: function (a, k) {
  654. var v, e = {}, b;
  655. k = k || a.strokeWidth || 0;
  656. b = Math.round(k) % 2 / 2;
  657. a.x = Math.floor(a.x || this.x || 0) + b;
  658. a.y = Math.floor(a.y || this.y || 0) + b;
  659. a.width = Math.floor((a.width || this.width || 0) - 2 * b);
  660. a.height = Math.floor((a.height || this.height || 0) - 2 * b);
  661. q(a.strokeWidth) && (a.strokeWidth = k);
  662. for (v in a)this[v] !== a[v] &&
  663. (this[v] = e[v] = a[v]);
  664. return e
  665. },
  666. css: function (a) {
  667. var v = this.styles, k = {}, e = this.element, b, c, h = "";
  668. b = !v;
  669. var D = ["textOverflow", "width"];
  670. a && a.color && (a.fill = a.color);
  671. if (v)for (c in a)a[c] !== v[c] && (k[c] = a[c], b = !0);
  672. if (b) {
  673. b = this.textWidth = a && a.width && "text" === e.nodeName.toLowerCase() && I(a.width) || this.textWidth;
  674. v && (a = t(v, k));
  675. this.styles = a;
  676. b && !P && this.renderer.forExport && delete a.width;
  677. if (x && !P)u(this.element, a); else {
  678. v = function (a, v) {
  679. return "-" + v.toLowerCase()
  680. };
  681. for (c in a)-1 === E(c, D) && (h += c.replace(/([A-Z])/g, v) +
  682. ":" + a[c] + ";");
  683. h && r(e, "style", h)
  684. }
  685. this.added && (b && this.renderer.buildText(this), a && a.textOutline && this.applyTextOutline(a.textOutline))
  686. }
  687. return this
  688. },
  689. strokeWidth: function () {
  690. return this["stroke-width"] || 0
  691. },
  692. on: function (a, k) {
  693. var v = this, e = v.element;
  694. n && "click" === a ? (e.ontouchstart = function (a) {
  695. v.touchEventFired = Date.now();
  696. a.preventDefault();
  697. k.call(e, a)
  698. }, e.onclick = function (a) {
  699. (-1 === O.navigator.userAgent.indexOf("Android") || 1100 < Date.now() - (v.touchEventFired || 0)) && k.call(e, a)
  700. }) : e["on" + a] = k;
  701. return this
  702. },
  703. setRadialReference: function (a) {
  704. var v =
  705. this.renderer.gradients[this.element.gradient];
  706. this.element.radialReference = a;
  707. v && v.radAttr && v.animate(this.renderer.getRadialAttr(a, v.radAttr));
  708. return this
  709. },
  710. translate: function (a, k) {
  711. return this.attr({translateX: a, translateY: k})
  712. },
  713. invert: function (a) {
  714. this.inverted = a;
  715. this.updateTransform();
  716. return this
  717. },
  718. updateTransform: function () {
  719. var a = this.translateX || 0, k = this.translateY || 0, e = this.scaleX, b = this.scaleY, c = this.inverted, h = this.rotation, D = this.element;
  720. c && (a += this.width, k += this.height);
  721. a = ["translate(" + a + "," +
  722. k + ")"];
  723. c ? a.push("rotate(90) scale(-1,1)") : h && a.push("rotate(" + h + " " + (D.getAttribute("x") || 0) + " " + (D.getAttribute("y") || 0) + ")");
  724. (q(e) || q(b)) && a.push("scale(" + K(e, 1) + " " + K(b, 1) + ")");
  725. a.length && D.setAttribute("transform", a.join(" "))
  726. },
  727. toFront: function () {
  728. var a = this.element;
  729. a.parentNode.appendChild(a);
  730. return this
  731. },
  732. align: function (a, k, e) {
  733. var v, b, c, h, D = {};
  734. b = this.renderer;
  735. c = b.alignedObjects;
  736. var x, y;
  737. if (a) {
  738. if (this.alignOptions = a, this.alignByTranslate = k, !e || w(e))this.alignTo = v = e || "renderer", m(c, this), c.push(this),
  739. e = null
  740. } else a = this.alignOptions, k = this.alignByTranslate, v = this.alignTo;
  741. e = K(e, b[v], b);
  742. v = a.align;
  743. b = a.verticalAlign;
  744. c = (e.x || 0) + (a.x || 0);
  745. h = (e.y || 0) + (a.y || 0);
  746. "right" === v ? x = 1 : "center" === v && (x = 2);
  747. x && (c += (e.width - (a.width || 0)) / x);
  748. D[k ? "translateX" : "x"] = Math.round(c);
  749. "bottom" === b ? y = 1 : "middle" === b && (y = 2);
  750. y && (h += (e.height - (a.height || 0)) / y);
  751. D[k ? "translateY" : "y"] = Math.round(h);
  752. this[this.placed ? "animate" : "attr"](D);
  753. this.placed = !0;
  754. this.alignAttr = D;
  755. return this
  756. },
  757. getBBox: function (a, k) {
  758. var v, e = this.renderer, b, c = this.element,
  759. h = this.styles, D, x = this.textStr, m, y = e.cache, n = e.cacheKeys, F;
  760. k = K(k, this.rotation);
  761. b = k * d;
  762. D = h && h.fontSize;
  763. void 0 !== x && (F = x.toString(), -1 === F.indexOf("\x3c") && (F = F.replace(/[0-9]/g, "0")), F += ["", k || 0, D, h && h.width, h && h.textOverflow].join());
  764. F && !a && (v = y[F]);
  765. if (!v) {
  766. if (c.namespaceURI === this.SVG_NS || e.forExport) {
  767. try {
  768. (m = this.fakeTS && function (a) {
  769. C(c.querySelectorAll(".highcharts-text-outline"), function (v) {
  770. v.style.display = a
  771. })
  772. }) && m("none"), v = c.getBBox ? t({}, c.getBBox()) : {
  773. width: c.offsetWidth,
  774. height: c.offsetHeight
  775. },
  776. m && m("")
  777. } catch (W) {
  778. }
  779. if (!v || 0 > v.width)v = {width: 0, height: 0}
  780. } else v = this.htmlGetBBox();
  781. e.isSVG && (a = v.width, e = v.height, h && "11px" === h.fontSize && 17 === Math.round(e) && (v.height = e = 14), k && (v.width = Math.abs(e * Math.sin(b)) + Math.abs(a * Math.cos(b)), v.height = Math.abs(e * Math.cos(b)) + Math.abs(a * Math.sin(b))));
  782. if (F && 0 < v.height) {
  783. for (; 250 < n.length;)delete y[n.shift()];
  784. y[F] || n.push(F);
  785. y[F] = v
  786. }
  787. }
  788. return v
  789. },
  790. show: function (a) {
  791. return this.attr({visibility: a ? "inherit" : "visible"})
  792. },
  793. hide: function () {
  794. return this.attr({visibility: "hidden"})
  795. },
  796. fadeOut: function (a) {
  797. var v = this;
  798. v.animate({opacity: 0}, {
  799. duration: a || 150, complete: function () {
  800. v.attr({y: -9999})
  801. }
  802. })
  803. },
  804. add: function (a) {
  805. var v = this.renderer, k = this.element, e;
  806. a && (this.parentGroup = a);
  807. this.parentInverted = a && a.inverted;
  808. void 0 !== this.textStr && v.buildText(this);
  809. this.added = !0;
  810. if (!a || a.handleZ || this.zIndex)e = this.zIndexSetter();
  811. e || (a ? a.element : v.box).appendChild(k);
  812. if (this.onAdd)this.onAdd();
  813. return this
  814. },
  815. safeRemoveChild: function (a) {
  816. var v = a.parentNode;
  817. v && v.removeChild(a)
  818. },
  819. destroy: function () {
  820. var a =
  821. this.element || {}, k = this.renderer.isSVG && "SPAN" === a.nodeName && this.parentGroup, e, b;
  822. a.onclick = a.onmouseout = a.onmouseover = a.onmousemove = a.point = null;
  823. D(this);
  824. this.clipPath && (this.clipPath = this.clipPath.destroy());
  825. if (this.stops) {
  826. for (b = 0; b < this.stops.length; b++)this.stops[b] = this.stops[b].destroy();
  827. this.stops = null
  828. }
  829. this.safeRemoveChild(a);
  830. for (this.destroyShadows(); k && k.div && 0 === k.div.childNodes.length;)a = k.parentGroup, this.safeRemoveChild(k.div), delete k.div, k = a;
  831. this.alignTo && m(this.renderer.alignedObjects,
  832. this);
  833. for (e in this)delete this[e];
  834. return null
  835. },
  836. shadow: function (a, k, e) {
  837. var v = [], b, c, h = this.element, D, x, m, y;
  838. if (!a)this.destroyShadows(); else if (!this.shadows) {
  839. x = K(a.width, 3);
  840. m = (a.opacity || .15) / x;
  841. y = this.parentInverted ? "(-1,-1)" : "(" + K(a.offsetX, 1) + ", " + K(a.offsetY, 1) + ")";
  842. for (b = 1; b <= x; b++)c = h.cloneNode(0), D = 2 * x + 1 - 2 * b, r(c, {
  843. isShadow: "true",
  844. stroke: a.color || "#000000",
  845. "stroke-opacity": m * b,
  846. "stroke-width": D,
  847. transform: "translate" + y,
  848. fill: "none"
  849. }), e && (r(c, "height", Math.max(r(c, "height") - D, 0)), c.cutHeight = D), k ?
  850. k.element.appendChild(c) : h.parentNode.insertBefore(c, h), v.push(c);
  851. this.shadows = v
  852. }
  853. return this
  854. },
  855. destroyShadows: function () {
  856. C(this.shadows || [], function (a) {
  857. this.safeRemoveChild(a)
  858. }, this);
  859. this.shadows = void 0
  860. },
  861. xGetter: function (a) {
  862. "circle" === this.element.nodeName && ("x" === a ? a = "cx" : "y" === a && (a = "cy"));
  863. return this._defaultGetter(a)
  864. },
  865. _defaultGetter: function (a) {
  866. a = K(this[a], this.element ? this.element.getAttribute(a) : null, 0);
  867. /^[\-0-9\.]+$/.test(a) && (a = parseFloat(a));
  868. return a
  869. },
  870. dSetter: function (a, k, e) {
  871. a && a.join && (a =
  872. a.join(" "));
  873. /(NaN| {2}|^$)/.test(a) && (a = "M 0 0");
  874. e.setAttribute(k, a);
  875. this[k] = a
  876. },
  877. dashstyleSetter: function (a) {
  878. var v, k = this["stroke-width"];
  879. "inherit" === k && (k = 1);
  880. if (a = a && a.toLowerCase()) {
  881. a = a.replace("shortdashdotdot", "3,1,1,1,1,1,").replace("shortdashdot", "3,1,1,1").replace("shortdot", "1,1,").replace("shortdash", "3,1,").replace("longdash", "8,3,").replace(/dot/g, "1,3,").replace("dash", "4,3,").replace(/,$/, "").split(",");
  882. for (v = a.length; v--;)a[v] = I(a[v]) * k;
  883. a = a.join(",").replace(/NaN/g, "none");
  884. this.element.setAttribute("stroke-dasharray",
  885. a)
  886. }
  887. },
  888. alignSetter: function (a) {
  889. this.element.setAttribute("text-anchor", {left: "start", center: "middle", right: "end"}[a])
  890. },
  891. opacitySetter: function (a, k, e) {
  892. this[k] = a;
  893. e.setAttribute(k, a)
  894. },
  895. titleSetter: function (a) {
  896. var v = this.element.getElementsByTagName("title")[0];
  897. v || (v = p.createElementNS(this.SVG_NS, "title"), this.element.appendChild(v));
  898. v.firstChild && v.removeChild(v.firstChild);
  899. v.appendChild(p.createTextNode(String(K(a), "").replace(/<[^>]*>/g, "")))
  900. },
  901. textSetter: function (a) {
  902. a !== this.textStr && (delete this.bBox,
  903. this.textStr = a, this.added && this.renderer.buildText(this))
  904. },
  905. fillSetter: function (a, k, e) {
  906. "string" === typeof a ? e.setAttribute(k, a) : a && this.colorGradient(a, k, e)
  907. },
  908. visibilitySetter: function (a, k, e) {
  909. "inherit" === a ? e.removeAttribute(k) : e.setAttribute(k, a)
  910. },
  911. zIndexSetter: function (a, k) {
  912. var v = this.renderer, e = this.parentGroup, b = (e || v).element || v.box, c, h = this.element, D;
  913. c = this.added;
  914. var x;
  915. q(a) && (h.zIndex = a, a = +a, this[k] === a && (c = !1), this[k] = a);
  916. if (c) {
  917. (a = this.zIndex) && e && (e.handleZ = !0);
  918. k = b.childNodes;
  919. for (x = 0; x < k.length && !D; x++)e = k[x], c = e.zIndex, e !== h && (I(c) > a || !q(a) && q(c) || 0 > a && !q(c) && b !== v.box) && (b.insertBefore(h, e), D = !0);
  920. D || b.appendChild(h)
  921. }
  922. return D
  923. },
  924. _defaultSetter: function (a, k, e) {
  925. e.setAttribute(k, a)
  926. }
  927. };
  928. B.prototype.yGetter = B.prototype.xGetter;
  929. B.prototype.translateXSetter = B.prototype.translateYSetter = B.prototype.rotationSetter = B.prototype.verticalAlignSetter = B.prototype.scaleXSetter = B.prototype.scaleYSetter = function (a, k) {
  930. this[k] = a;
  931. this.doTransform = !0
  932. };
  933. B.prototype["stroke-widthSetter"] = B.prototype.strokeSetter = function (a,
  934. k, e) {
  935. this[k] = a;
  936. this.stroke && this["stroke-width"] ? (B.prototype.fillSetter.call(this, this.stroke, "stroke", e), e.setAttribute("stroke-width", this["stroke-width"]), this.hasStroke = !0) : "stroke-width" === k && 0 === a && this.hasStroke && (e.removeAttribute("stroke"), this.hasStroke = !1)
  937. };
  938. A = a.SVGRenderer = function () {
  939. this.init.apply(this, arguments)
  940. };
  941. A.prototype = {
  942. Element: B, SVG_NS: N, init: function (a, k, b, c, D, x) {
  943. var v;
  944. c = this.createElement("svg").attr({version: "1.1", "class": "highcharts-root"}).css(this.getStyle(c));
  945. v = c.element;
  946. a.appendChild(v);
  947. -1 === a.innerHTML.indexOf("xmlns") && r(v, "xmlns", this.SVG_NS);
  948. this.isSVG = !0;
  949. this.box = v;
  950. this.boxWrapper = c;
  951. this.alignedObjects = [];
  952. this.url = (e || h) && p.getElementsByTagName("base").length ? O.location.href.replace(/#.*?$/, "").replace(/<[^>]*>/g, "").replace(/([\('\)])/g, "\\$1").replace(/ /g, "%20") : "";
  953. this.createElement("desc").add().element.appendChild(p.createTextNode("Created with Highcharts 5.0.7"));
  954. this.defs = this.createElement("defs").add();
  955. this.allowHTML = x;
  956. this.forExport = D;
  957. this.gradients =
  958. {};
  959. this.cache = {};
  960. this.cacheKeys = [];
  961. this.imgCount = 0;
  962. this.setSize(k, b, !1);
  963. var m;
  964. e && a.getBoundingClientRect && (k = function () {
  965. u(a, {left: 0, top: 0});
  966. m = a.getBoundingClientRect();
  967. u(a, {left: Math.ceil(m.left) - m.left + "px", top: Math.ceil(m.top) - m.top + "px"})
  968. }, k(), this.unSubPixelFix = H(O, "resize", k))
  969. }, getStyle: function (a) {
  970. return this.style = t({
  971. fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',
  972. fontSize: "12px"
  973. }, a)
  974. }, setStyle: function (a) {
  975. this.boxWrapper.css(this.getStyle(a))
  976. }, isHidden: function () {
  977. return !this.boxWrapper.getBBox().width
  978. },
  979. destroy: function () {
  980. var a = this.defs;
  981. this.box = null;
  982. this.boxWrapper = this.boxWrapper.destroy();
  983. b(this.gradients || {});
  984. this.gradients = null;
  985. a && (this.defs = a.destroy());
  986. this.unSubPixelFix && this.unSubPixelFix();
  987. return this.alignedObjects = null
  988. }, createElement: function (a) {
  989. var k = new this.Element;
  990. k.init(this, a);
  991. return k
  992. }, draw: J, getRadialAttr: function (a, k) {
  993. return {cx: a[0] - a[2] / 2 + k.cx * a[2], cy: a[1] - a[2] / 2 + k.cy * a[2], r: k.r * a[2]}
  994. }, buildText: function (a) {
  995. var k = a.element, v = this, e = v.forExport, b = K(a.textStr, "").toString(),
  996. h = -1 !== b.indexOf("\x3c"), D = k.childNodes, x, m, y, n, F = r(k, "x"), d = a.styles, t = a.textWidth, w = d && d.lineHeight, l = d && d.textOutline, z = d && "ellipsis" === d.textOverflow, f = d && "nowrap" === d.whiteSpace, E = d && d.fontSize, q, g = D.length, d = t && !a.added && this.box, J = function (a) {
  997. var e;
  998. e = /(px|em)$/.test(a && a.style.fontSize) ? a.style.fontSize : E || v.style.fontSize || 12;
  999. return w ? I(w) : v.fontMetrics(e, a.getAttribute("style") ? a : k).h
  1000. };
  1001. q = [b, z, f, w, l, E, t].join();
  1002. if (q !== a.textCache) {
  1003. for (a.textCache = q; g--;)k.removeChild(D[g]);
  1004. h || l || z || t || -1 !==
  1005. b.indexOf(" ") ? (x = /<.*class="([^"]+)".*>/, m = /<.*style="([^"]+)".*>/, y = /<.*href="(http[^"]+)".*>/, d && d.appendChild(k), b = h ? b.replace(/<(b|strong)>/g, '\x3cspan style\x3d"font-weight:bold"\x3e').replace(/<(i|em)>/g, '\x3cspan style\x3d"font-style:italic"\x3e').replace(/<a/g, "\x3cspan").replace(/<\/(b|strong|i|em|a)>/g, "\x3c/span\x3e").split(/<br.*?>/g) : [b], b = c(b, function (a) {
  1006. return "" !== a
  1007. }), C(b, function (b, c) {
  1008. var h, D = 0;
  1009. b = b.replace(/^\s+|\s+$/g, "").replace(/<span/g, "|||\x3cspan").replace(/<\/span>/g, "\x3c/span\x3e|||");
  1010. h = b.split("|||");
  1011. C(h, function (b) {
  1012. if ("" !== b || 1 === h.length) {
  1013. var d = {}, w = p.createElementNS(v.SVG_NS, "tspan"), l, E;
  1014. x.test(b) && (l = b.match(x)[1], r(w, "class", l));
  1015. m.test(b) && (E = b.match(m)[1].replace(/(;| |^)color([ :])/, "$1fill$2"), r(w, "style", E));
  1016. y.test(b) && !e && (r(w, "onclick", 'location.href\x3d"' + b.match(y)[1] + '"'), u(w, {cursor: "pointer"}));
  1017. b = (b.replace(/<(.|\n)*?>/g, "") || " ").replace(/&lt;/g, "\x3c").replace(/&gt;/g, "\x3e");
  1018. if (" " !== b) {
  1019. w.appendChild(p.createTextNode(b));
  1020. D ? d.dx = 0 : c && null !== F && (d.x = F);
  1021. r(w, d);
  1022. k.appendChild(w);
  1023. !D && c && (!P && e && u(w, {display: "block"}), r(w, "dy", J(w)));
  1024. if (t) {
  1025. d = b.replace(/([^\^])-/g, "$1- ").split(" ");
  1026. l = 1 < h.length || c || 1 < d.length && !f;
  1027. for (var q, g, M = [], C = J(w), K = a.rotation, I = b, Q = I.length; (l || z) && (d.length || M.length);)a.rotation = 0, q = a.getBBox(!0), g = q.width, !P && v.forExport && (g = v.measureSpanWidth(w.firstChild.data, a.styles)), q = g > t, void 0 === n && (n = q), z && n ? (Q /= 2, "" === I || !q && .5 > Q ? d = [] : (I = b.substring(0, I.length + (q ? -1 : 1) * Math.ceil(Q)), d = [I + (3 < t ? "\u2026" : "")], w.removeChild(w.firstChild))) :
  1028. q && 1 !== d.length ? (w.removeChild(w.firstChild), M.unshift(d.pop())) : (d = M, M = [], d.length && !f && (w = p.createElementNS(N, "tspan"), r(w, {
  1029. dy: C,
  1030. x: F
  1031. }), E && r(w, "style", E), k.appendChild(w)), g > t && (t = g)), d.length && w.appendChild(p.createTextNode(d.join(" ").replace(/- /g, "-")));
  1032. a.rotation = K
  1033. }
  1034. D++
  1035. }
  1036. }
  1037. })
  1038. }), n && a.attr("title", a.textStr), d && d.removeChild(k), l && a.applyTextOutline && a.applyTextOutline(l)) : k.appendChild(p.createTextNode(b.replace(/&lt;/g, "\x3c").replace(/&gt;/g, "\x3e")))
  1039. }
  1040. }, getContrast: function (a) {
  1041. a = f(a).rgba;
  1042. return 510 <
  1043. a[0] + a[1] + a[2] ? "#000000" : "#FFFFFF"
  1044. }, button: function (a, k, e, b, c, h, D, m, d) {
  1045. var v = this.label(a, k, e, d, null, null, null, null, "button"), n = 0;
  1046. v.attr(y({padding: 8, r: 2}, c));
  1047. var F, w, p, l;
  1048. c = y({
  1049. fill: "#f7f7f7",
  1050. stroke: "#cccccc",
  1051. "stroke-width": 1,
  1052. style: {color: "#333333", cursor: "pointer", fontWeight: "normal"}
  1053. }, c);
  1054. F = c.style;
  1055. delete c.style;
  1056. h = y(c, {fill: "#e6e6e6"}, h);
  1057. w = h.style;
  1058. delete h.style;
  1059. D = y(c, {fill: "#e6ebf5", style: {color: "#000000", fontWeight: "bold"}}, D);
  1060. p = D.style;
  1061. delete D.style;
  1062. m = y(c, {style: {color: "#cccccc"}}, m);
  1063. l = m.style;
  1064. delete m.style;
  1065. H(v.element, x ? "mouseover" : "mouseenter", function () {
  1066. 3 !== n && v.setState(1)
  1067. });
  1068. H(v.element, x ? "mouseout" : "mouseleave", function () {
  1069. 3 !== n && v.setState(n)
  1070. });
  1071. v.setState = function (a) {
  1072. 1 !== a && (v.state = n = a);
  1073. v.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-" + ["normal", "hover", "pressed", "disabled"][a || 0]);
  1074. v.attr([c, h, D, m][a || 0]).css([F, w, p, l][a || 0])
  1075. };
  1076. v.attr(c).css(t({cursor: "default"}, F));
  1077. return v.on("click", function (a) {
  1078. 3 !== n && b.call(v, a)
  1079. })
  1080. }, crispLine: function (a,
  1081. k) {
  1082. a[1] === a[4] && (a[1] = a[4] = Math.round(a[1]) - k % 2 / 2);
  1083. a[2] === a[5] && (a[2] = a[5] = Math.round(a[2]) + k % 2 / 2);
  1084. return a
  1085. }, path: function (a) {
  1086. var k = {fill: "none"};
  1087. z(a) ? k.d = a : F(a) && t(k, a);
  1088. return this.createElement("path").attr(k)
  1089. }, circle: function (a, k, e) {
  1090. a = F(a) ? a : {x: a, y: k, r: e};
  1091. k = this.createElement("circle");
  1092. k.xSetter = k.ySetter = function (a, k, e) {
  1093. e.setAttribute("c" + k, a)
  1094. };
  1095. return k.attr(a)
  1096. }, arc: function (a, k, e, b, c, h) {
  1097. F(a) && (k = a.y, e = a.r, b = a.innerR, c = a.start, h = a.end, a = a.x);
  1098. a = this.symbol("arc", a || 0, k || 0, e || 0, e || 0, {
  1099. innerR: b ||
  1100. 0, start: c || 0, end: h || 0
  1101. });
  1102. a.r = e;
  1103. return a
  1104. }, rect: function (a, k, e, b, c, h) {
  1105. c = F(a) ? a.r : c;
  1106. var v = this.createElement("rect");
  1107. a = F(a) ? a : void 0 === a ? {} : {x: a, y: k, width: Math.max(e, 0), height: Math.max(b, 0)};
  1108. void 0 !== h && (a.strokeWidth = h, a = v.crisp(a));
  1109. a.fill = "none";
  1110. c && (a.r = c);
  1111. v.rSetter = function (a, k, e) {
  1112. r(e, {rx: a, ry: a})
  1113. };
  1114. return v.attr(a)
  1115. }, setSize: function (a, k, e) {
  1116. var b = this.alignedObjects, v = b.length;
  1117. this.width = a;
  1118. this.height = k;
  1119. for (this.boxWrapper.animate({width: a, height: k}, {
  1120. step: function () {
  1121. this.attr({
  1122. viewBox: "0 0 " + this.attr("width") +
  1123. " " + this.attr("height")
  1124. })
  1125. }, duration: K(e, !0) ? void 0 : 0
  1126. }); v--;)b[v].align()
  1127. }, g: function (a) {
  1128. var k = this.createElement("g");
  1129. return a ? k.attr({"class": "highcharts-" + a}) : k
  1130. }, image: function (a, k, e, b, c) {
  1131. var v = {preserveAspectRatio: "none"};
  1132. 1 < arguments.length && t(v, {x: k, y: e, width: b, height: c});
  1133. v = this.createElement("image").attr(v);
  1134. v.element.setAttributeNS ? v.element.setAttributeNS("http://www.w3.org/1999/xlink", "href", a) : v.element.setAttribute("hc-svg-href", a);
  1135. return v
  1136. }, symbol: function (a, k, e, b, c, h) {
  1137. var v = this, D, x = this.symbols[a],
  1138. m = q(k) && x && this.symbols[a](Math.round(k), Math.round(e), b, c, h), y = /^url\((.*?)\)$/, d, n;
  1139. x ? (D = this.path(m), D.attr("fill", "none"), t(D, {
  1140. symbolName: a,
  1141. x: k,
  1142. y: e,
  1143. width: b,
  1144. height: c
  1145. }), h && t(D, h)) : y.test(a) && (d = a.match(y)[1], D = this.image(d), D.imgwidth = K(S[d] && S[d].width, h && h.width), D.imgheight = K(S[d] && S[d].height, h && h.height), n = function () {
  1146. D.attr({width: D.width, height: D.height})
  1147. }, C(["width", "height"], function (a) {
  1148. D[a + "Setter"] = function (a, k) {
  1149. var e = {}, b = this["img" + k], v = "width" === k ? "translateX" : "translateY";
  1150. this[k] = a;
  1151. q(b) && (this.element && this.element.setAttribute(k, b), this.alignByTranslate || (e[v] = ((this[k] || 0) - b) / 2, this.attr(e)))
  1152. }
  1153. }), q(k) && D.attr({
  1154. x: k,
  1155. y: e
  1156. }), D.isImg = !0, q(D.imgwidth) && q(D.imgheight) ? n() : (D.attr({width: 0, height: 0}), l("img", {
  1157. onload: function () {
  1158. var a = g[v.chartIndex];
  1159. 0 === this.width && (u(this, {position: "absolute", top: "-999em"}), p.body.appendChild(this));
  1160. S[d] = {width: this.width, height: this.height};
  1161. D.imgwidth = this.width;
  1162. D.imgheight = this.height;
  1163. D.element && n();
  1164. this.parentNode && this.parentNode.removeChild(this);
  1165. v.imgCount--;
  1166. if (!v.imgCount && a && a.onload)a.onload()
  1167. }, src: d
  1168. }), this.imgCount++));
  1169. return D
  1170. }, symbols: {
  1171. circle: function (a, k, e, b) {
  1172. return this.arc(a + e / 2, k + b / 2, e / 2, b / 2, {start: 0, end: 2 * Math.PI, open: !1})
  1173. }, square: function (a, k, e, b) {
  1174. return ["M", a, k, "L", a + e, k, a + e, k + b, a, k + b, "Z"]
  1175. }, triangle: function (a, k, e, b) {
  1176. return ["M", a + e / 2, k, "L", a + e, k + b, a, k + b, "Z"]
  1177. }, "triangle-down": function (a, k, e, b) {
  1178. return ["M", a, k, "L", a + e, k, a + e / 2, k + b, "Z"]
  1179. }, diamond: function (a, k, e, b) {
  1180. return ["M", a + e / 2, k, "L", a + e, k + b / 2, a + e / 2, k + b, a, k + b / 2, "Z"]
  1181. }, arc: function (a,
  1182. k, e, b, c) {
  1183. var v = c.start, h = c.r || e, D = c.r || b || e, x = c.end - .001;
  1184. e = c.innerR;
  1185. b = c.open;
  1186. var m = Math.cos(v), d = Math.sin(v), y = Math.cos(x), x = Math.sin(x);
  1187. c = c.end - v < Math.PI ? 0 : 1;
  1188. h = ["M", a + h * m, k + D * d, "A", h, D, 0, c, 1, a + h * y, k + D * x];
  1189. q(e) && h.push(b ? "M" : "L", a + e * y, k + e * x, "A", e, e, 0, c, 0, a + e * m, k + e * d);
  1190. h.push(b ? "" : "Z");
  1191. return h
  1192. }, callout: function (a, k, e, b, c) {
  1193. var h = Math.min(c && c.r || 0, e, b), D = h + 6, v = c && c.anchorX;
  1194. c = c && c.anchorY;
  1195. var x;
  1196. x = ["M", a + h, k, "L", a + e - h, k, "C", a + e, k, a + e, k, a + e, k + h, "L", a + e, k + b - h, "C", a + e, k + b, a + e, k + b, a + e - h, k + b, "L", a + h, k + b, "C",
  1197. a, k + b, a, k + b, a, k + b - h, "L", a, k + h, "C", a, k, a, k, a + h, k];
  1198. v && v > e ? c > k + D && c < k + b - D ? x.splice(13, 3, "L", a + e, c - 6, a + e + 6, c, a + e, c + 6, a + e, k + b - h) : x.splice(13, 3, "L", a + e, b / 2, v, c, a + e, b / 2, a + e, k + b - h) : v && 0 > v ? c > k + D && c < k + b - D ? x.splice(33, 3, "L", a, c + 6, a - 6, c, a, c - 6, a, k + h) : x.splice(33, 3, "L", a, b / 2, v, c, a, b / 2, a, k + h) : c && c > b && v > a + D && v < a + e - D ? x.splice(23, 3, "L", v + 6, k + b, v, k + b + 6, v - 6, k + b, a + h, k + b) : c && 0 > c && v > a + D && v < a + e - D && x.splice(3, 3, "L", v - 6, k, v, k - 6, v + 6, k, e - h, k);
  1199. return x
  1200. }
  1201. }, clipRect: function (k, e, b, c) {
  1202. var h = a.uniqueKey(), D = this.createElement("clipPath").attr({id: h}).add(this.defs);
  1203. k = this.rect(k, e, b, c, 0).add(D);
  1204. k.id = h;
  1205. k.clipPath = D;
  1206. k.count = 0;
  1207. return k
  1208. }, text: function (a, k, e, b) {
  1209. var c = !P && this.forExport, h = {};
  1210. if (b && (this.allowHTML || !this.forExport))return this.html(a, k, e);
  1211. h.x = Math.round(k || 0);
  1212. e && (h.y = Math.round(e));
  1213. if (a || 0 === a)h.text = a;
  1214. a = this.createElement("text").attr(h);
  1215. c && a.css({position: "absolute"});
  1216. b || (a.xSetter = function (a, k, e) {
  1217. var b = e.getElementsByTagName("tspan"), c, h = e.getAttribute(k), D;
  1218. for (D = 0; D < b.length; D++)c = b[D], c.getAttribute(k) === h && c.setAttribute(k, a);
  1219. e.setAttribute(k,
  1220. a)
  1221. });
  1222. return a
  1223. }, fontMetrics: function (a, k) {
  1224. a = a || k && k.style && k.style.fontSize || this.style && this.style.fontSize;
  1225. a = /px/.test(a) ? I(a) : /em/.test(a) ? parseFloat(a) * (k ? this.fontMetrics(null, k.parentNode).f : 16) : 12;
  1226. k = 24 > a ? a + 3 : Math.round(1.2 * a);
  1227. return {h: k, b: Math.round(.8 * k), f: a}
  1228. }, rotCorr: function (a, k, e) {
  1229. var b = a;
  1230. k && e && (b = Math.max(b * Math.cos(k * d), 4));
  1231. return {x: -a / 3 * Math.sin(k * d), y: b}
  1232. }, label: function (a, e, b, c, h, D, x, m, d) {
  1233. var v = this, n = v.g("button" !== d && "label"), F = n.text = v.text("", 0, 0, x).attr({zIndex: 1}), w, p, l = 0, z = 3,
  1234. E = 0, f, g, J, K, P, N = {}, I, u, r = /^url\((.*?)\)$/.test(c), M = r, S, Q, R, O;
  1235. d && n.addClass("highcharts-" + d);
  1236. M = r;
  1237. S = function () {
  1238. return (I || 0) % 2 / 2
  1239. };
  1240. Q = function () {
  1241. var a = F.element.style, k = {};
  1242. p = (void 0 === f || void 0 === g || P) && q(F.textStr) && F.getBBox();
  1243. n.width = (f || p.width || 0) + 2 * z + E;
  1244. n.height = (g || p.height || 0) + 2 * z;
  1245. u = z + v.fontMetrics(a && a.fontSize, F).b;
  1246. M && (w || (n.box = w = v.symbols[c] || r ? v.symbol(c) : v.rect(), w.addClass(("button" === d ? "" : "highcharts-label-box") + (d ? " highcharts-" + d + "-box" : "")), w.add(n), a = S(), k.x = a, k.y = (m ? -u : 0) + a), k.width =
  1247. Math.round(n.width), k.height = Math.round(n.height), w.attr(t(k, N)), N = {})
  1248. };
  1249. R = function () {
  1250. var a = E + z, k;
  1251. k = m ? 0 : u;
  1252. q(f) && p && ("center" === P || "right" === P) && (a += {center: .5, right: 1}[P] * (f - p.width));
  1253. if (a !== F.x || k !== F.y)F.attr("x", a), void 0 !== k && F.attr("y", k);
  1254. F.x = a;
  1255. F.y = k
  1256. };
  1257. O = function (a, k) {
  1258. w ? w.attr(a, k) : N[a] = k
  1259. };
  1260. n.onAdd = function () {
  1261. F.add(n);
  1262. n.attr({text: a || 0 === a ? a : "", x: e, y: b});
  1263. w && q(h) && n.attr({anchorX: h, anchorY: D})
  1264. };
  1265. n.widthSetter = function (a) {
  1266. f = a
  1267. };
  1268. n.heightSetter = function (a) {
  1269. g = a
  1270. };
  1271. n["text-alignSetter"] = function (a) {
  1272. P = a
  1273. };
  1274. n.paddingSetter = function (a) {
  1275. q(a) && a !== z && (z = n.padding = a, R())
  1276. };
  1277. n.paddingLeftSetter = function (a) {
  1278. q(a) && a !== E && (E = a, R())
  1279. };
  1280. n.alignSetter = function (a) {
  1281. a = {left: 0, center: .5, right: 1}[a];
  1282. a !== l && (l = a, p && n.attr({x: J}))
  1283. };
  1284. n.textSetter = function (a) {
  1285. void 0 !== a && F.textSetter(a);
  1286. Q();
  1287. R()
  1288. };
  1289. n["stroke-widthSetter"] = function (a, k) {
  1290. a && (M = !0);
  1291. I = this["stroke-width"] = a;
  1292. O(k, a)
  1293. };
  1294. n.strokeSetter = n.fillSetter = n.rSetter = function (a, k) {
  1295. "fill" === k && a && (M = !0);
  1296. O(k, a)
  1297. };
  1298. n.anchorXSetter = function (a, k) {
  1299. h = a;
  1300. O(k, Math.round(a) - S() - J)
  1301. };
  1302. n.anchorYSetter =
  1303. function (a, k) {
  1304. D = a;
  1305. O(k, a - K)
  1306. };
  1307. n.xSetter = function (a) {
  1308. n.x = a;
  1309. l && (a -= l * ((f || p.width) + 2 * z));
  1310. J = Math.round(a);
  1311. n.attr("translateX", J)
  1312. };
  1313. n.ySetter = function (a) {
  1314. K = n.y = Math.round(a);
  1315. n.attr("translateY", K)
  1316. };
  1317. var V = n.css;
  1318. return t(n, {
  1319. css: function (a) {
  1320. if (a) {
  1321. var k = {};
  1322. a = y(a);
  1323. C(n.textProps, function (e) {
  1324. void 0 !== a[e] && (k[e] = a[e], delete a[e])
  1325. });
  1326. F.css(k)
  1327. }
  1328. return V.call(n, a)
  1329. }, getBBox: function () {
  1330. return {width: p.width + 2 * z, height: p.height + 2 * z, x: p.x - z, y: p.y - z}
  1331. }, shadow: function (a) {
  1332. a && (Q(), w && w.shadow(a));
  1333. return n
  1334. }, destroy: function () {
  1335. k(n.element,
  1336. "mouseenter");
  1337. k(n.element, "mouseleave");
  1338. F && (F = F.destroy());
  1339. w && (w = w.destroy());
  1340. B.prototype.destroy.call(n);
  1341. n = v = Q = R = O = null
  1342. }
  1343. })
  1344. }
  1345. };
  1346. a.Renderer = A
  1347. })(L);
  1348. (function (a) {
  1349. var B = a.attr, A = a.createElement, H = a.css, G = a.defined, r = a.each, g = a.extend, f = a.isFirefox, u = a.isMS, l = a.isWebKit, q = a.pInt, d = a.SVGRenderer, b = a.win, p = a.wrap;
  1350. g(a.SVGElement.prototype, {
  1351. htmlCss: function (a) {
  1352. var b = this.element;
  1353. if (b = a && "SPAN" === b.tagName && a.width)delete a.width, this.textWidth = b, this.updateTransform();
  1354. a && "ellipsis" === a.textOverflow && (a.whiteSpace =
  1355. "nowrap", a.overflow = "hidden");
  1356. this.styles = g(this.styles, a);
  1357. H(this.element, a);
  1358. return this
  1359. }, htmlGetBBox: function () {
  1360. var a = this.element;
  1361. "text" === a.nodeName && (a.style.position = "absolute");
  1362. return {x: a.offsetLeft, y: a.offsetTop, width: a.offsetWidth, height: a.offsetHeight}
  1363. }, htmlUpdateTransform: function () {
  1364. if (this.added) {
  1365. var a = this.renderer, b = this.element, m = this.translateX || 0, c = this.translateY || 0, n = this.x || 0, d = this.y || 0, p = this.textAlign || "left", e = {
  1366. left: 0,
  1367. center: .5,
  1368. right: 1
  1369. }[p], x = this.styles;
  1370. H(b, {marginLeft: m, marginTop: c});
  1371. this.shadows && r(this.shadows, function (a) {
  1372. H(a, {marginLeft: m + 1, marginTop: c + 1})
  1373. });
  1374. this.inverted && r(b.childNodes, function (e) {
  1375. a.invertChild(e, b)
  1376. });
  1377. if ("SPAN" === b.tagName) {
  1378. var F = this.rotation, w = q(this.textWidth), h = x && x.whiteSpace, y = [F, p, b.innerHTML, this.textWidth, this.textAlign].join();
  1379. y !== this.cTT && (x = a.fontMetrics(b.style.fontSize).b, G(F) && this.setSpanRotation(F, e, x), H(b, {
  1380. width: "",
  1381. whiteSpace: h || "nowrap"
  1382. }), b.offsetWidth > w && /[ \-]/.test(b.textContent || b.innerText) && H(b, {
  1383. width: w + "px", display: "block", whiteSpace: h ||
  1384. "normal"
  1385. }), this.getSpanCorrection(b.offsetWidth, x, e, F, p));
  1386. H(b, {left: n + (this.xCorr || 0) + "px", top: d + (this.yCorr || 0) + "px"});
  1387. l && (x = b.offsetHeight);
  1388. this.cTT = y
  1389. }
  1390. } else this.alignOnAdd = !0
  1391. }, setSpanRotation: function (a, d, m) {
  1392. var c = {}, n = u ? "-ms-transform" : l ? "-webkit-transform" : f ? "MozTransform" : b.opera ? "-o-transform" : "";
  1393. c[n] = c.transform = "rotate(" + a + "deg)";
  1394. c[n + (f ? "Origin" : "-origin")] = c.transformOrigin = 100 * d + "% " + m + "px";
  1395. H(this.element, c)
  1396. }, getSpanCorrection: function (a, b, m) {
  1397. this.xCorr = -a * m;
  1398. this.yCorr = -b
  1399. }
  1400. });
  1401. g(d.prototype,
  1402. {
  1403. html: function (a, b, m) {
  1404. var c = this.createElement("span"), n = c.element, d = c.renderer, l = d.isSVG, e = function (a, e) {
  1405. r(["opacity", "visibility"], function (b) {
  1406. p(a, b + "Setter", function (a, b, c, x) {
  1407. a.call(this, b, c, x);
  1408. e[c] = b
  1409. })
  1410. })
  1411. };
  1412. c.textSetter = function (a) {
  1413. a !== n.innerHTML && delete this.bBox;
  1414. n.innerHTML = this.textStr = a;
  1415. c.htmlUpdateTransform()
  1416. };
  1417. l && e(c, c.element.style);
  1418. c.xSetter = c.ySetter = c.alignSetter = c.rotationSetter = function (a, e) {
  1419. "align" === e && (e = "textAlign");
  1420. c[e] = a;
  1421. c.htmlUpdateTransform()
  1422. };
  1423. c.attr({
  1424. text: a, x: Math.round(b),
  1425. y: Math.round(m)
  1426. }).css({fontFamily: this.style.fontFamily, fontSize: this.style.fontSize, position: "absolute"});
  1427. n.style.whiteSpace = "nowrap";
  1428. c.css = c.htmlCss;
  1429. l && (c.add = function (a) {
  1430. var b, x = d.box.parentNode, h = [];
  1431. if (this.parentGroup = a) {
  1432. if (b = a.div, !b) {
  1433. for (; a;)h.push(a), a = a.parentGroup;
  1434. r(h.reverse(), function (a) {
  1435. var n, m = B(a.element, "class");
  1436. m && (m = {className: m});
  1437. b = a.div = a.div || A("div", m, {
  1438. position: "absolute",
  1439. left: (a.translateX || 0) + "px",
  1440. top: (a.translateY || 0) + "px",
  1441. display: a.display,
  1442. opacity: a.opacity,
  1443. pointerEvents: a.styles &&
  1444. a.styles.pointerEvents
  1445. }, b || x);
  1446. n = b.style;
  1447. g(a, {
  1448. on: function () {
  1449. c.on.apply({element: h[0].div}, arguments);
  1450. return a
  1451. }, translateXSetter: function (e, k) {
  1452. n.left = e + "px";
  1453. a[k] = e;
  1454. a.doTransform = !0
  1455. }, translateYSetter: function (e, k) {
  1456. n.top = e + "px";
  1457. a[k] = e;
  1458. a.doTransform = !0
  1459. }
  1460. });
  1461. e(a, n)
  1462. })
  1463. }
  1464. } else b = x;
  1465. b.appendChild(n);
  1466. c.added = !0;
  1467. c.alignOnAdd && c.htmlUpdateTransform();
  1468. return c
  1469. });
  1470. return c
  1471. }
  1472. })
  1473. })(L);
  1474. (function (a) {
  1475. var B, A, H = a.createElement, G = a.css, r = a.defined, g = a.deg2rad, f = a.discardElement, u = a.doc, l = a.each, q = a.erase, d = a.extend;
  1476. B = a.extendClass;
  1477. var b = a.isArray, p = a.isNumber, C = a.isObject, t = a.merge;
  1478. A = a.noop;
  1479. var m = a.pick, c = a.pInt, n = a.SVGElement, E = a.SVGRenderer, z = a.win;
  1480. a.svg || (A = {
  1481. docMode8: u && 8 === u.documentMode, init: function (a, b) {
  1482. var e = ["\x3c", b, ' filled\x3d"f" stroked\x3d"f"'], c = ["position: ", "absolute", ";"], h = "div" === b;
  1483. ("shape" === b || h) && c.push("left:0;top:0;width:1px;height:1px;");
  1484. c.push("visibility: ", h ? "hidden" : "visible");
  1485. e.push(' style\x3d"', c.join(""), '"/\x3e');
  1486. b && (e = h || "span" === b || "img" === b ? e.join("") : a.prepVML(e), this.element = H(e));
  1487. this.renderer =
  1488. a
  1489. }, add: function (a) {
  1490. var e = this.renderer, b = this.element, c = e.box, h = a && a.inverted, c = a ? a.element || a : c;
  1491. a && (this.parentGroup = a);
  1492. h && e.invertChild(b, c);
  1493. c.appendChild(b);
  1494. this.added = !0;
  1495. this.alignOnAdd && !this.deferUpdateTransform && this.updateTransform();
  1496. if (this.onAdd)this.onAdd();
  1497. this.className && this.attr("class", this.className);
  1498. return this
  1499. }, updateTransform: n.prototype.htmlUpdateTransform, setSpanRotation: function () {
  1500. var a = this.rotation, b = Math.cos(a * g), c = Math.sin(a * g);
  1501. G(this.element, {
  1502. filter: a ? ["progid:DXImageTransform.Microsoft.Matrix(M11\x3d",
  1503. b, ", M12\x3d", -c, ", M21\x3d", c, ", M22\x3d", b, ", sizingMethod\x3d'auto expand')"].join("") : "none"
  1504. })
  1505. }, getSpanCorrection: function (a, b, c, n, h) {
  1506. var e = n ? Math.cos(n * g) : 1, x = n ? Math.sin(n * g) : 0, d = m(this.elemHeight, this.element.offsetHeight), F;
  1507. this.xCorr = 0 > e && -a;
  1508. this.yCorr = 0 > x && -d;
  1509. F = 0 > e * x;
  1510. this.xCorr += x * b * (F ? 1 - c : c);
  1511. this.yCorr -= e * b * (n ? F ? c : 1 - c : 1);
  1512. h && "left" !== h && (this.xCorr -= a * c * (0 > e ? -1 : 1), n && (this.yCorr -= d * c * (0 > x ? -1 : 1)), G(this.element, {textAlign: h}))
  1513. }, pathToVML: function (a) {
  1514. for (var b = a.length, e = []; b--;)p(a[b]) ? e[b] =
  1515. Math.round(10 * a[b]) - 5 : "Z" === a[b] ? e[b] = "x" : (e[b] = a[b], !a.isArc || "wa" !== a[b] && "at" !== a[b] || (e[b + 5] === e[b + 7] && (e[b + 7] += a[b + 7] > a[b + 5] ? 1 : -1), e[b + 6] === e[b + 8] && (e[b + 8] += a[b + 8] > a[b + 6] ? 1 : -1)));
  1516. return e.join(" ") || "x"
  1517. }, clip: function (a) {
  1518. var b = this, e;
  1519. a ? (e = a.members, q(e, b), e.push(b), b.destroyClip = function () {
  1520. q(e, b)
  1521. }, a = a.getCSS(b)) : (b.destroyClip && b.destroyClip(), a = {clip: b.docMode8 ? "inherit" : "rect(auto)"});
  1522. return b.css(a)
  1523. }, css: n.prototype.htmlCss, safeRemoveChild: function (a) {
  1524. a.parentNode && f(a)
  1525. }, destroy: function () {
  1526. this.destroyClip &&
  1527. this.destroyClip();
  1528. return n.prototype.destroy.apply(this)
  1529. }, on: function (a, b) {
  1530. this.element["on" + a] = function () {
  1531. var a = z.event;
  1532. a.target = a.srcElement;
  1533. b(a)
  1534. };
  1535. return this
  1536. }, cutOffPath: function (a, b) {
  1537. var e;
  1538. a = a.split(/[ ,]/);
  1539. e = a.length;
  1540. if (9 === e || 11 === e)a[e - 4] = a[e - 2] = c(a[e - 2]) - 10 * b;
  1541. return a.join(" ")
  1542. }, shadow: function (a, b, n) {
  1543. var e = [], h, d = this.element, x = this.renderer, p, F = d.style, k, D = d.path, l, t, z, f;
  1544. D && "string" !== typeof D.value && (D = "x");
  1545. t = D;
  1546. if (a) {
  1547. z = m(a.width, 3);
  1548. f = (a.opacity || .15) / z;
  1549. for (h = 1; 3 >= h; h++)l = 2 * z + 1 - 2 * h, n &&
  1550. (t = this.cutOffPath(D.value, l + .5)), k = ['\x3cshape isShadow\x3d"true" strokeweight\x3d"', l, '" filled\x3d"false" path\x3d"', t, '" coordsize\x3d"10 10" style\x3d"', d.style.cssText, '" /\x3e'], p = H(x.prepVML(k), null, {
  1551. left: c(F.left) + m(a.offsetX, 1),
  1552. top: c(F.top) + m(a.offsetY, 1)
  1553. }), n && (p.cutOff = l + 1), k = ['\x3cstroke color\x3d"', a.color || "#000000", '" opacity\x3d"', f * h, '"/\x3e'], H(x.prepVML(k), null, null, p), b ? b.element.appendChild(p) : d.parentNode.insertBefore(p, d), e.push(p);
  1554. this.shadows = e
  1555. }
  1556. return this
  1557. }, updateShadows: A,
  1558. setAttr: function (a, b) {
  1559. this.docMode8 ? this.element[a] = b : this.element.setAttribute(a, b)
  1560. }, classSetter: function (a) {
  1561. (this.added ? this.element : this).className = a
  1562. }, dashstyleSetter: function (a, b, c) {
  1563. (c.getElementsByTagName("stroke")[0] || H(this.renderer.prepVML(["\x3cstroke/\x3e"]), null, null, c))[b] = a || "solid";
  1564. this[b] = a
  1565. }, dSetter: function (a, b, c) {
  1566. var e = this.shadows;
  1567. a = a || [];
  1568. this.d = a.join && a.join(" ");
  1569. c.path = a = this.pathToVML(a);
  1570. if (e)for (c = e.length; c--;)e[c].path = e[c].cutOff ? this.cutOffPath(a, e[c].cutOff) : a;
  1571. this.setAttr(b,
  1572. a)
  1573. }, fillSetter: function (a, b, c) {
  1574. var e = c.nodeName;
  1575. "SPAN" === e ? c.style.color = a : "IMG" !== e && (c.filled = "none" !== a, this.setAttr("fillcolor", this.renderer.color(a, c, b, this)))
  1576. }, "fill-opacitySetter": function (a, b, c) {
  1577. H(this.renderer.prepVML(["\x3c", b.split("-")[0], ' opacity\x3d"', a, '"/\x3e']), null, null, c)
  1578. }, opacitySetter: A, rotationSetter: function (a, b, c) {
  1579. c = c.style;
  1580. this[b] = c[b] = a;
  1581. c.left = -Math.round(Math.sin(a * g) + 1) + "px";
  1582. c.top = Math.round(Math.cos(a * g)) + "px"
  1583. }, strokeSetter: function (a, b, c) {
  1584. this.setAttr("strokecolor",
  1585. this.renderer.color(a, c, b, this))
  1586. }, "stroke-widthSetter": function (a, b, c) {
  1587. c.stroked = !!a;
  1588. this[b] = a;
  1589. p(a) && (a += "px");
  1590. this.setAttr("strokeweight", a)
  1591. }, titleSetter: function (a, b) {
  1592. this.setAttr(b, a)
  1593. }, visibilitySetter: function (a, b, c) {
  1594. "inherit" === a && (a = "visible");
  1595. this.shadows && l(this.shadows, function (c) {
  1596. c.style[b] = a
  1597. });
  1598. "DIV" === c.nodeName && (a = "hidden" === a ? "-999em" : 0, this.docMode8 || (c.style[b] = a ? "visible" : "hidden"), b = "top");
  1599. c.style[b] = a
  1600. }, xSetter: function (a, b, c) {
  1601. this[b] = a;
  1602. "x" === b ? b = "left" : "y" === b && (b = "top");
  1603. this.updateClipping ?
  1604. (this[b] = a, this.updateClipping()) : c.style[b] = a
  1605. }, zIndexSetter: function (a, b, c) {
  1606. c.style[b] = a
  1607. }
  1608. }, A["stroke-opacitySetter"] = A["fill-opacitySetter"], a.VMLElement = A = B(n, A), A.prototype.ySetter = A.prototype.widthSetter = A.prototype.heightSetter = A.prototype.xSetter, A = {
  1609. Element: A, isIE8: -1 < z.navigator.userAgent.indexOf("MSIE 8.0"), init: function (a, b, c) {
  1610. var e, h;
  1611. this.alignedObjects = [];
  1612. e = this.createElement("div").css({position: "relative"});
  1613. h = e.element;
  1614. a.appendChild(e.element);
  1615. this.isVML = !0;
  1616. this.box = h;
  1617. this.boxWrapper =
  1618. e;
  1619. this.gradients = {};
  1620. this.cache = {};
  1621. this.cacheKeys = [];
  1622. this.imgCount = 0;
  1623. this.setSize(b, c, !1);
  1624. if (!u.namespaces.hcv) {
  1625. u.namespaces.add("hcv", "urn:schemas-microsoft-com:vml");
  1626. try {
  1627. u.createStyleSheet().cssText = "hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "
  1628. } catch (y) {
  1629. u.styleSheets[0].cssText += "hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "
  1630. }
  1631. }
  1632. }, isHidden: function () {
  1633. return !this.box.offsetWidth
  1634. },
  1635. clipRect: function (a, b, c, n) {
  1636. var e = this.createElement(), m = C(a);
  1637. return d(e, {
  1638. members: [],
  1639. count: 0,
  1640. left: (m ? a.x : a) + 1,
  1641. top: (m ? a.y : b) + 1,
  1642. width: (m ? a.width : c) - 1,
  1643. height: (m ? a.height : n) - 1,
  1644. getCSS: function (a) {
  1645. var b = a.element, c = b.nodeName, k = a.inverted, e = this.top - ("shape" === c ? b.offsetTop : 0), h = this.left, b = h + this.width, n = e + this.height, e = {clip: "rect(" + Math.round(k ? h : e) + "px," + Math.round(k ? n : b) + "px," + Math.round(k ? b : n) + "px," + Math.round(k ? e : h) + "px)"};
  1646. !k && a.docMode8 && "DIV" === c && d(e, {width: b + "px", height: n + "px"});
  1647. return e
  1648. },
  1649. updateClipping: function () {
  1650. l(e.members,
  1651. function (a) {
  1652. a.element && a.css(e.getCSS(a))
  1653. })
  1654. }
  1655. })
  1656. }, color: function (b, c, n, m) {
  1657. var e = this, d, x = /^rgba/, p, t, k = "none";
  1658. b && b.linearGradient ? t = "gradient" : b && b.radialGradient && (t = "pattern");
  1659. if (t) {
  1660. var D, w, z = b.linearGradient || b.radialGradient, f, E, v, q, g, F = "";
  1661. b = b.stops;
  1662. var C, u = [], r = function () {
  1663. p = ['\x3cfill colors\x3d"' + u.join(",") + '" opacity\x3d"', v, '" o:opacity2\x3d"', E, '" type\x3d"', t, '" ', F, 'focus\x3d"100%" method\x3d"any" /\x3e'];
  1664. H(e.prepVML(p), null, null, c)
  1665. };
  1666. f = b[0];
  1667. C = b[b.length - 1];
  1668. 0 < f[0] && b.unshift([0, f[1]]);
  1669. 1 >
  1670. C[0] && b.push([1, C[1]]);
  1671. l(b, function (k, b) {
  1672. x.test(k[1]) ? (d = a.color(k[1]), D = d.get("rgb"), w = d.get("a")) : (D = k[1], w = 1);
  1673. u.push(100 * k[0] + "% " + D);
  1674. b ? (v = w, q = D) : (E = w, g = D)
  1675. });
  1676. if ("fill" === n)if ("gradient" === t)n = z.x1 || z[0] || 0, b = z.y1 || z[1] || 0, f = z.x2 || z[2] || 0, z = z.y2 || z[3] || 0, F = 'angle\x3d"' + (90 - 180 * Math.atan((z - b) / (f - n)) / Math.PI) + '"', r(); else {
  1677. var k = z.r, A = 2 * k, B = 2 * k, G = z.cx, U = z.cy, L = c.radialReference, T, k = function () {
  1678. L && (T = m.getBBox(), G += (L[0] - T.x) / T.width - .5, U += (L[1] - T.y) / T.height - .5, A *= L[2] / T.width, B *= L[2] / T.height);
  1679. F =
  1680. 'src\x3d"' + a.getOptions().global.VMLRadialGradientURL + '" size\x3d"' + A + "," + B + '" origin\x3d"0.5,0.5" position\x3d"' + G + "," + U + '" color2\x3d"' + g + '" ';
  1681. r()
  1682. };
  1683. m.added ? k() : m.onAdd = k;
  1684. k = q
  1685. } else k = D
  1686. } else x.test(b) && "IMG" !== c.tagName ? (d = a.color(b), m[n + "-opacitySetter"](d.get("a"), n, c), k = d.get("rgb")) : (k = c.getElementsByTagName(n), k.length && (k[0].opacity = 1, k[0].type = "solid"), k = b);
  1687. return k
  1688. }, prepVML: function (a) {
  1689. var b = this.isIE8;
  1690. a = a.join("");
  1691. b ? (a = a.replace("/\x3e", ' xmlns\x3d"urn:schemas-microsoft-com:vml" /\x3e'), a =
  1692. -1 === a.indexOf('style\x3d"') ? a.replace("/\x3e", ' style\x3d"display:inline-block;behavior:url(#default#VML);" /\x3e') : a.replace('style\x3d"', 'style\x3d"display:inline-block;behavior:url(#default#VML);')) : a = a.replace("\x3c", "\x3chcv:");
  1693. return a
  1694. }, text: E.prototype.html, path: function (a) {
  1695. var c = {coordsize: "10 10"};
  1696. b(a) ? c.d = a : C(a) && d(c, a);
  1697. return this.createElement("shape").attr(c)
  1698. }, circle: function (a, b, c) {
  1699. var e = this.symbol("circle");
  1700. C(a) && (c = a.r, b = a.y, a = a.x);
  1701. e.isCircle = !0;
  1702. e.r = c;
  1703. return e.attr({x: a, y: b})
  1704. }, g: function (a) {
  1705. var b;
  1706. a && (b = {className: "highcharts-" + a, "class": "highcharts-" + a});
  1707. return this.createElement("div").attr(b)
  1708. }, image: function (a, b, c, n, h) {
  1709. var e = this.createElement("img").attr({src: a});
  1710. 1 < arguments.length && e.attr({x: b, y: c, width: n, height: h});
  1711. return e
  1712. }, createElement: function (a) {
  1713. return "rect" === a ? this.symbol(a) : E.prototype.createElement.call(this, a)
  1714. }, invertChild: function (a, b) {
  1715. var e = this;
  1716. b = b.style;
  1717. var n = "IMG" === a.tagName && a.style;
  1718. G(a, {
  1719. flip: "x",
  1720. left: c(b.width) - (n ? c(n.top) : 1),
  1721. top: c(b.height) - (n ? c(n.left) : 1),
  1722. rotation: -90
  1723. });
  1724. l(a.childNodes, function (b) {
  1725. e.invertChild(b, a)
  1726. })
  1727. }, symbols: {
  1728. arc: function (a, b, c, n, h) {
  1729. var e = h.start, m = h.end, d = h.r || c || n;
  1730. c = h.innerR;
  1731. n = Math.cos(e);
  1732. var p = Math.sin(e), k = Math.cos(m), D = Math.sin(m);
  1733. if (0 === m - e)return ["x"];
  1734. e = ["wa", a - d, b - d, a + d, b + d, a + d * n, b + d * p, a + d * k, b + d * D];
  1735. h.open && !c && e.push("e", "M", a, b);
  1736. e.push("at", a - c, b - c, a + c, b + c, a + c * k, b + c * D, a + c * n, b + c * p, "x", "e");
  1737. e.isArc = !0;
  1738. return e
  1739. }, circle: function (a, b, c, n, h) {
  1740. h && r(h.r) && (c = n = 2 * h.r);
  1741. h && h.isCircle && (a -= c / 2, b -= n / 2);
  1742. return ["wa", a, b, a + c, b + n, a + c, b + n / 2, a + c, b + n / 2, "e"]
  1743. },
  1744. rect: function (a, b, c, n, h) {
  1745. return E.prototype.symbols[r(h) && h.r ? "callout" : "square"].call(0, a, b, c, n, h)
  1746. }
  1747. }
  1748. }, a.VMLRenderer = B = function () {
  1749. this.init.apply(this, arguments)
  1750. }, B.prototype = t(E.prototype, A), a.Renderer = B);
  1751. E.prototype.measureSpanWidth = function (a, b) {
  1752. var c = u.createElement("span");
  1753. a = u.createTextNode(a);
  1754. c.appendChild(a);
  1755. G(c, b);
  1756. this.box.appendChild(c);
  1757. b = c.offsetWidth;
  1758. f(c);
  1759. return b
  1760. }
  1761. })(L);
  1762. (function (a) {
  1763. function B() {
  1764. var l = a.defaultOptions.global, f = u.moment;
  1765. if (l.timezone) {
  1766. if (f)return function (a) {
  1767. return -f.tz(a,
  1768. l.timezone).utcOffset()
  1769. };
  1770. a.error(25)
  1771. }
  1772. return l.useUTC && l.getTimezoneOffset
  1773. }
  1774. function A() {
  1775. var l = a.defaultOptions.global, q, d = l.useUTC, b = d ? "getUTC" : "get", p = d ? "setUTC" : "set";
  1776. a.Date = q = l.Date || u.Date;
  1777. q.hcTimezoneOffset = d && l.timezoneOffset;
  1778. q.hcGetTimezoneOffset = B();
  1779. q.hcMakeTime = function (a, b, m, c, n, p) {
  1780. var l;
  1781. d ? (l = q.UTC.apply(0, arguments), l += r(l)) : l = (new q(a, b, f(m, 1), f(c, 0), f(n, 0), f(p, 0))).getTime();
  1782. return l
  1783. };
  1784. G("Minutes Hours Day Date Month FullYear".split(" "), function (a) {
  1785. q["hcGet" + a] = b + a
  1786. });
  1787. G("Milliseconds Seconds Minutes Hours Date Month FullYear".split(" "),
  1788. function (a) {
  1789. q["hcSet" + a] = p + a
  1790. })
  1791. }
  1792. var H = a.color, G = a.each, r = a.getTZOffset, g = a.merge, f = a.pick, u = a.win;
  1793. a.defaultOptions = {
  1794. colors: "#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #2b908f #f45b5b #91e8e1".split(" "),
  1795. symbols: ["circle", "diamond", "square", "triangle", "triangle-down"],
  1796. lang: {
  1797. loading: "Loading...",
  1798. months: "January February March April May June July August September October November December".split(" "),
  1799. shortMonths: "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),
  1800. weekdays: "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
  1801. decimalPoint: ".",
  1802. numericSymbols: "kMGTPE".split(""),
  1803. resetZoom: "Reset zoom",
  1804. resetZoomTitle: "Reset zoom level 1:1",
  1805. thousandsSep: " "
  1806. },
  1807. global: {useUTC: !0, VMLRadialGradientURL: "http://code.highcharts.com/5.0.7/gfx/vml-radial-gradient.png"},
  1808. chart: {
  1809. borderRadius: 0,
  1810. defaultSeriesType: "line",
  1811. ignoreHiddenSeries: !0,
  1812. spacing: [10, 10, 15, 10],
  1813. resetZoomButton: {theme: {zIndex: 20}, position: {align: "right", x: -10, y: 10}},
  1814. width: null,
  1815. height: null,
  1816. borderColor: "#335cad",
  1817. backgroundColor: "#ffffff",
  1818. plotBorderColor: "#cccccc"
  1819. },
  1820. title: {
  1821. text: "Chart title",
  1822. align: "center", margin: 15, widthAdjust: -44
  1823. },
  1824. subtitle: {text: "", align: "center", widthAdjust: -44},
  1825. plotOptions: {},
  1826. labels: {style: {position: "absolute", color: "#333333"}},
  1827. legend: {
  1828. enabled: !0,
  1829. align: "center",
  1830. layout: "horizontal",
  1831. labelFormatter: function () {
  1832. return this.name
  1833. },
  1834. borderColor: "#999999",
  1835. borderRadius: 0,
  1836. navigation: {activeColor: "#003399", inactiveColor: "#cccccc"},
  1837. itemStyle: {color: "#333333", fontSize: "12px", fontWeight: "bold"},
  1838. itemHoverStyle: {color: "#000000"},
  1839. itemHiddenStyle: {color: "#cccccc"},
  1840. shadow: !1,
  1841. itemCheckboxStyle: {
  1842. position: "absolute",
  1843. width: "13px", height: "13px"
  1844. },
  1845. squareSymbol: !0,
  1846. symbolPadding: 5,
  1847. verticalAlign: "bottom",
  1848. x: 0,
  1849. y: 0,
  1850. title: {style: {fontWeight: "bold"}}
  1851. },
  1852. loading: {
  1853. labelStyle: {fontWeight: "bold", position: "relative", top: "45%"},
  1854. style: {position: "absolute", backgroundColor: "#ffffff", opacity: .5, textAlign: "center"}
  1855. },
  1856. tooltip: {
  1857. enabled: !0,
  1858. animation: a.svg,
  1859. borderRadius: 3,
  1860. dateTimeLabelFormats: {
  1861. millisecond: "%A, %b %e, %H:%M:%S.%L",
  1862. second: "%A, %b %e, %H:%M:%S",
  1863. minute: "%A, %b %e, %H:%M",
  1864. hour: "%A, %b %e, %H:%M",
  1865. day: "%A, %b %e, %Y",
  1866. week: "Week from %A, %b %e, %Y",
  1867. month: "%B %Y",
  1868. year: "%Y"
  1869. },
  1870. footerFormat: "",
  1871. padding: 8,
  1872. snap: a.isTouchDevice ? 25 : 10,
  1873. backgroundColor: H("#f7f7f7").setOpacity(.85).get(),
  1874. borderWidth: 1,
  1875. headerFormat: '\x3cspan style\x3d"font-size: 10px"\x3e{point.key}\x3c/span\x3e\x3cbr/\x3e',
  1876. pointFormat: '\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e {series.name}: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3e',
  1877. shadow: !0,
  1878. style: {
  1879. color: "#333333",
  1880. cursor: "default",
  1881. fontSize: "12px",
  1882. pointerEvents: "none",
  1883. whiteSpace: "nowrap"
  1884. }
  1885. },
  1886. credits: {
  1887. }
  1888. };
  1889. a.setOptions = function (l) {
  1890. a.defaultOptions = g(!0, a.defaultOptions, l);
  1891. A();
  1892. return a.defaultOptions
  1893. };
  1894. a.getOptions = function () {
  1895. return a.defaultOptions
  1896. };
  1897. a.defaultPlotOptions = a.defaultOptions.plotOptions;
  1898. A()
  1899. })(L);
  1900. (function (a) {
  1901. var B = a.arrayMax, A = a.arrayMin, H = a.defined, G = a.destroyObjectProperties, r = a.each, g = a.erase, f = a.merge, u = a.pick;
  1902. a.PlotLineOrBand = function (a, f) {
  1903. this.axis =
  1904. a;
  1905. f && (this.options = f, this.id = f.id)
  1906. };
  1907. a.PlotLineOrBand.prototype = {
  1908. render: function () {
  1909. var a = this, q = a.axis, d = q.horiz, b = a.options, p = b.label, g = a.label, t = b.to, m = b.from, c = b.value, n = H(m) && H(t), E = H(c), z = a.svgElem, e = !z, x = [], F, w = b.color, h = u(b.zIndex, 0), y = b.events, x = {"class": "highcharts-plot-" + (n ? "band " : "line ") + (b.className || "")}, J = {}, K = q.chart.renderer, I = n ? "bands" : "lines", k = q.log2lin;
  1910. q.isLog && (m = k(m), t = k(t), c = k(c));
  1911. E ? (x = {
  1912. stroke: w,
  1913. "stroke-width": b.width
  1914. }, b.dashStyle && (x.dashstyle = b.dashStyle)) : n && (w && (x.fill =
  1915. w), b.borderWidth && (x.stroke = b.borderColor, x["stroke-width"] = b.borderWidth));
  1916. J.zIndex = h;
  1917. I += "-" + h;
  1918. (w = q[I]) || (q[I] = w = K.g("plot-" + I).attr(J).add());
  1919. e && (a.svgElem = z = K.path().attr(x).add(w));
  1920. if (E)x = q.getPlotLinePath(c, z.strokeWidth()); else if (n)x = q.getPlotBandPath(m, t, b); else return;
  1921. if (e && x && x.length) {
  1922. if (z.attr({d: x}), y)for (F in b = function (b) {
  1923. z.on(b, function (k) {
  1924. y[b].apply(a, [k])
  1925. })
  1926. }, y)b(F)
  1927. } else z && (x ? (z.show(), z.animate({d: x})) : (z.hide(), g && (a.label = g = g.destroy())));
  1928. p && H(p.text) && x && x.length && 0 < q.width &&
  1929. 0 < q.height && !x.flat ? (p = f({
  1930. align: d && n && "center",
  1931. x: d ? !n && 4 : 10,
  1932. verticalAlign: !d && n && "middle",
  1933. y: d ? n ? 16 : 10 : n ? 6 : -4,
  1934. rotation: d && !n && 90
  1935. }, p), this.renderLabel(p, x, n, h)) : g && g.hide();
  1936. return a
  1937. }, renderLabel: function (a, f, d, b) {
  1938. var p = this.label, l = this.axis.chart.renderer;
  1939. p || (p = {
  1940. align: a.textAlign || a.align,
  1941. rotation: a.rotation,
  1942. "class": "highcharts-plot-" + (d ? "band" : "line") + "-label " + (a.className || "")
  1943. }, p.zIndex = b, this.label = p = l.text(a.text, 0, 0, a.useHTML).attr(p).add(), p.css(a.style));
  1944. b = [f[1], f[4], d ? f[6] : f[1]];
  1945. f = [f[2], f[5],
  1946. d ? f[7] : f[2]];
  1947. d = A(b);
  1948. l = A(f);
  1949. p.align(a, !1, {x: d, y: l, width: B(b) - d, height: B(f) - l});
  1950. p.show()
  1951. }, destroy: function () {
  1952. g(this.axis.plotLinesAndBands, this);
  1953. delete this.axis;
  1954. G(this)
  1955. }
  1956. };
  1957. a.AxisPlotLineOrBandExtension = {
  1958. getPlotBandPath: function (a, f) {
  1959. f = this.getPlotLinePath(f, null, null, !0);
  1960. (a = this.getPlotLinePath(a, null, null, !0)) && f ? (a.flat = a.toString() === f.toString(), a.push(f[4], f[5], f[1], f[2], "z")) : a = null;
  1961. return a
  1962. }, addPlotBand: function (a) {
  1963. return this.addPlotBandOrLine(a, "plotBands")
  1964. }, addPlotLine: function (a) {
  1965. return this.addPlotBandOrLine(a,
  1966. "plotLines")
  1967. }, addPlotBandOrLine: function (f, g) {
  1968. var d = (new a.PlotLineOrBand(this, f)).render(), b = this.userOptions;
  1969. d && (g && (b[g] = b[g] || [], b[g].push(f)), this.plotLinesAndBands.push(d));
  1970. return d
  1971. }, removePlotBandOrLine: function (a) {
  1972. for (var f = this.plotLinesAndBands, d = this.options, b = this.userOptions, p = f.length; p--;)f[p].id === a && f[p].destroy();
  1973. r([d.plotLines || [], b.plotLines || [], d.plotBands || [], b.plotBands || []], function (b) {
  1974. for (p = b.length; p--;)b[p].id === a && g(b, b[p])
  1975. })
  1976. }
  1977. }
  1978. })(L);
  1979. (function (a) {
  1980. var B = a.correctFloat, A =
  1981. a.defined, H = a.destroyObjectProperties, G = a.isNumber, r = a.merge, g = a.pick, f = a.deg2rad;
  1982. a.Tick = function (a, f, g, d) {
  1983. this.axis = a;
  1984. this.pos = f;
  1985. this.type = g || "";
  1986. this.isNew = !0;
  1987. g || d || this.addLabel()
  1988. };
  1989. a.Tick.prototype = {
  1990. addLabel: function () {
  1991. var a = this.axis, f = a.options, q = a.chart, d = a.categories, b = a.names, p = this.pos, C = f.labels, t = a.tickPositions, m = p === t[0], c = p === t[t.length - 1], b = d ? g(d[p], b[p], p) : p, d = this.label, t = t.info, n;
  1992. a.isDatetimeAxis && t && (n = f.dateTimeLabelFormats[t.higherRanks[p] || t.unitName]);
  1993. this.isFirst = m;
  1994. this.isLast =
  1995. c;
  1996. f = a.labelFormatter.call({
  1997. axis: a,
  1998. chart: q,
  1999. isFirst: m,
  2000. isLast: c,
  2001. dateTimeLabelFormat: n,
  2002. value: a.isLog ? B(a.lin2log(b)) : b
  2003. });
  2004. A(d) ? d && d.attr({text: f}) : (this.labelLength = (this.label = d = A(f) && C.enabled ? q.renderer.text(f, 0, 0, C.useHTML).css(r(C.style)).add(a.labelGroup) : null) && d.getBBox().width, this.rotation = 0)
  2005. }, getLabelSize: function () {
  2006. return this.label ? this.label.getBBox()[this.axis.horiz ? "height" : "width"] : 0
  2007. }, handleOverflow: function (a) {
  2008. var l = this.axis, q = a.x, d = l.chart.chartWidth, b = l.chart.spacing, p = g(l.labelLeft,
  2009. Math.min(l.pos, b[3])), b = g(l.labelRight, Math.max(l.pos + l.len, d - b[1])), C = this.label, t = this.rotation, m = {
  2010. left: 0,
  2011. center: .5,
  2012. right: 1
  2013. }[l.labelAlign], c = C.getBBox().width, n = l.getSlotWidth(), E = n, z = 1, e, x = {};
  2014. if (t)0 > t && q - m * c < p ? e = Math.round(q / Math.cos(t * f) - p) : 0 < t && q + m * c > b && (e = Math.round((d - q) / Math.cos(t * f))); else if (d = q + (1 - m) * c, q - m * c < p ? E = a.x + E * (1 - m) - p : d > b && (E = b - a.x + E * m, z = -1), E = Math.min(n, E), E < n && "center" === l.labelAlign && (a.x += z * (n - E - m * (n - Math.min(c, E)))), c > E || l.autoRotation && (C.styles || {}).width)e = E;
  2015. e && (x.width =
  2016. e, (l.options.labels.style || {}).textOverflow || (x.textOverflow = "ellipsis"), C.css(x))
  2017. }, getPosition: function (a, f, g, d) {
  2018. var b = this.axis, p = b.chart, l = d && p.oldChartHeight || p.chartHeight;
  2019. return {
  2020. x: a ? b.translate(f + g, null, null, d) + b.transB : b.left + b.offset + (b.opposite ? (d && p.oldChartWidth || p.chartWidth) - b.right - b.left : 0),
  2021. y: a ? l - b.bottom + b.offset - (b.opposite ? b.height : 0) : l - b.translate(f + g, null, null, d) - b.transB
  2022. }
  2023. }, getLabelPosition: function (a, g, q, d, b, p, C, t) {
  2024. var m = this.axis, c = m.transA, n = m.reversed, E = m.staggerLines, z = m.tickRotCorr ||
  2025. {x: 0, y: 0}, e = b.y;
  2026. A(e) || (e = 0 === m.side ? q.rotation ? -8 : -q.getBBox().height : 2 === m.side ? z.y + 8 : Math.cos(q.rotation * f) * (z.y - q.getBBox(!1, 0).height / 2));
  2027. a = a + b.x + z.x - (p && d ? p * c * (n ? -1 : 1) : 0);
  2028. g = g + e - (p && !d ? p * c * (n ? 1 : -1) : 0);
  2029. E && (q = C / (t || 1) % E, m.opposite && (q = E - q - 1), g += m.labelOffset / E * q);
  2030. return {x: a, y: Math.round(g)}
  2031. }, getMarkPath: function (a, f, g, d, b, p) {
  2032. return p.crispLine(["M", a, f, "L", a + (b ? 0 : -g), f + (b ? g : 0)], d)
  2033. }, render: function (a, f, q) {
  2034. var d = this.axis, b = d.options, p = d.chart.renderer, l = d.horiz, t = this.type, m = this.label, c = this.pos,
  2035. n = b.labels, E = this.gridLine, z = t ? t + "Tick" : "tick", e = d.tickSize(z), x = this.mark, F = !x, w = n.step, h = {}, y = !0, J = d.tickmarkOffset, K = this.getPosition(l, c, J, f), I = K.x, K = K.y, k = l && I === d.pos + d.len || !l && K === d.pos ? -1 : 1, D = t ? t + "Grid" : "grid", P = b[D + "LineWidth"], N = b[D + "LineColor"], r = b[D + "LineDashStyle"], D = g(b[z + "Width"], !t && d.isXAxis ? 1 : 0), z = b[z + "Color"];
  2036. q = g(q, 1);
  2037. this.isActive = !0;
  2038. E || (h.stroke = N, h["stroke-width"] = P, r && (h.dashstyle = r), t || (h.zIndex = 1), f && (h.opacity = 0), this.gridLine = E = p.path().attr(h).addClass("highcharts-" + (t ?
  2039. t + "-" : "") + "grid-line").add(d.gridGroup));
  2040. if (!f && E && (c = d.getPlotLinePath(c + J, E.strokeWidth() * k, f, !0)))E[this.isNew ? "attr" : "animate"]({
  2041. d: c,
  2042. opacity: q
  2043. });
  2044. e && (d.opposite && (e[0] = -e[0]), F && (this.mark = x = p.path().addClass("highcharts-" + (t ? t + "-" : "") + "tick").add(d.axisGroup), x.attr({
  2045. stroke: z,
  2046. "stroke-width": D
  2047. })), x[F ? "attr" : "animate"]({
  2048. d: this.getMarkPath(I, K, e[0], x.strokeWidth() * k, l, p),
  2049. opacity: q
  2050. }));
  2051. m && G(I) && (m.xy = K = this.getLabelPosition(I, K, m, l, n, J, a, w), this.isFirst && !this.isLast && !g(b.showFirstLabel, 1) || this.isLast && !this.isFirst && !g(b.showLastLabel, 1) ? y = !1 : !l || d.isRadial || n.step || n.rotation || f || 0 === q || this.handleOverflow(K), w && a % w && (y = !1), y && G(K.y) ? (K.opacity = q, m[this.isNew ? "attr" : "animate"](K)) : m.attr("y", -9999), this.isNew = !1)
  2052. }, destroy: function () {
  2053. H(this, this.axis)
  2054. }
  2055. }
  2056. })(L);
  2057. (function (a) {
  2058. var B = a.addEvent, A = a.animObject, H = a.arrayMax, G = a.arrayMin, r = a.AxisPlotLineOrBandExtension, g = a.color, f = a.correctFloat, u = a.defaultOptions, l = a.defined, q = a.deg2rad, d = a.destroyObjectProperties, b = a.each, p = a.extend, C = a.fireEvent, t = a.format,
  2059. m = a.getMagnitude, c = a.grep, n = a.inArray, E = a.isArray, z = a.isNumber, e = a.isString, x = a.merge, F = a.normalizeTickInterval, w = a.pick, h = a.PlotLineOrBand, y = a.removeEvent, J = a.splat, K = a.syncTimeout, I = a.Tick;
  2060. a.Axis = function () {
  2061. this.init.apply(this, arguments)
  2062. };
  2063. a.Axis.prototype = {
  2064. defaultOptions: {
  2065. dateTimeLabelFormats: {
  2066. millisecond: "%H:%M:%S.%L",
  2067. second: "%H:%M:%S",
  2068. minute: "%H:%M",
  2069. hour: "%H:%M",
  2070. day: "%e. %b",
  2071. week: "%e. %b",
  2072. month: "%b '%y",
  2073. year: "%Y"
  2074. },
  2075. endOnTick: !1,
  2076. labels: {
  2077. enabled: !0, style: {color: "#666666", cursor: "default", fontSize: "11px"},
  2078. x: 0
  2079. },
  2080. minPadding: .01,
  2081. maxPadding: .01,
  2082. minorTickLength: 2,
  2083. minorTickPosition: "outside",
  2084. startOfWeek: 1,
  2085. startOnTick: !1,
  2086. tickLength: 10,
  2087. tickmarkPlacement: "between",
  2088. tickPixelInterval: 100,
  2089. tickPosition: "outside",
  2090. title: {align: "middle", style: {color: "#666666"}},
  2091. type: "linear",
  2092. minorGridLineColor: "#f2f2f2",
  2093. minorGridLineWidth: 1,
  2094. minorTickColor: "#999999",
  2095. lineColor: "#ccd6eb",
  2096. lineWidth: 1,
  2097. gridLineColor: "#e6e6e6",
  2098. tickColor: "#ccd6eb"
  2099. },
  2100. defaultYAxisOptions: {
  2101. endOnTick: !0,
  2102. tickPixelInterval: 72,
  2103. showLastLabel: !0,
  2104. labels: {x: -8},
  2105. maxPadding: .05,
  2106. minPadding: .05,
  2107. startOnTick: !0,
  2108. title: {rotation: 270, text: "Values"},
  2109. stackLabels: {
  2110. enabled: !1, formatter: function () {
  2111. return a.numberFormat(this.total, -1)
  2112. }, style: {fontSize: "11px", fontWeight: "bold", color: "#000000", textOutline: "1px contrast"}
  2113. },
  2114. gridLineWidth: 1,
  2115. lineWidth: 0
  2116. },
  2117. defaultLeftAxisOptions: {labels: {x: -15}, title: {rotation: 270}},
  2118. defaultRightAxisOptions: {labels: {x: 15}, title: {rotation: 90}},
  2119. defaultBottomAxisOptions: {labels: {autoRotation: [-45], x: 0}, title: {rotation: 0}},
  2120. defaultTopAxisOptions: {
  2121. labels: {
  2122. autoRotation: [-45],
  2123. x: 0
  2124. }, title: {rotation: 0}
  2125. },
  2126. init: function (a, b) {
  2127. var k = b.isX;
  2128. this.chart = a;
  2129. this.horiz = a.inverted ? !k : k;
  2130. this.isXAxis = k;
  2131. this.coll = this.coll || (k ? "xAxis" : "yAxis");
  2132. this.opposite = b.opposite;
  2133. this.side = b.side || (this.horiz ? this.opposite ? 0 : 2 : this.opposite ? 1 : 3);
  2134. this.setOptions(b);
  2135. var c = this.options, e = c.type;
  2136. this.labelFormatter = c.labels.formatter || this.defaultLabelFormatter;
  2137. this.userOptions = b;
  2138. this.minPixelPadding = 0;
  2139. this.reversed = c.reversed;
  2140. this.visible = !1 !== c.visible;
  2141. this.zoomEnabled = !1 !== c.zoomEnabled;
  2142. this.hasNames =
  2143. "category" === e || !0 === c.categories;
  2144. this.categories = c.categories || this.hasNames;
  2145. this.names = this.names || [];
  2146. this.isLog = "logarithmic" === e;
  2147. this.isDatetimeAxis = "datetime" === e;
  2148. this.isLinked = l(c.linkedTo);
  2149. this.ticks = {};
  2150. this.labelEdge = [];
  2151. this.minorTicks = {};
  2152. this.plotLinesAndBands = [];
  2153. this.alternateBands = {};
  2154. this.len = 0;
  2155. this.minRange = this.userMinRange = c.minRange || c.maxZoom;
  2156. this.range = c.range;
  2157. this.offset = c.offset || 0;
  2158. this.stacks = {};
  2159. this.oldStacks = {};
  2160. this.stacksTouched = 0;
  2161. this.min = this.max = null;
  2162. this.crosshair = w(c.crosshair,
  2163. J(a.options.tooltip.crosshairs)[k ? 0 : 1], !1);
  2164. var h;
  2165. b = this.options.events;
  2166. -1 === n(this, a.axes) && (k ? a.axes.splice(a.xAxis.length, 0, this) : a.axes.push(this), a[this.coll].push(this));
  2167. this.series = this.series || [];
  2168. a.inverted && k && void 0 === this.reversed && (this.reversed = !0);
  2169. this.removePlotLine = this.removePlotBand = this.removePlotBandOrLine;
  2170. for (h in b)B(this, h, b[h]);
  2171. this.isLog && (this.val2lin = this.log2lin, this.lin2val = this.lin2log)
  2172. },
  2173. setOptions: function (a) {
  2174. this.options = x(this.defaultOptions, "yAxis" === this.coll && this.defaultYAxisOptions,
  2175. [this.defaultTopAxisOptions, this.defaultRightAxisOptions, this.defaultBottomAxisOptions, this.defaultLeftAxisOptions][this.side], x(u[this.coll], a))
  2176. },
  2177. defaultLabelFormatter: function () {
  2178. var b = this.axis, c = this.value, e = b.categories, h = this.dateTimeLabelFormat, n = u.lang, d = n.numericSymbols, n = n.numericSymbolMagnitude || 1E3, v = d && d.length, m, f = b.options.labels.format, b = b.isLog ? c : b.tickInterval;
  2179. if (f)m = t(f, this); else if (e)m = c; else if (h)m = a.dateFormat(h, c); else if (v && 1E3 <= b)for (; v-- && void 0 === m;)e = Math.pow(n, v + 1), b >=
  2180. e && 0 === 10 * c % e && null !== d[v] && 0 !== c && (m = a.numberFormat(c / e, -1) + d[v]);
  2181. void 0 === m && (m = 1E4 <= Math.abs(c) ? a.numberFormat(c, -1) : a.numberFormat(c, -1, void 0, ""));
  2182. return m
  2183. },
  2184. getSeriesExtremes: function () {
  2185. var a = this, e = a.chart;
  2186. a.hasVisibleSeries = !1;
  2187. a.dataMin = a.dataMax = a.threshold = null;
  2188. a.softThreshold = !a.isXAxis;
  2189. a.buildStacks && a.buildStacks();
  2190. b(a.series, function (b) {
  2191. if (b.visible || !e.options.chart.ignoreHiddenSeries) {
  2192. var k = b.options, h = k.threshold, D;
  2193. a.hasVisibleSeries = !0;
  2194. a.isLog && 0 >= h && (h = null);
  2195. if (a.isXAxis)k = b.xData,
  2196. k.length && (b = G(k), z(b) || b instanceof Date || (k = c(k, function (a) {
  2197. return z(a)
  2198. }), b = G(k)), a.dataMin = Math.min(w(a.dataMin, k[0]), b), a.dataMax = Math.max(w(a.dataMax, k[0]), H(k))); else if (b.getExtremes(), D = b.dataMax, b = b.dataMin, l(b) && l(D) && (a.dataMin = Math.min(w(a.dataMin, b), b), a.dataMax = Math.max(w(a.dataMax, D), D)), l(h) && (a.threshold = h), !k.softThreshold || a.isLog)a.softThreshold = !1
  2199. }
  2200. })
  2201. },
  2202. translate: function (a, b, c, e, h, n) {
  2203. var k = this.linkedParent || this, D = 1, m = 0, d = e ? k.oldTransA : k.transA;
  2204. e = e ? k.oldMin : k.min;
  2205. var f = k.minPixelPadding;
  2206. h = (k.isOrdinal || k.isBroken || k.isLog && h) && k.lin2val;
  2207. d || (d = k.transA);
  2208. c && (D *= -1, m = k.len);
  2209. k.reversed && (D *= -1, m -= D * (k.sector || k.len));
  2210. b ? (a = (a * D + m - f) / d + e, h && (a = k.lin2val(a))) : (h && (a = k.val2lin(a)), a = D * (a - e) * d + m + D * f + (z(n) ? d * n : 0));
  2211. return a
  2212. },
  2213. toPixels: function (a, b) {
  2214. return this.translate(a, !1, !this.horiz, null, !0) + (b ? 0 : this.pos)
  2215. },
  2216. toValue: function (a, b) {
  2217. return this.translate(a - (b ? 0 : this.pos), !0, !this.horiz, null, !0)
  2218. },
  2219. getPlotLinePath: function (a, b, c, e, h) {
  2220. var k = this.chart, D = this.left, n = this.top, m, d, f = c && k.oldChartHeight ||
  2221. k.chartHeight, p = c && k.oldChartWidth || k.chartWidth, y;
  2222. m = this.transB;
  2223. var t = function (a, b, k) {
  2224. if (a < b || a > k)e ? a = Math.min(Math.max(b, a), k) : y = !0;
  2225. return a
  2226. };
  2227. h = w(h, this.translate(a, null, null, c));
  2228. a = c = Math.round(h + m);
  2229. m = d = Math.round(f - h - m);
  2230. z(h) ? this.horiz ? (m = n, d = f - this.bottom, a = c = t(a, D, D + this.width)) : (a = D, c = p - this.right, m = d = t(m, n, n + this.height)) : y = !0;
  2231. return y && !e ? null : k.renderer.crispLine(["M", a, m, "L", c, d], b || 1)
  2232. },
  2233. getLinearTickPositions: function (a, b, c) {
  2234. var k, e = f(Math.floor(b / a) * a), h = f(Math.ceil(c / a) * a), D = [];
  2235. if (b ===
  2236. c && z(b))return [b];
  2237. for (b = e; b <= h;) {
  2238. D.push(b);
  2239. b = f(b + a);
  2240. if (b === k)break;
  2241. k = b
  2242. }
  2243. return D
  2244. },
  2245. getMinorTickPositions: function () {
  2246. var a = this.options, b = this.tickPositions, c = this.minorTickInterval, e = [], h, n = this.pointRangePadding || 0;
  2247. h = this.min - n;
  2248. var n = this.max + n, m = n - h;
  2249. if (m && m / c < this.len / 3)if (this.isLog)for (n = b.length, h = 1; h < n; h++)e = e.concat(this.getLogTickPositions(c, b[h - 1], b[h], !0)); else if (this.isDatetimeAxis && "auto" === a.minorTickInterval)e = e.concat(this.getTimeTicks(this.normalizeTimeTickInterval(c), h, n, a.startOfWeek));
  2250. else for (b = h + (b[0] - h) % c; b <= n && b !== e[0]; b += c)e.push(b);
  2251. 0 !== e.length && this.trimTicks(e, a.startOnTick, a.endOnTick);
  2252. return e
  2253. },
  2254. adjustForMinRange: function () {
  2255. var a = this.options, c = this.min, e = this.max, h, n = this.dataMax - this.dataMin >= this.minRange, m, v, d, f, p, y;
  2256. this.isXAxis && void 0 === this.minRange && !this.isLog && (l(a.min) || l(a.max) ? this.minRange = null : (b(this.series, function (a) {
  2257. f = a.xData;
  2258. for (v = p = a.xIncrement ? 1 : f.length - 1; 0 < v; v--)if (d = f[v] - f[v - 1], void 0 === m || d < m)m = d
  2259. }), this.minRange = Math.min(5 * m, this.dataMax - this.dataMin)));
  2260. e - c < this.minRange && (y = this.minRange, h = (y - e + c) / 2, h = [c - h, w(a.min, c - h)], n && (h[2] = this.isLog ? this.log2lin(this.dataMin) : this.dataMin), c = H(h), e = [c + y, w(a.max, c + y)], n && (e[2] = this.isLog ? this.log2lin(this.dataMax) : this.dataMax), e = G(e), e - c < y && (h[0] = e - y, h[1] = w(a.min, e - y), c = H(h)));
  2261. this.min = c;
  2262. this.max = e
  2263. },
  2264. getClosest: function () {
  2265. var a;
  2266. this.categories ? a = 1 : b(this.series, function (b) {
  2267. var k = b.closestPointRange, c = b.visible || !b.chart.options.chart.ignoreHiddenSeries;
  2268. !b.noSharedTooltip && l(k) && c && (a = l(a) ? Math.min(a, k) : k)
  2269. });
  2270. return a
  2271. },
  2272. nameToX: function (a) {
  2273. var b = E(this.categories), k = b ? this.categories : this.names, c = a.options.x, e;
  2274. a.series.requireSorting = !1;
  2275. l(c) || (c = !1 === this.options.uniqueNames ? a.series.autoIncrement() : n(a.name, k));
  2276. -1 === c ? b || (e = k.length) : e = c;
  2277. this.names[e] = a.name;
  2278. return e
  2279. },
  2280. updateNames: function () {
  2281. var a = this;
  2282. 0 < this.names.length && (this.names.length = 0, this.minRange = void 0, b(this.series || [], function (k) {
  2283. k.xIncrement = null;
  2284. if (!k.points || k.isDirtyData)k.processData(), k.generatePoints();
  2285. b(k.points, function (b, c) {
  2286. var e;
  2287. b.options && (e = a.nameToX(b), e !== b.x && (b.x = e, k.xData[c] = e))
  2288. })
  2289. }))
  2290. },
  2291. setAxisTranslation: function (a) {
  2292. var k = this, c = k.max - k.min, h = k.axisPointRange || 0, n, m = 0, d = 0, f = k.linkedParent, y = !!k.categories, p = k.transA, t = k.isXAxis;
  2293. if (t || y || h)n = k.getClosest(), f ? (m = f.minPointOffset, d = f.pointRangePadding) : b(k.series, function (a) {
  2294. var b = y ? 1 : t ? w(a.options.pointRange, n, 0) : k.axisPointRange || 0;
  2295. a = a.options.pointPlacement;
  2296. h = Math.max(h, b);
  2297. k.single || (m = Math.max(m, e(a) ? 0 : b / 2), d = Math.max(d, "on" === a ? 0 : b))
  2298. }), f = k.ordinalSlope && n ? k.ordinalSlope /
  2299. n : 1, k.minPointOffset = m *= f, k.pointRangePadding = d *= f, k.pointRange = Math.min(h, c), t && (k.closestPointRange = n);
  2300. a && (k.oldTransA = p);
  2301. k.translationSlope = k.transA = p = k.len / (c + d || 1);
  2302. k.transB = k.horiz ? k.left : k.bottom;
  2303. k.minPixelPadding = p * m
  2304. },
  2305. minFromRange: function () {
  2306. return this.max - this.range
  2307. },
  2308. setTickInterval: function (k) {
  2309. var c = this, e = c.chart, h = c.options, n = c.isLog, d = c.log2lin, v = c.isDatetimeAxis, y = c.isXAxis, p = c.isLinked, t = h.maxPadding, x = h.minPadding, g = h.tickInterval, E = h.tickPixelInterval, q = c.categories, J = c.threshold,
  2310. K = c.softThreshold, I, r, u, A;
  2311. v || q || p || this.getTickAmount();
  2312. u = w(c.userMin, h.min);
  2313. A = w(c.userMax, h.max);
  2314. p ? (c.linkedParent = e[c.coll][h.linkedTo], e = c.linkedParent.getExtremes(), c.min = w(e.min, e.dataMin), c.max = w(e.max, e.dataMax), h.type !== c.linkedParent.options.type && a.error(11, 1)) : (!K && l(J) && (c.dataMin >= J ? (I = J, x = 0) : c.dataMax <= J && (r = J, t = 0)), c.min = w(u, I, c.dataMin), c.max = w(A, r, c.dataMax));
  2315. n && (!k && 0 >= Math.min(c.min, w(c.dataMin, c.min)) && a.error(10, 1), c.min = f(d(c.min), 15), c.max = f(d(c.max), 15));
  2316. c.range && l(c.max) &&
  2317. (c.userMin = c.min = u = Math.max(c.min, c.minFromRange()), c.userMax = A = c.max, c.range = null);
  2318. C(c, "foundExtremes");
  2319. c.beforePadding && c.beforePadding();
  2320. c.adjustForMinRange();
  2321. !(q || c.axisPointRange || c.usePercentage || p) && l(c.min) && l(c.max) && (d = c.max - c.min) && (!l(u) && x && (c.min -= d * x), !l(A) && t && (c.max += d * t));
  2322. z(h.floor) ? c.min = Math.max(c.min, h.floor) : z(h.softMin) && (c.min = Math.min(c.min, h.softMin));
  2323. z(h.ceiling) ? c.max = Math.min(c.max, h.ceiling) : z(h.softMax) && (c.max = Math.max(c.max, h.softMax));
  2324. K && l(c.dataMin) && (J = J || 0, !l(u) &&
  2325. c.min < J && c.dataMin >= J ? c.min = J : !l(A) && c.max > J && c.dataMax <= J && (c.max = J));
  2326. c.tickInterval = c.min === c.max || void 0 === c.min || void 0 === c.max ? 1 : p && !g && E === c.linkedParent.options.tickPixelInterval ? g = c.linkedParent.tickInterval : w(g, this.tickAmount ? (c.max - c.min) / Math.max(this.tickAmount - 1, 1) : void 0, q ? 1 : (c.max - c.min) * E / Math.max(c.len, E));
  2327. y && !k && b(c.series, function (a) {
  2328. a.processData(c.min !== c.oldMin || c.max !== c.oldMax)
  2329. });
  2330. c.setAxisTranslation(!0);
  2331. c.beforeSetTickPositions && c.beforeSetTickPositions();
  2332. c.postProcessTickInterval &&
  2333. (c.tickInterval = c.postProcessTickInterval(c.tickInterval));
  2334. c.pointRange && !g && (c.tickInterval = Math.max(c.pointRange, c.tickInterval));
  2335. k = w(h.minTickInterval, c.isDatetimeAxis && c.closestPointRange);
  2336. !g && c.tickInterval < k && (c.tickInterval = k);
  2337. v || n || g || (c.tickInterval = F(c.tickInterval, null, m(c.tickInterval), w(h.allowDecimals, !(.5 < c.tickInterval && 5 > c.tickInterval && 1E3 < c.max && 9999 > c.max)), !!this.tickAmount));
  2338. this.tickAmount || (c.tickInterval = c.unsquish());
  2339. this.setTickPositions()
  2340. },
  2341. setTickPositions: function () {
  2342. var a =
  2343. this.options, b, c = a.tickPositions, e = a.tickPositioner, h = a.startOnTick, n = a.endOnTick, m;
  2344. this.tickmarkOffset = this.categories && "between" === a.tickmarkPlacement && 1 === this.tickInterval ? .5 : 0;
  2345. this.minorTickInterval = "auto" === a.minorTickInterval && this.tickInterval ? this.tickInterval / 5 : a.minorTickInterval;
  2346. this.tickPositions = b = c && c.slice();
  2347. !b && (b = this.isDatetimeAxis ? this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval, a.units), this.min, this.max, a.startOfWeek, this.ordinalPositions, this.closestPointRange,
  2348. !0) : this.isLog ? this.getLogTickPositions(this.tickInterval, this.min, this.max) : this.getLinearTickPositions(this.tickInterval, this.min, this.max), b.length > this.len && (b = [b[0], b.pop()]), this.tickPositions = b, e && (e = e.apply(this, [this.min, this.max]))) && (this.tickPositions = b = e);
  2349. this.trimTicks(b, h, n);
  2350. this.isLinked || (this.min === this.max && l(this.min) && !this.tickAmount && (m = !0, this.min -= .5, this.max += .5), this.single = m, c || e || this.adjustTickAmount())
  2351. },
  2352. trimTicks: function (a, b, c) {
  2353. var k = a[0], e = a[a.length - 1], h = this.minPointOffset ||
  2354. 0;
  2355. if (!this.isLinked) {
  2356. if (b)this.min = k; else for (; this.min - h > a[0];)a.shift();
  2357. if (c)this.max = e; else for (; this.max + h < a[a.length - 1];)a.pop();
  2358. 0 === a.length && l(k) && a.push((e + k) / 2)
  2359. }
  2360. },
  2361. alignToOthers: function () {
  2362. var a = {}, c, e = this.options;
  2363. !1 === this.chart.options.chart.alignTicks || !1 === e.alignTicks || this.isLog || b(this.chart[this.coll], function (b) {
  2364. var k = b.options, k = [b.horiz ? k.left : k.top, k.width, k.height, k.pane].join();
  2365. b.series.length && (a[k] ? c = !0 : a[k] = 1)
  2366. });
  2367. return c
  2368. },
  2369. getTickAmount: function () {
  2370. var a = this.options, b = a.tickAmount,
  2371. c = a.tickPixelInterval;
  2372. !l(a.tickInterval) && this.len < c && !this.isRadial && !this.isLog && a.startOnTick && a.endOnTick && (b = 2);
  2373. !b && this.alignToOthers() && (b = Math.ceil(this.len / c) + 1);
  2374. 4 > b && (this.finalTickAmt = b, b = 5);
  2375. this.tickAmount = b
  2376. },
  2377. adjustTickAmount: function () {
  2378. var a = this.tickInterval, b = this.tickPositions, c = this.tickAmount, e = this.finalTickAmt, h = b && b.length;
  2379. if (h < c) {
  2380. for (; b.length < c;)b.push(f(b[b.length - 1] + a));
  2381. this.transA *= (h - 1) / (c - 1);
  2382. this.max = b[b.length - 1]
  2383. } else h > c && (this.tickInterval *= 2, this.setTickPositions());
  2384. if (l(e)) {
  2385. for (a = c = b.length; a--;)(3 === e && 1 === a % 2 || 2 >= e && 0 < a && a < c - 1) && b.splice(a, 1);
  2386. this.finalTickAmt = void 0
  2387. }
  2388. },
  2389. setScale: function () {
  2390. var a, c;
  2391. this.oldMin = this.min;
  2392. this.oldMax = this.max;
  2393. this.oldAxisLength = this.len;
  2394. this.setAxisSize();
  2395. c = this.len !== this.oldAxisLength;
  2396. b(this.series, function (b) {
  2397. if (b.isDirtyData || b.isDirty || b.xAxis.isDirty)a = !0
  2398. });
  2399. c || a || this.isLinked || this.forceRedraw || this.userMin !== this.oldUserMin || this.userMax !== this.oldUserMax || this.alignToOthers() ? (this.resetStacks && this.resetStacks(), this.forceRedraw = !1, this.getSeriesExtremes(), this.setTickInterval(), this.oldUserMin = this.userMin, this.oldUserMax = this.userMax, this.isDirty || (this.isDirty = c || this.min !== this.oldMin || this.max !== this.oldMax)) : this.cleanStacks && this.cleanStacks()
  2400. },
  2401. setExtremes: function (a, c, e, h, n) {
  2402. var k = this, m = k.chart;
  2403. e = w(e, !0);
  2404. b(k.series, function (a) {
  2405. delete a.kdTree
  2406. });
  2407. n = p(n, {min: a, max: c});
  2408. C(k, "setExtremes", n, function () {
  2409. k.userMin = a;
  2410. k.userMax = c;
  2411. k.eventArgs = n;
  2412. e && m.redraw(h)
  2413. })
  2414. },
  2415. zoom: function (a, b) {
  2416. var c = this.dataMin, k = this.dataMax, e = this.options,
  2417. h = Math.min(c, w(e.min, c)), e = Math.max(k, w(e.max, k));
  2418. if (a !== this.min || b !== this.max)this.allowZoomOutside || (l(c) && (a < h && (a = h), a > e && (a = e)), l(k) && (b < h && (b = h), b > e && (b = e))), this.displayBtn = void 0 !== a || void 0 !== b, this.setExtremes(a, b, !1, void 0, {trigger: "zoom"});
  2419. return !0
  2420. },
  2421. setAxisSize: function () {
  2422. var a = this.chart, b = this.options, c = b.offsets || [0, 0, 0, 0], e = this.horiz, h = w(b.width, a.plotWidth - c[3] + c[1]), n = w(b.height, a.plotHeight - c[0] + c[2]), m = w(b.top, a.plotTop + c[0]), b = w(b.left, a.plotLeft + c[3]), c = /%$/;
  2423. c.test(n) && (n =
  2424. Math.round(parseFloat(n) / 100 * a.plotHeight));
  2425. c.test(m) && (m = Math.round(parseFloat(m) / 100 * a.plotHeight + a.plotTop));
  2426. this.left = b;
  2427. this.top = m;
  2428. this.width = h;
  2429. this.height = n;
  2430. this.bottom = a.chartHeight - n - m;
  2431. this.right = a.chartWidth - h - b;
  2432. this.len = Math.max(e ? h : n, 0);
  2433. this.pos = e ? b : m
  2434. },
  2435. getExtremes: function () {
  2436. var a = this.isLog, b = this.lin2log;
  2437. return {
  2438. min: a ? f(b(this.min)) : this.min,
  2439. max: a ? f(b(this.max)) : this.max,
  2440. dataMin: this.dataMin,
  2441. dataMax: this.dataMax,
  2442. userMin: this.userMin,
  2443. userMax: this.userMax
  2444. }
  2445. },
  2446. getThreshold: function (a) {
  2447. var b =
  2448. this.isLog, c = this.lin2log, k = b ? c(this.min) : this.min, b = b ? c(this.max) : this.max;
  2449. null === a ? a = k : k > a ? a = k : b < a && (a = b);
  2450. return this.translate(a, 0, 1, 0, 1)
  2451. },
  2452. autoLabelAlign: function (a) {
  2453. a = (w(a, 0) - 90 * this.side + 720) % 360;
  2454. return 15 < a && 165 > a ? "right" : 195 < a && 345 > a ? "left" : "center"
  2455. },
  2456. tickSize: function (a) {
  2457. var b = this.options, c = b[a + "Length"], k = w(b[a + "Width"], "tick" === a && this.isXAxis ? 1 : 0);
  2458. if (k && c)return "inside" === b[a + "Position"] && (c = -c), [c, k]
  2459. },
  2460. labelMetrics: function () {
  2461. return this.chart.renderer.fontMetrics(this.options.labels.style &&
  2462. this.options.labels.style.fontSize, this.ticks[0] && this.ticks[0].label)
  2463. },
  2464. unsquish: function () {
  2465. var a = this.options.labels, c = this.horiz, e = this.tickInterval, h = e, n = this.len / (((this.categories ? 1 : 0) + this.max - this.min) / e), m, d = a.rotation, f = this.labelMetrics(), p, y = Number.MAX_VALUE, t, x = function (a) {
  2466. a /= n || 1;
  2467. a = 1 < a ? Math.ceil(a) : 1;
  2468. return a * e
  2469. };
  2470. c ? (t = !a.staggerLines && !a.step && (l(d) ? [d] : n < w(a.autoRotationLimit, 80) && a.autoRotation)) && b(t, function (a) {
  2471. var b;
  2472. if (a === d || a && -90 <= a && 90 >= a)p = x(Math.abs(f.h / Math.sin(q * a))), b = p +
  2473. Math.abs(a / 360), b < y && (y = b, m = a, h = p)
  2474. }) : a.step || (h = x(f.h));
  2475. this.autoRotation = t;
  2476. this.labelRotation = w(m, d);
  2477. return h
  2478. },
  2479. getSlotWidth: function () {
  2480. var a = this.chart, b = this.horiz, c = this.options.labels, e = Math.max(this.tickPositions.length - (this.categories ? 0 : 1), 1), h = a.margin[3];
  2481. return b && 2 > (c.step || 0) && !c.rotation && (this.staggerLines || 1) * this.len / e || !b && (h && h - a.spacing[3] || .33 * a.chartWidth)
  2482. },
  2483. renderUnsquish: function () {
  2484. var a = this.chart, c = a.renderer, h = this.tickPositions, n = this.ticks, m = this.options.labels, d = this.horiz,
  2485. v = this.getSlotWidth(), f = Math.max(1, Math.round(v - 2 * (m.padding || 5))), p = {}, y = this.labelMetrics(), t = m.style && m.style.textOverflow, g, z = 0, E, w;
  2486. e(m.rotation) || (p.rotation = m.rotation || 0);
  2487. b(h, function (a) {
  2488. (a = n[a]) && a.labelLength > z && (z = a.labelLength)
  2489. });
  2490. this.maxLabelLength = z;
  2491. if (this.autoRotation)z > f && z > y.h ? p.rotation = this.labelRotation : this.labelRotation = 0; else if (v && (g = {width: f + "px"}, !t))for (g.textOverflow = "clip", E = h.length; !d && E--;)if (w = h[E], f = n[w].label)f.styles && "ellipsis" === f.styles.textOverflow ? f.css({textOverflow: "clip"}) :
  2492. n[w].labelLength > v && f.css({width: v + "px"}), f.getBBox().height > this.len / h.length - (y.h - y.f) && (f.specCss = {textOverflow: "ellipsis"});
  2493. p.rotation && (g = {width: (z > .5 * a.chartHeight ? .33 * a.chartHeight : a.chartHeight) + "px"}, t || (g.textOverflow = "ellipsis"));
  2494. if (this.labelAlign = m.align || this.autoLabelAlign(this.labelRotation))p.align = this.labelAlign;
  2495. b(h, function (a) {
  2496. var b = (a = n[a]) && a.label;
  2497. b && (b.attr(p), g && b.css(x(g, b.specCss)), delete b.specCss, a.rotation = p.rotation)
  2498. });
  2499. this.tickRotCorr = c.rotCorr(y.b, this.labelRotation ||
  2500. 0, 0 !== this.side)
  2501. },
  2502. hasData: function () {
  2503. return this.hasVisibleSeries || l(this.min) && l(this.max) && !!this.tickPositions
  2504. },
  2505. addTitle: function (a) {
  2506. var b = this.chart.renderer, c = this.horiz, k = this.opposite, e = this.options.title, h;
  2507. this.axisTitle || ((h = e.textAlign) || (h = (c ? {
  2508. low: "left",
  2509. middle: "center",
  2510. high: "right"
  2511. } : {
  2512. low: k ? "right" : "left",
  2513. middle: "center",
  2514. high: k ? "left" : "right"
  2515. })[e.align]), this.axisTitle = b.text(e.text, 0, 0, e.useHTML).attr({
  2516. zIndex: 7,
  2517. rotation: e.rotation || 0,
  2518. align: h
  2519. }).addClass("highcharts-axis-title").css(e.style).add(this.axisGroup),
  2520. this.axisTitle.isNew = !0);
  2521. this.axisTitle[a ? "show" : "hide"](!0)
  2522. },
  2523. generateTick: function (a) {
  2524. var b = this.ticks;
  2525. b[a] ? b[a].addLabel() : b[a] = new I(this, a)
  2526. },
  2527. getOffset: function () {
  2528. var a = this, c = a.chart, e = c.renderer, h = a.options, n = a.tickPositions, m = a.ticks, d = a.horiz, f = a.side, p = c.inverted ? [1, 0, 3, 2][f] : f, y, t, x = 0, g, z = 0, E = h.title, q = h.labels, F = 0, J = c.axisOffset, c = c.clipOffset, K = [-1, 1, 1, -1][f], C, I = h.className, r = a.axisParent, u = this.tickSize("tick");
  2529. y = a.hasData();
  2530. a.showAxis = t = y || w(h.showEmpty, !0);
  2531. a.staggerLines = a.horiz && q.staggerLines;
  2532. a.axisGroup || (a.gridGroup = e.g("grid").attr({zIndex: h.gridZIndex || 1}).addClass("highcharts-" + this.coll.toLowerCase() + "-grid " + (I || "")).add(r), a.axisGroup = e.g("axis").attr({zIndex: h.zIndex || 2}).addClass("highcharts-" + this.coll.toLowerCase() + " " + (I || "")).add(r), a.labelGroup = e.g("axis-labels").attr({zIndex: q.zIndex || 7}).addClass("highcharts-" + a.coll.toLowerCase() + "-labels " + (I || "")).add(r));
  2533. if (y || a.isLinked)b(n, function (b, c) {
  2534. a.generateTick(b, c)
  2535. }), a.renderUnsquish(), !1 === q.reserveSpace || 0 !== f && 2 !== f &&
  2536. {1: "left", 3: "right"}[f] !== a.labelAlign && "center" !== a.labelAlign || b(n, function (a) {
  2537. F = Math.max(m[a].getLabelSize(), F)
  2538. }), a.staggerLines && (F *= a.staggerLines, a.labelOffset = F * (a.opposite ? -1 : 1)); else for (C in m)m[C].destroy(), delete m[C];
  2539. E && E.text && !1 !== E.enabled && (a.addTitle(t), t && (x = a.axisTitle.getBBox()[d ? "height" : "width"], g = E.offset, z = l(g) ? 0 : w(E.margin, d ? 5 : 10)));
  2540. a.renderLine();
  2541. a.offset = K * w(h.offset, J[f]);
  2542. a.tickRotCorr = a.tickRotCorr || {x: 0, y: 0};
  2543. e = 0 === f ? -a.labelMetrics().h : 2 === f ? a.tickRotCorr.y : 0;
  2544. z = Math.abs(F) +
  2545. z;
  2546. F && (z = z - e + K * (d ? w(q.y, a.tickRotCorr.y + 8 * K) : q.x));
  2547. a.axisTitleMargin = w(g, z);
  2548. J[f] = Math.max(J[f], a.axisTitleMargin + x + K * a.offset, z, y && n.length && u ? u[0] : 0);
  2549. h = h.offset ? 0 : 2 * Math.floor(a.axisLine.strokeWidth() / 2);
  2550. c[p] = Math.max(c[p], h)
  2551. },
  2552. getLinePath: function (a) {
  2553. var b = this.chart, c = this.opposite, k = this.offset, e = this.horiz, h = this.left + (c ? this.width : 0) + k, k = b.chartHeight - this.bottom - (c ? this.height : 0) + k;
  2554. c && (a *= -1);
  2555. return b.renderer.crispLine(["M", e ? this.left : h, e ? k : this.top, "L", e ? b.chartWidth - this.right : h, e ? k : b.chartHeight -
  2556. this.bottom], a)
  2557. },
  2558. renderLine: function () {
  2559. this.axisLine || (this.axisLine = this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup), this.axisLine.attr({
  2560. stroke: this.options.lineColor,
  2561. "stroke-width": this.options.lineWidth,
  2562. zIndex: 7
  2563. }))
  2564. },
  2565. getTitlePosition: function () {
  2566. var a = this.horiz, b = this.left, c = this.top, e = this.len, h = this.options.title, n = a ? b : c, m = this.opposite, d = this.offset, f = h.x || 0, p = h.y || 0, y = this.chart.renderer.fontMetrics(h.style && h.style.fontSize, this.axisTitle).f, e = {
  2567. low: n + (a ? 0 : e),
  2568. middle: n + e / 2, high: n + (a ? e : 0)
  2569. }[h.align], b = (a ? c + this.height : b) + (a ? 1 : -1) * (m ? -1 : 1) * this.axisTitleMargin + (2 === this.side ? y : 0);
  2570. return {
  2571. x: a ? e + f : b + (m ? this.width : 0) + d + f,
  2572. y: a ? b + p - (m ? this.height : 0) + d : e + p
  2573. }
  2574. },
  2575. renderMinorTick: function (a) {
  2576. var b = this.chart.hasRendered && z(this.oldMin), c = this.minorTicks;
  2577. c[a] || (c[a] = new I(this, a, "minor"));
  2578. b && c[a].isNew && c[a].render(null, !0);
  2579. c[a].render(null, !1, 1)
  2580. },
  2581. renderTick: function (a, b) {
  2582. var c = this.isLinked, e = this.ticks, k = this.chart.hasRendered && z(this.oldMin);
  2583. if (!c || a >= this.min && a <= this.max)e[a] ||
  2584. (e[a] = new I(this, a)), k && e[a].isNew && e[a].render(b, !0, .1), e[a].render(b)
  2585. },
  2586. render: function () {
  2587. var a = this, c = a.chart, e = a.options, n = a.isLog, m = a.lin2log, d = a.isLinked, v = a.tickPositions, f = a.axisTitle, p = a.ticks, y = a.minorTicks, t = a.alternateBands, x = e.stackLabels, z = e.alternateGridColor, g = a.tickmarkOffset, E = a.axisLine, w = a.showAxis, l = A(c.renderer.globalAnimation), q, F;
  2588. a.labelEdge.length = 0;
  2589. a.overlap = !1;
  2590. b([p, y, t], function (a) {
  2591. for (var b in a)a[b].isActive = !1
  2592. });
  2593. if (a.hasData() || d)a.minorTickInterval && !a.categories && b(a.getMinorTickPositions(),
  2594. function (b) {
  2595. a.renderMinorTick(b)
  2596. }), v.length && (b(v, function (b, c) {
  2597. a.renderTick(b, c)
  2598. }), g && (0 === a.min || a.single) && (p[-1] || (p[-1] = new I(a, -1, null, !0)), p[-1].render(-1))), z && b(v, function (b, e) {
  2599. F = void 0 !== v[e + 1] ? v[e + 1] + g : a.max - g;
  2600. 0 === e % 2 && b < a.max && F <= a.max + (c.polar ? -g : g) && (t[b] || (t[b] = new h(a)), q = b + g, t[b].options = {
  2601. from: n ? m(q) : q,
  2602. to: n ? m(F) : F,
  2603. color: z
  2604. }, t[b].render(), t[b].isActive = !0)
  2605. }), a._addedPlotLB || (b((e.plotLines || []).concat(e.plotBands || []), function (b) {
  2606. a.addPlotBandOrLine(b)
  2607. }), a._addedPlotLB = !0);
  2608. b([p, y, t],
  2609. function (a) {
  2610. var b, e, h = [], k = l.duration;
  2611. for (b in a)a[b].isActive || (a[b].render(b, !1, 0), a[b].isActive = !1, h.push(b));
  2612. K(function () {
  2613. for (e = h.length; e--;)a[h[e]] && !a[h[e]].isActive && (a[h[e]].destroy(), delete a[h[e]])
  2614. }, a !== t && c.hasRendered && k ? k : 0)
  2615. });
  2616. E && (E[E.isPlaced ? "animate" : "attr"]({d: this.getLinePath(E.strokeWidth())}), E.isPlaced = !0, E[w ? "show" : "hide"](!0));
  2617. f && w && (f[f.isNew ? "attr" : "animate"](a.getTitlePosition()), f.isNew = !1);
  2618. x && x.enabled && a.renderStackTotals();
  2619. a.isDirty = !1
  2620. },
  2621. redraw: function () {
  2622. this.visible &&
  2623. (this.render(), b(this.plotLinesAndBands, function (a) {
  2624. a.render()
  2625. }));
  2626. b(this.series, function (a) {
  2627. a.isDirty = !0
  2628. })
  2629. },
  2630. keepProps: "extKey hcEvents names series userMax userMin".split(" "),
  2631. destroy: function (a) {
  2632. var c = this, e = c.stacks, h, k = c.plotLinesAndBands, m;
  2633. a || y(c);
  2634. for (h in e)d(e[h]), e[h] = null;
  2635. b([c.ticks, c.minorTicks, c.alternateBands], function (a) {
  2636. d(a)
  2637. });
  2638. if (k)for (a = k.length; a--;)k[a].destroy();
  2639. b("stackTotalGroup axisLine axisTitle axisGroup gridGroup labelGroup cross".split(" "), function (a) {
  2640. c[a] && (c[a] = c[a].destroy())
  2641. });
  2642. for (m in c)c.hasOwnProperty(m) && -1 === n(m, c.keepProps) && delete c[m]
  2643. },
  2644. drawCrosshair: function (a, b) {
  2645. var c, e = this.crosshair, h = w(e.snap, !0), k, n = this.cross;
  2646. a || (a = this.cross && this.cross.e);
  2647. this.crosshair && !1 !== (l(b) || !h) ? (h ? l(b) && (k = this.isXAxis ? b.plotX : this.len - b.plotY) : k = a && (this.horiz ? a.chartX - this.pos : this.len - a.chartY + this.pos), l(k) && (c = this.getPlotLinePath(b && (this.isXAxis ? b.x : w(b.stackY, b.y)), null, null, null, k) || null), l(c) ? (b = this.categories && !this.isRadial, n || (this.cross = n = this.chart.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-" +
  2648. (b ? "category " : "thin ") + e.className).attr({zIndex: w(e.zIndex, 2)}).add(), n.attr({
  2649. stroke: e.color || (b ? g("#ccd6eb").setOpacity(.25).get() : "#cccccc"),
  2650. "stroke-width": w(e.width, 1)
  2651. }), e.dashStyle && n.attr({dashstyle: e.dashStyle})), n.show().attr({d: c}), b && !e.width && n.attr({"stroke-width": this.transA}), this.cross.e = a) : this.hideCrosshair()) : this.hideCrosshair()
  2652. },
  2653. hideCrosshair: function () {
  2654. this.cross && this.cross.hide()
  2655. }
  2656. };
  2657. p(a.Axis.prototype, r)
  2658. })(L);
  2659. (function (a) {
  2660. var B = a.Axis, A = a.Date, H = a.dateFormat, G = a.defaultOptions,
  2661. r = a.defined, g = a.each, f = a.extend, u = a.getMagnitude, l = a.getTZOffset, q = a.normalizeTickInterval, d = a.pick, b = a.timeUnits;
  2662. B.prototype.getTimeTicks = function (a, q, t, m) {
  2663. var c = [], n = {}, p = G.global.useUTC, z, e = new A(q - l(q)), x = A.hcMakeTime, F = a.unitRange, w = a.count, h;
  2664. if (r(q)) {
  2665. e[A.hcSetMilliseconds](F >= b.second ? 0 : w * Math.floor(e.getMilliseconds() / w));
  2666. if (F >= b.second)e[A.hcSetSeconds](F >= b.minute ? 0 : w * Math.floor(e.getSeconds() / w));
  2667. if (F >= b.minute)e[A.hcSetMinutes](F >= b.hour ? 0 : w * Math.floor(e[A.hcGetMinutes]() / w));
  2668. if (F >= b.hour)e[A.hcSetHours](F >=
  2669. b.day ? 0 : w * Math.floor(e[A.hcGetHours]() / w));
  2670. if (F >= b.day)e[A.hcSetDate](F >= b.month ? 1 : w * Math.floor(e[A.hcGetDate]() / w));
  2671. F >= b.month && (e[A.hcSetMonth](F >= b.year ? 0 : w * Math.floor(e[A.hcGetMonth]() / w)), z = e[A.hcGetFullYear]());
  2672. if (F >= b.year)e[A.hcSetFullYear](z - z % w);
  2673. if (F === b.week)e[A.hcSetDate](e[A.hcGetDate]() - e[A.hcGetDay]() + d(m, 1));
  2674. z = e[A.hcGetFullYear]();
  2675. m = e[A.hcGetMonth]();
  2676. var y = e[A.hcGetDate](), J = e[A.hcGetHours]();
  2677. if (A.hcTimezoneOffset || A.hcGetTimezoneOffset)h = (!p || !!A.hcGetTimezoneOffset) && (t - q > 4 * b.month ||
  2678. l(q) !== l(t)), e = e.getTime(), e = new A(e + l(e));
  2679. p = e.getTime();
  2680. for (q = 1; p < t;)c.push(p), p = F === b.year ? x(z + q * w, 0) : F === b.month ? x(z, m + q * w) : !h || F !== b.day && F !== b.week ? h && F === b.hour ? x(z, m, y, J + q * w) : p + F * w : x(z, m, y + q * w * (F === b.day ? 1 : 7)), q++;
  2681. c.push(p);
  2682. F <= b.hour && 1E4 > c.length && g(c, function (a) {
  2683. 0 === a % 18E5 && "000000000" === H("%H%M%S%L", a) && (n[a] = "day")
  2684. })
  2685. }
  2686. c.info = f(a, {higherRanks: n, totalRange: F * w});
  2687. return c
  2688. };
  2689. B.prototype.normalizeTimeTickInterval = function (a, d) {
  2690. var f = d || [["millisecond", [1, 2, 5, 10, 20, 25, 50, 100, 200, 500]], ["second",
  2691. [1, 2, 5, 10, 15, 30]], ["minute", [1, 2, 5, 10, 15, 30]], ["hour", [1, 2, 3, 4, 6, 8, 12]], ["day", [1, 2]], ["week", [1, 2]], ["month", [1, 2, 3, 4, 6]], ["year", null]];
  2692. d = f[f.length - 1];
  2693. var m = b[d[0]], c = d[1], n;
  2694. for (n = 0; n < f.length && !(d = f[n], m = b[d[0]], c = d[1], f[n + 1] && a <= (m * c[c.length - 1] + b[f[n + 1][0]]) / 2); n++);
  2695. m === b.year && a < 5 * m && (c = [1, 2, 5]);
  2696. a = q(a / m, c, "year" === d[0] ? Math.max(u(a / m), 1) : 1);
  2697. return {unitRange: m, count: a, unitName: d[0]}
  2698. }
  2699. })(L);
  2700. (function (a) {
  2701. var B = a.Axis, A = a.getMagnitude, H = a.map, G = a.normalizeTickInterval, r = a.pick;
  2702. B.prototype.getLogTickPositions =
  2703. function (a, f, u, l) {
  2704. var g = this.options, d = this.len, b = this.lin2log, p = this.log2lin, C = [];
  2705. l || (this._minorAutoInterval = null);
  2706. if (.5 <= a)a = Math.round(a), C = this.getLinearTickPositions(a, f, u); else if (.08 <= a)for (var d = Math.floor(f), t, m, c, n, E, g = .3 < a ? [1, 2, 4] : .15 < a ? [1, 2, 4, 6, 8] : [1, 2, 3, 4, 5, 6, 7, 8, 9]; d < u + 1 && !E; d++)for (m = g.length, t = 0; t < m && !E; t++)c = p(b(d) * g[t]), c > f && (!l || n <= u) && void 0 !== n && C.push(n), n > u && (E = !0), n = c; else f = b(f), u = b(u), a = g[l ? "minorTickInterval" : "tickInterval"], a = r("auto" === a ? null : a, this._minorAutoInterval,
  2707. g.tickPixelInterval / (l ? 5 : 1) * (u - f) / ((l ? d / this.tickPositions.length : d) || 1)), a = G(a, null, A(a)), C = H(this.getLinearTickPositions(a, f, u), p), l || (this._minorAutoInterval = a / 5);
  2708. l || (this.tickInterval = a);
  2709. return C
  2710. };
  2711. B.prototype.log2lin = function (a) {
  2712. return Math.log(a) / Math.LN10
  2713. };
  2714. B.prototype.lin2log = function (a) {
  2715. return Math.pow(10, a)
  2716. }
  2717. })(L);
  2718. (function (a) {
  2719. var B = a.dateFormat, A = a.each, H = a.extend, G = a.format, r = a.isNumber, g = a.map, f = a.merge, u = a.pick, l = a.splat, q = a.syncTimeout, d = a.timeUnits;
  2720. a.Tooltip = function () {
  2721. this.init.apply(this,
  2722. arguments)
  2723. };
  2724. a.Tooltip.prototype = {
  2725. init: function (a, d) {
  2726. this.chart = a;
  2727. this.options = d;
  2728. this.crosshairs = [];
  2729. this.now = {x: 0, y: 0};
  2730. this.isHidden = !0;
  2731. this.split = d.split && !a.inverted;
  2732. this.shared = d.shared || this.split
  2733. }, cleanSplit: function (a) {
  2734. A(this.chart.series, function (b) {
  2735. var d = b && b.tt;
  2736. d && (!d.isActive || a ? b.tt = d.destroy() : d.isActive = !1)
  2737. })
  2738. }, getLabel: function () {
  2739. var a = this.chart.renderer, d = this.options;
  2740. this.label || (this.split ? this.label = a.g("tooltip") : (this.label = a.label("", 0, 0, d.shape || "callout", null, null, d.useHTML,
  2741. null, "tooltip").attr({
  2742. padding: d.padding,
  2743. r: d.borderRadius
  2744. }), this.label.attr({
  2745. fill: d.backgroundColor,
  2746. "stroke-width": d.borderWidth
  2747. }).css(d.style).shadow(d.shadow)), this.label.attr({zIndex: 8}).add());
  2748. return this.label
  2749. }, update: function (a) {
  2750. this.destroy();
  2751. this.init(this.chart, f(!0, this.options, a))
  2752. }, destroy: function () {
  2753. this.label && (this.label = this.label.destroy());
  2754. this.split && this.tt && (this.cleanSplit(this.chart, !0), this.tt = this.tt.destroy());
  2755. clearTimeout(this.hideTimer);
  2756. clearTimeout(this.tooltipTimeout)
  2757. },
  2758. move: function (a, d, f, t) {
  2759. var b = this, c = b.now, n = !1 !== b.options.animation && !b.isHidden && (1 < Math.abs(a - c.x) || 1 < Math.abs(d - c.y)), p = b.followPointer || 1 < b.len;
  2760. H(c, {
  2761. x: n ? (2 * c.x + a) / 3 : a,
  2762. y: n ? (c.y + d) / 2 : d,
  2763. anchorX: p ? void 0 : n ? (2 * c.anchorX + f) / 3 : f,
  2764. anchorY: p ? void 0 : n ? (c.anchorY + t) / 2 : t
  2765. });
  2766. b.getLabel().attr(c);
  2767. n && (clearTimeout(this.tooltipTimeout), this.tooltipTimeout = setTimeout(function () {
  2768. b && b.move(a, d, f, t)
  2769. }, 32))
  2770. }, hide: function (a) {
  2771. var b = this;
  2772. clearTimeout(this.hideTimer);
  2773. a = u(a, this.options.hideDelay, 500);
  2774. this.isHidden || (this.hideTimer =
  2775. q(function () {
  2776. b.getLabel()[a ? "fadeOut" : "hide"]();
  2777. b.isHidden = !0
  2778. }, a))
  2779. }, getAnchor: function (a, d) {
  2780. var b, f = this.chart, m = f.inverted, c = f.plotTop, n = f.plotLeft, p = 0, z = 0, e, x;
  2781. a = l(a);
  2782. b = a[0].tooltipPos;
  2783. this.followPointer && d && (void 0 === d.chartX && (d = f.pointer.normalize(d)), b = [d.chartX - f.plotLeft, d.chartY - c]);
  2784. b || (A(a, function (a) {
  2785. e = a.series.yAxis;
  2786. x = a.series.xAxis;
  2787. p += a.plotX + (!m && x ? x.left - n : 0);
  2788. z += (a.plotLow ? (a.plotLow + a.plotHigh) / 2 : a.plotY) + (!m && e ? e.top - c : 0)
  2789. }), p /= a.length, z /= a.length, b = [m ? f.plotWidth - z : p, this.shared && !m && 1 < a.length && d ? d.chartY - c : m ? f.plotHeight - p : z]);
  2790. return g(b, Math.round)
  2791. }, getPosition: function (a, d, f) {
  2792. var b = this.chart, m = this.distance, c = {}, n = f.h || 0, p, z = ["y", b.chartHeight, d, f.plotY + b.plotTop, b.plotTop, b.plotTop + b.plotHeight], e = ["x", b.chartWidth, a, f.plotX + b.plotLeft, b.plotLeft, b.plotLeft + b.plotWidth], x = !this.followPointer && u(f.ttBelow, !b.inverted === !!f.negative), g = function (a, b, e, h, d, f) {
  2793. var k = e < h - m, y = h + m + e < b, p = h - m - e;
  2794. h += m;
  2795. if (x && y)c[a] = h; else if (!x && k)c[a] = p; else if (k)c[a] = Math.min(f - e, 0 > p - n ? p : p - n);
  2796. else if (y)c[a] = Math.max(d, h + n + e > b ? h : h + n); else return !1
  2797. }, w = function (a, b, e, h) {
  2798. var k;
  2799. h < m || h > b - m ? k = !1 : c[a] = h < e / 2 ? 1 : h > b - e / 2 ? b - e - 2 : h - e / 2;
  2800. return k
  2801. }, h = function (a) {
  2802. var b = z;
  2803. z = e;
  2804. e = b;
  2805. p = a
  2806. }, y = function () {
  2807. !1 !== g.apply(0, z) ? !1 !== w.apply(0, e) || p || (h(!0), y()) : p ? c.x = c.y = 0 : (h(!0), y())
  2808. };
  2809. (b.inverted || 1 < this.len) && h();
  2810. y();
  2811. return c
  2812. }, defaultFormatter: function (a) {
  2813. var b = this.points || l(this), d;
  2814. d = [a.tooltipFooterHeaderFormatter(b[0])];
  2815. d = d.concat(a.bodyFormatter(b));
  2816. d.push(a.tooltipFooterHeaderFormatter(b[0], !0));
  2817. return d
  2818. }, refresh: function (a,
  2819. d) {
  2820. var b = this.chart, f, m = this.options, c, n, p = {}, z = [];
  2821. f = m.formatter || this.defaultFormatter;
  2822. var p = b.hoverPoints, e = this.shared;
  2823. clearTimeout(this.hideTimer);
  2824. this.followPointer = l(a)[0].series.tooltipOptions.followPointer;
  2825. n = this.getAnchor(a, d);
  2826. d = n[0];
  2827. c = n[1];
  2828. !e || a.series && a.series.noSharedTooltip ? p = a.getLabelConfig() : (b.hoverPoints = a, p && A(p, function (a) {
  2829. a.setState()
  2830. }), A(a, function (a) {
  2831. a.setState("hover");
  2832. z.push(a.getLabelConfig())
  2833. }), p = {x: a[0].category, y: a[0].y}, p.points = z, a = a[0]);
  2834. this.len = z.length;
  2835. p = f.call(p,
  2836. this);
  2837. e = a.series;
  2838. this.distance = u(e.tooltipOptions.distance, 16);
  2839. !1 === p ? this.hide() : (f = this.getLabel(), this.isHidden && f.attr({opacity: 1}).show(), this.split ? this.renderSplit(p, b.hoverPoints) : (f.attr({text: p && p.join ? p.join("") : p}), f.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-" + u(a.colorIndex, e.colorIndex)), f.attr({stroke: m.borderColor || a.color || e.color || "#666666"}), this.updatePosition({
  2840. plotX: d,
  2841. plotY: c,
  2842. negative: a.negative,
  2843. ttBelow: a.ttBelow,
  2844. h: n[2] || 0
  2845. })), this.isHidden = !1)
  2846. }, renderSplit: function (b,
  2847. d) {
  2848. var f = this, p = [], m = this.chart, c = m.renderer, n = !0, g = this.options, z, e = this.getLabel();
  2849. A(b.slice(0, d.length + 1), function (a, b) {
  2850. b = d[b - 1] || {isHeader: !0, plotX: d[0].plotX};
  2851. var x = b.series || f, h = x.tt, y = b.series || {}, t = "highcharts-color-" + u(b.colorIndex, y.colorIndex, "none");
  2852. h || (x.tt = h = c.label(null, null, null, "callout").addClass("highcharts-tooltip-box " + t).attr({
  2853. padding: g.padding,
  2854. r: g.borderRadius,
  2855. fill: g.backgroundColor,
  2856. stroke: b.color || y.color || "#333333",
  2857. "stroke-width": g.borderWidth
  2858. }).add(e));
  2859. h.isActive = !0;
  2860. h.attr({text: a});
  2861. h.css(g.style);
  2862. a = h.getBBox();
  2863. y = a.width + h.strokeWidth();
  2864. b.isHeader ? (z = a.height, y = Math.max(0, Math.min(b.plotX + m.plotLeft - y / 2, m.chartWidth - y))) : y = b.plotX + m.plotLeft - u(g.distance, 16) - y;
  2865. 0 > y && (n = !1);
  2866. a = (b.series && b.series.yAxis && b.series.yAxis.pos) + (b.plotY || 0);
  2867. a -= m.plotTop;
  2868. p.push({
  2869. target: b.isHeader ? m.plotHeight + z : a,
  2870. rank: b.isHeader ? 1 : 0,
  2871. size: x.tt.getBBox().height + 1,
  2872. point: b,
  2873. x: y,
  2874. tt: h
  2875. })
  2876. });
  2877. this.cleanSplit();
  2878. a.distribute(p, m.plotHeight + z);
  2879. A(p, function (a) {
  2880. var b = a.point, c = b.series;
  2881. a.tt.attr({
  2882. visibility: void 0 ===
  2883. a.pos ? "hidden" : "inherit",
  2884. x: n || b.isHeader ? a.x : b.plotX + m.plotLeft + u(g.distance, 16),
  2885. y: a.pos + m.plotTop,
  2886. anchorX: b.isHeader ? b.plotX + m.plotLeft : b.plotX + c.xAxis.pos,
  2887. anchorY: b.isHeader ? a.pos + m.plotTop - 15 : b.plotY + c.yAxis.pos
  2888. })
  2889. })
  2890. }, updatePosition: function (a) {
  2891. var b = this.chart, d = this.getLabel(), d = (this.options.positioner || this.getPosition).call(this, d.width, d.height, a);
  2892. this.move(Math.round(d.x), Math.round(d.y || 0), a.plotX + b.plotLeft, a.plotY + b.plotTop)
  2893. }, getDateFormat: function (a, f, g, t) {
  2894. var b = B("%m-%d %H:%M:%S.%L",
  2895. f), c, n, p = {millisecond: 15, second: 12, minute: 9, hour: 6, day: 3}, z = "millisecond";
  2896. for (n in d) {
  2897. if (a === d.week && +B("%w", f) === g && "00:00:00.000" === b.substr(6)) {
  2898. n = "week";
  2899. break
  2900. }
  2901. if (d[n] > a) {
  2902. n = z;
  2903. break
  2904. }
  2905. if (p[n] && b.substr(p[n]) !== "01-01 00:00:00.000".substr(p[n]))break;
  2906. "week" !== n && (z = n)
  2907. }
  2908. n && (c = t[n]);
  2909. return c
  2910. }, getXDateFormat: function (a, d, f) {
  2911. d = d.dateTimeLabelFormats;
  2912. var b = f && f.closestPointRange;
  2913. return (b ? this.getDateFormat(b, a.x, f.options.startOfWeek, d) : d.day) || d.year
  2914. }, tooltipFooterHeaderFormatter: function (a, d) {
  2915. var b = d ? "footer" :
  2916. "header";
  2917. d = a.series;
  2918. var f = d.tooltipOptions, m = f.xDateFormat, c = d.xAxis, n = c && "datetime" === c.options.type && r(a.key), b = f[b + "Format"];
  2919. n && !m && (m = this.getXDateFormat(a, f, c));
  2920. n && m && (b = b.replace("{point.key}", "{point.key:" + m + "}"));
  2921. return G(b, {point: a, series: d})
  2922. }, bodyFormatter: function (a) {
  2923. return g(a, function (a) {
  2924. var b = a.series.tooltipOptions;
  2925. return (b.pointFormatter || a.point.tooltipFormatter).call(a.point, b.pointFormat)
  2926. })
  2927. }
  2928. }
  2929. })(L);
  2930. (function (a) {
  2931. var B = a.addEvent, A = a.attr, H = a.charts, G = a.color, r = a.css, g = a.defined, f =
  2932. a.doc, u = a.each, l = a.extend, q = a.fireEvent, d = a.offset, b = a.pick, p = a.removeEvent, C = a.splat, t = a.Tooltip, m = a.win;
  2933. a.Pointer = function (a, b) {
  2934. this.init(a, b)
  2935. };
  2936. a.Pointer.prototype = {
  2937. init: function (a, d) {
  2938. this.options = d;
  2939. this.chart = a;
  2940. this.runChartClick = d.chart.events && !!d.chart.events.click;
  2941. this.pinchDown = [];
  2942. this.lastValidTouch = {};
  2943. t && d.tooltip.enabled && (a.tooltip = new t(a, d.tooltip), this.followTouchMove = b(d.tooltip.followTouchMove, !0));
  2944. this.setDOMEvents()
  2945. }, zoomOption: function (a) {
  2946. var c = this.chart, d = c.options.chart, m = d.zoomType ||
  2947. "", c = c.inverted;
  2948. /touch/.test(a.type) && (m = b(d.pinchType, m));
  2949. this.zoomX = a = /x/.test(m);
  2950. this.zoomY = m = /y/.test(m);
  2951. this.zoomHor = a && !c || m && c;
  2952. this.zoomVert = m && !c || a && c;
  2953. this.hasZoom = a || m
  2954. }, normalize: function (a, b) {
  2955. var c, n;
  2956. a = a || m.event;
  2957. a.target || (a.target = a.srcElement);
  2958. n = a.touches ? a.touches.length ? a.touches.item(0) : a.changedTouches[0] : a;
  2959. b || (this.chartPosition = b = d(this.chart.container));
  2960. void 0 === n.pageX ? (c = Math.max(a.x, a.clientX - b.left), b = a.y) : (c = n.pageX - b.left, b = n.pageY - b.top);
  2961. return l(a, {
  2962. chartX: Math.round(c),
  2963. chartY: Math.round(b)
  2964. })
  2965. }, getCoordinates: function (a) {
  2966. var b = {xAxis: [], yAxis: []};
  2967. u(this.chart.axes, function (c) {
  2968. b[c.isXAxis ? "xAxis" : "yAxis"].push({axis: c, value: c.toValue(a[c.horiz ? "chartX" : "chartY"])})
  2969. });
  2970. return b
  2971. }, runPointActions: function (c) {
  2972. var d = this.chart, m = d.series, p = d.tooltip, e = p ? p.shared : !1, g = !0, t = d.hoverPoint, w = d.hoverSeries, h, y, l, q = [], r;
  2973. if (!e && !w)for (h = 0; h < m.length; h++)if (m[h].directTouch || !m[h].options.stickyTracking)m = [];
  2974. w && (e ? w.noSharedTooltip : w.directTouch) && t ? q = [t] : (e || !w || w.options.stickyTracking ||
  2975. (m = [w]), u(m, function (a) {
  2976. y = a.noSharedTooltip && e;
  2977. l = !e && a.directTouch;
  2978. a.visible && !y && !l && b(a.options.enableMouseTracking, !0) && (r = a.searchPoint(c, !y && 1 === a.kdDimensions)) && r.series && q.push(r)
  2979. }), q.sort(function (a, b) {
  2980. var c = a.distX - b.distX, h = a.dist - b.dist, k = (b.series.group && b.series.group.zIndex) - (a.series.group && a.series.group.zIndex);
  2981. return 0 !== c && e ? c : 0 !== h ? h : 0 !== k ? k : a.series.index > b.series.index ? -1 : 1
  2982. }));
  2983. if (e)for (h = q.length; h--;)(q[h].x !== q[0].x || q[h].series.noSharedTooltip) && q.splice(h, 1);
  2984. if (q[0] && (q[0] !==
  2985. this.prevKDPoint || p && p.isHidden)) {
  2986. if (e && !q[0].series.noSharedTooltip) {
  2987. for (h = 0; h < q.length; h++)q[h].onMouseOver(c, q[h] !== (w && w.directTouch && t || q[0]));
  2988. q.length && p && p.refresh(q.sort(function (a, b) {
  2989. return a.series.index - b.series.index
  2990. }), c)
  2991. } else if (p && p.refresh(q[0], c), !w || !w.directTouch)q[0].onMouseOver(c);
  2992. this.prevKDPoint = q[0];
  2993. g = !1
  2994. }
  2995. g && (m = w && w.tooltipOptions.followPointer, p && m && !p.isHidden && (m = p.getAnchor([{}], c), p.updatePosition({
  2996. plotX: m[0],
  2997. plotY: m[1]
  2998. })));
  2999. this.unDocMouseMove || (this.unDocMouseMove = B(f,
  3000. "mousemove", function (b) {
  3001. if (H[a.hoverChartIndex])H[a.hoverChartIndex].pointer.onDocumentMouseMove(b)
  3002. }));
  3003. u(e ? q : [b(t, q[0])], function (a) {
  3004. u(d.axes, function (b) {
  3005. (!a || a.series && a.series[b.coll] === b) && b.drawCrosshair(c, a)
  3006. })
  3007. })
  3008. }, reset: function (a, b) {
  3009. var c = this.chart, d = c.hoverSeries, e = c.hoverPoint, n = c.hoverPoints, m = c.tooltip, f = m && m.shared ? n : e;
  3010. a && f && u(C(f), function (b) {
  3011. b.series.isCartesian && void 0 === b.plotX && (a = !1)
  3012. });
  3013. if (a)m && f && (m.refresh(f), e && (e.setState(e.state, !0), u(c.axes, function (a) {
  3014. a.crosshair && a.drawCrosshair(null,
  3015. e)
  3016. }))); else {
  3017. if (e)e.onMouseOut();
  3018. n && u(n, function (a) {
  3019. a.setState()
  3020. });
  3021. if (d)d.onMouseOut();
  3022. m && m.hide(b);
  3023. this.unDocMouseMove && (this.unDocMouseMove = this.unDocMouseMove());
  3024. u(c.axes, function (a) {
  3025. a.hideCrosshair()
  3026. });
  3027. this.hoverX = this.prevKDPoint = c.hoverPoints = c.hoverPoint = null
  3028. }
  3029. }, scaleGroups: function (a, b) {
  3030. var c = this.chart, d;
  3031. u(c.series, function (e) {
  3032. d = a || e.getPlotBox();
  3033. e.xAxis && e.xAxis.zoomEnabled && e.group && (e.group.attr(d), e.markerGroup && (e.markerGroup.attr(d), e.markerGroup.clip(b ? c.clipRect : null)), e.dataLabelsGroup &&
  3034. e.dataLabelsGroup.attr(d))
  3035. });
  3036. c.clipRect.attr(b || c.clipBox)
  3037. }, dragStart: function (a) {
  3038. var b = this.chart;
  3039. b.mouseIsDown = a.type;
  3040. b.cancelClick = !1;
  3041. b.mouseDownX = this.mouseDownX = a.chartX;
  3042. b.mouseDownY = this.mouseDownY = a.chartY
  3043. }, drag: function (a) {
  3044. var b = this.chart, c = b.options.chart, d = a.chartX, e = a.chartY, m = this.zoomHor, f = this.zoomVert, p = b.plotLeft, h = b.plotTop, y = b.plotWidth, g = b.plotHeight, t, q = this.selectionMarker, k = this.mouseDownX, l = this.mouseDownY, r = c.panKey && a[c.panKey + "Key"];
  3045. q && q.touch || (d < p ? d = p : d > p + y && (d = p + y), e <
  3046. h ? e = h : e > h + g && (e = h + g), this.hasDragged = Math.sqrt(Math.pow(k - d, 2) + Math.pow(l - e, 2)), 10 < this.hasDragged && (t = b.isInsidePlot(k - p, l - h), b.hasCartesianSeries && (this.zoomX || this.zoomY) && t && !r && !q && (this.selectionMarker = q = b.renderer.rect(p, h, m ? 1 : y, f ? 1 : g, 0).attr({
  3047. fill: c.selectionMarkerFill || G("#335cad").setOpacity(.25).get(),
  3048. "class": "highcharts-selection-marker",
  3049. zIndex: 7
  3050. }).add()), q && m && (d -= k, q.attr({
  3051. width: Math.abs(d),
  3052. x: (0 < d ? 0 : d) + k
  3053. })), q && f && (d = e - l, q.attr({
  3054. height: Math.abs(d),
  3055. y: (0 < d ? 0 : d) + l
  3056. })), t && !q && c.panning && b.pan(a,
  3057. c.panning)))
  3058. }, drop: function (a) {
  3059. var b = this, c = this.chart, d = this.hasPinched;
  3060. if (this.selectionMarker) {
  3061. var e = {
  3062. originalEvent: a,
  3063. xAxis: [],
  3064. yAxis: []
  3065. }, m = this.selectionMarker, f = m.attr ? m.attr("x") : m.x, p = m.attr ? m.attr("y") : m.y, h = m.attr ? m.attr("width") : m.width, y = m.attr ? m.attr("height") : m.height, t;
  3066. if (this.hasDragged || d)u(c.axes, function (c) {
  3067. if (c.zoomEnabled && g(c.min) && (d || b[{xAxis: "zoomX", yAxis: "zoomY"}[c.coll]])) {
  3068. var m = c.horiz, k = "touchend" === a.type ? c.minPixelPadding : 0, n = c.toValue((m ? f : p) + k), m = c.toValue((m ? f + h : p +
  3069. y) - k);
  3070. e[c.coll].push({axis: c, min: Math.min(n, m), max: Math.max(n, m)});
  3071. t = !0
  3072. }
  3073. }), t && q(c, "selection", e, function (a) {
  3074. c.zoom(l(a, d ? {animation: !1} : null))
  3075. });
  3076. this.selectionMarker = this.selectionMarker.destroy();
  3077. d && this.scaleGroups()
  3078. }
  3079. c && (r(c.container, {cursor: c._cursor}), c.cancelClick = 10 < this.hasDragged, c.mouseIsDown = this.hasDragged = this.hasPinched = !1, this.pinchDown = [])
  3080. }, onContainerMouseDown: function (a) {
  3081. a = this.normalize(a);
  3082. this.zoomOption(a);
  3083. a.preventDefault && a.preventDefault();
  3084. this.dragStart(a)
  3085. }, onDocumentMouseUp: function (b) {
  3086. H[a.hoverChartIndex] &&
  3087. H[a.hoverChartIndex].pointer.drop(b)
  3088. }, onDocumentMouseMove: function (a) {
  3089. var b = this.chart, c = this.chartPosition;
  3090. a = this.normalize(a, c);
  3091. !c || this.inClass(a.target, "highcharts-tracker") || b.isInsidePlot(a.chartX - b.plotLeft, a.chartY - b.plotTop) || this.reset()
  3092. }, onContainerMouseLeave: function (b) {
  3093. var c = H[a.hoverChartIndex];
  3094. c && (b.relatedTarget || b.toElement) && (c.pointer.reset(), c.pointer.chartPosition = null)
  3095. }, onContainerMouseMove: function (b) {
  3096. var c = this.chart;
  3097. g(a.hoverChartIndex) && H[a.hoverChartIndex] && H[a.hoverChartIndex].mouseIsDown ||
  3098. (a.hoverChartIndex = c.index);
  3099. b = this.normalize(b);
  3100. b.returnValue = !1;
  3101. "mousedown" === c.mouseIsDown && this.drag(b);
  3102. !this.inClass(b.target, "highcharts-tracker") && !c.isInsidePlot(b.chartX - c.plotLeft, b.chartY - c.plotTop) || c.openMenu || this.runPointActions(b)
  3103. }, inClass: function (a, b) {
  3104. for (var c; a;) {
  3105. if (c = A(a, "class")) {
  3106. if (-1 !== c.indexOf(b))return !0;
  3107. if (-1 !== c.indexOf("highcharts-container"))return !1
  3108. }
  3109. a = a.parentNode
  3110. }
  3111. }, onTrackerMouseOut: function (a) {
  3112. var b = this.chart.hoverSeries;
  3113. a = a.relatedTarget || a.toElement;
  3114. if (!(!b || !a ||
  3115. b.options.stickyTracking || this.inClass(a, "highcharts-tooltip") || this.inClass(a, "highcharts-series-" + b.index) && this.inClass(a, "highcharts-tracker")))b.onMouseOut()
  3116. }, onContainerClick: function (a) {
  3117. var b = this.chart, c = b.hoverPoint, d = b.plotLeft, e = b.plotTop;
  3118. a = this.normalize(a);
  3119. b.cancelClick || (c && this.inClass(a.target, "highcharts-tracker") ? (q(c.series, "click", l(a, {point: c})), b.hoverPoint && c.firePointEvent("click", a)) : (l(a, this.getCoordinates(a)), b.isInsidePlot(a.chartX - d, a.chartY - e) && q(b, "click", a)))
  3120. }, setDOMEvents: function () {
  3121. var b =
  3122. this, d = b.chart.container;
  3123. d.onmousedown = function (a) {
  3124. b.onContainerMouseDown(a)
  3125. };
  3126. d.onmousemove = function (a) {
  3127. b.onContainerMouseMove(a)
  3128. };
  3129. d.onclick = function (a) {
  3130. b.onContainerClick(a)
  3131. };
  3132. B(d, "mouseleave", b.onContainerMouseLeave);
  3133. 1 === a.chartCount && B(f, "mouseup", b.onDocumentMouseUp);
  3134. a.hasTouch && (d.ontouchstart = function (a) {
  3135. b.onContainerTouchStart(a)
  3136. }, d.ontouchmove = function (a) {
  3137. b.onContainerTouchMove(a)
  3138. }, 1 === a.chartCount && B(f, "touchend", b.onDocumentTouchEnd))
  3139. }, destroy: function () {
  3140. var b;
  3141. p(this.chart.container, "mouseleave",
  3142. this.onContainerMouseLeave);
  3143. a.chartCount || (p(f, "mouseup", this.onDocumentMouseUp), p(f, "touchend", this.onDocumentTouchEnd));
  3144. clearInterval(this.tooltipTimeout);
  3145. for (b in this)this[b] = null
  3146. }
  3147. }
  3148. })(L);
  3149. (function (a) {
  3150. var B = a.charts, A = a.each, H = a.extend, G = a.map, r = a.noop, g = a.pick;
  3151. H(a.Pointer.prototype, {
  3152. pinchTranslate: function (a, g, l, q, d, b) {
  3153. this.zoomHor && this.pinchTranslateDirection(!0, a, g, l, q, d, b);
  3154. this.zoomVert && this.pinchTranslateDirection(!1, a, g, l, q, d, b)
  3155. }, pinchTranslateDirection: function (a, g, l, q, d, b, p, r) {
  3156. var f =
  3157. this.chart, m = a ? "x" : "y", c = a ? "X" : "Y", n = "chart" + c, E = a ? "width" : "height", z = f["plot" + (a ? "Left" : "Top")], e, x, F = r || 1, w = f.inverted, h = f.bounds[a ? "h" : "v"], y = 1 === g.length, J = g[0][n], u = l[0][n], I = !y && g[1][n], k = !y && l[1][n], D;
  3158. l = function () {
  3159. !y && 20 < Math.abs(J - I) && (F = r || Math.abs(u - k) / Math.abs(J - I));
  3160. x = (z - u) / F + J;
  3161. e = f["plot" + (a ? "Width" : "Height")] / F
  3162. };
  3163. l();
  3164. g = x;
  3165. g < h.min ? (g = h.min, D = !0) : g + e > h.max && (g = h.max - e, D = !0);
  3166. D ? (u -= .8 * (u - p[m][0]), y || (k -= .8 * (k - p[m][1])), l()) : p[m] = [u, k];
  3167. w || (b[m] = x - z, b[E] = e);
  3168. b = w ? 1 / F : F;
  3169. d[E] = e;
  3170. d[m] = g;
  3171. q[w ? a ? "scaleY" :
  3172. "scaleX" : "scale" + c] = F;
  3173. q["translate" + c] = b * z + (u - b * J)
  3174. }, pinch: function (a) {
  3175. var f = this, l = f.chart, q = f.pinchDown, d = a.touches, b = d.length, p = f.lastValidTouch, C = f.hasZoom, t = f.selectionMarker, m = {}, c = 1 === b && (f.inClass(a.target, "highcharts-tracker") && l.runTrackerClick || f.runChartClick), n = {};
  3176. 1 < b && (f.initiated = !0);
  3177. C && f.initiated && !c && a.preventDefault();
  3178. G(d, function (a) {
  3179. return f.normalize(a)
  3180. });
  3181. "touchstart" === a.type ? (A(d, function (a, b) {
  3182. q[b] = {chartX: a.chartX, chartY: a.chartY}
  3183. }), p.x = [q[0].chartX, q[1] && q[1].chartX], p.y = [q[0].chartY,
  3184. q[1] && q[1].chartY], A(l.axes, function (a) {
  3185. if (a.zoomEnabled) {
  3186. var b = l.bounds[a.horiz ? "h" : "v"], c = a.minPixelPadding, d = a.toPixels(g(a.options.min, a.dataMin)), m = a.toPixels(g(a.options.max, a.dataMax)), f = Math.max(d, m);
  3187. b.min = Math.min(a.pos, Math.min(d, m) - c);
  3188. b.max = Math.max(a.pos + a.len, f + c)
  3189. }
  3190. }), f.res = !0) : f.followTouchMove && 1 === b ? this.runPointActions(f.normalize(a)) : q.length && (t || (f.selectionMarker = t = H({
  3191. destroy: r,
  3192. touch: !0
  3193. }, l.plotBox)), f.pinchTranslate(q, d, m, t, n, p), f.hasPinched = C, f.scaleGroups(m, n), f.res && (f.res = !1, this.reset(!1, 0)))
  3194. }, touch: function (f, r) {
  3195. var l = this.chart, q, d;
  3196. if (l.index !== a.hoverChartIndex)this.onContainerMouseLeave({relatedTarget: !0});
  3197. a.hoverChartIndex = l.index;
  3198. 1 === f.touches.length ? (f = this.normalize(f), (d = l.isInsidePlot(f.chartX - l.plotLeft, f.chartY - l.plotTop)) && !l.openMenu ? (r && this.runPointActions(f), "touchmove" === f.type && (r = this.pinchDown, q = r[0] ? 4 <= Math.sqrt(Math.pow(r[0].chartX - f.chartX, 2) + Math.pow(r[0].chartY - f.chartY, 2)) : !1), g(q, !0) && this.pinch(f)) : r && this.reset()) : 2 === f.touches.length &&
  3199. this.pinch(f)
  3200. }, onContainerTouchStart: function (a) {
  3201. this.zoomOption(a);
  3202. this.touch(a, !0)
  3203. }, onContainerTouchMove: function (a) {
  3204. this.touch(a)
  3205. }, onDocumentTouchEnd: function (f) {
  3206. B[a.hoverChartIndex] && B[a.hoverChartIndex].pointer.drop(f)
  3207. }
  3208. })
  3209. })(L);
  3210. (function (a) {
  3211. var B = a.addEvent, A = a.charts, H = a.css, G = a.doc, r = a.extend, g = a.noop, f = a.Pointer, u = a.removeEvent, l = a.win, q = a.wrap;
  3212. if (l.PointerEvent || l.MSPointerEvent) {
  3213. var d = {}, b = !!l.PointerEvent, p = function () {
  3214. var a, b = [];
  3215. b.item = function (a) {
  3216. return this[a]
  3217. };
  3218. for (a in d)d.hasOwnProperty(a) &&
  3219. b.push({pageX: d[a].pageX, pageY: d[a].pageY, target: d[a].target});
  3220. return b
  3221. }, C = function (b, d, c, f) {
  3222. "touch" !== b.pointerType && b.pointerType !== b.MSPOINTER_TYPE_TOUCH || !A[a.hoverChartIndex] || (f(b), f = A[a.hoverChartIndex].pointer, f[d]({
  3223. type: c,
  3224. target: b.currentTarget,
  3225. preventDefault: g,
  3226. touches: p()
  3227. }))
  3228. };
  3229. r(f.prototype, {
  3230. onContainerPointerDown: function (a) {
  3231. C(a, "onContainerTouchStart", "touchstart", function (a) {
  3232. d[a.pointerId] = {pageX: a.pageX, pageY: a.pageY, target: a.currentTarget}
  3233. })
  3234. }, onContainerPointerMove: function (a) {
  3235. C(a, "onContainerTouchMove",
  3236. "touchmove", function (a) {
  3237. d[a.pointerId] = {pageX: a.pageX, pageY: a.pageY};
  3238. d[a.pointerId].target || (d[a.pointerId].target = a.currentTarget)
  3239. })
  3240. }, onDocumentPointerUp: function (a) {
  3241. C(a, "onDocumentTouchEnd", "touchend", function (a) {
  3242. delete d[a.pointerId]
  3243. })
  3244. }, batchMSEvents: function (a) {
  3245. a(this.chart.container, b ? "pointerdown" : "MSPointerDown", this.onContainerPointerDown);
  3246. a(this.chart.container, b ? "pointermove" : "MSPointerMove", this.onContainerPointerMove);
  3247. a(G, b ? "pointerup" : "MSPointerUp", this.onDocumentPointerUp)
  3248. }
  3249. });
  3250. q(f.prototype,
  3251. "init", function (a, b, c) {
  3252. a.call(this, b, c);
  3253. this.hasZoom && H(b.container, {"-ms-touch-action": "none", "touch-action": "none"})
  3254. });
  3255. q(f.prototype, "setDOMEvents", function (a) {
  3256. a.apply(this);
  3257. (this.hasZoom || this.followTouchMove) && this.batchMSEvents(B)
  3258. });
  3259. q(f.prototype, "destroy", function (a) {
  3260. this.batchMSEvents(u);
  3261. a.call(this)
  3262. })
  3263. }
  3264. })(L);
  3265. (function (a) {
  3266. var B, A = a.addEvent, H = a.css, G = a.discardElement, r = a.defined, g = a.each, f = a.extend, u = a.isFirefox, l = a.marginNames, q = a.merge, d = a.pick, b = a.setAnimation, p = a.stableSort, C = a.win, t = a.wrap;
  3267. B = a.Legend = function (a, b) {
  3268. this.init(a, b)
  3269. };
  3270. B.prototype = {
  3271. init: function (a, b) {
  3272. this.chart = a;
  3273. this.setOptions(b);
  3274. b.enabled && (this.render(), A(this.chart, "endResize", function () {
  3275. this.legend.positionCheckboxes()
  3276. }))
  3277. }, setOptions: function (a) {
  3278. var b = d(a.padding, 8);
  3279. this.options = a;
  3280. this.itemStyle = a.itemStyle;
  3281. this.itemHiddenStyle = q(this.itemStyle, a.itemHiddenStyle);
  3282. this.itemMarginTop = a.itemMarginTop || 0;
  3283. this.initialItemX = this.padding = b;
  3284. this.initialItemY = b - 5;
  3285. this.itemHeight = this.maxItemWidth = 0;
  3286. this.symbolWidth = d(a.symbolWidth,
  3287. 16);
  3288. this.pages = []
  3289. }, update: function (a, b) {
  3290. var c = this.chart;
  3291. this.setOptions(q(!0, this.options, a));
  3292. this.destroy();
  3293. c.isDirtyLegend = c.isDirtyBox = !0;
  3294. d(b, !0) && c.redraw()
  3295. }, colorizeItem: function (a, b) {
  3296. a.legendGroup[b ? "removeClass" : "addClass"]("highcharts-legend-item-hidden");
  3297. var c = this.options, d = a.legendItem, m = a.legendLine, e = a.legendSymbol, f = this.itemHiddenStyle.color, c = b ? c.itemStyle.color : f, p = b ? a.color || f : f, g = a.options && a.options.marker, h = {fill: p}, y;
  3298. d && d.css({fill: c, color: c});
  3299. m && m.attr({stroke: p});
  3300. if (e) {
  3301. if (g &&
  3302. e.isMarker && (h = a.pointAttribs(), !b))for (y in h)h[y] = f;
  3303. e.attr(h)
  3304. }
  3305. }, positionItem: function (a) {
  3306. var b = this.options, d = b.symbolPadding, b = !b.rtl, m = a._legendItemPos, f = m[0], m = m[1], e = a.checkbox;
  3307. (a = a.legendGroup) && a.element && a.translate(b ? f : this.legendWidth - f - 2 * d - 4, m);
  3308. e && (e.x = f, e.y = m)
  3309. }, destroyItem: function (a) {
  3310. var b = a.checkbox;
  3311. g(["legendItem", "legendLine", "legendSymbol", "legendGroup"], function (b) {
  3312. a[b] && (a[b] = a[b].destroy())
  3313. });
  3314. b && G(a.checkbox)
  3315. }, destroy: function () {
  3316. function a(a) {
  3317. this[a] && (this[a] = this[a].destroy())
  3318. }
  3319. g(this.getAllItems(), function (b) {
  3320. g(["legendItem", "legendGroup"], a, b)
  3321. });
  3322. g(["box", "title", "group"], a, this);
  3323. this.display = null
  3324. }, positionCheckboxes: function (a) {
  3325. var b = this.group && this.group.alignAttr, d, m = this.clipHeight || this.legendHeight, f = this.titleHeight;
  3326. b && (d = b.translateY, g(this.allItems, function (c) {
  3327. var e = c.checkbox, n;
  3328. e && (n = d + f + e.y + (a || 0) + 3, H(e, {
  3329. left: b.translateX + c.checkboxOffset + e.x - 20 + "px",
  3330. top: n + "px",
  3331. display: n > d - 6 && n < d + m - 6 ? "" : "none"
  3332. }))
  3333. }))
  3334. }, renderTitle: function () {
  3335. var a = this.padding, b = this.options.title,
  3336. d = 0;
  3337. b.text && (this.title || (this.title = this.chart.renderer.label(b.text, a - 3, a - 4, null, null, null, null, null, "legend-title").attr({zIndex: 1}).css(b.style).add(this.group)), a = this.title.getBBox(), d = a.height, this.offsetWidth = a.width, this.contentGroup.attr({translateY: d}));
  3338. this.titleHeight = d
  3339. }, setText: function (b) {
  3340. var c = this.options;
  3341. b.legendItem.attr({text: c.labelFormat ? a.format(c.labelFormat, b) : c.labelFormatter.call(b)})
  3342. }, renderItem: function (a) {
  3343. var b = this.chart, f = b.renderer, m = this.options, p = "horizontal" ===
  3344. m.layout, e = this.symbolWidth, g = m.symbolPadding, l = this.itemStyle, t = this.itemHiddenStyle, h = this.padding, y = p ? d(m.itemDistance, 20) : 0, J = !m.rtl, r = m.width, I = m.itemMarginBottom || 0, k = this.itemMarginTop, u = this.initialItemX, C = a.legendItem, N = !a.series, A = !N && a.series.drawLegendSymbol ? a.series : a, B = A.options, B = this.createCheckboxForItem && B && B.showCheckbox, v = m.useHTML;
  3345. C || (a.legendGroup = f.g("legend-item").addClass("highcharts-" + A.type + "-series highcharts-color-" + a.colorIndex + (a.options.className ? " " + a.options.className :
  3346. "") + (N ? " highcharts-series-" + a.index : "")).attr({zIndex: 1}).add(this.scrollGroup), a.legendItem = C = f.text("", J ? e + g : -g, this.baseline || 0, v).css(q(a.visible ? l : t)).attr({
  3347. align: J ? "left" : "right",
  3348. zIndex: 2
  3349. }).add(a.legendGroup), this.baseline || (l = l.fontSize, this.fontMetrics = f.fontMetrics(l, C), this.baseline = this.fontMetrics.f + 3 + k, C.attr("y", this.baseline)), this.symbolHeight = m.symbolHeight || this.fontMetrics.f, A.drawLegendSymbol(this, a), this.setItemEvents && this.setItemEvents(a, C, v), B && this.createCheckboxForItem(a));
  3350. this.colorizeItem(a, a.visible);
  3351. this.setText(a);
  3352. f = C.getBBox();
  3353. e = a.checkboxOffset = m.itemWidth || a.legendItemWidth || e + g + f.width + y + (B ? 20 : 0);
  3354. this.itemHeight = g = Math.round(a.legendItemHeight || f.height);
  3355. p && this.itemX - u + e > (r || b.chartWidth - 2 * h - u - m.x) && (this.itemX = u, this.itemY += k + this.lastLineHeight + I, this.lastLineHeight = 0);
  3356. this.maxItemWidth = Math.max(this.maxItemWidth, e);
  3357. this.lastItemY = k + this.itemY + I;
  3358. this.lastLineHeight = Math.max(g, this.lastLineHeight);
  3359. a._legendItemPos = [this.itemX, this.itemY];
  3360. p ? this.itemX += e :
  3361. (this.itemY += k + g + I, this.lastLineHeight = g);
  3362. this.offsetWidth = r || Math.max((p ? this.itemX - u - y : e) + h, this.offsetWidth)
  3363. }, getAllItems: function () {
  3364. var a = [];
  3365. g(this.chart.series, function (b) {
  3366. var c = b && b.options;
  3367. b && d(c.showInLegend, r(c.linkedTo) ? !1 : void 0, !0) && (a = a.concat(b.legendItems || ("point" === c.legendType ? b.data : b)))
  3368. });
  3369. return a
  3370. }, adjustMargins: function (a, b) {
  3371. var c = this.chart, f = this.options, m = f.align.charAt(0) + f.verticalAlign.charAt(0) + f.layout.charAt(0);
  3372. f.floating || g([/(lth|ct|rth)/, /(rtv|rm|rbv)/, /(rbh|cb|lbh)/,
  3373. /(lbv|lm|ltv)/], function (e, n) {
  3374. e.test(m) && !r(a[n]) && (c[l[n]] = Math.max(c[l[n]], c.legend[(n + 1) % 2 ? "legendHeight" : "legendWidth"] + [1, -1, -1, 1][n] * f[n % 2 ? "x" : "y"] + d(f.margin, 12) + b[n]))
  3375. })
  3376. }, render: function () {
  3377. var a = this, b = a.chart, d = b.renderer, q = a.group, l, e, t, r, w = a.box, h = a.options, y = a.padding;
  3378. a.itemX = a.initialItemX;
  3379. a.itemY = a.initialItemY;
  3380. a.offsetWidth = 0;
  3381. a.lastItemY = 0;
  3382. q || (a.group = q = d.g("legend").attr({zIndex: 7}).add(), a.contentGroup = d.g().attr({zIndex: 1}).add(q), a.scrollGroup = d.g().add(a.contentGroup));
  3383. a.renderTitle();
  3384. l = a.getAllItems();
  3385. p(l, function (a, b) {
  3386. return (a.options && a.options.legendIndex || 0) - (b.options && b.options.legendIndex || 0)
  3387. });
  3388. h.reversed && l.reverse();
  3389. a.allItems = l;
  3390. a.display = e = !!l.length;
  3391. a.lastLineHeight = 0;
  3392. g(l, function (b) {
  3393. a.renderItem(b)
  3394. });
  3395. t = (h.width || a.offsetWidth) + y;
  3396. r = a.lastItemY + a.lastLineHeight + a.titleHeight;
  3397. r = a.handleOverflow(r);
  3398. r += y;
  3399. w || (a.box = w = d.rect().addClass("highcharts-legend-box").attr({r: h.borderRadius}).add(q), w.isNew = !0);
  3400. w.attr({
  3401. stroke: h.borderColor, "stroke-width": h.borderWidth || 0, fill: h.backgroundColor ||
  3402. "none"
  3403. }).shadow(h.shadow);
  3404. 0 < t && 0 < r && (w[w.isNew ? "attr" : "animate"](w.crisp({
  3405. x: 0,
  3406. y: 0,
  3407. width: t,
  3408. height: r
  3409. }, w.strokeWidth())), w.isNew = !1);
  3410. w[e ? "show" : "hide"]();
  3411. a.legendWidth = t;
  3412. a.legendHeight = r;
  3413. g(l, function (b) {
  3414. a.positionItem(b)
  3415. });
  3416. e && q.align(f({width: t, height: r}, h), !0, "spacingBox");
  3417. b.isResizing || this.positionCheckboxes()
  3418. }, handleOverflow: function (a) {
  3419. var b = this, f = this.chart, m = f.renderer, p = this.options, e = p.y, f = f.spacingBox.height + ("top" === p.verticalAlign ? -e : e) - this.padding, e = p.maxHeight, q, l = this.clipRect, t = p.navigation,
  3420. h = d(t.animation, !0), y = t.arrowSize || 12, r = this.nav, u = this.pages, I = this.padding, k, D = this.allItems, C = function (a) {
  3421. a ? l.attr({height: a}) : l && (b.clipRect = l.destroy(), b.contentGroup.clip());
  3422. b.contentGroup.div && (b.contentGroup.div.style.clip = a ? "rect(" + I + "px,9999px," + (I + a) + "px,0)" : "auto")
  3423. };
  3424. "horizontal" !== p.layout || "middle" === p.verticalAlign || p.floating || (f /= 2);
  3425. e && (f = Math.min(f, e));
  3426. u.length = 0;
  3427. a > f && !1 !== t.enabled ? (this.clipHeight = q = Math.max(f - 20 - this.titleHeight - I, 0), this.currentPage = d(this.currentPage, 1), this.fullHeight =
  3428. a, g(D, function (a, b) {
  3429. var c = a._legendItemPos[1];
  3430. a = Math.round(a.legendItem.getBBox().height);
  3431. var e = u.length;
  3432. if (!e || c - u[e - 1] > q && (k || c) !== u[e - 1])u.push(k || c), e++;
  3433. b === D.length - 1 && c + a - u[e - 1] > q && u.push(c);
  3434. c !== k && (k = c)
  3435. }), l || (l = b.clipRect = m.clipRect(0, I, 9999, 0), b.contentGroup.clip(l)), C(q), r || (this.nav = r = m.g().attr({zIndex: 1}).add(this.group), this.up = m.symbol("triangle", 0, 0, y, y).on("click", function () {
  3436. b.scroll(-1, h)
  3437. }).add(r), this.pager = m.text("", 15, 10).addClass("highcharts-legend-navigation").css(t.style).add(r),
  3438. this.down = m.symbol("triangle-down", 0, 0, y, y).on("click", function () {
  3439. b.scroll(1, h)
  3440. }).add(r)), b.scroll(0), a = f) : r && (C(), r.hide(), this.scrollGroup.attr({translateY: 1}), this.clipHeight = 0);
  3441. return a
  3442. }, scroll: function (a, c) {
  3443. var d = this.pages, f = d.length;
  3444. a = this.currentPage + a;
  3445. var m = this.clipHeight, e = this.options.navigation, p = this.pager, g = this.padding;
  3446. a > f && (a = f);
  3447. 0 < a && (void 0 !== c && b(c, this.chart), this.nav.attr({
  3448. translateX: g,
  3449. translateY: m + this.padding + 7 + this.titleHeight,
  3450. visibility: "visible"
  3451. }), this.up.attr({
  3452. "class": 1 ===
  3453. a ? "highcharts-legend-nav-inactive" : "highcharts-legend-nav-active"
  3454. }), p.attr({text: a + "/" + f}), this.down.attr({
  3455. x: 18 + this.pager.getBBox().width,
  3456. "class": a === f ? "highcharts-legend-nav-inactive" : "highcharts-legend-nav-active"
  3457. }), this.up.attr({fill: 1 === a ? e.inactiveColor : e.activeColor}).css({cursor: 1 === a ? "default" : "pointer"}), this.down.attr({fill: a === f ? e.inactiveColor : e.activeColor}).css({cursor: a === f ? "default" : "pointer"}), c = -d[a - 1] + this.initialItemY, this.scrollGroup.animate({translateY: c}), this.currentPage =
  3458. a, this.positionCheckboxes(c))
  3459. }
  3460. };
  3461. a.LegendSymbolMixin = {
  3462. drawRectangle: function (a, b) {
  3463. var c = a.symbolHeight, f = a.options.squareSymbol;
  3464. b.legendSymbol = this.chart.renderer.rect(f ? (a.symbolWidth - c) / 2 : 0, a.baseline - c + 1, f ? c : a.symbolWidth, c, d(a.options.symbolRadius, c / 2)).addClass("highcharts-point").attr({zIndex: 3}).add(b.legendGroup)
  3465. }, drawLineMarker: function (a) {
  3466. var b = this.options, f = b.marker, m = a.symbolWidth, p = a.symbolHeight, e = p / 2, g = this.chart.renderer, l = this.legendGroup;
  3467. a = a.baseline - Math.round(.3 * a.fontMetrics.b);
  3468. var t;
  3469. t = {"stroke-width": b.lineWidth || 0};
  3470. b.dashStyle && (t.dashstyle = b.dashStyle);
  3471. this.legendLine = g.path(["M", 0, a, "L", m, a]).addClass("highcharts-graph").attr(t).add(l);
  3472. f && !1 !== f.enabled && (b = Math.min(d(f.radius, e), e), 0 === this.symbol.indexOf("url") && (f = q(f, {
  3473. width: p,
  3474. height: p
  3475. }), b = 0), this.legendSymbol = f = g.symbol(this.symbol, m / 2 - b, a - b, 2 * b, 2 * b, f).addClass("highcharts-point").add(l), f.isMarker = !0)
  3476. }
  3477. };
  3478. (/Trident\/7\.0/.test(C.navigator.userAgent) || u) && t(B.prototype, "positionItem", function (a, b) {
  3479. var c = this, d = function () {
  3480. b._legendItemPos &&
  3481. a.call(c, b)
  3482. };
  3483. d();
  3484. setTimeout(d)
  3485. })
  3486. })(L);
  3487. (function (a) {
  3488. var B = a.addEvent, A = a.animate, H = a.animObject, G = a.attr, r = a.doc, g = a.Axis, f = a.createElement, u = a.defaultOptions, l = a.discardElement, q = a.charts, d = a.css, b = a.defined, p = a.each, C = a.extend, t = a.find, m = a.fireEvent, c = a.getStyle, n = a.grep, E = a.isNumber, z = a.isObject, e = a.isString, x = a.Legend, F = a.marginNames, w = a.merge, h = a.Pointer, y = a.pick, J = a.pInt, K = a.removeEvent, I = a.seriesTypes, k = a.splat, D = a.svg, P = a.syncTimeout, N = a.win, S = a.Renderer, O = a.Chart = function () {
  3489. this.getArgs.apply(this,
  3490. arguments)
  3491. };
  3492. a.chart = function (a, b, c) {
  3493. return new O(a, b, c)
  3494. };
  3495. O.prototype = {
  3496. callbacks: [], getArgs: function () {
  3497. var a = [].slice.call(arguments);
  3498. if (e(a[0]) || a[0].nodeName)this.renderTo = a.shift();
  3499. this.init(a[0], a[1])
  3500. }, init: function (b, c) {
  3501. var e, h = b.series;
  3502. b.series = null;
  3503. e = w(u, b);
  3504. e.series = b.series = h;
  3505. this.userOptions = b;
  3506. this.respRules = [];
  3507. b = e.chart;
  3508. h = b.events;
  3509. this.margin = [];
  3510. this.spacing = [];
  3511. this.bounds = {h: {}, v: {}};
  3512. this.callback = c;
  3513. this.isResizing = 0;
  3514. this.options = e;
  3515. this.axes = [];
  3516. this.series = [];
  3517. this.hasCartesianSeries = b.showAxes;
  3518. var d;
  3519. this.index = q.length;
  3520. q.push(this);
  3521. a.chartCount++;
  3522. if (h)for (d in h)B(this, d, h[d]);
  3523. this.xAxis = [];
  3524. this.yAxis = [];
  3525. this.pointCount = this.colorCounter = this.symbolCounter = 0;
  3526. this.firstRender()
  3527. }, initSeries: function (b) {
  3528. var c = this.options.chart;
  3529. (c = I[b.type || c.type || c.defaultSeriesType]) || a.error(17, !0);
  3530. c = new c;
  3531. c.init(this, b);
  3532. return c
  3533. }, orderSeries: function (a) {
  3534. var b = this.series;
  3535. for (a = a || 0; a < b.length; a++)b[a] && (b[a].index = a, b[a].name = b[a].name || "Series " + (b[a].index + 1))
  3536. }, isInsidePlot: function (a, b, c) {
  3537. var e = c ?
  3538. b : a;
  3539. a = c ? a : b;
  3540. return 0 <= e && e <= this.plotWidth && 0 <= a && a <= this.plotHeight
  3541. }, redraw: function (b) {
  3542. var c = this.axes, e = this.series, h = this.pointer, d = this.legend, k = this.isDirtyLegend, f, n, y = this.hasCartesianSeries, g = this.isDirtyBox, v = e.length, l = v, q = this.renderer, t = q.isHidden(), w = [];
  3543. this.setResponsive && this.setResponsive(!1);
  3544. a.setAnimation(b, this);
  3545. t && this.cloneRenderTo();
  3546. for (this.layOutTitles(); l--;)if (b = e[l], b.options.stacking && (f = !0, b.isDirty)) {
  3547. n = !0;
  3548. break
  3549. }
  3550. if (n)for (l = v; l--;)b = e[l], b.options.stacking && (b.isDirty = !0);
  3551. p(e, function (a) {
  3552. a.isDirty && "point" === a.options.legendType && (a.updateTotals && a.updateTotals(), k = !0);
  3553. a.isDirtyData && m(a, "updatedData")
  3554. });
  3555. k && d.options.enabled && (d.render(), this.isDirtyLegend = !1);
  3556. f && this.getStacks();
  3557. y && p(c, function (a) {
  3558. a.updateNames();
  3559. a.setScale()
  3560. });
  3561. this.getMargins();
  3562. y && (p(c, function (a) {
  3563. a.isDirty && (g = !0)
  3564. }), p(c, function (a) {
  3565. var b = a.min + "," + a.max;
  3566. a.extKey !== b && (a.extKey = b, w.push(function () {
  3567. m(a, "afterSetExtremes", C(a.eventArgs, a.getExtremes()));
  3568. delete a.eventArgs
  3569. }));
  3570. (g || f) && a.redraw()
  3571. }));
  3572. g && this.drawChartBox();
  3573. m(this, "predraw");
  3574. p(e, function (a) {
  3575. (g || a.isDirty) && a.visible && a.redraw();
  3576. a.isDirtyData = !1
  3577. });
  3578. h && h.reset(!0);
  3579. q.draw();
  3580. m(this, "redraw");
  3581. m(this, "render");
  3582. t && this.cloneRenderTo(!0);
  3583. p(w, function (a) {
  3584. a.call()
  3585. })
  3586. }, get: function (a) {
  3587. function b(b) {
  3588. return b.id === a || b.options && b.options.id === a
  3589. }
  3590. var c, e = this.series, h;
  3591. c = t(this.axes, b) || t(this.series, b);
  3592. for (h = 0; !c && h < e.length; h++)c = t(e[h].points || [], b);
  3593. return c
  3594. }, getAxes: function () {
  3595. var a = this, b = this.options, c = b.xAxis = k(b.xAxis || {}), b = b.yAxis = k(b.yAxis ||
  3596. {});
  3597. p(c, function (a, b) {
  3598. a.index = b;
  3599. a.isX = !0
  3600. });
  3601. p(b, function (a, b) {
  3602. a.index = b
  3603. });
  3604. c = c.concat(b);
  3605. p(c, function (b) {
  3606. new g(a, b)
  3607. })
  3608. }, getSelectedPoints: function () {
  3609. var a = [];
  3610. p(this.series, function (b) {
  3611. a = a.concat(n(b.points || [], function (a) {
  3612. return a.selected
  3613. }))
  3614. });
  3615. return a
  3616. }, getSelectedSeries: function () {
  3617. return n(this.series, function (a) {
  3618. return a.selected
  3619. })
  3620. }, setTitle: function (a, b, c) {
  3621. var e = this, h = e.options, d;
  3622. d = h.title = w({style: {color: "#333333", fontSize: h.isStock ? "16px" : "18px"}}, h.title, a);
  3623. h = h.subtitle = w({style: {color: "#666666"}},
  3624. h.subtitle, b);
  3625. p([["title", a, d], ["subtitle", b, h]], function (a, b) {
  3626. var c = a[0], h = e[c], d = a[1];
  3627. a = a[2];
  3628. h && d && (e[c] = h = h.destroy());
  3629. a && a.text && !h && (e[c] = e.renderer.text(a.text, 0, 0, a.useHTML).attr({
  3630. align: a.align,
  3631. "class": "highcharts-" + c,
  3632. zIndex: a.zIndex || 4
  3633. }).add(), e[c].update = function (a) {
  3634. e.setTitle(!b && a, b && a)
  3635. }, e[c].css(a.style))
  3636. });
  3637. e.layOutTitles(c)
  3638. }, layOutTitles: function (a) {
  3639. var b = 0, c, e = this.renderer, h = this.spacingBox;
  3640. p(["title", "subtitle"], function (a) {
  3641. var c = this[a], d = this.options[a], k;
  3642. c && (k = d.style.fontSize,
  3643. k = e.fontMetrics(k, c).b, c.css({width: (d.width || h.width + d.widthAdjust) + "px"}).align(C({y: b + k + ("title" === a ? -3 : 2)}, d), !1, "spacingBox"), d.floating || d.verticalAlign || (b = Math.ceil(b + c.getBBox().height)))
  3644. }, this);
  3645. c = this.titleOffset !== b;
  3646. this.titleOffset = b;
  3647. !this.isDirtyBox && c && (this.isDirtyBox = c, this.hasRendered && y(a, !0) && this.isDirtyBox && this.redraw())
  3648. }, getChartSize: function () {
  3649. var a = this.options.chart, e = a.width, a = a.height, h = this.renderToClone || this.renderTo;
  3650. b(e) || (this.containerWidth = c(h, "width"));
  3651. b(a) || (this.containerHeight =
  3652. c(h, "height"));
  3653. this.chartWidth = Math.max(0, e || this.containerWidth || 600);
  3654. this.chartHeight = Math.max(0, a || this.containerHeight || 400)
  3655. }, cloneRenderTo: function (a) {
  3656. var b = this.renderToClone, c = this.container;
  3657. if (a) {
  3658. if (b) {
  3659. for (; b.childNodes.length;)this.renderTo.appendChild(b.firstChild);
  3660. l(b);
  3661. delete this.renderToClone
  3662. }
  3663. } else c && c.parentNode === this.renderTo && this.renderTo.removeChild(c), this.renderToClone = b = this.renderTo.cloneNode(0), d(b, {
  3664. position: "absolute",
  3665. top: "-9999px",
  3666. display: "block"
  3667. }), b.style.setProperty &&
  3668. b.style.setProperty("display", "block", "important"), r.body.appendChild(b), c && b.appendChild(c)
  3669. }, setClassName: function (a) {
  3670. this.container.className = "highcharts-container " + (a || "")
  3671. }, getContainer: function () {
  3672. var b, c = this.options, h = c.chart, d, k;
  3673. b = this.renderTo;
  3674. var m = a.uniqueKey(), n;
  3675. b || (this.renderTo = b = h.renderTo);
  3676. e(b) && (this.renderTo = b = r.getElementById(b));
  3677. b || a.error(13, !0);
  3678. d = J(G(b, "data-highcharts-chart"));
  3679. E(d) && q[d] && q[d].hasRendered && q[d].destroy();
  3680. G(b, "data-highcharts-chart", this.index);
  3681. b.innerHTML = "";
  3682. h.skipClone || b.offsetWidth || this.cloneRenderTo();
  3683. this.getChartSize();
  3684. d = this.chartWidth;
  3685. k = this.chartHeight;
  3686. n = C({
  3687. position: "relative",
  3688. overflow: "hidden",
  3689. width: d + "px",
  3690. height: k + "px",
  3691. textAlign: "left",
  3692. lineHeight: "normal",
  3693. zIndex: 0,
  3694. "-webkit-tap-highlight-color": "rgba(0,0,0,0)"
  3695. }, h.style);
  3696. this.container = b = f("div", {id: m}, n, this.renderToClone || b);
  3697. this._cursor = b.style.cursor;
  3698. this.renderer = new (a[h.renderer] || S)(b, d, k, null, h.forExport, c.exporting && c.exporting.allowHTML);
  3699. this.setClassName(h.className);
  3700. this.renderer.setStyle(h.style);
  3701. this.renderer.chartIndex = this.index
  3702. }, getMargins: function (a) {
  3703. var c = this.spacing, e = this.margin, h = this.titleOffset;
  3704. this.resetMargins();
  3705. h && !b(e[0]) && (this.plotTop = Math.max(this.plotTop, h + this.options.title.margin + c[0]));
  3706. this.legend.display && this.legend.adjustMargins(e, c);
  3707. this.extraMargin && (this[this.extraMargin.type] = (this[this.extraMargin.type] || 0) + this.extraMargin.value);
  3708. this.extraTopMargin && (this.plotTop += this.extraTopMargin);
  3709. a || this.getAxisMargins()
  3710. }, getAxisMargins: function () {
  3711. var a = this, c = a.axisOffset =
  3712. [0, 0, 0, 0], e = a.margin;
  3713. a.hasCartesianSeries && p(a.axes, function (a) {
  3714. a.visible && a.getOffset()
  3715. });
  3716. p(F, function (h, d) {
  3717. b(e[d]) || (a[h] += c[d])
  3718. });
  3719. a.setChartSize()
  3720. }, reflow: function (a) {
  3721. var e = this, h = e.options.chart, d = e.renderTo, k = b(h.width), f = h.width || c(d, "width"), h = h.height || c(d, "height"), d = a ? a.target : N;
  3722. if (!k && !e.isPrinting && f && h && (d === N || d === r)) {
  3723. if (f !== e.containerWidth || h !== e.containerHeight)clearTimeout(e.reflowTimeout), e.reflowTimeout = P(function () {
  3724. e.container && e.setSize(void 0, void 0, !1)
  3725. }, a ? 100 : 0);
  3726. e.containerWidth =
  3727. f;
  3728. e.containerHeight = h
  3729. }
  3730. }, initReflow: function () {
  3731. var a = this, b;
  3732. b = B(N, "resize", function (b) {
  3733. a.reflow(b)
  3734. });
  3735. B(a, "destroy", b)
  3736. }, setSize: function (b, c, e) {
  3737. var h = this, k = h.renderer;
  3738. h.isResizing += 1;
  3739. a.setAnimation(e, h);
  3740. h.oldChartHeight = h.chartHeight;
  3741. h.oldChartWidth = h.chartWidth;
  3742. void 0 !== b && (h.options.chart.width = b);
  3743. void 0 !== c && (h.options.chart.height = c);
  3744. h.getChartSize();
  3745. b = k.globalAnimation;
  3746. (b ? A : d)(h.container, {width: h.chartWidth + "px", height: h.chartHeight + "px"}, b);
  3747. h.setChartSize(!0);
  3748. k.setSize(h.chartWidth, h.chartHeight,
  3749. e);
  3750. p(h.axes, function (a) {
  3751. a.isDirty = !0;
  3752. a.setScale()
  3753. });
  3754. h.isDirtyLegend = !0;
  3755. h.isDirtyBox = !0;
  3756. h.layOutTitles();
  3757. h.getMargins();
  3758. h.redraw(e);
  3759. h.oldChartHeight = null;
  3760. m(h, "resize");
  3761. P(function () {
  3762. h && m(h, "endResize", null, function () {
  3763. --h.isResizing
  3764. })
  3765. }, H(b).duration)
  3766. }, setChartSize: function (a) {
  3767. var b = this.inverted, c = this.renderer, e = this.chartWidth, h = this.chartHeight, d = this.options.chart, k = this.spacing, f = this.clipOffset, m, n, y, g;
  3768. this.plotLeft = m = Math.round(this.plotLeft);
  3769. this.plotTop = n = Math.round(this.plotTop);
  3770. this.plotWidth =
  3771. y = Math.max(0, Math.round(e - m - this.marginRight));
  3772. this.plotHeight = g = Math.max(0, Math.round(h - n - this.marginBottom));
  3773. this.plotSizeX = b ? g : y;
  3774. this.plotSizeY = b ? y : g;
  3775. this.plotBorderWidth = d.plotBorderWidth || 0;
  3776. this.spacingBox = c.spacingBox = {x: k[3], y: k[0], width: e - k[3] - k[1], height: h - k[0] - k[2]};
  3777. this.plotBox = c.plotBox = {x: m, y: n, width: y, height: g};
  3778. e = 2 * Math.floor(this.plotBorderWidth / 2);
  3779. b = Math.ceil(Math.max(e, f[3]) / 2);
  3780. c = Math.ceil(Math.max(e, f[0]) / 2);
  3781. this.clipBox = {
  3782. x: b, y: c, width: Math.floor(this.plotSizeX - Math.max(e, f[1]) /
  3783. 2 - b), height: Math.max(0, Math.floor(this.plotSizeY - Math.max(e, f[2]) / 2 - c))
  3784. };
  3785. a || p(this.axes, function (a) {
  3786. a.setAxisSize();
  3787. a.setAxisTranslation()
  3788. })
  3789. }, resetMargins: function () {
  3790. var a = this, b = a.options.chart;
  3791. p(["margin", "spacing"], function (c) {
  3792. var e = b[c], h = z(e) ? e : [e, e, e, e];
  3793. p(["Top", "Right", "Bottom", "Left"], function (e, d) {
  3794. a[c][d] = y(b[c + e], h[d])
  3795. })
  3796. });
  3797. p(F, function (b, c) {
  3798. a[b] = y(a.margin[c], a.spacing[c])
  3799. });
  3800. a.axisOffset = [0, 0, 0, 0];
  3801. a.clipOffset = [0, 0, 0, 0]
  3802. }, drawChartBox: function () {
  3803. var a = this.options.chart, b = this.renderer, c =
  3804. this.chartWidth, e = this.chartHeight, h = this.chartBackground, d = this.plotBackground, k = this.plotBorder, f, m = this.plotBGImage, n = a.backgroundColor, p = a.plotBackgroundColor, y = a.plotBackgroundImage, g, l = this.plotLeft, q = this.plotTop, t = this.plotWidth, w = this.plotHeight, x = this.plotBox, r = this.clipRect, z = this.clipBox, J = "animate";
  3805. h || (this.chartBackground = h = b.rect().addClass("highcharts-background").add(), J = "attr");
  3806. f = a.borderWidth || 0;
  3807. g = f + (a.shadow ? 8 : 0);
  3808. n = {fill: n || "none"};
  3809. if (f || h["stroke-width"])n.stroke = a.borderColor,
  3810. n["stroke-width"] = f;
  3811. h.attr(n).shadow(a.shadow);
  3812. h[J]({x: g / 2, y: g / 2, width: c - g - f % 2, height: e - g - f % 2, r: a.borderRadius});
  3813. J = "animate";
  3814. d || (J = "attr", this.plotBackground = d = b.rect().addClass("highcharts-plot-background").add());
  3815. d[J](x);
  3816. d.attr({fill: p || "none"}).shadow(a.plotShadow);
  3817. y && (m ? m.animate(x) : this.plotBGImage = b.image(y, l, q, t, w).add());
  3818. r ? r.animate({width: z.width, height: z.height}) : this.clipRect = b.clipRect(z);
  3819. J = "animate";
  3820. k || (J = "attr", this.plotBorder = k = b.rect().addClass("highcharts-plot-border").attr({zIndex: 1}).add());
  3821. k.attr({stroke: a.plotBorderColor, "stroke-width": a.plotBorderWidth || 0, fill: "none"});
  3822. k[J](k.crisp({x: l, y: q, width: t, height: w}, -k.strokeWidth()));
  3823. this.isDirtyBox = !1
  3824. }, propFromSeries: function () {
  3825. var a = this, b = a.options.chart, c, e = a.options.series, h, d;
  3826. p(["inverted", "angular", "polar"], function (k) {
  3827. c = I[b.type || b.defaultSeriesType];
  3828. d = b[k] || c && c.prototype[k];
  3829. for (h = e && e.length; !d && h--;)(c = I[e[h].type]) && c.prototype[k] && (d = !0);
  3830. a[k] = d
  3831. })
  3832. }, linkSeries: function () {
  3833. var a = this, b = a.series;
  3834. p(b, function (a) {
  3835. a.linkedSeries.length =
  3836. 0
  3837. });
  3838. p(b, function (b) {
  3839. var c = b.options.linkedTo;
  3840. e(c) && (c = ":previous" === c ? a.series[b.index - 1] : a.get(c)) && c.linkedParent !== b && (c.linkedSeries.push(b), b.linkedParent = c, b.visible = y(b.options.visible, c.options.visible, b.visible))
  3841. })
  3842. }, renderSeries: function () {
  3843. p(this.series, function (a) {
  3844. a.translate();
  3845. a.render()
  3846. })
  3847. }, renderLabels: function () {
  3848. var a = this, b = a.options.labels;
  3849. b.items && p(b.items, function (c) {
  3850. var e = C(b.style, c.style), h = J(e.left) + a.plotLeft, d = J(e.top) + a.plotTop + 12;
  3851. delete e.left;
  3852. delete e.top;
  3853. a.renderer.text(c.html,
  3854. h, d).attr({zIndex: 2}).css(e).add()
  3855. })
  3856. }, render: function () {
  3857. var a = this.axes, b = this.renderer, c = this.options, e, h, d;
  3858. this.setTitle();
  3859. this.legend = new x(this, c.legend);
  3860. this.getStacks && this.getStacks();
  3861. this.getMargins(!0);
  3862. this.setChartSize();
  3863. c = this.plotWidth;
  3864. e = this.plotHeight -= 21;
  3865. p(a, function (a) {
  3866. a.setScale()
  3867. });
  3868. this.getAxisMargins();
  3869. h = 1.1 < c / this.plotWidth;
  3870. d = 1.05 < e / this.plotHeight;
  3871. if (h || d)p(a, function (a) {
  3872. (a.horiz && h || !a.horiz && d) && a.setTickInterval(!0)
  3873. }), this.getMargins();
  3874. this.drawChartBox();
  3875. this.hasCartesianSeries &&
  3876. p(a, function (a) {
  3877. a.visible && a.render()
  3878. });
  3879. this.seriesGroup || (this.seriesGroup = b.g("series-group").attr({zIndex: 3}).add());
  3880. this.renderSeries();
  3881. this.renderLabels();
  3882. this.addCredits();
  3883. this.setResponsive && this.setResponsive();
  3884. this.hasRendered = !0
  3885. }, addCredits: function (a) {
  3886. var b = this;
  3887. a = w(!0, this.options.credits, a);
  3888. a.enabled && !this.credits && (this.credits = this.renderer.text(a.text + (this.mapCredits || ""), 0, 0).addClass("highcharts-credits").on("click", function () {
  3889. a.href && (N.location.href = a.href)
  3890. }).attr({
  3891. align: a.position.align,
  3892. zIndex: 8
  3893. }).css(a.style).add().align(a.position), this.credits.update = function (a) {
  3894. b.credits = b.credits.destroy();
  3895. b.addCredits(a)
  3896. })
  3897. }, destroy: function () {
  3898. var b = this, c = b.axes, e = b.series, h = b.container, d, k = h && h.parentNode;
  3899. m(b, "destroy");
  3900. q[b.index] = void 0;
  3901. a.chartCount--;
  3902. b.renderTo.removeAttribute("data-highcharts-chart");
  3903. K(b);
  3904. for (d = c.length; d--;)c[d] = c[d].destroy();
  3905. this.scroller && this.scroller.destroy && this.scroller.destroy();
  3906. for (d = e.length; d--;)e[d] = e[d].destroy();
  3907. p("title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" "),
  3908. function (a) {
  3909. var c = b[a];
  3910. c && c.destroy && (b[a] = c.destroy())
  3911. });
  3912. h && (h.innerHTML = "", K(h), k && l(h));
  3913. for (d in b)delete b[d]
  3914. }, isReadyToRender: function () {
  3915. var a = this;
  3916. return D || N != N.top || "complete" === r.readyState ? !0 : (r.attachEvent("onreadystatechange", function () {
  3917. r.detachEvent("onreadystatechange", a.firstRender);
  3918. "complete" === r.readyState && a.firstRender()
  3919. }), !1)
  3920. }, firstRender: function () {
  3921. var a = this, b = a.options;
  3922. if (a.isReadyToRender()) {
  3923. a.getContainer();
  3924. m(a, "init");
  3925. a.resetMargins();
  3926. a.setChartSize();
  3927. a.propFromSeries();
  3928. a.getAxes();
  3929. p(b.series || [], function (b) {
  3930. a.initSeries(b)
  3931. });
  3932. a.linkSeries();
  3933. m(a, "beforeRender");
  3934. h && (a.pointer = new h(a, b));
  3935. a.render();
  3936. if (!a.renderer.imgCount && a.onload)a.onload();
  3937. a.cloneRenderTo(!0)
  3938. }
  3939. }, onload: function () {
  3940. p([this.callback].concat(this.callbacks), function (a) {
  3941. a && void 0 !== this.index && a.apply(this, [this])
  3942. }, this);
  3943. m(this, "load");
  3944. m(this, "render");
  3945. b(this.index) && !1 !== this.options.chart.reflow && this.initReflow();
  3946. this.onload = null
  3947. }
  3948. }
  3949. })(L);
  3950. (function (a) {
  3951. var B, A = a.each, H = a.extend, G = a.erase, r = a.fireEvent,
  3952. g = a.format, f = a.isArray, u = a.isNumber, l = a.pick, q = a.removeEvent;
  3953. B = a.Point = function () {
  3954. };
  3955. B.prototype = {
  3956. init: function (a, b, f) {
  3957. this.series = a;
  3958. this.color = a.color;
  3959. this.applyOptions(b, f);
  3960. a.options.colorByPoint ? (b = a.options.colors || a.chart.options.colors, this.color = this.color || b[a.colorCounter], b = b.length, f = a.colorCounter, a.colorCounter++, a.colorCounter === b && (a.colorCounter = 0)) : f = a.colorIndex;
  3961. this.colorIndex = l(this.colorIndex, f);
  3962. a.chart.pointCount++;
  3963. return this
  3964. }, applyOptions: function (a, b) {
  3965. var d = this.series, f = d.options.pointValKey ||
  3966. d.pointValKey;
  3967. a = B.prototype.optionsToObject.call(this, a);
  3968. H(this, a);
  3969. this.options = this.options ? H(this.options, a) : a;
  3970. a.group && delete this.group;
  3971. f && (this.y = this[f]);
  3972. this.isNull = l(this.isValid && !this.isValid(), null === this.x || !u(this.y, !0));
  3973. this.selected && (this.state = "select");
  3974. "name" in this && void 0 === b && d.xAxis && d.xAxis.hasNames && (this.x = d.xAxis.nameToX(this));
  3975. void 0 === this.x && d && (this.x = void 0 === b ? d.autoIncrement(this) : b);
  3976. return this
  3977. }, optionsToObject: function (a) {
  3978. var b = {}, d = this.series, g = d.options.keys,
  3979. l = g || d.pointArrayMap || ["y"], m = l.length, c = 0, n = 0;
  3980. if (u(a) || null === a)b[l[0]] = a; else if (f(a))for (!g && a.length > m && (d = typeof a[0], "string" === d ? b.name = a[0] : "number" === d && (b.x = a[0]), c++); n < m;)g && void 0 === a[c] || (b[l[n]] = a[c]), c++, n++; else"object" === typeof a && (b = a, a.dataLabels && (d._hasPointLabels = !0), a.marker && (d._hasPointMarkers = !0));
  3981. return b
  3982. }, getClassName: function () {
  3983. return "highcharts-point" + (this.selected ? " highcharts-point-select" : "") + (this.negative ? " highcharts-negative" : "") + (this.isNull ? " highcharts-null-point" :
  3984. "") + (void 0 !== this.colorIndex ? " highcharts-color-" + this.colorIndex : "") + (this.options.className ? " " + this.options.className : "") + (this.zone && this.zone.className ? " " + this.zone.className.replace("highcharts-negative", "") : "")
  3985. }, getZone: function () {
  3986. var a = this.series, b = a.zones, a = a.zoneAxis || "y", f = 0, g;
  3987. for (g = b[f]; this[a] >= g.value;)g = b[++f];
  3988. g && g.color && !this.options.color && (this.color = g.color);
  3989. return g
  3990. }, destroy: function () {
  3991. var a = this.series.chart, b = a.hoverPoints, f;
  3992. a.pointCount--;
  3993. b && (this.setState(), G(b, this), b.length ||
  3994. (a.hoverPoints = null));
  3995. if (this === a.hoverPoint)this.onMouseOut();
  3996. if (this.graphic || this.dataLabel)q(this), this.destroyElements();
  3997. this.legendItem && a.legend.destroyItem(this);
  3998. for (f in this)this[f] = null
  3999. }, destroyElements: function () {
  4000. for (var a = ["graphic", "dataLabel", "dataLabelUpper", "connector", "shadowGroup"], b, f = 6; f--;)b = a[f], this[b] && (this[b] = this[b].destroy())
  4001. }, getLabelConfig: function () {
  4002. return {
  4003. x: this.category,
  4004. y: this.y,
  4005. color: this.color,
  4006. colorIndex: this.colorIndex,
  4007. key: this.name || this.category,
  4008. series: this.series,
  4009. point: this,
  4010. percentage: this.percentage,
  4011. total: this.total || this.stackTotal
  4012. }
  4013. }, tooltipFormatter: function (a) {
  4014. var b = this.series, d = b.tooltipOptions, f = l(d.valueDecimals, ""), q = d.valuePrefix || "", m = d.valueSuffix || "";
  4015. A(b.pointArrayMap || ["y"], function (b) {
  4016. b = "{point." + b;
  4017. if (q || m)a = a.replace(b + "}", q + b + "}" + m);
  4018. a = a.replace(b + "}", b + ":,." + f + "f}")
  4019. });
  4020. return g(a, {point: this, series: this.series})
  4021. }, firePointEvent: function (a, b, f) {
  4022. var d = this, g = this.series.options;
  4023. (g.point.events[a] || d.options && d.options.events && d.options.events[a]) &&
  4024. this.importEvents();
  4025. "click" === a && g.allowPointSelect && (f = function (a) {
  4026. d.select && d.select(null, a.ctrlKey || a.metaKey || a.shiftKey)
  4027. });
  4028. r(this, a, b, f)
  4029. }, visible: !0
  4030. }
  4031. })(L);
  4032. (function (a) {
  4033. var B = a.addEvent, A = a.animObject, H = a.arrayMax, G = a.arrayMin, r = a.correctFloat, g = a.Date, f = a.defaultOptions, u = a.defaultPlotOptions, l = a.defined, q = a.each, d = a.erase, b = a.extend, p = a.fireEvent, C = a.grep, t = a.isArray, m = a.isNumber, c = a.isString, n = a.merge, E = a.pick, z = a.removeEvent, e = a.splat, x = a.SVGElement, F = a.syncTimeout, w = a.win;
  4034. a.Series = a.seriesType("line",
  4035. null, {
  4036. lineWidth: 2,
  4037. allowPointSelect: !1,
  4038. showCheckbox: !1,
  4039. animation: {duration: 1E3},
  4040. events: {},
  4041. marker: {
  4042. lineWidth: 0,
  4043. lineColor: "#ffffff",
  4044. radius: 4,
  4045. states: {
  4046. hover: {animation: {duration: 50}, enabled: !0, radiusPlus: 2, lineWidthPlus: 1},
  4047. select: {fillColor: "#cccccc", lineColor: "#000000", lineWidth: 2}
  4048. }
  4049. },
  4050. point: {events: {}},
  4051. dataLabels: {
  4052. align: "center",
  4053. formatter: function () {
  4054. return null === this.y ? "" : a.numberFormat(this.y, -1)
  4055. },
  4056. style: {fontSize: "11px", fontWeight: "bold", color: "contrast", textOutline: "1px contrast"},
  4057. verticalAlign: "bottom",
  4058. x: 0,
  4059. y: 0,
  4060. padding: 5
  4061. },
  4062. cropThreshold: 300,
  4063. pointRange: 0,
  4064. softThreshold: !0,
  4065. states: {hover: {lineWidthPlus: 1, marker: {}, halo: {size: 10, opacity: .25}}, select: {marker: {}}},
  4066. stickyTracking: !0,
  4067. turboThreshold: 1E3
  4068. }, {
  4069. isCartesian: !0,
  4070. pointClass: a.Point,
  4071. sorted: !0,
  4072. requireSorting: !0,
  4073. directTouch: !1,
  4074. axisTypes: ["xAxis", "yAxis"],
  4075. colorCounter: 0,
  4076. parallelArrays: ["x", "y"],
  4077. coll: "series",
  4078. init: function (a, c) {
  4079. var e = this, h, d, k = a.series, f;
  4080. e.chart = a;
  4081. e.options = c = e.setOptions(c);
  4082. e.linkedSeries = [];
  4083. e.bindAxes();
  4084. b(e, {
  4085. name: c.name, state: "", visible: !1 !==
  4086. c.visible, selected: !0 === c.selected
  4087. });
  4088. d = c.events;
  4089. for (h in d)B(e, h, d[h]);
  4090. if (d && d.click || c.point && c.point.events && c.point.events.click || c.allowPointSelect)a.runTrackerClick = !0;
  4091. e.getColor();
  4092. e.getSymbol();
  4093. q(e.parallelArrays, function (a) {
  4094. e[a + "Data"] = []
  4095. });
  4096. e.setData(c.data, !1);
  4097. e.isCartesian && (a.hasCartesianSeries = !0);
  4098. k.length && (f = k[k.length - 1]);
  4099. e._i = E(f && f._i, -1) + 1;
  4100. a.orderSeries(this.insert(k))
  4101. },
  4102. insert: function (a) {
  4103. var b = this.options.index, c;
  4104. if (m(b)) {
  4105. for (c = a.length; c--;)if (b >= E(a[c].options.index, a[c]._i)) {
  4106. a.splice(c +
  4107. 1, 0, this);
  4108. break
  4109. }
  4110. -1 === c && a.unshift(this);
  4111. c += 1
  4112. } else a.push(this);
  4113. return E(c, a.length - 1)
  4114. },
  4115. bindAxes: function () {
  4116. var b = this, c = b.options, e = b.chart, d;
  4117. q(b.axisTypes || [], function (h) {
  4118. q(e[h], function (a) {
  4119. d = a.options;
  4120. if (c[h] === d.index || void 0 !== c[h] && c[h] === d.id || void 0 === c[h] && 0 === d.index)b.insert(a.series), b[h] = a, a.isDirty = !0
  4121. });
  4122. b[h] || b.optionalAxis === h || a.error(18, !0)
  4123. })
  4124. },
  4125. updateParallelArrays: function (a, b) {
  4126. var c = a.series, e = arguments, h = m(b) ? function (e) {
  4127. var h = "y" === e && c.toYData ? c.toYData(a) : a[e];
  4128. c[e + "Data"][b] =
  4129. h
  4130. } : function (a) {
  4131. Array.prototype[b].apply(c[a + "Data"], Array.prototype.slice.call(e, 2))
  4132. };
  4133. q(c.parallelArrays, h)
  4134. },
  4135. autoIncrement: function () {
  4136. var a = this.options, b = this.xIncrement, c, e = a.pointIntervalUnit, b = E(b, a.pointStart, 0);
  4137. this.pointInterval = c = E(this.pointInterval, a.pointInterval, 1);
  4138. e && (a = new g(b), "day" === e ? a = +a[g.hcSetDate](a[g.hcGetDate]() + c) : "month" === e ? a = +a[g.hcSetMonth](a[g.hcGetMonth]() + c) : "year" === e && (a = +a[g.hcSetFullYear](a[g.hcGetFullYear]() + c)), c = a - b);
  4139. this.xIncrement = b + c;
  4140. return b
  4141. },
  4142. setOptions: function (a) {
  4143. var b =
  4144. this.chart, c = b.options.plotOptions, b = b.userOptions || {}, e = b.plotOptions || {}, h = c[this.type];
  4145. this.userOptions = a;
  4146. c = n(h, c.series, a);
  4147. this.tooltipOptions = n(f.tooltip, f.plotOptions[this.type].tooltip, b.tooltip, e.series && e.series.tooltip, e[this.type] && e[this.type].tooltip, a.tooltip);
  4148. null === h.marker && delete c.marker;
  4149. this.zoneAxis = c.zoneAxis;
  4150. a = this.zones = (c.zones || []).slice();
  4151. !c.negativeColor && !c.negativeFillColor || c.zones || a.push({
  4152. value: c[this.zoneAxis + "Threshold"] || c.threshold || 0, className: "highcharts-negative",
  4153. color: c.negativeColor, fillColor: c.negativeFillColor
  4154. });
  4155. a.length && l(a[a.length - 1].value) && a.push({color: this.color, fillColor: this.fillColor});
  4156. return c
  4157. },
  4158. getCyclic: function (a, b, c) {
  4159. var e, h = this.chart, d = this.userOptions, f = a + "Index", n = a + "Counter", m = c ? c.length : E(h.options.chart[a + "Count"], h[a + "Count"]);
  4160. b || (e = E(d[f], d["_" + f]), l(e) || (h.series.length || (h[n] = 0), d["_" + f] = e = h[n] % m, h[n] += 1), c && (b = c[e]));
  4161. void 0 !== e && (this[f] = e);
  4162. this[a] = b
  4163. },
  4164. getColor: function () {
  4165. this.options.colorByPoint ? this.options.color = null : this.getCyclic("color",
  4166. this.options.color || u[this.type].color, this.chart.options.colors)
  4167. },
  4168. getSymbol: function () {
  4169. this.getCyclic("symbol", this.options.marker.symbol, this.chart.options.symbols)
  4170. },
  4171. drawLegendSymbol: a.LegendSymbolMixin.drawLineMarker,
  4172. setData: function (b, e, d, f) {
  4173. var h = this, k = h.points, n = k && k.length || 0, g, p = h.options, y = h.chart, l = null, w = h.xAxis, x = p.turboThreshold, r = this.xData, z = this.yData, F = (g = h.pointArrayMap) && g.length;
  4174. b = b || [];
  4175. g = b.length;
  4176. e = E(e, !0);
  4177. if (!1 !== f && g && n === g && !h.cropped && !h.hasGroupedData && h.visible)q(b, function (a,
  4178. b) {
  4179. k[b].update && a !== p.data[b] && k[b].update(a, !1, null, !1)
  4180. }); else {
  4181. h.xIncrement = null;
  4182. h.colorCounter = 0;
  4183. q(this.parallelArrays, function (a) {
  4184. h[a + "Data"].length = 0
  4185. });
  4186. if (x && g > x) {
  4187. for (d = 0; null === l && d < g;)l = b[d], d++;
  4188. if (m(l))for (d = 0; d < g; d++)r[d] = this.autoIncrement(), z[d] = b[d]; else if (t(l))if (F)for (d = 0; d < g; d++)l = b[d], r[d] = l[0], z[d] = l.slice(1, F + 1); else for (d = 0; d < g; d++)l = b[d], r[d] = l[0], z[d] = l[1]; else a.error(12)
  4189. } else for (d = 0; d < g; d++)void 0 !== b[d] && (l = {series: h}, h.pointClass.prototype.applyOptions.apply(l, [b[d]]), h.updateParallelArrays(l,
  4190. d));
  4191. c(z[0]) && a.error(14, !0);
  4192. h.data = [];
  4193. h.options.data = h.userOptions.data = b;
  4194. for (d = n; d--;)k[d] && k[d].destroy && k[d].destroy();
  4195. w && (w.minRange = w.userMinRange);
  4196. h.isDirty = y.isDirtyBox = !0;
  4197. h.isDirtyData = !!k;
  4198. d = !1
  4199. }
  4200. "point" === p.legendType && (this.processData(), this.generatePoints());
  4201. e && y.redraw(d)
  4202. },
  4203. processData: function (b) {
  4204. var c = this.xData, e = this.yData, h = c.length, d;
  4205. d = 0;
  4206. var k, f, n = this.xAxis, m, g = this.options;
  4207. m = g.cropThreshold;
  4208. var p = this.getExtremesFromAll || g.getExtremesFromAll, l = this.isCartesian, g = n && n.val2lin, q = n &&
  4209. n.isLog, t, w;
  4210. if (l && !this.isDirty && !n.isDirty && !this.yAxis.isDirty && !b)return !1;
  4211. n && (b = n.getExtremes(), t = b.min, w = b.max);
  4212. if (l && this.sorted && !p && (!m || h > m || this.forceCrop))if (c[h - 1] < t || c[0] > w)c = [], e = []; else if (c[0] < t || c[h - 1] > w)d = this.cropData(this.xData, this.yData, t, w), c = d.xData, e = d.yData, d = d.start, k = !0;
  4213. for (m = c.length || 1; --m;)h = q ? g(c[m]) - g(c[m - 1]) : c[m] - c[m - 1], 0 < h && (void 0 === f || h < f) ? f = h : 0 > h && this.requireSorting && a.error(15);
  4214. this.cropped = k;
  4215. this.cropStart = d;
  4216. this.processedXData = c;
  4217. this.processedYData = e;
  4218. this.closestPointRange =
  4219. f
  4220. },
  4221. cropData: function (a, b, c, e) {
  4222. var h = a.length, d = 0, f = h, n = E(this.cropShoulder, 1), m;
  4223. for (m = 0; m < h; m++)if (a[m] >= c) {
  4224. d = Math.max(0, m - n);
  4225. break
  4226. }
  4227. for (c = m; c < h; c++)if (a[c] > e) {
  4228. f = c + n;
  4229. break
  4230. }
  4231. return {xData: a.slice(d, f), yData: b.slice(d, f), start: d, end: f}
  4232. },
  4233. generatePoints: function () {
  4234. var a = this.options.data, b = this.data, c, d = this.processedXData, f = this.processedYData, k = this.pointClass, n = d.length, m = this.cropStart || 0, g, p = this.hasGroupedData, l, q = [], t;
  4235. b || p || (b = [], b.length = a.length, b = this.data = b);
  4236. for (t = 0; t < n; t++)g = m + t, p ? (l = (new k).init(this,
  4237. [d[t]].concat(e(f[t]))), l.dataGroup = this.groupMap[t]) : (l = b[g]) || void 0 === a[g] || (b[g] = l = (new k).init(this, a[g], d[t])), l.index = g, q[t] = l;
  4238. if (b && (n !== (c = b.length) || p))for (t = 0; t < c; t++)t !== m || p || (t += n), b[t] && (b[t].destroyElements(), b[t].plotX = void 0);
  4239. this.data = b;
  4240. this.points = q
  4241. },
  4242. getExtremes: function (a) {
  4243. var b = this.yAxis, c = this.processedXData, e, h = [], d = 0;
  4244. e = this.xAxis.getExtremes();
  4245. var f = e.min, n = e.max, g, p, l, q;
  4246. a = a || this.stackedYData || this.processedYData || [];
  4247. e = a.length;
  4248. for (q = 0; q < e; q++)if (p = c[q], l = a[q], g = (m(l, !0) ||
  4249. t(l)) && (!b.isLog || l.length || 0 < l), p = this.getExtremesFromAll || this.options.getExtremesFromAll || this.cropped || (c[q + 1] || p) >= f && (c[q - 1] || p) <= n, g && p)if (g = l.length)for (; g--;)null !== l[g] && (h[d++] = l[g]); else h[d++] = l;
  4250. this.dataMin = G(h);
  4251. this.dataMax = H(h)
  4252. },
  4253. translate: function () {
  4254. this.processedXData || this.processData();
  4255. this.generatePoints();
  4256. var a = this.options, b = a.stacking, c = this.xAxis, e = c.categories, d = this.yAxis, k = this.points, f = k.length, n = !!this.modifyValue, g = a.pointPlacement, p = "between" === g || m(g), q = a.threshold,
  4257. t = a.startFromThreshold ? q : 0, w, x, z, F, u = Number.MAX_VALUE;
  4258. "between" === g && (g = .5);
  4259. m(g) && (g *= E(a.pointRange || c.pointRange));
  4260. for (a = 0; a < f; a++) {
  4261. var C = k[a], A = C.x, B = C.y;
  4262. x = C.low;
  4263. var H = b && d.stacks[(this.negStacks && B < (t ? 0 : q) ? "-" : "") + this.stackKey], G;
  4264. d.isLog && null !== B && 0 >= B && (C.isNull = !0);
  4265. C.plotX = w = r(Math.min(Math.max(-1E5, c.translate(A, 0, 0, 0, 1, g, "flags" === this.type)), 1E5));
  4266. b && this.visible && !C.isNull && H && H[A] && (F = this.getStackIndicator(F, A, this.index), G = H[A], B = G.points[F.key], x = B[0], B = B[1], x === t && F.key === H[A].base &&
  4267. (x = E(q, d.min)), d.isLog && 0 >= x && (x = null), C.total = C.stackTotal = G.total, C.percentage = G.total && C.y / G.total * 100, C.stackY = B, G.setOffset(this.pointXOffset || 0, this.barW || 0));
  4268. C.yBottom = l(x) ? d.translate(x, 0, 1, 0, 1) : null;
  4269. n && (B = this.modifyValue(B, C));
  4270. C.plotY = x = "number" === typeof B && Infinity !== B ? Math.min(Math.max(-1E5, d.translate(B, 0, 1, 0, 1)), 1E5) : void 0;
  4271. C.isInside = void 0 !== x && 0 <= x && x <= d.len && 0 <= w && w <= c.len;
  4272. C.clientX = p ? r(c.translate(A, 0, 0, 0, 1, g)) : w;
  4273. C.negative = C.y < (q || 0);
  4274. C.category = e && void 0 !== e[C.x] ? e[C.x] : C.x;
  4275. C.isNull ||
  4276. (void 0 !== z && (u = Math.min(u, Math.abs(w - z))), z = w);
  4277. C.zone = this.zones.length && C.getZone()
  4278. }
  4279. this.closestPointRangePx = u
  4280. },
  4281. getValidPoints: function (a, b) {
  4282. var c = this.chart;
  4283. return C(a || this.points || [], function (a) {
  4284. return b && !c.isInsidePlot(a.plotX, a.plotY, c.inverted) ? !1 : !a.isNull
  4285. })
  4286. },
  4287. setClip: function (a) {
  4288. var b = this.chart, c = this.options, e = b.renderer, d = b.inverted, h = this.clipBox, f = h || b.clipBox, n = this.sharedClipKey || ["_sharedClip", a && a.duration, a && a.easing, f.height, c.xAxis, c.yAxis].join(), m = b[n], g = b[n + "m"];
  4289. m || (a && (f.width =
  4290. 0, b[n + "m"] = g = e.clipRect(-99, d ? -b.plotLeft : -b.plotTop, 99, d ? b.chartWidth : b.chartHeight)), b[n] = m = e.clipRect(f), m.count = {length: 0});
  4291. a && !m.count[this.index] && (m.count[this.index] = !0, m.count.length += 1);
  4292. !1 !== c.clip && (this.group.clip(a || h ? m : b.clipRect), this.markerGroup.clip(g), this.sharedClipKey = n);
  4293. a || (m.count[this.index] && (delete m.count[this.index], --m.count.length), 0 === m.count.length && n && b[n] && (h || (b[n] = b[n].destroy()), b[n + "m"] && (this.markerGroup.clip(), b[n + "m"] = b[n + "m"].destroy())))
  4294. },
  4295. animate: function (a) {
  4296. var b =
  4297. this.chart, c = A(this.options.animation), e;
  4298. a ? this.setClip(c) : (e = this.sharedClipKey, (a = b[e]) && a.animate({width: b.plotSizeX}, c), b[e + "m"] && b[e + "m"].animate({width: b.plotSizeX + 99}, c), this.animate = null)
  4299. },
  4300. afterAnimate: function () {
  4301. this.setClip();
  4302. p(this, "afterAnimate")
  4303. },
  4304. drawPoints: function () {
  4305. var a = this.points, b = this.chart, c, e, d, k, f = this.options.marker, n, g, p, l, q = this.markerGroup, t = E(f.enabled, this.xAxis.isRadial ? !0 : null, this.closestPointRangePx > 2 * f.radius);
  4306. if (!1 !== f.enabled || this._hasPointMarkers)for (e = 0; e < a.length; e++)d =
  4307. a[e], c = d.plotY, k = d.graphic, n = d.marker || {}, g = !!d.marker, p = t && void 0 === n.enabled || n.enabled, l = d.isInside, p && m(c) && null !== d.y ? (c = E(n.symbol, this.symbol), d.hasImage = 0 === c.indexOf("url"), p = this.markerAttribs(d, d.selected && "select"), k ? k[l ? "show" : "hide"](!0).animate(p) : l && (0 < p.width || d.hasImage) && (d.graphic = k = b.renderer.symbol(c, p.x, p.y, p.width, p.height, g ? n : f).add(q)), k && k.attr(this.pointAttribs(d, d.selected && "select")), k && k.addClass(d.getClassName(), !0)) : k && (d.graphic = k.destroy())
  4308. },
  4309. markerAttribs: function (a,
  4310. b) {
  4311. var c = this.options.marker, e = a.marker || {}, d = E(e.radius, c.radius);
  4312. b && (c = c.states[b], b = e.states && e.states[b], d = E(b && b.radius, c && c.radius, d + (c && c.radiusPlus || 0)));
  4313. a.hasImage && (d = 0);
  4314. a = {x: Math.floor(a.plotX) - d, y: a.plotY - d};
  4315. d && (a.width = a.height = 2 * d);
  4316. return a
  4317. },
  4318. pointAttribs: function (a, b) {
  4319. var c = this.options.marker, e = a && a.options, d = e && e.marker || {}, h = this.color, f = e && e.color, n = a && a.color, e = E(d.lineWidth, c.lineWidth);
  4320. a = a && a.zone && a.zone.color;
  4321. h = f || a || n || h;
  4322. a = d.fillColor || c.fillColor || h;
  4323. h = d.lineColor || c.lineColor ||
  4324. h;
  4325. b && (c = c.states[b], b = d.states && d.states[b] || {}, e = E(b.lineWidth, c.lineWidth, e + E(b.lineWidthPlus, c.lineWidthPlus, 0)), a = b.fillColor || c.fillColor || a, h = b.lineColor || c.lineColor || h);
  4326. return {stroke: h, "stroke-width": e, fill: a}
  4327. },
  4328. destroy: function () {
  4329. var a = this, b = a.chart, c = /AppleWebKit\/533/.test(w.navigator.userAgent), e, f = a.data || [], k, n, m;
  4330. p(a, "destroy");
  4331. z(a);
  4332. q(a.axisTypes || [], function (b) {
  4333. (m = a[b]) && m.series && (d(m.series, a), m.isDirty = m.forceRedraw = !0)
  4334. });
  4335. a.legendItem && a.chart.legend.destroyItem(a);
  4336. for (e = f.length; e--;)(k =
  4337. f[e]) && k.destroy && k.destroy();
  4338. a.points = null;
  4339. clearTimeout(a.animationTimeout);
  4340. for (n in a)a[n] instanceof x && !a[n].survive && (e = c && "group" === n ? "hide" : "destroy", a[n][e]());
  4341. b.hoverSeries === a && (b.hoverSeries = null);
  4342. d(b.series, a);
  4343. b.orderSeries();
  4344. for (n in a)delete a[n]
  4345. },
  4346. getGraphPath: function (a, b, c) {
  4347. var e = this, d = e.options, h = d.step, f, n = [], m = [], g;
  4348. a = a || e.points;
  4349. (f = a.reversed) && a.reverse();
  4350. (h = {right: 1, center: 2}[h] || h && 3) && f && (h = 4 - h);
  4351. !d.connectNulls || b || c || (a = this.getValidPoints(a));
  4352. q(a, function (f, k) {
  4353. var p = f.plotX,
  4354. q = f.plotY, t = a[k - 1];
  4355. (f.leftCliff || t && t.rightCliff) && !c && (g = !0);
  4356. f.isNull && !l(b) && 0 < k ? g = !d.connectNulls : f.isNull && !b ? g = !0 : (0 === k || g ? k = ["M", f.plotX, f.plotY] : e.getPointSpline ? k = e.getPointSpline(a, f, k) : h ? (k = 1 === h ? ["L", t.plotX, q] : 2 === h ? ["L", (t.plotX + p) / 2, t.plotY, "L", (t.plotX + p) / 2, q] : ["L", p, t.plotY], k.push("L", p, q)) : k = ["L", p, q], m.push(f.x), h && m.push(f.x), n.push.apply(n, k), g = !1)
  4357. });
  4358. n.xMap = m;
  4359. return e.graphPath = n
  4360. },
  4361. drawGraph: function () {
  4362. var a = this, b = this.options, c = (this.gappedPath || this.getGraphPath).call(this),
  4363. e = [["graph", "highcharts-graph", b.lineColor || this.color, b.dashStyle]];
  4364. q(this.zones, function (c, d) {
  4365. e.push(["zone-graph-" + d, "highcharts-graph highcharts-zone-graph-" + d + " " + (c.className || ""), c.color || a.color, c.dashStyle || b.dashStyle])
  4366. });
  4367. q(e, function (e, d) {
  4368. var h = e[0], f = a[h];
  4369. f ? (f.endX = c.xMap, f.animate({d: c})) : c.length && (a[h] = a.chart.renderer.path(c).addClass(e[1]).attr({zIndex: 1}).add(a.group), f = {
  4370. stroke: e[2],
  4371. "stroke-width": b.lineWidth,
  4372. fill: a.fillGraph && a.color || "none"
  4373. }, e[3] ? f.dashstyle = e[3] : "square" !== b.linecap &&
  4374. (f["stroke-linecap"] = f["stroke-linejoin"] = "round"), f = a[h].attr(f).shadow(2 > d && b.shadow));
  4375. f && (f.startX = c.xMap, f.isArea = c.isArea)
  4376. })
  4377. },
  4378. applyZones: function () {
  4379. var a = this, b = this.chart, c = b.renderer, e = this.zones, d, f, n = this.clips || [], m, g = this.graph, p = this.area, l = Math.max(b.chartWidth, b.chartHeight), t = this[(this.zoneAxis || "y") + "Axis"], w, x, r = b.inverted, z, F, u, C, A = !1;
  4380. e.length && (g || p) && t && void 0 !== t.min && (x = t.reversed, z = t.horiz, g && g.hide(), p && p.hide(), w = t.getExtremes(), q(e, function (e, h) {
  4381. d = x ? z ? b.plotWidth : 0 : z ? 0 :
  4382. t.toPixels(w.min);
  4383. d = Math.min(Math.max(E(f, d), 0), l);
  4384. f = Math.min(Math.max(Math.round(t.toPixels(E(e.value, w.max), !0)), 0), l);
  4385. A && (d = f = t.toPixels(w.max));
  4386. F = Math.abs(d - f);
  4387. u = Math.min(d, f);
  4388. C = Math.max(d, f);
  4389. t.isXAxis ? (m = {
  4390. x: r ? C : u,
  4391. y: 0,
  4392. width: F,
  4393. height: l
  4394. }, z || (m.x = b.plotHeight - m.x)) : (m = {
  4395. x: 0,
  4396. y: r ? C : u,
  4397. width: l,
  4398. height: F
  4399. }, z && (m.y = b.plotWidth - m.y));
  4400. r && c.isVML && (m = t.isXAxis ? {
  4401. x: 0,
  4402. y: x ? u : C,
  4403. height: m.width,
  4404. width: b.chartWidth
  4405. } : {x: m.y - b.plotLeft - b.spacingBox.x, y: 0, width: m.height, height: b.chartHeight});
  4406. n[h] ? n[h].animate(m) : (n[h] =
  4407. c.clipRect(m), g && a["zone-graph-" + h].clip(n[h]), p && a["zone-area-" + h].clip(n[h]));
  4408. A = e.value > w.max
  4409. }), this.clips = n)
  4410. },
  4411. invertGroups: function (a) {
  4412. function b() {
  4413. q(["group", "markerGroup"], function (b) {
  4414. c[b] && (c[b].width = c.yAxis.len, c[b].height = c.xAxis.len, c[b].invert(a))
  4415. })
  4416. }
  4417. var c = this, e;
  4418. c.xAxis && (e = B(c.chart, "resize", b), B(c, "destroy", e), b(a), c.invertGroups = b)
  4419. },
  4420. plotGroup: function (a, b, c, e, d) {
  4421. var h = this[a], f = !h;
  4422. f && (this[a] = h = this.chart.renderer.g(b).attr({zIndex: e || .1}).add(d), h.addClass("highcharts-series-" + this.index +
  4423. " highcharts-" + this.type + "-series highcharts-color-" + this.colorIndex + " " + (this.options.className || "")));
  4424. h.attr({visibility: c})[f ? "attr" : "animate"](this.getPlotBox());
  4425. return h
  4426. },
  4427. getPlotBox: function () {
  4428. var a = this.chart, b = this.xAxis, c = this.yAxis;
  4429. a.inverted && (b = c, c = this.xAxis);
  4430. return {
  4431. translateX: b ? b.left : a.plotLeft,
  4432. translateY: c ? c.top : a.plotTop,
  4433. scaleX: 1,
  4434. scaleY: 1
  4435. }
  4436. },
  4437. render: function () {
  4438. var a = this, b = a.chart, c, e = a.options, d = !!a.animate && b.renderer.isSVG && A(e.animation).duration, f = a.visible ? "inherit" : "hidden", n =
  4439. e.zIndex, m = a.hasRendered, g = b.seriesGroup, p = b.inverted;
  4440. c = a.plotGroup("group", "series", f, n, g);
  4441. a.markerGroup = a.plotGroup("markerGroup", "markers", f, n, g);
  4442. d && a.animate(!0);
  4443. c.inverted = a.isCartesian ? p : !1;
  4444. a.drawGraph && (a.drawGraph(), a.applyZones());
  4445. a.drawDataLabels && a.drawDataLabels();
  4446. a.visible && a.drawPoints();
  4447. a.drawTracker && !1 !== a.options.enableMouseTracking && a.drawTracker();
  4448. a.invertGroups(p);
  4449. !1 === e.clip || a.sharedClipKey || m || c.clip(b.clipRect);
  4450. d && a.animate();
  4451. m || (a.animationTimeout = F(function () {
  4452. a.afterAnimate()
  4453. },
  4454. d));
  4455. a.isDirty = !1;
  4456. a.hasRendered = !0
  4457. },
  4458. redraw: function () {
  4459. var a = this.chart, b = this.isDirty || this.isDirtyData, c = this.group, e = this.xAxis, d = this.yAxis;
  4460. c && (a.inverted && c.attr({
  4461. width: a.plotWidth,
  4462. height: a.plotHeight
  4463. }), c.animate({translateX: E(e && e.left, a.plotLeft), translateY: E(d && d.top, a.plotTop)}));
  4464. this.translate();
  4465. this.render();
  4466. b && delete this.kdTree
  4467. },
  4468. kdDimensions: 1,
  4469. kdAxisArray: ["clientX", "plotY"],
  4470. searchPoint: function (a, b) {
  4471. var c = this.xAxis, e = this.yAxis, d = this.chart.inverted;
  4472. return this.searchKDTree({
  4473. clientX: d ?
  4474. c.len - a.chartY + c.pos : a.chartX - c.pos,
  4475. plotY: d ? e.len - a.chartX + e.pos : a.chartY - e.pos
  4476. }, b)
  4477. },
  4478. buildKDTree: function () {
  4479. function a(c, e, d) {
  4480. var h, f;
  4481. if (f = c && c.length)return h = b.kdAxisArray[e % d], c.sort(function (a, b) {
  4482. return a[h] - b[h]
  4483. }), f = Math.floor(f / 2), {
  4484. point: c[f],
  4485. left: a(c.slice(0, f), e + 1, d),
  4486. right: a(c.slice(f + 1), e + 1, d)
  4487. }
  4488. }
  4489. this.buildingKdTree = !0;
  4490. var b = this, c = b.kdDimensions;
  4491. delete b.kdTree;
  4492. F(function () {
  4493. b.kdTree = a(b.getValidPoints(null, !b.directTouch), c, c);
  4494. b.buildingKdTree = !1
  4495. }, b.options.kdNow ? 0 : 1)
  4496. },
  4497. searchKDTree: function (a,
  4498. b) {
  4499. function c(a, b, k, n) {
  4500. var m = b.point, g = e.kdAxisArray[k % n], p, t, q = m;
  4501. t = l(a[d]) && l(m[d]) ? Math.pow(a[d] - m[d], 2) : null;
  4502. p = l(a[h]) && l(m[h]) ? Math.pow(a[h] - m[h], 2) : null;
  4503. p = (t || 0) + (p || 0);
  4504. m.dist = l(p) ? Math.sqrt(p) : Number.MAX_VALUE;
  4505. m.distX = l(t) ? Math.sqrt(t) : Number.MAX_VALUE;
  4506. g = a[g] - m[g];
  4507. p = 0 > g ? "left" : "right";
  4508. t = 0 > g ? "right" : "left";
  4509. b[p] && (p = c(a, b[p], k + 1, n), q = p[f] < q[f] ? p : m);
  4510. b[t] && Math.sqrt(g * g) < q[f] && (a = c(a, b[t], k + 1, n), q = a[f] < q[f] ? a : q);
  4511. return q
  4512. }
  4513. var e = this, d = this.kdAxisArray[0], h = this.kdAxisArray[1], f = b ? "distX" : "dist";
  4514. this.kdTree || this.buildingKdTree || this.buildKDTree();
  4515. if (this.kdTree)return c(a, this.kdTree, this.kdDimensions, this.kdDimensions)
  4516. }
  4517. })
  4518. })(L);
  4519. (function (a) {
  4520. function B(a, d, b, f, g) {
  4521. var p = a.chart.inverted;
  4522. this.axis = a;
  4523. this.isNegative = b;
  4524. this.options = d;
  4525. this.x = f;
  4526. this.total = null;
  4527. this.points = {};
  4528. this.stack = g;
  4529. this.rightCliff = this.leftCliff = 0;
  4530. this.alignOptions = {
  4531. align: d.align || (p ? b ? "left" : "right" : "center"),
  4532. verticalAlign: d.verticalAlign || (p ? "middle" : b ? "bottom" : "top"),
  4533. y: l(d.y, p ? 4 : b ? 14 : -6),
  4534. x: l(d.x, p ? b ? -6 : 6 : 0)
  4535. };
  4536. this.textAlign =
  4537. d.textAlign || (p ? b ? "right" : "left" : "center")
  4538. }
  4539. var A = a.Axis, H = a.Chart, G = a.correctFloat, r = a.defined, g = a.destroyObjectProperties, f = a.each, u = a.format, l = a.pick;
  4540. a = a.Series;
  4541. B.prototype = {
  4542. destroy: function () {
  4543. g(this, this.axis)
  4544. }, render: function (a) {
  4545. var d = this.options, b = d.format, b = b ? u(b, this) : d.formatter.call(this);
  4546. this.label ? this.label.attr({
  4547. text: b,
  4548. visibility: "hidden"
  4549. }) : this.label = this.axis.chart.renderer.text(b, null, null, d.useHTML).css(d.style).attr({
  4550. align: this.textAlign,
  4551. rotation: d.rotation,
  4552. visibility: "hidden"
  4553. }).add(a)
  4554. },
  4555. setOffset: function (a, d) {
  4556. var b = this.axis, f = b.chart, g = f.inverted, l = b.reversed, l = this.isNegative && !l || !this.isNegative && l, m = b.translate(b.usePercentage ? 100 : this.total, 0, 0, 0, 1), b = b.translate(0), b = Math.abs(m - b);
  4557. a = f.xAxis[0].translate(this.x) + a;
  4558. var c = f.plotHeight, g = {
  4559. x: g ? l ? m : m - b : a,
  4560. y: g ? c - a - d : l ? c - m - b : c - m,
  4561. width: g ? b : d,
  4562. height: g ? d : b
  4563. };
  4564. if (d = this.label)d.align(this.alignOptions, null, g), g = d.alignAttr, d[!1 === this.options.crop || f.isInsidePlot(g.x, g.y) ? "show" : "hide"](!0)
  4565. }
  4566. };
  4567. H.prototype.getStacks = function () {
  4568. var a = this;
  4569. f(a.yAxis, function (a) {
  4570. a.stacks && a.hasVisibleSeries && (a.oldStacks = a.stacks)
  4571. });
  4572. f(a.series, function (d) {
  4573. !d.options.stacking || !0 !== d.visible && !1 !== a.options.chart.ignoreHiddenSeries || (d.stackKey = d.type + l(d.options.stack, ""))
  4574. })
  4575. };
  4576. A.prototype.buildStacks = function () {
  4577. var a = this.series, d, b = l(this.options.reversedStacks, !0), f = a.length, g;
  4578. if (!this.isXAxis) {
  4579. this.usePercentage = !1;
  4580. for (g = f; g--;)a[b ? g : f - g - 1].setStackedPoints();
  4581. for (g = f; g--;)d = a[b ? g : f - g - 1], d.setStackCliffs && d.setStackCliffs();
  4582. if (this.usePercentage)for (g =
  4583. 0; g < f; g++)a[g].setPercentStacks()
  4584. }
  4585. };
  4586. A.prototype.renderStackTotals = function () {
  4587. var a = this.chart, d = a.renderer, b = this.stacks, f, g, l = this.stackTotalGroup;
  4588. l || (this.stackTotalGroup = l = d.g("stack-labels").attr({visibility: "visible", zIndex: 6}).add());
  4589. l.translate(a.plotLeft, a.plotTop);
  4590. for (f in b)for (g in a = b[f], a)a[g].render(l)
  4591. };
  4592. A.prototype.resetStacks = function () {
  4593. var a = this.stacks, d, b;
  4594. if (!this.isXAxis)for (d in a)for (b in a[d])a[d][b].touched < this.stacksTouched ? (a[d][b].destroy(), delete a[d][b]) : (a[d][b].total =
  4595. null, a[d][b].cum = null)
  4596. };
  4597. A.prototype.cleanStacks = function () {
  4598. var a, d, b;
  4599. if (!this.isXAxis)for (d in this.oldStacks && (a = this.stacks = this.oldStacks), a)for (b in a[d])a[d][b].cum = a[d][b].total
  4600. };
  4601. a.prototype.setStackedPoints = function () {
  4602. if (this.options.stacking && (!0 === this.visible || !1 === this.chart.options.chart.ignoreHiddenSeries)) {
  4603. var a = this.processedXData, d = this.processedYData, b = [], f = d.length, g = this.options, t = g.threshold, m = g.startFromThreshold ? t : 0, c = g.stack, g = g.stacking, n = this.stackKey, u = "-" + n, z = this.negStacks,
  4604. e = this.yAxis, x = e.stacks, F = e.oldStacks, w, h, y, A, K, I, k;
  4605. e.stacksTouched += 1;
  4606. for (K = 0; K < f; K++)I = a[K], k = d[K], w = this.getStackIndicator(w, I, this.index), A = w.key, y = (h = z && k < (m ? 0 : t)) ? u : n, x[y] || (x[y] = {}), x[y][I] || (F[y] && F[y][I] ? (x[y][I] = F[y][I], x[y][I].total = null) : x[y][I] = new B(e, e.options.stackLabels, h, I, c)), y = x[y][I], null !== k && (y.points[A] = y.points[this.index] = [l(y.cum, m)], r(y.cum) || (y.base = A), y.touched = e.stacksTouched, 0 < w.index && !1 === this.singleStacks && (y.points[A][0] = y.points[this.index + "," + I + ",0"][0])), "percent" ===
  4607. g ? (h = h ? n : u, z && x[h] && x[h][I] ? (h = x[h][I], y.total = h.total = Math.max(h.total, y.total) + Math.abs(k) || 0) : y.total = G(y.total + (Math.abs(k) || 0))) : y.total = G(y.total + (k || 0)), y.cum = l(y.cum, m) + (k || 0), null !== k && (y.points[A].push(y.cum), b[K] = y.cum);
  4608. "percent" === g && (e.usePercentage = !0);
  4609. this.stackedYData = b;
  4610. e.oldStacks = {}
  4611. }
  4612. };
  4613. a.prototype.setPercentStacks = function () {
  4614. var a = this, d = a.stackKey, b = a.yAxis.stacks, g = a.processedXData, l;
  4615. f([d, "-" + d], function (d) {
  4616. for (var f = g.length, c, n; f--;)if (c = g[f], l = a.getStackIndicator(l, c, a.index,
  4617. d), c = (n = b[d] && b[d][c]) && n.points[l.key])n = n.total ? 100 / n.total : 0, c[0] = G(c[0] * n), c[1] = G(c[1] * n), a.stackedYData[f] = c[1]
  4618. })
  4619. };
  4620. a.prototype.getStackIndicator = function (a, d, b, f) {
  4621. !r(a) || a.x !== d || f && a.key !== f ? a = {x: d, index: 0, key: f} : a.index++;
  4622. a.key = [b, d, a.index].join();
  4623. return a
  4624. }
  4625. })(L);
  4626. (function (a) {
  4627. var B = a.addEvent, A = a.animate, H = a.Axis, G = a.createElement, r = a.css, g = a.defined, f = a.each, u = a.erase, l = a.extend, q = a.fireEvent, d = a.inArray, b = a.isNumber, p = a.isObject, C = a.merge, t = a.pick, m = a.Point, c = a.Series, n = a.seriesTypes, E = a.setAnimation,
  4628. z = a.splat;
  4629. l(a.Chart.prototype, {
  4630. addSeries: function (a, b, c) {
  4631. var e, d = this;
  4632. a && (b = t(b, !0), q(d, "addSeries", {options: a}, function () {
  4633. e = d.initSeries(a);
  4634. d.isDirtyLegend = !0;
  4635. d.linkSeries();
  4636. b && d.redraw(c)
  4637. }));
  4638. return e
  4639. },
  4640. addAxis: function (a, b, c, d) {
  4641. var e = b ? "xAxis" : "yAxis", f = this.options;
  4642. a = C(a, {index: this[e].length, isX: b});
  4643. new H(this, a);
  4644. f[e] = z(f[e] || {});
  4645. f[e].push(a);
  4646. t(c, !0) && this.redraw(d)
  4647. },
  4648. showLoading: function (a) {
  4649. var b = this, c = b.options, e = b.loadingDiv, d = c.loading, f = function () {
  4650. e && r(e, {
  4651. left: b.plotLeft + "px", top: b.plotTop +
  4652. "px", width: b.plotWidth + "px", height: b.plotHeight + "px"
  4653. })
  4654. };
  4655. e || (b.loadingDiv = e = G("div", {className: "highcharts-loading highcharts-loading-hidden"}, null, b.container), b.loadingSpan = G("span", {className: "highcharts-loading-inner"}, null, e), B(b, "redraw", f));
  4656. e.className = "highcharts-loading";
  4657. b.loadingSpan.innerHTML = a || c.lang.loading;
  4658. r(e, l(d.style, {zIndex: 10}));
  4659. r(b.loadingSpan, d.labelStyle);
  4660. b.loadingShown || (r(e, {
  4661. opacity: 0,
  4662. display: ""
  4663. }), A(e, {opacity: d.style.opacity || .5}, {duration: d.showDuration || 0}));
  4664. b.loadingShown = !0;
  4665. f()
  4666. },
  4667. hideLoading: function () {
  4668. var a = this.options, b = this.loadingDiv;
  4669. b && (b.className = "highcharts-loading highcharts-loading-hidden", A(b, {opacity: 0}, {
  4670. duration: a.loading.hideDuration || 100,
  4671. complete: function () {
  4672. r(b, {display: "none"})
  4673. }
  4674. }));
  4675. this.loadingShown = !1
  4676. },
  4677. propsRequireDirtyBox: "backgroundColor borderColor borderWidth margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),
  4678. propsRequireUpdateSeries: "chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions".split(" "),
  4679. update: function (a, c) {
  4680. var e, n = {credits: "addCredits", title: "setTitle", subtitle: "setSubtitle"}, h = a.chart, m, p;
  4681. if (h) {
  4682. C(!0, this.options.chart, h);
  4683. "className" in h && this.setClassName(h.className);
  4684. if ("inverted" in h || "polar" in h)this.propFromSeries(), m = !0;
  4685. for (e in h)h.hasOwnProperty(e) && (-1 !== d("chart." + e, this.propsRequireUpdateSeries) && (p = !0), -1 !== d(e, this.propsRequireDirtyBox) && (this.isDirtyBox = !0));
  4686. "style" in h && this.renderer.setStyle(h.style)
  4687. }
  4688. for (e in a) {
  4689. if (this[e] && "function" === typeof this[e].update)this[e].update(a[e], !1); else if ("function" === typeof this[n[e]])this[n[e]](a[e]);
  4690. "chart" !== e && -1 !== d(e, this.propsRequireUpdateSeries) && (p = !0)
  4691. }
  4692. a.colors && (this.options.colors = a.colors);
  4693. a.plotOptions && C(!0, this.options.plotOptions, a.plotOptions);
  4694. f(["xAxis", "yAxis", "series"], function (b) {
  4695. a[b] && f(z(a[b]), function (a, c) {
  4696. (c = g(a.id) && this.get(a.id) || this[b][c]) && c.coll === b && c.update(a, !1)
  4697. }, this)
  4698. }, this);
  4699. m && f(this.axes, function (a) {
  4700. a.update({}, !1)
  4701. });
  4702. p && f(this.series, function (a) {
  4703. a.update({}, !1)
  4704. });
  4705. a.loading && C(!0, this.options.loading, a.loading);
  4706. e = h && h.width;
  4707. h = h && h.height;
  4708. b(e) && e !== this.chartWidth || b(h) && h !== this.chartHeight ? this.setSize(e, h) : t(c, !0) && this.redraw()
  4709. },
  4710. setSubtitle: function (a) {
  4711. this.setTitle(void 0, a)
  4712. }
  4713. });
  4714. l(m.prototype, {
  4715. update: function (a, b, c, d) {
  4716. function e() {
  4717. f.applyOptions(a);
  4718. null === f.y && n && (f.graphic = n.destroy());
  4719. p(a, !0) && (n && n.element && a && a.marker && a.marker.symbol && (f.graphic = n.destroy()),
  4720. a && a.dataLabels && f.dataLabel && (f.dataLabel = f.dataLabel.destroy()));
  4721. m = f.index;
  4722. g.updateParallelArrays(f, m);
  4723. l.data[m] = p(l.data[m], !0) ? f.options : a;
  4724. g.isDirty = g.isDirtyData = !0;
  4725. !g.fixedBox && g.hasCartesianSeries && (k.isDirtyBox = !0);
  4726. "point" === l.legendType && (k.isDirtyLegend = !0);
  4727. b && k.redraw(c)
  4728. }
  4729. var f = this, g = f.series, n = f.graphic, m, k = g.chart, l = g.options;
  4730. b = t(b, !0);
  4731. !1 === d ? e() : f.firePointEvent("update", {options: a}, e)
  4732. }, remove: function (a, b) {
  4733. this.series.removePoint(d(this, this.series.data), a, b)
  4734. }
  4735. });
  4736. l(c.prototype, {
  4737. addPoint: function (a,
  4738. b, c, d) {
  4739. var e = this.options, f = this.data, g = this.chart, n = this.xAxis, n = n && n.hasNames && n.names, m = e.data, k, p, l = this.xData, q, w;
  4740. b = t(b, !0);
  4741. k = {series: this};
  4742. this.pointClass.prototype.applyOptions.apply(k, [a]);
  4743. w = k.x;
  4744. q = l.length;
  4745. if (this.requireSorting && w < l[q - 1])for (p = !0; q && l[q - 1] > w;)q--;
  4746. this.updateParallelArrays(k, "splice", q, 0, 0);
  4747. this.updateParallelArrays(k, q);
  4748. n && k.name && (n[w] = k.name);
  4749. m.splice(q, 0, a);
  4750. p && (this.data.splice(q, 0, null), this.processData());
  4751. "point" === e.legendType && this.generatePoints();
  4752. c && (f[0] && f[0].remove ?
  4753. f[0].remove(!1) : (f.shift(), this.updateParallelArrays(k, "shift"), m.shift()));
  4754. this.isDirtyData = this.isDirty = !0;
  4755. b && g.redraw(d)
  4756. }, removePoint: function (a, b, c) {
  4757. var e = this, d = e.data, f = d[a], g = e.points, n = e.chart, m = function () {
  4758. g && g.length === d.length && g.splice(a, 1);
  4759. d.splice(a, 1);
  4760. e.options.data.splice(a, 1);
  4761. e.updateParallelArrays(f || {series: e}, "splice", a, 1);
  4762. f && f.destroy();
  4763. e.isDirty = !0;
  4764. e.isDirtyData = !0;
  4765. b && n.redraw()
  4766. };
  4767. E(c, n);
  4768. b = t(b, !0);
  4769. f ? f.firePointEvent("remove", null, m) : m()
  4770. }, remove: function (a, b, c) {
  4771. function e() {
  4772. d.destroy();
  4773. f.isDirtyLegend = f.isDirtyBox = !0;
  4774. f.linkSeries();
  4775. t(a, !0) && f.redraw(b)
  4776. }
  4777. var d = this, f = d.chart;
  4778. !1 !== c ? q(d, "remove", null, e) : e()
  4779. }, update: function (a, b) {
  4780. var c = this, e = this.chart, d = this.userOptions, g = this.type, m = a.type || d.type || e.options.chart.type, p = n[g].prototype, q = ["group", "markerGroup", "dataLabelsGroup"], k;
  4781. if (m && m !== g || void 0 !== a.zIndex)q.length = 0;
  4782. f(q, function (a) {
  4783. q[a] = c[a];
  4784. delete c[a]
  4785. });
  4786. a = C(d, {animation: !1, index: this.index, pointStart: this.xData[0]}, {data: this.options.data}, a);
  4787. this.remove(!1, null, !1);
  4788. for (k in p)this[k] = void 0;
  4789. l(this, n[m || g].prototype);
  4790. f(q, function (a) {
  4791. c[a] = q[a]
  4792. });
  4793. this.init(e, a);
  4794. e.linkSeries();
  4795. t(b, !0) && e.redraw(!1)
  4796. }
  4797. });
  4798. l(H.prototype, {
  4799. update: function (a, b) {
  4800. var c = this.chart;
  4801. a = c.options[this.coll][this.options.index] = C(this.userOptions, a);
  4802. this.destroy(!0);
  4803. this.init(c, l(a, {events: void 0}));
  4804. c.isDirtyBox = !0;
  4805. t(b, !0) && c.redraw()
  4806. }, remove: function (a) {
  4807. for (var b = this.chart, c = this.coll, e = this.series, d = e.length; d--;)e[d] && e[d].remove(!1);
  4808. u(b.axes, this);
  4809. u(b[c], this);
  4810. b.options[c].splice(this.options.index, 1);
  4811. f(b[c],
  4812. function (a, b) {
  4813. a.options.index = b
  4814. });
  4815. this.destroy();
  4816. b.isDirtyBox = !0;
  4817. t(a, !0) && b.redraw()
  4818. }, setTitle: function (a, b) {
  4819. this.update({title: a}, b)
  4820. }, setCategories: function (a, b) {
  4821. this.update({categories: a}, b)
  4822. }
  4823. })
  4824. })(L);
  4825. (function (a) {
  4826. var B = a.color, A = a.each, H = a.map, G = a.pick, r = a.Series, g = a.seriesType;
  4827. g("area", "line", {softThreshold: !1, threshold: 0}, {
  4828. singleStacks: !1, getStackPoints: function () {
  4829. var a = [], g = [], l = this.xAxis, q = this.yAxis, d = q.stacks[this.stackKey], b = {}, p = this.points, r = this.index, t = q.series, m = t.length, c, n = G(q.options.reversedStacks,
  4830. !0) ? 1 : -1, E, z;
  4831. if (this.options.stacking) {
  4832. for (E = 0; E < p.length; E++)b[p[E].x] = p[E];
  4833. for (z in d)null !== d[z].total && g.push(z);
  4834. g.sort(function (a, b) {
  4835. return a - b
  4836. });
  4837. c = H(t, function () {
  4838. return this.visible
  4839. });
  4840. A(g, function (e, f) {
  4841. var p = 0, t, h;
  4842. if (b[e] && !b[e].isNull)a.push(b[e]), A([-1, 1], function (a) {
  4843. var p = 1 === a ? "rightNull" : "leftNull", l = 0, q = d[g[f + a]];
  4844. if (q)for (E = r; 0 <= E && E < m;)t = q.points[E], t || (E === r ? b[e][p] = !0 : c[E] && (h = d[e].points[E]) && (l -= h[1] - h[0])), E += n;
  4845. b[e][1 === a ? "rightCliff" : "leftCliff"] = l
  4846. }); else {
  4847. for (E = r; 0 <= E && E < m;) {
  4848. if (t =
  4849. d[e].points[E]) {
  4850. p = t[1];
  4851. break
  4852. }
  4853. E += n
  4854. }
  4855. p = q.toPixels(p, !0);
  4856. a.push({isNull: !0, plotX: l.toPixels(e, !0), plotY: p, yBottom: p})
  4857. }
  4858. })
  4859. }
  4860. return a
  4861. }, getGraphPath: function (a) {
  4862. var f = r.prototype.getGraphPath, g = this.options, q = g.stacking, d = this.yAxis, b, p, C = [], t = [], m = this.index, c, n = d.stacks[this.stackKey], E = g.threshold, z = d.getThreshold(g.threshold), e, g = g.connectNulls || "percent" === q, x = function (b, e, f) {
  4863. var h = a[b];
  4864. b = q && n[h.x].points[m];
  4865. var g = h[f + "Null"] || 0;
  4866. f = h[f + "Cliff"] || 0;
  4867. var p, l, h = !0;
  4868. f || g ? (p = (g ? b[0] : b[1]) + f, l = b[0] + f, h = !!g) : !q &&
  4869. a[e] && a[e].isNull && (p = l = E);
  4870. void 0 !== p && (t.push({
  4871. plotX: c,
  4872. plotY: null === p ? z : d.getThreshold(p),
  4873. isNull: h
  4874. }), C.push({plotX: c, plotY: null === l ? z : d.getThreshold(l), doCurve: !1}))
  4875. };
  4876. a = a || this.points;
  4877. q && (a = this.getStackPoints());
  4878. for (b = 0; b < a.length; b++)if (p = a[b].isNull, c = G(a[b].rectPlotX, a[b].plotX), e = G(a[b].yBottom, z), !p || g)g || x(b, b - 1, "left"), p && !q && g || (t.push(a[b]), C.push({
  4879. x: b,
  4880. plotX: c,
  4881. plotY: e
  4882. })), g || x(b, b + 1, "right");
  4883. b = f.call(this, t, !0, !0);
  4884. C.reversed = !0;
  4885. p = f.call(this, C, !0, !0);
  4886. p.length && (p[0] = "L");
  4887. p = b.concat(p);
  4888. f =
  4889. f.call(this, t, !1, g);
  4890. p.xMap = b.xMap;
  4891. this.areaPath = p;
  4892. return f
  4893. }, drawGraph: function () {
  4894. this.areaPath = [];
  4895. r.prototype.drawGraph.apply(this);
  4896. var a = this, g = this.areaPath, l = this.options, q = [["area", "highcharts-area", this.color, l.fillColor]];
  4897. A(this.zones, function (d, b) {
  4898. q.push(["zone-area-" + b, "highcharts-area highcharts-zone-area-" + b + " " + d.className, d.color || a.color, d.fillColor || l.fillColor])
  4899. });
  4900. A(q, function (d) {
  4901. var b = d[0], f = a[b];
  4902. f ? (f.endX = g.xMap, f.animate({d: g})) : (f = a[b] = a.chart.renderer.path(g).addClass(d[1]).attr({
  4903. fill: G(d[3],
  4904. B(d[2]).setOpacity(G(l.fillOpacity, .75)).get()), zIndex: 0
  4905. }).add(a.group), f.isArea = !0);
  4906. f.startX = g.xMap;
  4907. f.shiftUnit = l.step ? 2 : 1
  4908. })
  4909. }, drawLegendSymbol: a.LegendSymbolMixin.drawRectangle
  4910. })
  4911. })(L);
  4912. (function (a) {
  4913. var B = a.pick;
  4914. a = a.seriesType;
  4915. a("spline", "line", {}, {
  4916. getPointSpline: function (a, H, G) {
  4917. var r = H.plotX, g = H.plotY, f = a[G - 1];
  4918. G = a[G + 1];
  4919. var u, l, q, d;
  4920. if (f && !f.isNull && !1 !== f.doCurve && G && !G.isNull && !1 !== G.doCurve) {
  4921. a = f.plotY;
  4922. q = G.plotX;
  4923. G = G.plotY;
  4924. var b = 0;
  4925. u = (1.5 * r + f.plotX) / 2.5;
  4926. l = (1.5 * g + a) / 2.5;
  4927. q = (1.5 * r + q) / 2.5;
  4928. d = (1.5 * g + G) / 2.5;
  4929. q !== u && (b = (d - l) * (q - r) / (q - u) + g - d);
  4930. l += b;
  4931. d += b;
  4932. l > a && l > g ? (l = Math.max(a, g), d = 2 * g - l) : l < a && l < g && (l = Math.min(a, g), d = 2 * g - l);
  4933. d > G && d > g ? (d = Math.max(G, g), l = 2 * g - d) : d < G && d < g && (d = Math.min(G, g), l = 2 * g - d);
  4934. H.rightContX = q;
  4935. H.rightContY = d
  4936. }
  4937. H = ["C", B(f.rightContX, f.plotX), B(f.rightContY, f.plotY), B(u, r), B(l, g), r, g];
  4938. f.rightContX = f.rightContY = null;
  4939. return H
  4940. }
  4941. })
  4942. })(L);
  4943. (function (a) {
  4944. var B = a.seriesTypes.area.prototype, A = a.seriesType;
  4945. A("areaspline", "spline", a.defaultPlotOptions.area, {
  4946. getStackPoints: B.getStackPoints,
  4947. getGraphPath: B.getGraphPath,
  4948. setStackCliffs: B.setStackCliffs,
  4949. drawGraph: B.drawGraph,
  4950. drawLegendSymbol: a.LegendSymbolMixin.drawRectangle
  4951. })
  4952. })(L);
  4953. (function (a) {
  4954. var B = a.animObject, A = a.color, H = a.each, G = a.extend, r = a.isNumber, g = a.merge, f = a.pick, u = a.Series, l = a.seriesType, q = a.svg;
  4955. l("column", "line", {
  4956. borderRadius: 0,
  4957. groupPadding: .2,
  4958. marker: null,
  4959. pointPadding: .1,
  4960. minPointLength: 0,
  4961. cropThreshold: 50,
  4962. pointRange: null,
  4963. states: {
  4964. hover: {halo: !1, brightness: .1, shadow: !1},
  4965. select: {color: "#cccccc", borderColor: "#000000", shadow: !1}
  4966. },
  4967. dataLabels: {
  4968. align: null, verticalAlign: null,
  4969. y: null
  4970. },
  4971. softThreshold: !1,
  4972. startFromThreshold: !0,
  4973. stickyTracking: !1,
  4974. tooltip: {distance: 6},
  4975. threshold: 0,
  4976. borderColor: "#ffffff"
  4977. }, {
  4978. cropShoulder: 0,
  4979. directTouch: !0,
  4980. trackerGroups: ["group", "dataLabelsGroup"],
  4981. negStacks: !0,
  4982. init: function () {
  4983. u.prototype.init.apply(this, arguments);
  4984. var a = this, b = a.chart;
  4985. b.hasRendered && H(b.series, function (b) {
  4986. b.type === a.type && (b.isDirty = !0)
  4987. })
  4988. },
  4989. getColumnMetrics: function () {
  4990. var a = this, b = a.options, g = a.xAxis, l = a.yAxis, t = g.reversed, m, c = {}, n = 0;
  4991. !1 === b.grouping ? n = 1 : H(a.chart.series, function (b) {
  4992. var e =
  4993. b.options, d = b.yAxis, f;
  4994. b.type === a.type && b.visible && l.len === d.len && l.pos === d.pos && (e.stacking ? (m = b.stackKey, void 0 === c[m] && (c[m] = n++), f = c[m]) : !1 !== e.grouping && (f = n++), b.columnIndex = f)
  4995. });
  4996. var q = Math.min(Math.abs(g.transA) * (g.ordinalSlope || b.pointRange || g.closestPointRange || g.tickInterval || 1), g.len), r = q * b.groupPadding, e = (q - 2 * r) / (n || 1), b = Math.min(b.maxPointWidth || g.len, f(b.pointWidth, e * (1 - 2 * b.pointPadding)));
  4997. a.columnMetrics = {
  4998. width: b,
  4999. offset: (e - b) / 2 + (r + ((a.columnIndex || 0) + (t ? 1 : 0)) * e - q / 2) * (t ? -1 : 1)
  5000. };
  5001. return a.columnMetrics
  5002. },
  5003. crispCol: function (a, b, f, g) {
  5004. var d = this.chart, m = this.borderWidth, c = -(m % 2 ? .5 : 0), m = m % 2 ? .5 : 1;
  5005. d.inverted && d.renderer.isVML && (m += 1);
  5006. f = Math.round(a + f) + c;
  5007. a = Math.round(a) + c;
  5008. g = Math.round(b + g) + m;
  5009. c = .5 >= Math.abs(b) && .5 < g;
  5010. b = Math.round(b) + m;
  5011. g -= b;
  5012. c && g && (--b, g += 1);
  5013. return {x: a, y: b, width: f - a, height: g}
  5014. },
  5015. translate: function () {
  5016. var a = this, b = a.chart, g = a.options, l = a.dense = 2 > a.closestPointRange * a.xAxis.transA, l = a.borderWidth = f(g.borderWidth, l ? 0 : 1), t = a.yAxis, m = a.translatedThreshold = t.getThreshold(g.threshold), c = f(g.minPointLength,
  5017. 5), n = a.getColumnMetrics(), q = n.width, r = a.barW = Math.max(q, 1 + 2 * l), e = a.pointXOffset = n.offset;
  5018. b.inverted && (m -= .5);
  5019. g.pointPadding && (r = Math.ceil(r));
  5020. u.prototype.translate.apply(a);
  5021. H(a.points, function (d) {
  5022. var g = f(d.yBottom, m), n = 999 + Math.abs(g), n = Math.min(Math.max(-n, d.plotY), t.len + n), h = d.plotX + e, l = r, p = Math.min(n, g), z, x = Math.max(n, g) - p;
  5023. Math.abs(x) < c && c && (x = c, z = !t.reversed && !d.negative || t.reversed && d.negative, p = Math.abs(p - m) > c ? g - c : m - (z ? c : 0));
  5024. d.barX = h;
  5025. d.pointWidth = q;
  5026. d.tooltipPos = b.inverted ? [t.len + t.pos - b.plotLeft -
  5027. n, a.xAxis.len - h - l / 2, x] : [h + l / 2, n + t.pos - b.plotTop, x];
  5028. d.shapeType = "rect";
  5029. d.shapeArgs = a.crispCol.apply(a, d.isNull ? [d.plotX, t.len / 2, 0, 0] : [h, p, l, x])
  5030. })
  5031. },
  5032. getSymbol: a.noop,
  5033. drawLegendSymbol: a.LegendSymbolMixin.drawRectangle,
  5034. drawGraph: function () {
  5035. this.group[this.dense ? "addClass" : "removeClass"]("highcharts-dense-data")
  5036. },
  5037. pointAttribs: function (a, b) {
  5038. var d = this.options, f, g = this.pointAttrToOptions || {};
  5039. f = g.stroke || "borderColor";
  5040. var m = g["stroke-width"] || "borderWidth", c = a && a.color || this.color, n = a[f] || d[f] || this.color ||
  5041. c, l = a[m] || d[m] || this[m] || 0, g = d.dashStyle;
  5042. a && this.zones.length && (c = (c = a.getZone()) && c.color || a.options.color || this.color);
  5043. b && (a = d.states[b], b = a.brightness, c = a.color || void 0 !== b && A(c).brighten(a.brightness).get() || c, n = a[f] || n, l = a[m] || l, g = a.dashStyle || g);
  5044. f = {fill: c, stroke: n, "stroke-width": l};
  5045. d.borderRadius && (f.r = d.borderRadius);
  5046. g && (f.dashstyle = g);
  5047. return f
  5048. },
  5049. drawPoints: function () {
  5050. var a = this, b = this.chart, f = a.options, l = b.renderer, t = f.animationLimit || 250, m;
  5051. H(a.points, function (c) {
  5052. var d = c.graphic;
  5053. if (r(c.plotY) &&
  5054. null !== c.y) {
  5055. m = c.shapeArgs;
  5056. if (d)d[b.pointCount < t ? "animate" : "attr"](g(m)); else c.graphic = d = l[c.shapeType](m).attr({"class": c.getClassName()}).add(c.group || a.group);
  5057. d.attr(a.pointAttribs(c, c.selected && "select")).shadow(f.shadow, null, f.stacking && !f.borderRadius)
  5058. } else d && (c.graphic = d.destroy())
  5059. })
  5060. },
  5061. animate: function (a) {
  5062. var b = this, d = this.yAxis, f = b.options, g = this.chart.inverted, m = {};
  5063. q && (a ? (m.scaleY = .001, a = Math.min(d.pos + d.len, Math.max(d.pos, d.toPixels(f.threshold))), g ? m.translateX = a - d.len : m.translateY = a, b.group.attr(m)) :
  5064. (m[g ? "translateX" : "translateY"] = d.pos, b.group.animate(m, G(B(b.options.animation), {
  5065. step: function (a, d) {
  5066. b.group.attr({scaleY: Math.max(.001, d.pos)})
  5067. }
  5068. })), b.animate = null))
  5069. },
  5070. remove: function () {
  5071. var a = this, b = a.chart;
  5072. b.hasRendered && H(b.series, function (b) {
  5073. b.type === a.type && (b.isDirty = !0)
  5074. });
  5075. u.prototype.remove.apply(a, arguments)
  5076. }
  5077. })
  5078. })(L);
  5079. (function (a) {
  5080. a = a.seriesType;
  5081. a("bar", "column", null, {inverted: !0})
  5082. })(L);
  5083. (function (a) {
  5084. var B = a.Series;
  5085. a = a.seriesType;
  5086. a("scatter", "line", {
  5087. lineWidth: 0, marker: {enabled: !0}, tooltip: {
  5088. headerFormat: '\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e \x3cspan style\x3d"font-size: 0.85em"\x3e {series.name}\x3c/span\x3e\x3cbr/\x3e',
  5089. pointFormat: "x: \x3cb\x3e{point.x}\x3c/b\x3e\x3cbr/\x3ey: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3e"
  5090. }
  5091. }, {
  5092. sorted: !1,
  5093. requireSorting: !1,
  5094. noSharedTooltip: !0,
  5095. trackerGroups: ["group", "markerGroup", "dataLabelsGroup"],
  5096. takeOrdinalPosition: !1,
  5097. kdDimensions: 2,
  5098. drawGraph: function () {
  5099. this.options.lineWidth && B.prototype.drawGraph.call(this)
  5100. }
  5101. })
  5102. })(L);
  5103. (function (a) {
  5104. var B = a.pick, A = a.relativeLength;
  5105. a.CenteredSeriesMixin = {
  5106. getCenter: function () {
  5107. var a = this.options, G = this.chart, r = 2 * (a.slicedOffset || 0), g = G.plotWidth - 2 * r, G = G.plotHeight -
  5108. 2 * r, f = a.center, f = [B(f[0], "50%"), B(f[1], "50%"), a.size || "100%", a.innerSize || 0], u = Math.min(g, G), l, q;
  5109. for (l = 0; 4 > l; ++l)q = f[l], a = 2 > l || 2 === l && /%$/.test(q), f[l] = A(q, [g, G, u, f[2]][l]) + (a ? r : 0);
  5110. f[3] > f[2] && (f[3] = f[2]);
  5111. return f
  5112. }
  5113. }
  5114. })(L);
  5115. (function (a) {
  5116. var B = a.addEvent, A = a.defined, H = a.each, G = a.extend, r = a.inArray, g = a.noop, f = a.pick, u = a.Point, l = a.Series, q = a.seriesType, d = a.setAnimation;
  5117. q("pie", "line", {
  5118. center: [null, null],
  5119. clip: !1,
  5120. colorByPoint: !0,
  5121. dataLabels: {
  5122. distance: 30, enabled: !0, formatter: function () {
  5123. return null === this.y ?
  5124. void 0 : this.point.name
  5125. }, x: 0
  5126. },
  5127. ignoreHiddenPoint: !0,
  5128. legendType: "point",
  5129. marker: null,
  5130. size: null,
  5131. showInLegend: !1,
  5132. slicedOffset: 10,
  5133. stickyTracking: !1,
  5134. tooltip: {followPointer: !0},
  5135. borderColor: "#ffffff",
  5136. borderWidth: 1,
  5137. states: {hover: {brightness: .1, shadow: !1}}
  5138. }, {
  5139. isCartesian: !1,
  5140. requireSorting: !1,
  5141. directTouch: !0,
  5142. noSharedTooltip: !0,
  5143. trackerGroups: ["group", "dataLabelsGroup"],
  5144. axisTypes: [],
  5145. pointAttribs: a.seriesTypes.column.prototype.pointAttribs,
  5146. animate: function (a) {
  5147. var b = this, d = b.points, f = b.startAngleRad;
  5148. a || (H(d, function (a) {
  5149. var c =
  5150. a.graphic, d = a.shapeArgs;
  5151. c && (c.attr({r: a.startR || b.center[3] / 2, start: f, end: f}), c.animate({
  5152. r: d.r,
  5153. start: d.start,
  5154. end: d.end
  5155. }, b.options.animation))
  5156. }), b.animate = null)
  5157. },
  5158. updateTotals: function () {
  5159. var a, d = 0, f = this.points, g = f.length, m, c = this.options.ignoreHiddenPoint;
  5160. for (a = 0; a < g; a++)m = f[a], 0 > m.y && (m.y = null), d += c && !m.visible ? 0 : m.y;
  5161. this.total = d;
  5162. for (a = 0; a < g; a++)m = f[a], m.percentage = 0 < d && (m.visible || !c) ? m.y / d * 100 : 0, m.total = d
  5163. },
  5164. generatePoints: function () {
  5165. l.prototype.generatePoints.call(this);
  5166. this.updateTotals()
  5167. },
  5168. translate: function (a) {
  5169. this.generatePoints();
  5170. var b = 0, d = this.options, g = d.slicedOffset, m = g + (d.borderWidth || 0), c, n, l, q = d.startAngle || 0, e = this.startAngleRad = Math.PI / 180 * (q - 90), q = (this.endAngleRad = Math.PI / 180 * (f(d.endAngle, q + 360) - 90)) - e, r = this.points, u = d.dataLabels.distance, d = d.ignoreHiddenPoint, w, h = r.length, y;
  5171. a || (this.center = a = this.getCenter());
  5172. this.getX = function (b, c) {
  5173. l = Math.asin(Math.min((b - a[1]) / (a[2] / 2 + u), 1));
  5174. return a[0] + (c ? -1 : 1) * Math.cos(l) * (a[2] / 2 + u)
  5175. };
  5176. for (w = 0; w < h; w++) {
  5177. y = r[w];
  5178. c = e + b * q;
  5179. if (!d || y.visible)b += y.percentage / 100;
  5180. n = e + b * q;
  5181. y.shapeType =
  5182. "arc";
  5183. y.shapeArgs = {
  5184. x: a[0],
  5185. y: a[1],
  5186. r: a[2] / 2,
  5187. innerR: a[3] / 2,
  5188. start: Math.round(1E3 * c) / 1E3,
  5189. end: Math.round(1E3 * n) / 1E3
  5190. };
  5191. l = (n + c) / 2;
  5192. l > 1.5 * Math.PI ? l -= 2 * Math.PI : l < -Math.PI / 2 && (l += 2 * Math.PI);
  5193. y.slicedTranslation = {
  5194. translateX: Math.round(Math.cos(l) * g),
  5195. translateY: Math.round(Math.sin(l) * g)
  5196. };
  5197. c = Math.cos(l) * a[2] / 2;
  5198. n = Math.sin(l) * a[2] / 2;
  5199. y.tooltipPos = [a[0] + .7 * c, a[1] + .7 * n];
  5200. y.half = l < -Math.PI / 2 || l > Math.PI / 2 ? 1 : 0;
  5201. y.angle = l;
  5202. m = Math.min(m, u / 5);
  5203. y.labelPos = [a[0] + c + Math.cos(l) * u, a[1] + n + Math.sin(l) * u, a[0] + c + Math.cos(l) * m, a[1] + n + Math.sin(l) *
  5204. m, a[0] + c, a[1] + n, 0 > u ? "center" : y.half ? "right" : "left", l]
  5205. }
  5206. },
  5207. drawGraph: null,
  5208. drawPoints: function () {
  5209. var a = this, d = a.chart.renderer, f, g, m, c, n = a.options.shadow;
  5210. n && !a.shadowGroup && (a.shadowGroup = d.g("shadow").add(a.group));
  5211. H(a.points, function (b) {
  5212. if (null !== b.y) {
  5213. g = b.graphic;
  5214. c = b.shapeArgs;
  5215. f = b.sliced ? b.slicedTranslation : {};
  5216. var l = b.shadowGroup;
  5217. n && !l && (l = b.shadowGroup = d.g("shadow").add(a.shadowGroup));
  5218. l && l.attr(f);
  5219. m = a.pointAttribs(b, b.selected && "select");
  5220. g ? g.setRadialReference(a.center).attr(m).animate(G(c, f)) : (b.graphic =
  5221. g = d[b.shapeType](c).addClass(b.getClassName()).setRadialReference(a.center).attr(f).add(a.group), b.visible || g.attr({visibility: "hidden"}), g.attr(m).attr({"stroke-linejoin": "round"}).shadow(n, l))
  5222. }
  5223. })
  5224. },
  5225. searchPoint: g,
  5226. sortByAngle: function (a, d) {
  5227. a.sort(function (a, b) {
  5228. return void 0 !== a.angle && (b.angle - a.angle) * d
  5229. })
  5230. },
  5231. drawLegendSymbol: a.LegendSymbolMixin.drawRectangle,
  5232. getCenter: a.CenteredSeriesMixin.getCenter,
  5233. getSymbol: g
  5234. }, {
  5235. init: function () {
  5236. u.prototype.init.apply(this, arguments);
  5237. var a = this, d;
  5238. a.name = f(a.name, "Slice");
  5239. d = function (b) {
  5240. a.slice("select" === b.type)
  5241. };
  5242. B(a, "select", d);
  5243. B(a, "unselect", d);
  5244. return a
  5245. }, setVisible: function (a, d) {
  5246. var b = this, g = b.series, m = g.chart, c = g.options.ignoreHiddenPoint;
  5247. d = f(d, c);
  5248. a !== b.visible && (b.visible = b.options.visible = a = void 0 === a ? !b.visible : a, g.options.data[r(b, g.data)] = b.options, H(["graphic", "dataLabel", "connector", "shadowGroup"], function (c) {
  5249. if (b[c])b[c][a ? "show" : "hide"](!0)
  5250. }), b.legendItem && m.legend.colorizeItem(b, a), a || "hover" !== b.state || b.setState(""), c && (g.isDirty = !0), d && m.redraw())
  5251. },
  5252. slice: function (a, g, l) {
  5253. var b = this.series;
  5254. d(l, b.chart);
  5255. f(g, !0);
  5256. this.sliced = this.options.sliced = a = A(a) ? a : !this.sliced;
  5257. b.options.data[r(this, b.data)] = this.options;
  5258. a = a ? this.slicedTranslation : {translateX: 0, translateY: 0};
  5259. this.graphic.animate(a);
  5260. this.shadowGroup && this.shadowGroup.animate(a)
  5261. }, haloPath: function (a) {
  5262. var b = this.shapeArgs;
  5263. return this.sliced || !this.visible ? [] : this.series.chart.renderer.symbols.arc(b.x, b.y, b.r + a, b.r + a, {
  5264. innerR: this.shapeArgs.r,
  5265. start: b.start,
  5266. end: b.end
  5267. })
  5268. }
  5269. })
  5270. })(L);
  5271. (function (a) {
  5272. var B =
  5273. a.addEvent, A = a.arrayMax, H = a.defined, G = a.each, r = a.extend, g = a.format, f = a.map, u = a.merge, l = a.noop, q = a.pick, d = a.relativeLength, b = a.Series, p = a.seriesTypes, C = a.stableSort;
  5274. a.distribute = function (a, b) {
  5275. function c(a, b) {
  5276. return a.target - b.target
  5277. }
  5278. var d, g = !0, m = a, e = [], l;
  5279. l = 0;
  5280. for (d = a.length; d--;)l += a[d].size;
  5281. if (l > b) {
  5282. C(a, function (a, b) {
  5283. return (b.rank || 0) - (a.rank || 0)
  5284. });
  5285. for (l = d = 0; l <= b;)l += a[d].size, d++;
  5286. e = a.splice(d - 1, a.length)
  5287. }
  5288. C(a, c);
  5289. for (a = f(a, function (a) {
  5290. return {size: a.size, targets: [a.target]}
  5291. }); g;) {
  5292. for (d = a.length; d--;)g =
  5293. a[d], l = (Math.min.apply(0, g.targets) + Math.max.apply(0, g.targets)) / 2, g.pos = Math.min(Math.max(0, l - g.size / 2), b - g.size);
  5294. d = a.length;
  5295. for (g = !1; d--;)0 < d && a[d - 1].pos + a[d - 1].size > a[d].pos && (a[d - 1].size += a[d].size, a[d - 1].targets = a[d - 1].targets.concat(a[d].targets), a[d - 1].pos + a[d - 1].size > b && (a[d - 1].pos = b - a[d - 1].size), a.splice(d, 1), g = !0)
  5296. }
  5297. d = 0;
  5298. G(a, function (a) {
  5299. var b = 0;
  5300. G(a.targets, function () {
  5301. m[d].pos = a.pos + b;
  5302. b += m[d].size;
  5303. d++
  5304. })
  5305. });
  5306. m.push.apply(m, e);
  5307. C(m, c)
  5308. };
  5309. b.prototype.drawDataLabels = function () {
  5310. var a = this, b = a.options,
  5311. c = b.dataLabels, d = a.points, f, l, e = a.hasRendered || 0, p, r, w = q(c.defer, !0), h = a.chart.renderer;
  5312. if (c.enabled || a._hasPointLabels)a.dlProcessOptions && a.dlProcessOptions(c), r = a.plotGroup("dataLabelsGroup", "data-labels", w && !e ? "hidden" : "visible", c.zIndex || 6), w && (r.attr({opacity: +e}), e || B(a, "afterAnimate", function () {
  5313. a.visible && r.show(!0);
  5314. r[b.animation ? "animate" : "attr"]({opacity: 1}, {duration: 200})
  5315. })), l = c, G(d, function (e) {
  5316. var d, m = e.dataLabel, n, k, t, z = e.connector, w = !m, x;
  5317. f = e.dlOptions || e.options && e.options.dataLabels;
  5318. if (d = q(f && f.enabled, l.enabled) && null !== e.y)for (k in c = u(l, f), n = e.getLabelConfig(), p = c.format ? g(c.format, n) : c.formatter.call(n, c), x = c.style, t = c.rotation, x.color = q(c.color, x.color, a.color, "#000000"), "contrast" === x.color && (x.color = c.inside || 0 > c.distance || b.stacking ? h.getContrast(e.color || a.color) : "#000000"), b.cursor && (x.cursor = b.cursor), n = {
  5319. fill: c.backgroundColor,
  5320. stroke: c.borderColor,
  5321. "stroke-width": c.borderWidth,
  5322. r: c.borderRadius || 0,
  5323. rotation: t,
  5324. padding: c.padding,
  5325. zIndex: 1
  5326. }, n)void 0 === n[k] && delete n[k];
  5327. !m ||
  5328. d && H(p) ? d && H(p) && (m ? n.text = p : (m = e.dataLabel = h[t ? "text" : "label"](p, 0, -9999, c.shape, null, null, c.useHTML, null, "data-label"), m.addClass("highcharts-data-label-color-" + e.colorIndex + " " + (c.className || "") + (c.useHTML ? "highcharts-tracker" : ""))), m.attr(n), m.css(x).shadow(c.shadow), m.added || m.add(r), a.alignDataLabel(e, m, c, null, w)) : (e.dataLabel = m.destroy(), z && (e.connector = z.destroy()))
  5329. })
  5330. };
  5331. b.prototype.alignDataLabel = function (a, b, c, d, f) {
  5332. var g = this.chart, e = g.inverted, m = q(a.plotX, -9999), n = q(a.plotY, -9999), l = b.getBBox(),
  5333. h, p = c.rotation, t = c.align, u = this.visible && (a.series.forceDL || g.isInsidePlot(m, Math.round(n), e) || d && g.isInsidePlot(m, e ? d.x + 1 : d.y + d.height - 1, e)), E = "justify" === q(c.overflow, "justify");
  5334. u && (h = c.style.fontSize, h = g.renderer.fontMetrics(h, b).b, d = r({
  5335. x: e ? g.plotWidth - n : m,
  5336. y: Math.round(e ? g.plotHeight - m : n),
  5337. width: 0,
  5338. height: 0
  5339. }, d), r(c, {
  5340. width: l.width,
  5341. height: l.height
  5342. }), p ? (E = !1, e = g.renderer.rotCorr(h, p), e = {
  5343. x: d.x + c.x + d.width / 2 + e.x,
  5344. y: d.y + c.y + {top: 0, middle: .5, bottom: 1}[c.verticalAlign] * d.height
  5345. }, b[f ? "attr" : "animate"](e).attr({align: t}),
  5346. m = (p + 720) % 360, m = 180 < m && 360 > m, "left" === t ? e.y -= m ? l.height : 0 : "center" === t ? (e.x -= l.width / 2, e.y -= l.height / 2) : "right" === t && (e.x -= l.width, e.y -= m ? 0 : l.height)) : (b.align(c, null, d), e = b.alignAttr), E ? this.justifyDataLabel(b, c, e, l, d, f) : q(c.crop, !0) && (u = g.isInsidePlot(e.x, e.y) && g.isInsidePlot(e.x + l.width, e.y + l.height)), c.shape && !p && b.attr({
  5347. anchorX: a.plotX,
  5348. anchorY: a.plotY
  5349. }));
  5350. u || (b.attr({y: -9999}), b.placed = !1)
  5351. };
  5352. b.prototype.justifyDataLabel = function (a, b, c, d, f, g) {
  5353. var e = this.chart, m = b.align, n = b.verticalAlign, l, h, p = a.box ?
  5354. 0 : a.padding || 0;
  5355. l = c.x + p;
  5356. 0 > l && ("right" === m ? b.align = "left" : b.x = -l, h = !0);
  5357. l = c.x + d.width - p;
  5358. l > e.plotWidth && ("left" === m ? b.align = "right" : b.x = e.plotWidth - l, h = !0);
  5359. l = c.y + p;
  5360. 0 > l && ("bottom" === n ? b.verticalAlign = "top" : b.y = -l, h = !0);
  5361. l = c.y + d.height - p;
  5362. l > e.plotHeight && ("top" === n ? b.verticalAlign = "bottom" : b.y = e.plotHeight - l, h = !0);
  5363. h && (a.placed = !g, a.align(b, null, f))
  5364. };
  5365. p.pie && (p.pie.prototype.drawDataLabels = function () {
  5366. var d = this, g = d.data, c, l = d.chart, p = d.options.dataLabels, r = q(p.connectorPadding, 10), e = q(p.connectorWidth, 1), u =
  5367. l.plotWidth, F = l.plotHeight, w, h = p.distance, y = d.center, C = y[2] / 2, B = y[1], H = 0 < h, k, D, L, N, S = [[], []], O, v, M, Q, R = [0, 0, 0, 0];
  5368. d.visible && (p.enabled || d._hasPointLabels) && (b.prototype.drawDataLabels.apply(d), G(g, function (a) {
  5369. a.dataLabel && a.visible && (S[a.half].push(a), a.dataLabel._pos = null)
  5370. }), G(S, function (b, e) {
  5371. var g, m, n = b.length, q, t, z;
  5372. if (n)for (d.sortByAngle(b, e - .5), 0 < h && (g = Math.max(0, B - C - h), m = Math.min(B + C + h, l.plotHeight), q = f(b, function (a) {
  5373. if (a.dataLabel)return z = a.dataLabel.getBBox().height || 21, {
  5374. target: a.labelPos[1] -
  5375. g + z / 2, size: z, rank: a.y
  5376. }
  5377. }), a.distribute(q, m + z - g)), Q = 0; Q < n; Q++)c = b[Q], L = c.labelPos, k = c.dataLabel, M = !1 === c.visible ? "hidden" : "inherit", t = L[1], q ? void 0 === q[Q].pos ? M = "hidden" : (N = q[Q].size, v = g + q[Q].pos) : v = t, O = p.justify ? y[0] + (e ? -1 : 1) * (C + h) : d.getX(v < g + 2 || v > m - 2 ? t : v, e), k._attr = {
  5378. visibility: M,
  5379. align: L[6]
  5380. }, k._pos = {
  5381. x: O + p.x + ({left: r, right: -r}[L[6]] || 0),
  5382. y: v + p.y - 10
  5383. }, L.x = O, L.y = v, null === d.options.size && (D = k.width, O - D < r ? R[3] = Math.max(Math.round(D - O + r), R[3]) : O + D > u - r && (R[1] = Math.max(Math.round(O + D - u + r), R[1])), 0 > v - N / 2 ? R[0] =
  5384. Math.max(Math.round(-v + N / 2), R[0]) : v + N / 2 > F && (R[2] = Math.max(Math.round(v + N / 2 - F), R[2])))
  5385. }), 0 === A(R) || this.verifyDataLabelOverflow(R)) && (this.placeDataLabels(), H && e && G(this.points, function (a) {
  5386. var b;
  5387. w = a.connector;
  5388. if ((k = a.dataLabel) && k._pos && a.visible) {
  5389. M = k._attr.visibility;
  5390. if (b = !w)a.connector = w = l.renderer.path().addClass("highcharts-data-label-connector highcharts-color-" + a.colorIndex).add(d.dataLabelsGroup), w.attr({
  5391. "stroke-width": e,
  5392. stroke: p.connectorColor || a.color || "#666666"
  5393. });
  5394. w[b ? "attr" : "animate"]({d: d.connectorPath(a.labelPos)});
  5395. w.attr("visibility", M)
  5396. } else w && (a.connector = w.destroy())
  5397. }))
  5398. }, p.pie.prototype.connectorPath = function (a) {
  5399. var b = a.x, c = a.y;
  5400. return q(this.options.dataLabels.softConnector, !0) ? ["M", b + ("left" === a[6] ? 5 : -5), c, "C", b, c, 2 * a[2] - a[4], 2 * a[3] - a[5], a[2], a[3], "L", a[4], a[5]] : ["M", b + ("left" === a[6] ? 5 : -5), c, "L", a[2], a[3], "L", a[4], a[5]]
  5401. }, p.pie.prototype.placeDataLabels = function () {
  5402. G(this.points, function (a) {
  5403. var b = a.dataLabel;
  5404. b && a.visible && ((a = b._pos) ? (b.attr(b._attr), b[b.moved ? "animate" : "attr"](a), b.moved = !0) : b && b.attr({y: -9999}))
  5405. })
  5406. },
  5407. p.pie.prototype.alignDataLabel = l, p.pie.prototype.verifyDataLabelOverflow = function (a) {
  5408. var b = this.center, c = this.options, f = c.center, g = c.minSize || 80, l, e;
  5409. null !== f[0] ? l = Math.max(b[2] - Math.max(a[1], a[3]), g) : (l = Math.max(b[2] - a[1] - a[3], g), b[0] += (a[3] - a[1]) / 2);
  5410. null !== f[1] ? l = Math.max(Math.min(l, b[2] - Math.max(a[0], a[2])), g) : (l = Math.max(Math.min(l, b[2] - a[0] - a[2]), g), b[1] += (a[0] - a[2]) / 2);
  5411. l < b[2] ? (b[2] = l, b[3] = Math.min(d(c.innerSize || 0, l), l), this.translate(b), this.drawDataLabels && this.drawDataLabels()) : e = !0;
  5412. return e
  5413. });
  5414. p.column && (p.column.prototype.alignDataLabel = function (a, d, c, f, g) {
  5415. var l = this.chart.inverted, e = a.series, m = a.dlBox || a.shapeArgs, n = q(a.below, a.plotY > q(this.translatedThreshold, e.yAxis.len)), p = q(c.inside, !!this.options.stacking);
  5416. m && (f = u(m), 0 > f.y && (f.height += f.y, f.y = 0), m = f.y + f.height - e.yAxis.len, 0 < m && (f.height -= m), l && (f = {
  5417. x: e.yAxis.len - f.y - f.height,
  5418. y: e.xAxis.len - f.x - f.width,
  5419. width: f.height,
  5420. height: f.width
  5421. }), p || (l ? (f.x += n ? 0 : f.width, f.width = 0) : (f.y += n ? f.height : 0, f.height = 0)));
  5422. c.align = q(c.align, !l || p ? "center" :
  5423. n ? "right" : "left");
  5424. c.verticalAlign = q(c.verticalAlign, l || p ? "middle" : n ? "top" : "bottom");
  5425. b.prototype.alignDataLabel.call(this, a, d, c, f, g)
  5426. })
  5427. })(L);
  5428. (function (a) {
  5429. var B = a.Chart, A = a.each, H = a.pick, G = a.addEvent;
  5430. B.prototype.callbacks.push(function (a) {
  5431. function g() {
  5432. var f = [];
  5433. A(a.series, function (a) {
  5434. var g = a.options.dataLabels, q = a.dataLabelCollections || ["dataLabel"];
  5435. (g.enabled || a._hasPointLabels) && !g.allowOverlap && a.visible && A(q, function (d) {
  5436. A(a.points, function (a) {
  5437. a[d] && (a[d].labelrank = H(a.labelrank, a.shapeArgs && a.shapeArgs.height),
  5438. f.push(a[d]))
  5439. })
  5440. })
  5441. });
  5442. a.hideOverlappingLabels(f)
  5443. }
  5444. g();
  5445. G(a, "redraw", g)
  5446. });
  5447. B.prototype.hideOverlappingLabels = function (a) {
  5448. var g = a.length, f, r, l, q, d, b, p, C, t, m = function (a, b, d, f, e, g, l, m) {
  5449. return !(e > a + d || e + l < a || g > b + f || g + m < b)
  5450. };
  5451. for (r = 0; r < g; r++)if (f = a[r])f.oldOpacity = f.opacity, f.newOpacity = 1;
  5452. a.sort(function (a, b) {
  5453. return (b.labelrank || 0) - (a.labelrank || 0)
  5454. });
  5455. for (r = 0; r < g; r++)for (l = a[r], f = r + 1; f < g; ++f)if (q = a[f], l && q && l.placed && q.placed && 0 !== l.newOpacity && 0 !== q.newOpacity && (d = l.alignAttr, b = q.alignAttr, p = l.parentGroup, C = q.parentGroup,
  5456. t = 2 * (l.box ? 0 : l.padding), d = m(d.x + p.translateX, d.y + p.translateY, l.width - t, l.height - t, b.x + C.translateX, b.y + C.translateY, q.width - t, q.height - t)))(l.labelrank < q.labelrank ? l : q).newOpacity = 0;
  5457. A(a, function (a) {
  5458. var b, c;
  5459. a && (c = a.newOpacity, a.oldOpacity !== c && a.placed && (c ? a.show(!0) : b = function () {
  5460. a.hide()
  5461. }, a.alignAttr.opacity = c, a[a.isOld ? "animate" : "attr"](a.alignAttr, null, b)), a.isOld = !0)
  5462. })
  5463. }
  5464. })(L);
  5465. (function (a) {
  5466. var B = a.addEvent, A = a.Chart, H = a.createElement, G = a.css, r = a.defaultOptions, g = a.defaultPlotOptions, f = a.each, u =
  5467. a.extend, l = a.fireEvent, q = a.hasTouch, d = a.inArray, b = a.isObject, p = a.Legend, C = a.merge, t = a.pick, m = a.Point, c = a.Series, n = a.seriesTypes, E = a.svg;
  5468. a = a.TrackerMixin = {
  5469. drawTrackerPoint: function () {
  5470. var a = this, b = a.chart, c = b.pointer, d = function (a) {
  5471. for (var c = a.target, e; c && !e;)e = c.point, c = c.parentNode;
  5472. if (void 0 !== e && e !== b.hoverPoint)e.onMouseOver(a)
  5473. };
  5474. f(a.points, function (a) {
  5475. a.graphic && (a.graphic.element.point = a);
  5476. a.dataLabel && (a.dataLabel.div ? a.dataLabel.div.point = a : a.dataLabel.element.point = a)
  5477. });
  5478. a._hasTracking || (f(a.trackerGroups,
  5479. function (b) {
  5480. if (a[b]) {
  5481. a[b].addClass("highcharts-tracker").on("mouseover", d).on("mouseout", function (a) {
  5482. c.onTrackerMouseOut(a)
  5483. });
  5484. if (q)a[b].on("touchstart", d);
  5485. a.options.cursor && a[b].css(G).css({cursor: a.options.cursor})
  5486. }
  5487. }), a._hasTracking = !0)
  5488. }, drawTrackerGraph: function () {
  5489. var a = this, b = a.options, c = b.trackByArea, d = [].concat(c ? a.areaPath : a.graphPath), g = d.length, h = a.chart, l = h.pointer, m = h.renderer, n = h.options.tooltip.snap, p = a.tracker, k, r = function () {
  5490. if (h.hoverSeries !== a)a.onMouseOver()
  5491. }, t = "rgba(192,192,192," +
  5492. (E ? .0001 : .002) + ")";
  5493. if (g && !c)for (k = g + 1; k--;)"M" === d[k] && d.splice(k + 1, 0, d[k + 1] - n, d[k + 2], "L"), (k && "M" === d[k] || k === g) && d.splice(k, 0, "L", d[k - 2] + n, d[k - 1]);
  5494. p ? p.attr({d: d}) : a.graph && (a.tracker = m.path(d).attr({
  5495. "stroke-linejoin": "round",
  5496. visibility: a.visible ? "visible" : "hidden",
  5497. stroke: t,
  5498. fill: c ? t : "none",
  5499. "stroke-width": a.graph.strokeWidth() + (c ? 0 : 2 * n),
  5500. zIndex: 2
  5501. }).add(a.group), f([a.tracker, a.markerGroup], function (a) {
  5502. a.addClass("highcharts-tracker").on("mouseover", r).on("mouseout", function (a) {
  5503. l.onTrackerMouseOut(a)
  5504. });
  5505. b.cursor && a.css({cursor: b.cursor});
  5506. if (q)a.on("touchstart", r)
  5507. }))
  5508. }
  5509. };
  5510. n.column && (n.column.prototype.drawTracker = a.drawTrackerPoint);
  5511. n.pie && (n.pie.prototype.drawTracker = a.drawTrackerPoint);
  5512. n.scatter && (n.scatter.prototype.drawTracker = a.drawTrackerPoint);
  5513. u(p.prototype, {
  5514. setItemEvents: function (a, b, c) {
  5515. var e = this, d = e.chart, f = "highcharts-legend-" + (a.series ? "point" : "series") + "-active";
  5516. (c ? b : a.legendGroup).on("mouseover", function () {
  5517. a.setState("hover");
  5518. d.seriesGroup.addClass(f);
  5519. b.css(e.options.itemHoverStyle)
  5520. }).on("mouseout",
  5521. function () {
  5522. b.css(a.visible ? e.itemStyle : e.itemHiddenStyle);
  5523. d.seriesGroup.removeClass(f);
  5524. a.setState()
  5525. }).on("click", function (b) {
  5526. var c = function () {
  5527. a.setVisible && a.setVisible()
  5528. };
  5529. b = {browserEvent: b};
  5530. a.firePointEvent ? a.firePointEvent("legendItemClick", b, c) : l(a, "legendItemClick", b, c)
  5531. })
  5532. }, createCheckboxForItem: function (a) {
  5533. a.checkbox = H("input", {
  5534. type: "checkbox",
  5535. checked: a.selected,
  5536. defaultChecked: a.selected
  5537. }, this.options.itemCheckboxStyle, this.chart.container);
  5538. B(a.checkbox, "click", function (b) {
  5539. l(a.series || a, "checkboxClick",
  5540. {checked: b.target.checked, item: a}, function () {
  5541. a.select()
  5542. })
  5543. })
  5544. }
  5545. });
  5546. r.legend.itemStyle.cursor = "pointer";
  5547. u(A.prototype, {
  5548. showResetZoom: function () {
  5549. var a = this, b = r.lang, c = a.options.chart.resetZoomButton, d = c.theme, f = d.states, g = "chart" === c.relativeTo ? null : "plotBox";
  5550. this.resetZoomButton = a.renderer.button(b.resetZoom, null, null, function () {
  5551. a.zoomOut()
  5552. }, d, f && f.hover).attr({
  5553. align: c.position.align,
  5554. title: b.resetZoomTitle
  5555. }).addClass("highcharts-reset-zoom").add().align(c.position, !1, g)
  5556. }, zoomOut: function () {
  5557. var a = this;
  5558. l(a, "selection", {resetSelection: !0}, function () {
  5559. a.zoom()
  5560. })
  5561. }, zoom: function (a) {
  5562. var c, d = this.pointer, g = !1, l;
  5563. !a || a.resetSelection ? f(this.axes, function (a) {
  5564. c = a.zoom()
  5565. }) : f(a.xAxis.concat(a.yAxis), function (a) {
  5566. var b = a.axis;
  5567. d[b.isXAxis ? "zoomX" : "zoomY"] && (c = b.zoom(a.min, a.max), b.displayBtn && (g = !0))
  5568. });
  5569. l = this.resetZoomButton;
  5570. g && !l ? this.showResetZoom() : !g && b(l) && (this.resetZoomButton = l.destroy());
  5571. c && this.redraw(t(this.options.chart.animation, a && a.animation, 100 > this.pointCount))
  5572. }, pan: function (a, b) {
  5573. var c = this, d = c.hoverPoints,
  5574. e;
  5575. d && f(d, function (a) {
  5576. a.setState()
  5577. });
  5578. f("xy" === b ? [1, 0] : [1], function (b) {
  5579. b = c[b ? "xAxis" : "yAxis"][0];
  5580. var d = b.horiz, f = a[d ? "chartX" : "chartY"], d = d ? "mouseDownX" : "mouseDownY", g = c[d], h = (b.pointRange || 0) / 2, k = b.getExtremes(), l = b.toValue(g - f, !0) + h, h = b.toValue(g + b.len - f, !0) - h, m = h < l, g = m ? h : l, l = m ? l : h, h = Math.min(k.dataMin, k.min) - g, k = l - Math.max(k.dataMax, k.max);
  5581. b.series.length && 0 > h && 0 > k && (b.setExtremes(g, l, !1, !1, {trigger: "pan"}), e = !0);
  5582. c[d] = f
  5583. });
  5584. e && c.redraw(!1);
  5585. G(c.container, {cursor: "move"})
  5586. }
  5587. });
  5588. u(m.prototype, {
  5589. select: function (a,
  5590. b) {
  5591. var c = this, e = c.series, g = e.chart;
  5592. a = t(a, !c.selected);
  5593. c.firePointEvent(a ? "select" : "unselect", {accumulate: b}, function () {
  5594. c.selected = c.options.selected = a;
  5595. e.options.data[d(c, e.data)] = c.options;
  5596. c.setState(a && "select");
  5597. b || f(g.getSelectedPoints(), function (a) {
  5598. a.selected && a !== c && (a.selected = a.options.selected = !1, e.options.data[d(a, e.data)] = a.options, a.setState(""), a.firePointEvent("unselect"))
  5599. })
  5600. })
  5601. }, onMouseOver: function (a, b) {
  5602. var c = this.series, d = c.chart, e = d.tooltip, f = d.hoverPoint;
  5603. if (this.series) {
  5604. if (!b) {
  5605. if (f &&
  5606. f !== this)f.onMouseOut();
  5607. if (d.hoverSeries !== c)c.onMouseOver();
  5608. d.hoverPoint = this
  5609. }
  5610. !e || e.shared && !c.noSharedTooltip ? e || this.setState("hover") : (this.setState("hover"), e.refresh(this, a));
  5611. this.firePointEvent("mouseOver")
  5612. }
  5613. }, onMouseOut: function () {
  5614. var a = this.series.chart, b = a.hoverPoints;
  5615. this.firePointEvent("mouseOut");
  5616. b && -1 !== d(this, b) || (this.setState(), a.hoverPoint = null)
  5617. }, importEvents: function () {
  5618. if (!this.hasImportedEvents) {
  5619. var a = C(this.series.options.point, this.options).events, b;
  5620. this.events = a;
  5621. for (b in a)B(this,
  5622. b, a[b]);
  5623. this.hasImportedEvents = !0
  5624. }
  5625. }, setState: function (a, b) {
  5626. var c = Math.floor(this.plotX), d = this.plotY, e = this.series, f = e.options.states[a] || {}, l = g[e.type].marker && e.options.marker, m = l && !1 === l.enabled, n = l && l.states && l.states[a] || {}, p = !1 === n.enabled, k = e.stateMarkerGraphic, q = this.marker || {}, r = e.chart, z = e.halo, C, A = l && e.markerAttribs;
  5627. a = a || "";
  5628. if (!(a === this.state && !b || this.selected && "select" !== a || !1 === f.enabled || a && (p || m && !1 === n.enabled) || a && q.states && q.states[a] && !1 === q.states[a].enabled)) {
  5629. A && (C = e.markerAttribs(this,
  5630. a));
  5631. if (this.graphic)this.state && this.graphic.removeClass("highcharts-point-" + this.state), a && this.graphic.addClass("highcharts-point-" + a), this.graphic.attr(e.pointAttribs(this, a)), C && this.graphic.animate(C, t(r.options.chart.animation, n.animation, l.animation)), k && k.hide(); else {
  5632. if (a && n) {
  5633. l = q.symbol || e.symbol;
  5634. k && k.currentSymbol !== l && (k = k.destroy());
  5635. if (k)k[b ? "animate" : "attr"]({
  5636. x: C.x,
  5637. y: C.y
  5638. }); else l && (e.stateMarkerGraphic = k = r.renderer.symbol(l, C.x, C.y, C.width, C.height).add(e.markerGroup), k.currentSymbol =
  5639. l);
  5640. k && k.attr(e.pointAttribs(this, a))
  5641. }
  5642. k && (k[a && r.isInsidePlot(c, d, r.inverted) ? "show" : "hide"](), k.element.point = this)
  5643. }
  5644. (c = f.halo) && c.size ? (z || (e.halo = z = r.renderer.path().add(A ? e.markerGroup : e.group)), z[b ? "animate" : "attr"]({d: this.haloPath(c.size)}), z.attr({"class": "highcharts-halo highcharts-color-" + t(this.colorIndex, e.colorIndex)}), z.point = this, z.attr(u({
  5645. fill: this.color || e.color,
  5646. "fill-opacity": c.opacity,
  5647. zIndex: -1
  5648. }, c.attributes))) : z && z.point && z.point.haloPath && z.animate({d: z.point.haloPath(0)});
  5649. this.state =
  5650. a
  5651. }
  5652. }, haloPath: function (a) {
  5653. return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX) - a, this.plotY - a, 2 * a, 2 * a)
  5654. }
  5655. });
  5656. u(c.prototype, {
  5657. onMouseOver: function () {
  5658. var a = this.chart, b = a.hoverSeries;
  5659. if (b && b !== this)b.onMouseOut();
  5660. this.options.events.mouseOver && l(this, "mouseOver");
  5661. this.setState("hover");
  5662. a.hoverSeries = this
  5663. }, onMouseOut: function () {
  5664. var a = this.options, b = this.chart, c = b.tooltip, d = b.hoverPoint;
  5665. b.hoverSeries = null;
  5666. if (d)d.onMouseOut();
  5667. this && a.events.mouseOut && l(this, "mouseOut");
  5668. !c || a.stickyTracking ||
  5669. c.shared && !this.noSharedTooltip || c.hide();
  5670. this.setState()
  5671. }, setState: function (a) {
  5672. var b = this, c = b.options, d = b.graph, g = c.states, h = c.lineWidth, c = 0;
  5673. a = a || "";
  5674. if (b.state !== a && (f([b.group, b.markerGroup], function (c) {
  5675. c && (b.state && c.removeClass("highcharts-series-" + b.state), a && c.addClass("highcharts-series-" + a))
  5676. }), b.state = a, !g[a] || !1 !== g[a].enabled) && (a && (h = g[a].lineWidth || h + (g[a].lineWidthPlus || 0)), d && !d.dashstyle))for (g = {"stroke-width": h}, d.attr(g); b["zone-graph-" + c];)b["zone-graph-" + c].attr(g), c += 1
  5677. }, setVisible: function (a,
  5678. b) {
  5679. var c = this, d = c.chart, e = c.legendItem, g, m = d.options.chart.ignoreHiddenSeries, n = c.visible;
  5680. g = (c.visible = a = c.options.visible = c.userOptions.visible = void 0 === a ? !n : a) ? "show" : "hide";
  5681. f(["group", "dataLabelsGroup", "markerGroup", "tracker", "tt"], function (a) {
  5682. if (c[a])c[a][g]()
  5683. });
  5684. if (d.hoverSeries === c || (d.hoverPoint && d.hoverPoint.series) === c)c.onMouseOut();
  5685. e && d.legend.colorizeItem(c, a);
  5686. c.isDirty = !0;
  5687. c.options.stacking && f(d.series, function (a) {
  5688. a.options.stacking && a.visible && (a.isDirty = !0)
  5689. });
  5690. f(c.linkedSeries, function (b) {
  5691. b.setVisible(a,
  5692. !1)
  5693. });
  5694. m && (d.isDirtyBox = !0);
  5695. !1 !== b && d.redraw();
  5696. l(c, g)
  5697. }, show: function () {
  5698. this.setVisible(!0)
  5699. }, hide: function () {
  5700. this.setVisible(!1)
  5701. }, select: function (a) {
  5702. this.selected = a = void 0 === a ? !this.selected : a;
  5703. this.checkbox && (this.checkbox.checked = a);
  5704. l(this, a ? "select" : "unselect")
  5705. }, drawTracker: a.drawTrackerGraph
  5706. })
  5707. })(L);
  5708. (function (a) {
  5709. var B = a.Chart, A = a.each, H = a.inArray, G = a.isObject, r = a.pick, g = a.splat;
  5710. B.prototype.setResponsive = function (a) {
  5711. var f = this.options.responsive;
  5712. f && f.rules && A(f.rules, function (f) {
  5713. this.matchResponsiveRule(f,
  5714. a)
  5715. }, this)
  5716. };
  5717. B.prototype.matchResponsiveRule = function (f, g) {
  5718. var l = this.respRules, q = f.condition, d;
  5719. d = q.callback || function () {
  5720. return this.chartWidth <= r(q.maxWidth, Number.MAX_VALUE) && this.chartHeight <= r(q.maxHeight, Number.MAX_VALUE) && this.chartWidth >= r(q.minWidth, 0) && this.chartHeight >= r(q.minHeight, 0)
  5721. };
  5722. void 0 === f._id && (f._id = a.uniqueKey());
  5723. d = d.call(this);
  5724. !l[f._id] && d ? f.chartOptions && (l[f._id] = this.currentOptions(f.chartOptions), this.update(f.chartOptions, g)) : l[f._id] && !d && (this.update(l[f._id], g), delete l[f._id])
  5725. };
  5726. B.prototype.currentOptions = function (a) {
  5727. function f(a, d, b, l) {
  5728. var p, q;
  5729. for (p in a)if (!l && -1 < H(p, ["series", "xAxis", "yAxis"]))for (a[p] = g(a[p]), b[p] = [], q = 0; q < a[p].length; q++)b[p][q] = {}, f(a[p][q], d[p][q], b[p][q], l + 1); else G(a[p]) ? (b[p] = {}, f(a[p], d[p] || {}, b[p], l + 1)) : b[p] = d[p] || null
  5730. }
  5731. var l = {};
  5732. f(a, this.options, l, 0);
  5733. return l
  5734. }
  5735. })(L);
  5736. return L
  5737. });