UNPKG

@boldreports/javascript-reporting-controls

Version:

The Bold Reports by Syncfusion controls for JavaScript contains ReportViewer and ReportDesigner HTML5 and JavaScript reporting controls for enterprise web development

10 lines 1.03 MB
/*! * filename: ej.chart.min.js * version : 10.1.12 * Copyright Syncfusion Inc. 2001 - 2025. 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/bold.reports.common.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(),t,i,r;t/=n;i/=n;r/=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),e=e.toLowerCase();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(),i.d=-(i.normal&f)},getPoint:function(n,i,r,u){var f;if(typeof n=="number")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),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 e=ej.Ej3DRender.transform,u=ej.EjSvgRender.utils._getStringBuilder(),o=ej.EjSvgRender.chartTransform3D.toScreen(n.VectorPoints[0],e),i,f,s,r;for(u.append("M "+o.x+" "+o.y+" "),i=0;i<n.VectorPoints.length;i++)f=ej.EjSvgRender.chartTransform3D.toScreen(n.VectorPoints[i],e),u.append("L "+f.x+" "+f.y+" ");s=u.toString();r={id:n.element.id,"stroke-dasharray":n.element.dashArray,"stroke-width":n.element.width,stroke:n.element.stroke,d:s};r.id=r.id.replace(/[^a-zA-Z0-9]/g,"");t.svgRenderer.drawPath(r,n.element.child)},drawLine:function(n,t){var i=ej.Ej3DRender.transform;if(i!=null){var u=ej.EjSvgRender.chartTransform3D.toScreen(n.VectorPoints[0],i),f=ej.EjSvgRender.chartTransform3D.toScreen(n.VectorPoints[2],i),r={id:n.element.id,x1:u.x,y1:u.y,x2:f.x,y2:f.y,"stroke-dasharray":n.element.dashArray,"stroke-width":n.element.width,stroke:n.element.stroke,opacity:n.element.opacity};r.id=r.id.replace(/[^a-zA-Z0-9]/g,"");t.svgRenderer.drawLine(r,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.font);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?u.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,tt,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 it=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:it+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,ut=h?90:-90,rt=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:tt,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+rt,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 vt,yt,rt,g,y,dt,pt,st,wi,wt,bi;this.gMultiLevelEle=this.svgRenderer.createGroup({id:this.svgObject.id+"_axisMultiLevelLabels_"+t});var rt,w,ut,e,b,c,hi,ft,o,s,k,ci=0,ki,li,di=i.multiLevelLabels.length,bt=this.model,kt=bt.elementSpacing,f=10,u=0,h=0,ai,l,et,ii,ri,ui,y,dt,ct,a,lt,nt,fi,tt=bt.m_AreaBounds,d,ot=i.visibleRange,ei,gt=bt.wallSize,it=i._opposed,vi=r.axes[i.name]._validCross,oi,at=i.orientation.toLowerCase(),yi=vi?i.y:tt.Y+(!it&&tt.Height),si,gi=vi?i.x:tt.X+(it&&tt.Width),v,st,ni=[],ti,ht,pi={Width:n(this.svgObject).width(),Height:n(this.svgObject).height()},p=ej.EjSvgRender.chartTransform3D.transform3D(pi);for(p.mViewport=pi,p.Rotation=0,p.Tilt=0,p.Depth=100,p.PerspectiveAngle=bt.perspectiveAngle,ej.EjSvgRender.chartTransform3D.transform(p),vt=ej.EjSvgRender.chartTransform3D.result,yt=ej.Ej3DRender.prototype.matrix3D.prototype,rt=0;rt<di;rt++)if(e=i.multiLevelLabels[rt],b=this.svgObject.id+"_"+i.name+"MultiLevelLabels_"+t+"_"+rt,e.text!=""&&e.visible){if(l=e._level,et="middle",c=e.font,ht=e.border.width,ct=e.maximumTextWidth,si=e.textAlignment.toLowerCase(),dt=y=e.text,k=e.textOverflow.toLowerCase(),d=ej.EjSvgRender.utils._measureText(e.text,tt.Width,e.font),hi=(e.end-e.start)/2,ft=(e.start+hi-ot.min)/ot.delta,o=(e.start-ot.min)/ot.delta,s=(e.end-ot.min)/ot.delta,i.isInversed&&(ft=isNaN(ft)?0:1-ft,o=isNaN(o)?0:1-o,s=isNaN(s)?0:1-s),at=="horizontal"?(u=Math.round(i.width*ft)+tt.X+i.plotOffset,h=it?yi-gt-i.majorTickLines.size-kt-f/2-i._LableMaxWidth.height:yi+gt+i.majorTickLines.size+kt+i._LableMaxWidth.height,o=Math.round(i.width*o)+tt.X+i.plotOffset,s=Math.round(i.width*s)+tt.X+i.plotOffset,ut=ct?ct:s-o-f):(h=Math.round(i.plotOffset+i.y+i.height*(1-ft)),u=it?i.x+gt+i.majorTickLines.size+i.axisLine.width+kt/2+i._LableMaxWidth.width+i.prevHeight[l]+i.multiLevelLabelHeight[l]/2:gi-gt-i.majorTickLines.size-kt/2-i._LableMaxWidth.width-i.prevHeight[l]-i.multiLevelLabelHeight[l]/2,o=Math.round(i.plotOffset+i.y+i.height*(1-o)),s=Math.round(i.plotOffset+i.y+i.height*(1-s)),ut=ct?ct:i.multiLevelLabelHeight[l]+f),at=="horizontal"&&(h=it?h-i.prevHeight[l]:h+i.prevHeight[l]),si=="far"?(u=u+ut/2-ht/2,et="end"):si=="near"&&(et="start",u=u-ut/2+ht/2),g=ej.EjAxisRenderer.prototype._triggerMultiLevelLabelsRendering(dt,u,h,k,c,e.border,this),y=dt=g.text,u=g.location.x,h=g.location.y,k=g.textOverflow.toLowerCase(),c=g.font,c.color=c.color?c.color:i.multiLevelLabelsFontColor,ki=g.border,li=g.border.type.toLowerCase(),ht=g.border.width,v={id:b,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":et},k!="none"&&(y=ej.EjAxisRenderer.prototype.textOverflowMultiLevelLabels(i,ut,y,dt,k,c,d,{x:u,y:h},null,this)),k=="wrap"||k=="wrapandtrim")for(pt=h,w=0;w<y.length;w++)d=ej.EjSvgRender.utils._measureText(y[w],null,c),w!=0&&(pt=it?pt-d.height:pt+d.height),ai={Width:d.width,Height:d.height,Label:{Text:y[w]},TextAnchor:et,tag:"text",font:c,id:b+"_"+w,child:this.chart3D},v.id=v.id+"_"+w,st=ej.EjSvgRender.chartTransform3D.toScreen({x:u,y:pt+f/2,z:0},p,vt,yt),v.x=st.x,v.y=st.y,this.svgRenderer.drawText(v,y[w],this.gMultiLevelEle);if(u=at=="horizontal"?u:it?u+f:u-f,k!="wrap"&&k!="wrapandtrim"&&(ai={Width:d.width,Height:d.height,Label:{Text:y},TextAnchor:et,tag:"text",font:c,id:b,child:this.chart3D},st=ej.EjSvgRender.chartTransform3D.toScreen({x:u,y:h+f/2,z:0},p,vt,yt),v.x=st.x,v.y=st.y,this.svgRenderer.drawText(v,y,this.gMultiLevelEle)),wi=at=="horizontal"?{bounds:{x:o,y:h-f,height:i.multiLevelLabelHeight[l],width:ut},axisIndex:t,multiLevelLabel:e}:{bounds:{x:u-a/2-f/2,y:s,height:o-s,width:a},axisIndex:t,multiLevelLabel:e},this.model.multiLevelLabelRegions.push(wi),li!="none"&&ht>0){for(b=this.svgObject.id+"_"+i.name+"MultiLevelLabelsBorder_"+t+"_"+rt,wt=h-f+i.multiLevelLabelHeight[l]+f/2,bi=e.border.color?e.border.color:i.multiLevelLabelsColor,at=="horizontal"?(ii={x1:o,y1:h-f,x2:s,y2:h-f},ri={x1:o,y1:wt,x2:s,y2:wt},ui={x1:o,y1:h-f,x2:o,y2:wt},fi={x1:s,y1:h-f,x2:s,y2:wt}):(a=i.multiLevelLabelHeight[l]-f/2,ii={x1:u-a/2-f/2,y1:s,x2:u+a/2+f/2,y2:s},ri={x1:u-a/2-f/2,y1:o,x2:u+a/2+f/2,y2:o},ui={x1:u-a/2-f/2,y1:s,x2:u-a/2-f/2,y2:o},fi={x1:u+a/2+f/2,y1:s,x2:u+a/2+f/2,y2:o}),ti=0;ti<4;ti++){switch(ti){case 0:lt=b+"_top";nt=ii;break;case 1:lt=b+"_bottom";nt=ri;break;case 2:lt=b+"_left";nt=ui;break;case 3:lt=b+"_right";nt=fi}ni[0]=ej.Ej3DRender.prototype.vector3D.prototype.vector3D(nt.x1,nt.y1,ci);ni[1]=ej.Ej3DRender.prototype.vector3D.prototype.vector3D(nt.x2,nt.y2,ci);ei=ej.EjSvgRender.chartTransform3D.toScreen(ni[0],p,vt,yt);oi=ej.EjSvgRender.chartTransform3D.toScreen(ni[1],p,vt,yt);v={id:lt,x1:ei.x,y1:ei.y,x2:oi.x,y2:oi.y,stroke:bi,"stroke-width":ht};this.svgRenderer.drawLine(v,this.gMultiLevelEle)}this.svgRenderer.append(this.gMultiLevelEle,this.svgObject)}}},_textTrim:function(n,t,i){var e=t.length,f,u,o=ej.EjSvgRender.utils._measureText(t,this.model.m_AreaBounds.Width,i),r;if(o.width>n){for(r=e-1;r>=0;--r)if(u=t.substring(0,r)+"...",f=ej.EjSvgRender.utils._measureText(u,this.model.m_AreaBounds.Width,i),f.width<=n)return u}else return t},_textWrap:function(n,t,i){for(var o=t.toString().split(" "),r="",f=[],s=o.length,u="",e=0;e<s;e++)u=o[e],ej.EjSvgRender.utils._measureText(r.concat(u),this.model.m_AreaBounds.Width,i).width<n?r=r.concat((r===""?"":" ")+u):r!==""?(f.push(this._textTrim(n,r,i)),r=u):(f.push(this._textTrim(n,u,i)),u=""),r&&e===s-1&&f.push(this._textTrim(n,r,i));return f},_textWrapByLength:function(n,t,i){var u=0,e=[],f="",o,r;for(t=t.toString(),o=t.length,r=0;r<=o;r++)f=u==0?t.slice(u,r):"-"+t.slice(u,r),ej.EjSvgRender.utils._measureText(f,this.model.m_AreaBounds.Width,i).width>n-5?(e.push(f),u=r++):r===o&&e.push(f);return e},_multipleRows:function(n,t,i,r){for(var u,e,o,s=[],h,f=n-1;f>=0;f--)u=r.visibleLabels[f],o=ej.EjSvgRender.utils._measureText(u.Text,this.model.m_AreaBounds.Width,r.font),e=ej.EjSvgRender.utils._valueToCoefficient(r,f)*r.width+r.x,h=t<e+o.width/2,h?(u.index=u.index?u.index:0,s.push(u.index),i.index=i.index>u.index?i.index:u.index+1):i.index=s.indexOf(u.index)>-1?i.index:u.index},_drawAxisLabel:function(n,t){for(var w,e,f,v,r,y,o=[],l=null,g=n.visibleLabels.length,a=this.model.m_AreaBounds,c=n._opposed,b,k=t.axes[n.name]._validCross,d=k?n.y:a.Y+(!c&&a.Height),nt=k?n.x:a.X+(c&&a.Width),i=0;i<g;i++)if(!ej.util.isNullOrUndefined(n.visibleLabels[i].Text)){var s=0,u=0,tt=0,it=0,p,h;if(n.visibleLabels[i].originalText=n.visibleLabels[i].Text,e=ej.EjSvgRender.utils._measureText(n.visibleLabels[i].Text,this.model.m_AreaBounds.Width,n.font),f=(n.visibleLabels[i].Value-n.visibleRange.min)/n.visibleRange.delta,f=n.isInversed?1-f:f,f=isNaN(f)?0:f,n.orientation.toLowerCase()=="horizontal"?(tt=s=Math.round(n.width*f)+this.model.m_AreaBounds.X+n.plotOffset,u=c?d-this.model.wallSize-n.majorTickLines.size-this.model.elementSpacing/2:d+this.model.wallSize+n.majorTickLines.size+this.model.elementSpacing,w="middle"):(u=it=Math.round(n.plotOffset+n.y+e.height/4+n.height*(1-f)),s=c?n.x+n.majorTickLines.size+n.axisLine.width+this.model.elementSpacing/2:nt-this.model.wallSize-n.majorTickLines.size-this.model.elementSpacing/2,w=c?"start":"end"),o.push({x:s,y:u,size:e}),v=n.width/n.visibleLabels.length-5,r=o[i],(r.x-r.size.width/2<n.x&&i===0||r.x+r.size.width/2>n.x+n.width&&i===n.visibleLabels.length-1)&&n.labelIntersectAction!="trim"&&n.labelIntersectAction.indexOf("wrap")<0)if(n.edgeLabelPlacement==="hide")continue;else n.edgeLabelPlacement==="shift"&&(i==0?r.x=s=n.x+r.size.width/2:i==n.visibleLabels.length-1&&(r.x=s=n.x+n.width-r.size.width/2));if(n.orientation.toLowerCase()=="horizontal")if(n.labelRotation)l=n.labelRotation,y=ej.EjSvgRender.utils.rotatedLabel(n,this,n.labelRotation,n.visibleLabels[i].Text,!0),u+=y.height/2;else if(n.labelIntersectAction=="trim")n.visibleLabels[i].Text=this._textTrim(v,n.visibleLabels[i].Text,n.font);else if(n.labelIntersectAction=="wrapByWord")n.visibleLabels[i].Text=this._textWrap(v,n.visibleLabels[i].Text,n.font);else if(n.labelIntersectAction=="wrap")n.visibleLabels[i].Text=this._textWrapByLength(v,n.visibleLabels[i].Text,n.font);else if(n.labelIntersectAction=="rotate45"||n.labelIntersectAction=="rotate90")l=n.labelIntersectAction.indexOf("45")>-1?45:90,y=ej.EjSvgRender.utils.rotatedLabel(n,this,l,n.visibleLabels[i].Text,!0),u+=y.height/2;else if(n.labelIntersectAction==="multipleRows")p=r.x,p-=e.width/2,this._multipleRows(i,p,n.visibleLabels[i],n),u=n.visibleLabels[i].index?u+n.visibleLabels[i].index*(e.height+5):u;else if(n.labelIntersectAction==="hide"){if(h=h?h:0,i!=0&&o[h].x+o[h].size.width/2>=o[i].x-o[i].size.width/2)continue;h=i}b={Width:e.width,Height:e.height,Label:n.visibleLabels[i],TextAnchor:w,tag:"text",font:n.font,id:this.svgObject.id+n.orientation+i,child:this.chart3D,Angle:l};this.graphics.addVisual(this.polygon.createTextElement(this.vector.vector3D(s,u,0),b,10,10))}},_renderTicks3D:function(n,t,i,r){for(var s,f,o,y=n.visibleLabels.length,p,h=this.model.m_AreaBounds,w=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(p=n.visibleRange.interval/(n.minorTicksPerInterval+1),s=0;s<n.minorTicksPerInterval;s++)u=ej.EjSvgRender.utils._valueToCoefficient(n,n.visibleLabels[e].Value+p*(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),u=0,tt=this._calculateVisiblePoints(t).visiblePoints,w=t._visiblePoints.length;for(s=0;s<w;s++)u+=tt[s].YValues[0];u=u!=0?u:1;var b=360/u,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,f,e,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),f=Math.abs(d[r]),v=Math.abs(f)*(Math.PI*2/u),e={},e.x=0,e.y=0,ej.util.isNullOrUndefined(f)||((t.explodeIndex==t._visiblePoints[r].actualIndex||t.explodeAll)&&(o={X:0,Y:0},o.X=Math.cos(2*Math.PI*(h+f/2)/u),o.Y=Math.sin(2*Math.PI*(h+f/2)/u),e.x=.01*c*o.X*t.explodeOffset,e.y=.01*c*o.Y*t.explodeOffset),l=i.chartObj.vector.vector3D(e.x+p.centerX,e.y+p.centerY,0),y=this.createSegment(l,parseFloat(b*h),parseFloat(b*f),rt,c,r,f,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+=f);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 h=t.marker.dataLabel.connectorLine.height,rt,a,e,o,v,nt=0,p=0,ut=2,b,k,f,s,ot,w,g,st;if(typeof t.marker.dataLabel.offset=="number"?p=t.marker.dataLabel.offset:(nt=t.marker.dataLabel.offset.x,p=t.marker.dataLabel.offset.y),this.chartObj.model.AreaType=="none"){u={x:0,y:0};var c=r.text?r.text:r.y,tt=n.inArray(t,this.chartObj.model.series),s=ej.EjSvgRender.utils._measureText(c,null,t.marker.dataLabel.font);if(t.type.toLowerCase()=="doughnut"||t.type.toLowerCase()=="pie"){var ht=Math.min(t.actualWidth,t.actualHeight)/2,y=r.symbolLocation.center,nt=t.marker.dataLabel.offset.x,p=t.marker.dataLabel.offset.y,ft=r.symbolLocation.radius*t._coefficient;ej.util.isNullOrUndefined(h)&&(h=ej.EjSvgRender.utils._measureText(c,null,t.marker.dataLabel.font).height);t!=null&&t.labelPosition!="inside"?a=r.symbolLocation.radius+h:t!=null&&(a=ft+(r.symbolLocation.radius-ft)/2);t.labelPosition!="inside"?(b=a*Math.cos(r.symbolLocation.angle),k=a*Math.sin(r.symbolLocation.angle),e=b>0?u.X=y.x+b+s.width/2+ut:u.X=y.x+b-s.width/2-ut,o=k>0?u.Y=y.y+k+s.height/2:u.Y=y.y+k):(e=u.X=y.x+a*Math.cos(r.symbolLocation.angle)+nt,o=u.Y=y.y+a*Math.sin(r.symbolLocation.angle)+p);f=n.extend({},ej.EjSvgRender.commonChartEventArgs);f.data={text:c,location:{x:e,y:o},series:t,pointIndex:i,seriesIndex:tt};this.chartObj._trigger("displayTextRendering",f);f.data.Text=f.data.text;s=ej.EjSvgRender.utils._measureText(f.data.Text,null,t.marker.dataLabel.font);e=u.X=f.data.location.x;o=u.Y=f.data.location.y}}else{var l=t.yAxis.labelFormat?t.yAxis.labelFormat:"",tt=n.inArray(t,this.chartObj.model.series),et=20,c=r.text?r.text:r.y;l&&(l.indexOf("{value}")>-1?c=l.replace("{value}",r.y):l.indexOf("e")==0||l.indexOf("E")==0?(v=l.match(/(\d+)/g),v=v==null?6:v>et?et:v,c=r.y.toExponential(v)):c=ej.globalize.format(r.y,l,this.chartObj.model.locale));var it=0,f=n.extend({},ej.EjSvgRender.commonChartEventArgs),s=ej.EjSvgRender.utils._measureText(c,null,t.marker.dataLabel.font),u=ej.EjSvgRender.utils.Transform3DToVisible(t,r.symbolLocation.x,r.symbolLocation.y,this.chartObj),h=t.marker.dataLabel.connectorLine.height?t.marker.dataLabel.connectorLine.height:0,d=6.28*(1-90/360),o=u.Y,e=u.X;this.chartObj.model.requireInvertedAxes?(e=r.x>0?u.X-Math.sin(d)*h:u.X+Math.sin(d)*h,it=-s