=s&&(v[t].len=Math.ceil(Math.random()*400),v[t].highlightStyle.xStart=-400,v[t].highlightStyle.xEnd=-400+v[t].len,v[t].highlightStyle.yStart=Math.ceil(Math.random()*o),v[t].highlightStyle.yEnd=v[t].highlightStyle.yStart),v[t].highlightStyle.xStart+=v[t].animationX,v[t].highlightStyle.xEnd+=v[t].animationX,r(v[t]);r(l),i()},h.timeInterval)}function d(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{n:50,lineWidth:2,brushType:"stroke",color:"random",timeInterval:100}},{overwrite:!1,recursive:!0});var l=a(n.textStyle),c=f(n.backgroundColor),h=n.effectOption,p=h.n,d=h.brushType,v=h.lineWidth,m=[],g;for(var y=0;y=20?-20:1,r(S);for(var e=0;e<20;e++)x[e].highlightStyle.color=e1e-4||Math.abs(e.position[0])>1e-4||Math.abs(e.position[1])>1e-4||Math.abs(e.scale[0]-1)>1e-4||Math.abs(e.scale[1]-1)>1e-4?e.__needTransform=!0:e.__needTransform=!1,e.style=e.style||{},e.style.__rect=null}function h(e){return(e||"")+ ++s}function p(e){var t={shape:"circle",id:e.id||i.newShapeId(),zlevel:0,draggable:!1,clickable:!1,hoverable:!0,position:[0,0],rotation:[0,0,0],scale:[1,1,0,0]};return r.merge(t,e,{overwrite:!0,recursive:!0}),c(t),o[t.id]=t,u[t.zlevel]=u[t.zlevel]||[],u[t.zlevel].push(t),f=Math.max(f,t.zlevel),l[t.zlevel]=!0,i}function d(e){return o[e]}function v(e){if(typeof e!="undefined"){var t={};if(e instanceof Array)for(var n=0,r=e.length;n1e-4||e.position&&(Math.abs(e.position[0])>1e-4||Math.abs(e.position[1])>1e-4)||e.scale&&(Math.abs(e.scale[0]-1)>1e-4||Math.abs(e.scale[1]-1)>1e-4)?e.__needTransform=!0:e.__needTransform=!1,a.push(e),i}function b(){return a=[],i}function w(){return a.length>0}function E(e,t){t||(t={hover:!1,normal:"down"});if(t.hover)for(var n=0,r=a.length;n=0;r--){s=u[r];if(s){f=s.length;while(f--)if(e(s[f]))return i}}break;case"up":for(var n=0,r=u.length;n1)for(var e in arguments)console.log(arguments[e]);return t},t}),define("zrender",["zrender/zrender"],function(e){return e}),define("echarts/util/shape/icon",["require","zrender/tool/matrix","zrender/shape","zrender/shape/base","zrender/shape"],function(e){function n(){this.type="icon",this._iconLibrary={mark:r,markUndo:i,markClear:s,dataZoom:o,dataZoomReset:u,restore:a,lineChart:f,barChart:l,dataView:c,saveAsImage:h,cross:p,circle:d,rectangle:v,triangle:m,diamond:g,star:y}}function r(e,t){var n=t.width/16,r=t.height/16;e.moveTo(t.x,t.y+t.height),e.lineTo(t.x+5*n,t.y+14*r),e.lineTo(t.x+t.width,t.y+3*r),e.lineTo(t.x+13*n,t.y),e.lineTo(t.x+2*n,t.y+11*r),e.lineTo(t.x,t.y+t.height),e.moveTo(t.x+6*n,t.y+10*r),e.lineTo(t.x+14*n,t.y+2*r),e.moveTo(t.x+10*n,t.y+13*r),e.lineTo(t.x+t.width,t.y+13*r),e.moveTo(t.x+13*n,t.y+10*r),e.lineTo(t.x+13*n,t.y+t.height)}function i(e,t){var n=t.width/16,r=t.height/16;e.moveTo(t.x,t.y+t.height),e.lineTo(t.x+5*n,t.y+14*r),e.lineTo(t.x+t.width,t.y+3*r),e.lineTo(t.x+13*n,t.y),e.lineTo(t.x+2*n,t.y+11*r),e.lineTo(t.x,t.y+t.height),e.moveTo(t.x+6*n,t.y+10*r),e.lineTo(t.x+14*n,t.y+2*r),e.moveTo(t.x+10*n,t.y+13*r),e.lineTo(t.x+t.width,t.y+13*r)}function s(e,t){var n=t.width/16,r=t.height/16;e.moveTo(t.x+4*n,t.y+15*r),e.lineTo(t.x+9*n,t.y+13*r),e.lineTo(t.x+14*n,t.y+8*r),e.lineTo(t.x+11*n,t.y+5*r),e.lineTo(t.x+6*n,t.y+10*r),e.lineTo(t.x+4*n,t.y+15*r),e.moveTo(t.x+5*n,t.y),e.lineTo(t.x+11*n,t.y),e.moveTo(t.x+5*n,t.y+r),e.lineTo(t.x+11*n,t.y+r),e.moveTo(t.x,t.y+2*r),e.lineTo(t.x+t.width,t.y+2*r),e.moveTo(t.x,t.y+5*r),e.lineTo(t.x+3*n,t.y+t.height),e.lineTo(t.x+13*n,t.y+t.height),e.lineTo(t.x+t.width,t.y+5*r)}function o(e,t){var n=t.width/16,r=t.height/16;e.moveTo(t.x,t.y+3*r),e.lineTo(t.x+6*n,t.y+3*r),e.moveTo(t.x+3*n,t.y),e.lineTo(t.x+3*n,t.y+6*r),e.moveTo(t.x+3*n,t.y+8*r),e.lineTo(t.x+3*n,t.y+t.height),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x+t.width,t.y+3*r),e.lineTo(t.x+8*n,t.y+3*r),e.moveTo(t.x,t.y),e.lineTo(t.x,t.y)}function u(e,t){var n=t.width/16,r=t.height/16;e.moveTo(t.x+6*n,t.y),e.lineTo(t.x+2*n,t.y+3*r),e.lineTo(t.x+6*n,t.y+6*r),e.moveTo(t.x+2*n,t.y+3*r),e.lineTo(t.x+14*n,t.y+3*r),e.lineTo(t.x+14*n,t.y+11*r),e.moveTo(t.x+2*n,t.y+5*r),e.lineTo(t.x+2*n,t.y+13*r),e.lineTo(t.x+14*n,t.y+13*r),e.moveTo(t.x+10*n,t.y+10*r),e.lineTo(t.x+14*n,t.y+13*r),e.lineTo(t.x+10*n,t.y+t.height),e.moveTo(t.x,t.y),e.lineTo(t.x,t.y)}function a(e,t){var n=t.width/16,r=t.height/16,i=t.width/2;e.lineWidth=1.5,e.arc(t.x+i,t.y+i,i-n,0,Math.PI*2/3),e.moveTo(t.x+3*n,t.y+t.height),e.lineTo(t.x+0*n,t.y+12*r),e.lineTo(t.x+5*n,t.y+11*r),e.moveTo(t.x,t.y+8*r),e.arc(t.x+i,t.y+i,i-n,Math.PI,Math.PI*5/3),e.moveTo(t.x+13*n,t.y),e.lineTo(t.x+t.width,t.y+4*r),e.lineTo(t.x+11*n,t.y+5*r),e.moveTo(t.x,t.y),e.lineTo(t.x,t.y)}function f(e,t){var n=t.width/16,r=t.height/16;e.moveTo(t.x,t.y),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x+t.width,t.y+t.height),e.moveTo(t.x+2*n,t.y+14*r),e.lineTo(t.x+7*n,t.y+6*r),e.lineTo(t.x+11*n,t.y+11*r),e.lineTo(t.x+15*n,t.y+2*r),e.moveTo(t.x,t.y),e.lineTo(t.x,t.y)}function l(e,t){var n=t.width/16,r=t.height/16;e.moveTo(t.x,t.y),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x+t.width,t.y+t.height),e.moveTo(t.x+3*n,t.y+14*r),e.lineTo(t.x+3*n,t.y+6*r),e.lineTo(t.x+4*n,t.y+6*r),e.lineTo(t.x+4*n,t.y+14*r),e.moveTo(t.x+7*n,t.y+14*r),e.lineTo(t.x+7*n,t.y+2*r),e.lineTo(t.x+8*n,t.y+2*r),e.lineTo(t.x+8*n,t.y+14*r),e.moveTo(t.x+11*n,t.y+14*r),e.lineTo(t.x+11*n,t.y+9*r),e.lineTo(t.x+12*n,t.y+9*r),e.lineTo(t.x+12*n,t.y+14*r)}function c(e,t){var n=t.width/16;e.moveTo(t.x+n,t.y),e.lineTo(t.x+n,t.y+t.height),e.lineTo(t.x+15*n,t.y+t.height),e.lineTo(t.x+15*n,t.y),e.lineTo(t.x+n,t.y),e.moveTo(t.x+3*n,t.y+3*n),e.lineTo(t.x+13*n,t.y+3*n),e.moveTo(t.x+3*n,t.y+6*n),e.lineTo(t.x+13*n,t.y+6*n),e.moveTo(t.x+3*n,t.y+9*n),e.lineTo(t.x+13*n,t.y+9*n),e.moveTo(t.x+3*n,t.y+12*n),e.lineTo(t.x+9*n,t.y+12*n)}function h(e,t){var n=t.width/16,r=t.height/16;e.moveTo(t.x,t.y),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x,t.y),e.moveTo(t.x+4*n,t.y),e.lineTo(t.x+4*n,t.y+8*r),e.lineTo(t.x+12*n,t.y+8*r),e.lineTo(t.x+12*n,t.y),e.moveTo(t.x+6*n,t.y+11*r),e.lineTo(t.x+6*n,t.y+13*r),e.lineTo(t.x+10*n,t.y+13*r),e.lineTo(t.x+10*n,t.y+11*r),e.lineTo(t.x+6*n,t.y+11*r),e.moveTo(t.x,t.y),e.lineTo(t.x,t.y)}function p(e,t){var n=t.x,r=t.y,i=t.width,s=t.height;e.moveTo(n,r+s/2),e.lineTo(n+i,r+s/2),e.moveTo(n+i/2,r),e.lineTo(n+i/2,r+s)}function d(e,t){var n=t.width/2,r=t.height/2;e.arc(t.x+n,t.y+r,Math.min(n,r),0,Math.PI*2)}function v(e,t){e.rect(t.x,t.y,t.width,t.height)}function m(e,t){var n=t.width/2,r=t.height/2,i=t.x+n,s=t.y+r,o=Math.min(n,r);e.moveTo(i,s-o),e.lineTo(i+o,s+o),e.lineTo(i-o,s+o),e.lineTo(i,s-o)}function g(e,t){var n=t.width/2,r=t.height/2,i=t.x+n,s=t.y+r,o=Math.min(n,r);e.moveTo(i,s-o),e.lineTo(i+o,s),e.lineTo(i,s+o),e.lineTo(i-o,s),e.lineTo(i,s-o)}function y(t,n){var r=n.width/2,i=n.height/2,s=e("zrender/shape").get("star");s.buildPath(t,{x:n.x+r,y:n.y+i,r:Math.min(r,i),n:n.n||5})}var t=e("zrender/tool/matrix");return n.prototype={buildPath:function(e,t){this._iconLibrary[t.iconType]?this._iconLibrary[t.iconType](e,t):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y));return},getRect:function(e){return{x:Math.round(e.x),y:Math.round(e.y),width:e.width,height:e.height}},isCover:function(e,n,r){if(e.__needTransform&&e._transform){var i=[];t.invert(i,e._transform);var s=[n,r];t.mulVector(s,i,[n,r,1]),n==s[0]&&r==s[1]&&(Math.abs(e.rotation[0])>1e-4||Math.abs(e.position[0])>1e-4||Math.abs(e.position[1])>1e-4||Math.abs(e.scale[0]-1)>1e-4||Math.abs(e.scale[1]-1)>1e-4?e.__needTransform=!0:e.__needTransform=!1),n=s[0],r=s[1]}var o;return e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),o=[o.x,o.x+o.width,o.y,o.y+o.height],e.style.__rect=o),n>=o[0]&&n<=o[1]&&r>=o[2]&&r<=o[3]?!0:!1},define:function(e,t){this._iconLibrary[e]=t},get:function(e){return this._iconLibrary[e]}},e("zrender/shape/base").derive(n),e("zrender/shape").define("icon",new n),n}),define("echarts/chart",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),define("echarts/component/base",["require","../config","zrender/tool/util"],function(e){function t(t){function s(e){e=e||i.type+"";switch(e){case n.COMPONENT_TYPE_GRID:case n.COMPONENT_TYPE_AXIS_CATEGORY:case n.COMPONENT_TYPE_AXIS_VALUE:return 0;case n.CHART_TYPE_LINE:case n.CHART_TYPE_BAR:case n.CHART_TYPE_SCATTER:case n.CHART_TYPE_PIE:case n.CHART_TYPE_RADAR:case n.CHART_TYPE_MAP:case n.CHART_TYPE_K:return 2;case n.COMPONENT_TYPE_LEGEND:case n.COMPONENT_TYPE_DATARANGE:case n.COMPONENT_TYPE_DATAZOOM:return 4;case n.CHART_TYPE_ISLAND:return 5;case n.COMPONENT_TYPE_TOOLBOX:case n.COMPONENT_TYPE_TITLE:return 6;case n.COMPONENT_TYPE_TOOLTIP:return 7;default:return 0}}function o(e){return r.merge(e||{},n[i.type]||{},{overwrite:!1,recursive:!0})}function u(e){if(!(e instanceof Array))return[e,e,e,e];switch(e.length+""){case"4":return e;case"3":return[e[0],e[1],e[2],e[1]];case"2":return[e[0],e[1],e[0],e[1]];case"1":return[e[0],e[0],e[0],e[0]];case"0":return[0,0,0,0]}}function f(e){var t=r.merge(r.clone(e)||{},n.textStyle,{overwrite:!1});return t.fontStyle+" "+t.fontWeight+" "+t.fontSize+"px "+t.fontFamily}function l(){i.zr&&i.zr.delShape(i.shapeList),i.shapeList=[]}function c(){i.clear(),i.shapeList=null,i=null}var n=e("../config"),r=e("zrender/tool/util"),i=this;i.zr=t,i.shapeList=[];var a=function(){function e(e,t){if(typeof e=="undefined")return undefined;if(!t)return e;t=t.split(".");var n=t.length,r=0;while(r0?-1:1,t.style.r-=i,t.style.r=t.style.r<5?5:t.style.r;var s=o.get(t,"value"),a=s*f.island.calculateStep;a>1?s=Math.round(s-a*i):s=(s-a*i).toFixed(2)-0;var l=o.get(t,"name");t.style.text=l+":"+s,o.set(t,"value",s),o.set(t,"name",l),n.modShape(t.id,t),n.refresh(),u.stop(r)},a.render=m,a.resize=y,a.getOption=g,a.add=b,a.del=w,a.ondrop=E,a.ondragend=S}return e("../chart").define("island",t),t}),define("echarts/component",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),define("echarts/component/title",["require","./base","../config","zrender/tool/area","zrender/tool/util","../component"],function(e){function t(t,n,r){function h(){c=v(),d(),p();for(var e=0,t=a.shapeList.length;e3){var o=N(i[1])-N(i[0]),l=!1,c,h;e=0;while(!l&&e3){var o=N(i[0])-N(i[1]);e=1;while(o*e-60?r.position=="bottom"?"right":"left":r.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),f.shapeList.push(e)}else{var g,y;r.position=="left"?(g=l.getX()-s,y="right"):(g=l.getXend()+s,y="left");for(var m=0;m1?e-1:1)}function N(e){var t=r.data,n=t.length,i=T(),s=r.boundaryGap?i:0;for(var o=0;o=r.data.length?r.position=="bottom"||r.position=="top"?l.getXend():l.getY():N(r.data[e])}function k(e){return r.data[e]}function L(e){return e%h===0}function A(){return r.position}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("zrender/tool/util"),a=e("zrender/tool/area"),f=this;f.type=o.COMPONENT_TYPE_AXIS_CATEGORY;var l=i.grid,c=f.getZlevelBase(),h,p;f.init=S,f.refresh=x,f.getGap=T,f.getCoord=N,f.getCoordByIndex=C,f.getNameByIndex=k,f.isMainAxis=L,f.getPosition=A,S(r,l)}return e("../component").define("categoryAxis",t),t}),define("echarts/component/valueAxis",["require","./base","../config","zrender/tool/util","../component"],function(e){function t(t,n,r,i,s){function g(){d=!1,x();if(!d)return;r.splitArea.show&&S(),r.splitLine.show&&E(),r.axisLine.show&&y(),r.axisTick.show&&b(),r.axisLabel.show&&w();for(var e=0,t=f.shapeList.length;e0?r.position=="bottom"?"right":"left":r.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),f.shapeList.push(e)}else{var p,d;r.position=="left"?(p=l.getX()-s,d="right"):(p=l.getXend()+s,d="left");for(var h=0;h=0?typeof t[y][m]!="undefined"?t[y][m]+=n:t[y][m]=n:typeof t[b][m]!="undefined"?t[b][m]+=n:t[b][m]=n}}}for(var l in t){e=t[l];for(var m=0,g=e.length;m=0&&p>=0){e||(h=0);while(p/sh&&(i=Math.ceil((h-p)/t/s)*s)),h=-i*t+p}else{o=p-h;while(o/sp?p:e;var t=p-h,n,i;return r.position=="left"||r.position=="right"?(n=l.getHeight(),i=l.getYend()-(e-h)/t*n):(n=l.getWidth(),i=(e-h)/t*n+l.getX()),e==h||e==p?i:Math.floor(i)}function O(){return r.position}var o=e("./base");o.call(this,n);var u=e("../config"),a=e("zrender/tool/util"),f=this;f.type=u.COMPONENT_TYPE_AXIS_VALUE;var l=i.grid,c=f.getZlevelBase(),h,p,d,v,m;f.init=k,f.refresh=L,f.getExtremum=C,f.getCoord=A,f.getPosition=O,k(r,l,s)}return e("../component").define("valueAxis",t),t}),define("echarts/component/axis",["require","./base","../config","./categoryAxis","./valueAxis","../component"],function(e){function t(t,n,r,i,s){function l(e){!e||e instanceof Array&&e.length===0?e=[{type:u.COMPONENT_TYPE_AXIS_VALUE}]:e instanceof Array||(e=[e]),e.length>2&&(e=[e[0],e[1]]);if(s=="xAxis"){if(!e[0].position||e[0].position!="bottom"&&e[0].position!="top")e[0].position="bottom";e.length>1&&(e[1].position=e[0].position=="bottom"?"top":"bottom");for(var t=0,n=e.length;t1&&(e[1].position=e[0].position=="left"?"right":"left");for(var t=0,n=e.length;t=0&&f.start<=100?f.start:0,m=typeof f.end!="undefined"&&f.end>=0&&f.end<=100?f.end:100;v>m&&(v+=m,m=v-m,v-=m);var g=Math.round((m-v)/100*(f.orient=="horizontal"?h.width:h.height));return{start:v,end:m,start2:0,end2:100,size:g,xAxisIndex:s,yAxisIndex:u,seriesIndex:i}}function S(){y={xAxis:{},yAxis:{},series:{}};var e=r.xAxis,t=p.xAxisIndex;for(var n=0,i=t.length;n=h.x+h.width?e.style.x=h.x+h.width-e.style.width-r:e.style.x+=t:e.style.y+n-r<=h.y?e.style.y=h.y+r:e.style.y+n+e.style.height+r>=h.y+h.height?e.style.y=h.y+h.height-e.style.height-r:e.style.y+=n,e._type=="filler"?A():O(),f.realtime?_():(clearTimeout(g),g=setTimeout(_,200)),!0}function A(){f.orient=="horizontal"?(v.style.x=d.style.x-c,m.style.x=d.style.x+d.style.width,p.start=Math.floor((v.style.x-h.x)/h.width*100),p.end=Math.ceil((m.style.x+c-h.x)/h.width*100)):(v.style.y=d.style.y-c,m.style.y=d.style.y+d.style.height,p.start=Math.floor((v.style.y-h.y)/h.height*100),p.end=Math.ceil((m.style.y+c-h.y)/h.height*100)),n.modShape(v.id,v),n.modShape(m.id,m),n.refresh()}function O(){var e,t;f.orient=="horizontal"?(e=v.style.x,t=m.style.x,d.style.x=Math.min(e,t)+c,d.style.width=Math.abs(e-t)-c,p.start=Math.floor((Math.min(e,t)-h.x)/h.width*100),p.end=Math.ceil((Math.max(e,t)+c-h.x)/h.width*100)):(e=v.style.y,t=m.style.y,d.style.y=Math.min(e,t)+c,d.style.height=Math.abs(e-t)-c,p.start=Math.floor((Math.min(e,t)-h.y)/h.height*100),p.end=Math.ceil((Math.max(e,t)+c-h.y)/h.height*100)),n.modShape(d.id,d),n.refresh()}function M(){if(!f.show)return;f.orient=="horizontal"?(v.style.x=h.x+p.start/100*h.width,m.style.x=h.x+p.end/100*h.width-c,d.style.x=v.style.x+c,d.style.width=m.style.x-v.style.x-c):(v.style.y=h.y+p.start/100*h.height,m.style.y=h.y+p.end/100*h.height-c,d.style.y=v.style.y+c,d.style.height=m.style.y-v.style.y-c),n.modShape(v.id,v),n.modShape(m.id,m),n.modShape(d.id,d),n.refresh()}function _(e){var n,i,s,u,a;for(var l in y){n=y[l];for(var c in n)a=n[c],u=a.length,i=Math.floor(p.start/100*u),s=Math.ceil(p.end/100*u),r[l][c].type!=o.CHART_TYPE_SCATTER?r[l][c].data=a.slice(i,s):r[l][c].data=D(c,a)}(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function D(e,t){var n=[],r=p.scatterMap[e],i,s,o,u,a;f.orient=="horizontal"?(i=r.x.max-r.x.min,s=p.start/100*i+r.x.min,o=p.end/100*i+r.x.min,i=r.y.max-r.y.min,u=p.start2/100*i+r.y.min,a=p.end2/100*i+r.y.min):(i=r.x.max-r.x.min,s=p.start2/100*i+r.x.min,o=p.end2/100*i+r.x.min,i=r.y.max-r.y.min,u=p.start/100*i+r.y.min,a=p.end/100*i+r.y.min);for(var l=0,c=t.length;l=s&&t[l][0]<=o&&t[l][1]>=u&&t[l][1]<=a&&n.push(t[l]);return n}function P(){u.isDragend=!0}function H(e,n){if(!u.isDragend||!e.target)return;_(),n.dragOut=!0,n.dragIn=!0,f.realtime||t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function B(e,t){t.needRefresh=!0;return}function j(e){f.start=p.start=e.start,f.end=p.end=e.end,f.start2=p.start2=e.start2,f.end2=p.end2=e.end2,M(),_(!0);return}function F(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,M(),_(!0),p;var t=i.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height);if(n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.xt.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var r,s=(n.x-t.x)/t.width,o=1-(n.x+n.width-t.x)/t.width,u=1-(n.y+n.height-t.y)/t.height,a=(n.y-t.y)/t.height;return f.orient=="horizontal"?(r=p.end-p.start,p.start+=r*s,p.end-=r*o,r=p.end2-p.start2,p.start2+=r*u,p.end2-=r*a):(r=p.end-p.start,p.start+=r*u,p.end-=r*a,r=p.end2-p.start2,p.start2+=r*s,p.end2-=r*o),f.start=p.start,f.end=p.end,f.start2=p.start2,f.end2=p.end2,M(),_(!0),p}function I(e,t){var n,r=y.series,i=e.series,s;for(var o=0,u=i.length;o=p-d&&(d=0,m+=y+b),s=x(d,m,g,y,v[n]?w:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:d+g+5,y:m,color:v[n]?l.textStyle.color:"#ccc",text:n,textFont:u,textBaseline:"top"},hoverable:l.selectedMode,clickable:l.selectedMode},l.orient=="vertical"&&l.x=="right"&&(o.style.x-=g+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?d+=g+5+a.getTextWidth(n,u)+b:m+=y+b}function w(){var e=l.padding[0],t=l.padding[1],n=l.padding[2],r=l.padding[3];f.shapeList.push({shape:"rectangle",zlevel:c,hoverable:!1,style:{x:h.x-r,y:h.y-e,width:h.width+r+t,height:h.height+e+n,brushType:l.borderWidth===0?"fill":"both",color:l.backgroundColor,strokeColor:l.borderColor,lineWidth:l.borderWidth}})}function E(){var e=l.data,t=e.length,n=l.itemGap,i=l.itemWidth+5,s=l.itemHeight,o=f.getFont(l.textStyle),u=0,c=0;if(l.orient=="horizontal"){for(var h=0;hv&&(u=v,d<0&&(d=0),c+=c+10),{x:d,y:m,width:u,height:c}}function S(e){var t=i.series,n,r;for(var s=0,o=t.length;sm&&(v-=w+5)):(gy&&(g-=h+5))}return{x:v,y:g,width:f,height:l}}function _(e,t,n){return{shape:"text",zlevel:f,style:{x:a.orient=="horizontal"?e:l.x+l.width/2,y:a.orient=="horizontal"?l.y+l.height/2:t,color:a.textStyle.color,text:n,textFont:u.getFont(a.textStyle),textBaseline:a.orient=="horizontal"?"middle":"top",textAlign:a.orient=="horizontal"?"left":"center"}}}function D(e,t,n,r,i){return{shape:"rectangle",zlevel:f,style:{x:e,y:t+1,width:n,height:r-2,color:i},clickable:!0}}function P(e,t,n){var r=c.x,i=c.y,s=c.width,o=c.height;return a.orient=="horizontal"?e.style.x+t<=r?e.style.x=r:e.style.x+t+e.style.width>=r+s?e.style.x=r+s-e.style.width:e.style.x+=t:e.style.y+n<=i?e.style.y=i:e.style.y+n+e.style.height>=i+o?e.style.y=i+o-e.style.height:e.style.y+=n,e._type=="filler"?j():F(e),a.realtime?q():(clearTimeout(y),y=setTimeout(q,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;q(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE),n.needRefresh=!1,u.isDragend=!1;return}function j(){var e=c.x,t=c.y,n=c.width,r=c.height;a.orient=="horizontal"?(h.style.x=m.style.x,p.style.width=h.style.x-e,d.style.x=m.style.x+m.style.width,v.style.x=d.style.x,v.style.width=e+n-d.style.x,g.start=Math.ceil(100-(h.style.x-e)/n*100),g.end=Math.floor(100-(d.style.x-e)/n*100)):(h.style.y=m.style.y,p.style.height=h.style.y-t,d.style.y=m.style.y+m.style.height,v.style.y=d.style.y,v.style.height=t+r-d.style.y,g.start=Math.ceil(100-(h.style.y-t)/r*100),g.end=Math.floor(100-(d.style.y-t)/r*100)),I(!1)}function F(e){var t=c.x,n=c.y,r=c.width,i=c.height,s,o;a.orient=="horizontal"?(s=h.style.x,o=d.style.x,e.id==h.id&&s>=o?(o=s,d.style.x=s):e.id==d.id&&s>=o&&(s=o,h.style.x=s),m.style.x=s,m.style.width=o-s,p.style.width=s-t,v.style.x=o,v.style.width=t+r-o,g.start=Math.ceil(100-(s-t)/r*100),g.end=Math.floor(100-(o-t)/r*100)):(s=h.style.y,o=d.style.y,e.id==h.id&&s>=o?(o=s,d.style.y=s):e.id==d.id&&s>=o&&(s=o,h.style.y=s),m.style.y=s,m.style.height=o-s,p.style.height=s-n,v.style.y=o,v.style.height=n+i-o,g.start=Math.ceil(100-(s-n)/i*100),g.end=Math.floor(100-(o-n)/i*100)),I(!0)}function I(e){h.position=[h.style.x-h.style._x,h.style.y-h.style._y],a.precision===0?h.style.text=Math.round(w*g.start+a.min)+"":h.style.text=(w*g.start+a.min).toFixed(a.precision),h.style.color=W(w*g.start+a.min),n.modShape(h.id,h),d.position=[d.style.x-d.style._x,d.style.y-d.style._y],a.precision===0?d.style.text=Math.round(w*g.end+a.min)+"":d.style.text=(w*g.end+a.min).toFixed(a.precision),d.style.color=W(w*g.end+a.min),n.modShape(d.id,d),n.modShape(p.id,p),n.modShape(v.id,v),e&&n.modShape(m.id,m),n.refresh()}function q(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE)}function R(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function U(t){if(typeof u.deepQuery([t],"dataRange.min")=="undefined"||typeof u.deepQuery([t],"dataRange.max")=="undefined")return;r=t,r.dataRange=u.reformOption(r.dataRange),r.dataRange.padding=u.reformCssArray(r.dataRange.padding),a=r.dataRange,u.clear(),x={};var n=e("zrender/tool/color"),i=a.splitNumber<=0||a.calculable?100:a.splitNumber;E=n.getGradientColors(a.color,(i-a.color.length)/(a.color.length-1)+1),E=E.slice(0,i),a.precision===0?w=Math.round((a.max-a.min)/i)||1:(w=(a.max-a.min)/i,w=w.toFixed(a.precision)-0),S=[];for(var s=0;sa.max&&(e=a.max);if(a.calculable)if(e>w*g.start+a.min||eD&&(e=D-i),t+r>_&&(t=_-r),t<20&&(t=0),E.style.cssText=S+x+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(D-e<100||_-t<100)&&setTimeout(I,20)}function I(){if(E){var e="",t=E.offsetHeight,n=E.offsetWidth;E.offsetLeft+n>D&&(e+="left:"+(D-n)+"px;"),E.offsetTop+t>_&&(e+="top:"+(_-t)+"px;"),e!==""&&(E.style.cssText+=e)}}function q(){var e,t;if(!A)R();else{if(A._type=="island"&&v.deepQuery([r],"tooltip.show")){W();return}var n=u.get(A,"series"),i=u.get(A,"data");e=v.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(N),clearTimeout(k),N=setTimeout(j,C)):(t=v.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?z(n.xAxisIndex,n.yAxisIndex,u.get(A,"dataIndex")):W())}}function R(){var e=r.series,t,n;if(!b||!w){N=setTimeout(j,C);return}for(var i=0,s=e.length;i=r)break;a=t.getCoordByIndex(++n),o=a}return r-sh){a>=i&&(c=a);if(a<=i)break;a=t.getCoordByIndex(++n),f=a}return i-f>c-i?n-=1:typeof t.getNameByIndex(n)=="undefined"&&(n=-1),n}function z(e,t,n){if(typeof b=="undefined"||typeof w=="undefined"||typeof e=="undefined"||typeof t=="undefined"||n<0){clearTimeout(N),clearTimeout(k),N=setTimeout(j,C);return}var s=r.series,u=[],a,f,c,h,p="";if(v.deepQuery([r],"tooltip.trigger")=="axis"){if(v.deepQuery([r],"tooltip.show")===!1)return;h=v.deepQuery([r],"tooltip.formatter")}if(e!=-1&&b.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){a=b.getAxis(e);for(var d=0,m=s.length;d0){var g;if(typeof h=="function"){var S=[];for(var d=0,m=u.length;d"+u[d].name+" : ",g=u[d].data[n],g=g=typeof g!="undefined"?typeof g.value!="undefined"?g.value:g:"-",h+=g;E.innerHTML=h}v.hasAppend||(E.style.left=D/2+"px",E.style.top=_/2+"px",i.firstChild.appendChild(E),v.hasAppend=!0),F(f,c,p)}}function W(){var e=u.get(A,"series"),t=u.get(A,"data"),s=u.get(A,"name"),a=u.get(A,"value"),f=u.get(A,"special"),c,h="",p,d="";A._type!="island"?(v.deepQuery([r],"tooltip.trigger")=="item"&&(c=v.deepQuery([r],"tooltip.formatter")||c),v.deepQuery([e],"tooltip.trigger")=="item"&&(c=v.deepQuery([e],"tooltip.formatter")||c,h+=B(v.deepQuery([e],"tooltip"))),c=v.deepQuery([t],"tooltip.formatter")||c,h+=B(v.deepQuery([t],"tooltip"))):c=v.deepQuery([t,e,r],"tooltip.islandFormatter");if(typeof c=="function")M=e.name+":"+u.get(A,"dataIndex"),E.innerHTML=c([e.name,s,a,f],M,J);else if(typeof c=="string")c=c.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),c=c.replace("{a0}",e.name).replace("{b0}",s).replace("{c0}",a),typeof f!="undefined"&&(c=c.replace("{d0}",f)),E.innerHTML=c;else if(e.type==o.CHART_TYPE_SCATTER)E.innerHTML=e.name+"
"+(s===""?"":s+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR){p=v.deepQuery([e,r],"indicator"),d+=(s===""?e.name:s)+"
";for(var m=0;m";E.innerHTML=d}else E.innerHTML=e.name+"
"+s+" : "+a+(typeof f=="undefined"?"":" ("+f+")");v.hasAppend||(E.style.left=D/2+"px",E.style.top=_/2+"px",i.firstChild.appendChild(E),v.hasAppend=!0),F(l.getX(O)+20,l.getY(O)-20,h),P.invisible||(P.invisible=!0,n.modShape(P.id,P),n.refresh())}function X(e,t,i,s,o,u){if(e.length>0){var a,f,l=r.tooltip.axisPointer,c=l.type,h=l.lineStyle.color,p=l.lineStyle.width,d=l.lineStyle.type,m=l.areaStyle.size,g=l.areaStyle.color;for(var b=0,w=e.length;bD&&(n+="left:"+(D-i)+"px;"),E.offsetTop+r>_&&(n+="top:"+(_-r)+"px;"),n!==""&&(E.style.cssText+=n),(D-E.offsetLeft<100||_-E.offsetTop<100)&&setTimeout(I,20)}function K(e){g=e,y=g.grid,b=g.xAxis,w=g.yAxis}function Q(e,t){r=e,i=t,r.tooltip=v.reformOption(r.tooltip),r.tooltip.textStyle=p.merge(r.tooltip.textStyle,o.textStyle,{overwrite:!1,recursive:!0}),r.tooltip.padding=v.reformCssArray(r.tooltip.padding),T=!1,r.tooltip.trigger=="axis"&&(T=!0);var n=r.series;for(var s=0,u=n.length;s0){m=M(),O(),A();for(var r=0,i=l.shapeList.length;r0?f.dataZoom.absoluteZoom(C[C.length-1]):(f.dataZoom.rectZoom(),z(v.dataZoomReset),n.refresh()),!0}function R(){E=!1,w&&(w=!1,v.mark&&n.modShape(v.mark.id,{style:{strokeColor:v.mark.highlightStyle.strokeColor}}),n.un(o.EVENT.CLICK,j),n.un(o.EVENT.MOUSEMOVE,P))}function U(){T=!1,x&&(x=!1,v.dataZoom&&n.modShape(v.dataZoom.id,{style:{strokeColor:v.dataZoom.highlightStyle.strokeColor}}),n.un(o.EVENT.MOUSEDOWN,H),n.un(o.EVENT.MOUSEUP,B),n.un(o.EVENT.MOUSEMOVE,P))}function z(e){n.modShape(e.id,{hoverable:!1,clickable:!1,style:{strokeColor:y}})}function W(e){n.modShape(e.id,{hoverable:!0,clickable:!0,style:{strokeColor:e.highlightStyle.strokeColor}})}function X(){return k.show(a),!0}function V(){return R(),U(),t.dispatch(s.EVENT.RESTORE),!0}function $(){function o(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null}var e=a.toolbox.feature.saveAsImage,t=e.type||"png";t!="png"&&t!="jpeg"&&(t="png");var r=n.toDataURL("image/"+t),i=document.createElement("div");i.id="__echarts_download_wrap__",i.style.cssText="position:fixed;z-index:99999;display:block;top:0;left:0;background-color:rgba(33,33,33,0.5);text-align:center;width:100%;height:100%;line-height:"+document.documentElement.clientHeight+"px;",i.onclick=o;var s=document.createElement("a");s.href=r,s.setAttribute("download",(e.name?e.name:a.title&&(a.title.text||a.title.subtext)?a.title.text||a.title.subtext:"ECharts")+"."+t),s.innerHTML='
图片另存为")+'"/>',i.appendChild(s),document.body.appendChild(i),s=null,i=null;return}function J(e){R();var n=e.target._name;return n==h?h=!1:h=n,t.dispatch(s.EVENT.MAGIC_TYPE_CHANGED,e.event,{magicType:h}),!0}function K(e){if(e.toolbox&&e.toolbox.show&&e.toolbox.feature.magicType&&e.toolbox.feature.magicType.length>0){var t=e.toolbox.feature.magicType,n=t.length;p={};while(n--)p[t[n]]=!0;n=e.series.length;var r,i;while(n--)r=e.series[n].type,p[r]&&(i=e.xAxis instanceof Array?e.xAxis[e.series[n].xAxisIndex||0]:e.xAxis,i&&i.type=="category"&&(i.__boundaryGap=typeof i.boundaryGap!="undefined"?i.boundaryGap:!0),i=e.yAxis instanceof Array?e.yAxis[e.series[n].yAxisIndex||0]:e.yAxis,i&&i.type=="category"&&(i.__boundaryGap=typeof i.boundaryGap!="undefined"?i.boundaryGap:!0),e.series[n].__type=r)}h=!1;var s=e.dataZoom;if(s&&s.show){var o=typeof s.start!="undefined"&&s.start>=0&&s.start<=100?s.start:0,u=typeof s.end!="undefined"&&s.end>=0&&s.end<=100?s.end:100;o>u&&(o+=u,u=o-u,o-=u),C=[{start:o,end:u,start2:0,end2:100}]}else C=[]}function Q(){if(h){for(var e=0,t=a.series.length;e'+(t[0]||a[0])+"
",l.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(y-15)+"px;"+"height:"+(g-100)+"px;";var n=u.deepQuery([r],"toolbox.feature.dataView.optionToContent");typeof n!="function"?l.value=E():l.value=n(r),f.appendChild(l),h.style.cssText="float:right;padding:1px 6px;",h.innerHTML=t[1]||a[1],h.onclick=b,f.appendChild(h),u.deepQuery([r],"toolbox.feature.dataView.readOnly")===!1?(c.style.cssText="float:right;margin-right:10px;padding:1px 6px;",c.innerHTML=t[2]||a[2],c.onclick=S,f.appendChild(c),l.readOnly=!1,l.style.cursor="default"):(l.readOnly=!0,l.style.cursor="text"),v="width:"+y+"px;"+"height:"+g+"px;"+"background-color:#fff;",f.style.cssText=d+v,i.onselectstart=function(){return!0}}function E(){var e,t,n,i,s,u,a=[],f="";if(r.xAxis){r.xAxis instanceof Array?a=r.xAxis:a=[r.xAxis];for(e=0,i=a.length;e10&&(v="width:"+y+"px;"+"height:"+g+"px;"+"background-color:#fff;",f.style.cssText=d+v,l.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(y-15)+"px;"+"height:"+(g-100)+"px;")}function L(){window.removeEventListener?(f.removeEventListener("click",N),f.removeEventListener("mousewheel",N),f.removeEventListener("mousemove",N),f.removeEventListener("mousedown",N),f.removeEventListener("mouseup",N),f.removeEventListener("touchstart",N),f.removeEventListener("touchmove",N),f.removeEventListener("touchend",N)):(f.detachEvent("onclick",N),f.detachEvent("onmousewheel",N),f.detachEvent("onmousemove",N),f.detachEvent("onmousedown",N),f.detachEvent("onmouseup",N)),c.onclick=null,h.onclick=null,p&&(f.removeChild(l),f.removeChild(c),f.removeChild(h)),l=null,c=null,h=null,i.firstChild.removeChild(f),f=null,u=null}var s=e("./base");s.call(this,n);var o=e("../config"),u=this;u.type=o.COMPONENT_TYPE_DATAVIEW;var a=["Data View","close","refresh"],f=document.createElement("div"),l=document.createElement("textArea"),c=document.createElement("button"),h=document.createElement("button"),p=!1,d="position:absolute;display:block;overflow:hidden;transition:height 0.8s,background-color 1s;;-moz-transition:height 0.8s,background-color 1s;-webkit-transition:height 0.8s,background-color 1s;-o-transition:height 0.8s,background-color 1s;z-index:1;left:0;top:0;",v,m="echarts-dataview",g=n.getHeight(),y=n.getWidth();u.dispose=L,u.resize=k,u.show=w,u.hide=b,C()}return e("../component").define("dataView",t),t}),define("echarts/echarts",["require","./config","zrender","zrender/tool/util","zrender/tool/event","zrender/config","./util/shape/icon","./chart","./chart/island","./component","./component/title","./component/axis","./component/categoryAxis","./component/valueAxis","./component/grid","./component/dataZoom","./component/legend","./component/dataRange","./component/tooltip","./component/toolbox","./component/dataView","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util"],function(e){function n(t,n){function v(){var i=e("zrender");s=i.init(t);var u=e("zrender/tool/util");o=u.clone(n||{}),f=[],l={};var a=e("zrender/tool/event");a.Dispatcher.call(l),l.bind(r.EVENT.LEGEND_SELECTED,N),l.bind(r.EVENT.DATA_ZOOM,C),l.bind(r.EVENT.DATA_RANGE,k),l.bind(r.EVENT.MAGIC_TYPE_CHANGED,L),l.bind(r.EVENT.DATA_VIEW_CHANGED,A),l.bind(r.EVENT.RESTORE,O),l.bind(r.EVENT.REFRESH,M);var c=e("zrender/config");s.on(c.EVENT.CLICK,m),s.on(c.EVENT.MOUSEOVER,g),s.on(c.EVENT.MOUSEWHEEL,y),s.on(c.EVENT.DRAGSTART,b),s.on(c.EVENT.DRAGEND,T),s.on(c.EVENT.DRAGENTER,w),s.on(c.EVENT.DRAGOVER,E),s.on(c.EVENT.DRAGLEAVE,S),s.on(c.EVENT.DROP,x),e("./util/shape/icon");var h=e("./chart");e("./chart/island");var v=h.get("island");p=new v(l,s);var _=e("./component");e("./component/title"),e("./component/axis"),e("./component/categoryAxis"),e("./component/valueAxis"),e("./component/grid"),e("./component/dataZoom"),e("./component/legend"),e("./component/dataRange"),e("./component/tooltip"),e("./component/toolbox"),e("./component/dataView");var D=_.get("toolbox");d=new D(l,s,t)}function m(e){var t=f.length;while(t--)f[t]&&f[t].onclick&&f[t].onclick(e);if(e.target){var n=D(e.target);n&&typeof n.seriesIndex!="undefined"&&l.dispatch(r.EVENT.CLICK,e.event,n)}}function g(e){if(e.target){var t=D(e.target);t&&typeof t.seriesIndex!="undefined"&&l.dispatch(r.EVENT.HOVER,e.event,t)}}function y(e){l.dispatch(r.EVENT.MOUSEWHEEL,e.event,D(e.target))}function b(e){c={dragIn:!1,dragOut:!1,needRefresh:!1};var t=f.length;while(t--)f[t]&&f[t].ondragstart&&f[t].ondragstart(e)}function w(e){var t=f.length;while(t--)f[t]&&f[t].ondragenter&&f[t].ondragenter(e)}function E(e){var t=f.length;while(t--)f[t]&&f[t].ondragover&&f[t].ondragover(e)}function S(e){var t=f.length;while(t--)f[t]&&f[t].ondragleave&&f[t].ondragleave(e)}function x(e){var t=f.length;while(t--)f[t]&&f[t].ondrop&&f[t].ondrop(e,c);p.ondrop(e,c)}function T(e){var t=f.length;while(t--)f[t]&&f[t].ondragend&&f[t].ondragend(e,c);p.ondragend(e,c),c.needRefresh&&(_(p.getOption()),l.dispatch(r.EVENT.DATA_CHANGED,e.event,D(e.target)),l.dispatch(r.EVENT.REFRESH))}function N(e){c.needRefresh=!1;var t=f.length;while(t--)f[t]&&f[t].onlegendSelected&&f[t].onlegendSelected(e,c);h=e.selected,c.needRefresh&&l.dispatch(r.EVENT.REFRESH)}function C(e){c.needRefresh=!1;var t=f.length;while(t--)f[t]&&f[t].ondataZoom&&f[t].ondataZoom(e,c);c.needRefresh&&l.dispatch(r.EVENT.REFRESH)}function k(e){c.needRefresh=!1;var t=f.length;while(t--)f[t]&&f[t].ondataRange&&f[t].ondataRange(e,c);c.needRefresh&&s.refresh()}function L(){var e=d.getMagicOption(),t;if(u.xAxis)if(u.xAxis instanceof Array){t=u.xAxis.length;while(t--)e.xAxis[t].data=u.xAxis[t].data}else e.xAxis.data=u.xAxis.data;if(u.yAxis)if(u.yAxis instanceof Array){t=u.yAxis.length;while(t--)e.yAxis[t].data=u.yAxis[t].data}else e.yAxis.data=u.yAxis.data;t=e.series.length;while(t--)e.series[t].data=u.series[t].data;P(e)}function A(e){_(e.option),l.dispatch(r.EVENT.DATA_CHANGED,null,e),l.dispatch(r.EVENT.REFRESH)}function O(){H()}function M(e){B(e)}function _(e){if(e.dataZoom&&e.dataZoom.show||e.toolbox&&e.toolbox.show&&e.toolbox.feature&&e.toolbox.feature.dataZoom)for(var t=0,n=f.length;t0?s.getColor=function(e){return l.getColor(e,o.color)}:s.getColor=function(e){return l.getColor(e,r.color)},s.getCalculableColor=function(){return o.calculableColor||r.calculableColor},u=f.clone(o),a=f.clone(o),o.legend&&o.legend.selected?h=o.legend.selected:h={},p.clear(),d.reset(o),P(o),i}function I(e,t){return t?(o.series=e,i.setOption(o,t)):i.setOption({series:e}),i}function q(e,t,n,i,s){var o=e instanceof Array?e:[[e,t,n,s]],u;for(var f=0,c=o.length;fa.largeThreshold){l.shapeList.push(w(d,r,o));continue}for(var y=0,E=d.length;y1e-4||Math.abs(e.position[0])>1e-4||Math.abs(e.position[1])>1e-4||Math.abs(e.scale[0]-1)>1e-4||Math.abs(e.scale[1]-1)>1e-4?e.__needTransform=!0:e.__needTransform=!1),n=s[0],r=s[1]}var o;return e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),o=[o.x,o.x+o.width,o.y,o.y+o.height],e.style.__rect=o),n>=o[0]&&n<=o[1]&&r>=o[2]&&r<=o[3]?!0:!1}},e("zrender/shape/base").derive(n),e("zrender/shape").define("candle",new n),n}),define("echarts/chart/k",["require","../component/base","./calculableBase","../config","../util/ecData","../util/shape/candle","../chart"],function(e){function t(t,n,r,i){function h(){f.selectedMap={};var e={top:[],bottom:[]},t;for(var r=0,s=l.length;r0&&p(o,e[o]);for(var r=0,s=f.shapeList.length;rb[2],f.shapeList.push(g(E,b[6],b[7],b[0],b[1],b[2],b[3],b[4],b[5],w?f.deepQuery(v,"itemStyle.normal.color")||i:f.deepQuery(v,"itemStyle.normal.color0")||s,f.deepQuery(v,"itemStyle.normal.lineStyle.width")||t,w?f.deepQuery(v,"itemStyle.normal.lineStyle.color")||n:f.deepQuery(v,"itemStyle.normal.lineStyle.color0")||r,w?f.deepQuery(v,"itemStyle.emphasis.color")||h||i:f.deepQuery(v,"itemStyle.emphasis.color0")||p||s,f.deepQuery(v,"itemStyle.emphasis.lineStyle.width")||o||t,w?f.deepQuery(v,"itemStyle.emphasis.lineStyle.color")||a||n:f.deepQuery(v,"itemStyle.emphasis.lineStyle.color0")||c||r))}}}function g(e,t,n,r,i,s,o,u,f,h,p,d,v,m,g){var y={shape:"candle",zlevel:c,clickable:!0,style:{x:r,y:[s,o,u,f],width:i,color:h,strokeColor:d,lineWidth:p,brushType:"both"},highlightStyle:{color:v,strokeColor:g,lineWidth:m},_serieIndex:e};return a.pack(y,l[e],e,l[e].data[t],t,n),y}function y(e,t){i=t,b(e)}function b(e){e&&(r=e,l=r.series),f.clear(),h()}function w(){var e=f.deepQuery([r],"animationDuration"),t=f.deepQuery([r],"animationEasing"),i,s,o;for(var u=0,a=f.shapeList.length;u=0?e.source=n[i]:u=!1,n[o]>=0?e.target=n[o]:u=!1,u})}function Q(e,t,s){var u=[],a=e.length;for(var f=0;f500)continue;l<5&&(l=5),m.scale(n,n,1/l);var c=1*(o+u)*r/l;m.scale(n,n,c),m.sub(M[i],M[i],n),m.add(M[s],M[s],n)}for(var i=0,h=L.length;is&&(s=a)}var f=s-i,l=r-n;for(var u=0;ur&&(r=t[i]);for(var i=0;i0&&y(l,e[l]);for(var u=0,f=c.shapeList.length;u0&&(y[n]=y[n]||[],y[n].push(b[n]),b[n]=[]);continue}p=f.getCoord(E),E>=0?(d-=v-p,p=d):E<0&&(m+=p-g,p=m),b[n].push([l,p,T,u.getNameByIndex(T),l,v])}}d=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(y[M]=y[M]||[],y[M].push(b[M]),b[M]=[]);S(y,u,"horizontal")}function E(e,t){var n=t[0][0],r=h[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,l,p,d,v,m,g,y={},b={},w,E;for(var T=0,N=e;T0&&(y[n]=y[n]||[],y[n].push(b[n]),b[n]=[]);continue}l=f.getCoord(E),E>=0?(d+=l-v,l=d):E<0&&(m-=g-l,l=m),b[n].push([l,p,T,u.getNameByIndex(T),v,p])}}d=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(y[M]=y[M]||[],y[M].push(b[M]),b[M]=[]);S(y,u,"vertical")}function S(e,t,n){var r,s,o,u,f,v,m,g,y,b,w,E;for(var S=h.length-1;S>=0;S--){y=h[S],w=e[S];if(y.type==a.CHART_TYPE_LINE&&typeof w!="undefined"){r=d[S],s=c.deepQuery([y],"itemStyle.normal.lineStyle.width"),o=c.deepQuery([y],"itemStyle.normal.lineStyle.type"),u=c.deepQuery([y],"itemStyle.normal.lineStyle.color"),f=c.deepQuery([y],"itemStyle.normal.color"),v=c.deepQuery([y],"itemStyle.emphasis.color"),m=typeof c.deepQuery([y],"itemStyle.normal.areaStyle")!="undefined",g=c.deepQuery([y],"itemStyle.normal.areaStyle.color");for(var x=0,N=w.length;x0&&d(h,e[h]);for(var a=0,c=f.shapeList.length;a0?(E=N-x,B==1&&w[n]>E&&(E=w[n]),T-=E,x=T,T-=.5):O<0?(E=x-k,B==1&&w[n]>E&&(E=w[n]),x=C,C+=E,C+=.5):(E=N-x,T-=E,x=T,T-=.5),L=b(n,M,a.getNameByIndex(M),S,x,m[n]||g,E),L._orient="vertical",f.shapeList.push(L)}for(var H=0,B=t[D].length;H0?(E=S-N,B==1&&w[n]>E&&(E=w[n]),S=T,T+=E,T+=.5):O<0?(E=k-S,B==1&&w[n]>E&&(E=w[n]),C-=E,S=C,C-=.5):(E=S-N,S=T,T+=E,T+=.5),L=b(n,M,a.getNameByIndex(M),S,x-(m[n]||g),E,m[n]||g),L._orient="horizontal",f.shapeList.push(L)}for(var H=0,B=t[D].length;H=150&&w<=210?"right":w<=30||w>=330?"left":"center",{shape:"text",zlevel:p+1,hoverable:!1,style:{x:y+S*f.cos(w,!0),y:b-S*f.sin(w,!0),color:g.color||s,text:E(e,t,n,d),textAlign:g.align||T,textBaseline:g.baseline||"middle",textFont:c.getFont(g)},highlightStyle:{brushType:"fill"}};if(m.position=="center")return{shape:"text",zlevel:p+1,hoverable:!1,style:{x:y,y:b,color:g.color||s,text:E(e,t,n,d),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:c.getFont(g)},highlightStyle:{brushType:"fill"}};return}return}function E(e,t,n,r){var i=h[e],s=i.data[t],o=c.deepQuery([s,i],"itemStyle."+r+".label.formatter");if(!o)return s.name;if(typeof o=="function")return o(i.name,s.name,s.value,n);if(typeof o=="string")return o=o.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),o=o.replace("{a0}",i.name).replace("{b0}",s.name).replace("{c0}",s.value).replace("{d0}",n),o}function S(e,t,n,r,i,s){var o=h[e],u=o.data[t];if(T(o,u,s)){var a=s?"emphasis":"normal",c=l.merge(l.clone(u.itemStyle)||{},o.itemStyle,{overwrite:!1,recursive:!0}),d=c[a].labelLine,v=d.lineStyle||{},m=o.center[0],g=o.center[1],y=o.radius[1],b=y+d.length,w=(r+n)/2%360,E=f.cos(w,!0),S=f.sin(w,!0);return{shape:"line",zlevel:p+1,hoverable:!1,style:{xStart:m+y*E,yStart:g-y*S,xEnd:m+b*E,yEnd:g-b*S,strokeColor:v.color||i,lineType:v.type,lineWidth:v.width}}}return}function x(e,t,n){return c.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function T(e,t,n){return c.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function N(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),!e.center||e.center&&!(e.center instanceof Array)?e.center=[Math.round(n.getWidth()/2),Math.round(n.getHeight()/2)]:(typeof e.center[0]=="undefined"&&(e.center[0]=Math.round(n.getWidth()/2)),typeof e.center[1]=="undefined"&&(e.center[1]=Math.round(n.getHeight()/2))),typeof e.radius=="undefined"?e.radius=[0,Math.round(Math.min(n.getWidth(),n.getHeight())/2-50)]:e.radius instanceof Array||(e.radius=[0,e.radius]),e.itemStyle.normal.label.textStyle=t(e.itemStyle.normal.label.textStyle||{},u.textStyle,{overwrite:!1,recursive:!0}),e.itemStyle.emphasis.label.textStyle=t(e.itemStyle.emphasis.label.textStyle||{},u.textStyle,{overwrite:!1,recursive:!0}),e}function C(e,t){i=t,k(e)}function k(e){e&&(r=e,h=r.series),c.clear(),m()}function L(){var e=c.deepQuery([r],"animationDuration"),t=c.deepQuery([r],"animationEasing"),i,s,o,u,f,l;for(var h=0,p=c.shapeList.length;h