UNPKG

zingchart

Version:

Our JavaScript charting library is a commercial product. But the full branded version is free to try, forever.

8 lines (7 loc) 17.4 kB
/* 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 support@zingchart.com. Build 2.9.16-hf1 */ ZC.WJ.push("api"),zingchart.ABR=function(e,a,l){var n;document.getElementById("zc-fullscreen")&&(e="zc-fullscreen"),"string"==typeof(l=l||{})&&(l=JSON.parse(l));var s,i,r,t,o,d,p,u,C,g,h,_,c,f,Z,v,B,x,A,L,b,m,y,K=zingchart.getLoader(e),E=!(null!==ZC._n_(l.update)&&!ZC._b_(l.update)),O=null!==ZC._n_(l.history)&&ZC._b_(l.history),S="undefined"!=typeof l.smart&&ZC._b_(l.smart);if(K){switch(-1===ZC.AV(["resize","addplot","removeplot","modify","modifyplot","setnodevalue","addnode","removenode","setdata"],a)&&((i=K.FI()).params=l,ZC.AO.C0(a,K,i)),a){case"clearscroll":if(!(s=K.CB(l.graphid)))return null;s.HO&&s.HO.MB&&(s.HO.MB(),s.HO.unbind()),s.HZ&&s.HZ.MB&&(s.HZ.MB(),s.HZ.unbind());break;case"getbubblesize":return(s=K.CB(l.graphid))&&(r=s.I7(l.plotindex,l.plotid))?r.getSize(l.value||1):null;case"fastlinexycoords":var k=(s=K.AG[0]).BM("scale-x"),I=s.BM("scale-y");return k&&I?k.CM&&I.CM?[I.AR(l.val),k.AR(l.key)]:[k.AR(l.key),I.AR(l.val)]:[0,0];case"getscaleinfo":return(s=K.CB(l.graphid))&&(t=s.BM(l.name||""))?null!==ZC._n_(l.value)?t.AR?t.AR(l.value):null:null!==ZC._n_(l.coord)&&t.NJ?t.NJ(l.coord):null:null;case"getobjectinfo":if(!(s=K.CB(l.graphid)))return null;var V={id:"K",x:"iX",y:"iY",width:"I",height:"F",color:"C2",lineColor:"B9",lineWidth:"B1",borderColor:"BX",borderWidth:"AU",backgroundColor1:"A0",backgroundColor2:"AE"};switch(l.object){case"graph":for(g in i={},V)i[g]=s[V[g]];return ZC._cp_({type:s.AF},i),i;case"plotarea":for(g in i={},V)i[g]=s.N[V[g]];return i;case"legend":if(i={},s.BE)for(g in V)i[g]=s.BE[V[g]];return i;case"scale":if(!(t=s.BM(l.name||"")))return null;for(g in i={},V)i[g]=t[V[g]];return ZC._cp_({type:t.AF,text:t.M&&t.M.AK||"",datetime:null!==t.F7&&"date"===t.F7.o.type,step:t.E3,step_:t.SM,stepSize:t.AA,values:t.V,placement:t.BA,aperture:t.EM,zooming:t.GP,offsetStart:t.A9,offsetEnd:t.BU,sizeFactor:t.JU,inversed:t.CM},i),t.M&&""!==t.M.AK&&(i.label={x:t.M.iX,y:t.M.iY,width:t.M.I,height:t.M.F,angle:t.M.AB}),"v"===t.AF?ZC._cp_({progression:t.BS,logBase:t.DY,minValue:t.B0,maxValue:t.BF,minValue_:t.FP,maxValue_:t.GW},i):"scale-r"===l.name?ZC._cp_({refAngle:t.DL},i):ZC._cp_({minValue:t.V[t.W],maxValue:t.V[t.A1],minValue_:t.V[t.D4],maxValue_:t.V[t.DQ],minIndex:t.W,maxIndex:t.A1,minIndex_:t.D4,maxIndex_:t.DQ},i),i;case"plot":if(!(r=s.I7(l.plotindex,l.plotid)))return null;for(g in i={},V)i[g]=r[V[g]];var M=r.AP&&s.E["plot"+r.L+".visible"];return ZC._cp_({visible:M,id:r.HA,index:r.L,type:r.AF,text:r.AK,values:r.V,scales:r.BO,stacked:r.CG,stackType:r.KT,stack:r.DZ,xdata:r.K4},i),r.TV&&ZC._cp_({marker:{visible:r.TV.AP,size:r.TV.AI,type:r.TV.DJ,backgroundColor1:r.TV.A0,backgroundColor2:r.TV.AE,borderColor:r.TV.BX,borderWidth:r.TV.AU}},i),i;case"node":if(r=s.I7(l.plotindex,l.plotid)){if(A=null!==ZC._n_(l.nodeindex)?ZC._i_(l.nodeindex):0,!r.R[A])return null;for(g in o=r.FQ(A),(i={}).bounds=o.G.E[o.K+"-bounds"],V)-1!==ZC.AV(["x","y","width","height"],g)?i[g]=o[V[g]]:i[g]=o.P[V[g]];if(ZC._cp_({plotindex:r.L,index:o.L,size:o.AI,value:o.AD,keyvalue:o.BV,visible:r.AP,onviewport:o.J1},i),-1!==r.AF.indexOf("pie")&&ZC._cp_({angleStart:o.B4,angleEnd:o.BL,slice:o.A.PZ,npv:100*o.AD/o.A.A.KP[o.L]},i),r.K4){var z={};for(g in r.K4)r.K4[g]instanceof Array?z[g]=r.K4[g][A]:z[g]=r.K4[g];i.xdata=z}return i}return null}break;case"getxyinfo":var N=[],J=l.x,D=l.y,F=ZC._tx_(K.K);J/=F[0],D/=F[1];for(var R=0;R<K.AG.length;R++){s=K.AG[R];for(var j=0;j<s.AY.A3.length;j++){r=s.AY.A3[j];var X=s.BM(r.BW("k")[0]),G=s.BM(r.BW("v")[0]);if(X&&G){if(X.OK&&X.OK){var P=X.OK(X.CM?D:J),Y=X.OK(X.CM?D:J,null,!0);N.push({infotype:"key-scale",xydistance:ZC._a_(J-X.II(P)),graphid:s.K,plotidx:r.L,scalename:X.BD,scaleidx:P,scalepos:Y,scaletext:X.BY[P]||"",scalevalue:X.V[P],scalenumvalue:X.NJ(X.CM?D:J)})}if(G.NJ){var w=G.NJ(G.CM?J:D,!0);N.push({infotype:"value-scale",xydistance:ZC._a_(G.CM?J:D-G.AR(w)),graphid:s.K,plotidx:r.L,scalename:G.BD,scalevalue:w})}for(var H,T=ZC.MAX,W=null,Q=0,U=r.R.length;Q<U;Q++)if(null!==(o=r.FQ(Q)))switch(s.AJ.layout){case"xy":case"yx":var q=!1;"vbar"===o.A.AF?(H=o.getNodeData("h")||o.F,ZC.DS(J,o.iX-o.I/2,o.iX+o.I/2)&&ZC.DS(D,o.iY,o.iY+H)&&(q=!0,T=1)):"hbar"===o.A.AF&&(H=o.getNodeData("w")||o.I,ZC.DS(J,o.iX,o.iX+H)&&ZC.DS(D,o.iY-o.F/2,o.iY+o.F/2)&&(q=!0,T=1)),((n=Math.sqrt((o.iX-J)*(o.iX-J)+(o.iY-D)*(o.iY-D)))<T||q)&&(W={infotype:"node",xydistance:T,graphid:s.K,plotidx:r.L,plotid:r.HA,nodeidx:o.L,nodevalue:o.AD,nodekeyvalue:null===o.BV?X.V[o.L]:o.BV},q||(T=n));break;case"":var $=o.AC9();(n=Math.sqrt(($[0]-J)*($[0]-J)+($[1]-D)*($[1]-D)))<T&&(W={infotype:"node",xydistance:T,graphid:s.K,plotidx:r.L,plotid:r.HA,nodeidx:o.L,nodevalue:o.AD,nodekeyvalue:null===o.BV?X.V[o.L]:o.BV},T=n)}W&&N.push(W)}}}return N;case"update":l.objects?(s=K.CB(l.graphid))&&(s.P3(),s.R5()):null!==ZC._n_(l.graphid)&&(s=K.CB(l.graphid))?K.QL(function(){s.KC(S,S)}):K.KC();break;case"setcharttype":(s=K.CB(l.graphid))&&(null!==ZC._n_(l["preserve-state"])&&ZC._b_(l["preserve-state"])?K.E["graph-state-"+s.L]=JSON.stringify(s.E):K.E["graph-state-"+s.L]=null,K.o.graphset[s.L].type=s.o.type=s.AF=l.type,E&&K.KC());break;case"addgraph":K.o.graphset.push(l.data||{}),E&&K.KC();break;case"addplot":if(zingchart.SKIP.CSV=!0,_={},c=l.plotdata?"plotdata":"data",null!==ZC._n_(l[c])&&("object"==typeof l[c]?ZC._cp_(l[c],_):_=JSON.parse(l[c])),ZC._todash_(_),s=K.CB(l.graphid)){var ee=[];if(null===ZC._n_(s.o.series)&&(s.o.series=[]),h=(null!==ZC._n_(l.plotindex)||null!==ZC._n_(l.plotid))&&(r=s.I7(l.plotindex,l.plotid))?r.L:s.o.series.length,null!==ZC._n_(s.IY)&&s.IY.splice(h,0,!1),null!==ZC._n_(s.CF)){for(b in y={},s.CF)(m=ZC._i_(b.replace("p","")))<h?y[b]=s.CF[b]:y["p"+(m+1)]=s.CF[b];y["p"+h]={},s.CF=y}for(d=0,p=s.o.series.length;d<=p;d++)d===h&&ee.push(_),s.o.series[d]&&ee.push(s.o.series[d]);ZC.AO.C0("plot_add",K,{id:K.K,graphid:s.K,plotindex:h,data:_}),K.o.graphset[s.L].series=s.o.series=ee,K.E.json=ZC.GX(JSON.stringify(K.o)),s.M3("on-change"),E&&(s.E["from-api"]=!0,K.QL(function(){s.KC(S,S)}))}break;case"removeplot":if(zingchart.SKIP.CSV=!0,(s=K.CB(l.graphid))&&(r=s.I7(l.plotindex,l.plotid))){if(null!==ZC._n_(s.IY)&&s.IY.splice(r.L,1),null!==ZC._n_(s.CF)){for(b in y={},s.CF)(m=ZC._i_(b.replace("p","")))<r.L?y[b]=s.CF[b]:y["p"+(m-1)]=s.CF[b];s.CF=y}s.o.series.splice(r.L,1),K.o.graphset[s.L].series=s.o.series,K.E.json=ZC.GX(JSON.stringify(K.o)),ZC.AO.C0("plot_remove",K,{id:K.K,graphid:s.K,plotindex:r.L}),s.M3("on-change"),s.KC(S,S)}break;case"modify":if(zingchart.exec(K.K,"setmode",{mode:""}),zingchart.SKIP.CSV=!0,_={},null!==ZC._n_(l.data)&&("object"==typeof l.data?ZC._cp_(l.data,_):_=JSON.parse(l.data)),ZC._todash_(_),s=K.CB(l.graphid)){if(s.B7&&!s.B7.KU&&E&&(s.B7.I3=!1,s.E["force-preview-parse"]=!0),null!==ZC._n_(l.object))switch(l.object){case"title":ZC._cp_(_,s.o.title);break;case"plotset":case"series":ZC._cp_(_,s.o.series);break;case"plotarea":ZC._cp_(_,s.o.plotarea);break;case"legend":ZC._cp_(_,s.o.legend);break;case"plot":ZC._cp_(_,s.o.plot);break;case"map":ZC._cp_(_,s.o.shapes[0])}else ZC._cp_(_,s.o);switch(l.object){case"title":K.o.graphset[s.L].title=s.o.title;break;case"plotset":case"series":K.o.graphset[s.L].series=s.o.series;break;case"plotarea":K.o.graphset[s.L].plotarea=s.o.plotarea;break;case"legend":K.o.graphset[s.L].legend=s.o.legend;break;case"plot":K.o.graphset[s.L].plot=s.o.plot;break;case"map":K.o.graphset[s.L].shapes[0]=s.o.shapes[0],K.XS(K.o),s.o.shapes=K.o.graphset[s.L].shapes;break;default:K.o.graphset[s.L]=s.o}K.E.json=ZC.GX(JSON.stringify(K.o)),ZC.AO.C0("modify",K,{id:K.K,graphid:s.K,data:_,object:l.object}),s.M3("on-change"),E&&(s.E["from-api"]=!0,K.QL(function(){s.KC(S,S)}))}break;case"modifyplot":zingchart.SKIP.CSV=!0,_={},c=l.plotdata?"plotdata":"data",null!==ZC._n_(l[c])&&("object"==typeof l[c]?ZC._cp_(l[c],_):_=JSON.parse(l[c])),ZC._todash_(_),(s=K.CB(l.graphid))&&(r=s.I7(l.plotindex,l.plotid))&&(null===ZC._n_(K.o.graphset[s.L].series)&&(K.o.graphset[s.L].series=[]),ZC._cp_(_,s.o.series[r.L]),K.o.graphset[s.L].series[r.L]=s.o.series[r.L],K.E.json=ZC.GX(JSON.stringify(K.o)),ZC.AO.C0("plot_modify",K,{id:K.K,graphid:s.K,plotindex:r.L,data:_}),s.M3("on-change"),E&&(s.E["from-api"]=!0,K.QL(function(){s.KC(S,S)})));break;case"setnodevalue":zingchart.SKIP.CSV=!0,(s=K.CB(l.graphid))&&(r=s.I7(l.plotindex,l.plotid))&&(A=0,null!==ZC._n_(l.nodeindex)&&(A=ZC._i_(l.nodeindex)),n=0,null!==ZC._n_(l.value)&&(n=l.value),ZC.AO.C0("node_set",K,{id:K.K,graphid:s.K,plotindex:r.L,nodeindex:A,key:A,value:n,text:n}),K.o.graphset[s.L].series[r.L].values[A]=s.o.series[r.L].values[A]=n,K.E.json=ZC.GX(JSON.stringify(K.o)),s.M3("on-change"),E&&(s.E["from-api"]=!0,s.KC(S,S)));break;case"setscalevalues":if(zingchart.SKIP.CSV=!0,s=K.CB(l.graphid)){for(f=l.scale||"scale-x",Z=0,v=s.BO.length;Z<v;Z++)f===s.BO[Z].BD&&null!==ZC._n_(s.o[f])&&(s.o[f].values=l.values,K.o.graphset[s.L][f]=K.o.graphset[s.L][f]||{},K.o.graphset[s.L][f].values=l.values);K.E.json=ZC.GX(JSON.stringify(K.o)),s.M3("on-change"),E&&(s.E["from-api"]=!0,s.KC(S,S))}break;case"addscalevalue":if(zingchart.SKIP.CSV=!0,s=K.CB(l.graphid)){for(f=l.scale||"scale-x",Z=0,v=s.BO.length;Z<v;Z++)if(f===s.BO[Z].BD&&null!==ZC._n_(s.o[f])&&null!==ZC._n_(s.o[f].values)){for(A=null===ZC._n_(l.nodeindex)?s.o[f].values.length:ZC._i_(l.nodeindex),(x=s.o[f].values).push(null),d=x.length-1;d>A;d--)x[d]=x[d-1];x[A]=l.value||"",K.o.graphset[s.L][f].values=x}K.E.json=ZC.GX(JSON.stringify(K.o)),s.M3("on-change"),E&&(s.E["from-api"]=!0,s.KC(S,S))}break;case"removescalevalue":if(zingchart.SKIP.CSV=!0,s=K.CB(l.graphid)){for(f=l.scale||"scale-x",Z=0,v=s.BO.length;Z<v;Z++)f===s.BO[Z].BD&&null!==ZC._n_(s.o[f])&&null!==ZC._n_(s.o[f].values)&&(A=null===ZC._n_(l.nodeindex)?s.o[f].values.length-1:ZC._i_(l.nodeindex),(x=s.o[f].values).splice(A,1),K.o.graphset[s.L][f].values=x);K.E.json=ZC.GX(JSON.stringify(K.o)),s.M3("on-change"),E&&(s.E["from-api"]=!0,s.KC(S,S))}break;case"addnode":zingchart.exec(K.K,"setmode",{mode:""}),zingchart.SKIP.CSV=!0,s=K.CB(l.graphid);var ae=l.value instanceof Array;if(s&&(r=s.I7(l.plotindex,l.plotid))){B=s.o.series[r.L].values,A=null===ZC._n_(l.nodeindex)?B.length:l.nodeindex,B.push(null);var le=B.length;for(A=ZC.BR(0,ZC.CY(A,le)),d=le-1;d>A;d--)B[d]=B[d-1];if(B[A]=l.value,!ae)for(Z=0,v=s.BO.length;Z<v;Z++)if(f=s.BO[Z].BD,"k"===s.BO[Z].AF&&null!==ZC._n_(l[f+"-value"])&&null!==ZC._n_(s.o[f])&&null!==ZC._n_(s.o[f].values)){for((x=s.o[f].values).push(null),d=x.length-1;d>A;d--)x[d]=x[d-1];x[A]=l[f+"-value"],K.o.graphset[s.L][f].values=x}ZC.AO.C0("node_add",K,{id:K.K,graphid:s.K,plotindex:r.L,nodeindex:A,key:A,value:l.value,text:l.value}),K.o.graphset[s.L].series[r.L].values=s.o.series[r.L].values,K.E.json=ZC.GX(JSON.stringify(K.o)),s.M3("on-change"),E&&(s.E["from-api"]=!0,s.KC(S,S))}break;case"removenode":if(zingchart.exec(K.K,"setmode",{mode:""}),zingchart.SKIP.CSV=!0,(s=K.CB(l.graphid))&&(r=s.I7(l.plotindex,l.plotid))){B=s.o.series[r.L].values,A=null===ZC._n_(l.nodeindex)?r.R.length-1:ZC._i_(l.nodeindex);var ne=!0;if(null!==ZC._n_(l.nodekeyvalue))for(ne=!1,Z=0,v=r.R.length;Z<v;Z++){if(null===r.R[Z]&&Z===l.nodekeyvalue){ne=!0,A=Z;break}if(r.R[Z]&&null!==ZC._n_(r.R[Z].BV)&&r.R[Z].BV===l.nodekeyvalue){ne=!0,A=Z;break}}if(ne&&ZC.DS(A,0,r.R.length-1)){for(B.splice(A,1),Z=0,v=s.BO.length;Z<v;Z++)f=s.BO[Z].BD,"k"===s.BO[Z].AF&&null!==ZC._n_(l[f])&&ZC._b_(l[f])&&null!==ZC._n_(s.o[f])&&null!==ZC._n_(s.o[f].values)&&((x=s.o[f].values).splice(A,1),K.o.graphset[s.L][f].values=x);(ne||r.R[A])&&(ZC.AO.C0("node_remove",K,{id:K.K,graphid:s.K,plotindex:r.L,nodeindex:A,key:A,value:r.R[A]?r.R[A].AD:null,text:r.R[A]?r.R[A].AD:null}),K.o.graphset[s.L].series[r.L].values=s.o.series[r.L].values,K.E.json=ZC.GX(JSON.stringify(K.o)),s.M3("on-change"),E&&(s.E["from-api"]=!0,s.KC(S,S)))}}break;case"setdata":if(zingchart.exec(K.K,"setmode",{mode:""}),_={},null!==ZC._n_(l.data))if("object"==typeof l.data)zingchart.DEV.COPYDATA?_=JSON.parse(JSON.stringify(l.data)):ZC._cp_(l.data,_);else try{_=JSON.parse(l.data)}catch(fe){return K.O5(fe,"JSON parser"),!1}ZC._todash_(_),null===ZC._n_(l.preservezoom)&&(K.E.preservezoom=!1),s=null,null!==ZC._n_(l.graphid)&&(s=K.CB(l.graphid)),ZC.AO.C0("setdata",K,{id:K.K,graphid:s?s.K:null,data:_});var se,ie,re=["x","y","width","height"];if(s){for(se=0;se<re.length;se++)delete K.E["graph-"+s.L+"-"+re[se]];K.o.graphset[s.L]=s.o=_;var te=!1;if(_.widgets)te=!0;else if(_.shapes)for(d=0;d<_.shapes.length;d++)"zingchart.maps"===_.shapes[d].type&&(te=!0);te&&K.XS(K.o),K.E.json=ZC.GX(JSON.stringify(K.o)),E&&(s.E["from-api"]=!0,O&&K.NX++,K.QL(function(){K.parse(s.K),K.AG[s.L].paint()}))}else{for(se=0;se<re.length;se++)for(ie=0;ie<K.AG.length;ie++)delete K.E["graph-"+ie+"-"+re[se]];K.o=_,K.E.json=ZC.GX(JSON.stringify(K.o)),K.XS(K.o),E&&(O&&K.NX++,K.KC())}break;case"getseriesdata":return(s=K.CB(l.graphid))?null!==ZC._n_(l.plotindex)||null!==ZC._n_(l.plotid)?(r=s.I7(l.plotindex,l.plotid,0))?s.o.series[r.L]:null:s.o.series:null;case"setseriesdata":case"appendseriesdata":if(zingchart.exec(K.K,"setmode",{mode:""}),zingchart.SKIP.CSV=!0,s=K.CB(l.graphid)){if(null!==ZC._n_(l.plotindex)||null!==ZC._n_(l.plotid)?(r=s.I7(l.plotindex,l.plotid,0),_="setseriesdata"===a?{}:s.o.series&&s.o.series[r.L]?s.o.series[r.L]:{}):_="setseriesdata"===a?[]:s.o.series||[],null!==ZC._n_(l.data)&&("object"==typeof l.data?ZC._cp_(l.data,_):ZC._cp_(JSON.parse(l.data),_)),ZC._todash_(_),null!==ZC._n_(l.plotindex)||null!==ZC._n_(l.plotid))r=s.I7(l.plotindex,l.plotid,0),K.o.graphset[s.L].series[r.L]=s.o.series[r.L]=_,_.hasOwnProperty("visible")&&(s.E["plot"+r.L+".visible"]=_.visible);else for(K.o.graphset[s.L].series=s.o.series=_,d=0;d<_.length;d++)_[d].hasOwnProperty("visible")&&(s.E["plot"+d+".visible"]=_[d].visible);K.E.json=ZC.GX(JSON.stringify(K.o)),s.M3("on-change"),E&&K.QL(function(){s.KC(S,S)})}break;case"getseriesvalues":if(s=K.CB(l.graphid)){if(null!==ZC._n_(l.plotindex)||null!==ZC._n_(l.plotid))return(r=s.I7(l.plotindex,l.plotid,0))&&s.o.series[r.L].values||[];for(L=[],d=0,p=s.AY.A3.length;d<p;d++)L.push(s.o.series[d].values||[]);return L}return null;case"setseriesvalues":case"appendseriesvalues":zingchart.exec(K.K,"setmode",{mode:""}),zingchart.SKIP.CSV=!0,L=[],null!==ZC._n_(l.values)&&(L="object"==typeof l.values?l.values:JSON.parse(l.values));var oe=!1;if(s=K.CB(l.graphid)){if(null===ZC._n_(l.plotindex)&&null===ZC._n_(l.plotid)||(L=[L],oe=!0),oe||"setseriesvalues"!==a){for(r=s.I7(l.plotindex,l.plotid,0),d=0,p=L.length;d<p;d++)if(s.AY.A3[r.L+d])if("setseriesvalues"===a)oe&&(K.o.graphset[s.L].series[r.L+d].values=s.o.series[r.L+d].values=L[d]);else{var de=K.o.graphset[s.L].series[r.L+d].values,pe=L[d].length>0&&null!==ZC._n_(L[d][0])&&L[d][0].length>1,ue=!0;if(null!==ZC._n_(n=l.ignoreduplicates)&&(ue=ZC._b_(n)),pe){var Ce=de.length;for(u=0,C=L[d].length;u<C;u++){for(var ge=!1,he=Ce-1;he>=0;he--){if(L[d][u][0]>de[he][0]){de.push(L[d][u]),ge=!0;break}if(L[d][u][0]===de[he][0]){ge=!0;break}}ge&&ue||de.push(L[d][u])}}else for(u=0,C=L[d].length;u<C;u++)de.push(L[d][u]);l["max-values"]&&ZC._i_(l["max-values"])<de.length&&(de=de.slice(-l["max-values"])),K.o.graphset[s.L].series[r.L+d].values=s.o.series[r.L+d].values=de}}else{for(Z=0;Z<L.length;Z++)K.o.graphset[s.L].series[Z]=K.o.graphset[s.L].series[Z]||{},s.o.series[Z]=s.o.series[Z]||{},K.o.graphset[s.L].series[Z].values=s.o.series[Z].values=L[Z];if(s.o.series.length>L.length)for(Z=L.length;Z<s.o.series.length;Z++)delete K.o.graphset[s.L].series[Z],delete s.o.series[Z]}s.M3("on-change"),K.E.json=ZC.GX(JSON.stringify(K.o)),E&&s.KC(S,S)}break;case"togglelegend":if((s=K.CB(l.graphid))&&s.BE){var _e=!0;"undefined"==typeof s.BE.o.visible||s.BE.o.visible||(_e=!1),s.BE.o.visible=!_e,s.BE.clear(!1),s.BE.parse(),s.BE.paint()}break;case"legendminimize":case"legendmaximize":(s=K.CB(l.graphid))&&s.BE&&("legendminimize"===a?(ZC.AO.C0("legend_minimize",K,s.H2()),ZC.AO.C0("legend_hide",K,s.H2())):(ZC.AO.C0("legend_maximize",K,s.H2()),ZC.AO.C0("legend_show",K,s.H2())),s.BE.ND="legendminimize"===a,s.BE.WE(),s.BE.clear(!1),s.BE.parse(),s.BE.paint());break;case"legendscroll":(s=K.CB(l.graphid))&&s.BE&&(r=s.I7(l.plotindex,l.plotid))&&(s.BE.scrollTo(ZC._i_(r.L)),s.BE.WE(),s.BE.clear(!0,!0),s.BE.YL=!0,s.BE.parse(),s.BE.paint());break;case"toggledimension":(s=K.CB(l.graphid))&&K.A5H(s.K);break;case"getdata":return _=JSON.parse(K.E.json),ZC._todash_(_,!0),_;case"getoriginaljson":return _=JSON.parse(K.E.source),ZC._todash_(_,!0),_;case"getgraphlength":return K.AG.length;case"getplotlength":return(s=K.CB(l.graphid))?s.AY.A3.length:0;case"getscales":if(s=K.CB(l.graphid)){var ce=[];for(d=0;d<s.BO.length;d++)ce.push(s.BO[d].BD);return ce}return[];case"getnodelength":return(s=K.CB(l.graphid))&&(r=s.I7(l.plotindex,l.plotid))?r.R.length:null;case"getnodevalue":return(s=K.CB(l.graphid))&&(r=s.I7(l.plotindex,l.plotid))&&null!==ZC._n_(l.nodeindex)&&(o=r.R[ZC._i_(l.nodeindex)])?r.EI?[o.BV,o.AD]:o.AD:null;case"getplotvalues":if((s=K.CB(l.graphid))&&(r=s.I7(l.plotindex,l.plotid))){for(L=[],d=0,p=r.R.length;d<p;d++)r.R[d]?r.EI?L.push([r.R[d].BV,r.R[d].AD]):L.push(r.R[d].AD):L.push(null);return L}return null}}return null};