-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathzingchart-xy.min.js
8 lines (7 loc) · 28.5 KB
/
zingchart-xy.min.js
1
2
3
4
5
6
7
8
/*
All of the code within the ZingChart software is developed and copyrighted by ZingChart, Inc., and may not be copied,
replicated, or used in any other software or application without prior permission from ZingChart. All usage must coincide with the
ZingChart End User License Agreement which can be requested by email at [email protected].
Build 2.9.16-hf1
*/
ZC.WJ.push("xy");var QB={$i:function(A){this.b(A)},parse:function(){this.b()},J6:function(){var A=this;A.A1===A.W?A.AA=A.I-A.A9-A.BU:A.AA=(A.I-A.A9-A.BU)/(A.A1-A.W+(A.DF?1:0))},AA0:function(A){this.b(A),this.J6()},zoomTo:function(A,i){this.b(A,i);this.J6()},clear:function(){},build:function(){this.b()},NJ:function(A){var i,e=this;i=e.AX?(e.iX+e.I-e.A9-A)/(e.I-e.A9-e.BU):(A-e.iX-e.A9)/(e.I-e.A9-e.BU);var a=e.B0,t=e.BF;null!==ZC._n_(e.aForcedMinMax[0])&&e.aForcedMinMax[0]!==a&&(a=e.aForcedMinMax[0]),null!==ZC._n_(e.aForcedMinMax[1])&&e.aForcedMinMax[1]!==t&&(t=e.aForcedMinMax[1]),"log"===e.BS&&(a=ZC.FV(a,e.DY),t=ZC.FV(t,e.DY));var C=a+ZC._f_((t-a)*i);return"log"===e.BS&&(C=Math.pow(e.DY,C)),C},OK:function(A,i,e){var a,t,C,n=this;void 0===e&&(e=!1);var l=n.DF?n.AA:0;C=n.AX?(n.iX+n.I-A-n.A9-l/2)/(n.I-n.A9-n.BU-l):(A-n.iX-n.A9-l/2)/(n.I-n.A9-n.BU-l);var r,Z=!1;if(i)for(r in i.K8){Z=!0;break}if(i&&!n.NW&&Z){var o=n.V[n.W];"string"==typeof o&&(o=ZC.AV(n.IU,o)),"log"===n.BS&&(o=ZC.FV(o,n.DY));var s=n.V[n.A1];"string"==typeof s&&(s=ZC.AV(n.IU,s)),"log"===n.BS&&(s=ZC.FV(s,n.DY));var c=o+ZC._f_((s-o)*C);"log"===n.BS&&(c=Math.pow(n.DY,c));var f=ZC.MAX;for(r in t=null,i.K8)(a=Math.abs(r-c))<f&&(f=a,t=i.K8[r]);if(null===ZC._n_(t)&&(t=c),f>i.A2G){var B=Math.ceil((s-o)/(n.I-n.A9-n.BU));if(i.V.length<2&&(B*=100),f>B)return null}return t}var u=n.W,_=n.A1;return n.EI&&(null!==ZC._n_(a=n.V[u])&&(u=a),null!==ZC._n_(a=n.V[_])&&(_=a)),"log"===n.BS&&(u=ZC.FV(u,n.DY),_=ZC.FV(_,n.DY)),t=e?n.DF?u+(_-u+1)*C:u+(_-u)*C:(n.DF,n.W+(n.A1-n.W)*C),"log"===n.BS?(t=Math.pow(n.DY,t),t=Math.round(t)-1):(t=ZC._i_(t),t=ZC.BR(0,t),t=ZC.CY(n.DQ,t)),t},II:function(A){var i=this;i.W,i.A1;return i.EI&&!i.NW&&(i.B0,i.BF),"log"===i.BS&&(A=ZC.FV(A+1,i.DY)),i.AX?i.iX+i.I-i.A9-(A-i.W+(i.DF?1:0))*i.AA+(i.DF?i.AA/2:0):i.iX+i.A9+(A-i.W)*i.AA+(i.DF?i.AA/2:0)},AR:function(A){var i,e,a,t,C,n=this;if("log"===n.BS&&(0===A&&(A=n.B0),A=ZC.FV(A,n.DY)),n.NW){var l=n.UA[A];return n.II(l)}if(-1!==(i=ZC.AV(n.IU,A)))return n.II(i);if(!n.A4L&&(n.EI||n.F7&&"date"===n.F7.o.type)){t=n.V[n.W],C=n.V[n.A1];var r=n.I;return"log"===n.BS&&(t=ZC.FV(t,n.DY),C=ZC.FV(C,n.DY),n.W===n.D4&&n.A1===n.DQ&&(r=(n.A1-n.W)*n.AA+n.A9+n.BU)),C===t?e=0:(a=C-t,e=(r-n.A9-n.BU-(n.DF?n.AA:0))/a),n.AX?n.iX+r-n.A9-(A-t)*e-(n.DF?n.AA/2:0)+n.iMinOffset:n.iX+n.A9+(A-t)*e+(n.DF?n.AA/2:0)-n.iMinOffset}return t=n.B0,C=n.BF,"log"===n.BS&&(t=ZC.FV(t,n.DY),C=ZC.FV(C,n.DY)),C===t?e=0:(a=C-t+(n.DF?1:0),e=(n.I-n.A9-n.BU)/a),n.AX?n.iX+n.I-n.A9-(A-t)*e-(n.DF?n.AA/2:0):n.iX+n.A9+(A-t)*e+(n.DF?n.AA/2:0)},paint:function(){var A,i,e,a,t,C,n,l,r,Z,o,s,c,f,B,u,_,p=this;p.b(),null!==ZC._n_(p.A.A.E[p.A.K+"-"+p.BD+"-feed-offset-start"])&&(p.A9=p.A.A.E[p.A.K+"-"+p.BD+"-feed-offset-start"]),"bubble"!==p.A.AF&&"scatter"!==p.A.AF||(-1===p.A9&&-1===p.BU||1===p.V.length)&&(p.A9=p.BU=p.I/(p.V.length+1),p.J6());var F=p.BF,h=p.B0;if("log"===p.BS&&(null!==ZC._n_(p.o["max-value"])&&(F=ZC._f_(p.o["max-value"]),p.aForcedMinMax[1]=F),null!==ZC._n_(p.o["min-value"])&&(h=ZC._f_(p.o["min-value"]),p.aForcedMinMax[0]=h),p.iMinOffset=0,(F!==p.BF||h!==p.B0)&&p.W===p.D4&&p.A1===p.DQ&&1===p.aForcedMinMax[2])){p.aForcedMinMax[2]=0;var D=p.AA;p.AA=(p.I-p.A9-p.BU)/(ZC.FV(F,p.DY)-ZC.FV(h,p.DY))-.1;var I=ZC.FV(h,p.DY)-ZC.FV(p.B0,p.DY),K=ZC.FV(p.BF,p.DY)-ZC.FV(F,p.DY);p.iMinOffset=I*(p.AA-D)*(p.V.length-1)/(K+I)}var d=p.A0Q(),E=0,Y=1,m=1,V={};for(i=0,e=p.A.BO.length;i<e;i++)"scale-x"===p.A.BO[i].BD.substring(0,7)&&p.A.BO[i].BA===p.BA&&E++,"scale-x"===p.A.BO[i].BD.substring(0,7)&&("default"===p.A.BO[i].BA?(V[p.A.BO[i].BD]=Y,Y++):(V[p.A.BO[i].BD]=m,m++));var M=V[p.BD],g="default"===p.BA,v=null,G=null;for(i=0,e=p.A.AY.A3.length;i<e;i++){var X=p.A.AY.A3[i],N=X.BW();if(-1!==ZC.AV(N,p.BD)){var b=p.A.BM(X.BW("v")[0]);v=b.AR(b.HC),G=X;break}}var W=8;null!==ZC._n_(p.IV.o.size)&&(W=ZC._i_(p.IV.o.size));var U=4;null!==ZC._n_(p.IG.o.size)&&(U=ZC._i_(p.IG.o.size));var S=ZC._i_(p.A.E[p.BD+"-distance"]||-1);p.VG&&(S=0),"default"===p.BA?(Z=ZC._i_(p.A.N.DW/E),t=p.iY+p.F+(M-1)*Z,-1!==S&&(t=p.iY+p.F+S)):(Z=ZC._i_(p.A.N.EB/E),t=p.iY-(M-1)*Z,-1!==S&&(t=p.iY-S));var Q=t;if(p.A.HO&&(p.A.HO.AP=!0,p.D4===p.W&&p.DQ===p.A1&&(p.A.HO.AP=!1),p.A.HO.AP&&0===p.A.HO.B2.BJ&&"default"===p.BA&&(t+=p.A.HO.B2.F+p.B1/2)),p.E.iY=t,p.AP&&p.TG){null!==ZC._n_(p.o["fixed-items"])&&(p.M4=p.EJ=ZC._i_(p.o["fixed-items"]));var O=ZC.BR(1,Math.ceil((p.A1-p.W)/(p.M4-1))),k=ZC.BR(1,Math.ceil((p.A1-p.W)/(p.EJ-1)));null===ZC._n_(p.o["fixed-items"])&&ZC._b_(p.o.normalize)&&(O=ZC.AQ.A0S(O),k=ZC.AQ.A0S(k));for(var x=p.iStepMultiplier,w=3;w>0;w--)p.iStepMultiplier>w&&p.A1-p.W<=w*p.iStepMultiplier&&(x=w);O*=x,k*=x;var P,y,R,H=0,L=p.AA*O/(p.FZ+1),J=p.AX?p.iX+p.BU:p.iX+p.A9,z=p.AX?p.iX+p.I-p.A9:p.iX+p.I-p.BU;if(null===ZC._n_(v)&&(v=t),C=p.G.usc()?p.G.mc():ZC.AM(p.A.K+"-scales-ml-0-c"),l=ZC.Q.EE(C,p.G.AC),n=p.G.usc()?p.G.mc():ZC.AM(p.A.K+"-scales-bl-0-c"),r=ZC.Q.EE(n,p.G.AC),"inherit"===p.o["line-color"]&&-1!==d&&(p.B9=d),p.A.AJ["3d"]){if((B=ZC.DM.DE(p,p.A,p.iX-ZC.AN.E1,p.iX-ZC.AN.E1+p.I,t-ZC.AN.E2,t-ZC.AN.E2,-1,ZC.AN.FE+1,"x")).K=p.K+"-line",p.A.ES.true3d&&(p.A.ES["x-angle"]>0?B.MG=[1===p.L?-100:100,1,1]:B.MG=[1===p.L?100:-100,1,1]),p.A.CN.add(B),null!==ZC._n_(p.o.axis)){var T=new ZC.CZ(p);T.append(p.o.axis),T.parse(),T.A0=T.AE=T.B9,(B=ZC.DM.DE(T,p.A,p.iX-ZC.AN.E1,p.iX-ZC.AN.E1+p.I,t-ZC.AN.E2,t-ZC.AN.E2,-T.B1/2,T.B1/2,"x")).K=p.K+"-axis",p.A.CN.add(B)}}else{o=[[p.iX-1,Q],[p.iX+p.I+1,Q]];var q=p.K;p.K+="-line",ZC.CO.paint(l,p,o),p.K=q}if(p.V.length>0&&p.D8.AP){var j=null===ZC._n_(p.D8.o["offset-start"])?0:ZC._i_(p.D8.o["offset-start"]),$=null===ZC._n_(p.D8.o["offset-end"])?0:ZC._i_(p.D8.o["offset-end"]);if(p.D8.o.items&&p.D8.o.items.length>0&&!p.A.AJ["3d"])for(u=new ZC.HU(p),i=p.W;i<p.A1+(p.DF?1:0);i++)s=i-p.W,_=i%p.D8.o.items.length,u.append(p.D8.o.items[_]),u.K=p.K+"-guide-"+i,u.Z=n,u.parse(),p.AX?u.iX=p.iX+p.I-p.A9-s*p.AA-p.AA:u.iX=p.iX+p.A9+s*p.AA,u.iY=p.iY+j,u.I=p.AA,u.F=p.F-j-$,u.paint();if(p.D8.B1>0)for(p.GU=0,i=p.W;i<=p.A1+(p.DF?1:0);i++)if(p.K9=i,i===p.W||i===p.A1+(p.DF?1:0)||(i-p.W)%O==0){(p.D8.E6.length>0||i===p.W)&&((f=new ZC.CZ(p)).Z=f.C8=n,f.copy(p.D8),f.IQ=bA,f.DH()&&f.parse()),o=[],s=i-p.W,c="log"===p.BS?p.AR(p.V[i]):p.AX?p.iX+p.I-p.A9-s*p.AA:p.iX+p.A9+s*p.AA;var AA=p.iY+j,iA=p.F-j-$;if(f.AP)if(p.A.AJ["3d"]){var eA=new ZC.CZ(p);eA.copy(f),null!==ZC._n_(p.o["scale-z"])&&null!==ZC._n_(A=p.o["scale-z"].guide)&&(eA.append(A),eA.parse()),eA.A0=eA.AE=eA.B9,B=ZC.DM.DE(eA,p.A,c-ZC.AN.E1-eA.B1/2,c-ZC.AN.E1+eA.B1/2,t-ZC.AN.E2,t-ZC.AN.E2,0,ZC.AN.FE,"z"),p.A.CN.add(B),f.A0=f.AE=f.B9,(B=ZC.DM.DE(f,p.A,c-ZC.AN.E1-f.B1/2,c-ZC.AN.E1+f.B1/2,AA-ZC.AN.E2,AA+iA-ZC.AN.E2,ZC.AN.FE+2,ZC.AN.FE+2,"y")).K=p.K+"-guide-"+i,p.A.CN.add(B)}else o.push([c,AA],[c,AA+iA]),f.K=p.K+"-guide-"+i,ZC.CO.paint(r,f,o);p.GU++}}if(p.V.length>0&&p.G8.AP&&!p.A.AJ["3d"]&&p.G8.o.items&&p.G8.o.items.length>0)for(u=new ZC.HU(p),i=p.W;i<p.A1+(p.DF?1:0);i++)for(p.K9=i,s=i-p.W,p.GU=0,a=1;a<=p.FZ;a++)_=p.GU%p.G8.o.items.length,u.append(p.G8.o.items[_]),u.K=p.K+"-guide-"+i+"-"+a,u.Z=p.G.usc()?p.G.mc():ZC.AM(p.A.K+"-scales-bl-0-c"),u.parse(),p.AX?u.iX=p.iX+p.I-p.A9-s*p.AA-(a+1)*L:u.iX=p.iX+p.A9+s*p.AA+a*L,u.iY=p.iY,u.I=L,u.F=p.F,u.paint(),p.GU++;if(p.G8.B1>0)for(i=p.W;i<p.A1+(p.DF?1:0);i++)if(p.K9=i,i%O==0)for(s=i-p.W,p.GU=0,a=1;a<=p.FZ;a++)o=[],(f=new ZC.CZ(p)).copy(p.G8),f.IQ=bA,f.DH()&&f.parse(),c="log"===p.BS?p.AR(p.V[i]+a*p.V[i+1]/(p.FZ+2)):p.AX?p.iX+p.I-p.A9-s*p.AA-a*L:p.iX+p.A9+s*p.AA+a*L,ZC.DS(c,J,z)&&(o.push([c,p.iY],[c,p.iY+p.F]),f.AP&&(f.K=p.K+"-minor-guide-"+a,ZC.CO.paint(r,f,o))),p.GU++;if(p.VL(r,d),p.V.length>0&&p.IV.AP){switch(p.IV.o.placement){case"inner":break;case"outer":H+=W;break;default:H+=W/2}if(!zingchart.DEV.SMARTDATELABELS||!p.F7||"date"!==p.F7.o.type)for(p.GU=0,i=p.W;i<=p.A1+(p.DF?1:0);i++)if(i===p.W||i===p.A1+(p.DF?1:0)||(i-p.W)%O==0){p.K9=i;var aA=W;if(o=[],s=i-p.W,(p.IV.E6.length>0||i===p.W)&&((f=new ZC.DT(p)).copy(p.IV),"inherit"===p.IV.o["line-color"]&&-1!==d&&(f.B9=d),f.IQ=bA,f.DH()&&f.parse(),f.AI>1&&(aA=f.AI)),c="log"===p.BS?p.AR(p.V[i]):p.AX?p.iX+p.I-p.A9-s*p.AA:p.iX+p.A9+s*p.AA,ZC.DS(c,J,z)){switch(f.o.placement){case"ref-auto":o.push([c,v+aA/2],[c,v-aA/2]);break;case"ref-top":o.push([c,v-aA],[c,v]);break;case"ref-bottom":o.push([c,v+aA],[c,v]);break;case"inner":o.push([c,t-(g?aA:-aA)],[c,t]);break;case"outer":o.push([c,t],[c,t+(g?aA:-aA)]);break;default:o.push([c,t+aA/2],[c,t-aA/2])}if(f.AP){for(y=ZC._i_(f.o["offset-x"]||"0"),R=ZC._i_(f.o["offset-y"]||"0"),P=0;P<o.length;P++)o[P][0]+=y,o[P][1]+=R;if(f.K=p.K+"-tick-"+i,p.A.AJ["3d"])if(p.A.ES.true3d){var tA,CA=[];for(P=0;P<o.length;P++)tA=new ZC.CE(p.A,o[P][0]-ZC.AN.E1,o[P][1]-ZC.AN.E2,0),CA.push([tA.EC[0],tA.EC[1]]);ZC.CO.paint(l,f,CA)}else{var nA=this.A.ES.angle||45;for(P=0;P<o.length;P++)o[P][0]-=ZC.EF(nA)*ZC.AN.FE/2,o[P][1]+=ZC.EL(nA)*ZC.AN.FE/2;ZC.CO.paint(l,f,o)}else ZC.CO.paint(l,f,o)}}p.GU++}}var lA=[];if(p.V.length>0&&p.FZ>0&&p.IG.AP&&!p.A.AJ["3d"])for(i=p.W;i<p.A1+(p.DF?1:0);i++)if(p.K9=i,i%O==0)for(s=i-p.W,p.GU=0,a=1;a<=p.FZ;a++){if(o=[],(f=new ZC.CZ(p)).copy(p.IG),"inherit"===p.IG.o["line-color"]&&-1!==d&&(f.B9=d),f.IQ=bA,f.DH()&&f.parse(),"log"===p.BS){var rA=Math.round(ZC.FV(p.V[i],p.DY)),ZA=p.V[i]+a*p.V[i+1]/(p.FZ+2);ZA=rA<0?ZC._f_(ZA.toFixed(-rA)):ZC._f_(ZA.toFixed(rA)),lA.push(ZA),c=p.AR(ZA)}else c=p.AX?p.iX+p.I-p.A9-s*p.AA-a*L:p.iX+p.A9+s*p.AA+a*L;if(ZC.DS(c,J,z)){switch(f.o.placement){case"ref-auto":o.push([c,v+U/2],[c,v-U/2]);break;case"ref-top":o.push([c,v],[c,v-U]);break;case"ref-bottom":o.push([c,v],[c,v+U]);break;case"inner":o.push([c,t-(g?U:-U)],[c,t]);break;case"outer":o.push([c,t],[c,t+(g?U:-U)]);break;default:o.push([c,t+U/2],[c,t-U/2])}if(f.AP){for(y=ZC._i_(f.o["offset-x"]||"0"),R=ZC._i_(f.o["offset-y"]||"0"),P=0;P<o.length;P++)o[P][0]+=y,o[P][1]+=R;f.K=p.K+"-minor-tick-"+i,ZC.CO.paint(l,f,o)}}p.GU++}p.XV();var oA=null,sA=null,cA=p.CL,fA=p.DV,BA=[],uA=new ZC.DT(p);uA.copy(p.IV);var _A,pA=0,FA=0,hA=0,DA=[],IA=[];if(p.o["custom-items"])for(i=0;i<p.o["custom-items"].length;i++)WA(p.o["custom-items"][i][0],!1,!0,p.o["custom-items"][i][1]);if(p.V.length>0&&p.BQ.AP)if(zingchart.DEV.SMARTDATELABELS&&p.F7&&"date"===p.F7.o.type){var KA=p.getOptimalDateInterval(p.V[p.A1]-p.V[p.W]),dA=KA[0];_A=KA[1];var EA=KA[2],YA=KA[3];hA=KA[4];var mA=EA*Math.ceil(p.V[p.W]/EA),VA=EA*Math.floor(p.V[p.A1]/EA),MA="";p.GU=0;var gA=!0;for(i=mA;i<=VA;i+=EA){gA=!0;var vA=ZC.AO.YF(i,dA,p.A.UL,p.A.NF);if(vA!==MA){switch(YA){case"yr":hA>15&&(gA=ZC._i_(vA)%2==0);break;case"mon":hA>15&&(gA=ZC._i_(vA)%3==0);break;case"day":hA>45?gA=1===ZC._i_(vA)||15===ZC._i_(vA):hA>30?gA=1===ZC._i_(vA)||10===ZC._i_(vA)||20===ZC._i_(vA):hA>15&&(gA=1===ZC._i_(vA)||10===ZC._i_(vA)||15===ZC._i_(vA)||20===ZC._i_(vA)||25===ZC._i_(vA));break;case"hr":hA>45?gA=ZC._i_(vA)%12==0:hA>30?gA=ZC._i_(vA)%6==0:hA>15&&(gA=ZC._i_(vA)%3==0);break;case"min":case"sec":hA>45?gA=ZC._i_(vA)%30==0:hA>30?gA=ZC._i_(vA)%10==0:hA>15&&(gA=ZC._i_(vA)%5==0)}gA&&(WA(i,!0),MA=vA)}}uA.AP&&(uA.K=p.K+"-ticks",ZC.CO.paint(l,uA,BA))}else for(p.GU=0,WA(p.W),p.GU=p.A1-p.W,WA(p.A1),p.GU=1,i=p.W+1;i<p.A1;i++)(i-p.W)%k==0&&WA(i);for(i=0;i<lA.length;i++){var GA=p.FU(i,null,null,!1,lA[i]);WA(GA,!1,!0,GA)}if(p.M.AP&&p.M.AK&&""!==p.M.AK){(oA=new ZC.DN(p)).copy(p.M),oA.K=p.A.K+"-"+p.BD.replace(/\-/g,"_")+"-item_title",oA.GN=p.K+"-label "+p.A.K+"-scale-label zc-scale-label",oA.AK=p.M.AK,oA.Z=p.G.usc()?p.G.mc():ZC.AM(p.A.K+"-scales-ml-0-c"),oA.IP=p.G.usc()?ZC.AM(p.G.K+"-main"):ZC.AM(p.G.K+"-text"),oA.parse(),"inherit"!==p.M.o["font-color"]&&"inherit"!==p.M.o.color||-1===d||(oA.C2=d);var XA=p.iX+(p.AX?p.BU:p.A9),NA=p.I-p.A9-p.BU;switch("chart"===oA.o["center-point"]&&(XA=p.A.iX,NA=p.A.I),oA.OE){case"left":oA.iX=XA;break;case"center":oA.iX=XA+NA/2-oA.I/2;break;case"right":oA.iX=XA+NA-oA.I}oA.iY=g?t+H+FA:t-oA.F-H-FA,p.M.iX=oA.iX,p.M.iY=oA.iY,oA.AP&&(p.N2(oA,null,"h"),oA.paint(),oA.EP(),null===ZC._n_(oA.o.tooltip)&&oA.KK||IA.push(ZC.AO.OB(p.A.G.K,p.A.K,oA)))}IA.length>0&&ZC.AM(p.A.A.K+"-map")&&(ZC.AM(p.A.A.K+"-map").innerHTML+=IA.join("")),null!==ZC._n_(p.o.transform)&&"date"===p.o.transform.type&&p.paintTransformDate()}function bA(A){return A=(A=(A=(A=(A=(A=A.replace(/%scale-last-position/g,p.A1-p.W)).replace(/(%c)|(%scale-position)/g,p.GU)).replace(/(%i)|(%scale-index)/g,p.K9)).replace(/(%v)|(%scale-value)/g,null!==ZC._n_(p.V[p.K9])?p.V[p.K9]:"")).replace(/(%l)|(%scale-label)/g,null!==ZC._n_(p.BY[p.K9])?p.BY[p.K9]:"")).replace(/%scale-day-of-week/g,ZC.AO.YF(p.V[p.K9],"%w",p.A.UL,p.A.NF))}function WA(A,i,e,a){var C;if(p.K9=A,s=A-p.W,(p.BQ.E6.length>0||A===p.W||!oA||p.BQ.I0||e)&&(oA=new ZC.DN(p)),oA.copy(p.BQ),oA.GN=p.K+"-item "+p.A.K+"-scale-item zc-scale-item",oA.K=p.A.K+"-"+p.BD.replace(/\-/g,"_")+"-item_"+(a?"c"+a:A),oA.E["p-width"]=p.AA,p.CL=cA,p.DV=fA,e||p.Z5(bA),C=i?ZC.AO.YF(A,_A,p.A.UL,p.A.NF):a||p.FU(A,null,null),!e&&p.BQ.I0){var n=p.A.H2();ZC._cp_({index:A,cnt:s,text:C},n),p.H8(p.BQ,oA,null,n,p.BQ.MN)}if(!(null!==ZC._n_(p.LW)&&-1===ZC.AV(p.LW,C)||(oA.AK=C,oA.Z=oA.C8=p.G.usc()?p.G.mc():ZC.AM(p.A.K+"-scales-ml-0-c"),oA.IP=p.G.usc()?ZC.AM(p.G.K+"-main"):ZC.AM(p.G.K+"-text"),oA.E.nodeidx=A,oA.parse(),p.BQ.A24&&p.BQ.AB%180==0&&(oA.o.width=ZC._i_(.9*p.AA),oA.parse()),"inherit"!==p.BQ.o["font-color"]&&"inherit"!==p.BQ.o.color||-1===d||(oA.C2=d),e||(oA.IQ=bA,oA.DH()&&oA.parse()),oA.o["auto-fit"]&&(oA.I=ZC._i_(p.AA)),i?(c=p.AR(A),oA.iX=c-oA.I/2-(p.DF?p.AA/2:0)):e?(c=p.AR(A),oA.iX=c-oA.I/2):"log"===p.BS?(c=p.AR(p.V[A]),oA.iX=c-oA.I/2+(p.DF?p.AA/2:0)*(p.AX?-1:1)):p.AX?(c=p.iX+p.I-p.A9-s*p.AA,oA.iX=c-oA.I/2-(p.DF?p.AA/2:0)):(c=p.iX+p.A9+s*p.AA,oA.iX=c-oA.I/2+(p.DF?p.AA/2:0)),c<p.iX-1||c>p.iX+p.I+1))){if(p.A.B7&&p.A.B7.BY&&p.A.B7.I3){for(var l=!1,r=0;r<p.A.B7.BY.length;r++)p.A.B7.BY[r].text===oA.AK&&(l=!0);l||p.A.B7.BY.push({x:ZC._i_(c),text:oA.AK})}switch(oA.o.placement){case"inner":oA.iY=g?t-oA.F-W:t+W;break;case"ref-top":oA.iY=v-oA.F-W;break;case"ref-bottom":oA.iY=v+W;break;case"ref-auto":G&&G.R[A]?(G.FQ(A).setup(),G.FQ(A).iY<v?oA.iY=v+W:oA.iY=v-oA.F-W):oA.iY=v+W;break;default:oA.iY=g?t+W:t-oA.F-W}if(sA=p.N2(oA,sA,"h",0),p.BQ.o["auto-align"]&&p.BQ.AB%180!=0){var Z=ZC.DS(p.BQ.AB,0,180)?g?1:-1:g?-1:1;oA.iX+=Z*oA.I*ZC.EF(p.BQ.AB)/2,oA.iY+=Z*(oA.I*ZC.EL(p.BQ.AB)/2-oA.F*ZC.EL(p.BQ.AB)/2)}var o=p.X8(oA,A,{items:hA,lcoords:DA,lstep:k,tdim:pA,mdim:FA,dim:"h",html:IA});if(pA=o.tdim,FA=o.mdim,!o.overlaps&&i&&p.IV.AP)switch(uA.o.placement){case"ref-auto":BA.push([c,v+W/2],[c,v-W/2],null);break;case"ref-top":BA.push([c,v-W],[c,v],null);break;case"ref-bottom":BA.push([c,v+W],[c,v],null);break;case"inner":BA.push([c,t-(g?W:-W)],[c,t],null);break;case"outer":BA.push([c,t],[c,t+(g?W:-W)],null);break;default:BA.push([c,t+W/2],[c,t-W/2],null)}p.GU++}}},getOptimalDateInterval:function(A){var i,e,a,t,C;return 0<=A&&A<=3*ZC.SEC?(i="%q",e="%q ms",a=10,t="ms",C=ZC._i_(A/10)):3*ZC.SEC<A&&A<=3*ZC.MIN?(i="%s",e="%h:%i:%s %A",a=ZC.SEC,t="sec",C=ZC._i_(A/ZC.SEC)):3*ZC.MIN<A&&A<=3*ZC.HR?(i="%i",e="%h:%i %A",a=ZC.MIN,t="min",C=ZC._i_(A/ZC.MIN)):3*ZC.HR<A&&A<=3*ZC.DAY?(i="%h:%i",e="%M %d, %h %A",a=ZC.HR,t="hr",C=ZC._i_(A/ZC.HR)):3*ZC.DAY<A&&A<=3*ZC.MON?(i="%d",e="%M %d",a=ZC.DAY,t="day",C=ZC._i_(A/ZC.DAY)):3*ZC.MON<A&&A<=3*ZC.YR?(i="%m",e="%M %Y",a=ZC.DAY,t="mon",C=ZC._i_(A/ZC.MON)):(i="%Y",e="%Y",a=ZC.DAY,t="yr",C=ZC._i_(A/ZC.YR)),[i,e,a,t,C]},paintTransformDate:function(){var A,i,e,a,t=this;i=ZC.Q.EE(t.G.usc()?t.G.K+"-main-c":t.A.K+"-scales-bl-0-c",t.G.AC);var C=[],n=1;!function f(A,i){void 0===i&&(i=!1),0<=A&&A<=2*ZC.SEC?(e="%q",a="%q ms",i&&f(60*A)):2*ZC.SEC<A&&A<=2*ZC.MIN?(e="%s",a="%h:%i:%s %A",i&&f(60*A),A>10*ZC.SEC&&(n=2),A>30*ZC.SEC&&(n=5),A>60*ZC.SEC&&(n=10)):2*ZC.MIN<A&&A<=2*ZC.HR?(e="%i",a="%h:%i %A",i&&f(24*A),A>10*ZC.MIN&&(n=2),A>30*ZC.MIN&&(n=5),A>60*ZC.MIN&&(n=10)):2*ZC.HR<A&&A<=2*ZC.DAY?(e="%h",a="%M %d, %h %A",i&&f(30*A),A>6*ZC.HR&&(n=2),A>12*ZC.HR&&(n=4),A>24*ZC.HR&&(n=6)):2*ZC.DAY<A&&A<=2*ZC.MON?(e="%d",a="%M %d",i&&f(366*A),A>12*ZC.DAY&&(C=[1,5,9,13,17,21,25,29]),A>24*ZC.DAY&&(C=[1,6,11,16,21,26])):2*ZC.MON<A&&A<=2*ZC.YR?(e="%m",a="%M %Y",i&&f(10*A),A>9*ZC.MON&&(C=[1,4,7,10])):(e="%Y",a="%Y",A>9*ZC.YR&&(n=3),A>16*ZC.YR&&(n=4),A>25*ZC.YR&&(n=5))}(t.V[t.A1]-t.V[t.W]);var l=null,r=[],Z=!1,o=!1;function s(A){var o,s;if(null!==ZC._n_(t.V[A])&&""!==t.V[A]){t.NW&&A!==t.W&&A!==t.A1&&null!==ZC._n_(t.V[A-1])&&""!==t.V[A-1]&&null!==ZC._n_(t.V[A])&&t.V[A];var c=ZC.AO.YF(t.V[A],e,t.A.UL,t.A.NF);if(c!==l&&ZC._i_(c)%n==0&&(0===C.length||-1!==ZC.AV(C,ZC._i_(c)))){var f,B=!0,u=A-t.W;o=t.AX?t.iX+t.I-t.A9-u*t.AA:t.iX+t.A9+u*t.AA+(t.DF?t.AA/2:0);var _=new ZC.DN(t);t.G.B6.load(_.o,"graph.SCALE.transform[date].item"),null!==ZC._n_(f=t.o.transform.item)&&_.append(f),_.GN=t.K+"-item "+t.A.K+"-scale-item zc-scale-item",_.K=t.K+"-date-item-"+A;var p=ZC.AO.YF(t.V[A],a,t.A.UL,t.A.NF);_.AK=p,_.Z=_.C8=t.G.usc()?t.G.mc():ZC.AM(t.A.K+"-scales-ml-0-c"),_.IP=t.G.usc()?ZC.AM(t.G.K+"-main"):ZC.AM(t.G.K+"-text"),_.parse(),t.AX?_.iX=o-_.I/2-(t.DF?t.AA/2:0):_.iX=o,_.iY=t.iY,t.A.AJ["3d"]&&(t.A.O7(),s=new ZC.CE(t.A,_.iX+_.I/2-ZC.AN.E1,_.iY+_.F/2-ZC.AN.E2,0),_.iX=s.EC[0]-_.I/2,_.iY=s.EC[1]-_.F/2);var F=[_.iX+_.BK,_.iY+_.BJ,_.I,_.F];if(_.AB%180==90&&(F=[_.iX+_.BK+_.I/2-_.F/2,_.iY+_.BJ+_.F/2-_.I/2,_.F,_.I]),t.A.B7&&t.A.B7.I3){for(var h=!1,D=0;D<t.A.B7.BY.length;D++)t.A.B7.BY[D].text===_.AK&&(h=!0);h||_.iX>=t.iX&&_.iX+_.I<=t.iX+t.I&&t.A.B7.BY.push({x:ZC._i_(_.iX),text:_.AK})}if(_.AP&&Z){if(B=!0,!t.A0F){if(A===t.W||A===t.A1)B=!0;else for(var I=0,K=r.length;I<K;I++)if(ZC.DS(F[0],r[I][0],r[I][0]+r[I][2])||ZC.DS(F[0]+F[2],r[I][0],r[I][0]+r[I][2])){B=!1;break}_.iX+_.BK+_.I>t.iX+t.BK+t.I&&(B=!1)}if(B){r.push(F),_.paint(),_.EP();var d=new ZC.CZ(t);null!==ZC._n_(f=t.o.transform.guide)&&d.append(f),d.B1=1,d.B9="#ccc",d.parse();var E=[];if(E.push([o,t.iY],[o,t.iY+t.F]),t.A.AJ["3d"]){t.A.O7();for(var Y=0,m=E.length;Y<m;Y++)s=new ZC.CE(t.A,E[Y][0]-ZC.AN.E1,E[Y][1]-ZC.AN.E2,0),E[Y][0]=s.EC[0],E[Y][1]=s.EC[1]}d.AP&&ZC.CO.paint(i,d,E)}}0}l=c}}if(t.A.B7&&t.A.B7.I3&&(t.A.B7.BY=[]),t.V.length>0&&(Z=!1,null!==ZC._n_(A=t.o.transform.item)&&(Z=!(null!==ZC._n_(A.visible)&&!ZC._b_(A.visible))),o=!1,t.A.B7&&t.A.B7.BY&&(o=!0),Z||o)){s(t.W),s(t.A1);for(var c=t.W+1;c<t.A1;c++)s(c)}}};ZC.QB=ZC.ZN.CD(QB);var QC={$i:function(A){this.b(A)},parse:function(){this.b()},J6:function(){var A=this;A.A1===A.W?A.AA=A.F-A.A9-A.BU:A.AA=(A.F-A.A9-A.BU)/(A.A1-A.W+(A.DF?1:0))},AA0:function(A){this.b(A),this.J6()},clear:function(){},build:function(){this.b()},zoomTo:function(A,i){this.b(A,i),this.J6()},NJ:function(A,i,e){var a,t=this;a=t.AX?(A-t.iY-t.A9)/(t.F-t.A9-t.BU):(t.iY+t.F-t.A9-A)/(t.F-t.A9-t.BU);var C=t.B0+ZC._f_((t.BF-t.B0)*a);return e&&(C=ZC._a_(t.AX?Math.ceil(C):Math.floor(C))),"log"===t.BS&&i&&(C=Math.pow(t.DY,C)),C},AR:function(A){var i=this;if("lin"===i.BS||"log"===i.BS){var e=i.BF-i.B0,a=0===e?0:(i.F-i.A9-i.BU-(i.DF?i.AA:0))/e;return"log"===i.BS&&(A=0===A?i.FP:ZC.FV(A,i.DY)),i.AX?i.iY+i.A9+(A-i.B0)*a:i.iY+i.F-i.A9-(A-i.B0)*a}var t=ZC.evalFn(i.BS,window);if(t&&t.valueToCoord){a=t.valueToCoord.call(i,A,{type:i.AF,x:i.iX,y:i.iY,width:i.I,height:i.F,offsetStart:i.A9,offsetEnd:i.BU,inversed:i.CM,mirrored:i.AX,minValue:i.B0,maxValue:i.BF,minValue_:i.FP,maxValue_:i.GW});return i.AX?i.iY+i.A9+a*(i.F-i.A9-i.BU):i.iY+i.F-i.A9-a*(i.F-i.A9-i.BU)}return i.iY},paint:function(){var A,i,e,a,t,C,n,l,r,Z,o,s,c,f,B,u,_,p,F,h=this;h.b(),"bubble"!==h.A.AF&&"scatter"!==h.A.AF||1!==h.V.length||(h.A9=h.F/2);var D=h.A0Q(),I=0,K=1,d=1,E={};for(i=0,e=h.A.BO.length;i<e;i++)h.A.BO[i].AP&&h.A.BO[i].TG&&("scale-y"===h.A.BO[i].BD.substring(0,7)&&h.A.BO[i].BA===h.BA&&I++,"scale-y"===h.A.BO[i].BD.substring(0,7)&&("default"===h.A.BO[i].BA?(E[h.A.BO[i].BD]=K,K++):(E[h.A.BO[i].BD]=d,d++)));var Y=E[h.BD],m="default"===h.BA,V=null,M=null;for(i=0,e=h.A.AY.A3.length;i<e;i++){var g=h.A.AY.A3[i],v=g.BW();if(-1!==ZC.AV(v,h.BD)){var G=h.A.BM(g.BW("k")[0]);V=G.AR(G.HC),M=g;break}}var X=8;null!==ZC._n_(h.IV.o.size)&&(X=ZC._i_(h.IV.o.size));var N=4;null!==ZC._n_(h.IG.o.size)&&(N=ZC._i_(h.IG.o.size));var b=ZC._i_(h.A.E[h.BD+"-distance"]||-1);h.VG&&(b=0),"default"===h.BA?(F=ZC._i_(h.A.N.E0/I),a=h.iX-(Y-1)*F,-1!==b&&(a=h.iX-b)):(F=ZC._i_(h.A.N.EA/I),a=h.iX+h.I+(Y-1)*F,-1!==b&&(a=h.iX+h.I+b));var W=a;if(h.A.HZ&&"scale-y"===h.BD&&(h.A.HZ.AP=!0,h.FP===h.B0&&h.GW===h.BF&&(h.A.HZ.AP=!1),h.A.HZ.AP&&0===h.A.HZ.B2.BK&&"default"===h.BA&&(a-=h.A.HZ.B2.I+h.B1/2)),h.E.iX=a,h.AP&&h.TG){for(var U=Math.ceil((h.A1-h.W)/(h.EJ-1)),S=Math.ceil((h.A1-h.W)/(h.M4-1)),Q=h.iStepMultiplier,O=3;O>0;O--)h.iStepMultiplier>O&&h.A1-h.W<=O*h.iStepMultiplier&&(Q=O);S*=Q,U*=Q;var k=0,x=h.AA*S/(h.FZ+1);if(t=h.G.usc()?h.G.mc():ZC.AM(h.A.K+"-scales-ml-0-c"),C=ZC.Q.EE(t,h.G.AC),n=h.G.usc()?h.G.mc():ZC.AM(h.A.K+"-scales-bl-0-c"),l=ZC.Q.EE(n,h.G.AC),h.TG||h.YK||null!==ZC._n_(h.A.o[h.BD])){if("inherit"===h.o["line-color"]&&-1!==D&&(h.B9=D),h.A.AJ["3d"]){if((c=ZC.DM.DE(h,h.A,a-ZC.AN.E1,a-ZC.AN.E1,h.iY-ZC.AN.E2,h.iY-ZC.AN.E2+h.F,-1,ZC.AN.FE+1,"y")).K=h.K+"-line",h.A.ES.true3d&&(h.A.ES["y-angle"]>0?c.MG=[1===h.L?-100:100,1,1]:c.MG=[1===h.L?100:-100,1,1]),h.A.CN.add(c),null!==ZC._n_(h.o.axis)){var w=new ZC.CZ(h);w.append(h.o.axis),w.parse(),w.A0=w.AE=w.B9,(c=ZC.DM.DE(w,h.A,a-ZC.AN.E1,a-ZC.AN.E1,h.iY-ZC.AN.E2,h.iY-ZC.AN.E2+h.F,-w.B1/2,w.B1/2,"y")).K=h.K+"-axis",h.A.CN.add(c)}}else{Z=[[W,h.iY+h.F],[W,h.iY]];var P=h.K;h.K+="-line",ZC.CO.paint(C,h,Z),h.K=P}var y=0,R=0,H=[],L=[];if(h.TG||h.YK){if(h.V.length>0&&h.D8.AP){var J=null===ZC._n_(h.D8.o["offset-start"])?0:ZC._i_(h.D8.o["offset-start"]),z=null===ZC._n_(h.D8.o["offset-end"])?0:ZC._i_(h.D8.o["offset-end"]);if(h.D8.o.items&&h.D8.o.items.length>0&&!h.A.AJ["3d"])for(h.GU=0,f=new ZC.HU(h),i=h.W;i<h.A1+(h.DF?1:0);i++)if(h.K9=i,i%S==0){o=i-h.W,B=h.GU%h.D8.o.items.length,f.append(h.D8.o.items[B]),f.K=h.K+"-guide-"+i,f.Z=n,f.parse(),r=h.AR(h.V[i]);var T=h.AR(h.V[Math.min(i+S,h.V.length-1)]);h.DF&&r===T&&(T=h.AR(h.V[Math.min(i-S,h.V.length-1)]),T=r-Math.abs(r-T)),f.iX=h.iX+J,f.iY=h.AX?r:T,f.I=h.I-J-z,f.F=Math.abs(r-T),f.paint(),h.GU++}if(h.D8.B1>0)for(h.GU=0,i=h.W;i<=h.A1+(h.DF?1:0);i++)if(h.K9=i,i===h.W||i===h.A1||i%S==0){(h.D8.E6.length>0||i===h.W||"log"===h.BS)&&((s=new ZC.CZ(h)).Z=s.C8=n,"log"===h.BS?ZC.AQ._int_(ZC.FV(h.V[i],h.DY))?s.copy(h.D8):s.copy(h.G8):s.copy(h.D8),s.IQ=BA,s.DH()&&s.parse()),Z=[],o=i-h.W;var q=h.iX+J,j=h.I-J-z;if(r=(h.BS,h.AR(h.V[i])),s.AP)if(h.A.AJ["3d"]){var $=new ZC.CZ(h);$.copy(s),null!==ZC._n_(h.o["scale-z"])&&null!==ZC._n_(A=h.o["scale-z"].guide)&&($.append(A),$.parse()),$.A0=$.AE=$.B9,c=ZC.DM.DE($,h.A,a-ZC.AN.E1,a-ZC.AN.E1,r-ZC.AN.E2-$.B1/2,r-ZC.AN.E2+$.B1/2,0,ZC.AN.FE,"y"),h.A.CN.add(c),s.A0=s.AE=s.B9,(c=ZC.DM.DE(s,h.A,q-ZC.AN.E1,q-ZC.AN.E1+j,r-ZC.AN.E2-s.B1/2,r-ZC.AN.E2+s.B1/2,ZC.AN.FE+2,ZC.AN.FE+2,"x")).K=h.K+"-guide-"+i,h.A.CN.add(c)}else Z.push([q,r],[q+j,r]),s.K=h.K+"-guide-"+i,ZC.CO.paint(l,s,Z);h.GU++}}if(h.V.length>0&&h.G8.AP&&x>2&&!h.A.AJ["3d"]){if(h.G8.o.items&&h.G8.o.items.length>0)for(f=new ZC.HU(h),i=h.W;i<h.A1+(h.DF?1:0);i++)if(h.K9=i,i%S==0)for(o=i-h.W,h.GU=0,u=1;u<=h.FZ;u++)B=h.GU%h.G8.o.items.length,f.append(h.G8.o.items[B]),f.K=h.K+"-guide-"+i+"-"+u,f.Z=h.G.usc()?h.G.mc():ZC.AM(h.A.K+"-scales-bl-0-c"),f.parse(),f.iX=h.iX,r=h.AX?h.iY+h.A9+o*h.AA+u*x:h.iY+h.F-h.A9-o*h.AA-(u+1)*x,f.iY=r,f.I=h.I,f.F=x,f.paint(),h.GU++;if(h.G8.B1>0&&"log"!==h.BS)for(i=h.W;i<h.A1+(h.DF?1:0);i++)if(h.K9=i,i===h.W||i===h.A1||i%S==0)for(o=i-h.W,h.GU=0,u=1;u<=h.FZ;u++)Z=[],(s=new ZC.CZ(h)).copy(h.G8),s.IQ=BA,s.DH()&&s.parse(),r="log"===h.BS?h.AR(h.V[i]+u*(h.V[i+1]-h.V[i])/(h.FZ+1)):h.AR(h.V[i]+u*U*(h.V[i+1]-h.V[i])/(h.FZ+1)),ZC.DS(r,h.iY,h.iY+h.F)&&(Z.push([h.iX,r],[h.iX+h.I,r]),s.AP&&(s.K=h.K+"-minor-guide-"+u,ZC.CO.paint(l,s,Z))),h.GU++}var AA,iA,eA;if(h.VL(l,D),h.V.length>0&&h.IV.AP){switch(h.IV.o.placement){case"inner":break;case"outer":k+=X;break;default:k+=X/2}for(h.GU=0,_=ZC.AV(h.V,0),i=h.W;i<=h.A1+(h.DF?1:0);i++){h.K9=i;var aA=-1;if((i===h.W||i===h.A1||i%S==0||ZC._b_(h.o["show-zero"])&&i===_)&&(Z=[],o=i-h.W,(h.IV.E6.length>0||i===h.W||"log"===h.BS)&&(s=new ZC.CZ(h),"log"===h.BS?ZC.AQ._int_(ZC.FV(h.V[i],h.DY))?s.copy(h.IV):(s.copy(h.IG),aA=X,X=N):s.copy(h.IV),"inherit"===h.IV.o["line-color"]&&-1!==D&&(s.B9=D),s.IQ=BA,s.DH()&&s.parse()),r=(h.BS,h.AR(h.V[i])),ZC.DS(r,h.A.N.iY,h.A.N.iY+h.A.N.F))){switch(s.o.placement){case"ref-right":Z.push([V,r],[V+X,r]);break;case"ref-left":Z.push([V,r],[V-X,r]);break;case"ref-auto":Z.push([V-X/2,r],[V+X/2,r]);break;case"inner":Z.push([a,r],[a+(m?X:-X),r]);break;case"outer":Z.push([a,r],[a-(m?X:-X),r]);break;default:Z.push([a+X/2,r],[a-X/2,r])}if(-1!==aA&&(X=aA,aA=-1),s.AP){for(iA=ZC._i_(s.o["offset-x"]||"0"),eA=ZC._i_(s.o["offset-y"]||"0"),AA=0;AA<Z.length;AA++)Z[AA][0]+=iA,Z[AA][1]+=eA;if(s.K=h.K+"-tick-"+i,h.A.AJ["3d"])if(h.A.ES.true3d){var tA,CA=[];for(AA=0;AA<Z.length;AA++)tA=new ZC.CE(h.A,Z[AA][0]-ZC.AN.E1,Z[AA][1]-ZC.AN.E2,0),CA.push([tA.EC[0],tA.EC[1]]);ZC.CO.paint(C,s,CA)}else{var nA=this.A.ES.angle||45;for(AA=0;AA<Z.length;AA++)Z[AA][0]-=ZC.EF(nA)*ZC.AN.FE/2,Z[AA][1]+=ZC.EL(nA)*ZC.AN.FE/2;ZC.CO.paint(C,s,Z)}else ZC.CO.paint(C,s,Z)}h.GU++}}}if(h.V.length>0&&h.IG.AP&&h.FZ>0&&x>5&&!h.A.AJ["3d"]&&"log"!==h.BS)for(i=h.W;i<h.A1+(h.DF?1:0);i++)if(h.K9=i,i===h.W||i===h.A1||i%S==0)for(o=i-h.W,h.GU=0,u=1;u<=h.FZ;u++){if(Z=[],(s=new ZC.CZ(h)).copy(h.IG),"inherit"===h.IG.o["line-color"]&&-1!==D&&(s.B9=D),s.IQ=BA,s.DH()&&s.parse(),r="log"===h.BS?h.AR(h.V[i]+u*(h.V[i+1]-h.V[i])/(h.FZ+1)):h.AR(h.V[i]+u*U*(h.V[i+1]-h.V[i])/(h.FZ+1)),ZC.DS(r,h.iY,h.iY+h.F)){switch(s.o.placement){case"ref-right":Z.push([V,r],[V+N,r]);break;case"ref-left":Z.push([V,r],[V-N,r]);break;case"ref-auto":Z.push([V-N/2,r],[V+N/2,r]);break;case"inner":Z.push([a,r],[a+(m?N:-N),r]);break;default:Z.push([a,r],[a-(m?N:-N),r]);break;case"cross":Z.push([a+N/2,r],[a-N/2,r])}if(s.AP){for(iA=ZC._i_(s.o["offset-x"]||"0"),eA=ZC._i_(s.o["offset-y"]||"0"),AA=0;AA<Z.length;AA++)Z[AA][0]+=iA,Z[AA][1]+=eA;s.K=h.K+"-minor-tick-"+i,ZC.CO.paint(C,s,Z)}}h.GU++}h.XV();var lA=null,rA=h.CL,ZA=h.DV,oA=function(A){var i;if(h.K9=A,o=A-h.W,(h.BQ.E6.length>0||A===h.W||!p||h.BQ.I0)&&(p=new ZC.DN(h)),p.copy(h.BQ),p.GN=h.K+"-item "+h.A.K+"-scale-item zc-scale-item",p.K=h.A.K+"-"+h.BD.replace(/\-/g,"_")+"-item_"+A,h.CL=rA,h.DV=ZA,h.Z5(BA),i=("piano"===h.A.AF||h.Q4)&&h.BY.length?h.FU(A+h.B0-h.FP):h.FU(A),h.BQ.I0){var e=h.A.H2();ZC._cp_({index:A,cnt:o,text:i},e),h.H8(h.BQ,p,null,e,h.BQ.MN)}if(null===ZC._n_(h.LW)||-1!==ZC.AV(h.LW,i)){switch(p.AK=i,p.Z=p.C8=h.G.usc()?h.G.mc():ZC.AM(h.A.K+"-scales-ml-0-c"),p.IP=h.G.usc()?ZC.AM(h.G.K+"-main"):ZC.AM(h.G.K+"-text"),p.parse(),"inherit"!==h.BQ.o["font-color"]&&"inherit"!==h.BQ.o.color||-1===D||(p.C2=D),p.IQ=BA,p.DH()&&p.parse(),p.o.placement){case"ref-left":p.iX=V-p.I-X;break;case"ref-right":p.iX=V+X;break;case"ref-auto":M&&M.R[A]?(M.FQ(A).setup(),M.FQ(A).iX<V?p.iX=V+X:p.iX=V-p.I-X):p.iX=V+X;break;case"middle":p.iX=a-p.I/2;break;case"inner":p.iX=m?a+X:a-p.I-X;break;default:p.iX=m?a-p.I-X:a+X}if("log"===h.BS?p.iY=h.AR(h.V[A])-p.F/2:p.iY=h.AR(h.V[A])-p.F/2+(h.AX?1:-1)*(h.DF?h.AA/2:0),lA=h.N2(p,lA,"v"),h.BQ.o["auto-align"]&&h.BQ.AB%180!=0){var t=m?1:-1;90===h.BQ.AB||270===h.BQ.AB?p.iX+=t*(p.I/2-p.F/2):ZC.DS(h.BQ.AB,0,90)||ZC.DS(h.BQ.AB,270,360)?(p.iX+=t*(p.I-p.I*ZC.EF(h.BQ.AB))/2,p.iY-=t*p.I*ZC.EL(h.BQ.AB)/2):ZC.DS(h.BQ.AB,90,270)&&(p.iX+=t*(p.I+p.I*ZC.EF(h.BQ.AB))/2,p.iY+=t*p.I*ZC.EL(h.BQ.AB)/2)}if(ZC.DS(p.iY+p.F/2,h.A.N.iY-1,h.A.N.iY+h.A.N.F+1)||h.A.AJ["3d"]){var C=h.X8(p,A,{items:0,lcoords:H,lstep:U,tdim:y,mdim:R,dim:"w",html:L});y=C.tdim,R=C.mdim,h.GU++}}};if(h.V.length>0&&h.BQ.AP)if("log"===h.BS){var sA=[];for(i=h.W;i<=h.A1;i++)ZC.AQ._int_(ZC.FV(h.V[i],h.DY))&&(h.GU=i,oA(i),sA.push(i));for(i=h.W;i<=h.A1;i++)-1===ZC.AV(sA,i)&&(h.GU=i,oA(i))}else for(h.GU=0,oA(h.W),h.GU=h.A1-h.W,oA(h.A1),-1!==(_=ZC.AV(h.V,0))&&ZC._b_(h.o["show-zero"])&&(h.GU=_,oA(_)),h.GU=1,i=h.W+1;i<h.A1;i++)i%U==0&&oA(i)}if(h.M.AP&&h.M.AK&&""!==h.M.AK){(p=new ZC.DN(h)).copy(h.M),p.K=h.A.K+"-"+h.BD.replace(/\-/g,"_")+"-item_title",p.GN=h.K+"-label "+h.A.K+"-scale-label zc-scale-label",p.AK=h.M.AK,p.Z=h.G.usc()?h.G.mc():ZC.AM(h.A.K+"-scales-ml-0-c"),p.IP=h.G.usc()?ZC.AM(h.G.K+"-main"):ZC.AM(h.G.K+"-text"),p.parse(),"inherit"!==h.M.o["font-color"]&&"inherit"!==h.M.o.color||-1===D||(p.C2=D);var cA=h.iY+(h.AX?h.A9:h.BU),fA=h.F-h.BU-h.A9;switch("chart"===p.o["center-point"]&&(cA=h.A.iY,fA=h.A.F),p.K2){case"top":p.iY=cA+p.I/2-p.F/2;break;case"middle":p.iY=cA+fA/2-p.F/2;break;case"bottom":p.iY=cA+fA-p.I/2-p.F/2}p.iX=m?a-p.I/2-p.F/2-k-R:a+R+p.F/2+k-p.I/2,h.M.iX=p.iX,h.M.iY=p.iY,p.AP&&(h.N2(p,null,"v",10),p.paint(),p.EP(),null===ZC._n_(p.o.tooltip)&&p.KK||L.push(ZC.AO.OB(h.A.G.K,h.A.K,p)))}L.length>0&&ZC.AM(h.A.A.K+"-map")&&(ZC.AM(h.A.A.K+"-map").innerHTML+=L.join(""))}}function BA(A){return A=(A=(A=(A=(A=A.replace(/%scale-last-position/g,h.A1-h.W)).replace(/(%c)|(%scale-position)/g,h.GU)).replace(/(%i)|(%scale-index)/g,h.K9)).replace(/(%v)|(%scale-value)/g,null!==ZC._n_(h.V[h.K9])?h.V[h.K9]:"")).replace(/(%l)|(%scale-label)/g,null!==ZC._n_(h.BY[h.K9])?h.BY[h.K9]:"")}}};ZC.QC=ZC.WA.CD(QC);