text: ﻿if(!window.LChart){throw new Error("未能加载loongchart.core.js，该js必须在其他LChart框架的js加载之前被引用。\n"+"Not loaded loongchart.core.js which must be loaded before other LChart's js.")}else{LChart.Const.Skins.BlackAndWhite.Pie3D={SeparateLineColor:null,InnerLabelColor:null,OuterLabelColor:null,OuterLabelBorderColor:null,OuterLabelBackColor:"rgba(255,255,255,0.3)"}}LChart.Pie3D=LChart.getCore().__extends({GraphType:"Pie3D"});LChart.Pie3D._spreadSkin=function(b,a){b.separateLine={};b.innerLabel={};b.outerLabel={};b.separateLine.color=a.SeparateLineColor||null;b.innerLabel.color=a.InnerLabelColor||null;b.outerLabel.color=a.OuterLabelColor||null;b.outerLabel.bordercolor=a.OuterLabelBorderColor||null;b.outerLabel.backcolor=a.OuterLabelBackColor||null};LChart.Pie3D._getDefaultOptions=function(b){var a=LChart.Methods.Extend(b,{offX:0,offY:0,radius:null,margin:null,colors:null,animateRotate:true,animateScale:true,startAngle:null,clickout:true,reflection3d:{reflectoffX:null,reflectoffY:null,zoomX:null,zoomY:null},separateLine:{show:false,color:null,width:null},innerLabel:{show:true,content:function(c){return c.percent.toFixed(1)+"%"},distance:null,color:null,fontsize:null,fontfamily:null},outerLabel:{show:true,content:function(c){return c.text+" "+c.percent.toFixed(1)+"%"},withlegend:true,legendtype:null,length:null,color:null,backcolor:"rgba(255,255,255,0.3)",bordercolor:null,borderwidth:0.5,fontsize:null,fontfamily:null}});return a};LChart.Pie3D._getCheckOptions=function(){return{__top:[["offX","n"],["offY","n"],["radius","n"],["margin","n"],["colors","ca"],["animateRotate","b"],["animateScale","b"],["startAngle","n"],["clickout","b"]],reflection3d:[["reflectoffX","n"],["reflectoffY","n"],["zoomX","n"],["zoomY","n"]],separateLine:[["show","b"],["color","c"],["width","n"]],innerLabel:[["show","b"],["content","f"],["distance","n"],["color","c"],["fontsize","n"],["fontfamily","s"]],outerLabel:[["show","b"],["content","f"],["withlegend","b"],["legendtype","s"],["length","n"],["backcolor","c"],["bordercolor","c"],["borderwidth","n"],["color","c"],["fontsize","n"],["fontfamily","s"]]}};LChart.Pie3D._drawgraphic=function(E,k,x,f){var c=E._computeSegmentTotal(x).segmentTotal;var e=3;var d=3;var n=f.reflection3d.zoomX||1.2;var l=f.reflection3d.zoomY||0.9;if(E._configs._isIE678.isIE678){n=1;l=1}var C=E._computeRadiusForPies(f,n,l);if(E._configs._isIE678.isIE678){C.maxRadius*=0.9}var o=!f.radius||!LChart.Methods.IsNumber(f.radius)?C.maxRadius:f.radius;var w=o/10;var i=k==E.ID;var m=(f.colors&&f.colors.length>0?f.colors:null)||LChart.Const.Defaults.FillColors;if(i){E.coordinates.draw=C.coordinate;E._configs.legendColors=m}E.shapes[k]={cemicircles:[],outerLabels:[],faces:null};var t=E.shapes[k];if(!E.coordinates.pie){E.coordinates.pie={}}E.coordinates.pie[k]={pieRadius:o,centerX:C.centerX,centerY:C.centerY,cemicircles:[],outerlabels:[]};var s=f.reflection3d.reflectoffX||0;var q=f.reflection3d.reflectoffY||o/6;var j=true;var G=E._configs.specificConfig[k];var A=f.separateLine.show?(f.separateLine.width||1):0;var B=f.separateLine.color||"#ffffff";var F=Math.PI*(f.startAngle==null?-0.5:f.startAngle);var b=E._getReflectAngle(s,q);var a=function(J,aa,K,L){var Q=(K+L)/2;var P=C.centerX;var O=C.centerY;var T=Math.cos(Q);var N=Math.sin(Q);if(J){P+=w*T;O+=w*N}var M=o*aa;var Y=P+Math.cos(K)*M;var X=O+Math.sin(K)*M;var I=P+Math.cos(L)*M;var H=O+Math.sin(L)*M;var V=P+s;var U=O+q;var Z=V+Math.cos(K)*M;var W=U+Math.sin(K)*M;var S=V+Math.cos(L)*M;var R=U+Math.sin(L)*M;return{midAngle:Q,centerX:P,centerY:O,startX:Y,startY:X,endX:I,endY:H,radius:M,darkCenterX:V,darkCenterY:U,darkStartX:Z,darkStartY:W,darkEndX:S,darkEndY:R}};var D=function(H){return LChart.Methods.computeDifferAngle(H,b*Math.PI)<Math.PI/2};var g=function(N,M,L,J,I,K,O,H){this.content=N;this.length=M;this.width=L;this.height=J;this.floatright=I;this.floattop=K;this.data=O;this.contact=H;this.color=this.contact.color;this.index=this.contact.index;this.resetposition=function(){var Q=this.contact.computeinfo(),P=D(Q.midAngle);var U=1.15,S=Math.cos(Q.midAngle),R=Math.sin(Q.midAngle),T=R>0?R:0;this.startX=(P?(Q.centerX+Q.darkCenterX)/2:Q.centerX)+o*S;this.startY=(P?(Q.centerY+Q.darkCenterY)/2:Q.centerY)+o*R;this.left=(P?Q.darkCenterX:Q.centerX)+o*U*S+(this.floatright?0:-this.width);this.top=(P?Q.darkCenterY:Q.centerY)+o*U*R+T*this.length-this.length-d};this.endX=function(){return this.left+(this.floatright?0:this.width)};this.endY=function(){return this.top+this.height/2}};var r=function(J,I,K,H,N,M,L,O){this.index=J;this.color=I;this.percent=K;this.angleMin=H;this.angleMax=N;this.midAngle=M;this.isHovered=false;this.isClickout=O;this.data=L;this.redraw=function(P,Q){var S=Q;for(var R=0;R<4;R++){z(R,P,1,this.angleMin,this.angleMax,Q||this.color,S,S?Q:this.data.darksidecolor)}};this.contact=null;this.computeinfo=function(P){if(!this._computeinfo||P){this._computeinfo=a(this.isClickout,1,this.angleMin,this.angleMax)}return this._computeinfo};this.click=function(T,P){if(f.clickout){j=true;this.isClickout=!this.isClickout;
  this.computeinfo(true);E.redrawAll();var R=f.mouseoverTransparency;var Q="rgba(255,255,255,"+(R>0&&R<1?R:0.2)+")";this.redraw(this.isClickout,Q);v(this,Q)}if(!f.clickout||this.isClickout){var S=typeof this.data.click=="function"?this.data.click:(f.click||null);if(S){S(this.data,T)}}};if(f.tip.show&&typeof f.tip.content=="function"){this.tip=null;this.showTip=function(){if(this.tip){this.tip.style.display="inline"}else{var S=(this.angleMin+this.angleMax)/2;var R=(C.centerX+o*0.5*Math.cos(S))*n;var Q=(C.centerY+o*0.5*Math.sin(S))*l;this.tip=E._createTip(f.tip.content(this.data),R,Q);var P=this;P.tip.onclick=function(T){P.click(T)}}};this.hideTip=function(){if(this.tip){this.tip.style.display="none"}}}};var z=function(H,K,ab,L,O,Y,X,R,aa,U){var Q=a(K,ab,L,O);R=R||LChart.Methods.getDarkenColor(Y);var N=X?0:A;E.ctx.save();E.ctx.transform(n,0,0,l,0,0);switch(H){case 0:E.DrawFigures.createArc(Q.darkCenterX,Q.darkCenterY,Q.radius,0,null,R,L,O,true);break;case 1:E.DrawFigures.createCloseFigure([[Q.darkCenterX,Q.darkCenterY],[Q.centerX,Q.centerY],[Q.endX,Q.endY],[Q.darkEndX,Q.darkEndY]],R);break;case 2:E.DrawFigures.createCloseFigure([[Q.darkCenterX,Q.darkCenterY],[Q.centerX,Q.centerY],[Q.startX,Q.startY],[Q.darkStartX,Q.darkStartY]],R);break;default:E.DrawFigures.createArc(Q.centerX,Q.centerY,Q.radius,N,B,Y,L,O,true);if(N>0){if(D(L)){E.DrawFigures.createLine(Q.startX,Q.startY,Q.darkStartX,Q.darkStartY,N,B)}if(K&&D(O)){E.DrawFigures.createLine(Q.endX,Q.endY,Q.darkEndX,Q.darkEndY,N,B)}}break}E.ctx.restore();var J=f.outerLabel;if(aa&&J.show&&typeof J.content=="function"){var P=J.length||o/12;var S=LChart.Methods.JudgeBetweenAngle(-Math.PI*0.5,Math.PI*0.5,Q.midAngle);var Z=LChart.Methods.JudgeBetweenAngle(-Math.PI,0,Q.midAngle);var W=J.content(aa);var M=E.DrawFigures.measureText(W,null,J.fontsize||(P-1),J.fontfamily);var V=M+(J.withlegend?P+3*e:2*e);var T=P+d*2;var I=new g(W,P,V,T,S?1:0,Z?1:0,aa,U);t.outerLabels.push(I);U.contact=I}};var h=function(L){var K=f.innerLabel;if(!(K.show&&typeof K.content=="function")){return}var M=K.distance||0.6;var J=function(N){var S=(N.angleMin+N.angleMax)/2;var P=N.data;var O=N.isClickout?(o*M+w):o*M;var R=C.centerX+O*Math.cos(S);var Q=C.centerY+O*Math.sin(S);E.ctx.save();E.ctx.transform(n,0,0,l,0,0);E.DrawFigures.createText(K.content(P),R,Q,"center",P.fontweight,P.fontsize||K.fontsize||o/10,K.fontfamily,P.fontcolor||K.color||LChart.Const.Defaults.InnerLabelColor);E.ctx.restore()};if(L){J(L)}else{for(var I=0,H;H=t.cemicircles[I];I++){J(H)}}};var v=function(O,L){var I=f.outerLabel;if(!(I.show&&typeof I.content=="function")){return}var J=(i?C.coordinate.minY:5)/l;var H=(i?C.coordinate.maxY:E.canvas.height-5)/l;t.outerLabels.sort(function(R,Q){return R.index-Q.index});if(j){for(var K=0,N;N=t.outerLabels[K];K++){N.resetposition()}j=false}var M=function(){var W=function(ab,aa){return Math.max(ab.left,aa.left)<=Math.min(ab.left+ab.width,aa.left+aa.width)&&Math.max(ab.top,aa.top)<=Math.min(ab.top+ab.height,aa.top+aa.height)};var S=[];var Q=[];var X=[];var R=[];for(var V=0,Z;Z=t.outerLabels[V];V++){while(J>Z.top){Z.top+=d;Z.left+=Z.floatright?e:-e}while(H<Z.top+Z.height){Z.top-=d;Z.left+=Z.floatright?e:-e}if(Z.floatright&&Z.floattop){X.push(Z)}else{if(Z.floatright&&!Z.floattop){R.push(Z)}else{if(!Z.floatright&&Z.floattop){S.push(Z)}else{Q.push(Z)}}}}var Y=0;var U=[];var T=function(ab){if(U.length>0){for(var aa=0,ac;ac=U[aa];aa++){while(W(ac,ab)&&Y<1000){ab.top+=ab.floattop?d:-d;ab.left+=ab.floatright?e:-e;Y++}}}U.push(ab)};for(var V=S.length-1;V>=0;V--){T(S[V])}U=[];for(var V=0;V<Q.length;V++){T(Q[V])}U=[];for(var V=0;V<X.length;V++){T(X[V])}U=[];for(var V=R.length-1;V>=0;V--){T(R[V])}};var P=function(S,R){var Q=S;E.ctx.save();E.ctx.transform(n,0,0,l,0,0);if(!R){E.DrawFigures.createQuadraticCurve(Q.startX,Q.startY,Q.startX*0.8+Q.endX()*0.2,Q.startY*0.2+Q.endY()*0.8,Q.endX(),Q.endY(),1,I.bordercolor);if(I.backcolor){E.DrawFigures.createRectangleFill(Q.left,Q.top,Q.width,Q.height,I.backcolor)}var W=I.fontsize||(Q.length-1);var V=Q.left+(Q.floatright?e+(I.withlegend?Q.length+e:0):Q.width-e);var U=Q.top+Q.length/2+W/2+d/2;E.DrawFigures.createText(Q.content,V,U,Q.floatright?"left":"right",null,W,I.fontfamily,I.color);if(I.borderwidth&&I.borderwidth>0){E.DrawFigures.createRectangleBorder(Q.left,Q.top,Q.width,Q.height,I.borderwidth,I.bordercolor)}}if(I.withlegend){var T=I.legendtype||"s";var R=R||Q.color;E.DrawFigures.createPointElement(T,Q.left+e,Q.top+d,Q.length,R,T!="x",R,2,T=="x")}E.ctx.restore()};if(O){P(O.contact,L)}else{M();E.coordinates.pie[k].outerlabels.length=0;for(var K=0,N;N=t.outerLabels[K];K++){P(N);E.coordinates.pie[k].outerlabels[K]={index:N.contact.index,left:N.left,top:N.top,width:N.width,height:N.height}}}};var u=function(P,X){var Q=f.animation&&f.animateScale?P:1;var S=f.animation&&f.animateRotate?P:1;var R=X>=1;var N=[],I=[];var L=F;for(var U=0,Y;Y=x[U];U++){var H=(Y.value/c)*100;var V=H/100*Math.PI*2*S;var T=Y.color||m[U%m.length];var J=L;var K=L+E._formatSegmentAngle(V);var O=(J+K)/2;
  if(R){Y.percent=H;E.coordinates.pie[k].cemicircles.push({index:U,percent:H,angleMin:J,angleMax:K,color:T})}var W=new r(U,T,H,J,K,O,Y,Y.extended);N.push(W);L=K}I=E._get3DFaceDrawOrder(N);for(var U=0,M;M=I[U];U++){z(M.type,M.shape.data.extended,Q,M.shape.angleMin,M.shape.angleMax,M.shape.color,false,M.shape.data.darksidecolor,R&&M.type==3?M.shape.data:null,R&&M.type==3?M.shape:null)}if(R){t.cemicircles=N;t.faces=I;h();v()}};var p=function(){var J=function(T,R){var M=null;for(var P=0,Q;Q=t.cemicircles[P];P++){var O=Q.computeinfo();var N=LChart.Methods.GetCurrentAngle(T,R,O.centerX,O.centerY);var K=(Math.pow(T-O.centerX,2)+Math.pow(R-O.centerY,2)<=Math.pow(o,2))&&LChart.Methods.JudgeBetweenAngle(Q.angleMin,Q.angleMax,N);var V=false;if(f.outerLabel&&f.outerLabel.show&&Q.contact){var S=Q.contact;if(T>=S.left&&T<=S.left+S.width&&R>=S.top&&R<=S.top+S.height){V=true}}if(K||V){M=Q;break}}if(!M){for(var P=t.cemicircles.length-1;P>=0;P--){var Q=t.cemicircles[P];var O=Q.computeinfo();var L=LChart.Methods.GetCurrentAngle(T,R,O.darkCenterX,O.darkCenterY);var U=(Math.pow(T-O.darkCenterX,2)+Math.pow(R-O.darkCenterY,2)<=Math.pow(o,2))&&LChart.Methods.JudgeBetweenAngle(Q.angleMin,Q.angleMax,L);if(U){M=Q;break}}}return M};var I=function(M){var M=window.event||M;var K=LChart.Methods.tranferLocation(E._getMouseLoction(M),n,l);var L=J(K.X,K.Y);if(L){L.click(M)}};var H=function(O){var O=window.event||O;var R=LChart.Methods.tranferLocation(E._getMouseLoction(O),n,l);var M=J(R.X,R.Y);if(M){E._configs.cursorPointer=true}if(G.currentMouseShape!=M){var P=G.currentMouseShape;if(P){var L=typeof P.data.mouseleave=="function"?P.data.mouseleave:(f.mouseleave||null);if(L){L(P.data,O)}}if(G.currentMouseShape){E.redrawAll()}G.currentMouseShape=M;for(var N=0,P;P=t.cemicircles[N];N++){if(P.isHovered){P.isHovered=false;if(P.hideTip){P.hideTip()}}}if(M){M.isHovered=true;var K=f.mouseoverTransparency;var Q="rgba(255,255,255,"+(K>0&&K<1?K:0.2)+")";M.redraw(M.isClickout,Q);v(M,Q);if(M.showTip){M.showTip()}var S=typeof M.data.mouseover=="function"?M.data.mouseover:(f.mouseover||null);if(S){S(M.data,O)}}}};E._addEventListener("click",I);E._addEventListener("mousemove",H)};var y=function(){for(var H=0,I;I=t.faces[H];H++){z(I.type,I.shape.isClickout,1,I.shape.angleMin,I.shape.angleMax,I.shape.color,null,I.shape.data.darksidecolor)}h();v()};return{drawSegments:u,mouseEvents:p,redraw:y}};