UNPKG

js-pkg

Version:
10 lines 973 kB
/*! * filename: ej.chart.min.js * version : 15.3.0.33 * Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ (function(n){typeof define=="function"&&define.amd?define(["./../common/ej.globalize.min","./../common/ej.core.min","./../common/ej.data.min","./../common/ej.scroller.min"],n):n()})(function(){ej.Ej3DRender=function(){},function(n){var r;ej.Ej3DRender.Polygons=[];ej.Ej3DRender.prototype={matrix3D:function(){},vector3D:function(){},BSPTreeBuilder:function(){},Graphics3D:function(){},polygon3D:function(){}};r=new ej.Ej3DRender;r.vector3D.prototype={x:"",y:"",z:"",Epsilon:1e-5,isValid:function(n){return!isNaN(n.x)&&!isNaN(n.y)&&!isNaN(n.z)},vector3D:function(n,t){this.x=n.x;this.y=n.y;this.z=t},vector3D:function(n,t,i){return this.x=n,this.y=t,this.z=i,{x:n,y:t,z:i}},vector3DMinus:function(n,t){return this.vector3D(n.x-t.x,n.y-t.y,n.z-t.z)},vector3DPlus:function(n,t){return this.vector3D(n.x+t.x,n.y+t.y,n.z+t.z)},vector3DMultiply:function(n,t){var i=n.y*t.z-t.y*n.z,r=n.z*t.x-t.z*n.x,u=n.x*t.y-t.x*n.y;return this.vector3D(i,r,u)},vector3dAND:function(n,t){return n.x*t.x+n.y*t.y+n.z*t.z},vector3DStarMultiply:function(n,t){var i=n.x*t,r=n.y*t,u=n.z*t;return this.vector3D(i,r,u)},getLength:function(n){var t=this.vector3dAND(n,n);return Math.sqrt(t)},normalize:function(){var n=this.getLength();x/=n;y/=n;z/=n},getNormal:function(n,t,i){var f=this.vector3DMinus(n,t),e=this.vector3DMinus(i,t),u=this.vector3DMultiply(f,e),r=this.getLength(u);return r<this.Epsilon&&(r=0),{x:u.x/r,y:u.y/r,z:u.z/r}}};r.matrix3D.prototype={MATRIX_SIZE:4,matrix3D:function(n){for(var i=[],t=0;t<n;t++)i[t]=this.createArray(n);return i},isAffine:function(n){return n[0][3]==0&&n[1][3]==0&&n[2][3]==0&&n[3][3]==1},createArray:function(n){for(var i=[],t=0;t<n;++t)i[t]=0;return i},getIdentity:function(){for(var t=this.matrix3D(this.MATRIX_SIZE),n=0;n<this.MATRIX_SIZE;n++)t[n][n]=1;return t},getInvertal:function(n){for(var t,i=this.getIdentity(),r=0;r<this.MATRIX_SIZE;r++)for(t=0;t<this.MATRIX_SIZE;t++)i[r][t]=this.getMinor(n,r,t);return i=this.transposed(i),this.getMatrixMultiple(1/this.getDeterminant(n),i)},getMatrixMultiple:function(n,t){for(var r,i=0;i<t.length;i++)for(r=0;r<t[i].length;r++)t[i][r]=t[i][r]*n;return t},getMatrixVectorMutiple:function(n,t){var r=n[0][0]*t.x+n[1][0]*t.y+n[2][0]*t.z+n[3][0],u=n[0][1]*t.x+n[1][1]*t.y+n[2][1]*t.z+n[3][1],f=n[0][2]*t.x+n[1][2]*t.y+n[2][2]*t.z+n[3][2],i;return this.isAffine(n)||(i=1/(n[0][3]*t.x+n[1][3]*t.y+n[2][3]*t.z+n[3][3]),r*=i,u*=i,f*=i),{x:r,y:u,z:f}},getMatrixVectorAnd:function(n,t){var i=n[0][0]*t.x+n[1][0]*t.y+n[2][0]*t.z,u=n[0][1]*t.x+n[1][1]*t.y+n[2][1]*t.z,f=n[0][2]*t.x+n[1][2]*t.y+n[2][2]*t.z;return r.vector3D.prototype.vector3D(i,u,f)},getMatrixAdd:function(n,t){for(var i,u=this.matrix3D(4),r=0;r<4;r++)for(i=0;i<4;i++)u[r][i]=n[r][i]+t[r][i];return u},getMatrixMultiplication:function(n,t){for(var i,f,r,o,e=this.getIdentity(),u=0;u<this.MATRIX_SIZE;u++)for(i=0;i<this.MATRIX_SIZE;i++){for(f=0,r=0;r<this.MATRIX_SIZE;r++)f+=n[r][i]*t[u][r],o=f;e[u][i]=f}return e},getMatrixEqual:function(n,t){for(var i,u=!0,r=0;r<n.length;r++)for(i=0;i<n.length;i++)n[r][i]!=t[r][i]&&(u=!1);return u},getMatrixNotEqual:function(n,t){for(var i,u=!0,r=0;r<n.length;r++)for(i=0;i<n.length;i++)n[r][i]!=t[r][i]&&(u=!1);return!u},getMinor:function(n,t,i){return((t+i)%2==0?1:-1)*this.getDeterminant(this.getMMtr(n,t,i))},getMMtr:function(n,t,i){for(var o,u,s,f=n.length-1,e=this.createArray(f),r=0;r<f;r++)for(o=r>=t?r+1:r,e[r]=this.createArray(f),u=0;u<f;u++)s=u>=i?u+1:u,e[r][u]=n[o][s];return e},getDeterminant:function(n){var u=n.length,r=0,i,t,f;if(u<2)r=n[0][0];else for(i=1,t=0;t<u;t++)f=this.getMMtr(n,t,0),r+=i*n[t][0]*this.getDeterminant(f),i=i>0?-1:1;return r},transform:function(n,t,i){var r=this.getIdentity();return r[3][0]=n,r[3][1]=t,r[3][2]=i,r},turn:function(n){var t=this.getIdentity();return t[0][0]=Math.cos(n),t[2][0]=-Math.sin(n),t[0][2]=Math.sin(n),t[2][2]=Math.cos(n),t},tilt:function(n){var t=this.getIdentity();return t[1][1]=Math.cos(n),t[2][1]=Math.sin(n),t[1][2]=-Math.sin(n),t[2][2]=Math.cos(n),t},transposed:function(n){for(var t,r=this.getIdentity(),i=0;i<this.MATRIX_SIZE;i++)for(t=0;t<this.MATRIX_SIZE;t++)r[i][t]=n[t][i];return r},shear:function(n,t,i,r,u,f){var e=this.getIdentity();return e[0]=n,e[0]=t,e[1]=i,e[1]=r,e[2]=u,e[2]=f,e}};r.Graphics3D.prototype={addVisual:function(n){return n==null||f.test(n)?-1:(n.Graphics3D=this,e.add(n))},getVisualCount:function(){return ej.Ej3DRender.Polygons.length()},remove:function(n){ej.Ej3DRender.Polygons.Remove(n)},clearVisual:function(){ej.Ej3DRender.Polygons=null},getVisual:function(){return ej.Ej3DRender.Polygons},prepareView:function(n,t,i,r,u,f){arguments.length==0?e.build():(ej.Ej3DRender.transform==null?ej.Ej3DRender.transform=ej.EjSvgRender.chartTransform3D.transform3D(u):ej.Ej3DRender.transform.mViewport=u,ej.Ej3DRender.tree||(ej.Ej3DRender.tree=[]),ej.Ej3DRender.transform.Rotation=i,ej.Ej3DRender.transform.Tilt=r,ej.Ej3DRender.transform.Depth=t,ej.Ej3DRender.transform.PerspectiveAngle=n,ej.EjSvgRender.chartTransform3D.transform(ej.Ej3DRender.transform),ej.Ej3DRender.tree[f._id]=e.build())},view:function(n,i,r,u,f,e,o){var h=32767,s;if(arguments.length==2){if(n==null)return;s=t.vector3D(0,0,h);this.drawBspNode3D(ej.Ej3DRender.tree[i._id],s,n,i)}else{if(n==null)return;ej.Ej3DRender.transform==null?ej.Ej3DRender.transform=ej.EjSvgRender.chartTransform3D.transform3D(f):ej.Ej3DRender.transform.mViewport=f;ej.Ej3DRender.transform.Rotation=r;ej.Ej3DRender.transform.Tilt=u;ej.Ej3DRender.transform.Depth=o;ej.Ej3DRender.transform.PerspectiveAngle=e;ej.EjSvgRender.chartTransform3D.transform(ej.Ej3DRender.transform);s=t.vector3D(0,0,h);this.drawBspNode3D(ej.Ej3DRender.tree[i._id],s,n,i)}},draw3DElement:function(n,t){n.Plane.element?n.Plane.element.tag=="text"||n.Plane.element.tag=="dataLabel"?f.drawText(n.Plane,t):n.Plane.element.tag=="polyline"?f.drawPolyLine(n.Plane,t):n.Plane.element.tag=="template"?f.drawTemplate(n.Plane,t):f.drawLine(n.Plane,t):f.draw(n.Plane,t)},drawBspNode3D:function(n,i,r,u){if(n!=null&&ej.Ej3DRender.transform!=null)for(;;){var e=t.vector3dAND(f.getNormal(ej.EjSvgRender.chartTransform3D.result(ej.Ej3DRender.transform),n.Plane.VectorPoints),i);if(e>n.Plane.D){if(n.Front!=null&&this.drawBspNode3D(n.Front,i,r,u),this.draw3DElement(n,u),n.Back!=null){n=n.Back;continue}}else if(n.Back!=null&&this.drawBspNode3D(n.Back,i,r,u),this.draw3DElement(n,u),n.Front!=null){n=n.Front;continue}break}}};r.BSPTreeBuilder.prototype={EPSILON:.0005,Polygon:[],add:function(n){return ej.Ej3DRender.Polygons.push(n),ej.Ej3DRender.Polygons.length-1},remove:function(n){ej.Ej3DRender.Polygons.splice(n,1)},clear:function(){ej.Ej3DRender.Polygons=[]},count:function(){return ej.Ej3DRender.Polygons.length},getNext:function(n,t){return n>=t?n-t:n<0?n+t:n},getNodeCount:function(n){return n==null?0:1+this.getNodeCount(n.Back)+this.getNodeCount(n.Front)},vector3DIndexClassification:function(n,t,i){return{index:t,result:i,vector:n,isCuttingBackPoint:!1,cuttingBackPairIndex:null,alreadyCuttedBack:!1,isCuttingFrontPoint:!1,cuttingFrontPairIndex:null,alreadyCuttedFront:!1}},classifyPoint:function(n,t){var i="OnPlane",u=-t.D-r.vector3D.prototype.vector3dAND(n,t.normal);return u>this.EPSILON?i="OnBack":u<-this.EPSILON&&(i="OnFront"),i},classifyPolygon:function(n,t){var i=t.Points,f,h,s;if(i==null)return"Unknown";var e=0,o=0,u=0,c=n.normal,l=n.D;for(f=0,h=i.length;f<h;f++)if(s=-l-r.vector3D.prototype.vector3dAND(i[f],c),s>this.EPSILON?e++:s<-this.EPSILON?o++:u++,e>0&&o>0)break;return u==i.length?"OnPlane":o+u==i.length?"ToRight":e+u==i.length?"ToLeft":"Unknown"},splitPolygon:function(i,r){var w=[],b=[],rt,v,e,k,ut,u,o,ft;if(i.Points!=null){var l=[],s=[],h=[],k,d,g=i.Points.length;for(u=0;u<g;u++){var nt=i.Points[u],y=i.Points[this.getNext(u+1,g)],p=this.classifyPoint(nt,r),a=this.classifyPoint(y,r),c=this.vector3DIndexClassification(nt,l.length,p);if(l.push(c),p!=a&&p!="OnPlane"&&a!="OnPlane"){var it=t.vector3DMinus(nt,y),et=t.vector3DMinus(t.vector3DStarMultiply(r.normal,-r.D),y),ot=t.vector3dAND(et,r.normal),st=ot/t.vector3dAND(r.normal,it),ht=t.vector3DPlus(y,t.vector3DStarMultiply(it,st)),tt=this.vector3DIndexClassification(ht,l.length,"OnPlane");l.push(tt);s.push(tt);h.push(tt)}else if(p=="OnPlane"){if(rt=i.Points[this.getNext(u-1,g)],v=this.classifyPoint(rt,r),v==a)continue;if(v!="OnPlane"&&a!="OnPlane")s.push(c),h.push(c);else if(v=="OnPlane")switch(a){case"OnBack":s.push(c);break;case"OnFront":h.push(c)}else if(a=="OnPlane")switch(v){case"OnBack":s.push(c);break;case"OnFront":h.push(c)}}}if(h.length!=0||s.length!=0){for(u=0;u<s.length-1;u+=2)e=s[u],o=s[u+1],e.CuttingBackPoint=!0,o.CuttingBackPoint=!0,e.CuttingBackPairIndex=o.index,o.CuttingBackPairIndex=e.index;for(u=0;u<h.length-1;u+=2)e=h[u],o=h[u+1],e.CuttingFrontPoint=!0,o.CuttingFrontPoint=!0,e.CuttingFrontPairIndex=o.index,o.CuttingFrontPairIndex=e.index;for(u=0;u<s.length-1;u++)(e=s[u],e.alreadyCuttedBack)||(k=this.cutOutBackPolygon(l,e),k.length>2&&(ut=f.polygon3D(k,i),w.push(n.extend({},ut))));for(u=0;u<h.length-1;u++)(o=h[u],o.alreadyCuttedFront)||(d=this.cutOutFrontPolygon(l,o),d.length>2&&(ft=f.polygon3D(d,i),b.push(n.extend({},ft))))}}else w.push(i),b.push(i);return{BackP:w,FrontP:b}},cutOutFrontPolygon:function(n,t){for(var r=[],i=t,s,u,f,e,o;;)if(i.alreadyCuttedFront=!0,r.push(i.vector),s=n[i.CuttingFrontPairIndex],i.CuttingFrontPoint)if(s.alreadyCuttedFront)if(u=n[this.getNext(i.index-1,n.length)],f=n[this.getNext(i.index+1,n.length)],u.result!="OnFront"||u.alreadyCuttedFront){if(f.result!="OnFront"||f.alreadyCuttedFront)return r;i=f}else i=u;else i=s;else if(e=n[this.getNext(i.index-1,n.length)],o=n[this.getNext(i.index+1,n.length)],e.result=="OnBack"||e.alreadyCuttedFront){if(o.result=="OnBack"||o.alreadyCuttedFront)return r;i=o}else i=e;return r},cutOutBackPolygon:function(n,t){for(var f=[],i=t,e,r,u;;)if(i.alreadyCuttedBack=!0,f.push(i.vector),e=n[i.CuttingBackPairIndex],i.CuttingBackPoint)if(e.alreadyCuttedBack)if(r=n[this.getNext(i.index-1,n.length)],u=n[this.getNext(i.index+1,n.length)],r.result!="OnBack"||r.alreadyCuttedBack){if(u.result!="OnBack"||u.alreadyCuttedBack)return f;i=u}else i=r;else i=e;else if(r=n[this.getNext(i.index-1,n.length)],u=n[this.getNext(i.index+1,n.length)],r.result=="OnFront"||r.alreadyCuttedBack){if(u.result=="OnFront"||u.alreadyCuttedBack)return f;i=u}else i=r;return f},build:function(){var f,e,o,i,s,h,c,n,l,t,r,u;if(arguments[0]){if(f=arguments[0],f.length<1)return null;for(e={Back:null,Front:null,Plane:null},o=f[0],e.Plane=o,i=[],s=[],h=1,c=f.length;h<c;h++)if(n=f[h],n!=o){l=this.classifyPolygon(o,n);switch(l){case"OnPlane":case"ToRight":s.push(n);break;case"ToLeft":i.push(n);break;case"Unknown":if(n.element&&(n.element.tag=="line"||n.element.tag=="text"))i.push(n);else{for(t=this.splitPolygon(n,o),r=0;r<t.BackP.length;r++)t.BackP[r].Name=t.BackP[r].Name+"back",i.push(t.BackP[r]);for(u=0;u<t.FrontP.length;u++)t.FrontP[u].Name=t.FrontP[u].Name+"front",s.push(t.FrontP[u])}}}return i.length>0&&(e.Back=this.build(i)),s.length>0&&(e.Front=this.build(s)),e}return this.build(ej.Ej3DRender.Polygons)}};r.polygon3D.prototype={epsilon:1e-5,normal:{x:0,y:0,z:0},vector:new(new ej.Ej3DRender).vector3D,polygon3D:function(n,t,i,r,u,f,e,o){var h,s;if(arguments.length==3)this.calcNormal(arguments[0],arguments[1],arguments[2]);else return arguments.length==2?(n=arguments[0],this.calcNormal(n[0],n[1],n[2]),this.vectorPoints=n,this.calcNormal(this.vectorPoints),s=arguments[1],s.Normal=this.normal,s.normal=this.normal,s.Points=n,s.VectorPoints=this.vectorPoints,s.IsSplitted=!0,s.d=this.d,s.D=this.d,s):(this.calcNormal(n[0],n[1],n[2]),this.vectorPoints=n,this.calcNormal(this.vectorPoints),h={Tag:"path",Parent:arguments[arguments.length-1]},s={Normal:this.normal,normal:this.normal,Points:n,VectorPoints:this.vectorPoints,Index:i,Tag:t,Name:o?o:null,StrokeThickness:u,Opacity:f,Fill:e,d:this.d,D:this.d},arguments.length!=1&&(s.Element=h),s)},createLine:function(n,i,r,u,f,e){var s=n.width,o=[];return o[0]=t.vector3D(i,r,e),o[1]=t.vector3D(i+s,f+s,e),o[2]=t.vector3D(u,f,e),this.line3D(n,o)},createPolyline:function(n,i){if(n.length==2){var r=n[1];n.push(t.vector3D(r.x,r.y,r.z))}return this.polyLine3D(i,n)},polyLine3D:function(n,t){var i=this.polygon3D(t);return i.element=n,i},line3D:function(n,t){var i=this.polygon3D(t);return i.element=n,i},text3D:function(n,t){var i=this.polygon3D(t);return i.element=n,i},createCylinder:function(n,r,u,f,e,o,s,h,c,l,a,v){var y=0,rt,ut,k,d,b=24,g=360/b,nt=Math.PI/180,ft=parseFloat((n.z+r.z)/2),w=[],p=[],tt=[],it=[],et=r.y-n.y<r.z-n.z?parseFloat((r.y-n.y)/2):parseFloat((r.z-n.z)/2),ot=r.x-n.x<r.z-n.z?parseFloat((r.x-n.x)/2):parseFloat((r.z-n.z)/2),st=parseFloat((n.x+r.x)/2),ht=parseFloat((n.y+r.y)/2);switch(e){case"bar":case"stackingbar":case"stackingbar100":for(b++;b--;)ut=parseFloat(ht+et*Math.cos(y*g*nt)),k=parseFloat(ft+et*Math.sin(y*g*nt)),p[y]={Y:ut,Z:k},tt.push(t.vector3D(n.x,p[y].Y,p[y].Z)),it.push(t.vector3D(r.x,p[y].Y,p[y].Z)),y>0&&(d=[t.vector3D(n.x,p[y-1].Y,p[y-1].Z),t.vector3D(r.x,p[y-1].Y,p[y-1].Z),t.vector3D(r.x,p[y].Y,p[y].Z),t.vector3D(n.x,p[y].Y,p[y].Z)],w[y+1]=this.polygon3D(d,u,f,s,0,c,s,"_"+(y+1).toString()+"_"+a,v),i.addVisual(w[y+1])),y++;break;case"column":case"stackingcolumn":case"stackingcolumn100":for(b++;b--;)rt=parseFloat(st+ot*Math.cos(y*g*nt)),k=parseFloat(ft+ot*Math.sin(y*g*nt)),p[y]={X:rt,Z:k},tt.push(t.vector3D(p[y].X,n.y,p[y].Z)),it.push(t.vector3D(p[y].X,r.y,p[y].Z)),y>0&&(d=[t.vector3D(p[y-1].X,n.y,p[y-1].Z),t.vector3D(p[y-1].X,r.y,p[y-1].Z),t.vector3D(p[y].X,r.y,p[y].Z),t.vector3D(p[y].X,n.y,p[y].Z)],w[y+1]=this.polygon3D(d,u,f,s,0,c,s,"_"+(y+1).toString()+"_"+a,v),i.addVisual(w[y+1])),y++}return w[0]=this.polygon3D(it,u,f,o,0,c,s,"_0_"+a,v),w[1]=this.polygon3D(tt,u,f,o,h,c,s,"_1_"+a,v),i.addVisual(w[0]),i.addVisual(w[1]),w},createBox:function(n,r,u,f,e,o,s,h,c,l,a,v){var y=[],p=[t.vector3D(n.x,n.y,n.z),t.vector3D(r.x,n.y,n.z),t.vector3D(r.x,r.y,n.z),t.vector3D(n.x,r.y,n.z)],w=[t.vector3D(n.x,n.y,r.z),t.vector3D(r.x,n.y,r.z),t.vector3D(r.x,r.y,r.z),t.vector3D(n.x,r.y,r.z)],b=[t.vector3D(n.x,n.y,r.z),t.vector3D(r.x,n.y,r.z),t.vector3D(r.x,n.y,n.z),t.vector3D(n.x,n.y,n.z)],k=[t.vector3D(n.x,r.y,r.z),t.vector3D(r.x,r.y,r.z),t.vector3D(r.x,r.y,n.z),t.vector3D(n.x,r.y,n.z)],d=[t.vector3D(n.x,n.y,n.z),t.vector3D(n.x,n.y,r.z),t.vector3D(n.x,r.y,r.z),t.vector3D(n.x,r.y,n.z)],g=[t.vector3D(r.x,n.y,n.z),t.vector3D(r.x,n.y,r.z),t.vector3D(r.x,r.y,r.z),t.vector3D(r.x,r.y,n.z)],v;return arguments[10]?(y[0]=this.polygon3D(p,u,f,o,h,c,s,"_0_"+a,v),y[1]=this.polygon3D(w,u,f,o,h,c,s,"_1_"+a,v),y[2]=this.polygon3D(b,u,f,o,h,c,s,"_2_"+a,v),y[3]=this.polygon3D(k,u,f,o,h,c,s,"_3_"+a,v),y[4]=this.polygon3D(d,u,f,o,h,c,s,"_4_"+a,v),y[5]=this.polygon3D(g,u,f,o,h,c,s,"_5_"+a,v)):(v=arguments[arguments.length-1],y[0]=this.polygon3D(p,u,f,o,h,c,s,"_0_"+f,v),y[1]=this.polygon3D(w,u,f,o,h,c,s,"_1_"+f,v),y[2]=this.polygon3D(b,u,f,o,h,c,s,"_2_"+f,v),y[3]=this.polygon3D(k,u,f,o,h,c,s,"_3_"+f,v),y[4]=this.polygon3D(d,u,f,o,h,c,s,"_4_"+f,v),y[5]=this.polygon3D(g,u,f,o,h,c,s,"_5_"+f,v)),l?(i.addVisual(y[0]),i.addVisual(y[1]),i.addVisual(y[2]),i.addVisual(y[3]),i.addVisual(y[4]),i.addVisual(y[5])):(i.addVisual(y[5]),i.addVisual(y[4]),i.addVisual(y[0]),i.addVisual(y[1]),i.addVisual(y[2]),i.addVisual(y[3])),y},calcNormal:function(){var n,r;if(arguments.length>=3){var u=arguments[0],e=arguments[1],o=arguments[2],s=t.vector3DMinus(u,e),h=t.vector3DMinus(o,e),f=t.vector3DMultiply(s,h),i=t.getLength(f);i<this.epsilon&&(i=1);this.normal=t.vector3D(f.x/i,f.y/i,f.z/i);this.d=-(this.normal.x*u.x+this.normal.y*u.y+this.normal.z*u.z);arguments[3]&&(arguments[3].normal=this.normal,arguments.d=this.d)}else for(n=arguments[0],this.calcNormal(n[0],n[1],n[2],arguments[1]),r=3;r<n.length&&this.test();r++)this.calcNormal(n[r],n[0],n[r/2])},test:function(){return!t.isValid(this.normal)},transform:function(n,i){var r,f;if(i.Points!=null){for(r=0;r<i.Points.length;r++)i.VectorPoints[r]=i.Points[r]=u.getMatrixVectorMutiple(n,i.Points[r]);this.calcNormal(i.VectorPoints,i)}else f=n*i.normal*-i.d,i.normal=u.getMatrixVectorAnd(n,i.normal),t.normalize(normal),i.d=-(i.normal&f)},getPoint:function(n,i,r,u){var f;if(typeof n==double)return f=-(r.x*n+r.y*i+u)/r.z,t.vector3D(n,i,f);var e=n,o=i,s=t.vector3DMinus(t.vector3DStarMultiply(r,-u),e),h=t.vector3dAND(s,r),c=h/t.vector3dAND(r,o);return t.vector3DPlus(e,t.vector3DStarMultiply(o*c))},getNormal:function(n,i){var f,r;if(i!=null)for(f=t.getNormal(u.getMatrixVectorMutiple(n,i[0]),u.getMatrixVectorMutiple(n,i[1]),u.getMatrixVectorMutiple(n,i[2])),r=3;r<i.length&&!t.isValid(f)&&i[r/2];r++){var e=u.getMatrixVectorMutiple(n,i[r]),o=u.getMatrixVectorMutiple(n,i[0]),s=u.getMatrixVectorMutiple(n,i[r/2]);f=t.getNormal(e,o,s)}else f=u.getMatrixVectorAnd(n,normal),t.normalize();return f},createTextElement:function(n,t,i,r){var u=[],f=n.x,e=n.y,o=t.Width,s=t.Height;return u[0]=this.vector.vector3D(f,e,n.z),u[1]=this.vector.vector3D(f+o,e+s+r,n.z),u[2]=this.vector.vector3D(f+o+i,e+s+r,n.z),this.text3D(t,u)},redraw:function(){},drawPolyLine:function(n,t){var f=ej.Ej3DRender.transform,r=ej.EjSvgRender.utils._getStringBuilder(),e=ej.EjSvgRender.chartTransform3D.toScreen(n.VectorPoints[0],f),i,u,o,s;for(r.append("M "+e.x+" "+e.y+" "),i=0;i<n.VectorPoints.length;i++)u=ej.EjSvgRender.chartTransform3D.toScreen(n.VectorPoints[i],f),r.append("L "+u.x+" "+u.y+" ");o=r.toString();s={id:n.element.id,"stroke-dasharray":n.element.dashArray,"stroke-width":n.element.width,stroke:n.element.stroke,d:o};t.svgRenderer.drawPath(s,n.element.child)},drawLine:function(n,t){var i=ej.Ej3DRender.transform;if(i!=null){var r=ej.EjSvgRender.chartTransform3D.toScreen(n.VectorPoints[0],i),u=ej.EjSvgRender.chartTransform3D.toScreen(n.VectorPoints[2],i),f={id:n.element.id,x1:r.x,y1:r.y,x2:u.x,y2:u.y,"stroke-dasharray":n.element.dashArray,"stroke-width":n.element.width,stroke:n.element.stroke,opacity:n.element.opacity};t.svgRenderer.drawLine(f,n.element.child)}},drawTemplate:function(n,t){var i=n.element,u=ej.Ej3DRender.transform,r;u!=null&&(r=ej.EjSvgRender.chartTransform3D.toScreen(n.VectorPoints[0],u),ej.EjSeriesRender.prototype.drawLabelTemplate(i.Label.series,i.Label.series.points[i.Label.pointIndex],i.Label.pointIndex,{X:r.x,Y:r.y},t))},drawText:function(t,i){var r=t.element,o=ej.Ej3DRender.transform,c,w;if(o!=null){var e=ej.EjSvgRender.chartTransform3D.toScreen(t.VectorPoints[0],o),s=e.x,h=e.y;if(r.tag=="text")c={id:r.id,x:s,y:h,fill:r.font.color,"font-size":r.font.size,"font-family":r.font.fontFamily,"font-style":r.font.fontStyle,"font-weight":r.font.fontWeight,opacity:r.font.opacity,"text-anchor":r.TextAnchor,cursor:"default",transform:r.Angle?"rotate("+r.Angle+","+s+","+h+")":null},i.svgRenderer.drawText(c,t.element.Label.Text,t.element.child,t.element.Label);else{var u=r.series,l=u.yAxis&&u.yAxis.labelFormat?u.yAxis.labelFormat:"",b=r.point.text?r.point.text:r.point.y+l.substring(l.indexOf("}")+1),a=ej.EjSvgRender.utils._measureText(b,null,u.marker.dataLabel.font),f=u.marker.dataLabel.margin,k=a.width+f.left+f.right,v=a.height+f.top+f.bottom,y={X:e.x,Y:e.y},p;w=u.marker.dataLabel.shape?u.marker.dataLabel.shape:u.marker.dataLabel.shape?marker.dataLabel.shape:"None";n.each(i.model.symbolShape,function(n){w.toLowerCase()==n.toLowerCase()&&(p=n)});var d=y.X-f.left/2+f.right/2,g=y.Y-f.top/2-v/f.top+f.bottom/2,nt=n.inArray(u,i.model.series);ej.EjSeriesRender.prototype.dataLabelSymbol(nt,u,r.pointIndex,d,g,k,v,p,i)}}},draw:function(i,r){var o,s,a,h;if(i.VectorPoints!=null&&!(i.VectorPoints.length<=0)){var c=ej.Ej3DRender.transform,l=ej.EjSvgRender.utils._getStringBuilder(),u=i.Fill,y=r.svgRenderer.checkColorFormat(u);if(y||(u=r.colorNameToHex(u)),o={Segments:null,StartPoint:null},c!=null)for(o.StartPoint=ej.EjSvgRender.chartTransform3D.toScreen(i.VectorPoints[0],c),l.append("M "+o.StartPoint.x+" "+o.StartPoint.y+" "),s=0;s<i.VectorPoints.length;s++)a=ej.EjSvgRender.chartTransform3D.toScreen(i.VectorPoints[s],c),l.append("L "+a.x+" "+a.y+" ");var p=l.toString(),f="Light",e=2*(Math.abs(t.vector3dAND(i.normal,t.vector3D(0,0,1)))-1),v=2*(Math.abs(t.vector3dAND(i.normal,t.vector3D(0,1,0)))-1),w=2*(Math.abs(t.vector3dAND(i.normal,t.vector3D(1,0,0)))-1);e==w?(f="ZLight",u=this.applyZLight(u,r)):v==e||e!=0&&v<e?(f="XLight",u=this.applyXLight(u,r)):e<0?(f="ZLight",u=this.applyZLight(u,r)):(f="Light",u=u);r.model.AreaType=="none"&&(i.StrokeThickness=0);h={id:r.svgObject.id+"_"+i.Name,name:f,fill:u,stroke:i.Stroke,"stroke-width":i.StrokeThickness,opacity:i.Opacity,d:p};r.svgRenderer.drawPath(h,i.Element.Parent);r.model.previousID&&r.model.touchCross&&n("#"+h.id).insertAfter(n("#"+r.model.previousID));r.model.previousID=h.id}},applyXLight:function(n,t){var i=t.svgRenderer.hexToRGB(n);return i.R=parseInt(i.R*.7),i.G=parseInt(i.G*.7),i.B=parseInt(i.B*.7),t.svgRenderer.hexFromRGB(i)},applyZLight:function(n,t){var i=t.svgRenderer.hexToRGB(n);return i.R=parseInt(i.R*.9),i.G=parseInt(i.G*.9),i.B=parseInt(i.B*.9),t.svgRenderer.hexFromRGB(i)},update:function(t,i,r){var u,s,h,c;if(i.VectorPoints!=null&&!(i.VectorPoints.length<=0)){i.VectorPoints=t;var f=ej.Ej3DRender.transform,e=ej.EjSvgRender.utils._getStringBuilder(),l=i.Fill,o={Segments:null,StartPoint:null};if(f!=null)for(o.StartPoint=ej.EjSvgRender.chartTransform3D.toScreen(i.VectorPoints[0],f),e.append("M "+o.StartPoint.x+" "+o.StartPoint.y+" "),u=0;u<i.VectorPoints.length;u++)s=ej.EjSvgRender.chartTransform3D.toScreen(i.VectorPoints[u],f),e.append("L "+s.x+" "+s.y+" ");h=e.toString();n(r.chartObj.chart3D).find("#"+r.chartObj.svgObject.id+"_"+i.Name).length>0&&(c=n(r.chartObj.chart3D).find("#"+r.chartObj.svgObject.id+"_"+i.Name)[0],r.chartObj.svgRenderer._setAttr(n(c),{d:h}))}}};var r=new ej.Ej3DRender,t=new r.vector3D,u=new r.matrix3D,e=new r.BSPTreeBuilder,f=new r.polygon3D,i=new r.Graphics3D}(jQuery);ej.Ej3DAxisRenderer=function(){};ej.Ej3DSeriesRender=function(){};ej.Ej3DChart=function(){};ej.series3DTypes={},function(n){ej.Ej3DAxisRenderer.prototype={_drawAxes:function(n,t,i){t.majorGridLines.visible&&this._drawGridLines3D(t,i);t.visible&&t.majorTickLines.visible&&this._renderTicks3D(t,t.majorTickLines.size,t.majorTickLines.width,i);t.visible&&(this._drawAxisLabel(t,i),this._drawMultiLevelLabel(n,t,i),this._drawAxisTitle(t))},_drawAxisTitle:function(t){var i,a,v,e,u,o,s;if(t.title.visible){i=t.title.font;this.gAxisTitleEle=this.svgRenderer.createGroup({id:this.svgObject.id+"axisTitle_"+t.name});var h=t._opposed,b={Width:n(this.svgObject).width(),Height:n(this.svgObject).height()},k=10,f=ej.EjSvgRender.chartTransform3D.transform3D(b);f.mViewport=b;f.Rotation=0;f.Tilt=0;f.Depth=100;f.PerspectiveAngle=90;ej.EjSvgRender.chartTransform3D.transform(f);var d=ej.EjSvgRender.chartTransform3D.result,g=ej.Ej3DRender.prototype.matrix3D.prototype,nt=t.orientation.toLowerCase(),y=!1,c,l;for(a=0;a<this.model._axes.length;a++)if(c=this.model._axes[a],c.orientation.toLowerCase()==nt)for(v=0;v<c.multiLevelLabels.length;v++)if(c.multiLevelLabels[v].visible){y=!0;break}if(nt=="horizontal"){var tt=this.model.elementSpacing+t._LableMaxWidth.height,p=ej.EjSvgRender.utils._measureText(t.title.text,t.width,t.title.font).height/2,r=n.extend({},ej.EjSvgRender.commonChartEventArgs);r.data={Text:t.title.text,location:{x:t.width/2,y:tt+p+t.majorTickLines.size+t.axisLine.width+this.model.wallSize+t._multiLevelLabelHeight},axes:t};this._trigger("axesTitleRendering",r);i=t.title.font;e=r.data.location.x+t.x;u=h?t.y-r.data.location.y:r.data.location.y+t.y;l={Width:p.width,Height:p.height,Label:r.data,TextAnchor:"middle",tag:"text",font:i,id:this.svgObject.id+"axisTitle",child:this.chart3D};y?(o={id:this.svgObject.id+"axisTitle",x:e,y:u,fill:i.color,"font-size":i.size,"font-family":i.fontFamily,"font-style":i.fontStyle,"font-weight":i.fontWeight,opacity:i.opacity,"text-anchor":"middle"},s=ej.EjSvgRender.chartTransform3D.toScreen({x:e,y:u,z:0},f,d,g),o.x=s.x,o.y=s.y,this.svgRenderer.drawText(o,r.data.Text,this.gAxisTitleEle),this.svgRenderer.append(this.gAxisTitleEle,this.svgObject)):this.graphics.addVisual(this.polygon.createTextElement(this.vector.vector3D(e,u,0),l,10,10))}else{var w=ej.EjSvgRender.utils._measureText(t.title.text,t.height,t.title.font),e=h?t.x+(4*this.model.elementSpacing+t._LableMaxWidth.width+t.majorTickLines.size+t.axisLine.width+this.model.wallSize+t._multiLevelLabelHeight):t.x-(3*this.model.elementSpacing+t._LableMaxWidth.width+t.majorTickLines.size+t.axisLine.width+this.model.wallSize+t._multiLevelLabelHeight),r=n.extend({},ej.EjSvgRender.commonChartEventArgs);r.data={Text:t.title.text,location:{x:w.width/2,y:0},axes:t};this._trigger("axesTitleRendering",r);i=t.title.font;var u=r.data.location.y+(t.y+t.height)+t.height/-2,rt=h?90:-90,it=h?25:-25;l={Width:w.width,Height:w.height,Angle:-90,Label:r.data,TextAnchor:"middle",tag:"text",font:i,id:this.svgObject.id+"_YAxisTitle",child:this.chart3D};y?(o={id:id,x:e,y:u,fill:i.color,"font-size":i.size,"font-family":i.fontFamily,"font-style":i.fontStyle,"font-weight":i.fontWeight,opacity:i.opacity,"text-anchor":"middle",transform:"rotate(-90,"+e+","+(h?u+k:u-k)+")"},s=ej.EjSvgRender.chartTransform3D.toScreen({x:e,y:u,z:0},f,d,g),o.x=s.x+it,o.y=s.y,this.svgRenderer.drawText(o,r.data.Text,this.gAxisTitleEle),this.svgRenderer.append(this.gAxisTitleEle,this.svgObject)):this.graphics.addVisual(this.polygon.createTextElement(this.vector.vector3D(e,u,0),l,10,10))}}},_drawMultiLevelLabel:function(t,i,r){var ot,st,nt,k,a,at,ft,ci,ht,li;this.gMultiLevelEle=this.svgRenderer.createGroup({id:this.svgObject.id+"_axisMultiLevelLabels_"+t});var nt,y,tt,e,p,c,ri,it,o,s,w,ui=0,ai,fi,vi=i.multiLevelLabels.length,ct=this.model,lt=ct.elementSpacing,f=10,u=0,h=0,ei,rt,bt,kt,dt,a,at,gt,d=ct.m_AreaBounds,b,ut=i.visibleRange,ni,vt=ct.wallSize,g=i._opposed,oi=r.axes[i.name]._validCross,ti,yt=i.orientation.toLowerCase(),si=oi?i.y:d.Y+(!g&&d.Height),ii,yi=oi?i.x:d.X+(g&&d.Width),l,ft,pt=[],wt,et,hi={Width:n(this.svgObject).width(),Height:n(this.svgObject).height()},v=ej.EjSvgRender.chartTransform3D.transform3D(hi);for(v.mViewport=hi,v.Rotation=0,v.Tilt=0,v.Depth=100,v.PerspectiveAngle=ct.perspectiveAngle,ej.EjSvgRender.chartTransform3D.transform(v),ot=ej.EjSvgRender.chartTransform3D.result,st=ej.Ej3DRender.prototype.matrix3D.prototype,nt=0;nt<vi;nt++)if(e=i.multiLevelLabels[nt],p=this.svgObject.id+"_"+i.name+"MultiLevelLabels_"+t+"_"+nt,e.text!=""&&e.visible){if(level=e._level,rt="middle",c=e.font,et=e.border.width,maximumTextWidth=e.maximumTextWidth,ii=e.textAlignment.toLowerCase(),at=a=e.text,w=e.textOverflow.toLowerCase(),b=ej.EjSvgRender.utils._measureText(e.text,d.Width,e.font),ri=(e.end-e.start)/2,it=(e.start+ri-ut.min)/ut.delta,o=(e.start-ut.min)/ut.delta,s=(e.end-ut.min)/ut.delta,i.isInversed&&(it=isNaN(it)?0:1-it,o=isNaN(o)?0:1-o,s=isNaN(s)?0:1-s),yt=="horizontal"?(u=Math.round(i.width*it)+d.X+i.plotOffset,h=g?si-vt-i.majorTickLines.size-lt-f/2-i._LableMaxWidth.height:si+vt+i.majorTickLines.size+lt+i._LableMaxWidth.height,o=Math.round(i.width*o)+d.X+i.plotOffset,s=Math.round(i.width*s)+d.X+i.plotOffset,tt=maximumTextWidth?maximumTextWidth:s-o-f):(h=Math.round(i.plotOffset+i.y+i.height*(1-it)),u=g?i.x+vt+i.majorTickLines.size+i.axisLine.width+lt/2+i._LableMaxWidth.width+i.multiLevelLabelHeight[level]/2:yi-vt-i.majorTickLines.size-lt/2-i._LableMaxWidth.width-i.multiLevelLabelHeight[level]/2,o=Math.round(i.plotOffset+i.y+i.height*(1-o)),s=Math.round(i.plotOffset+i.y+i.height*(1-s)),tt=maximumTextWidth?maximumTextWidth:i.multiLevelLabelHeight[level]+f),h=g?h-i.prevHeight[level]:h+i.prevHeight[level],ii=="far"?(u=u+tt/2-et/2,rt="end"):ii=="near"&&(rt="start",u=u-tt/2+et/2),k=ej.EjAxisRenderer.prototype._triggerMultiLevelLabelsRendering(at,u,h,w,c,e.border,this),a=at=k.text,u=k.location.x,h=k.location.y,w=k.textOverflow.toLowerCase(),c=k.font,c.color=c.color?c.color:i.multiLevelLabelsFontColor,ai=k.border,fi=k.border.type.toLowerCase(),et=k.border.width,l={id:p,x:u,y:h,fill:c.color,"font-size":c.size,"font-family":c.fontFamily,"font-style":c.fontStyle,"font-weight":c.fontWeight,opacity:c.opacity,"text-anchor":rt},w!="none"&&(a=ej.EjAxisRenderer.prototype.textOverflowMultiLevelLabels(i,tt,a,at,w,c,b,{x:u,y:h},null,this)),w=="wrap"||w=="wrapandtrim")for(newY=h,y=0;y<a.length;y++)b=ej.EjSvgRender.utils._measureText(a[y],null,c),y!=0&&(newY=g?newY-b.height:newY+b.height),ei={Width:b.width,Height:b.height,Label:{Text:a[y]},TextAnchor:rt,tag:"text",font:c,id:p+"_"+y,child:this.chart3D},l.id=l.id+"_"+y,ft=ej.EjSvgRender.chartTransform3D.toScreen({x:u,y:newY+f/2,z:0},v,ot,st),l.x=ft.x,l.y=ft.y,this.svgRenderer.drawText(l,a[y],this.gMultiLevelEle);if(u=yt=="horizontal"?u:g?u+f:u-f,w!="wrap"&&w!="wrapandtrim"&&(ei={Width:b.width,Height:b.height,Label:{Text:a},TextAnchor:rt,tag:"text",font:c,id:p,child:this.chart3D},ft=ej.EjSvgRender.chartTransform3D.toScreen({x:u,y:h+f/2,z:0},v,ot,st),l.x=ft.x,l.y=ft.y,this.svgRenderer.drawText(l,a,this.gMultiLevelEle)),ci=yt=="horizontal"?{bounds:{x:o,y:h-f,height:i.multiLevelLabelHeight[level],width:tt},axisIndex:t,multiLevelLabel:e}:{bounds:{x:u-width/2-f/2,y:s,height:o-s,width:width},axisIndex:t,multiLevelLabel:e},this.model.multiLevelLabelRegions.push(ci),fi!="none"&&et>0){for(p=this.svgObject.id+"_"+i.name+"MultiLevelLabelsBorder_"+t+"_"+nt,ht=h-f+i.multiLevelLabelHeight[level]+f/2,li=e.border.color?e.border.color:i.multiLevelLabelsColor,yt=="horizontal"?(bt={x1:o,y1:h-f,x2:s,y2:h-f},kt={x1:o,y1:ht,x2:s,y2:ht},dt={x1:o,y1:h-f,x2:o,y2:ht},gt={x1:s,y1:h-f,x2:s,y2:ht}):(width=i.multiLevelLabelHeight[level],bt={x1:u-width/2-f/2,y1:s,x2:u+width/2+f/2,y2:s},kt={x1:u-width/2-f/2,y1:o,x2:u+width/2+f/2,y2:o},dt={x1:u-width/2-f/2,y1:s,x2:u-width/2-f/2,y2:o},gt={x1:u+width/2+f/2,y1:s,x2:u+width/2+f/2,y2:o}),wt=0;wt<4;wt++){switch(wt){case 0:newId=p+"_top";value=bt;break;case 1:newId=p+"_bottom";value=kt;break;case 2:newId=p+"_left";value=dt;break;case 3:newId=p+"_right";value=gt}pt[0]=ej.Ej3DRender.prototype.vector3D.prototype.vector3D(value.x1,value.y1,ui);pt[1]=ej.Ej3DRender.prototype.vector3D.prototype.vector3D(value.x2,value.y2,ui);ni=ej.EjSvgRender.chartTransform3D.toScreen(pt[0],v,ot,st);ti=ej.EjSvgRender.chartTransform3D.toScreen(pt[1],v,ot,st);l={id:newId,x1:ni.x,y1:ni.y,x2:ti.x,y2:ti.y,stroke:li,"stroke-width":et};this.svgRenderer.drawLine(l,this.gMultiLevelEle)}this.svgRenderer.append(this.gMultiLevelEle,this.svgObject)}}},_drawAxisLabel:function(n,t){for(var v=n.visibleLabels.length,f=this.model.m_AreaBounds,u=n._opposed,c,l=t.axes[n.name]._validCross,a=l?n.y:f.Y+(!u&&f.Height),y=l?n.x:f.X+(u&&f.Width),r=0;r<v;r++)if(!ej.util.isNullOrUndefined(n.visibleLabels[r].Text)){var e=0,o=0,p=0,w=0,s,h=ej.EjSvgRender.utils._measureText(n.visibleLabels[r].Text,this.model.m_AreaBounds.Width,n.font),i=(n.visibleLabels[r].Value-n.visibleRange.min)/n.visibleRange.delta;i=n.isInversed?1-i:i;i=isNaN(i)?0:i;n.orientation.toLowerCase()=="horizontal"?(p=e=Math.round(n.width*i)+this.model.m_AreaBounds.X+n.plotOffset,o=u?a-this.model.wallSize-n.majorTickLines.size-this.model.elementSpacing/2:a+this.model.wallSize+n.majorTickLines.size+this.model.elementSpacing,s="middle"):(o=w=Math.round(n.plotOffset+n.y+h.height/4+n.height*(1-i)),e=u?n.x+n.majorTickLines.size+n.axisLine.width+this.model.elementSpacing/2:y-this.model.wallSize-n.majorTickLines.size-this.model.elementSpacing/2,s=u?"start":"end");c={Width:h.width,Height:h.height,Label:n.visibleLabels[r],TextAnchor:s,tag:"text",font:n.font,id:this.svgObject.id+n.orientation+r,child:this.chart3D};this.graphics.addVisual(this.polygon.createTextElement(this.vector.vector3D(e,o,0),c,10,10))}},_renderTicks3D:function(n,t,i,r){for(var s,f,o,y=n.visibleLabels.length,h=this.model.m_AreaBounds,p=n.y,e=0;e<y;e++){var c=0,l=0,a=0,v=0,u=(n.visibleLabels[e].Value-n.visibleRange.min)/n.visibleRange.delta;if(u=n.isInversed?1-u:u,u=isNaN(u)?0:u,n.orientation.toLowerCase()=="horizontal"?l=c=Math.round(n.width*u)+h.X+n.plotOffset:a=v=Math.round(n.plotOffset+n.height*(1-u)+n.y),f=this._calculatePosition3D(n,n.tickLinesPosition,t,i,c,a,l,v,r),o={width:n.majorTickLines.width,stroke:n.majorTickLines.color,child:this.chart3D,tag:"line"},o.id=this.svgObject.id+n.name+"_majorTickLines_"+e,this.graphics.addVisual(this.polygon.createLine(o,f.X1,f.Y1,f.X2,f.Y2,0)),n.minorGridLines.visible&&n.minorTicksPerInterval>0&&e<y-1)for(minorTicks=n.visibleRange.interval/(n.minorTicksPerInterval+1),s=0;s<n.minorTicksPerInterval;s++)u=ej.EjSvgRender.utils._valueToCoefficient(n,n.visibleLabels[e].Value+minorTicks*(s+1)),u=isNaN(u)?0:u,n.orientation.toLowerCase()=="horizontal"?c=l=Math.round(n.plotOffset+h.Width*u+h.X):a=v=Math.round(n.plotOffset+h.Height*(1-u))+n.y,f=this._calculatePosition3D(n,n.tickLinesPosition,t,i,c,a,l,v,r),o={width:n.minorTickLines.width,stroke:n.minorTickLines.color,child:this.chart3D,tag:"line"},o.id=this.svgObject.id+n.name+"_minorTickLines_"+e+s,this.graphics.addVisual(this.polygon.createLine(o,f.X1,f.Y1,f.X2,f.Y2,0))}},_calculatePosition3D:function(n,t,i,r,u,f,e,o,s){var w=n.orientation,h=n._opposed,t="outside",c=this.model.m_AreaBounds,v=s.axes[n.name]._validCross,y=v?n.y:c.Y+(!h&&c.Height),p=v?n.x:c.X+(h&&c.Width),a,l;if(n.orientation.toLowerCase()=="horizontal"){switch(t){case"inside":f=h?r:0;o=h?f+i:i;break;case"outside":f=0;o=h?i:f+i}l=h?y-this.model.wallSize-i:y+this.model.wallSize-i/2;a=n.x;f+=l;o+=l;u=e=u}else{switch(t){case"inside":u=0;e=h?i:u+i;break;case"outside":u=0;e=h?u+i:i}a=h?p+this.model.wallSize:p-this.model.wallSize-i;l=this.model.m_AreaBounds.Y;u+=a;e+=a;f=o=f}return{X1:u,Y1:f,X2:e,Y2:o}},_drawGridLines3D:function(t,i){var v,u,a,b,c,r,f,y,h;if(t!=null){var p=t.visibleLabels.length,w,k=t._opposed,tt=t.orientation,d=i.axes[t.name]._validCross,l,e,o,s,g;if(tt.toLowerCase()=="horizontal")for(u=0;u<p;u++){r=ej.EjSvgRender.utils._valueToCoefficient(t,t.visibleLabels[u].Value);r=isNaN(r)?0:r;e=l=Math.round(t.width*r)+this.model.m_AreaBounds.X+t.plotOffset;o=this.model.m_AreaBounds.Y;s=this.model.m_AreaBounds.Y+this.model.m_AreaBounds.Height;var a=this.model.depth>2?this.model.depth-2:1,nt=d?t.y:this.model.m_AreaBounds.Y+(!k&&this.model.m_AreaBounds.Height),f={opacity:t.majorGridLines.opacity,width:t.majorGridLines.width,stroke:t.majorGridLines.color,child:this.chart3D,tag:"line"};if(f.id=this.svgObject.id+t.name+"_gridlines_"+u,this.graphics.addVisual(this.polygon.createLine(f,l,o,e,s,a)),v=n.extend({},f),v.id=this.svgObject.id+t.name+"_parallelGridlines_"+u,h=this.polygon.createLine(v,e,0,e,-a,nt),this.polygon.transform(this.matrixobj.tilt(parseFloat(Math.PI/2)),h),this.graphics.addVisual(h),t.minorGridLines.visible&&t.minorTicksPerInterval>0&&u<p-1)for(w=t.visibleRange.interval/(t.minorTicksPerInterval+1),c=0;c<t.minorTicksPerInterval;c++)r=ej.EjSvgRender.utils._valueToCoefficient(t,t.visibleLabels[u].Value+w*(c+1)),r=isNaN(r)?0:r,e=l=Math.round(this.model.m_AreaBounds.Width*r)+this.model.m_AreaBounds.X,o=this.model.m_AreaBounds.Y,s=this.model.m_AreaBounds.Y+this.model.m_AreaBounds.Height,f={opacity:t.minorGridLines.opacity,width:t.minorGridLines.width,stroke:t.minorGridLines.color,child:this.chart3D,tag:"line"},f.id=this.svgObject.id+t.name+"_minorgridlines_"+u+c,this.graphics.addVisual(this.polygon.createLine(f,l,o,e,s,a)),v=n.extend({},f),v.id=this.svgObject.id+t.name+"_parallelMinorGridlines_"+u+c,h=this.polygon.createLine(v,e,0,e,-a,nt),this.polygon.transform(this.matrixobj.tilt(parseFloat(Math.PI/2)),h),this.graphics.addVisual(h);g++}else for(u=0;u<p;u++){if(r=(t.visibleLabels[u].Value-t.visibleRange.min)/t.visibleRange.delta,r=t.isInversed?1-r:r,r=isNaN(r)?0:r,l=this.model.m_AreaBounds.X,o=Math.round(t.height*(1-r))+.5,o+=t.y,e=l+this.model.m_AreaBounds.Width,s=o,a=this.model.depth>2?this.model.depth-2:1,f={opacity:t.majorGridLines.opacity,width:t.majorGridLines.width,stroke:t.majorGridLines.color,axisName:t.name,child:this.chart3D,tag:"line"},f.id=this.svgObject.id+t.name+"_gridlines_"+u,this.graphics.addVisual(this.polygon.createLine(f,l,o,e,s,a)),b=d?t.x:this.model.m_AreaBounds.X+(k&&this.model.m_AreaBounds.Width+1),y=n.extend({},f),y.id=this.svgObject.id+t.name+"_parallelGridlines_"+u,h=this.polygon.createLine(y,-a,s,0,s,b),this.polygon.transform(this.matrixobj.turn(parseFloat(-Math.PI/2)),h),this.graphics.addVisual(h),t.minorGridLines.visible&&t.minorTicksPerInterval>0&&u<p-1)for(w=t.visibleRange.interval/(t.minorTicksPerInterval+1),c=0;c<t.minorTicksPerInterval;c++)r=ej.EjSvgRender.utils._valueToCoefficient(t,t.visibleLabels[u].Value+w*(c+1)),r=isNaN(r)?0:r,l=this.model.m_AreaBounds.X,o=Math.round(t.height*(1-r))+.5,o+=t.y,e=l+this.model.m_AreaBounds.Width,s=o,f={opacity:t.minorGridLines.opacity,width:t.minorGridLines.width,stroke:t.minorGridLines.color,axisName:t.name,child:this.chart3D,tag:"line"},f.id=this.svgObject.id+t.name+"_minorgridlines_"+u+c,this.graphics.addVisual(this.polygon.createLine(f,l,o,e,s,a)),y=n.extend({},f),y.id=this.svgObject.id+t.name+"_parallelMinorGridlines_"+u+c,h=this.polygon.createLine(y,-a,s,0,s,b),this.polygon.transform(this.matrixobj.turn(parseFloat(-Math.PI/2)),h),this.graphics.addVisual(h);g++}}}};ej.Ej3DSeriesRender.prototype={_getSegmentDepth:function(n){var u=this.chartObj.model.depth,i,r,t;if(this.chartObj.model._sideBySideSeriesPlacement)t=u/4,i=t,r=t*3;else{var e=n.position-1,f=n.all,t=u/(f*2+f+1);i=t+t*e*3;r=i+t*2}return{Start:i,End:r,Delta:r-i}},createSegment:function(n,t,i,r,u,f,e,o,s){return{StartValue:t,EndValue:i,depth:r,radius:u,index:f,YData:e,Center:n,inSideRadius:o,ActualEndValue:i,ActualStartValue:t,pointIndex:s}},calculateSize:function(t,i){var r=t.chartObj.model.legend,o=0,s=0,u=t.chartObj.model.title,h=t.chartObj.model.title.subTitle,e=t.chartObj.model._titleLocation,a=t.chartObj.model._subTitleLocation,v=t.chartObj.model.title.textOverflow,y=t.chartObj.model.title.subTitle.textOverflow,w=u.text&&u.visible&&u.enableTrim&&(v=="wrap"||v=="wrapandtrim")?!0:!1,c=h.text&&h.visible&&h.enableTrim&&(y=="wrap"||y=="wrapandtrim")?!0:!1,p,f,l;return r.visible&&r.position.toLowerCase()!="custom"&&(r.position.toLowerCase()=="right"||r.position.toLowerCase()=="left"?o=(r.position.toLowerCase()=="right"?t.chartObj.model.margin.right:t.chartObj.model.margin.left)+t.chartObj.model.LegendViewerBounds.Width:s=(r.position.toLowerCase()=="top"?t.chartObj.model.margin.top:t.chartObj.model.margin.bottom)+t.chartObj.model.LegendViewerBounds.Height),i.actualWidth=n(t.chartObj.svgObject).width()-o,p=i.actualWidth*.5+(r.position.toLowerCase()==="left"?o:0),w||c?(f=e.size.height+(c?a.size.height:0)+s,i.actualHeight=n(t.chartObj.svgObject).height()-f,l=i.actualHeight*.5+(r.position.toLowerCase()==="top"?f:e.size.height+(c?a.size.height:0))):(f=(u.text&&u.visible?e.Y:0)+s,i.actualHeight=n(t.chartObj.svgObject).height()-f,l=i.actualHeight*.5+(r.position.toLowerCase()==="top"?f:u.text&&u.visible?e.Y:0)),{centerX:p,centerY:l}},createPoints:function(t,i){var s,r;t.segments=[];var p=this.calculateSize(i,t),e=0,tt=this._calculateVisiblePoints(t).visiblePoints,w=t._visiblePoints.length;for(s=0;s<w;s++)e+=tt[s].YValues[0];var b=360/e,k=n.inArray(t,i.chartObj.model._visibleSeries),ut=this.chartObj.model._visibleSeries.length,it=i.chartObj.model.innerRadius[k],d=i.chartObj._getYValues(t._visiblePoints),rt=i.chartObj.model.depth,l,a=0,v=0,h=0,g,u,f,o,y,nt=0,c=i.chartObj.model.circularRadius[k];for(r=0;r<w;r++)(t._visiblePoints[r].visible||t._visiblePoints[r].gapMode)&&(g=n.inArray(t._visiblePoints[r],t._visiblePoints),u=Math.abs(d[r]),v=Math.abs(u)*(Math.PI*2/e),f={},f.x=0,f.y=0,u!=0&&((t.explodeIndex==t._visiblePoints[r].actualIndex||t.explodeAll)&&(o={X:0,Y:0},o.X=Math.cos(2*Math.PI*(h+u/2)/e),o.Y=Math.sin(2*Math.PI*(h+u/2)/e),f.x=.01*c*o.X*t.explodeOffset,f.y=.01*c*o.Y*t.explodeOffset),l=i.chartObj.vector.vector3D(f.x+p.centerX,f.y+p.centerY,0),y=this.createSegment(l,parseFloat(b*h),parseFloat(b*u),rt,c,r,u,it,g,t),y.visible=t._visiblePoints[r].gapMode?!1:!0,t.segments.push(y)),t.marker.dataLabel.visible&&this._addPieDataLabel(nt,d[r],a,a+v,r,c,this._isChartRotated(i)?i.chartObj.model.depth+5:0,l,t._visiblePoints[r]),nt++,a+=v,h+=u);return t.segments},_addPieDataLabel:function(n,t,i,r,u,f,e,o,s){var h=(i+r)/2;s.symbolLocation={x:0,y:0,radius:0,angle:0,StartDepth:0};s.symbolLocation.x=n;s.symbolLocation.y=t;s.symbolLocation.radius=f;s.symbolLocation.angle=h;s.symbolLocation.center=o;s.startDepth=e},_isChartRotated:function(n){var t=Math.abs(n.chartObj.model.tilt%360),i=Math.abs(n.chartObj.model.rotattion%360);return(t>90&&t<270)^(i>90&&i<270)?!0:!1},createSector:function(n,t,i,r){var o=parseInt(Math.ceil(n.ActualEndValue/6)),v=Math.PI/180,s=0,rt=[],h=t.chartObj.model.depth,k,d,tt,it,g,p,nt,l,a,u,w,b;if(o<1)return null;var c=[],y=n.ActualEndValue/o,f=[],e=[];for(u=0;u<o+1;u++)k=parseFloat(n.Center.x+n.radius*Math.cos((n.ActualStartValue+u*y)*v)),d=parseFloat(n.Center.y+n.radius*Math.sin((n.ActualStartValue+u*y)*v)),f[u]={X:k,Y:d},tt=parseFloat(n.Center.x+n.inSideRadius*Math.cos((n.ActualStartValue+u*y)*v)),it=parseFloat(n.Center.y+n.inSideRadius*Math.sin((n.ActualStartValue+u*y)*v)),e[u]={X:tt,Y:it},rt.push({X:k,Y:d});for(g=[],u=0;u<o;u++)p=[t.chartObj.vector.vector3D(f[u].X,f[u].Y,0),t.chartObj.vector.vector3D(f[u].X,f[u].Y,h),t.chartObj.vector.vector3D(f[u+1].X,f[u+1].Y,h),t.chartObj.vector.vector3D(f[u+1].X,f[u+1].Y,0)],g[u]=t.chartObj.polygon.polygon3D(p,this,n.index,i.borderColor,i.borderWidth,i.opacity,i.interior,s.toString()+"_Region_Series_"+r+"_Point_"+n.index,t.chartObj.chart3D),s++;if(c[1]=g,n.inSideRadius>0){for(nt=[],u=0;u<o;u++)p=[t.chartObj.vector.vector3D(e[u].X,e[u].Y,0),t.chartObj.vector.vector3D(e[u].X,e[u].Y,h),t.chartObj.vector.vector3D(e[u+1].X,e[u+1].Y,h),t.chartObj.vector.vector3D(e[u+1].X,e[u+1].Y,0)],nt[u]=t.chartObj.polygon.polygon3D(p,this,n.index,i.borderColor,i.borderWidth,i.opacity,i.interior,s.toString()+"_Region_Series_"+r+"_Point_"+n.index,t.chartObj.chart3D),s++;c[3]=nt}for(l=[],a=[],u=0;u<o+1;u++)l.push(t.chartObj.vector.vector3D(f[u].X,f[u].Y,0)),a.push(t.chartObj.vector.vector3D(f[u].X,f[u].Y,h));if(n.inSideRadius>0)for(u=o;u>-1;u--)l.push(t.chartObj.vector.vector3D(e[u].X,e[u].Y,0)),a.push(t.chartObj.vector.vector3D(e[u].X,e[u].Y,h));else l.push(n.Center),a.push(t.chartObj.vector.vector3D(n.Center.x,n.Center.y,h));return c[0]=[],c[0].push(t.chartObj.polygon.polygon3D(l,this,n.index,i.borderColor,i.borderWidth,i.opacity,i.interior,s.toString()+"_Region_Series_"+r+"_Point_"+n.index,t.chartObj.chart3D)),s++,c[0].push(t.chartObj.polygon.polygon3D(a,this,n.index,i.borderColor,i.borderWidth,i.opacity,i.interior,s.toString()+"_Region_Series_"+r+"_Point_"+n.index,t.chartObj.chart3D)),s++,n.inSideRadius>0?(w=[t.chartObj.vector.vector3D(f[0].X,f[0].Y,0),t.chartObj.vector.vector3D(f[0].X,f[0].Y,h),t.chartObj.vector.vector3D(e[0].X,e[0].Y,h),t.chartObj.vector.vector3D(e[0].X,e[0].Y,0)],b=[t.chartObj.vector.vector3D(f[o].X,f[o].Y,0),t.chartObj.vector.vector3D(f[o].X,f[o].Y,h),t.chartObj.vector.vector3D(e[o].X,e[o].Y,h),t.chartObj.vector.vector3D(e[o].X,e[o].Y,0)],c[2]=[],c[2].push(t.chartObj.polygon.polygon3D(w,this,n.index,i.borderColor,i.borderWidth,i.opacity,i.interior,s.toString()+"_Region_Series_"+r+"_Point_"+n.index,t.chartObj.chart3D)),s++,c[2].push(t.chartObj.polygon.polygon3D(b,this,n.index,i.borderColor,i.borderWidth,i.opacity,i.interior,s.toString()+"_Region_Series_"+r+"_Point_"+n.index,t.chartObj.chart3D)),s++):(w=[t.chartObj.vector.vector3D(f[0].X,f[0].Y,0),t.chartObj.vector.vector3D(f[0].X,f[0].Y,h),t.chartObj.vector.vector3D(n.Center.x,n.Center.y,h),t.chartObj.vector.vector3D(n.Center.x,n.Center.y,0)],b=[t.chartObj.vector.vector3D(f[o].X,f[o].Y,0),t.chartObj.vector.vector3D(f[o].X,f[o].Y,h),t.chartObj.vector.vector3D(n.Center.x,n.Center.y,h),t.chartObj.vector.vector3D(n.Center.x,n.Center.y,0)],c[2]=[],c[2].push(t.chartObj.polygon.polygon3D(w,this,n.index,i.borderColor,i.borderWidth,i.opacity,i.interior,s.toString()+"_Region_Series_"+r+"_Point_"+n.index,t.chartObj.chart3D)),s++,c[2].push(t.chartObj.polygon.polygon3D(b,this,n.index,i.borderColor,i.borderWidth,i.opacity,i.interior,s.toString()+"_Region_Series_"+r+"_Point_"+n.index,t.chartObj.chart3D)),s++),c},createPolygons:function(t,i,r){var s,f=[],a,v,h,y,e,p=n.inArray(t,i.chartObj.model._visibleSeries),o,c,u,l;for(s=t.segments&&r?t.segments:this.createPoints(t,i),y=s.length,o=0;o<y;o++)if(a=s[o],a.visible&&(h=s[o].pointIndex,v=i.chartObj.setStyle(i,t,p,h),typeof i.chartObj.model.pointColors[h]=="object"&&(v.interior=i.chartObj.model.pointColors[h][0].color),e=this.createSector(a,i,v,p),e!=null))for(u=0;u<e.length;u++)if(f[u]||(f[u]=[]),e[u]!=null)for(c=0;c<e[u].length;c++)f[u].push(e[u][c]);if(r)return f;for(u=0;u<f.length;u++)for(l=0;l<f[u].length;l++)i.chartObj.graphics.addVisual(f[u][l])},draw3DDataLabel:function(t,i,r){var e=t.marker.dataLabel.connectorLine.height,b,l,o,s,h,nt,c,y,tt;if(this.chartObj.model.AreaType=="none"){u={x:0,y:0};var a=r.text?r.text:r.y,p=n.inArray(t,this.chartObj.model.series),f=n.extend({},ej.EjSvgRender.commonChartEventArgs);if(f.data={text:a,location:{x:o,y:s},series:t,pointIndex:i,seriesIndex:p},this.chartObj._trigger("displayTextRendering",f),f.data.Text=f.data.text,h=ej.EjSvgRender.utils._measureText(a,null,t.marker.dataLabel.font),t.type.toLowerCase()=="doughnut"||t.type.toLowerCase()=="pie"){var it=Math.min(t.actualWidth,t.actualHeight)/2,k=r.symbolLocation.center,d=r.symbolLocation.radius*t._coefficient;ej.util.isNullOrUndefined(e)&&(e=ej.EjSvgRender.utils._measureText(f.data.text,null,t.marker.dataLabel.font).height);t!=null&&t.labelPosition!="inside"?l=r.symbolLocation.radius+e:t!=null&&(l=d+(r.symbolLocation.radius-d)/2);o=u.X=k.x+l*Math.cos(r.symbolLocation.angle);s=u.Y=k.y+l*Math.sin(r.symbolLocation.angle)}}else{var g=t.yAxis.labelFormat?t.yAxis.labelFormat:"",p=n.inArray(t,this.chartObj.model.series),a=r.text?r.text:r.y+g.substring(g.indexOf("}")+1),w=0,f=n.extend({},ej.EjSvgRender.commonChartEventArgs);f.data={text:a,location:{x:o,y:s},series:t,pointIndex:i};this.chartObj._trigger("displayTextRendering",f);f.data.Text=f.data.text;var h=ej.EjSvgRender.utils._measureText(a,null,t.marker.dataLabel.font),u=ej.EjSvgRender.utils.Transform3DToVisible(t,r.symbolLocation.x,r.symbolLocation.y,this.chartObj),e=t.marker.dataLabel.connectorLine.height?t.marker.dataLabel.connectorLine.height:0,v=6.28*(1-90/360),s=u.Y,o=u.X;this.chartObj.model.requireInvertedAxes?(o=r.x>0?u.X-Math.sin(v)*e:u.X+Math.sin(v)*e,w=-h.height/3):s=r.y>0?u.Y+Math.sin(v)*e:u.Y+Math.sin(-v)*e}nt=this._getSegmentDepth(t);t.marker.dataLabel.shape.toLowerCase()=="none"||r.marker.dataLabel.template||f.data.Text==""||(c={tag:"dataLabel",series:t,point:r,pointIndex:i,id:this.chartObj.svgObject.id+p+"_DataLabel"+i,child:this.chartObj.chart3D},this.chartObj.graphics.addVisual(this.chartObj.polygon.createTextElement(this.chartObj.vector.vector3D(o,s,r.symbolLocation.z?r.symbolLocation.z:0),c,0,-h.height)));b=r.marker.dataLabel.template?"template":"text";c={Width:h.width,Height:h.height,Label:f.data,TextAnchor:"middle",tag:b,font:t.marker.dataLabel.font,Angle:t.marker.dataLabel.angle,id:this.chartObj.svgObject.id+"_SeriesText"+i+p,child:this.chartObj.chart3D};this.chartObj.model.AreaType!="none"?(t.marker.dataLabel.connectorLine.height&&t.marker.dataLabel.connectorLine.height>0&&(y=[],y.push({x:u.X,y:u.Y+w,z:r.symbolLocation.z}),y.push({x:o,y:s+w,z:r.symbolLocation.z}),this.drawLineSegment(y,i,t)),this.chartObj.graphics.addVisual(this.chartObj.polygon.createTextElement(this.chartObj.vector.vector3D(o,s,r.symbolLocation.z),c,0,-h.height))):(t.labelPosition.toLowerCase()!="inside"&&this.updateConnectorLine(r,i,t,u,e),tt={x:t.actualWidth,y:t.actualHeight},this.chartObj.graphics.addVisual(this.chartObj.polygon.createTextElement(this.chartObj.vector.vector3D(u.X,u.Y,-1),c,0,-h.height)))},updateConnectorLine:function(n,t,i,r,u){var e=[],f=n.symbolLocation,o=f.center.x+Math.cos(f.angle)*f.radius,s=f.center.y+Math.sin(f.angle)*f.radius,h;e.push({x:o,y:s});h=f.radius+u;o=f.center.x+Math.cos(f.angle)*h;s=f.center.y+Math.sin(f.angle)*h;e.push({x:o,y:s});i.marker.dataLabel.connectorLine.type=="bezier"&&(e=this.getBezierApproximation(e,256,i));this.drawLineSegment(e,t,i)},getBezierApproximation:function(n,t,i){for(var f,u=[],r=0;r<=t;r++)f=r/t,u.push(this.GetBezierPoint(f,n,0,n.length,i));return u},drawLineSegment:function(t,i,r){for(var f=[],u=0;u<t.length;u++)f.push(this.chartObj.vector.vector3D(t[u].x,t[u].y,t[u].z?t[u].z:0));var e=n.inArray(r,this.chartObj.model._visibleSeries),o=this.chartObj.model.AreaType=="none"?this.chartObj.model.pointColors[i]:this.chartObj.model.seriesColors[e],s=r.marker.dataLabel.connectorLine.stroke?r.marker.dataLabel.connectorLine.stroke:o,h={width:r.marker.dataLabel.connectorLine.width,stroke:s,child:this.chartObj.chart3D,tag:"polyline",id:this.chartObj.svgObject.id+"_"+e+"_"+i};this.chartObj.graphics.addVisual(this.chartObj.polygon.createPolyline(f,h))}};ej.ejCircularSeries={draw:function(t,r,u){var e=r.chartObj.model._visibleSeries.length,f=n.inArray(t,r.chartObj.model._visibleSeries);if(r._calculateVisiblePoints(t),r.calculateSize(r,t),u=="pie"?(t._size=t.pieCoefficient,t._coefficient=f==0?0:t._size):(t._size=t.doughnutSize,t._coefficient=t.doughnutCoefficient),r.chartObj.model.circularRadius.length>1){for(i=f;i<r.chartObj.model.circularRadius.length;i++)if(!ej.util.isNullOrUndefined(r.chartObj.model.circularRadius[i])){r.chartObj.model.circularRadius[f]=r.chartObj.model.circularRadius[i]*t._size;break}}else r.chartObj.model.circularRadius[f]=(1-.03)*Math.min(t.actualWidth/2,t.actualHeight/2)*t._size;r.chartObj.model.innerRadius[f]=t._coefficient*r.chartObj.model.circularRadius[f];r.createPolygons(t,r)},doAnimation:function(t,i){var r=this;t.count=0;n.each(t.segments,function(r,u){var f=u.radius,e=u.inSideRadius;t.animate=!0