Edit D:\rfid\libsystem\page\statistics\js\funnel.js
define(function(e){var d=e("./base");var g=e("zrender/shape/Text");var b=e("zrender/shape/Line");var i=e("zrender/shape/Polygon");var k=e("../config");k.funnel={zlevel:0,z:2,clickable:true,legendHoverLink:true,x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:true,position:"outer"},labelLine:{show:true,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:true},labelLine:{show:true}}}};var c=e("../util/ecData");var h=e("../util/number");var f=e("zrender/tool/util");var a=e("zrender/tool/color");var l=e("zrender/tool/area");function j(p,m,q,o,n){d.call(this,p,m,q,o,n);this.refresh(o)}j.prototype={type:k.CHART_TYPE_FUNNEL,_buildShape:function(){var p=this.series;var q=this.component.legend;this._paramsMap={};this._selected={};this.selectedMap={};var o;for(var n=0,m=p.length;n<m;n++){if(p[n].type===k.CHART_TYPE_FUNNEL){p[n]=this.reformOption(p[n]);this.legendHoverLink=p[n].legendHoverLink||this.legendHoverLink;o=p[n].name||"";this.selectedMap[o]=q?q.isSelected(o):true;if(!this.selectedMap[o]){continue}this._buildSingleFunnel(n);this.buildMark(n)}}this.addShapeList()},_buildSingleFunnel:function(G){var n=this.component.legend;var A=this.series[G];var I=this._mapData(G);var m=this._getLocation(G);this._paramsMap[G]={location:m,data:I};var H;var J=0;var o=[];for(var F=0,D=I.length;F<D;F++){H=I[F].name;this.selectedMap[H]=n?n.isSelected(H):true;if(this.selectedMap[H]&&!isNaN(I[F].value)){o.push(I[F]);J++}}if(J===0){return}var u=this._buildFunnelCase(G);var E=A.funnelAlign;var y=A.gap;var w=J>1?(m.height-(J-1)*y)/J:m.height;var B;var r=m.y;var p=A.sort==="descending"?this._getItemWidth(G,o[0].value):h.parsePercent(A.minSize,m.width);var z=A.sort==="descending"?1:0;var s=m.centerX;var C=[];var t;var v;var q;for(var F=0,D=o.length;F<D;F++){H=o[F].name;if(this.selectedMap[H]&&!isNaN(o[F].value)){B=F<=D-2?this._getItemWidth(G,o[F+z].value):A.sort==="descending"?h.parsePercent(A.minSize,m.width):h.parsePercent(A.maxSize,m.width);switch(E){case"left":t=m.x;break;case"right":t=m.x+m.width-p;break;default:t=s-p/2}v=this._buildItem(G,o[F]._index,n?n.getColor(H):this.zr.getColor(o[F]._index),t,r,p,B,w,E);r+=w+y;q=v.style.pointList;C.unshift([q[0][0]-10,q[0][1]]);C.push([q[1][0]+10,q[1][1]]);if(F===0){if(p===0){q=C.pop();E=="center"&&(C[0][0]+=10);E=="right"&&(C[0][0]=q[0]);C[0][1]-=E=="center"?10:15;if(D==1){q=v.style.pointList}}else{C[C.length-1][1]-=5;C[0][1]-=5}}p=B}}if(u){C.unshift([q[3][0]-10,q[3][1]]);C.push([q[2][0]+10,q[2][1]]);if(p===0){q=C.pop();E=="center"&&(C[0][0]+=10);E=="right"&&(C[0][0]=q[0]);C[0][1]+=E=="center"?10:15}else{C[C.length-1][1]+=5;C[0][1]+=5}u.style.pointList=C}},_buildFunnelCase:function(n){var o=this.series[n];if(this.deepQuery([o,this.option],"calculable")){var m=this._paramsMap[n].location;var q=10;var p={hoverable:false,style:{pointListd:[[m.x-q,m.y-q],[m.x+m.width+q,m.y-q],[m.x+m.width+q,m.y+m.height+q],[m.x-q,m.y+m.height+q]],brushType:"stroke",lineWidth:1,strokeColor:o.calculableHolderColor||this.ecTheme.calculableHolderColor||k.calculableHolderColor}};c.pack(p,o,n,undefined,-1);this.setCalculable(p);p=new i(p);this.shapeList.push(p);return p}},_getLocation:function(q){var o=this.series[q];var p=this.zr.getWidth();var n=this.zr.getHeight();var m=this.parsePercent(o.x,p);var s=this.parsePercent(o.y,n);var r=o.width==null?(p-m-this.parsePercent(o.x2,p)):this.parsePercent(o.width,p);return{x:m,y:s,width:r,height:o.height==null?(n-s-this.parsePercent(o.y2,n)):this.parsePercent(o.height,n),centerX:m+r/2}},_mapData:function(p){var s=this.series[p];var n=f.clone(s.data);for(var q=0,m=n.length;q<m;q++){n[q]._index=q}function r(u,t){if(u.value==="-"){return 1}else{if(t.value==="-"){return -1}}return t.value-u.value}function o(u,t){return -r(u,t)}if(s.sort!="none"){n.sort(s.sort==="descending"?r:o)}return n},_buildItem:function(p,B,m,C,w,v,D,E,u){var r=this.series;var s=r[p];var q=s.data[B];var A=this.getPolygon(p,B,m,C,w,v,D,E,u);c.pack(A,r[p],p,r[p].data[B],B,r[p].data[B].name);this.shapeList.push(A);var z=this.getLabel(p,B,m,C,w,v,D,E,u);c.pack(z,r[p],p,r[p].data[B],B,r[p].data[B].name);this.shapeList.push(z);if(!this._needLabel(s,q,false)){z.invisible=true}var o=this.getLabelLine(p,B,m,C,w,v,D,E,u);this.shapeList.push(o);if(!this._needLabelLine(s,q,false)){o.invisible=true}var t=[];var n=[];if(this._needLabelLine(s,q,true)){t.push(o.id);n.push(o.id)}if(this._needLabel(s,q,true)){t.push(z.id);n.push(A.id)}A.hoverConnect=t;z.hoverConnect=n;return A},_getItemWidth:function(o,r){var q=this.series[o];var n=this._paramsMap[o].location;var p=q.min;var m=q.max;var s=h.parsePercent(q.minSize,n.width);var t=h.parsePercent(q.maxSize,n.width);return(r-p)*(t-s)/(m-p)+s},getPolygon:function(A,C,z,s,q,r,o,u,x){var v=this.series[A];var E=v.data[C];var n=[E,v];var D=this.deepMerge(n,"itemStyle.normal")||{};var w=this.deepMerge(n,"itemStyle.emphasis")||{};var p=this.getItemStyleColor(D.color,A,C,E)||z;var m=this.getItemStyleColor(w.color,A,C,E)||(typeof p==="string"?a.lift(p,-0.2):p);var B;switch(x){case"left":B=s;break;case"right":B=s+(r-o);break;default:B=s+(r-o)/2;break}var t={zlevel:v.zlevel,z:v.z,clickable:this.deepQuery(n,"clickable"),style:{pointList:[[s,q],[s+r,q],[B+o,q+u],[B,q+u]],brushType:"both",color:p,lineWidth:D.borderWidth,strokeColor:D.borderColor},highlightStyle:{color:m,lineWidth:w.borderWidth,strokeColor:w.borderColor}};if(this.deepQuery([E,v,this.option],"calculable")){this.setCalculable(t);t.draggable=true}return new i(t)},getLabel:function(G,I,E,u,s,t,n,A,D){var B=this.series[G];var J=B.data[I];var m=this._paramsMap[G].location;var r=f.merge(f.clone(J.itemStyle)||{},B.itemStyle);var C="normal";var H=r[C].label;var q=H.textStyle||{};var F=r[C].labelLine.length;var v=this.getLabelText(G,I,C);var w=this.getFont(q);var p;var o=E;H.position=H.position||r.normal.label.position;if(H.position==="inner"||H.position==="inside"||H.position==="center"){p=D;o=Math.max(t,n)/2>l.getTextWidth(v,w)?"#fff":a.reverse(E)}else{if(H.position==="left"){p="right"}else{p="left"}}var z={zlevel:B.zlevel,z:B.z+1,style:{x:this._getLabelPoint(H.position,u,m,t,n,F,D),y:s+A/2,color:q.color||o,text:v,textAlign:q.align||p,textBaseline:q.baseline||"middle",textFont:w}};C="emphasis";H=r[C].label||H;q=H.textStyle||q;F=r[C].labelLine.length||F;H.position=H.position||r.normal.label.position;v=this.getLabelText(G,I,C);w=this.getFont(q);o=E;if(H.position==="inner"||H.position==="inside"||H.position==="center"){p=D;o=Math.max(t,n)/2>l.getTextWidth(v,w)?"#fff":a.reverse(E)}else{if(H.position==="left"){p="right"}else{p="left"}}z.highlightStyle={x:this._getLabelPoint(H.position,u,m,t,n,F,D),color:q.color||o,text:v,textAlign:q.align||p,textFont:w,brushType:"fill"};return new g(z)},getLabelText:function(n,q,m){var p=this.series;var r=p[n];var s=r.data[q];var o=this.deepQuery([s,r],"itemStyle."+m+".label.formatter");if(o){if(typeof o==="function"){return o.call(this.myChart,{seriesIndex:n,seriesName:r.name||"",series:r,dataIndex:q,data:s,name:s.name,value:s.value})}else{if(typeof o==="string"){o=o.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{a0}",r.name).replace("{b0}",s.name).replace("{c0}",s.value);return o}}}else{return s.name}},getLabelLine:function(D,F,B,t,q,r,o,v,A){var w=this.series[D];var G=w.data[F];var m=this._paramsMap[D].location;var p=f.merge(f.clone(G.itemStyle)||{},w.itemStyle);var z="normal";var u=p[z].labelLine;var C=p[z].labelLine.length;var n=u.lineStyle||{};var E=p[z].label;E.position=E.position||p.normal.label.position;var s={zlevel:w.zlevel,z:w.z+1,hoverable:false,style:{xStart:this._getLabelLineStartPoint(t,m,r,o,A),yStart:q+v/2,xEnd:this._getLabelPoint(E.position,t,m,r,o,C,A),yEnd:q+v/2,strokeColor:n.color||B,lineType:n.type,lineWidth:n.width}};z="emphasis";u=p[z].labelLine||u;C=p[z].labelLine.length||C;n=u.lineStyle||n;E=p[z].label||E;E.position=E.position;s.highlightStyle={xEnd:this._getLabelPoint(E.position,t,m,r,o,C,A),strokeColor:n.color||B,lineType:n.type,lineWidth:n.width};return new b(s)},_getLabelPoint:function(o,n,p,r,q,m,s){o=(o==="inner"||o==="inside")?"center":o;switch(o){case"center":return s=="center"?(n+r/2):s=="left"?(n+10):(n+r-10);case"left":if(m==="auto"){return p.x-10}else{return s=="center"?(p.centerX-Math.max(r,q)/2-m):s=="right"?(n-(r<q?(q-r):0)-m):(p.x-m)}break;default:if(m==="auto"){return p.x+p.width+10}else{return s=="center"?(p.centerX+Math.max(r,q)/2+m):s=="right"?(p.x+p.width+m):(n+Math.max(r,q)+m)}}},_getLabelLineStartPoint:function(m,n,p,o,q){return q=="center"?n.centerX:p<o?(m+Math.min(p,o)/2):(m+Math.max(p,o)/2)},_needLabel:function(n,o,m){return this.deepQuery([o,n],"itemStyle."+(m?"emphasis":"normal")+".label.show")},_needLabelLine:function(n,o,m){return this.deepQuery([o,n],"itemStyle."+(m?"emphasis":"normal")+".labelLine.show")},refresh:function(m){if(m){this.option=m;this.series=m.series}this.backupShapeList();this._buildShape()}};f.inherits(j,d);e("../chart").define("funnel",j);return j});
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de