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.1 kB
JavaScript
/*
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.11
*/
ZC.WG.push("api"),zingchart.ABS=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,p,d,u,g,C,_,h,c,f,Z,v,A,x,b,L,B,y,K,E=zingchart.getLoader(e),m=!(null!==ZC._n_(l.update)&&!ZC._b_(l.update)),k=null!==ZC._n_(l.history)&&ZC._b_(l.history),S="undefined"!=typeof l.smart&&ZC._b_(l.smart);if(E){switch(-1===ZC.AV(["resize","addplot","removeplot","modify","modifyplot","setnodevalue","addnode","removenode","setdata"],a)&&((i=E.FF()).params=l,ZC.AQ.C0(a,E,i)),a){case"clearscroll":if(!(s=E.CA(l.graphid)))return null;s.HK&&s.HK.M7&&(s.HK.M7(),s.HK.unbind()),s.HV&&s.HV.M7&&(s.HV.M7(),s.HV.unbind());break;case"getbubblesize":return(s=E.CA(l.graphid))&&(r=s.I5(l.plotindex,l.plotid))?r.getSize(l.value||1):null;case"fastlinexycoords":var O=(s=E.AG[0]).BM("scale-x"),I=s.BM("scale-y");return O&&I?O.CK&&I.CK?[I.AR(l.val),O.AR(l.key)]:[O.AR(l.key),I.AR(l.val)]:[0,0];case"getscaleinfo":return(s=E.CA(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.NG?t.NG(l.coord):null:null;case"getobjectinfo":if(!(s=E.CA(l.graphid)))return null;var V={id:"K",x:"iX",y:"iY",width:"I",height:"F",color:"C2",lineColor:"B7",lineWidth:"B1",borderColor:"BX",borderWidth:"AU",backgroundColor1:"A0",backgroundColor2:"AE"};switch(l.object){case"graph":for(C in i={},V)i[C]=s[V[C]];return ZC._cp_({type:s.AF},i),i;case"plotarea":for(C in i={},V)i[C]=s.P[V[C]];return i;case"legend":if(i={},s.BE)for(C in V)i[C]=s.BE[V[C]];return i;case"scale":if(!(t=s.BM(l.name||"")))return null;for(C in i={},V)i[C]=t[V[C]];return ZC._cp_({type:t.AF,text:t.M&&t.M.AM||"",datetime:null!==t.F6&&"date"===t.F6.o.type,step:t.E1,step_:t.SF,stepSize:t.AB,values:t.V,placement:t.BA,aperture:t.EK,zooming:t.GN,offsetStart:t.A9,offsetEnd:t.BS,sizeFactor:t.JF,inversed:t.CK},i),t.M&&""!==t.M.AM&&(i.label={x:t.M.iX,y:t.M.iY,width:t.M.I,height:t.M.F,angle:t.M.AA}),"v"===t.AF?ZC._cp_({progression:t.BT,logBase:t.DX,minValue:t.AY,maxValue:t.BD,minValue_:t.FR,maxValue_:t.GU},i):"scale-r"===l.name?ZC._cp_({refAngle:t.DJ},i):ZC._cp_({minValue:t.V[t.W],maxValue:t.V[t.A1],minValue_:t.V[t.D6],maxValue_:t.V[t.DR],minIndex:t.W,maxIndex:t.A1,minIndex_:t.D6,maxIndex_:t.DR},i),i;case"plot":if(!(r=s.I5(l.plotindex,l.plotid)))return null;for(C in i={},V)i[C]=r[V[C]];var N=r.AN&&s.E["plot"+r.L+".visible"];return ZC._cp_({visible:N,id:r.H6,index:r.L,type:r.AF,text:r.AM,values:r.V,scales:r.BO,stacked:r.CE,stackType:r.KR,stack:r.E0,xdata:r.K0},i),r.TQ&&ZC._cp_({marker:{visible:r.TQ.AN,size:r.TQ.AI,type:r.TQ.DV,backgroundColor1:r.TQ.A0,backgroundColor2:r.TQ.AE,borderColor:r.TQ.BX,borderWidth:r.TQ.AU}},i),i;case"node":if(r=s.I5(l.plotindex,l.plotid)){if(b=null!==ZC._n_(l.nodeindex)?ZC._i_(l.nodeindex):0,!r.R[b])return null;for(C in o=r.FK(b),(i={}).bounds=o.H.E[o.K+"-bounds"],V)-1!==ZC.AV(["x","y","width","height"],C)?i[C]=o[V[C]]:i[C]=o.O[V[C]];if(ZC._cp_({plotindex:r.L,index:o.L,size:o.AI,value:o.AD,keyvalue:o.BV,onviewport:o.IY},i),-1!==r.AF.indexOf("pie")&&ZC._cp_({angleStart:o.B4,angleEnd:o.BL,slice:o.A.PT,npv:100*o.AD/o.A.A.KO[o.L]},i),r.K0){var F={};for(C in r.K0)r.K0[C]instanceof Array?F[C]=r.K0[C][b]:F[C]=r.K0[C];i.xdata=F}return i}return null}break;case"getxyinfo":var G=[],D=l.x,M=l.y,R=ZC._tx_(E.K);D/=R[0],M/=R[1];for(var z=0;z<E.AG.length;z++){s=E.AG[z];for(var J=0;J<s.AZ.A3.length;J++){r=s.AZ.A3[J];var j=s.BM(r.BW("k")[0]),Q=s.BM(r.BW("v")[0]);if(j&&Q){if(j.OG&&j.OG){var W=j.OG(j.CK?M:D),P=j.OG(j.CK?M:D,null,!0);G.push({infotype:"key-scale",xydistance:ZC._a_(D-j.IE(W)),graphid:s.K,plotidx:r.L,scalename:j.BF,scaleidx:W,scalepos:P,scaletext:j.BY[W]||"",scalevalue:j.V[W],scalenumvalue:j.NG(j.CK?M:D)})}if(Q.NG){var w=Q.NG(Q.CK?D:M,!0);G.push({infotype:"value-scale",xydistance:ZC._a_(Q.CK?D:M-Q.AR(w)),graphid:s.K,plotidx:r.L,scalename:Q.BF,scalevalue:w})}for(var X,Y=ZC.MAX,H=null,T=0,U=r.R.length;T<U;T++)if(null!==(o=r.FK(T)))switch(s.AJ.layout){case"xy":case"yx":var q=!1;"vbar"===o.A.AF?(X=o.getNodeData("h")||o.F,ZC.DP(D,o.iX-o.I/2,o.iX+o.I/2)&&ZC.DP(M,o.iY,o.iY+X)&&(q=!0,Y=1)):"hbar"===o.A.AF&&(X=o.getNodeData("w")||o.I,ZC.DP(D,o.iX,o.iX+X)&&ZC.DP(M,o.iY-o.F/2,o.iY+o.F/2)&&(q=!0,Y=1)),((n=Math.sqrt((o.iX-D)*(o.iX-D)+(o.iY-M)*(o.iY-M)))<Y||q)&&(H={infotype:"node",xydistance:Y,graphid:s.K,plotidx:r.L,plotid:r.H6,nodeidx:o.L,nodevalue:o.AD,nodekeyvalue:null===o.BV?j.V[o.L]:o.BV},q||(Y=n));break;case"":var $=o.ACA();(n=Math.sqrt(($[0]-D)*($[0]-D)+($[1]-M)*($[1]-M)))<Y&&(H={infotype:"node",xydistance:Y,graphid:s.K,plotidx:r.L,plotid:r.H6,nodeidx:o.L,nodevalue:o.AD,nodekeyvalue:null===o.BV?j.V[o.L]:o.BV},Y=n)}H&&G.push(H)}}}return G;case"update":l.objects?(s=E.CA(l.graphid))&&(s.OY(),s.QZ()):null!==ZC._n_(l.graphid)&&(s=E.CA(l.graphid))?E.QF(function(){s.K8(S,S)}):E.K8();break;case"setcharttype":(s=E.CA(l.graphid))&&(null!==ZC._n_(l["preserve-state"])&&ZC._b_(l["preserve-state"])?E.E["graph-state-"+s.L]=JSON.stringify(s.E):E.E["graph-state-"+s.L]=null,E.o.graphset[s.L].type=s.o.type=s.AF=l.type,m&&E.K8());break;case"addgraph":E.o.graphset.push(l.data||{}),m&&E.K8();break;case"addplot":if(zingchart.SKIP.CSV=!0,h={},c=l.plotdata?"plotdata":"data",null!==ZC._n_(l[c])&&("object"==typeof l[c]?ZC._cp_(l[c],h):h=JSON.parse(l[c])),ZC._todash_(h),s=E.CA(l.graphid)){var ee=[];if(null===ZC._n_(s.o.series)&&(s.o.series=[]),_=(null!==ZC._n_(l.plotindex)||null!==ZC._n_(l.plotid))&&(r=s.I5(l.plotindex,l.plotid))?r.L:s.o.series.length,null!==ZC._n_(s.IW)&&s.IW.splice(_,0,!1),null!==ZC._n_(s.CD)){for(B in K={},s.CD)(y=ZC._i_(B.replace("p","")))<_?K[B]=s.CD[B]:K["p"+(y+1)]=s.CD[B];K["p"+_]={},s.CD=K}for(p=0,d=s.o.series.length;p<=d;p++)p===_&&ee.push(h),s.o.series[p]&&ee.push(s.o.series[p]);ZC.AQ.C0("plot_add",E,{id:E.K,graphid:s.K,plotindex:_,data:h}),E.o.graphset[s.L].series=s.o.series=ee,E.E.json=ZC.GW(JSON.stringify(E.o)),s.M1("on-change"),m&&(s.E["from-api"]=!0,E.QF(function(){s.K8(S,S)}))}break;case"removeplot":if(zingchart.SKIP.CSV=!0,(s=E.CA(l.graphid))&&(r=s.I5(l.plotindex,l.plotid))){if(null!==ZC._n_(s.IW)&&s.IW.splice(r.L,1),null!==ZC._n_(s.CD)){for(B in K={},s.CD)(y=ZC._i_(B.replace("p","")))<r.L?K[B]=s.CD[B]:K["p"+(y-1)]=s.CD[B];s.CD=K}s.o.series.splice(r.L,1),E.o.graphset[s.L].series=s.o.series,E.E.json=ZC.GW(JSON.stringify(E.o)),ZC.AQ.C0("plot_remove",E,{id:E.K,graphid:s.K,plotindex:r.L}),s.M1("on-change"),s.K8(S,S)}break;case"modify":if(zingchart.SKIP.CSV=!0,h={},null!==ZC._n_(l.data)&&("object"==typeof l.data?ZC._cp_(l.data,h):h=JSON.parse(l.data)),ZC._todash_(h),s=E.CA(l.graphid)){if(s.B9&&(s.B9.HZ=!1,s.E["force-preview-parse"]=!0),null!==ZC._n_(l.object))switch(l.object){case"title":ZC._cp_(h,s.o.title);break;case"plotset":case"series":ZC._cp_(h,s.o.series);break;case"plotarea":ZC._cp_(h,s.o.plotarea);break;case"legend":ZC._cp_(h,s.o.legend);break;case"plot":ZC._cp_(h,s.o.plot);break;case"map":ZC._cp_(h,s.o.shapes[0])}else ZC._cp_(h,s.o);switch(l.object){case"title":E.o.graphset[s.L].title=s.o.title;break;case"plotset":case"series":E.o.graphset[s.L].series=s.o.series;break;case"plotarea":E.o.graphset[s.L].plotarea=s.o.plotarea;break;case"legend":E.o.graphset[s.L].legend=s.o.legend;break;case"plot":E.o.graphset[s.L].plot=s.o.plot;break;case"map":E.o.graphset[s.L].shapes[0]=s.o.shapes[0],E.XR(E.o),s.o.shapes=E.o.graphset[s.L].shapes;break;default:E.o.graphset[s.L]=s.o}E.E.json=ZC.GW(JSON.stringify(E.o)),ZC.AQ.C0("modify",E,{id:E.K,graphid:s.K,data:h,object:l.object}),s.M1("on-change"),m&&(s.E["from-api"]=!0,E.QF(function(){s.K8(S,S)}))}break;case"modifyplot":zingchart.SKIP.CSV=!0,h={},c=l.plotdata?"plotdata":"data",null!==ZC._n_(l[c])&&("object"==typeof l[c]?ZC._cp_(l[c],h):h=JSON.parse(l[c])),ZC._todash_(h),(s=E.CA(l.graphid))&&(r=s.I5(l.plotindex,l.plotid))&&(null===ZC._n_(E.o.graphset[s.L].series)&&(E.o.graphset[s.L].series=[]),ZC._cp_(h,s.o.series[r.L]),E.o.graphset[s.L].series[r.L]=s.o.series[r.L],E.E.json=ZC.GW(JSON.stringify(E.o)),ZC.AQ.C0("plot_modify",E,{id:E.K,graphid:s.K,plotindex:r.L,data:h}),s.M1("on-change"),m&&(s.E["from-api"]=!0,E.QF(function(){s.K8(S,S)})));break;case"setnodevalue":zingchart.SKIP.CSV=!0,(s=E.CA(l.graphid))&&(r=s.I5(l.plotindex,l.plotid))&&(b=0,null!==ZC._n_(l.nodeindex)&&(b=ZC._i_(l.nodeindex)),n=0,null!==ZC._n_(l.value)&&(n=l.value),ZC.AQ.C0("node_set",E,{id:E.K,graphid:s.K,plotindex:r.L,nodeindex:b,key:b,value:n,text:n}),E.o.graphset[s.L].series[r.L].values[b]=s.o.series[r.L].values[b]=n,E.E.json=ZC.GW(JSON.stringify(E.o)),s.M1("on-change"),m&&(s.E["from-api"]=!0,s.K8(S,S)));break;case"setscalevalues":if(zingchart.SKIP.CSV=!0,s=E.CA(l.graphid)){for(f=l.scale||"scale-x",Z=0,v=s.BO.length;Z<v;Z++)f===s.BO[Z].BF&&null!==ZC._n_(s.o[f])&&(s.o[f].values=l.values,E.o.graphset[s.L][f]=E.o.graphset[s.L][f]||{},E.o.graphset[s.L][f].values=l.values);E.E.json=ZC.GW(JSON.stringify(E.o)),s.M1("on-change"),m&&(s.E["from-api"]=!0,s.K8(S,S))}break;case"addscalevalue":if(zingchart.SKIP.CSV=!0,s=E.CA(l.graphid)){for(f=l.scale||"scale-x",Z=0,v=s.BO.length;Z<v;Z++)if(f===s.BO[Z].BF&&null!==ZC._n_(s.o[f])&&null!==ZC._n_(s.o[f].values)){for(b=null===ZC._n_(l.nodeindex)?s.o[f].values.length:ZC._i_(l.nodeindex),(x=s.o[f].values).push(null),p=x.length-1;p>b;p--)x[p]=x[p-1];x[b]=l.value||"",E.o.graphset[s.L][f].values=x}E.E.json=ZC.GW(JSON.stringify(E.o)),s.M1("on-change"),m&&(s.E["from-api"]=!0,s.K8(S,S))}break;case"removescalevalue":if(zingchart.SKIP.CSV=!0,s=E.CA(l.graphid)){for(f=l.scale||"scale-x",Z=0,v=s.BO.length;Z<v;Z++)f===s.BO[Z].BF&&null!==ZC._n_(s.o[f])&&null!==ZC._n_(s.o[f].values)&&(b=null===ZC._n_(l.nodeindex)?s.o[f].values.length-1:ZC._i_(l.nodeindex),(x=s.o[f].values).splice(b,1),E.o.graphset[s.L][f].values=x);E.E.json=ZC.GW(JSON.stringify(E.o)),s.M1("on-change"),m&&(s.E["from-api"]=!0,s.K8(S,S))}break;case"addnode":zingchart.SKIP.CSV=!0,s=E.CA(l.graphid);var ae=l.value instanceof Array;if(s&&(r=s.I5(l.plotindex,l.plotid))){A=s.o.series[r.L].values,b=null===ZC._n_(l.nodeindex)?A.length:l.nodeindex,A.push(null);var le=A.length;for(b=ZC.BQ(0,ZC.CY(b,le)),p=le-1;p>b;p--)A[p]=A[p-1];if(A[b]=l.value,!ae)for(Z=0,v=s.BO.length;Z<v;Z++)if(f=s.BO[Z].BF,"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),p=x.length-1;p>b;p--)x[p]=x[p-1];x[b]=l[f+"-value"],E.o.graphset[s.L][f].values=x}ZC.AQ.C0("node_add",E,{id:E.K,graphid:s.K,plotindex:r.L,nodeindex:b,key:b,value:l.value,text:l.value}),E.o.graphset[s.L].series[r.L].values=s.o.series[r.L].values,E.E.json=ZC.GW(JSON.stringify(E.o)),s.M1("on-change"),m&&(s.E["from-api"]=!0,s.K8(S,S))}break;case"removenode":if(zingchart.SKIP.CSV=!0,(s=E.CA(l.graphid))&&(r=s.I5(l.plotindex,l.plotid))){A=s.o.series[r.L].values,b=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,b=Z;break}if(r.R[Z]&&null!==ZC._n_(r.R[Z].BV)&&r.R[Z].BV===l.nodekeyvalue){ne=!0,b=Z;break}}if(ne&&ZC.DP(b,0,r.R.length-1)){for(A.splice(b,1),Z=0,v=s.BO.length;Z<v;Z++)f=s.BO[Z].BF,"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(b,1),E.o.graphset[s.L][f].values=x);(ne||r.R[b])&&(ZC.AQ.C0("node_remove",E,{id:E.K,graphid:s.K,plotindex:r.L,nodeindex:b,key:b,value:r.R[b]?r.R[b].AD:null,text:r.R[b]?r.R[b].AD:null}),E.o.graphset[s.L].series[r.L].values=s.o.series[r.L].values,E.E.json=ZC.GW(JSON.stringify(E.o)),s.M1("on-change"),m&&(s.E["from-api"]=!0,s.K8(S,S)))}}break;case"setdata":if(h={},null!==ZC._n_(l.data))if("object"==typeof l.data)zingchart.DEV.COPYDATA?h=JSON.parse(JSON.stringify(l.data)):ZC._cp_(l.data,h);else try{h=JSON.parse(l.data)}catch(fe){return E.O0(fe,"JSON parser"),!1}ZC._todash_(h),null===ZC._n_(l.preservezoom)&&(E.E.preservezoom=!1),s=null,null!==ZC._n_(l.graphid)&&(s=E.CA(l.graphid)),ZC.AQ.C0("setdata",E,{id:E.K,graphid:s?s.K:null,data:h});var se,ie,re=["x","y","width","height"];if(s){for(se=0;se<re.length;se++)delete E.E["graph-"+s.L+"-"+re[se]];E.o.graphset[s.L]=s.o=h;var te=!1;if(h.widgets)te=!0;else if(h.shapes)for(p=0;p<h.shapes.length;p++)"zingchart.maps"===h.shapes[p].type&&(te=!0);te&&E.XR(E.o),E.E.json=ZC.GW(JSON.stringify(E.o)),m&&(s.E["from-api"]=!0,k&&E.NV++,E.QF(function(){E.parse(s.K),E.AG[s.L].paint()}))}else{for(se=0;se<re.length;se++)for(ie=0;ie<E.AG.length;ie++)delete E.E["graph-"+ie+"-"+re[se]];E.o=h,E.E.json=ZC.GW(JSON.stringify(E.o)),E.XR(E.o),m&&(k&&E.NV++,E.K8())}break;case"getseriesdata":return(s=E.CA(l.graphid))?null!==ZC._n_(l.plotindex)||null!==ZC._n_(l.plotid)?(r=s.I5(l.plotindex,l.plotid,0))?s.o.series[r.L]:null:s.o.series:null;case"setseriesdata":case"appendseriesdata":if(zingchart.SKIP.CSV=!0,s=E.CA(l.graphid)){if(null!==ZC._n_(l.plotindex)||null!==ZC._n_(l.plotid)?(r=s.I5(l.plotindex,l.plotid,0),h="setseriesdata"===a?{}:s.o.series&&s.o.series[r.L]?s.o.series[r.L]:{}):h="setseriesdata"===a?[]:s.o.series||[],null!==ZC._n_(l.data)&&("object"==typeof l.data?ZC._cp_(l.data,h):ZC._cp_(JSON.parse(l.data),h)),ZC._todash_(h),null!==ZC._n_(l.plotindex)||null!==ZC._n_(l.plotid))r=s.I5(l.plotindex,l.plotid,0),E.o.graphset[s.L].series[r.L]=s.o.series[r.L]=h,h.hasOwnProperty("visible")&&(s.E["plot"+r.L+".visible"]=h.visible);else for(E.o.graphset[s.L].series=s.o.series=h,p=0;p<h.length;p++)h[p].hasOwnProperty("visible")&&(s.E["plot"+p+".visible"]=h[p].visible);E.E.json=ZC.GW(JSON.stringify(E.o)),s.M1("on-change"),m&&E.QF(function(){s.K8(S,S)})}break;case"getseriesvalues":if(s=E.CA(l.graphid)){if(null!==ZC._n_(l.plotindex)||null!==ZC._n_(l.plotid))return(r=s.I5(l.plotindex,l.plotid,0))&&s.o.series[r.L].values||[];for(L=[],p=0,d=s.AZ.A3.length;p<d;p++)L.push(s.o.series[p].values||[]);return L}return null;case"setseriesvalues":case"appendseriesvalues":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=E.CA(l.graphid)){if(null===ZC._n_(l.plotindex)&&null===ZC._n_(l.plotid)||(L=[L],oe=!0),oe||"setseriesvalues"!==a){for(r=s.I5(l.plotindex,l.plotid,0),p=0,d=L.length;p<d;p++)if(s.AZ.A3[r.L+p])if("setseriesvalues"===a)oe&&(E.o.graphset[s.L].series[r.L+p].values=s.o.series[r.L+p].values=L[p]);else{var pe=E.o.graphset[s.L].series[r.L+p].values,de=L[p].length>0&&null!==ZC._n_(L[p][0])&&L[p][0].length>1,ue=!0;if(null!==ZC._n_(n=l.ignoreduplicates)&&(ue=ZC._b_(n)),de){var ge=pe.length;for(u=0,g=L[p].length;u<g;u++){for(var Ce=!1,_e=ge-1;_e>=0;_e--){if(L[p][u][0]>pe[_e][0]){pe.push(L[p][u]),Ce=!0;break}if(L[p][u][0]===pe[_e][0]){Ce=!0;break}}Ce&&ue||pe.push(L[p][u])}}else for(u=0,g=L[p].length;u<g;u++)pe.push(L[p][u]);l["max-values"]&&ZC._i_(l["max-values"])<pe.length&&(pe=pe.slice(-l["max-values"])),E.o.graphset[s.L].series[r.L+p].values=s.o.series[r.L+p].values=pe}}else{for(Z=0;Z<L.length;Z++)E.o.graphset[s.L].series[Z]=E.o.graphset[s.L].series[Z]||{},s.o.series[Z]=s.o.series[Z]||{},E.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 E.o.graphset[s.L].series[Z],delete s.o.series[Z]}s.M1("on-change"),E.E.json=ZC.GW(JSON.stringify(E.o)),m&&s.K8(S,S)}break;case"togglelegend":if((s=E.CA(l.graphid))&&s.BE){var he=!0;"undefined"==typeof s.BE.o.visible||s.BE.o.visible||(he=!1),s.BE.o.visible=!he,s.BE.clear(!1),s.BE.parse(),s.BE.paint()}break;case"legendminimize":case"legendmaximize":(s=E.CA(l.graphid))&&s.BE&&("legendminimize"===a?(ZC.AQ.C0("legend_minimize",E,s.GZ()),ZC.AQ.C0("legend_hide",E,s.GZ())):(ZC.AQ.C0("legend_maximize",E,s.GZ()),ZC.AQ.C0("legend_show",E,s.GZ())),s.BE.NA="legendminimize"===a,s.BE.WB(),s.BE.clear(!1),s.BE.parse(),s.BE.paint());break;case"legendscroll":(s=E.CA(l.graphid))&&s.BE&&(r=s.I5(l.plotindex,l.plotid))&&(s.BE.scrollTo(ZC._i_(r.L)),s.BE.WB(),s.BE.clear(!0,!0),s.BE.YJ=!0,s.BE.parse(),s.BE.paint());break;case"toggledimension":(s=E.CA(l.graphid))&&E.A5G(s.K);break;case"getdata":return h=JSON.parse(E.E.json),ZC._todash_(h,!0),h;case"getoriginaljson":return h=JSON.parse(E.E.source),ZC._todash_(h,!0),h;case"getgraphlength":return E.AG.length;case"getplotlength":return(s=E.CA(l.graphid))?s.AZ.A3.length:0;case"getscales":if(s=E.CA(l.graphid)){var ce=[];for(p=0;p<s.BO.length;p++)ce.push(s.BO[p].BF);return ce}return[];case"getnodelength":return(s=E.CA(l.graphid))&&(r=s.I5(l.plotindex,l.plotid))?r.R.length:null;case"getnodevalue":return(s=E.CA(l.graphid))&&(r=s.I5(l.plotindex,l.plotid))&&null!==ZC._n_(l.nodeindex)&&(o=r.R[ZC._i_(l.nodeindex)])?r.EG?[o.BV,o.AD]:o.AD:null;case"getplotvalues":if((s=E.CA(l.graphid))&&(r=s.I5(l.plotindex,l.plotid))){for(L=[],p=0,d=r.R.length;p<d;p++)r.R[p]?r.EG?L.push([r.R[p].BV,r.R[p].AD]):L.push(r.R[p].AD):L.push(null);return L}return null}}return null};