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.19 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.11_ES6 */ zingchart.setModule("toolbar3d"),function(){var o=!1;zingchart.bind(null,"label_click",function(t){if("trigger"===t.labelid){var a,r=[],e=["x","y","z","d","o"],i=["mainbox"];for(a=0;a<e.length;a++)i.push(e[a]+"box",e[a]+"minus",e[a]+"plus");for(a=0;a<i.length;a++)r.push({id:i[a],visible:!o});o?r.push({id:"trigger",borderRadius:5}):r.push({id:"trigger",borderRadius:"5 0 0 5"}),o=!o,zingchart.exec(t.id,"updateobject",{type:"label",data:r})}else{var d=zingchart.exec(t.id,"get3dview"),b=!1;switch(t.labelid){case"xminus":b=!0,d[ZC._[27]]-=5;break;case"xplus":b=!0,d[ZC._[27]]+=5;break;case"yminus":b=!0,d[ZC._[28]]-=5;break;case"yplus":b=!0,d[ZC._[28]]+=5;break;case"zminus":b=!0,d[ZC._[29]]-=5;break;case"zplus":b=!0,d[ZC._[29]]+=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(t.id,"set3dview",d)}}),zingchart.bind(null,"dataparse",function(t,a){var r=zingchart.getLoader(t.id),e=zingchart.getModules(r);if(-1!==ZC.AV(e,"toolbar3d"))for(var i=0,d=a[ZC._[16]].length;i<d;i++){var b=zingchart.getGraphInfo(r,a,i),l=b.graph.x+b.graph.width/2-125,c=a[ZC._[16]][i];c[ZC._[10]]=c[ZC._[10]]||[];var n={};c.options&&(n=c.options.toolbar3d||c.options);for(var h=c[ZC._[10]].length-1;h>=0;h--)c[ZC._[10]][h].dataToolbar3D&&c[ZC._[10]].splice(h,1);var u={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,u);var s={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,s);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 C={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,C);var v={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,v);var p={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,p);var _={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,_);var f={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,f);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 z={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,z);var Z={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,Z);var S={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,S);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 y={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,y);var w={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,w);var D={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,D),c[ZC._[10]].push(u,s,g,x,C,v,p,_,f,k,z,Z,S,m,y,w,D)}return a})}();