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) 5.18 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 */ zingchart.setModule("toolbar3d"),function(){var o=!1;zingchart.bind(null,"label_click",function(a){if("trigger"===a.labelid){var t,e=[],r=["x","y","z","d","o"],i=["mainbox"];for(t=0;t<r.length;t++)i.push(r[t]+"box",r[t]+"minus",r[t]+"plus");for(t=0;t<i.length;t++)e.push({id:i[t],visible:!o});o?e.push({id:"trigger",borderRadius:5}):e.push({id:"trigger",borderRadius:"5 0 0 5"}),o=!o,zingchart.exec(a.id,"updateobject",{type:"label",data:e})}else{var d=zingchart.exec(a.id,"get3dview"),b=!1;switch(a.labelid){case"xminus":b=!0,d["x-angle"]-=5;break;case"xplus":b=!0,d["x-angle"]+=5;break;case"yminus":b=!0,d["y-angle"]-=5;break;case"yplus":b=!0,d["y-angle"]+=5;break;case"zminus":b=!0,d["z-angle"]-=5;break;case"zplus":b=!0,d["z-angle"]+=5;break;case"dminus":b=!0,d.depth-=2,d.depth=Math.max(5,d.depth);break;case"dplus":b=!0,d.depth+=2,d.depth=Math.min(100,d.depth);break;case"ominus":b=!0,d.zoom-=.05,d.zoom=Math.max(.2,d.zoom);break;case"oplus":b=!0,d.zoom+=.05,d.zoom=Math.min(2,d.zoom)}b&&zingchart.exec(a.id,"set3dview",d)}}),zingchart.bind(null,"dataparse",function(a,t){var e=zingchart.getLoader(a.id),r=zingchart.getModules(e);if(-1!==ZC.AV(r,"toolbar3d"))for(var i=0,d=t.graphset.length;i<d;i++){var b=zingchart.getGraphInfo(e,t,i),l=b.graph.x+b.graph.width/2-125,c=t.graphset[i];c.labels=c.labels||[];var n={};c.options&&(n=c.options.toolbar3d||c.options);for(var h=c.labels.length-1;h>=0;h--)c.labels[h].dataToolbar3D&&c.labels.splice(h,1);var s={text:"3D",id:"trigger",dataToolbar3D:!0,x:l-25,y:17,width:25,height:20,backgroundColor:"#ddd",borderRadius:o?"5 0 0 5":5,fontSize:11,bold:!0,shadow:!0,hoverState:{backgroundColor:"#f90"}};ZC._cp_(n.trigger,s);var u={text:"",id:"mainbox",visible:o,dataToolbar3D:!0,x:l,y:5,width:250,height:45,backgroundColor:"#ddd",borderWidth:1,borderColor:"#ccc",borderRadius:5,shadow:!0,flat:!0};ZC._cp_(n.mainbox,u);var g={text:"X-Axis",id:"xbox",visible:o,dataToolbar3D:!0,x:l+5,y:10,width:40,height:35,fontSize:10,verticalAlign:"top",borderRadius:5,backgroundColor:"#eee",flat:!0};ZC._cp_(n.box,g);var x={id:"xminus",visible:o,dataToolbar3D:!0,text:"-",x:l+10,y:28,width:13,height:13,backgroundColor:"#ccc",borderRadius:5,fontSize:10,hoverState:{backgroundColor:"#f90"}};ZC._cp_(n.button,x);var v={id:"xplus",visible:o,dataToolbar3D:!0,text:"+",x:l+27,y:28,width:13,height:13,backgroundColor:"#ccc",borderRadius:5,fontSize:10,hoverState:{backgroundColor:"#f90"}};ZC._cp_(n.button,v);var p={text:"Y-Axis",id:"ybox",visible:o,dataToolbar3D:!0,x:l+5+50,y:10,width:40,height:35,fontSize:10,verticalAlign:"top",borderRadius:5,backgroundColor:"#eee",flat:!0};ZC._cp_(n.box,p);var C={id:"yminus",visible:o,dataToolbar3D:!0,text:"-",x:l+10+50,y:28,width:13,height:13,backgroundColor:"#ccc",borderRadius:5,fontSize:10,hoverState:{backgroundColor:"#f90"}};ZC._cp_(n.button,C);var f={id:"yplus",visible:o,dataToolbar3D:!0,text:"+",x:l+27+50,y:28,width:13,height:13,backgroundColor:"#ccc",borderRadius:5,fontSize:10,hoverState:{backgroundColor:"#f90"}};ZC._cp_(n.button,f);var z={text:"Z-Axis",id:"zbox",visible:o,dataToolbar3D:!0,x:l+5+100,y:10,width:40,height:35,fontSize:10,verticalAlign:"top",borderRadius:5,backgroundColor:"#eee",flat:!0};ZC._cp_(n.box,z);var k={id:"zminus",visible:o,dataToolbar3D:!0,text:"-",x:l+10+100,y:28,width:13,height:13,backgroundColor:"#ccc",borderRadius:5,fontSize:10,hoverState:{backgroundColor:"#f90"}};ZC._cp_(n.button,k);var _={id:"zplus",visible:o,dataToolbar3D:!0,text:"+",x:l+27+100,y:28,width:13,height:13,backgroundColor:"#ccc",borderRadius:5,fontSize:10,hoverState:{backgroundColor:"#f90"}};ZC._cp_(n.button,_);var S={text:"Depth",id:"dbox",visible:o,dataToolbar3D:!0,x:l+5+150,y:10,width:40,height:35,fontSize:10,verticalAlign:"top",borderRadius:5,backgroundColor:"#eee",flat:!0};ZC._cp_(n.box,S);var y={id:"dminus",visible:o,dataToolbar3D:!0,text:"-",x:l+10+150,y:28,width:13,height:13,backgroundColor:"#ccc",borderRadius:5,fontSize:10,hoverState:{backgroundColor:"#f90"}};ZC._cp_(n.button,y);var m={id:"dplus",visible:o,dataToolbar3D:!0,text:"+",x:l+27+150,y:28,width:13,height:13,backgroundColor:"#ccc",borderRadius:5,fontSize:10,hoverState:{backgroundColor:"#f90"}};ZC._cp_(n.button,m);var w={text:"Zoom",id:"obox",visible:o,dataToolbar3D:!0,x:l+5+200,y:10,width:40,height:35,fontSize:10,verticalAlign:"top",borderRadius:5,backgroundColor:"#eee",flat:!0};ZC._cp_(n.box,w);var D={id:"ominus",visible:o,dataToolbar3D:!0,text:"-",x:l+10+200,y:28,width:13,height:13,backgroundColor:"#ccc",borderRadius:5,fontSize:10,hoverState:{backgroundColor:"#f90"}};ZC._cp_(n.button,D);var Z={id:"oplus",visible:o,dataToolbar3D:!0,text:"+",x:l+27+200,y:28,width:13,height:13,backgroundColor:"#ccc",borderRadius:5,fontSize:10,hoverState:{backgroundColor:"#f90"}};ZC._cp_(n.button,Z),c.labels.push(s,u,g,x,v,p,C,f,z,k,_,S,y,m,w,D,Z)}return t})}();