From b41e33c2c8bbbc7ecd9b0b56b2df05cc71cdb207 Mon Sep 17 00:00:00 2001 From: kener Date: Wed, 15 Jan 2014 17:08:53 +0800 Subject: [PATCH] 1.3.6 release --- build/echarts-map.js | 58 +- build/echarts-original-map.js | 3427 +++++++++++++++------- build/echarts-original.js | 3267 ++++++++++++++------- build/echarts-plain-map.js | 58 +- build/echarts-plain-original-map.js | 3427 +++++++++++++++------- build/echarts-plain-original.js | 3273 ++++++++++++++------- build/echarts-plain.js | 58 +- build/echarts.js | 58 +- doc/asset/js/bootstrap-transition.js | 4 +- doc/changelog.html | 3 + doc/doc.html | 8 +- doc/example/topic/aqi-china/js/main.js | 2 +- doc/example/www/js/echarts-map.js | 58 +- doc/example/www/js/echarts.js | 58 +- doc/example/www2/js/echarts-plain-map.js | 58 +- doc/example/www2/js/echarts-plain.js | 58 +- index.html | 2 +- package.json | 4 +- src/chart/force.js | 2 +- src/echarts.js | 4 +- test/allchart/all.html | 12 +- test/allchart/all.js | 4 +- 22 files changed, 9204 insertions(+), 4699 deletions(-) diff --git a/build/echarts-map.js b/build/echarts-map.js index bbf4492a2d..5bb4e096dd 100644 --- a/build/echarts-map.js +++ b/build/echarts-map.js @@ -13,32 +13,8 @@ * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ /*! @@ -47,32 +23,8 @@ * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt */ -define("echarts/config",[],function(){var e={CHART_TYPE_LINE:"line",CHART_TYPE_BAR:"bar",CHART_TYPE_SCATTER:"scatter",CHART_TYPE_PIE:"pie",CHART_TYPE_RADAR:"radar",CHART_TYPE_MAP:"map",CHART_TYPE_K:"k",CHART_TYPE_ISLAND:"island",CHART_TYPE_FORCE:"force",CHART_TYPE_CHORD:"chord",COMPONENT_TYPE_TITLE:"title",COMPONENT_TYPE_LEGEND:"legend",COMPONENT_TYPE_DATARANGE:"dataRange",COMPONENT_TYPE_DATAVIEW:"dataView",COMPONENT_TYPE_DATAZOOM:"dataZoom",COMPONENT_TYPE_TOOLBOX:"toolbox",COMPONENT_TYPE_TOOLTIP:"tooltip",COMPONENT_TYPE_GRID:"grid",COMPONENT_TYPE_AXIS:"axis",COMPONENT_TYPE_POLAR:"polar",COMPONENT_TYPE_X_AXIS:"xAxis",COMPONENT_TYPE_Y_AXIS:"yAxis",COMPONENT_TYPE_AXIS_CATEGORY:"categoryAxis",COMPONENT_TYPE_AXIS_VALUE:"valueAxis",color:["#ff7f50","#87cefa","#da70d6","#32cd32","#6495ed","#ff69b4","#ba55d3","#cd5c5c","#ffa500","#40e0d0","#1e90ff","#ff6347","#7b68ee","#00fa9a","#ffd700","#6699FF","#ff6666","#3cb371","#b8860b","#30e0e0"],title:{text:"",subtext:"",x:"left",y:"top",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}},legend:{orient:"horizontal",x:"center",y:"top",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,textStyle:{color:"#333"},selectedMode:!0},dataRange:{orient:"vertical",x:"left",y:"bottom",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,precision:0,splitNumber:5,calculable:!1,realtime:!0,color:["#1e90ff","#f0ffff"],textStyle:{color:"#333"}},toolbox:{show:!1,orient:"horizontal",x:"right",y:"top",color:["#1e90ff","#22bb22","#4b0082","#d2691e"],backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemSize:16,feature:{},showTitle:!0,featureTitle:{mark:"辅助线开关",markUndo:"删除辅助线",markClear:"清空辅助线",dataZoom:"区域缩放",dataZoomReset:"区域缩放后退",dataView:"数据视图",lineChart:"折线图切换",barChart:"柱形图切换",restore:"还原",saveAsImage:"保存为图片"}},tooltip:{show:!0,showContent:!0,trigger:"item",islandFormatter:"{a}
{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{lineStyle:{width:2,type:"solid"}},emphasis:{}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1,position:"outer"},labelLine:{show:!1,length:40,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),define("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),define("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),define("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),define("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),define("zrender/tool/area",["require","../tool/util"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,p;if(typeof t.pointList!="undefined"){var d=t.pointList;if(d.length<2)return;var v=d.length;switch(a){case"start":l=d[0][0],c=d[1][0],h=d[0][1],p=d[1][1];break;case"end":l=d[v-2][0],c=d[v-1][0],h=d[v-2][1],p=d[v-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,p=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function g(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:p,getHighlightZoom:d,drift:v,isCover:m,updateTransform:g},t}),define("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),define("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),define("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),define("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),define("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),define("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function t(){this.type="text"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";if(r.maxWidth)switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y,r.maxWidth);break;case"stroke":e.strokeText(r.text,r.x,r.y,r.maxWidth);break;case"both":e.strokeText(r.text,r.x,r.y,r.maxWidth),e.fillText(r.text,r.x,r.y,r.maxWidth);break;default:e.fillText(r.text,r.x,r.y,r.maxWidth)}else switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y);break;case"stroke":e.strokeText(r.text,r.x,r.y);break;case"both":e.strokeText(r.text,r.x,r.y),e.fillText(r.text,r.x,r.y);break;default:e.fillText(r.text,r.x,r.y)}e.restore();return},getRect:function(t){var n=e("../tool/area"),r=n.getTextWidth(t.text,t.textFont),i=n.getTextWidth("国",t.textFont),s=t.x;t.textAlign=="end"||t.textAlign=="right"?s-=r:t.textAlign=="center"&&(s-=r/2);var o=t.y-i/2;return t.textBaseline=="top"?o+=i/2:t.textBaseline=="bottom"&&(s-=i/2),{x:s,y:o,width:r,height:i}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("text",new t),t}),define("zrender/shape/heart",["require","./base","../shape"],function(e){function t(){this.type="heart"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y),e.bezierCurveTo(t.x+t.a/2,t.y-t.b*2/3,t.x+t.a*2,t.y+t.b/3,t.x,t.y+t.b),e.bezierCurveTo(t.x-t.a*2,t.y+t.b/3,t.x-t.a/2,t.y-t.b*2/3,t.x,t.y);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b/4-t/2),width:e.a*2+t,height:e.b*5/4+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("heart",new t),t}),define("zrender/shape/droplet",["require","./base","../shape"],function(e){function t(){this.type="droplet"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y+t.a),e.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+t.a*3/2,t.y-t.a/3,t.x,t.y-t.b),e.bezierCurveTo(t.x-t.a*3/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.a+e.b+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("droplet",new t),t}),define("zrender/shape/path",["require","./base","../shape"],function(e){function t(){this.type="path"}t.prototype={_parsePathData:function(e){if(!e)return[];var t=e,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];t=t.replace(/ /g," "),t=t.replace(/ /g,","),t=t.replace(/,,/g,",");var r;for(r=0;r0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),define("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),define("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),define("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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","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,arrow:y,star:b,image:w}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=5;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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:case n.CHART_TYPE_CHORD: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 a(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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),define("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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 H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(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||e0&&(n.delShape(B.tipShape),B=!1),e&&n.refresh()}function R(e,t,n){var r=x.offsetHeight,i=x.offsetWidth;e+i>H&&(e=H-i),t+r>P&&(t=P-r),t<20&&(t=0),x.style.cssText=T+N+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(H-e<100||P-t<100)&&setTimeout(U,20)}function U(){if(x){var e="",t=x.offsetHeight,n=x.offsetWidth;x.offsetLeft+n>H&&(e+="left:"+(H-n)+"px;"),x.offsetTop+t>P&&(e+="top:"+(P-t)+"px;"),e!==""&&(x.style.cssText+=e)}}function z(){var e,t;if(!M)X()||W();else{if(M._type=="island"&&r.tooltip.show){K();return}var n=u.get(M,"series"),i=u.get(M,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(k),clearTimeout(A),k=setTimeout(q,L)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?$(n.xAxisIndex,n.yAxisIndex,u.get(M,"dataIndex")):K())}}function W(){if(!w||!E){k=setTimeout(q,L);return}var e=r.series,t,n;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 $(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(k),clearTimeout(A),k=setTimeout(q,L);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var y=0,S=u.length;y0){var T;if(typeof d=="function"){var N=[];for(var y=0,S=a.length;y"+ut(a[y].name||"")+" : ",T=a[y].data[s],T=typeof T!="undefined"?typeof T.value!="undefined"?T.value:T:"-",d+=T;x.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(h,p,g)}}function J(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}for(var f=0,c=n.length;f0){var h,p,d=[],v=r.polar[e].indicator[t].text;for(var f=0,c=s.length;f"+ut(d[0][3])+" : "+d[0][2];for(var f=1,c=d.length;f"+ut(d[f][1])+"
",o+=ut(d[f][3])+" : "+d[f][2];x.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_),l.getY(_),a),!0}}function K(){var e=u.get(M,"series"),t=u.get(M,"data"),s=u.get(M,"name"),a=u.get(M,"value"),f=u.get(M,"special"),c=u.get(M,"special2"),h,p,d="",v,g="";M._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.deepQuery([e],"tooltip.trigger")=="item"&&(p=m.deepQuery([e],"tooltip.showContent")||p,h=m.deepQuery([e],"tooltip.formatter")||h,d+=I(m.deepQuery([e],"tooltip"))),p=m.deepQuery([t],"tooltip.showContent")||p,h=m.deepQuery([t],"tooltip.formatter")||h,d+=I(m.deepQuery([t],"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")D=(e.name||"")+":"+u.get(M,"dataIndex"),x.innerHTML=h([e.name||"",s,a,f,c],D,Z);else if(typeof h=="string")D=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ut(e.name||"")).replace("{b0}",ut(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(M,"special2")||""),x.innerHTML=h;else{D=NaN;if(e.type==o.CHART_TYPE_SCATTER)x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
":"")+(s===""?"":ut(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR){v=f,g+=ut(s===""?e.name||"":s),g+=g===""?"":"
";for(var y=0;y";x.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")x.innerHTML=ut(s)+" ("+a+")";else{var b=ut(s),w=ut(f);x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
":"")+b+" -> "+w+" ("+a+")"+"
"+w+" -> "+b+" ("+c+")"}else x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
":"")+ut(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}j.invisible||(j.invisible=!0,n.modShape(j.id,j),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_)+20,l.getY(_)-20,d)}function Q(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yH&&(n+="left:"+(H-i)+"px;"),x.offsetTop+r>P&&(n+="top:"+(P-r)+"px;"),n!==""&&(x.style.cssText+=n),(H-x.offsetLeft<100||P-x.offsetTop<100)&&setTimeout(U,20)}function et(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function tt(e,t){if(!B||B&&B.dataIndex!=e.dataIndex){B&&B.tipShape.length>0&&n.delShape(B.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x=document.createElement("div"),T="position:absolute;display:block;border-style:solid;white-space:nowrap;",N,C,k,L,A,O,M,_,D,P=n.getHeight(),H=n.getWidth(),B=!1,j={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},F={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(j),n.addShape(F),n.on(a.EVENT.MOUSEMOVE,G),n.on(a.EVENT.GLOBALOUT,Y),m.dispose=ot,m.init=rt,m.refresh=it,m.resize=st,m.setComponent=et,m.ontooltipHover=tt,m.ondragend=nt,rt(r,i)}return e("../component").define("tooltip",t),t}),define("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),define("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wa.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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),define("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Y(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(D[i],D[i],n,-c),v.scaleAndAdd(D[s],D[s],n,c)}for(var i=0,h=O.length;i>1^-(o&1),u=u>>1^-(u&1),o+=r,u+=i,r=o,i=u,n.push([o/1024,u/1024])}return n}var r={world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],r="",i=e[0],s=e[1];for(var o=0,u=n.length;o180?n-360:n,r=90-(r/e.scale.y+e.offset.y),[n,r]}function o(e,t){return n.offset=e.offset,n.scale=e.scale,t instanceof Array?n.makePoint([t[0]*1,t[1]*1]):n.makePoint([t.x*1,t.y*1])}var n={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,r=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxr&&(t.xmin=r),t.xmaxi&&(t.ymin=i),t.ymax10?n[L][g].value=Math.round(n[L][g].value):n[L][g].value=n[L][g].value.toFixed(2)-0;y[L]=y[L]||{},y[L].mapData?P(L,n[L],a[L])(y[L].mapData):x[L.replace(/\|.*/,"")].getGeoJson&&(w[L]=x[L.replace(/\|.*/,"")].specialArea||w[L],x[L.replace(/\|.*/,"")].getGeoJson(P(L,n[L],a[L])))}}function P(e,t,r){return function(i){e.indexOf("|")!=-1&&(i=H(e,i)),y[e].mapData=i,q(e,B(e,i,r),t,r);if(--S<=0){for(var s=0,o=h.shapeList.length;s1&&(r={geometry:{coordinates:r.geometry.coordinates.slice(5,6),type:r.geometry.type},id:r.id,properties:r.properties,type:r.type});break}return{type:"FeatureCollection",features:[r]}}function B(t,n,r){var i=e("../util/projection/normal"),s=[],o=y[t].bbox||i.getBbox(n,w[t]),u;y[t].hasRoam?u=y[t].transform:u=I(o,r);var a=y[t].lastTransform||{scale:{}},f;u.left!=a.left||u.top!=a.top||u.scale.x!=a.scale.x||u.scale.y!=a.scale.y?(f=i.geoJson2Path(n,u,w[t]),a=l.clone(u)):(u=y[t].transform,f=y[t].pathArray),y[t].bbox=o,y[t].transform=u,y[t].lastTransform=a,y[t].pathArray=f;var c=[u.left,u.top];for(var h=0,p=f.length;hv?(d=v*.75,l=h*d):(v=d,d=v*.75,c=p*v);var m={OffsetLeft:a[0],OffsetTop:a[1],scale:{x:d,y:v}},g=o.geoJson2Path(n,m);return F(t,g[0],s)}function F(e,t,n){var r,i=t.properties.name;return N[i]?r=Z(e,N[i]):t.cp&&(r=[t.cp[0],t.cp[1]]),T[i]&&(r[0]+=T[i][0],r[1]+=T[i][1]),{text:R(e,i),path:t.path,position:n,textX:r[0],textY:r[1]}}function I(e,t){var r,i,s,o,u,a,f,l=n.getWidth(),c=n.getHeight(),d=Math.round(Math.min(l,c)*.02);for(var v in t)r=p[v].mapLocation,s=r.x||s,u=r.y||u,a=r.width||a,f=r.height||f;i=h.parsePercent(s,l),i=isNaN(i)?d:i,o=h.parsePercent(u,c),o=isNaN(o)?d:o,typeof a=="undefined"?a=isNaN(s)?l-2*d:l-i-2*d:a=h.parsePercent(a,l),typeof f=="undefined"?f=isNaN(u)?c-2*d:c-o-2*d:f=h.parsePercent(f,c);var m=e.width,g=e.height,y=a/.75/m,b=f/g;y>b?(y=b*.75,a=m*y):(b=y,y=b*.75,f=g*b);if(isNaN(s))switch(s+""){case"center":i=Math.floor((l-a)/2);break;case"right":i=l-a;break;default:}if(isNaN(u))switch(u+""){case"center":o=Math.floor((c-f)/2);break;case"bottom":o=c-f;break;default:}return{left:i,top:o,width:a,height:f,scale:{x:y,y:b}}}function q(e,t,n,r){var s=i.legend,o=i.dataRange,f,c,y,b,w,E=u.map,S,x,T,N,C,k;for(var L=0,A=t.length;L=r&&e<=r+s&&t>=i&&t<=i+o)return u}return}function W(e){var t=e.event,n=c.getX(t),r=c.getY(t),i=c.getDelta(t),s=z(n,r);if(s){var o=y[s].transform,u=o.left,a=o.top,f=o.width,l=o.height;geoAndPos=Y(s,[n-u,r-a]),i>0?(i=1.2,o.scale.x*=i,o.scale.y*=i,o.width=f*i,o.height=l*i):(i=1.2,o.scale.x/=i,o.scale.y/=i,o.width=f/i,o.height=l/i),y[s].hasRoam=!0,y[s].transform=o,geoAndPos=Z(s,geoAndPos),o.left-=geoAndPos[0]-(n-u),o.top-=geoAndPos[1]-(r-a),y[s].transform=o,clearTimeout(E),E=setTimeout(Q,100),c.stop(t)}}function X(e){var t=e.target;if(t&&t.draggable)return;var r=e.event,i=c.getX(r),s=c.getY(r),o=z(i,s);o&&(O=!0,L=i,A=s,_=o,setTimeout(function(){n.on(f.EVENT.MOUSEMOVE,V),n.on(f.EVENT.MOUSEUP,$)},50))}function V(e){if(!O||!h)return;var t=e.event,r=c.getX(t),i=c.getY(t),s=y[_].transform;s.hasRoam=!0,s.left-=L-r,s.top-=A-i,L=r,A=i,y[_].transform=s;var o=[s.left,s.top],u={position:[s.left,s.top]};for(var a=0,f=h.shapeList.length;a0&&b(l,e[l]);for(var u=0,f=c.shapeList.length;u0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}p=f.getCoord(E),E>=0?(v-=m-p,p=v):E<0&&(g+=p-y,p=g),b[n].push([l,p,S,u.getNameByIndex(S),l,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"horizontal")}function S(e,t){var n=t[0][0],r=h[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,l,p,v,m,g,y,b={},w,E;for(var S=0,T=e;S0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}l=f.getCoord(E),E>=0?(v+=l-m,l=v):E<0&&(g-=y-l,l=g),b[n].push([l,p,S,u.getNameByIndex(S),m,p])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"vertical")}function x(e,t,n){var r,s,o,u,a,f,d,m,g,y,b,w;for(var E=h.length-1;E>=0;E--){g=h[E],b=e[E];if(g.type==c.type&&typeof b!="undefined"){r=v[E],s=c.deepQuery([g],"itemStyle.normal.lineStyle.width"),o=c.deepQuery([g],"itemStyle.normal.lineStyle.type"),u=c.deepQuery([g],"itemStyle.normal.lineStyle.color"),a=c.deepQuery([g],"itemStyle.normal.color"),f=c.deepQuery([g],"itemStyle.emphasis.color"),d=typeof c.deepQuery([g],"itemStyle.normal.areaStyle")!="undefined",m=c.deepQuery([g],"itemStyle.normal.areaStyle.color");for(var S=0,x=b.length;S=0;n--){f=c.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(c.shapeList[n]._main){l=c.shapeList[n].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),p=c.shapeList[n]._orient=="horizontal";if(t[f][2]){if(c.shapeList[n].shape=="polygon"){var d=l.length;c.shapeList[n].style.pointList[d-3]=l[d-2],p?c.shapeList[n].style.pointList[d-3][0]=l[d-4][0]:c.shapeList[n].style.pointList[d-3][1]=l[d-4][1],c.shapeList[n].style.pointList[d-2]=l[d-1]}c.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{c.shapeList[n].style.pointList.shift();if(c.shapeList[n].shape=="polygon"){var v=c.shapeList[n].style.pointList.pop();p?v[0]=l[0][0]:v[1]=l[0][1],c.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(c.shapeList[n].id,{style:{pointList:c.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&c.shapeList[n]._dataIndex==h[f].data.length-1){r.delShape(c.shapeList[n].id);continue}if(!t[f][2]&&c.shapeList[n]._dataIndex===0){r.delShape(c.shapeList[n].id);continue}}r.animate(c.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=c.deepQuery([i],"animationDuration"),t=c.deepQuery([i],"animationEasing"),n,s,o,u=0;for(var a=0,f=c.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(E=N-x,B==1&&y[n]>E&&(E=y[n]),T-=E,x=T):O<0?(E=x-k,B==1&&y[n]>E&&(E=y[n]),x=C,C+=E):(E=N-x,T-=E,x=T),L=w(n,M,a.getNameByIndex(M),S,x,m[n]||g,E,"vertical"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H0?(E=S-N,B==1&&y[n]>E&&(E=y[n]),S=T,T+=E):O<0?(E=k-S,B==1&&y[n]>E&&(E=y[n]),C-=E,S=C):(E=S-N,S=T,T+=E),L=w(n,M,a.getNameByIndex(M),S,x-(m[n]||g),E,m[n]||g,"horizontal"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t){i=t,S(e)}function S(e){e&&(r=e,c=r.series),l.clear(),d()}function x(e){var t={};for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function T(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1},labelLine:{show:!1,length:30,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},hoverable:!0,itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},markPoint:{symbol:"pin",symbolSize:10,itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{symbol:["circle","arrow"],symbolSize:[2,4],itemStyle:{normal:{borderWidth:2,label:{show:!1,position:"inside",textStyle:{color:"#333"}},lineStyle:{type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,animationThreshold:2500,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),define("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),define("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),define("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),define("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),define("zrender/tool/area",["require","../tool/util","../shape"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,d;if(typeof t.pointList!="undefined"){var v=t.pointList;if(v.length<2)return;var m=v.length;switch(a){case"start":l=v[0][0],c=v[1][0],h=v[0][1],d=v[1][1];break;case"end":l=v[m-2][0],c=v[m-1][0],h=v[m-2][1],d=v[m-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,d=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function b(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:v,getHighlightZoom:m,drift:g,isCover:y,updateTransform:b},t}),define("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),define("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),define("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),define("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),define("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),define("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function n(){this.type="text"}var t=e("../tool/area");n.prototype={brush:function(e,n,r){var i=n.style||{};r&&(i=this.getHighlightStyle(i,n.highlightStyle||{}));if(typeof i.text=="undefined")return;e.save(),this.setContext(e,i),n.__needTransform&&e.transform.apply(e,this.updateTransform(n)),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var s=(i.text+"").split("\n"),o=t.getTextHeight("国",i.textFont),u=this.getRect(i),a=i.x,f;i.textBaseline=="top"?f=u.y:i.textBaseline=="bottom"?f=u.y+o:f=u.y+o/2;for(var l=0,c=s.length;l0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),define("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),define("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),define("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=this._clips,n=t.length,r=[],i=[];for(var s=0;s=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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){if(e.lenth<1)return;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","zrender/shape","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,arrow:y,star:b,heart:w,droplet:E,pin:S,image:x}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){var r=e("zrender/shape").get("heart");r.buildPath(t,{x:n.x+n.width/2,y:n.y+n.height*.2,a:n.width/2,b:n.height*.8})}function E(t,n){var r=e("zrender/shape").get("droplet");r.buildPath(t,{x:n.x+n.width*.5,y:n.y+n.height*.5,a:n.width*.5,b:n.height*.8})}function S(e,t){var n=t.x,r=t.y-t.height/2*1.5,i=t.width/2,s=t.height/2,o=Math.min(i,s);e.arc(n+i,r+s,o,Math.PI/5*4,Math.PI/5),e.lineTo(n+i,r+s+o*1.5)}function x(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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-(e.iconType=="pin"?e.height/2*1.5:0)),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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=o.height<10?4:0;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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/util/shape/markLine",["require","zrender/tool/matrix","zrender/shape","zrender/shape","zrender/shape/base","zrender/shape"],function(e){function n(){this.type="markLine"}var t=e("zrender/tool/matrix");return n.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildLinePath(e,r),e.stroke(),this.brushSymbol(t,e,r,0),this.brushSymbol(t,e,r,1),typeof r.text!="undefined"&&this.drawText(e,r,t.style),e.restore();return},buildLinePath:function(e,t){var n=t.xStart,r=t.xEnd,i=t.yStart,s=t.yEnd;if(!t.lineType||t.lineType=="solid")e.moveTo(n,i),e.lineTo(r,s);else if(t.lineType=="dashed"||t.lineType=="dotted"){var o=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,n,i,r,s,o)}},brushSymbol:function(n,r,i,s){r.save(),r.beginPath(),r.lineWidth=i.symbolBorder,r.strokeStyle=i.symbolBorderColor,i.iconType=i.symbol[s].replace("empty","").toLowerCase(),i.symbol[s].match("empty")&&(r.fillStyle="rgba(0, 0, 0, 0)");var o=s===0?i.xStart:i.xEnd,u=s===0?i.yStart:i.yEnd,a=typeof i.symbolRotate[s]!="undefined"?i.symbolRotate[s]-0:0,f;a!==0&&(f=t.create(),t.identity(f),(o||u)&&t.translate(f,f,[-o,-u]),t.rotate(f,f,a*Math.PI/180),(o||u)&&t.translate(f,f,[o,u]),r.transform.apply(r,f));if(i.iconType=="arrow"&&a===0)this.buildArrawPath(r,i,s);else{var l=i.symbolSize[s];i.x=o-l,i.y=u-l,i.width=l*2,i.height=l*2,e("zrender/shape").get("icon").buildPath(r,i)}r.closePath(),r.stroke(),r.fill(),r.restore()},buildArrawPath:function(e,t,n){var r=t.symbolSize[n],i=t.xStart,s=t.xEnd,o=t.yStart,u=t.yEnd,a=Math.atan(Math.abs((u-o)/(i-s)));n===0?s>i?u>o&&(a=Math.PI*2-a):u>o?a+=Math.PI:a=Math.PI-a:i>s?o>u&&(a=Math.PI*2-a):o>u?a+=Math.PI:a=Math.PI-a;var f=Math.PI/8,l=n===0?i:s,c=n===0?o:u,h=[[l+r*Math.cos(a-f),c-r*Math.sin(a-f)],[l+r*.6*Math.cos(a),c-r*.6*Math.sin(a)],[l+r*Math.cos(a+f),c-r*Math.sin(a+f)]];e.moveTo(l,c);for(var p=0,d=h.length;p1?o.symbol:[o.symbol[0],o.symbol[0]]:[o.symbol,o.symbol],o.symbolSize=o.symbolSize instanceof Array?o.symbolSize.length>1?o.symbolSize:[o.symbolSize[0],o.symbolSize[0]]:[o.symbolSize,o.symbolSize],o.symbolRotate=o.symbolRotate instanceof Array?o.symbolRotate.length>1?o.symbolRotate:[o.symbolRotate[0],o.symbolRotate[0]]:[o.symbolRotate,o.symbolRotate],o.name=e.name;var a=[],f=o.data,l,c=u.dataRange,h=u.legend,p,d,v,m,g,y=s.zr.getWidth(),b=s.zr.getHeight();for(var w=0,E=f.length;w0?-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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}function k(e){return typeof r.data[e].value!="undefined"?r.data[e].value:r.data[e]}function L(e){var t=r.data,n=t.length;for(var i=0;i0?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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),define("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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);var l;for(var c=0,h=t.length;c=s&&l[0]<=o&&l[1]>=u&&l[1]<=a&&n.push(t[c]);return n}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(t){if(typeof u.query(t,"dataRange.min")=="undefined"||typeof u.query(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||e0&&(n.delShape(j.tipShape),j=!1),e&&n.refresh()}function U(e,t,n){var r=T.offsetHeight,i=T.offsetWidth;e+i>B&&(e=B-i),t+r>H&&(t=H-r),t<20&&(t=0),T.style.cssText=N+C+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(B-e<100||H-t<100)&&setTimeout(z,20)}function z(){if(T){var e="",t=T.offsetHeight,n=T.offsetWidth;T.offsetLeft+n>B&&(e+="left:"+(B-n)+"px;"),T.offsetTop+t>H&&(e+="top:"+(H-t)+"px;"),e!==""&&(T.style.cssText+=e)}}function W(){var e,t;if(!_)V()||X();else{if(_._type=="island"&&r.tooltip.show){Q();return}var n=u.get(_,"series"),i=u.get(_,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(L),clearTimeout(O),L=setTimeout(R,A)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?J(n.xAxisIndex,n.yAxisIndex,u.get(_,"dataIndex")):Q())}}function X(){if(!w||!E){L=setTimeout(R,A);return}var e=r.series,t,n;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 J(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(L),clearTimeout(O),L=setTimeout(R,A);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var S=0,x=u.length;S0){var N;if(typeof d=="function"){var C=[];for(var S=0,x=a.length;S"+ct(a[S].name||"")+" : ",N=a[S].data[s],N=typeof N!="undefined"?typeof N.value!="undefined"?N.value:N:"-",d+=N;T.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(h,p,g)}}function K(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}var f=r.polar[e].indicator[t].text;for(var c=0,h=n.length;c0){var p,d,v=[];for(var c=0,h=s.length;c"+ct(v[0][3])+" : "+v[0][2];for(var c=1,h=v.length;c"+ct(v[c][1])+"
",o+=ct(v[c][3])+" : "+v[c][2];T.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D),l.getY(D),a),!0}}function Q(){var e=u.get(_,"series"),t=u.get(_,"data"),s=u.get(_,"name"),a=u.get(_,"value"),f=u.get(_,"special"),c=u.get(_,"special2"),h,p,d="",v,g="";_._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.query(e,"tooltip.trigger")=="item"&&(p=m.query(e,"tooltip.showContent")||p,h=m.query(e,"tooltip.formatter")||h,d+=q(m.query(e,"tooltip"))),p=m.query(t,"tooltip.showContent")||p,h=m.query(t,"tooltip.formatter")||h,d+=q(m.query(t,"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")P=(e.name||"")+":"+u.get(_,"dataIndex"),T.innerHTML=h([e.name||"",s,a,f,c],P,et);else if(typeof h=="string")P=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ct(e.name||"")).replace("{b0}",ct(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(_,"special2")||""),T.innerHTML=h;else{P=NaN;if(e.type==o.CHART_TYPE_SCATTER)T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
":"")+(s===""?"":ct(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR&&f){v=f,g+=ct(s===""?e.name||"":s),g+=g===""?"":"
";for(var y=0;y";T.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")T.innerHTML=ct(s)+" ("+a+")";else{var b=ct(s),w=ct(f);T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
":"")+b+" -> "+w+" ("+a+")"+"
"+w+" -> "+b+" ("+c+")"}else T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
":"")+ct(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}F.invisible||(F.invisible=!0,n.modShape(F.id,F),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D)+20,l.getY(D)-20,d)}function G(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yB&&(n+="left:"+(B-i)+"px;"),T.offsetTop+r>H&&(n+="top:"+(H-r)+"px;"),n!==""&&(T.style.cssText+=n),(B-T.offsetLeft<100||H-T.offsetTop<100)&&setTimeout(z,20)}function tt(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function nt(e,t){if(!j||j&&j.dataIndex!=e.dataIndex){j&&j.tipShape.length>0&&n.delShape(j.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x={},T=document.createElement("div"),N="position:absolute;display:block;border-style:solid;white-space:nowrap;",C,k,L,A,O,M,_,D,P,H=n.getHeight(),B=n.getWidth(),j=!1,F={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},I={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(F),n.addShape(I),n.on(a.EVENT.MOUSEMOVE,Y),n.on(a.EVENT.GLOBALOUT,Z),m.dispose=lt,m.init=ut,m.refresh=at,m.resize=ft,m.setComponent=tt,m.ontooltipHover=nt,m.ondragend=rt,m.onlegendSelected=it,ut(r,i)}return e("../component").define("tooltip",t),t}),define("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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.query(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.query(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/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),define("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",t),t}),define("echarts/echarts",["require","./config","zrender","zrender/tool/util","zrender/tool/event","zrender/config","./util/shape/icon","./util/shape/markLine","./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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wt.largeThreshold){f.shapeList.push(b(n,f.query(t,"itemStyle.normal.color")||h[s]));continue}for(var o=0,u=n.length;o1e-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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),define("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Z(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(P[i],P[i],n,-c),v.scaleAndAdd(P[s],P[s],n,c)}for(var i=0,h=M.length;i>1^-(o&1),u=u>>1^-(u&1),o+=r,u+=i,r=o,i=u,n.push([o/1024,u/1024])}return n}var r={world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],r="",i=e[0],s=e[1];for(var o=0,u=n.length;o180?n-360:n,r=90-(r/e.scale.y+e.offset.y),[n,r]}function o(e,t){return n.offset=e.offset,n.scale=e.scale,t instanceof Array?n.makePoint([t[0]*1,t[1]*1]):n.makePoint([t.x*1,t.y*1])}var n={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,r=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxr&&(t.xmin=r),t.xmaxi&&(t.ymin=i),t.ymax10?n[A][y].value=Math.round(n[A][y].value):n[A][y].value=n[A][y].value.toFixed(2)-0;b[A]=b[A]||{},b[A].mapData?B(A,n[A],a[A])(b[A].mapData):T[A.replace(/\|.*/,"")].getGeoJson&&(E[A]=T[A.replace(/\|.*/,"")].specialArea||E[A],T[A.replace(/\|.*/,"")].getGeoJson(B(A,n[A],a[A])))}}function B(e,t,i){return function(s){e.indexOf("|")!=-1&&(s=j(e,s)),b[e].mapData=s,U(e,F(e,s,i),t,i),z(e,i);if(--x<=0){for(var o=0,u=h.shapeList.length;o1&&(r={geometry:{coordinates:r.geometry.coordinates.slice(5,6),type:r.geometry.type},id:r.id,properties:r.properties,type:r.type});break}return{type:"FeatureCollection",features:[r]}}function F(t,n,r){var i=e("../util/projection/normal"),s=[],o=b[t].bbox||i.getBbox(n,E[t]),u;b[t].hasRoam?u=b[t].transform:u=R(o,r);var a=b[t].lastTransform||{scale:{}},f;u.left!=a.left||u.top!=a.top||u.scale.x!=a.scale.x||u.scale.y!=a.scale.y?(f=i.geoJson2Path(n,u,E[t]),a=l.clone(u)):(u=b[t].transform,f=b[t].pathArray),b[t].bbox=o,b[t].transform=u,b[t].lastTransform=a,b[t].pathArray=f;var c=[u.left,u.top];for(var h=0,p=f.length;hv?(d=v*.75,l=h*d):(v=d,d=v*.75,c=p*v);var m={OffsetLeft:a[0],OffsetTop:a[1],scale:{x:d,y:v}},g=o.geoJson2Path(n,m);return q(t,g[0],s)}function q(e,t,n){var r,i=t.properties.name;return C[i]?r=it(e,C[i]):t.cp&&(r=[t.cp[0],t.cp[1]]),N[i]&&(r[0]+=N[i][0],r[1]+=N[i][1]),{text:X(e,i),path:t.path,position:n,textX:r[0],textY:r[1]}}function R(e,t){var r,i,s,o,u,a,f,l=n.getWidth(),c=n.getHeight(),d=Math.round(Math.min(l,c)*.02);for(var v in t)r=p[v].mapLocation,s=r.x||s,u=r.y||u,a=r.width||a,f=r.height||f;i=h.parsePercent(s,l),i=isNaN(i)?d:i,o=h.parsePercent(u,c),o=isNaN(o)?d:o,typeof a=="undefined"?a=isNaN(s)?l-2*d:l-i-2*d:a=h.parsePercent(a,l),typeof f=="undefined"?f=isNaN(u)?c-2*d:c-o-2*d:f=h.parsePercent(f,c);var m=e.width,g=e.height,y=a/.75/m,b=f/g;y>b?(y=b*.75,a=m*y):(b=y,y=b*.75,f=g*b);if(isNaN(s))switch(s+""){case"center":i=Math.floor((l-a)/2);break;case"right":i=l-a;break;default:}if(isNaN(u))switch(u+""){case"center":o=Math.floor((c-f)/2);break;case"bottom":o=c-f;break;default:}return{left:i,top:o,width:a,height:f,scale:{x:y,y:b}}}function U(e,t,n,r){var s=i.legend,o=i.dataRange,f,c,b,w,E,S=u.map,x,T,N,C,k,L;for(var A=0,O=t.length;A=r&&e<=r+s&&t>=i&&t<=i+o)return u}return}function J(e){var n=e.event,r=c.getX(n),i=c.getY(n),s=c.getDelta(n),o=$(r,i);if(o){var a=b[o].transform,f=a.left,l=a.top,h=a.width,p=a.height;geoAndPos=nt(o,[r-f,i-l]),s>0?(s=1.2,a.scale.x*=s,a.scale.y*=s,a.width=h*s,a.height=p*s):(s=1.2,a.scale.x/=s,a.scale.y/=s,a.width=h/s,a.height=p/s),b[o].hasRoam=!0,b[o].transform=a,geoAndPos=it(o,geoAndPos),a.left-=geoAndPos[0]-(r-f),a.top-=geoAndPos[1]-(i-l),b[o].transform=a,clearTimeout(S),S=setTimeout(et,100),t.dispatch(u.EVENT.MAP_ROAM,e.event,{type:"scale"}),c.stop(n)}}function K(e){var t=e.target;if(t&&t.draggable)return;var r=e.event,i=c.getX(r),s=c.getY(r),o=$(i,s);o&&(M=!0,A=i,O=s,D=o,setTimeout(function(){n.on(f.EVENT.MOUSEMOVE,Q),n.on(f.EVENT.MOUSEUP,G)},50))}function Q(e){if(!M||!h)return;var r=e.event,i=c.getX(r),s=c.getY(r),o=b[D].transform;o.hasRoam=!0,o.left-=A-i,o.top-=O-s,A=i,O=s,b[D].transform=o;var a=[o.left,o.top],f={position:[o.left,o.top]};for(var l=0,p=h.shapeList.length;l0&&y(h,e[h]);for(var u=0,f=l.shapeList.length;u0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}d=f.getCoord(E),E>=0?(v-=m-d,d=v):E<0&&(g+=d-y,d=g),b[n].push([h,d,x,u.getNameByIndex(x),h,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"horizontal")}function E(e,t){var n=t[0][0],r=c[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,h,d,v,m,g,y,b={},w,E;for(var x=0,N=e;x0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}h=f.getCoord(E),E>=0?(v+=h-m,h=v):E<0&&(g-=y-h,h=g),b[n].push([h,d,x,u.getNameByIndex(x),m,d])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"vertical")}function S(e,t,n){var r,s,o,u,a,p,v,m,g,y,b;for(var w=c.length-1;w>=0;w--){m=c[w],y=e[w];if(m.type==l.type&&typeof y!="undefined"){r=d[w],s=l.query(m,"itemStyle.normal.lineStyle.width"),o=l.query(m,"itemStyle.normal.lineStyle.type"),u=l.query(m,"itemStyle.normal.lineStyle.color"),a=l.query(m,"itemStyle.normal.color"),p=typeof l.query(m,"itemStyle.normal.areaStyle")!="undefined",v=l.query(m,"itemStyle.normal.areaStyle.color");for(var E=0,S=y.length;E=0;n--){f=l.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(l.shapeList[n]._main){h=l.shapeList[n].style.pointList,o=Math.abs(h[0][0]-h[1][0]),a=Math.abs(h[0][1]-h[1][1]),p=l.shapeList[n]._orient=="horizontal";if(t[f][2]){if(l.shapeList[n].shape=="polygon"){var d=h.length;l.shapeList[n].style.pointList[d-3]=h[d-2],p?l.shapeList[n].style.pointList[d-3][0]=h[d-4][0]:l.shapeList[n].style.pointList[d-3][1]=h[d-4][1],l.shapeList[n].style.pointList[d-2]=h[d-1]}l.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{l.shapeList[n].style.pointList.shift();if(l.shapeList[n].shape=="polygon"){var v=l.shapeList[n].style.pointList.pop();p?v[0]=h[0][0]:v[1]=h[0][1],l.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(l.shapeList[n].id,{style:{pointList:l.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&l.shapeList[n]._dataIndex==c[f].data.length-1){r.delShape(l.shapeList[n].id);continue}if(!t[f][2]&&l.shapeList[n]._dataIndex===0){r.delShape(l.shapeList[n].id);continue}}r.animate(l.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=l.query(i,"animationDuration"),t=l.query(i,"animationEasing"),n,s,o,u=0;for(var a=0,f=l.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(x=L-C,I==1&&S[s]>x&&(x=S[s]),k-=x,C=k):D<0?(x=C-O,I==1&&S[s]>x&&(x=S[s]),C=A,A+=x):(x=L-C,k-=x,C=k),M=w(s,P,f.getNameByIndex(P),N,C,g[s]||y,x,"vertical"),T[s]=T[s]||{},T[s][P]=N+(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F0?(x=N-L,I==1&&S[s]>x&&(x=S[s]),N=k,k+=x):D<0?(x=O-N,I==1&&S[s]>x&&(x=S[s]),A-=x,N=A):(x=N-L,N=k,k+=x),M=w(s,P,f.getNameByIndex(P),N,C-(g[s]||y),x,g[s]||y,"horizontal"),T[s]=T[s]||{},T[s][P]=C-(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t,n){for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function C(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r{b} : {c}', // 数据孤岛内容格式器,非标准参数 + islandFormatter: '{a}
{b} : {c}', // 数据孤岛内容格式器 showDelay: 20, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms hideDelay: 100, // 隐藏延迟,单位ms transitionDuration : 0.4, // 动画变换时间,单位s @@ -436,7 +436,7 @@ define('echarts/config',[],function() { label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, @@ -453,7 +453,7 @@ define('echarts/config',[],function() { label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -461,8 +461,8 @@ define('echarts/config',[],function() { } }, //smooth : false, - //symbol: null, // 拐点图形类型,非标准参数 - symbolSize: 2, // 可计算特性参数,空数据拖拽提示图形大小 + //symbol: null, // 拐点图形类型 + symbolSize: 2, // 拐点图形大小 //symbolRotate : null, // 拐点图形旋转控制 showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) }, @@ -493,13 +493,14 @@ define('echarts/config',[],function() { scatter: { xAxisIndex: 0, yAxisIndex: 0, - //symbol: null, // 图形类型,非标准参数 + //symbol: null, // 图形类型 symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 //symbolRotate : null, // 拐点图形旋转控制 large: false, // 大规模散点图 largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 itemStyle: { normal: { + // color: 各异, label: { show: false, // 标签文本格式器,同Tooltip.formatter,不支持回调 @@ -511,7 +512,7 @@ define('echarts/config',[],function() { return c[0] + ' , ' + c[1]; } } - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -528,7 +529,7 @@ define('echarts/config',[],function() { return c[0] + ' , ' + c[1]; } } - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -542,16 +543,22 @@ define('echarts/config',[],function() { itemStyle: { normal: { // color: 各异, + label: { + show: false + }, lineStyle: { width: 2, type: 'solid' } }, emphasis: { + label: { + show: false + } // color: 各异, } }, - //symbol: null, // 拐点图形类型,非标准参数 + //symbol: null, // 拐点图形类型 symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 }, @@ -566,6 +573,7 @@ define('echarts/config',[],function() { // roseType : null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) itemStyle: { normal: { + // color: 各异, label: { show: true, position: 'outer' @@ -584,14 +592,14 @@ define('echarts/config',[],function() { }, emphasis: { label: { - show: false, - position: 'outer' + show: false + // position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, labelLine: { show: false, - length: 40, + length: 30, lineStyle: { // color: 各异, width: 1, @@ -613,6 +621,7 @@ define('echarts/config',[],function() { // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: // 'sum' | 'average' | 'max' | 'min' // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + hoverable: true, // roam : false, // 是否开启缩放及漫游模式 itemStyle: { normal: { @@ -754,6 +763,80 @@ define('echarts/config',[],function() { r: 15, calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% }, + + markPoint : { + symbol: 'pin', // 标注类型 + symbolSize: 10, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + //symbolRotate : null,// 标注旋转控制 + itemStyle: { + normal: { + // color: 各异, + // borderColor: 各异, // 标注边线颜色,优先于color + borderWidth: 2, // 标注边线线宽,单位px,默认为1 + label: { + show: true, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + position: 'inside' // 可选为'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + label: { + show: true + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + // position: 'inside' // 'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } + }, + + markLine : { + // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string + symbol: ['circle', 'arrow'], + // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + symbolSize: [2, 4], + // 标线起始和结束的symbol旋转控制 + //symbolRotate : null, + itemStyle: { + normal: { + // color: 各异, // 标线主色,线色,symbol主色 + // borderColor: 随color, // 标线symbol边框颜色,优先于color + borderWidth: 2, // 标线symbol边框线宽,单位px,默认为2 + label: { + show: false, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom' + position: 'inside', + textStyle: { // 默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + lineStyle: { + // color: 随borderColor, // 主色,线色,优先级高于borderColor和color + // width: 随borderWidth, // 优先于borderWidth + type: 'solid', + shadowColor : 'rgba(0,0,0,0)', //默认透明 + shadowBlur: 5, + shadowOffsetX: 3, + shadowOffsetY: 3 + } + }, + emphasis: { + label: { + show: false + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + // position: 'inside' // 'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle : {} + } + } + }, textStyle: { decoration: 'none', @@ -767,6 +850,7 @@ define('echarts/config',[],function() { // -------全局通用 REFRESH: 'refresh', RESTORE: 'restore', + RESIZE: 'resize', CLICK: 'click', HOVER: 'hover', MOUSEWHEEL: 'mousewheel', @@ -779,6 +863,7 @@ define('echarts/config',[],function() { PIE_SELECTED: 'pieSelected', MAGIC_TYPE_CHANGED: 'magicTypeChanged', DATA_VIEW_CHANGED: 'dataViewChanged', + MAP_ROAM : 'mapRoam', // -------内部通信 TOOLTIP_HOVER: 'tooltipHover' }, @@ -790,6 +875,7 @@ define('echarts/config',[],function() { nameConnector: ' & ', valueConnector: ' : ', animation: true, + animationThreshold: 2500, // 动画元素阀值,产生的图形原素超过2500不出动画 addDataAnimation: true, // 动态数据接口是否开启动画效果 animationDuration: 2000, animationEasing: 'ExponentialOut' //BounceOut @@ -2929,7 +3015,7 @@ define( * getTextWidth:测算单行文本宽度 */ define( - 'zrender/tool/area',['require','../tool/util'],function(require) { + 'zrender/tool/area',['require','../tool/util','../shape'],function(require) { var util = require('../tool/util'); var _ctx; @@ -3341,6 +3427,9 @@ define( * 路径包含判断,依赖多边形判断 */ function _isInsidePath(area, x, y) { + if (!area.pointList) { + require('../shape').get('path').buildPath(_ctx, area); + } var pointList = area.pointList; var insideCatch = false; for (var i = 0, l = pointList.length; i < l; i++) { @@ -3355,7 +3444,7 @@ define( } /** - * 测算单行文本欢度 + * 测算多行文本宽度 * @param {Object} text * @param {Object} textFont */ @@ -3368,16 +3457,49 @@ define( if (textFont) { _ctx.font = textFont; } - var width = _ctx.measureText(text).width; + + text = (text + '').split('\n'); + var width = 0; + for (var i = 0, l = text.length; i < l; i++) { + width = Math.max( + _ctx.measureText(text[i]).width, + width + ); + } _ctx.restore(); return width; } + + /** + * 测算多行文本高度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextHeight(text, textFont) { + if (!_ctx) { + _ctx = util.getContext(); + } + + _ctx.save(); + if (textFont) { + _ctx.font = textFont; + } + + text = (text + '').split('\n'); + //比较粗暴 + var height = (_ctx.measureText('国').width + 2) * text.length; + + _ctx.restore(); + + return height; + } return { isInside : isInside, isOutside : isOutside, - getTextWidth : getTextWidth + getTextWidth : getTextWidth, + getTextHeight : getTextHeight }; } ); @@ -5059,16 +5181,84 @@ define( } if (typeof tx != 'undefined' && typeof ty != 'undefined') { - if (style.textFont) { - ctx.font = style.textFont; - } - ctx.textAlign = style.textAlign || al; - ctx.textBaseline = style.textBaseLine || bl; - - ctx.fillText(style.text, tx, ty); + _fillText( + ctx, + style.text, + tx, ty, + style.textFont, + style.textAlign || al, + style.textBaseline || bl + ); } } + + function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { + if (textFont) { + ctx.font = textFont; + } + ctx.textAlign = textAlign; + ctx.textBaseline = textBaseline; + var rect = _getTextRect( + text, x, y, textFont, textAlign, textBaseline + ); + + text = (text + '').split('\n'); + var lineHeight = area.getTextHeight('国', textFont); + var x = x; + var y; + if (textBaseline == 'top') { + y = rect.y; + } + else if (textBaseline == 'bottom') { + y = rect.y + lineHeight; + } + else { + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + ctx.fillText(text[i], x, y); + y += lineHeight; + } + } + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { + var width = area.getTextWidth(text, textFont); + var lineHeight = area.getTextHeight('国', textFont); + + text = (text + '').split('\n'); + + var textX = x; //默认start == left + if (textAlign == 'end' || textAlign == 'right') { + textX -= width; + } + else if (textAlign == 'center') { + textX -= (width / 2); + } + + var textY; + if (textBaseline == 'top') { + textY = y; + } + else if (textBaseline == 'bottom') { + textY = y - lineHeight * text.length; + } + else { + // middle + textY = y - lineHeight * text.length / 2; + } + return { + x : textX, + y : textY, + width : width, + height : lineHeight * text.length + }; + } + /** * 根据默认样式扩展高亮样式 * @param ctx Canvas 2D上下文 @@ -5109,7 +5299,9 @@ define( // 可自定义覆盖默认值 for (var k in highlightStyle) { - newStyle[k] = highlightStyle[k]; + if (typeof highlightStyle[k] != 'undefined') { + newStyle[k] = highlightStyle[k]; + } } return newStyle; @@ -6747,6 +6939,8 @@ define( */ define( 'zrender/shape/text',['require','../tool/area','./base','../shape'],function(require) { + var area = require('../tool/area'); + function Text() { this.type = 'text'; } @@ -6766,6 +6960,10 @@ define( style, e.highlightStyle || {} ); } + + if (typeof style.text == 'undefined') { + return; + } ctx.save(); this.setContext(ctx, style); @@ -6781,52 +6979,70 @@ define( ctx.textAlign = style.textAlign || 'start'; ctx.textBaseline = style.textBaseline || 'middle'; - if (style.maxWidth) { - switch (style.brushType) { - case 'fill': - ctx.fillText( - style.text, - style.x, style.y, style.maxWidth - ); - break; - case 'stroke': - ctx.strokeText( - style.text, - style.x, style.y, style.maxWidth - ); - break; - case 'both': - ctx.strokeText( - style.text, - style.x, style.y, style.maxWidth - ); - ctx.fillText( - style.text, - style.x, style.y, style.maxWidth - ); - break; - default: - ctx.fillText( - style.text, - style.x, style.y, style.maxWidth - ); - } + var text = (style.text + '').split('\n'); + var lineHeight = area.getTextHeight('国', style.textFont); + var rect = this.getRect(style); + var x = style.x; + var y; + if (style.textBaseline == 'top') { + y = rect.y; } - else{ - switch (style.brushType) { - case 'fill': - ctx.fillText(style.text, style.x, style.y); - break; - case 'stroke': - ctx.strokeText(style.text, style.x, style.y); - break; - case 'both': - ctx.strokeText(style.text, style.x, style.y); - ctx.fillText(style.text, style.x, style.y); - break; - default: - ctx.fillText(style.text, style.x, style.y); + else if (style.textBaseline == 'bottom') { + y = rect.y + lineHeight; + } + else { + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + if (style.maxWidth) { + switch (style.brushType) { + case 'fill': + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + break; + case 'stroke': + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + break; + case 'both': + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + break; + default: + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + } } + else{ + switch (style.brushType) { + case 'fill': + ctx.fillText(text[i], x, y); + break; + case 'stroke': + ctx.strokeText(text[i], x, y); + break; + case 'both': + ctx.strokeText(text[i], x, y); + ctx.fillText(text[i], x, y); + break; + default: + ctx.fillText(text[i], x, y); + } + } + y += lineHeight; } ctx.restore(); @@ -6838,10 +7054,10 @@ define( * @param {Object} style */ getRect : function(style) { - var area = require('../tool/area'); - - var width = area.getTextWidth(style.text, style.textFont); - var height = area.getTextWidth('国', style.textFont); //比较粗暴 + var width = area.getTextWidth(style.text, style.textFont); + var lineHeight = area.getTextHeight('国', style.textFont); + + var text = (style.text + '').split('\n'); var textX = style.x; //默认start == left if (style.textAlign == 'end' || style.textAlign == 'right') { @@ -6851,19 +7067,23 @@ define( textX -= (width / 2); } - var textY = style.y - height / 2; //默认middle + var textY; if (style.textBaseline == 'top') { - textY += height / 2; + textY = style.y; } else if (style.textBaseline == 'bottom') { - textX -= height / 2; + textY = style.y - lineHeight * text.length; + } + else { + // middle + textY = style.y - lineHeight * text.length / 2; } return { x : textX, y : textY, width : width, - height : height + height : lineHeight * text.length }; } }; @@ -7240,14 +7460,19 @@ define('zrender/shape/path',['require','./base','../shape'],function(require) { 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' ]; + + cs = cs.replace(/-/g, ' -'); cs = cs.replace(/ /g, ' '); cs = cs.replace(/ /g, ','); cs = cs.replace(/,,/g, ','); + + var n; // create pipes so that we can split the data for (n = 0; n < cc.length; n++) { cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); } + // create array var arr = cs.split('|'); var ca = []; @@ -8741,7 +8966,7 @@ define( var Clip = require('./clip'); -var requrestAnimationFrame = window.requrestAnimationFrame +var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame @@ -8778,7 +9003,7 @@ Animation.prototype = { update : function() { var time = new Date().getTime(); - var delta = time - this._time; + //var delta = time - this._time; var clips = this._clips; var len = clips.length; @@ -8830,11 +9055,11 @@ Animation.prototype = { function step() { if (self._running) { self.update(); - requrestAnimationFrame(step); + requestAnimationFrame(step); } } - requrestAnimationFrame(step); + requestAnimationFrame(step); }, stop : function() { this._running = false; @@ -10134,32 +10359,8 @@ define( * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ /** @@ -10191,7 +10392,7 @@ define( var _idx = 0; //ZRender instance's id var _instances = {}; //ZRender实例map索引 - self.version = '1.0.7'; + self.version = '1.0.8'; /** * zrender初始化 @@ -10758,6 +10959,9 @@ define( } else { // 批量删除 + if (shapeId.lenth < 1) { // 空数组 + return; + } for (var i = 0, l = shapeId.length; i < l; i++) { delMap[shapeId[i].id] = true; } @@ -11596,6 +11800,7 @@ define( var _isMouseDown = false; var _isDragging = false; var _lastTouchMoment; + var _lastDownButton; var _lastX = 0; var _lastY = 0; @@ -11699,7 +11904,6 @@ define( //if (_mouseX - _lastX > 1 || _mouseY - _lastY > 1) { _dragStartHandler(); //} - _hasfound = false; storage.iterShape(_findHover, { normal: 'down'}); @@ -11802,11 +12006,18 @@ define( * @param {event} event dom事件对象 */ function _mouseDownHandler(event) { + if (_lastDownButton == 2) { + _lastDownButton = event.button; + _mouseDownTarget = null; + // 仅作为关闭右键菜单使用 + return; + } _event = _zrenderEventFixed(event); _isMouseDown = true; //分发config.EVENT.MOUSEDOWN事件 _mouseDownTarget = _lastHover; _dispatchAgency(_lastHover, config.EVENT.MOUSEDOWN); + _lastDownButton = event.button; } /** @@ -11862,7 +12073,7 @@ define( if (new Date() - _lastTouchMoment < config.EVENT.touchClickDelay ) { - _mobildFindFixed() + _mobildFindFixed(); _clickHandler(_event); } painter.clearHover(); @@ -12323,7 +12534,7 @@ define('zrender', ['zrender/zrender'], function (main) { return main; }); } */ define( - 'echarts/util/shape/icon',['require','zrender/tool/matrix','zrender/shape','zrender/shape','zrender/shape/base','zrender/shape'],function(require) { + 'echarts/util/shape/icon',['require','zrender/tool/matrix','zrender/shape','zrender/shape','zrender/shape','zrender/shape','zrender/shape/base','zrender/shape'],function(require) { var matrix = require('zrender/tool/matrix'); function Icon() { @@ -12347,6 +12558,9 @@ define( diamond : _iconDiamond, arrow : _iconArrow, star : _iconStar, + heart : _iconHeart, + droplet : _iconDroplet, + pin : _iconPin, image : _iconImage }; } @@ -12640,6 +12854,42 @@ define( }); } + function _iconHeart(ctx, style) { + var heart = require('zrender/shape').get('heart'); + heart.buildPath(ctx, { + x : style.x + style.width / 2, + y : style.y + style.height * 0.2, + a : style.width / 2, + b : style.height * 0.8 + }); + } + + function _iconDroplet(ctx, style) { + var droplet = require('zrender/shape').get('droplet'); + droplet.buildPath(ctx, { + x : style.x + style.width * 0.5, + y : style.y + style.height * 0.5, + a : style.width * 0.5, + b : style.height * 0.8 + }); + } + + function _iconPin(ctx, style) { + var x = style.x; + var y = style.y - style.height / 2 * 1.5; + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.arc( + x + width, + y + height, + r, + Math.PI / 5 * 4, + Math.PI / 5 + ); + ctx.lineTo(x + width, y + height + r * 1.5); + } + function _iconImage(ctx, style) { setTimeout(function(){ require('zrender/shape').get('image').brush(ctx, { @@ -12674,9 +12924,12 @@ define( * @param {Object} style */ getRect : function(style) { + // pin比较特殊,让尖端在目标x,y上 return { x : Math.round(style.x), - y : Math.round(style.y), + y : Math.round(style.y - (style.iconType == 'pin' + ? (style.height / 2 * 1.5) : 0) + ), width : style.width, height : style.height }; @@ -12719,8 +12972,8 @@ define( rect = this.getRect(e.style); e.style.__rect = rect; } - // 提高交互体验,包围盒四向扩大5px - var delta = 5; + // 提高交互体验,太小的图形包围盒四向扩大4px + var delta = rect.height < 10 ? 4 : 0; if (x >= rect.x - delta && x <= (rect.x + rect.width + 2 * delta) && y >= rect.y - delta @@ -12749,6 +13002,263 @@ define( return Icon; } ); +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:标线 + */ +define( + 'echarts/util/shape/markLine',['require','zrender/tool/matrix','zrender/shape','zrender/shape','zrender/shape/base','zrender/shape'],function(require) { + var matrix = require('zrender/tool/matrix'); + + function MarkLine() { + this.type = 'markLine'; + } + + MarkLine.prototype = { + /** + * 画刷 + * @param ctx 画布句柄 + * @param e 形状实体 + * @param isHighlight 是否为高亮状态 + * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + brush : function(ctx, e, isHighlight) { + var style = e.style || {}; + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + e.highlightStyle || {} + ); + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + if (e.__needTransform) { + ctx.transform.apply(ctx,this.updateTransform(e)); + } + + ctx.beginPath(); + this.buildLinePath(ctx, style); + ctx.stroke(); + + this.brushSymbol(e, ctx, style, 0); + this.brushSymbol(e, ctx, style, 1); + + if (typeof style.text != 'undefined') { + this.drawText(ctx, style, e.style); + } + + ctx.restore(); + + return; + }, + + /** + * 创建线条路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildLinePath : function(ctx, style) { + //var symbolSize = style.symbolSize; + var xStart = style.xStart; + var xEnd = style.xEnd; + var yStart = style.yStart; + var yEnd = style.yEnd; + /* + if (xStart > xEnd) { + xStart -= symbolSize[0]; + xEnd += symbolSize[1]; + } + else { + xStart += symbolSize[0]; + xEnd -= symbolSize[1]; + } + if (yStart > yEnd) { + yStart -= symbolSize[0]; + yEnd += symbolSize[1]; + } + else { + yStart += symbolSize[0]; + yEnd -= symbolSize[1]; + } + */ + if (!style.lineType || style.lineType == 'solid') { + //默认为实线 + ctx.moveTo(xStart, yStart); + ctx.lineTo(xEnd, yEnd); + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength =(style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + this.dashedLineTo( + ctx, + xStart, yStart, + xEnd, yEnd, + dashLength + ); + } + }, + + /** + * 标线始末标注 + */ + brushSymbol : function(e, ctx, style, idx) { + ctx.save(); + ctx.beginPath(); + + ctx.lineWidth = style.symbolBorder; + ctx.strokeStyle = style.symbolBorderColor; + // symbol + style.iconType = style.symbol[idx].replace('empty', '') + .toLowerCase(); + if (style.symbol[idx].match('empty')) { + ctx.fillStyle = 'rgba(0, 0, 0, 0)'; + } + + // symbolRotate + var x = idx === 0 ? style.xStart : style.xEnd; + var y = idx === 0 ? style.yStart : style.yEnd; + var rotate = typeof style.symbolRotate[idx] != 'undefined' + ? (style.symbolRotate[idx] - 0) : 0; + var transform; + if (rotate !== 0) { + transform = matrix.create(); + matrix.identity(transform); + if (x || y ) { + matrix.translate(transform, transform, [-x, -y]); + } + matrix.rotate( + transform, transform, + rotate * Math.PI / 180 + ); + if (x || y ) { + matrix.translate(transform, transform, [x, y]); + } + ctx.transform.apply(ctx, transform); + } + + if (style.iconType == 'arrow' && rotate === 0) { + // 箭头自动旋转,手动画 + this.buildArrawPath(ctx, style, idx); + } + else { + // symbolSize + var symbolSize = style.symbolSize[idx]; + style.x = x - symbolSize; + style.y = y - symbolSize, + style.width = symbolSize * 2; + style.height = symbolSize * 2; + require('zrender/shape').get('icon').buildPath(ctx, style); + } + + ctx.closePath(); + ctx.stroke(); + ctx.fill(); + ctx.restore(); + }, + + buildArrawPath : function (ctx, style, idx) { + var symbolSize = style.symbolSize[idx]; + var xStart = style.xStart; + var xEnd = style.xEnd; + var yStart = style.yStart; + var yEnd = style.yEnd; + // 原谅我吧,这三角函数实在没想明白,只能这么笨了 + var rotate = Math.atan( + Math.abs((yEnd - yStart) / (xStart - xEnd) + )); + if (idx === 0) { + if (xEnd > xStart) { + if (yEnd > yStart) { + rotate = Math.PI * 2 - rotate; + } + } + else { + if (yEnd > yStart) { + rotate += Math.PI; + } + else { + rotate = Math.PI - rotate; + } + } + } + else { + if (xStart > xEnd) { + if (yStart > yEnd) { + rotate = Math.PI * 2 - rotate; + } + } + else { + if (yStart > yEnd) { + rotate += Math.PI; + } + else { + rotate = Math.PI - rotate; + } + } + } + + var halfRotate = Math.PI / 8; // 夹角 + var x = idx === 0 ? xStart : xEnd; + var y = idx === 0 ? yStart : yEnd; + var point= [ + [ + x + symbolSize * Math.cos(rotate - halfRotate), + y - symbolSize * Math.sin(rotate - halfRotate), + ], + [ + x + symbolSize * 0.6 * Math.cos(rotate), + y - symbolSize * 0.6 * Math.sin(rotate), + ], + [ + x + symbolSize * Math.cos(rotate + halfRotate), + y - symbolSize * Math.sin(rotate + halfRotate), + ] + ]; + ctx.moveTo(x, y); + for (var i = 0, l = point.length; i 1 + ? mlOption.symbol + : [mlOption.symbol[0], mlOption.symbol[0]] + : [mlOption.symbol, mlOption.symbol]; + mlOption.symbolSize = mlOption.symbolSize instanceof Array + ? mlOption.symbolSize.length > 1 + ? mlOption.symbolSize + : [mlOption.symbolSize[0], mlOption.symbolSize[0]] + : [mlOption.symbolSize, mlOption.symbolSize]; + mlOption.symbolRotate = mlOption.symbolRotate instanceof Array + ? mlOption.symbolRotate.length > 1 + ? mlOption.symbolRotate + : [mlOption.symbolRotate[0], mlOption.symbolRotate[0]] + : [mlOption.symbolRotate, mlOption.symbolRotate]; + + mlOption.name = serie.name; + + var pList = []; + var data = mlOption.data; + var itemShape; + + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget; + var nColor; + var eColor; + var zrWidth = self.zr.getWidth(); + var zrHeight = self.zr.getHeight(); + for (var i = 0, l = data.length; i < l; i++) { + // 图例 + if (legend) { + color = legend.getColor(serie.name); + } + // 值域 + if (dataRange) { + value = typeof data[i][0] != 'undefined' + ? (typeof data[i][0].value != 'undefined' + ? data[i][0].value + : data[i][0]) + : '-'; + color = isNaN(value) ? color : dataRange.getColor(value); + + queryTarget = [data[i][0], mlOption]; + nColor = self.deepQuery( + queryTarget, 'itemStyle.normal.color' + ) || color; + eColor = self.deepQuery( + queryTarget, 'itemStyle.emphasis.color' + ) || nColor; + // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark + if (nColor == null && eColor == null) { + continue; + } + } + + // 标准化一些参数 + data[i][0].tooltip = {trigger:'item'}; // tooltip.trigger指定为item + data[i][0].name = typeof data[i][0].name != 'undefined' + ? data[i][0].name : ''; + data[i][1].name = typeof data[i][1].name != 'undefined' + ? data[i][1].name : ''; + data[i][0].value = typeof data[i][0].value != 'undefined' + ? data[i][0].value : ''; + + // 复用getSymbolShape + itemShape = getLineMarkShape( + mlOption, // markLine + data[i], // 数据 + parsePercent(data[i][0].x, zrWidth), // 坐标 + parsePercent(data[i][0].y, zrHeight), // 坐标 + parsePercent(data[i][1].x, zrWidth), // 坐标 + parsePercent(data[i][1].y, zrHeight), // 坐标 + color // 默认symbol和color + ); + + // 重新pack一下数据 + ecData.pack( + itemShape, + serie, seriesIndex, + data[i][0], 0, + data[i][0].name + ' : ' + data[i][1].name + ); + pList.push(itemShape); + } + //console.log(pList); + return pList; + } + + function getMarkCoord() { + // 无转换位置 + return [0, 0]; + } + + function getSymbolShape( + serie, seriesIndex, // 系列 + data, dataIndex, name, // 数据 + x, y, // 坐标 + symbol, color, // 默认symbol和color,来自legend或dataRange全局分配 + emptyColor, // 折线的emptySymbol用白色填充 + orient // 走向,用于默认文字定位 + ) { + var queryTarget = [data, serie]; + var value = typeof data != 'undefined' + ? (typeof data.value != 'undefined' + ? data.value + : data) + : '-'; + + symbol = self.deepQuery(queryTarget, 'symbol') || symbol; + var symbolSize = self.deepQuery(queryTarget, 'symbolSize'); + symbolSize = typeof symbolSize == 'function' + ? symbolSize(value) + : symbolSize; + var symbolRotate = self.deepQuery(queryTarget, 'symbolRotate'); + + var normal = self.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + var emphasis = self.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + var nBorderWidth = typeof normal.borderWidth != 'undefined' + ? normal.borderWidth + : (normal.lineStyle && normal.lineStyle.width * 2); + if (typeof nBorderWidth == 'undefined') { + nBorderWidth = 0; + } + var eBorderWidth = typeof emphasis.borderWidth != 'undefined' + ? emphasis.borderWidth + : (emphasis.lineStyle && emphasis.lineStyle.width * 2); + if (typeof eBorderWidth == 'undefined') { + eBorderWidth = nBorderWidth + 2; + } + + var itemShape = { + shape : 'icon', + style : { + iconType : symbol.replace('empty', '').toLowerCase(), + x : x - symbolSize, + y : y - symbolSize, + width : symbolSize * 2, + height : symbolSize * 2, + brushType : 'both', + color : symbol.match('empty') + ? emptyColor + : (normal.color || color), + strokeColor : normal.borderColor || normal.color || color, + lineWidth: nBorderWidth + }, + highlightStyle : { + color : symbol.match('empty') + ? emptyColor + : (emphasis.color|| normal.color || color), + strokeColor : emphasis.borderColor || normal.borderColor + || emphasis.color || normal.color || color, + lineWidth: eBorderWidth + }, + clickable : true + }; + + if (symbol.match('image')) { + itemShape.style.image = + symbol.replace(new RegExp('^image:\\/\\/'), ''); + itemShape.shape = 'image'; + } + + if (typeof symbolRotate != 'undefined') { + itemShape.rotation = [ + symbolRotate * Math.PI / 180, x, y + ]; + } + + if (symbol.match('star')) { + itemShape.style.iconType = 'star'; + itemShape.style.n = + (symbol.replace('empty', '').replace('star','') - 0) || 5; + } + + if (symbol == 'none') { + itemShape.invisible = true; + itemShape.hoverable = false; + } + + /* + if (self.deepQuery([data, serie, option], 'calculable')) { + self.setCalculable(itemShape); + itemShape.draggable = true; + } + */ + + itemShape = self.addLabel( + itemShape, + serie, data, name, + orient + ); + + if (symbol.match('empty')) { + if (typeof itemShape.style.textColor == 'undefined') { + itemShape.style.textColor = itemShape.style.strokeColor; + } + if (typeof itemShape.highlightStyle.textColor == 'undefined') { + itemShape.highlightStyle.textColor = + itemShape.highlightStyle.strokeColor; + } + } + + ecData.pack( + itemShape, + serie, seriesIndex, + data, dataIndex, + name + ); + + itemShape._mark = 'point'; // 复用animationMark + itemShape._x = x; + itemShape._y = y; + + itemShape._dataIndex = dataIndex; + itemShape._seriesIndex = seriesIndex; + + return itemShape; + } + + function getLineMarkShape( + mlOption, // 系列 + data, // 数据 + xStart, yStart, // 坐标 + xEnd, yEnd, // 坐标 + color // 默认color,来自legend或dataRange全局分配 + ) { + var value0 = typeof data[0] != 'undefined' + ? (typeof data[0].value != 'undefined' + ? data[0].value + : data[0]) + : '-'; + var value1 = typeof data[1] != 'undefined' + ? (typeof data[1].value != 'undefined' + ? data[1].value + : data[1]) + : '-'; + var symbol = [ + self.query(data[0], 'symbol') || mlOption.symbol[0], + self.query(data[1], 'symbol') || mlOption.symbol[1] + ]; + var symbolSize = [ + self.query(data[0], 'symbolSize') || mlOption.symbolSize[0], + self.query(data[1], 'symbolSize') || mlOption.symbolSize[1] + ]; + symbolSize[0] = typeof symbolSize[0] == 'function' + ? symbolSize[0](value0) + : symbolSize[0]; + symbolSize[1] = typeof symbolSize[1] == 'function' + ? symbolSize[1](value1) + : symbolSize[1]; + var symbolRotate = [ + self.query(data[0], 'symbolRotate') || mlOption.symbolRotate[0], + self.query(data[1], 'symbolRotate') || mlOption.symbolRotate[1] + ]; + //console.log(symbol, symbolSize, symbolRotate); + + var queryTarget = [data[0], mlOption]; + var normal = self.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + var emphasis = self.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + + var nlineStyle = normal.lineStyle; + var elineStyle = emphasis.lineStyle; + + var nBorderWidth = nlineStyle.width; + if (typeof nBorderWidth == 'undefined') { + nBorderWidth = normal.borderWidth; + } + var eBorderWidth = elineStyle.width; + if (typeof eBorderWidth == 'undefined') { + if (typeof emphasis.borderWidth != 'undefined') { + eBorderWidth = emphasis.borderWidth; + } + else { + eBorderWidth = nBorderWidth + 2; + } + } + + var itemShape = { + shape : 'markLine', + style : { + symbol : symbol, + symbolSize : symbolSize, + symbolRotate : symbolRotate, + //data : [data[0].name,data[1].name], + xStart : xStart, + yStart : yStart, // 坐标 + xEnd : xEnd, + yEnd : yEnd, // 坐标 + brushType : 'both', + lineType : nlineStyle.type, + shadowColor : nlineStyle.shadowColor, + shadowBlur: nlineStyle.shadowBlur, + shadowOffsetX: nlineStyle.shadowOffsetX, + shadowOffsetY: nlineStyle.shadowOffsetY, + color : normal.color || color, + strokeColor : nlineStyle.color + || normal.borderColor + || color + || normal.color, + lineWidth: nBorderWidth, + symbolBorderColor: normal.borderColor + || color + || normal.color, + symbolBorder: normal.borderWidth * 2 + }, + highlightStyle : { + shadowColor : elineStyle.shadowColor, + shadowBlur: elineStyle.shadowBlur, + shadowOffsetX: elineStyle.shadowOffsetX, + shadowOffsetY: elineStyle.shadowOffsetY, + color : emphasis.color|| normal.color || color, + strokeColor : elineStyle.color + || nlineStyle.color + || emphasis.borderColor + || normal.borderColor + || color + || emphasis.color + || normal.color, + lineWidth: eBorderWidth, + symbolBorderColor: emphasis.borderColor + || normal.borderColor + || color + || emphasis.color + || normal.color, + symbolBorder: typeof emphasis.borderWidth == 'undefined' + ? (normal.borderWidth * 2 + 2) + : (emphasis.borderWidth * 2) + }, + clickable : true + }; + + itemShape = self.addLabel( + itemShape, + mlOption, + data[0], + data[0].name + ' : ' + data[1].name + ); + + itemShape._mark = 'line'; + itemShape._x = xEnd; + itemShape._y = yEnd; + + return itemShape; + } + /** * 百分比计算 */ @@ -13092,6 +14298,63 @@ define('echarts/component/base',['require','../config','zrender/tool/util'],func } return position; } + + /** + * 动画设定 + */ + function animation() { + if (_aniMap[self.type]) { + self.animationMark(ecConfig.animationDuration); + } + } + + function animationMark(duration /*, easing*/) { + var x; + var y; + for (var i = 0, l = self.shapeList.length; i < l; i++) { + if (!self.shapeList[i]._mark) { + continue; + } + x = self.shapeList[i]._x || 0; + y = self.shapeList[i]._y || 0; + if (self.shapeList[i]._mark == 'point') { + zr.modShape( + self.shapeList[i].id, + { + scale : [0, 0, x, y] + }, + true + ); + zr.animate(self.shapeList[i].id, '') + .when( + duration, + {scale : [1, 1, x, y]} + ) + .start('QuinticOut'); + } + else if (self.shapeList[i]._mark == 'line') { + zr.modShape( + self.shapeList[i].id, + { + style : { + xEnd : self.shapeList[i].style.xStart, + yEnd : self.shapeList[i].style.yStart + } + }, + true + ); + zr.animate(self.shapeList[i].id, 'style') + .when( + duration, + { + xEnd : x, + yEnd : y + } + ) + .start('QuinticOut'); + } + } + } function resize() { self.refresh && self.refresh(); @@ -13129,138 +14392,23 @@ define('echarts/component/base',['require','../config','zrender/tool/util'],func self.deepMerge = deepMerge; self.getFont = getFont; self.addLabel = addLabel; + self.buildMark = buildMark; + self.getMarkCoord = getMarkCoord; + self.getSymbolShape = getSymbolShape; self.parsePercent = parsePercent; self.parseCenter = parseCenter; self.parseRadius = parseRadius; self.subPixelOptimize = subPixelOptimize; + self.animation = animation; + self.animationMark = animationMark; + self.resize = resize; self.clear = clear; self.dispose = dispose; - self.resize = resize; } return Base; }); -/** - * echarts通用私有数据服务 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/ecData',[],function() { - /** - * 打包私有数据 - * - * @param {shape} shape 修改目标 - * @param {Object} series - * @param {number} seriesIndex - * @param {number | Object} data - * @param {number} dataIndex - * @param {*=} special - * @param {*=} special2 - */ - function pack( - shape, series, seriesIndex, data, dataIndex, name, special, special2 - ) { - var value; - if (typeof data != 'undefined') { - if (typeof data.value != 'undefined') { - value = data.value; - } - else { - value = data; - } - } - - shape._echartsData = { - '_series' : series, - '_seriesIndex' : seriesIndex, - '_data' : data, - '_dataIndex' : dataIndex, - '_name' : name, - '_value' : value, - '_special' : special, - '_special2' : special2 - }; - return shape._echartsData; - } - - /** - * 从私有数据中获取特定项 - * @param {shape} shape - * @param {string} key - */ - function get(shape, key) { - var data = shape._echartsData; - if (!key) { - return data; - } - - switch (key) { - case 'series' : - return data && data._series; - case 'seriesIndex' : - return data && data._seriesIndex; - case 'data' : - return data && data._data; - case 'dataIndex' : - return data && data._dataIndex; - case 'name' : - return data && data._name; - case 'value' : - return data && data._value; - case 'special' : - return data && data._special; - case 'special2' : - return data && data._special2; - } - - return null; - } - - /** - * 修改私有数据中获取特定项 - * @param {shape} shape - * @param {string} key - * @param {*} value - */ - function set(shape, key, value) { - shape._echartsData = shape._echartsData || {}; - switch (key) { - case 'series' : // 当前系列值 - shape._echartsData._series = value; - break; - case 'seriesIndex' : // 系列数组位置索引 - shape._echartsData._seriesIndex = value; - break; - case 'data' : // 当前数据值 - shape._echartsData._data = value; - break; - case 'dataIndex' : // 数据数组位置索引 - shape._echartsData._dataIndex = value; - break; - case 'name' : - shape._echartsData._name = value; - break; - case 'value' : - shape._echartsData._value = value; - break; - case 'special' : - shape._echartsData._special = value; - break; - case 'special2' : - shape._echartsData._special2 = value; - break; - } - } - - return { - pack : pack, - set : set, - get : get - }; -}); /** * 高精度数学运算 */ @@ -13957,11 +15105,11 @@ define('echarts/component/title',['require','./base','../config','zrender/tool/a zrArea.getTextWidth(text, font), zrArea.getTextWidth(subtext, subfont) ); - var totalHeight = zrArea.getTextWidth('国', font) + var totalHeight = zrArea.getTextHeight(text, font) + (subtext === '' ? 0 : (titleOption.itemGap - + zrArea.getTextWidth('国', subfont)) + + zrArea.getTextHeight(subtext, subfont)) ); var x; @@ -14309,7 +15457,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender // 小标记 function _buildAxisTick() { var axShape; - var data = option.data; + //var data = option.data; var dataLength = option.data.length; var length = option.axisTick.length; var color = option.axisTick.lineStyle.color; @@ -14326,9 +15474,9 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender zlevel : _zlevelBase, hoverable : false, style : { - xStart : getCoord(data[i].value || data[i]), + xStart : getCoordByIndex(i), yStart : yPosition, - xEnd : getCoord(data[i].value || data[i]), + xEnd : getCoordByIndex(i), yEnd : yPosition + length, strokeColor : color, lineWidth : lineWidth @@ -14349,9 +15497,9 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender hoverable : false, style : { xStart : xPosition, - yStart : getCoord(data[i].value || data[i]), + yStart : getCoordByIndex(i), xEnd : xPosition + length, - yEnd : getCoord(data[i].value || data[i]), + yEnd : getCoordByIndex(i), strokeColor : color, lineWidth : lineWidth } @@ -14385,6 +15533,10 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender } for (var i = 0; i < dataLength; i += _interval) { + if ((_labelData[i].value || _labelData[i]) === '') { + // 空文本优化 + continue; + } dataTextStyle = zrUtil.merge( data[i].textStyle || {}, textStyle, @@ -14395,7 +15547,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender zlevel : _zlevelBase, hoverable : false, style : { - x : getCoord(data[i].value || data[i]), + x : getCoordByIndex(i), y : yPosition, color : dataTextStyle.color, text : _labelData[i].value || _labelData[i], @@ -14433,6 +15585,10 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender } for (var i = 0; i < dataLength; i += _interval) { + if ((_labelData[i].value || _labelData[i]) === '') { + // 空文本优化 + continue; + } dataTextStyle = zrUtil.merge( data[i].textStyle || {}, textStyle, @@ -14444,7 +15600,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender hoverable : false, style : { x : xPosition, - y : getCoord(data[i].value || data[i]), + y : getCoordByIndex(i), color : dataTextStyle.color, text : _labelData[i].value || _labelData[i], textFont : self.getFont(dataTextStyle), @@ -14466,7 +15622,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender function _buildSplitLine() { var axShape; - var data = option.data; + //var data = option.data; var dataLength = option.data.length; var lineType = option.splitLine.lineStyle.type; var lineWidth = option.splitLine.lineStyle.width; @@ -14483,7 +15639,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i < dataLength; i += _interval) { // 亚像素优化 x = self.subPixelOptimize( - getCoord(data[i].value || data[i]), lineWidth + getCoordByIndex(i), lineWidth ); axShape = { shape : 'line', @@ -14512,7 +15668,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i < dataLength; i += _interval) { // 亚像素优化 y = self.subPixelOptimize( - getCoord(data[i].value || data[i]), lineWidth + getCoordByIndex(i), lineWidth ); axShape = { shape : 'line', @@ -14538,7 +15694,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender var color = option.splitArea.areaStyle.color; color = color instanceof Array ? color : [color]; var colorLength = color.length; - var data = option.data; + //var data = option.data; var dataLength = option.data.length; if (option.position == 'bottom' || option.position == 'top') { @@ -14550,7 +15706,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i <= dataLength; i += _interval) { curX = i < dataLength - ? getCoord(data[i].value || data[i]) + ? getCoordByIndex(i) : grid.getXend(); axShape = { shape : 'rectangle', @@ -14578,7 +15734,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i <= dataLength; i += _interval) { curY = i < dataLength - ? getCoord(data[i].value || data[i]) + ? getCoordByIndex(i) : grid.getY(); axShape = { shape : 'rectangle', @@ -14735,7 +15891,27 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender // 根据类目轴数据索引换算类目轴名称 function getNameByIndex(dataIndex) { - return option.data[dataIndex]; + if (typeof option.data[dataIndex].value != 'undefined') { + return option.data[dataIndex].value; + } + else { + return option.data[dataIndex]; + } + } + + // 根据类目轴名称换算类目轴数据索引 + function getIndexByName(name) { + var data = option.data; + var dataLength = data.length; + + for (var i = 0; i < dataLength; i++) { + if (data[i] == name + || (typeof data[i].value != 'undefined' + && data[i].value == name) + ) { + return i; + } + } } /** @@ -14757,6 +15933,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender self.getCoord = getCoord; self.getCoordByIndex = getCoordByIndex; self.getNameByIndex = getNameByIndex; + self.getIndexByName = getIndexByName; self.isMainAxis = isMainAxis; self.getPosition = getPosition; @@ -15904,25 +17081,26 @@ define('echarts/component/grid',['require','./base','../config','../component'], option.grid = self.reformOption(option.grid); var gridOption = option.grid; - _x = gridOption.x; - _y = gridOption.y; - var x2 = gridOption.x2; - var y2 = gridOption.y2; _zrWidth = zr.getWidth(); _zrHeight = zr.getHeight(); + _x = self.parsePercent(gridOption.x, _zrWidth); + _y = self.parsePercent(gridOption.y, _zrHeight); + var x2 = self.parsePercent(gridOption.x2, _zrWidth); + var y2 = self.parsePercent(gridOption.y2, _zrHeight); + if (typeof gridOption.width == 'undefined') { _width = _zrWidth - _x - x2; } else { - _width = gridOption.width; + _width = self.parsePercent(gridOption.width, _zrWidth); } if (typeof gridOption.height == 'undefined') { _height = _zrHeight - _y - y2; } else { - _height = gridOption.height; + _height = self.parsePercent(gridOption.height, _zrHeight); } _x = self.subPixelOptimize(_x, gridOption.borderWidth); @@ -16785,11 +17963,13 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen } // console.log(xStart,xEnd,yStart,yEnd); + var value; for (var i = 0, l = data.length; i < l; i++) { - if (data[i][0] >= xStart - && data[i][0] <= xEnd - && data[i][1] >= yStart - && data[i][1] <= yEnd + value = data[i].value || data[i]; + if (value[0] >= xStart + && value[0] <= xEnd + && value[1] >= yStart + && value[1] <= yEnd ) { newData.push(data[i]); } @@ -16901,8 +18081,8 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen var total; var sdx = (rect.x - gridArea.x) / gridArea.width; - var edx = 1- (rect.x + rect.width - gridArea.x) / gridArea.width; - var sdy = 1- (rect.y + rect.height - gridArea.y) / gridArea.height; + var edx = 1 - (rect.x + rect.width - gridArea.x) / gridArea.width; + var sdy = 1 - (rect.y + rect.height - gridArea.y) / gridArea.height; var edy = (rect.y - gridArea.y) / gridArea.height; //console.log('this',sdy,edy,_zoom.start,_zoom.end) if (zoomOption.orient == 'horizontal') { @@ -16959,9 +18139,22 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen } } } + function silence(s) { _isSilence = s; } + + function getRealDataIndex(sIdx, dIdx) { + if (!_originalData) { + return dIdx; + } + var sreies = _originalData.series; + if (sreies[sIdx]) { + return Math.floor(_zoom.start / 100 * sreies[sIdx].length) + + dIdx; + } + return -1; + } function init(newOption) { option = newOption; @@ -16975,8 +18168,8 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen // 自己show 或者 toolbox启用且dataZoom有效 if (option.dataZoom.show || ( - self.deepQuery([option], 'toolbox.show') - && self.deepQuery([option], 'toolbox.feature.dataZoom') + self.query(option, 'toolbox.show') + && self.query(option, 'toolbox.feature.dataZoom') ) ) { _location = _getLocation(); @@ -16998,8 +18191,8 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen // 自己show 或者 toolbox启用且dataZoom有效 if (option.dataZoom.show || ( - self.deepQuery([option], 'toolbox.show') - && self.deepQuery([option], 'toolbox.feature.dataZoom') + self.query(option, 'toolbox.show') + && self.query(option, 'toolbox.feature.dataZoom') ) ) { _location = _getLocation(); @@ -17027,6 +18220,7 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen self.ondragend = ondragend; self.ondataZoom = ondataZoom; self.silence = silence; + self.getRealDataIndex = getRealDataIndex; init(option); } @@ -17469,12 +18663,12 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ break; case 'k' : itemShape.style.brushType = 'both'; - itemShape.style.color = self.deepQuery( - [ecConfig], 'k.itemStyle.normal.color' + itemShape.style.color = self.query( + ecConfig, 'k.itemStyle.normal.color' ) || '#fff'; itemShape.style.strokeColor = color != '#ccc' - ? self.deepQuery( - [ecConfig], 'k.itemStyle.normal.lineStyle.color' + ? self.query( + ecConfig, 'k.itemStyle.normal.lineStyle.color' ) || '#ff3200' : color; } @@ -17492,7 +18686,7 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ } function init(newOption) { - if (!self.deepQuery([newOption], 'legend.data')) { + if (!self.query(newOption, 'legend.data')) { return; } @@ -17524,8 +18718,8 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ _selectedMap[itemName] = false; } else { - color = self.deepQuery( - [serie], 'itemStyle.normal.color' + color = self.query( + serie, 'itemStyle.normal.color' ); if (color && serie.type != ecConfig.CHART_TYPE_K) { setColor(itemName, color); @@ -17647,6 +18841,10 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ return true; } } + + function getSelectedMap() { + return _selectedMap; + } self.init = init; self.refresh = refresh; @@ -17658,6 +18856,7 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ self.getItemShape = getItemShape; self.setItemShape = setItemShape; self.isSelected = isSelected; + self.getSelectedMap = getSelectedMap; init(option); } @@ -17876,7 +19075,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var itemWidth = dataRangeOption.itemWidth; var itemHeight = dataRangeOption.itemHeight; var itemGap = dataRangeOption.itemGap; - var textHeight = zrArea.getTextWidth('国', font); + var textHeight = zrArea.getTextHeight('国', font); var color; if (dataRangeOption.orient == 'vertical' @@ -17903,6 +19102,8 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } else { lastY += textHeight + _textGap; + textShape.style.y += textHeight / 2 + _textGap; + textShape.style.textBaseline = 'bottom'; } self.shapeList.push(textShape); } @@ -17973,6 +19174,11 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to textShape = _getTextShape( lastX, lastY, dataRangeOption.text[1] ); + + if (dataRangeOption.orient != 'horizontal') { + textShape.style.y -= 5; + textShape.style.textBaseline = 'top'; + } self.shapeList.push(textShape); } @@ -17990,7 +19196,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var lastY = _itemGroupLocation.y; var itemWidth = dataRangeOption.itemWidth; var itemHeight = dataRangeOption.itemHeight; - var textHeight = zrArea.getTextWidth('国', font); + var textHeight = zrArea.getTextHeight('国', font); var needValueText = true; @@ -18010,6 +19216,8 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } else { lastY += textHeight + _textGap; + textShape.style.y += textHeight / 2 + _textGap; + textShape.style.textBaseline = 'bottom'; } self.shapeList.push(textShape); } @@ -18108,7 +19316,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var height = _calculableLocation.height; var font = self.getFont(dataRangeOption.textStyle); - var textHieght = zrArea.getTextWidth('国', font) + 2; + var textHeight = zrArea.getTextHeight('国', font); var textWidth = Math.max( zrArea.getTextWidth( dataRangeOption.precision === 0 @@ -18139,23 +19347,23 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to // 手柄统统在下方 pointListStart = [ [x, y], - [x, y + height + textHieght / 2 * 3], - [x - textWidth, y + height + textHieght / 2 * 3], - [x - textWidth, y + height + textHieght / 2], - [x - textHieght / 2, y + height + textHieght / 2], + [x, y + height + textHeight / 2 * 3], + [x - textWidth, y + height + textHeight / 2 * 3], + [x - textWidth, y + height + textHeight / 2], + [x - textHeight / 2, y + height + textHeight / 2], [x - 1, y + height], [x - 1, y] ]; textXStart = x - textWidth / 2; - textYStart = y + height + textHieght; + textYStart = y + height + textHeight; pointListEnd = [ [x + width, y], - [x + width, y + height + textHieght / 2 * 3], - [x + width + textWidth, y + height + textHieght/2*3], - [x + width + textWidth, y + height + textHieght / 2], - [x + width + textHieght / 2, y + height + textHieght/2], + [x + width, y + height + textHeight / 2 * 3], + [x + width + textWidth, y + height + textHeight/2*3], + [x + width + textWidth, y + height + textHeight / 2], + [x + width + textHeight / 2, y + height + textHeight/2], [x + width + 1, y + height], [x + width + 1, y] ]; @@ -18166,23 +19374,23 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to // 手柄在上方 pointListStart = [ [x, y + height], - [x, y - textHieght / 2 * 3], - [x - textWidth, y - textHieght / 2 * 3], - [x - textWidth, y - textHieght / 2], - [x - textHieght / 2, y - textHieght / 2], + [x, y - textHeight / 2 * 3], + [x - textWidth, y - textHeight / 2 * 3], + [x - textWidth, y - textHeight / 2], + [x - textHeight / 2, y - textHeight / 2], [x - 1, y], [x - 1, y + height] ]; textXStart = x - textWidth / 2; - textYStart = y - textHieght; + textYStart = y - textHeight; pointListEnd = [ [x + width, y + height], - [x + width, y - textHieght / 2 * 3], - [x + width + textWidth, y - textHieght / 2 * 3], - [x + width + textWidth, y - textHieght / 2], - [x + width + textHieght / 2, y - textHieght / 2], + [x + width, y - textHeight / 2 * 3], + [x + width + textWidth, y - textHeight / 2 * 3], + [x + width + textWidth, y - textHeight / 2], + [x + width + textHeight / 2, y - textHeight / 2], [x + width + 1, y], [x + width + 1, y + height] ]; @@ -18191,55 +19399,54 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } } else { - textWidth += textHieght; + textWidth += textHeight; // 垂直 if (dataRangeOption.x != 'right') { // 手柄统统在右侧 pointListStart = [ [x, y], [x + width + textWidth, y], - [x + width + textWidth, y - textHieght], - [x + width + textHieght, y - textHieght], + [x + width + textWidth, y - textHeight], + [x + width + textHeight, y - textHeight], [x + width, y - 1], [x, y - 1] ]; - textXStart = x + width + textWidth / 2 + textHieght / 2; - textYStart = y - textHieght / 2; - + textXStart = x + width + textWidth / 2 + textHeight / 2; + textYStart = y - textHeight / 2; pointListEnd = [ [x, y + height], [x + width + textWidth, y + height], - [x + width + textWidth, y + textHieght + height], - [x + width + textHieght, y + textHieght + height], + [x + width + textWidth, y + textHeight + height], + [x + width + textHeight, y + textHeight + height], [x + width, y + 1 + height], [x, y + height + 1] ]; textXEnd = textXStart; - textYEnd = y + height + textHieght / 2; + textYEnd = y + height + textHeight / 2; } else { // 手柄在左侧 pointListStart = [ [x + width, y], [x - textWidth, y], - [x - textWidth, y - textHieght], - [x - textHieght, y - textHieght], + [x - textWidth, y - textHeight], + [x - textHeight, y - textHeight], [x, y - 1], [x + width, y - 1] ]; - textXStart = x - textWidth / 2 - textHieght / 2; - textYStart = y - textHieght / 2; + textXStart = x - textWidth / 2 - textHeight / 2; + textYStart = y - textHeight / 2; pointListEnd = [ [x + width, y + height], [x - textWidth, y + height], - [x - textWidth, y + textHieght + height], - [x - textHieght, y + textHieght + height], + [x - textWidth, y + textHeight + height], + [x - textHeight, y + textHeight + height], [x, y + 1 + height], [x + width, y + height + 1] ]; textXEnd = textXStart; - textYEnd = y + height + textHieght / 2; + textYEnd = y + height + textHeight / 2; } } @@ -18253,7 +19460,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to textY : textYStart, textPosition : 'specific', textAlign : 'center', - textBaseline : 'middle ', + textBaseline : 'middle', textColor: dataRangeOption.textStyle.color, color : getColor(dataRangeOption.max), width : 0, // for ondrif计算统一 @@ -18278,7 +19485,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to textY : textYEnd, textPosition : 'specific', textAlign : 'center', - textBaseline : 'middle ', + textBaseline : 'middle', textColor: dataRangeOption.textStyle.color, color : getColor(dataRangeOption.min), width : 0, // for ondrif计算统一 @@ -18371,7 +19578,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var totalWidth = 0; var totalHeight = 0; var font = self.getFont(dataRangeOption.textStyle); - var textHeight = zrArea.getTextWidth('国', font); + var textHeight = zrArea.getTextHeight('国', font); if (dataRangeOption.orient == 'horizontal') { // 水平布局,计算总宽度 @@ -18487,7 +19694,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to - dataRangeOption.borderWidth; break; default : - x = dataRangeOption.x - 0; + x = self.parsePercent(dataRangeOption.x, zrWidth); x = isNaN(x) ? 0 : x; break; } @@ -18509,7 +19716,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to y = Math.floor((zrHeight - totalHeight) / 2); break; default : - y = dataRangeOption.y - 0; + y = self.parsePercent(dataRangeOption.y, zrHeight); y = isNaN(y) ? 0 : y; break; } @@ -18882,9 +20089,9 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } function init(newOption) { - if (typeof self.deepQuery([newOption], 'dataRange.min') + if (typeof self.query(newOption, 'dataRange.min') == 'undefined' - || typeof self.deepQuery([newOption], 'dataRange.max') + || typeof self.query(newOption, 'dataRange.max') == 'undefined' ) { return; @@ -19072,6 +20279,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa var yAxis; var polar; + var _selectedMap = {}; // tooltip dom & css var _tDom = document.createElement('div'); // 通用样式 @@ -19506,21 +20714,24 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 categoryAxis = xAxis.getAxis(xAxisIndex); for (var i = 0, l = series.length; i < l; i++) { + if (!_isSelected(series[i].name)) { + continue; + } if (series[i].xAxisIndex == xAxisIndex && self.deepQuery( [series[i], option], 'tooltip.trigger' ) == 'axis' ) { - showContent = self.deepQuery( - [series[i]], + showContent = self.query( + series[i], 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [series[i]], + formatter = self.query( + series[i], 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [series[i]], 'tooltip' + specialCssText += _style(self.query( + series[i], 'tooltip' )); seriesArray.push(series[i]); seriesIndex.push(i); @@ -19532,7 +20743,12 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa _event, { seriesIndex : seriesIndex, - dataIndex : dataIndex + dataIndex : component.dataZoom + ? component.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex } ); y = zrEvent.getY(_event) + 10; @@ -19552,21 +20768,24 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 categoryAxis = yAxis.getAxis(yAxisIndex); for (var i = 0, l = series.length; i < l; i++) { + if (!_isSelected(series[i].name)) { + continue; + } if (series[i].yAxisIndex == yAxisIndex && self.deepQuery( [series[i], option], 'tooltip.trigger' ) == 'axis' ) { - showContent = self.deepQuery( - [series[i]], + showContent = self.query( + series[i], 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [series[i]], + formatter = self.query( + series[i], 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [series[i]], 'tooltip' + specialCssText += _style(self.query( + series[i], 'tooltip' )); seriesArray.push(series[i]); seriesIndex.push(i); @@ -19578,7 +20797,12 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa _event, { seriesIndex : seriesIndex, - dataIndex : dataIndex + dataIndex : component.dataZoom + ? component.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex } ); x = zrEvent.getX(_event) + 10; @@ -19701,24 +20925,29 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa } formatter = option.tooltip.formatter; } + var indicatorName = + option.polar[polarIndex].indicator[dataIndex].text; // 找到所有用这个极坐标并且axis触发的系列数据 for (var i = 0, l = series.length; i < l; i++) { + if (!_isSelected(series[i].name)) { + continue; + } if (series[i].polarIndex == polarIndex && self.deepQuery( [series[i], option], 'tooltip.trigger' ) == 'axis' ) { - showContent = self.deepQuery( - [series[i]], + showContent = self.query( + series[i], 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [series[i]], + formatter = self.query( + series[i], 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [series[i]], 'tooltip' + specialCssText += _style(self.query( + series[i], 'tooltip' )); seriesArray.push(series[i]); } @@ -19727,13 +20956,14 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa var polarData; var data; var params = []; - var indicatorName = - option.polar[polarIndex].indicator[dataIndex].text; for (var i = 0, l = seriesArray.length; i < l; i++) { polarData = seriesArray[i].data; for (var j = 0, k = polarData.length; j < k; j++) { data = polarData[j]; + if (!_isSelected(data.name)) { + continue; + } data = typeof data != 'undefined' ? data : {name:'', value: {dataIndex:'-'}}; @@ -19832,25 +21062,25 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa formatter = option.tooltip.formatter; } // 系列 - if (self.deepQuery([serie], 'tooltip.trigger') == 'item') { - showContent = self.deepQuery( - [serie], 'tooltip.showContent' + if (self.query(serie, 'tooltip.trigger') == 'item') { + showContent = self.query( + serie, 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [serie], 'tooltip.formatter' + formatter = self.query( + serie, 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [serie], 'tooltip' + specialCssText += _style(self.query( + serie, 'tooltip' )); } // 数据项 - showContent = self.deepQuery( - [data], 'tooltip.showContent' + showContent = self.query( + data, 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [data], 'tooltip.formatter' + formatter = self.query( + data, 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery([data], 'tooltip')); + specialCssText += _style(self.query(data, 'tooltip')); } else { showContent = self.deepQuery( @@ -19912,7 +21142,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa ? '' : (' (' + special + ')')); } - else if (serie.type == ecConfig.CHART_TYPE_RADAR) { + else if (serie.type == ecConfig.CHART_TYPE_RADAR && special) { indicator = special; html += _encodeHTML( name === '' ? (serie.name || '') : name @@ -19999,32 +21229,32 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa [seriesArray[i], option], 'tooltip.trigger' ) == 'axis' ) { - queryTarget = [seriesArray[i]]; - curType = self.deepQuery( + queryTarget = seriesArray[i]; + curType = self.query( queryTarget, 'tooltip.axisPointer.type' ); pointType = curType || pointType; if (curType == 'line') { - lineColor = self.deepQuery( + lineColor = self.query( queryTarget, 'tooltip.axisPointer.lineStyle.color' ) || lineColor; - lineWidth = self.deepQuery( + lineWidth = self.query( queryTarget, 'tooltip.axisPointer.lineStyle.width' ) || lineWidth; - lineType = self.deepQuery( + lineType = self.query( queryTarget, 'tooltip.axisPointer.lineStyle.type' ) || lineType; } else if (curType == 'shadow') { - areaSize = self.deepQuery( + areaSize = self.query( queryTarget, 'tooltip.axisPointer.areaStyle.size' ) || areaSize; - areaColor = self.deepQuery( + areaColor = self.query( queryTarget, 'tooltip.axisPointer.areaStyle.color' ) || areaColor; @@ -20240,6 +21470,29 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa function ondragend() { _hide(); } + + /** + * 图例选择 + */ + function onlegendSelected(param) { + _selectedMap = param.selected; + } + function _setSelectedMap() { + if (option.legend && option.legend.selected) { + _selectedMap = option.legend.selected; + } + else { + _selectedMap = {}; + } + } + function _isSelected(itemName) { + if (typeof _selectedMap[itemName] != 'undefined') { + return _selectedMap[itemName]; + } + else { + return true; // 没在legend里定义的都为true啊~ + } + } function init(newOption, newDom) { option = newOption; @@ -20266,9 +21519,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa var series = option.series; for (var i = 0, l = series.length; i < l; i++) { - if (self.deepQuery([series[i]], 'tooltip.trigger') - == 'axis' - ) { + if (self.query(series[i], 'tooltip.trigger') == 'axis') { _needAxisTrigger = true; break; } @@ -20279,6 +21530,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa _defaultCssText = _style(option.tooltip); _tDom.style.position = 'absolute'; // 不是多余的,别删! self.hasAppend = false; + _setSelectedMap(); } /** @@ -20300,6 +21552,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa option.tooltip.padding = self.reformCssArray( option.tooltip.padding ); + _setSelectedMap(); } } @@ -20354,6 +21607,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa self.setComponent = setComponent; self.ontooltipHover = ontooltipHover; self.ondragend = ondragend; + self.onlegendSelected = onlegendSelected; init(option, dom); } @@ -20479,13 +21733,13 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf var textFont = self.getFont(toolboxOption.textStyle); var textPosition; var textAlign; - var textBaseLine; + var textBaseline; if (toolboxOption.orient == 'horizontal') { textPosition = _itemGroupLocation.y / zr.getHeight() < 0.5 ? 'bottom' : 'top'; textAlign = _itemGroupLocation.x / zr.getWidth() < 0.5 ? 'left' : 'right'; - textBaseLine = _itemGroupLocation.y / zr.getHeight() < 0.5 + textBaseline = _itemGroupLocation.y / zr.getHeight() < 0.5 ? 'top' : 'bottom'; } else { @@ -20494,7 +21748,7 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf /* textAlign = _itemGroupLocation.x / zr.getWidth() < 0.5 ? 'right' : 'left'; - textBaseLine = 'top'; + textBaseline = 'top'; */ } @@ -20537,18 +21791,18 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf if (i === 0 && textAlign == 'left') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; - itemShape.highlightStyle.textBaseLine = textBaseLine; + itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX; - itemShape.highlightStyle.textY = textBaseLine == 'top' + itemShape.highlightStyle.textY = textBaseline == 'top' ? lastY + itemSize + 10 : lastY - 10; } if (i == iconLength - 1 && textAlign == 'right') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; - itemShape.highlightStyle.textBaseLine = textBaseLine; + itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX + itemSize; - itemShape.highlightStyle.textY = textBaseLine == 'top' + itemShape.highlightStyle.textY = textBaseline == 'top' ? lastY + itemSize + 10 : lastY - 10; } @@ -20857,16 +22111,16 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf yStart : y, xEnd : x, yEnd : y, - lineWidth : self.deepQuery( - [option], + lineWidth : self.query( + option, 'toolbox.feature.mark.lineStyle.width' ) || 2, - strokeColor : self.deepQuery( - [option], + strokeColor : self.query( + option, 'toolbox.feature.mark.lineStyle.color' ) || _markColor, - lineType : self.deepQuery( - [option], + lineType : self.query( + option, 'toolbox.feature.mark.lineStyle.type' ) || 'dashed' } @@ -21284,12 +22538,12 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf function resize() { _resetMark(); self.clear(); - if (option.toolbox.show) { + if (option && option.toolbox && option.toolbox.show) { _buildShape(); - } - if (_dataView) { - _dataView.resize(); - } + } + if (_dataView) { + _dataView.resize(); + } } function hideDataView() { @@ -21405,7 +22659,7 @@ define('echarts/component/dataView',['require','./base','../config','../componen function show(newOption) { _hasShow = true; - var lang = self.deepQuery([option],'toolbox.feature.dataView.lang') + var lang = self.query(option, 'toolbox.feature.dataView.lang') || _lang; option = newOption; @@ -21420,8 +22674,8 @@ define('echarts/component/dataView',['require','./base','../config','../componen 'display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;' + 'width:' + (_zrWidth - 15) + 'px;' + 'height:' + (_zrHeight - 100) + 'px;'; - var customContent = self.deepQuery( - [option], 'toolbox.feature.dataView.optionToContent' + var customContent = self.query( + option, 'toolbox.feature.dataView.optionToContent' ); if (typeof customContent != 'function') { _textArea.value = _optionToContent(); @@ -21436,7 +22690,7 @@ define('echarts/component/dataView',['require','./base','../config','../componen _buttonClose.onclick = hide; _tDom.appendChild(_buttonClose); - if (self.deepQuery([option], 'toolbox.feature.dataView.readOnly') + if (self.query(option, 'toolbox.feature.dataView.readOnly') === false ) { _buttonRefresh.style.cssText = @@ -21553,8 +22807,8 @@ define('echarts/component/dataView',['require','./base','../config','../componen function _save() { var text = _textArea.value; - var customContent = self.deepQuery( - [option], 'toolbox.feature.dataView.contentToOption' + var customContent = self.query( + option, 'toolbox.feature.dataView.contentToOption' ); if (typeof customContent != 'function') { text = text.split('\n'); @@ -22050,8 +23304,10 @@ define( if (!name.show) { continue; } - textStyle = self.deepQuery([name, item, option], - 'textStyle'); + textStyle = self.deepQuery( + [name, item, option], + 'textStyle' + ); style = {}; @@ -22414,6 +23670,9 @@ define( for (var i = 0; i < series.length; i ++) { serie = series[i]; + if (serie.type != ecConfig.CHART_TYPE_RADAR) { + continue; + } serieData = serie.data || []; for (var j = 0; j < serieData.length; j ++) { polarIndex = self.deepQuery( @@ -22763,32 +24022,8 @@ define( * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt */ /** @@ -22798,12 +24033,12 @@ define( * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -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','./component/polar','./util/ecData','./chart','./component','zrender/tool/util','zrender/tool/util','zrender/tool/util','zrender/tool/color','zrender/tool/util','zrender/tool/util','zrender/tool/util'],function(require) { +define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zrender/tool/event','zrender/config','./util/shape/icon','./util/shape/markLine','./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','./component/polar','./util/ecData','./chart','./component','zrender/tool/util','zrender/tool/util','zrender/tool/util','zrender/tool/color','zrender/tool/util','zrender/tool/util','zrender/tool/util'],function(require) { var self = {}; var echarts = self; // 提供内部反向使用静态方法; - self.version = '1.3.5'; + self.version = '1.3.6'; self.dependencies = { - zrender : '1.0.7' + zrender : '1.0.8' }; /** * 入口方法 @@ -22811,6 +24046,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr self.init = function(dom, libOption) { libOption = libOption || {type : 'canvas'}; if (libOption.type == 'canvas') { + dom = dom instanceof Array ? dom[0] : dom; return new Echarts(dom); } else if (libOption.type == 'flash') { @@ -22908,8 +24144,9 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _zr.on(zrConfig.EVENT.DRAGLEAVE, _ondragleave); _zr.on(zrConfig.EVENT.DROP, _ondrop); - // 动态扩展zrender shape:icon + // 动态扩展zrender shape:icon、markLine require('./util/shape/icon'); + require('./util/shape/markLine'); // 内置图表注册 var chartLibrary = require('./chart'); @@ -22935,6 +24172,8 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr // 工具箱 var Toolbox = componentLibrary.get('toolbox'); _toolbox = new Toolbox(_messageCenter, _zr, dom); + + _disposeChartList(); } /** @@ -23263,10 +24502,22 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr function _eventPackage(target) { if (target) { var ecData = require('./util/ecData'); + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + dataIndex = self.compoent.dataZoom + ? self.compoent.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex; return { - seriesIndex : ecData.get(target, 'seriesIndex'), - dataIndex : ecData.get(target, 'dataIndex'), - data : ecData.get(target, 'data') + seriesIndex : seriesIndex, + dataIndex : dataIndex, + data : ecData.get(target, 'data'), + name : ecData.get(target, 'name'), + value : ecData.get(target, 'value') }; } return; @@ -23290,6 +24541,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _messageCenter, _zr, magicOption ); _chartList.push(title); + self.compoent.title = title; } // 提示 @@ -23298,6 +24550,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr var Tooltip = componentLibrary.get('tooltip'); tooltip = new Tooltip(_messageCenter, _zr, magicOption, dom); _chartList.push(tooltip); + self.compoent.tooltip = tooltip; } // 图例 @@ -23308,6 +24561,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _messageCenter, _zr, magicOption, _selectedMap ); _chartList.push(legend); + self.compoent.legend = legend; } // 值域控件 @@ -23318,6 +24572,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _messageCenter, _zr, magicOption ); _chartList.push(dataRange); + self.compoent.dataRange = dataRange; } // 直角坐标系 @@ -23329,6 +24584,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr var Grid = componentLibrary.get('grid'); grid = new Grid(_messageCenter, _zr, magicOption); _chartList.push(grid); + self.compoent.grid = grid; var DataZoom = componentLibrary.get('dataZoom'); dataZoom = new DataZoom( @@ -23341,6 +24597,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr } ); _chartList.push(dataZoom); + self.compoent.dataZoom = dataZoom; var Axis = componentLibrary.get('axis'); xAxis = new Axis( @@ -23354,6 +24611,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr 'xAxis' ); _chartList.push(xAxis); + self.compoent.xAxis = xAxis; yAxis = new Axis( _messageCenter, @@ -23366,6 +24624,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr 'yAxis' ); _chartList.push(yAxis); + self.compoent.yAxis = yAxis; } // 极坐标系 @@ -23381,6 +24640,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr } ); _chartList.push(polar); + self.compoent.polar = polar; } tooltip && tooltip.setComponent({ @@ -23418,6 +24678,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr } ); _chartList.push(chart); + self.chart[chartType] = chart; } } } @@ -23429,9 +24690,15 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr if (magicOption.animation && !magicOption.renderAsImage) { var len = _chartList.length; while (len--) { - _chartList[len] - && _chartList[len].animation - && _chartList[len].animation(); + chart = _chartList[len]; + if (chart + && chart.animation + && chart.shapeList + && chart.shapeList.length + < magicOption.animationThreshold + ) { + chart.animation(); + } } } @@ -23542,6 +24809,13 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr && _chartList[len].dispose(); } _chartList = []; + + self.chart = { + island : _island + }; + self.compoent = { + toolbox : _toolbox + }; } /** @@ -23583,6 +24857,9 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr if (typeof _option.animation == 'undefined') { _option.animation = ecConfig.animation; } + if (typeof _option.animationThreshold == 'undefined') { + _option.animationThreshold = ecConfig.animationThreshold; + } if (typeof _option.animationDuration == 'undefined') { _option.animationDuration = ecConfig.animationDuration; } @@ -23973,6 +25250,9 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _island.resize(); _toolbox.resize(); _zr.refresh(); + _messageCenter.dispatch( + ecConfig.EVENT.RESIZE + ); return self; } @@ -24189,11 +25469,17 @@ define( var ratio = window.devicePixelRatio || 1; // console.log(rect) // var ti = new Date(); + // bbox取整 + rect = { + x : Math.floor(rect.x), + y : Math.floor(rect.y), + width : Math.floor(rect.width), + height : Math.floor(rect.height) + }; var pixels = ctx.getImageData( rect.x * ratio, rect.y * ratio, rect.width * ratio, rect.height * ratio ); - var data = pixels.data; var idx; var zrColor = require('zrender/tool/color'); @@ -24244,7 +25530,7 @@ define( * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -define('echarts/chart/scatter',['require','../component/base','./calculableBase','../config','../util/ecData','zrender/tool/color','../util/shape/symbol','../chart'],function(require) { +define('echarts/chart/scatter',['require','../component/base','./calculableBase','../config','zrender/tool/color','../util/shape/symbol','../chart'],function(require) { /** * 构造函数 * @param {Object} messageCenter echart消息中心 @@ -24261,7 +25547,6 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' CalculableBase.call(this, zr, option); var ecConfig = require('../config'); - var ecData = require('../util/ecData'); var zrColor = require('zrender/tool/color'); @@ -24293,7 +25578,7 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' serieName = serie.name; if (serie.type == ecConfig.CHART_TYPE_SCATTER) { series[i] = self.reformOption(series[i]); - _sIndex2ShapeMap[i] = self.deepQuery([serie], 'symbol') + _sIndex2ShapeMap[i] = self.query(serie, 'symbol') || _symbol[i % _symbol.length]; if (legend){ self.selectedMap[serieName] = @@ -24368,7 +25653,6 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' var pointList = {}; var x; var y; - var symbolSize; for (var j = 0, k = seriesArray.length; j < k; j++) { seriesIndex = seriesArray[j]; serie = series[seriesIndex]; @@ -24379,7 +25663,6 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' xAxis = component.xAxis.getAxis(serie.xAxisIndex || 0); yAxis = component.yAxis.getAxis(serie.yAxisIndex || 0); - symbolSize = self.deepQuery([serie], 'symbolSize'); pointList[seriesIndex] = []; for (var i = 0, l = serie.data.length; i < l; i++) { data = serie.data[i]; @@ -24395,16 +25678,17 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' x = xAxis.getCoord(value[0]); y = yAxis.getCoord(value[1]); pointList[seriesIndex].push([ - x, // 横坐标 - y, // 纵坐标 - (typeof symbolSize == 'function' - ? symbolSize(value) - : symbolSize), // 图形大小 - _sIndex2ShapeMap[seriesIndex], // 图形类型 - i, // 数据index - data.name || '' // 名称 + x, // 横坐标 + y, // 纵坐标 + i, // 数据index + data.name || '' // 名称 ]); } + self.buildMark( + serie, + seriesIndex, + component + ); } // console.log(pointList) _buildPointList(pointList); @@ -24414,46 +25698,19 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' * 生成折线和折线上的拐点 */ function _buildPointList(pointList) { - var dataRange = component.dataRange; - var rangColor; // 更高优先级 - var nColor; // normal - var nLineWidth; - var eColor; // emphasis - var eLineWidth; - var serie; - var queryTarget; - var data; var seriesPL; var singlePoint; - var symbolRotate; - + var shape; for (var seriesIndex in pointList) { serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - // 多级控制 - queryTarget = [serie]; - nColor = self.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || _sIndex2ColorMap[seriesIndex]; - nLineWidth = self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - ); - - eColor = self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ); - eLineWidth = self.deepQuery( - queryTarget, 'itemStyle.emphasis.lineStyle.width' - ); - - symbolRotate = self.deepQuery( - queryTarget, 'symbolRotate' - ); - + seriesPL = pointList[seriesIndex]; if (serie.large && serie.data.length > serie.largeThreshold) { self.shapeList.push(_getLargeSymbol( - seriesPL, nColor, eColor + seriesPL, + self.query( + serie, 'itemStyle.normal.color' + ) || _sIndex2ColorMap[seriesIndex] )); continue; } @@ -24462,171 +25719,92 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' * pointlist=[ * 0 x, * 1 y, - * 2 图形大小 - * 3 图形类型 - * 4 数据index - * 5 名称 + * 2 数据index + * 3 名称 * ] */ + for (var i = 0, l = seriesPL.length; i < l; i++) { singlePoint = seriesPL[i]; - data = serie.data[singlePoint[4]]; - - if (dataRange) { - if (isNaN(data[2])) { - continue; - } - rangColor = dataRange.getColor(data[2]); - if (!rangColor) { - continue; - } - } - else { - rangColor = nColor; - } - - queryTarget = [data]; - self.shapeList.push(_getSymbol( + shape = _getSymbol( seriesIndex, // seriesIndex - singlePoint[4], // dataIndex - singlePoint[5], // name - + singlePoint[2], // dataIndex + singlePoint[3], // name singlePoint[0], // x - singlePoint[1], // y - - // 大小 - self.deepQuery(queryTarget, 'symbolSize') - || singlePoint[2], - - // 方向 - self.deepQuery(queryTarget, 'symbolRotate') - || symbolRotate, - - // 类型 - self.deepQuery(queryTarget, 'symbol') - || singlePoint[3], - - // 填充颜色 - self.deepQuery(queryTarget, 'itemStyle.normal.color') - || rangColor, - // 线宽 - self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - )|| nLineWidth, - - //------------高亮 - // 填充颜色 - self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || eColor || nColor, - // 线宽 - self.deepQuery( - queryTarget, 'itemStyle.emphasis.lineStyle.width' - )|| eLineWidth || nLineWidth - )); + singlePoint[1] // y + ); + shape && self.shapeList.push(shape); } } // console.log(self.shapeList) } /** - * 生成散点图上的图形 + * 生成折线图上的拐点图形 */ - function _getSymbol( - seriesIndex, dataIndex, name, - x, y, symbolSize, symbolRotate, symbol, - nColor, nLineWidth, eColor, eLineWidth - ) { - var itemShape = { - shape : 'icon', - zlevel : _zlevelBase, - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : symbol.match('empty') ? 'stroke' : 'fill', - color : nColor, - strokeColor : nColor, - lineWidth: nLineWidth - }, - highlightStyle : { - color : eColor, - strokeColor : eColor, - lineWidth : eLineWidth - }, - clickable : true - }; - - if (typeof symbolRotate != 'undefined') { - itemShape.rotation = [ - symbolRotate * Math.PI / 180, x, y - ]; - } + function _getSymbol(seriesIndex, dataIndex, name, x, y) { + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; - if (symbol.match('image')) { - itemShape.style.image = - symbol.replace(new RegExp('^image:\\/\\/'), ''); - itemShape.shape = 'image'; + var dataRange = component.dataRange; + var rangColor; + if (dataRange) { + rangColor = isNaN(data[2]) + ? _sIndex2ColorMap[seriesIndex] + : dataRange.getColor(data[2]); + if (!rangColor) { + return null; + } } - - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; + else { + rangColor = _sIndex2ColorMap[seriesIndex]; } - if (symbol == 'none') { - itemShape.invisible = true; - itemShape.hoverable = false; - } - - /* - if (self.deepQuery([data, serie, option], 'calculable')) { - self.setCalculable(itemShape); - itemShape.draggable = true; - } - */ - - itemShape = self.addLabel( - itemShape, - series[seriesIndex], - series[seriesIndex].data[dataIndex], - name, + var itemShape = self.getSymbolShape( + serie, seriesIndex, data, dataIndex, name, + x, y, + _sIndex2ShapeMap[seriesIndex], + rangColor, + 'rgba(0,0,0,0)', 'vertical' ); - - ecData.pack( - itemShape, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - name - ); - - // for animation - itemShape._x = x; - itemShape._y = y; - + itemShape.zlevel = _zlevelBase; + itemShape._mark = false; // 非mark + itemShape._main = true; return itemShape; } - function _getLargeSymbol(symbolList, nColor, eColor) { + function _getLargeSymbol(symbolList, nColor) { return { shape : 'symbol', zlevel : _zlevelBase, + _main : true, hoverable: false, style : { pointList : symbolList, color : nColor, strokeColor : nColor - }, - highlightStyle : { - color : eColor, - strokeColor : eColor } }; } + + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' + && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' + && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 @@ -24668,38 +25846,49 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var serie; for (var i = 0, l = self.shapeList.length; i < l; i++) { - x = self.shapeList[i]._x || 0; - y = self.shapeList[i]._y || 0; - zr.modShape( - self.shapeList[i].id, - { - scale : [0, 0, x, y] - }, - true - ); - zr.animate(self.shapeList[i].id, '') - .when( - (self.deepQuery([serie],'animationDuration') - || duration), - {scale : [1, 1, x, y]} - ) - .start( - self.deepQuery([serie], 'animationEasing') || easing + if (self.shapeList[i]._main) { + if (self.shapeList[i].shape == 'symbol') { + continue; + } + serie = series[self.shapeList[i]._seriesIndex]; + x = self.shapeList[i]._x || 0; + y = self.shapeList[i]._y || 0; + zr.modShape( + self.shapeList[i].id, + { + scale : [0, 0, x, y] + }, + true ); + zr.animate(self.shapeList[i].id, '') + .when( + (self.query(serie,'animationDuration') + || duration), + {scale : [1, 1, x, y]} + ) + .start( + self.query(serie, 'animationEasing') || easing + ); + } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.ondataRange = ondataRange; - self.animation = animation; init(option, component); } @@ -24927,7 +26116,7 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c var ecConfig = require('../config'); var ecData = require('../util/ecData'); - + var self = this; self.type = ecConfig.CHART_TYPE_K; @@ -24983,6 +26172,14 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c return; } _buildHorizontal(maxDataLength, locationMap); + + for (var i = 0, l = seriesArray.length; i < l; i++) { + self.buildMark( + series[seriesArray[i]], + seriesArray[i], + component + ); + } } /** @@ -25119,36 +26316,36 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c && typeof seriesPL != 'undefined' ) { // 多级控制 - queryTarget = [serie]; - nLineWidth = self.deepQuery( + queryTarget = serie; + nLineWidth = self.query( queryTarget, 'itemStyle.normal.lineStyle.width' ); - nLineColor = self.deepQuery( + nLineColor = self.query( queryTarget, 'itemStyle.normal.lineStyle.color' ); - nLineColor0 = self.deepQuery( + nLineColor0 = self.query( queryTarget, 'itemStyle.normal.lineStyle.color0' ); - nColor = self.deepQuery( + nColor = self.query( queryTarget, 'itemStyle.normal.color' ); - nColor0 = self.deepQuery( + nColor0 = self.query( queryTarget, 'itemStyle.normal.color0' ); - eLineWidth = self.deepQuery( + eLineWidth = self.query( queryTarget, 'itemStyle.emphasis.lineStyle.width' ); - eLineColor = self.deepQuery( + eLineColor = self.query( queryTarget, 'itemStyle.emphasis.lineStyle.color' ); - eLineColor0 = self.deepQuery( + eLineColor0 = self.query( queryTarget, 'itemStyle.emphasis.lineStyle.color0' ); - eColor = self.deepQuery( + eColor = self.query( queryTarget, 'itemStyle.emphasis.color' ); - eColor0 = self.deepQuery( + eColor0 = self.query( queryTarget, 'itemStyle.emphasis.color0' ); @@ -25167,7 +26364,7 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c for (var i = 0, l = seriesPL.length; i < l; i++) { singlePoint = seriesPL[i]; data = serie.data[singlePoint[6]]; - queryTarget = [data]; + queryTarget = data; candleType = singlePoint[3] < singlePoint[2]; self.shapeList.push(_getCandle( seriesIndex, // seriesIndex @@ -25183,25 +26380,25 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c // 填充颜色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.normal.color' ) || nColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.normal.color0' ) || nColor0), // 线宽 - self.deepQuery( + self.query( queryTarget, 'itemStyle.normal.lineStyle.width' ) || nLineWidth, // 线色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.normal.lineStyle.color' ) || nLineColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.normal.lineStyle.color0' ) || nLineColor0), @@ -25210,25 +26407,25 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c // 填充颜色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.emphasis.color' ) || eColor || nColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.emphasis.color0' ) || eColor0 || nColor0), // 线宽 - self.deepQuery( + self.query( queryTarget, 'itemStyle.emphasis.lineStyle.width' ) || eLineWidth || nLineWidth, // 线色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.emphasis.lineStyle.color' ) || eLineColor || nLineColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.emphasis.lineStyle.color0' ) || eLineColor0 || nLineColor0) @@ -25278,6 +26475,24 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c return itemShape; } + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' + && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' + && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } + /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * @param {Object} newSeries @@ -25353,8 +26568,8 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var serie; @@ -25371,21 +26586,26 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c ); zr.animate(self.shapeList[i].id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration), {scale : [1, 1, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.addDataAnimation = addDataAnimation; - self.animation = animation; init(option, component); } @@ -25448,20 +26668,34 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c /** * 绘制图形 */ - function _buildShape() { + function _buildShape() { + var legend = component.legend; self.selectedMap = {}; _dropBoxList = []; _radarDataCounter = 0; + var serieName; for (var i = 0, l = series.length; i < l ; i ++) { if (series[i].type == ecConfig.CHART_TYPE_RADAR) { serie = self.reformOption(series[i]); - _queryTarget = [serie, option]; - - // 添加可拖拽提示框,多系列共用一个极坐标,第一个优先 - if (self.deepQuery(_queryTarget, 'calculable')) { - _addDropBox(i); + serieName = serie.name || ''; + // 系列图例开关 + self.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + + if (self.selectedMap[serieName]) { + _queryTarget = [serie, option]; + + // 添加可拖拽提示框,多系列共用一个极坐标,第一个优先 + if (self.deepQuery(_queryTarget, 'calculable')) { + _addDropBox(i); + } + _buildSingleRadar(i); + self.buildMark( + series[i], + i, + component + ); } - _buildSingleRadar(i); } } @@ -25515,7 +26749,7 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c pointList = _getPointList(serie.polarIndex, data[i]); // 添加拐点形状 - _addSymbol(pointList, defaultColor, data[i], index); + _addSymbol(pointList, defaultColor, i, index); // 添加数据形状 _addDataShape( pointList, defaultColor, data[i], @@ -25546,41 +26780,6 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c return pointList; } - /** - * 生成折线图上的拐点图形 - */ - function _getSymbol( - x, y, symbol, symbolSize, normalColor, emphasisColor, lineWidth - ) { - var itemShape = { - shape : 'icon', - zlevel : _zlevelBase + 1, - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') ? '#fff' : normalColor, - strokeColor : normalColor, - lineWidth: lineWidth * 2 - }, - hoverable: false - }; - - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; - } - - itemShape._x = x; - itemShape._y = y; - - return itemShape; - } - /** * 添加拐点 * @param {Array>} pointList 点集 @@ -25588,36 +26787,21 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c * @param {object} data 数据 * @param {number} serieIndex */ - function _addSymbol(pointList, defaultColor, data) { - // 多级控制 - var queryTarget = [data, serie]; - var symbol = self.deepQuery(queryTarget,'symbol') - || _symbol[_radarDataCounter % _symbol.length] - || 'cricle'; - - if (symbol != 'none') { - var symbolSize = self.deepQuery(queryTarget,'symbolSize'); - var nColor = self.deepQuery( - queryTarget, 'itemStyle.normal.color' - ); - var eColor = self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ); - var lineWidth = self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' + function _addSymbol(pointList, defaultColor, dataIndex, seriesIndex) { + var itemShape; + for (var i = 0, l = pointList.length; i < l; i++) { + itemShape = self.getSymbolShape( + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, '', + pointList[i][0], // x + pointList[i][1], // y + _symbol[_radarDataCounter % _symbol.length], + defaultColor, + '#fff', + 'vertical' ); - - for (var i = 0, l = pointList.length; i < l; i++) { - self.shapeList.push(_getSymbol( - pointList[i][0], // x - pointList[i][1], // y - symbol, - symbolSize, - nColor || defaultColor, - eColor || nColor || defaultColor, - lineWidth - )); - } + itemShape.zlevel = _zlevelBase + 1; + self.shapeList.push(itemShape); } } @@ -25725,7 +26909,6 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c } } - /** * 数据项被拖拽出去,重载基类方法 */ @@ -25840,8 +27023,8 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c } function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var dataIndex; var seriesIndex; var data; @@ -25877,39 +27060,25 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c zr.animate(item.id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 100, {scale : [1, 1, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } - else { - x = self.shapeList[i]._x || 0; - y = self.shapeList[i]._y || 0; - zr.modShape( - self.shapeList[i].id, - { - scale : [0, 0, x, y] - }, - true - ); - zr.animate(self.shapeList[i].id, '') - .when( - duration, - {scale : [1, 1, x, y]} - ) - .start('QuinticOut'); - } } - + + self.animationMark(duration, easing); } + // 重载基类方法 + self.animation = animation; + self.init = init; self.refresh = refresh; - self.animation = animation; self.ondrop = ondrop; self.ondragend = ondragend; @@ -28527,7 +29696,6 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base var matrix = []; var serieNumber = 0; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type === self.type) { // Use the config of first chord serie if (!chordSerieSample) { @@ -28542,6 +29710,11 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base continue; } chordSeries.push(series[i]); + self.buildMark( + series[i], + i, + component + ); matrix.push(series[i].matrix); serieNumber++; } @@ -28757,11 +29930,11 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base var timeout; - var showLabel = self.deepQuery( - [chordSerieSample], 'itemStyle.normal.label.show' + var showLabel = self.query( + chordSerieSample, 'itemStyle.normal.label.show' ); - var labelColor = self.deepQuery( - [chordSerieSample], 'itemStyle.normal.label.color' + var labelColor = self.query( + chordSerieSample, 'itemStyle.normal.label.color' ); function createMouseOver(idx) { @@ -29149,8 +30322,8 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base // key is serie name for (var i = 0; i < chordSeries.length; i++) { if (chordSeries[i].name === key) { - colorMap[key] = self.deepQuery( - [chordSeries[i]], + colorMap[key] = self.query( + chordSeries[i], 'itemStyle.normal.color' ); break; @@ -29161,8 +30334,8 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base // key is group name for (var i = 0; i < len; i++) { if (groups[i].name === key) { - colorMap[key] = self.deepQuery( - [groups[i]], + colorMap[key] = self.query( + groups[i], 'itemStyle.normal.color' ); break; @@ -29223,7 +30396,7 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base define('echarts/chart/force',['require','../component/base','./calculableBase','../config','../util/ecData','zrender/config','zrender/tool/event','zrender/tool/util','zrender/tool/vector','../util/ndarray','../chart'],function(require) { - var requrestAnimationFrame = window.requrestAnimationFrame + var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame @@ -29254,6 +30427,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' var NDArray = require('../util/ndarray'); + var legend; var self = this; self.type = ecConfig.CHART_TYPE_FORCE; @@ -29313,32 +30487,47 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' var mouseX, mouseY; function _buildShape() { - var legend = component.legend; + legend = component.legend; temperature = 1.0; viewportWidth = zr.getWidth(); viewportHeight = zr.getHeight(); centroid = [viewportWidth/2, viewportHeight/2]; - + + var serieName; for (var i = 0, l = series.length; i < l; i++) { var serie = series[i]; if (serie.type === ecConfig.CHART_TYPE_FORCE) { series[i] = self.reformOption(series[i]); + + serieName = series[i].name || ''; + // 系列图例开关 + self.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + if (!self.selectedMap[serieName]) { + continue; + } + self.buildMark( + series[i], + i, + component + ); + forceSerie = serie; - var minRadius = self.deepQuery([serie], 'minRadius'); - var maxRadius = self.deepQuery([serie], 'maxRadius'); + var minRadius = self.query(serie, 'minRadius'); + var maxRadius = self.query(serie, 'maxRadius'); // ----------获取外部参数 - attractiveness = self.deepQuery( - [serie], 'attractiveness' + attractiveness = self.query( + serie, 'attractiveness' ); - density = self.deepQuery([serie], 'density'); - initSize = self.deepQuery([serie], 'initSize'); - centripetal = self.deepQuery([serie], 'centripetal'); - coolDown = self.deepQuery([serie], 'coolDown'); + density = self.query(serie, 'density'); + initSize = self.query(serie, 'initSize'); + centripetal = self.query(serie, 'centripetal'); + coolDown = self.query(serie, 'coolDown'); // ---------- - categories = self.deepQuery([serie], 'categories'); + categories = self.query(serie, 'categories'); // 同步selected状态 for (var j = 0, len = categories.length; j < len; j++) { @@ -29352,21 +30541,21 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' } } - linkStyle = self.deepQuery( - [serie], 'itemStyle.normal.linkStyle' + linkStyle = self.query( + serie, 'itemStyle.normal.linkStyle' ); - linkEmphasisStyle = self.deepQuery( - [serie], 'itemStyle.emphasis.linkStyle' + linkEmphasisStyle = self.query( + serie, 'itemStyle.emphasis.linkStyle' ); - nodeStyle = self.deepQuery( - [serie], 'itemStyle.normal.nodeStyle' + nodeStyle = self.query( + serie, 'itemStyle.normal.nodeStyle' ); - nodeEmphasisStyle = self.deepQuery( - [serie], 'itemStyle.emphasis.nodeStyle' + nodeEmphasisStyle = self.query( + serie, 'itemStyle.emphasis.nodeStyle' ); - rawNodes = self.deepQuery([serie], 'nodes'); - rawLinks = zrUtil.clone(self.deepQuery([serie], 'links')); + rawNodes = self.query(serie, 'nodes'); + rawLinks = zrUtil.clone(self.query(serie, 'links')); _preProcessData(rawNodes, rawLinks); // Reset data nodePositions = []; @@ -29484,32 +30673,29 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' // Label var labelStyle; - if (self.deepQuery([forceSerie], 'itemStyle.normal.label.show') + if (self.query(forceSerie, 'itemStyle.normal.label.show') ) { shape.style.text = node.name; shape.style.textPosition = 'inside'; - labelStyle = self.deepQuery( - [forceSerie], 'itemStyle.normal.label.textStyle' + labelStyle = self.query( + forceSerie, 'itemStyle.normal.label.textStyle' ) || {}; shape.style.textColor = labelStyle.color || '#fff'; shape.style.textAlign = labelStyle.align || 'center'; - shape.style.textBaseLine = labelStyle.baseline || 'middle'; + shape.style.textBaseline = labelStyle.baseline || 'middle'; shape.style.textFont = self.getFont(labelStyle); } - if (self.deepQuery( - [forceSerie], 'itemStyle.emphasis.label.show' - ) - ) { + if (self.query(forceSerie, 'itemStyle.emphasis.label.show')) { shape.highlightStyle.text = node.name; shape.highlightStyle.textPosition = 'inside'; - labelStyle = self.deepQuery( - [forceSerie], 'itemStyle.emphasis.label.textStyle' + labelStyle = self.query( + forceSerie, 'itemStyle.emphasis.label.textStyle' ) || {}; shape.highlightStyle.textColor = labelStyle.color || '#fff'; shape.highlightStyle.textAlign = labelStyle.align || 'center'; - shape.highlightStyle.textBaseLine = labelStyle.baseline + shape.highlightStyle.textBaseline = labelStyle.baseline || 'middle'; shape.highlightStyle.textFont = self.getFont(labelStyle); } @@ -29521,6 +30707,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' if (typeof(node.category) !== 'undefined') { var category = categories[node.category]; if (category) { + shape.style.color = legend.getColor(category.name); var style = category.itemStyle; if (style) { if (style.normal) { @@ -29577,7 +30764,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' // data node, // data index - rawNodes.indexOf(node), + zrUtil.indexOf(rawNodes, node), // name node.name || '', // value @@ -29830,7 +31017,6 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' } var _updating; - function init(newOption, newComponent) { option = newOption; component = newComponent; @@ -29844,10 +31030,10 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' function cb() { if (_updating) { _step(); - requrestAnimationFrame(cb); + requestAnimationFrame(cb); } } - requrestAnimationFrame(cb); + requestAnimationFrame(cb); } function refresh(newOption) { @@ -29871,8 +31057,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' self.isDragstart = true; }; - function onclick() { - } + function onclick() { } /** * 拖拽开始 @@ -30646,8 +31831,17 @@ define('echarts/util/projection/normal',[],function() { * @param {Array} p */ function pos2geo(obj, p) { - var x = p[0] * 1; - var y = p[1] * 1; + var x; + var y; + if (p instanceof Array) { + x = p[0] * 1; + y = p[1] * 1; + } + else { + x = p.x * 1; + y = p.y * 1; + } + x = x / obj.scale.x + obj.offset.x - 168.5; x = x > 180 ? x - 360 : x; y = 90 - (y / obj.scale.y + obj.offset.y); @@ -30710,6 +31904,7 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. var _zlevelBase = self.getZlevelBase(); var _selectedMode; // 选择模式 + var _hoverable; // 悬浮高亮模式 var _selected = {}; // 地图选择状态 var _mapTypeMap = {}; // 图例类型索引 var _mapDataMap = {}; // 根据地图类型索引bbox,transform,path @@ -30730,6 +31925,8 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. var _mousedown; var _justMove; // 避免移动响应点击 var _curMapType; // 当前移动的地图类型 + + var _markAnimation = false; function _buildShape() { self.selectedMap = {}; @@ -30742,6 +31939,7 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. var name; var mapSeries = {}; _selectedMode = {}; + _hoverable = {}; var valueCalculation = {}; _needRoam = false; for (var i = 0, l = series.length; i < l; i++) { @@ -30769,7 +31967,13 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. _selectedMode[mapType] = _selectedMode[mapType] || series[i].selectedMode; - + if (typeof _hoverable[mapType] == 'undefined' + || _hoverable[mapType] + ) { + _hoverable[mapType] = !series[i].hoverable + ? false : true; // 1票否决 + } + valueCalculation[mapType] = valueCalculation[mapType] || series[i].mapValueCalculation; @@ -30870,12 +32074,19 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. vd, // 用户数据 ms // 系列 ); + _buildMark(mt, ms); if (--_mapDataRequireCounter <= 0) { for (var i = 0, l = self.shapeList.length; i < l; i++) { self.shapeList[i].id = zr.newShapeId(self.type); zr.addShape(self.shapeList[i]); } zr.refresh(); + if (!_markAnimation) { + _markAnimation = true; + if (option.animation && !option.renderAsImage) { + self.animationMark(option.animationDuration); + } + } } }; } @@ -31352,7 +32563,7 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. textShape = { shape : 'text', zlevel : _zlevelBase + 1, - hoverable: tooSmall, + hoverable: tooSmall ? _hoverable[mapType] : tooSmall, clickable : tooSmall, position : style.position, _mapType : mapType, @@ -31464,6 +32675,7 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. _mapTypeMap[name] = mapType; shape.onclick = self.shapeHandler.onclick; } + shape.hoverable = _hoverable[mapType]; // console.log(name,shape); ecData.pack( @@ -31481,6 +32693,37 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. //console.log(_selected); } + // 添加标注 + function _buildMark(mapType, mapSeries) { + var position = [ + _mapDataMap[mapType].transform.left, + _mapDataMap[mapType].transform.top + ]; + for (var sIdx in mapSeries) { + self.buildMark( + series[sIdx], + sIdx, + component, + { + mapType : mapType + }, + { + position : position, + _mapType : mapType + } + ); + } + } + + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData, markCoordParams) { + return _geoCoord[mpData.name] + ? geo2pos( + markCoordParams.mapType, _geoCoord[mpData.name] + ) + : [0, 0]; + } + function _nameChange(mapType, name) { return _nameMap[mapType][name] || name; } @@ -31584,7 +32827,11 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. // 让refresh飞一会 clearTimeout(_refreshDelayTicket); _refreshDelayTicket = setTimeout(refresh, 100); - + messageCenter.dispatch( + ecConfig.EVENT.MAP_ROAM, + param.event, + {type : 'scale'} + ); zrEvent.stop(event); } } @@ -31634,6 +32881,11 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. zr.modShape(self.shapeList[i].id, mod, true); } } + messageCenter.dispatch( + ecConfig.EVENT.MAP_ROAM, + param.event, + {type : 'move'} + ); zr.refresh(); _justMove = true; zrEvent.stop(event); @@ -31726,6 +32978,7 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. _nameMap = {}; _roamMap = {}; _specialArea = {}; + _markAnimation = false; refresh(newOption); @@ -31765,21 +33018,94 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. * 平面坐标转经纬度 */ function pos2geo(mapType, p) { + if (!_mapDataMap[mapType].transform) { + return null; + } return require('../util/projection/normal').pos2geo( _mapDataMap[mapType].transform, p ); } + /** + * 公开接口 : 平面坐标转经纬度 + */ + function getGeoByPos(mapType, p) { + if (!_mapDataMap[mapType].transform) { + return null; + } + var position = [ + _mapDataMap[mapType].transform.left, + _mapDataMap[mapType].transform.top + ]; + if (p instanceof Array) { + p[0] -= position[0]; + p[1] -= position[1]; + } + else { + p.x -= position[0]; + p.y -= position[1]; + } + return pos2geo(mapType, p); + } + /** * 经纬度转平面坐标 * @param {Object} p */ function geo2pos(mapType, p) { + if (!_mapDataMap[mapType].transform) { + return null; + } return require('../util/projection/normal').geo2pos( _mapDataMap[mapType].transform, p ); } + /** + * 公开接口 : 经纬度转平面坐标 + */ + function getPosByGeo(mapType, p) { + if (!_mapDataMap[mapType].transform) { + return null; + } + var pos = geo2pos(mapType, p); + pos[0] += _mapDataMap[mapType].transform.left; + pos[1] += _mapDataMap[mapType].transform.top; + return pos; + } + + /** + * 公开接口 : 地图参考坐标 + */ + function getMapPosition(mapType) { + if (!_mapDataMap[mapType].transform) { + return null; + } + return [ + _mapDataMap[mapType].transform.left, + _mapDataMap[mapType].transform.top + ]; + } + + /* + function appendShape(mapType, shapeList) { + shapeList = shapeList instanceof Array + ? shapeList : [shapeList]; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (typeof shapeList[i].id == 'undefined') { + shapeList[i].id = zr.newShapeId(self.type); + } + if (typeof shapeList[i].zlevel == 'undefined') { + shapeList[i].zlevel = _zlevelBase + 1; + } + shapeList[i]._mapType = mapType; + self.shapeList.push(shapeList[i]); + zr.addShape(shapeList[i]); + } + zr.refresh(); + } + */ + /** * 释放后实例不可用 */ @@ -31794,14 +33120,21 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. } // 重载基类方法 + self.getMarkCoord = getMarkCoord; self.dispose = dispose; self.init = init; self.refresh = refresh; self.ondataRange = ondataRange; + self.onclick = onclick; + + // 稳定接口 self.pos2geo = pos2geo; self.geo2pos = geo2pos; - self.onclick = onclick; + self.getMapPosition = getMapPosition; + self.getPosByGeo = getPosByGeo; + self.getGeoByPos = getGeoByPos; + //self.appendShape = appendShape; init(option, component); } @@ -32052,7 +33385,7 @@ define( * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -define('echarts/chart/line',['require','../component/base','./calculableBase','../config','../util/ecData','zrender/tool/color','zrender/shape','zrender/shape','../util/shape/halfSmoothPolygon','../chart'],function(require) { +define('echarts/chart/line',['require','../component/base','./calculableBase','../config','zrender/tool/color','zrender/shape','zrender/shape','../util/shape/halfSmoothPolygon','../chart'],function(require) { /** * 构造函数 * @param {Object} messageCenter echart消息中心 @@ -32069,7 +33402,6 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. CalculableBase.call(this, zr, option); var ecConfig = require('../config'); - var ecData = require('../util/ecData'); var zrColor = require('zrender/tool/color'); @@ -32163,6 +33495,13 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. _buildVertical(maxDataLength, locationMap); break; } + for (var i = 0, l = seriesArray.length; i < l; i++) { + self.buildMark( + series[seriesArray[i]], + seriesArray[i], + component + ); + } } /** @@ -32187,7 +33526,7 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. _sIndex2ShapeMap[seriesArray[i]] = _sIndex2ShapeMap[seriesArray[i]] - || self.deepQuery([serie],'symbol') + || self.query(serie,'symbol') || _symbol[i % _symbol.length]; if (legend){ @@ -32503,7 +33842,6 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. var lineType; var lineColor; var normalColor; - var emphasisColor; // 填充相关 var isFill; @@ -32524,28 +33862,25 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. if (serie.type == self.type && typeof seriesPL != 'undefined') { defaultColor = _sIndex2ColorMap[seriesIndex]; // 多级控制 - lineWidth = self.deepQuery( - [serie], 'itemStyle.normal.lineStyle.width' - ); - lineType = self.deepQuery( - [serie], 'itemStyle.normal.lineStyle.type' + lineWidth = self.query( + serie, 'itemStyle.normal.lineStyle.width' ); - lineColor = self.deepQuery( - [serie], 'itemStyle.normal.lineStyle.color' + lineType = self.query( + serie, 'itemStyle.normal.lineStyle.type' ); - normalColor = self.deepQuery( - [serie], 'itemStyle.normal.color' + lineColor = self.query( + serie, 'itemStyle.normal.lineStyle.color' ); - emphasisColor = self.deepQuery( - [serie], 'itemStyle.emphasis.color' + normalColor = self.query( + serie, 'itemStyle.normal.color' ); - isFill = typeof self.deepQuery( - [serie], 'itemStyle.normal.areaStyle' + isFill = typeof self.query( + serie, 'itemStyle.normal.areaStyle' ) != 'undefined'; - fillNormalColor = self.deepQuery( - [serie], 'itemStyle.normal.areaStyle.color' + fillNormalColor = self.query( + serie, 'itemStyle.normal.areaStyle.color' ); for (var i = 0, l = seriesPL.length; i < l; i++) { @@ -32571,19 +33906,6 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. singlePL[j][3], // name singlePL[j][0], // x singlePL[j][1], // y - self.deepQuery( - [data], 'itemStyle.normal.color' - ) || normalColor - || defaultColor, - self.deepQuery( - [data], 'itemStyle.emphasis.color' - ) || emphasisColor - || normalColor - || defaultColor, - lineWidth, - self.deepQuery( - [data, serie], 'symbolRotate' - ), orient )); } @@ -32601,20 +33923,20 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. lineWidth : lineWidth, lineType : lineType, smooth : _getSmooth(serie.smooth), - shadowColor : self.deepQuery( - [serie], + shadowColor : self.query( + serie, 'itemStyle.normal.lineStyle.shadowColor' ), - shadowBlur: self.deepQuery( - [serie], + shadowBlur: self.query( + serie, 'itemStyle.normal.lineStyle.shadowBlur' ), - shadowOffsetX: self.deepQuery( - [serie], + shadowOffsetX: self.query( + serie, 'itemStyle.normal.lineStyle.shadowOffsetX' ), - shadowOffsetY: self.deepQuery( - [serie], + shadowOffsetY: self.query( + serie, 'itemStyle.normal.lineStyle.shadowOffsetY' ) }, @@ -32685,18 +34007,14 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. var itemShape = _getSymbol( seriesIndex, dataIndex, name, - x, y, - color, - _sIndex2ColorMap[seriesIndex], - 2, - 0, - orient + x, y, orient ); - + itemShape.style.color = color; + itemShape.style.strokeColor = color; + itemShape.rotation = [0,0]; itemShape.hoverable = false; itemShape.draggable = false; itemShape.style.text = undefined; - //itemShape.highlightStyle.lineWidth = 20; return itemShape; } @@ -32704,99 +34022,46 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. /** * 生成折线图上的拐点图形 */ - function _getSymbol( - seriesIndex, dataIndex, name, x, y, - normalColor, emphasisColor, lineWidth, rotate, orient - ) { + function _getSymbol(seriesIndex, dataIndex, name, x, y, orient) { var serie = series[seriesIndex]; var data = serie.data[dataIndex]; - var symbol = self.deepQuery([data], 'symbol') - || _sIndex2ShapeMap[seriesIndex] - || 'cricle'; - var symbolSize = self.deepQuery([data, serie],'symbolSize'); - - var itemShape = { - shape : 'icon', - zlevel : _zlevelBase + 1, - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') ? '#fff' : normalColor, - strokeColor : normalColor, - lineWidth: lineWidth * 2 - }, - highlightStyle : { - color : symbol.match('empty') ? '#fff' : emphasisColor, - strokeColor : emphasisColor, - lineWidth: lineWidth * 2 + 2 - }, - clickable : true - }; - - if (symbol.match('image')) { - itemShape.style.image = - symbol.replace(new RegExp('^image:\\/\\/'), ''); - itemShape.shape = 'image'; - } - - if (typeof rotate != 'undefined') { - itemShape.rotation = [ - rotate * Math.PI / 180, x, y - ]; - } - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; - } + var itemShape = self.getSymbolShape( + serie, seriesIndex, data, dataIndex, name, + x, y, + _sIndex2ShapeMap[seriesIndex], + _sIndex2ColorMap[seriesIndex], + '#fff', + orient == 'vertical' ? 'horizontal' : 'vertical' // 翻转 + ); + itemShape.zlevel = _zlevelBase + 1; - if (symbol == 'none') { - itemShape.invisible = true; - itemShape.hoverable = false; - } - if (self.deepQuery([data, serie, option], 'calculable')) { self.setCalculable(itemShape); itemShape.draggable = true; } - - itemShape = self.addLabel( - itemShape, - series[seriesIndex], - series[seriesIndex].data[dataIndex], - name, - orient == 'vertical' ? 'horizontal' : 'vertical' - ); - if (symbol.match('empty')) { - if (typeof itemShape.style.textColor == 'undefined') { - itemShape.style.textColor = itemShape.style.strokeColor; - } - if (typeof itemShape.highlightStyle.textColor == 'undefined') { - itemShape.highlightStyle.textColor = - itemShape.highlightStyle.strokeColor; - } - } - ecData.pack( - itemShape, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - name - ); - - itemShape._x = x; - itemShape._y = y; - itemShape._dataIndex = dataIndex; - itemShape._seriesIndex = seriesIndex; - return itemShape; } + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' + && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' + && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } + /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * @param {Object} newSeries @@ -32824,62 +34089,22 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. var dataIndex = param.dataIndex; var seriesPL; var singlePL; - var serie; - var queryTarget; - - var lineWidth; - var normalColor; - var emphasisColor; - var defaultColor; - var len = seriesIndex.length; while (len--) { seriesPL = finalPLMap[seriesIndex[len]]; if (seriesPL) { - serie = series[seriesIndex[len]]; - queryTarget = [serie]; - defaultColor = _sIndex2ColorMap[seriesIndex[len]]; - // 多级控制 - lineWidth = self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - ); - normalColor = self.deepQuery( - queryTarget, 'itemStyle.normal.color' - ); - emphasisColor = self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ); - var shape; - var data; for (var i = 0, l = seriesPL.length; i < l; i++) { singlePL = seriesPL[i]; for (var j = 0, k = singlePL.length; j < k; j++) { if (dataIndex == singlePL[j][2]) { - data = serie.data[singlePL[j][2]]; - shape = _getSymbol( - seriesIndex[len], - singlePL[j][2], // dataIndex - singlePL[j][3], // name - singlePL[j][0], // x - singlePL[j][1], // y - self.deepQuery( - [data], 'itemStyle.normal.color' - ) || normalColor - || defaultColor, - self.deepQuery( - [data], 'itemStyle.emphasis.color' - ) || emphasisColor - || normalColor - || defaultColor, - lineWidth, - self.deepQuery( - [data, serie], 'symbolRotate' - ), + tipShape.push(_getSymbol( + seriesIndex[len], // seriesIndex + singlePL[j][2], // dataIndex + singlePL[j][3], // name + singlePL[j][0], // x + singlePL[j][1], // y 'horizontal' - ); - //console.log(shape) - //zr.addHoverShape(shape); - tipShape.push(shape); + )); } } } @@ -32993,8 +34218,8 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var serie; @@ -33026,40 +34251,28 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. } zr.animate(self.shapeList[i].id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 100, {scale : [1, 1, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } - else { - x = self.shapeList[i]._x || 0; - y = self.shapeList[i]._y || 0; - zr.modShape( - self.shapeList[i].id, - { - scale : [0, 0, x, y] - }, - true - ); - zr.animate(self.shapeList[i].id, '') - .when( - duration, - {scale : [1, 1, x, y]} - ) - .start('QuinticOut'); - } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.ontooltipHover = ontooltipHover; self.addDataAnimation = addDataAnimation; - self.animation = animation; init(option, component); } @@ -33221,11 +34434,11 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. switch (position) { case 'bottom' : case 'top' : - _buildHorizontal(maxDataLength, locationMap); + _buildHorizontal(maxDataLength, locationMap, seriesArray); break; case 'left' : case 'right' : - _buildVertical(maxDataLength, locationMap); + _buildVertical(maxDataLength, locationMap, seriesArray); break; } } @@ -33313,7 +34526,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. /** * 构建类目轴为水平方向的柱形图系列 */ - function _buildHorizontal(maxDataLength, locationMap) { + function _buildHorizontal(maxDataLength, locationMap, seriesArray) { // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; @@ -33330,6 +34543,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. var barMinHeightMap = size.barMinHeightMap; var barHeight; + var xMarkMap = {}; // 为标注记录一个横向偏移 var x; var y; var lastYP; // 正向堆叠处理 @@ -33408,6 +34622,10 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. barHeight, 'vertical' ); + + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {}; + xMarkMap[seriesIndex][i] = + x + (barWidthMap[seriesIndex] || barWidth) / 2; self.shapeList.push(barShape); } @@ -33456,12 +34674,13 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. x += ((barWidthMap[seriesIndex] || barWidth) + barGap); } } + _buildMark(seriesArray, xMarkMap, true); } /** * 构建类目轴为垂直方向的柱形图系列 */ - function _buildVertical(maxDataLength, locationMap) { + function _buildVertical(maxDataLength, locationMap, seriesArray) { // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; @@ -33478,6 +34697,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. var barMinHeightMap = size.barMinHeightMap; var barHeight; + var xMarkMap = {}; // 为标注记录一个横向偏移 var x; var y; var lastXP; // 正向堆叠处理 @@ -33556,6 +34776,10 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. barWidthMap[seriesIndex] || barWidth, 'horizontal' ); + + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {}; + xMarkMap[seriesIndex][i] = + y - (barWidthMap[seriesIndex] || barWidth) / 2; self.shapeList.push(barShape); } @@ -33606,6 +34830,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. y -= ((barWidthMap[seriesIndex] || barWidth) + barGap); } } + _buildMark(seriesArray, xMarkMap, false); } /** * 我真是自找麻烦啊,为啥要允许系列级个性化最小宽度和高度啊!!! @@ -33840,6 +35065,52 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. return barShape; } + // 添加标注 + function _buildMark(seriesArray, xMarkMap ,isHorizontal) { + for (var i = 0, l = seriesArray.length; i < l; i++) { + self.buildMark( + series[seriesArray[i]], + seriesArray[i], + component, + { + isHorizontal : isHorizontal, + xMarkMap : xMarkMap + } + ); + } + } + + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData, markCoordParams) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + var dataIndex; + var pos; + if (markCoordParams.isHorizontal) { + // 横向 + dataIndex = typeof mpData.xAxis == 'string' + && xAxis.getIndexByName + ? xAxis.getIndexByName(mpData.xAxis) + : (mpData.xAxis || 0); + pos = [ + markCoordParams.xMarkMap[seriesIndex][dataIndex], + yAxis.getCoord(mpData.yAxis || 0) + ]; + } + else { + // 纵向 + dataIndex = typeof mpData.xAxis == 'string' + && xAxis.getIndexByName + ? xAxis.getIndexByName(mpData.xAxis) + : (mpData.xAxis || 0); + pos = [ + xAxis.getCoord(mpData.xAxis || 0), + markCoordParams.xMarkMap[seriesIndex][dataIndex] + ]; + } + return pos; + } + /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * @param {Object} newSeries @@ -34041,12 +35312,17 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. } } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.addDataAnimation = addDataAnimation; - self.animation = animation; init(option, component); } @@ -34097,6 +35373,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. var _selected = {}; function _buildShape() { + var legend = component.legend; self.selectedMap = {}; _selected = {}; var center; @@ -34104,9 +35381,18 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. var pieCase; // 饼图箱子 _selectedMode = false; + var serieName; for (var i = 0, l = series.length; i < l; i++) { if (series[i].type == ecConfig.CHART_TYPE_PIE) { series[i] = self.reformOption(series[i]); + serieName = series[i].name || ''; + // 系列图例开关 + self.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + if (!self.selectedMap[serieName]) { + continue; + } + center = self.parseCenter(series[i].center); radius = self.parseRadius(series[i].radius); _selectedMode = _selectedMode || series[i].selectedMode; @@ -34132,6 +35418,11 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. self.shapeList.push(pieCase); } _buildSinglePie(i); + self.buildMark( + series[i], + i, + component + ); } } @@ -34287,16 +35578,17 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. ) { var serie = series[seriesIndex]; var data = serie.data[dataIndex]; + var queryTarget = [data, serie]; var center = self.parseCenter(serie.center); // 多级控制 var normalColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.color' ) || defaultColor; var emphasisColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.color' ); @@ -34336,7 +35628,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. sector.style._hasSelected = true; sector.style._x = sector.style.x; sector.style._y = sector.style.y; - var offset = self.deepQuery([serie], 'selectedOffset'); + var offset = self.query(serie, 'selectedOffset'); sector.style.x += zrMath.cos(midAngle, true) * offset; sector.style.y -= zrMath.sin(midAngle, true) * offset; @@ -34358,7 +35650,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. if (_needLabel(serie, data, false) && self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.position' ) == 'inner' ) { @@ -34367,15 +35659,15 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. ); sector.style.textPosition = 'specific'; sector.style.textColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.textStyle.color' ) || '#fff'; sector.style.textAlign = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.textStyle.align' ) || 'center'; - sector.style.textBaseLine = self.deepQuery( - [data, serie], + sector.style.textBaseline = self.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle.baseline' ) || 'middle'; sector.style.textX = Math.round( @@ -34389,14 +35681,14 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. * zrMath.sin((startAngle + endAngle) / 2, true) ); sector.style.textFont = self.getFont(self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.textStyle' )); } if (_needLabel(serie, data, true) && self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.position' ) == 'inner' ) { @@ -34405,15 +35697,15 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. ); sector.highlightStyle.textPosition = 'specific'; sector.highlightStyle.textColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.textStyle.color' ) || '#fff'; sector.highlightStyle.textAlign = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.textStyle.align' ) || 'center'; - sector.highlightStyle.textBaseLine = self.deepQuery( - [data, serie], + sector.highlightStyle.textBaseline = self.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle.baseline' ) || 'middle'; sector.highlightStyle.textX = Math.round( @@ -34427,7 +35719,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. * zrMath.sin((startAngle + endAngle) / 2, true) ); sector.highlightStyle.textFont = self.getFont(self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.textStyle' )); } @@ -34673,6 +35965,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. +'.labelLine.show' ); } + /** * 参数修正&默认值赋值,重载基类方法 * @param {Object} opt 参数 @@ -34930,8 +36223,8 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var r0; @@ -34965,7 +36258,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. dataIndex = ecData.get(self.shapeList[i], 'dataIndex'); zr.animate(self.shapeList[i].id, 'style') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 10, { @@ -34976,16 +36269,16 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. .start('QuinticOut'); zr.animate(self.shapeList[i].id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 100, {rotation : [0, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } - else { + else if (!self.shapeList[i]._mark){ dataIndex = self.shapeList[i]._dataIndex; zr.modShape( self.shapeList[i].id, @@ -35002,6 +36295,8 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. .start('QuinticOut'); } } + + self.animationMark(duration, easing); } function onclick(param) { @@ -35028,8 +36323,8 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. _selected[seriesIndex][dataIndex] = true; target.style._x = target.style.x; target.style._y = target.style.y; - offset = self.deepQuery( - [series[seriesIndex]], + offset = self.query( + series[seriesIndex], 'selectedOffset' ); target.style.x += zrMath.cos(midAngle, true) @@ -35198,12 +36493,12 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. }; self.reformOption = reformOption; // 重载基类方法 + self.animation = animation; // 接口方法 self.init = init; self.refresh = refresh; self.addDataAnimation = addDataAnimation; - self.animation = animation; self.onclick = onclick; self.ondrop = ondrop; self.ondragend = ondragend; diff --git a/build/echarts-original.js b/build/echarts-original.js index ede16a0509..34d9bb09af 100644 --- a/build/echarts-original.js +++ b/build/echarts-original.js @@ -89,8 +89,8 @@ define('echarts/config',[],function() { // 接受数组分别设定上右下左边距,同css itemGap: 10, // 各个item之间的间隔,单位px,默认为10, // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemWidth: 20, // 图例图形宽度,非标准参数 - itemHeight: 14, // 图例图形高度,非标准参数 + itemWidth: 20, // 图例图形宽度 + itemHeight: 14, // 图例图形高度 textStyle: { color: '#333' // 图例文字颜色 }, @@ -149,7 +149,7 @@ define('echarts/config',[],function() { // 接受数组分别设定上右下左边距,同css itemGap: 10, // 各个item之间的间隔,单位px,默认为10, // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemSize: 16, // 工具箱图形宽度,非标准参数 + itemSize: 16, // 工具箱图形宽度 feature : { //mark : true, //dataZoom : true, @@ -179,7 +179,7 @@ define('echarts/config',[],function() { showContent: true, // tooltip主体内容 trigger: 'item', // 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis' // formatter: null // 内容格式器:{string}(Template) ¦ {Function} - islandFormatter: '{a}
{b} : {c}', // 数据孤岛内容格式器,非标准参数 + islandFormatter: '{a}
{b} : {c}', // 数据孤岛内容格式器 showDelay: 20, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms hideDelay: 100, // 隐藏延迟,单位ms transitionDuration : 0.4, // 动画变换时间,单位s @@ -436,7 +436,7 @@ define('echarts/config',[],function() { label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, @@ -453,7 +453,7 @@ define('echarts/config',[],function() { label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -461,8 +461,8 @@ define('echarts/config',[],function() { } }, //smooth : false, - //symbol: null, // 拐点图形类型,非标准参数 - symbolSize: 2, // 可计算特性参数,空数据拖拽提示图形大小 + //symbol: null, // 拐点图形类型 + symbolSize: 2, // 拐点图形大小 //symbolRotate : null, // 拐点图形旋转控制 showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) }, @@ -493,13 +493,14 @@ define('echarts/config',[],function() { scatter: { xAxisIndex: 0, yAxisIndex: 0, - //symbol: null, // 图形类型,非标准参数 + //symbol: null, // 图形类型 symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 //symbolRotate : null, // 拐点图形旋转控制 large: false, // 大规模散点图 largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 itemStyle: { normal: { + // color: 各异, label: { show: false, // 标签文本格式器,同Tooltip.formatter,不支持回调 @@ -511,7 +512,7 @@ define('echarts/config',[],function() { return c[0] + ' , ' + c[1]; } } - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -528,7 +529,7 @@ define('echarts/config',[],function() { return c[0] + ' , ' + c[1]; } } - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -542,16 +543,22 @@ define('echarts/config',[],function() { itemStyle: { normal: { // color: 各异, + label: { + show: false + }, lineStyle: { width: 2, type: 'solid' } }, emphasis: { + label: { + show: false + } // color: 各异, } }, - //symbol: null, // 拐点图形类型,非标准参数 + //symbol: null, // 拐点图形类型 symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 }, @@ -566,6 +573,7 @@ define('echarts/config',[],function() { // roseType : null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) itemStyle: { normal: { + // color: 各异, label: { show: true, position: 'outer' @@ -584,14 +592,14 @@ define('echarts/config',[],function() { }, emphasis: { label: { - show: false, - position: 'outer' + show: false + // position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, labelLine: { show: false, - length: 40, + length: 30, lineStyle: { // color: 各异, width: 1, @@ -613,6 +621,7 @@ define('echarts/config',[],function() { // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: // 'sum' | 'average' | 'max' | 'min' // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + hoverable: true, // roam : false, // 是否开启缩放及漫游模式 itemStyle: { normal: { @@ -754,6 +763,80 @@ define('echarts/config',[],function() { r: 15, calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% }, + + markPoint : { + symbol: 'pin', // 标注类型 + symbolSize: 10, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + //symbolRotate : null,// 标注旋转控制 + itemStyle: { + normal: { + // color: 各异, + // borderColor: 各异, // 标注边线颜色,优先于color + borderWidth: 2, // 标注边线线宽,单位px,默认为1 + label: { + show: true, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + position: 'inside' // 可选为'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + label: { + show: true + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + // position: 'inside' // 'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } + }, + + markLine : { + // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string + symbol: ['circle', 'arrow'], + // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + symbolSize: [2, 4], + // 标线起始和结束的symbol旋转控制 + //symbolRotate : null, + itemStyle: { + normal: { + // color: 各异, // 标线主色,线色,symbol主色 + // borderColor: 随color, // 标线symbol边框颜色,优先于color + borderWidth: 2, // 标线symbol边框线宽,单位px,默认为2 + label: { + show: false, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom' + position: 'inside', + textStyle: { // 默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + lineStyle: { + // color: 随borderColor, // 主色,线色,优先级高于borderColor和color + // width: 随borderWidth, // 优先于borderWidth + type: 'solid', + shadowColor : 'rgba(0,0,0,0)', //默认透明 + shadowBlur: 5, + shadowOffsetX: 3, + shadowOffsetY: 3 + } + }, + emphasis: { + label: { + show: false + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + // position: 'inside' // 'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle : {} + } + } + }, textStyle: { decoration: 'none', @@ -767,6 +850,7 @@ define('echarts/config',[],function() { // -------全局通用 REFRESH: 'refresh', RESTORE: 'restore', + RESIZE: 'resize', CLICK: 'click', HOVER: 'hover', MOUSEWHEEL: 'mousewheel', @@ -779,6 +863,7 @@ define('echarts/config',[],function() { PIE_SELECTED: 'pieSelected', MAGIC_TYPE_CHANGED: 'magicTypeChanged', DATA_VIEW_CHANGED: 'dataViewChanged', + MAP_ROAM : 'mapRoam', // -------内部通信 TOOLTIP_HOVER: 'tooltipHover' }, @@ -790,6 +875,7 @@ define('echarts/config',[],function() { nameConnector: ' & ', valueConnector: ' : ', animation: true, + animationThreshold: 2500, // 动画元素阀值,产生的图形原素超过2500不出动画 addDataAnimation: true, // 动态数据接口是否开启动画效果 animationDuration: 2000, animationEasing: 'ExponentialOut' //BounceOut @@ -2929,7 +3015,7 @@ define( * getTextWidth:测算单行文本宽度 */ define( - 'zrender/tool/area',['require','../tool/util'],function(require) { + 'zrender/tool/area',['require','../tool/util','../shape'],function(require) { var util = require('../tool/util'); var _ctx; @@ -3341,6 +3427,9 @@ define( * 路径包含判断,依赖多边形判断 */ function _isInsidePath(area, x, y) { + if (!area.pointList) { + require('../shape').get('path').buildPath(_ctx, area); + } var pointList = area.pointList; var insideCatch = false; for (var i = 0, l = pointList.length; i < l; i++) { @@ -3355,7 +3444,7 @@ define( } /** - * 测算单行文本欢度 + * 测算多行文本宽度 * @param {Object} text * @param {Object} textFont */ @@ -3368,16 +3457,49 @@ define( if (textFont) { _ctx.font = textFont; } - var width = _ctx.measureText(text).width; + + text = (text + '').split('\n'); + var width = 0; + for (var i = 0, l = text.length; i < l; i++) { + width = Math.max( + _ctx.measureText(text[i]).width, + width + ); + } _ctx.restore(); return width; } + + /** + * 测算多行文本高度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextHeight(text, textFont) { + if (!_ctx) { + _ctx = util.getContext(); + } + + _ctx.save(); + if (textFont) { + _ctx.font = textFont; + } + + text = (text + '').split('\n'); + //比较粗暴 + var height = (_ctx.measureText('国').width + 2) * text.length; + + _ctx.restore(); + + return height; + } return { isInside : isInside, isOutside : isOutside, - getTextWidth : getTextWidth + getTextWidth : getTextWidth, + getTextHeight : getTextHeight }; } ); @@ -5059,16 +5181,84 @@ define( } if (typeof tx != 'undefined' && typeof ty != 'undefined') { - if (style.textFont) { - ctx.font = style.textFont; - } - ctx.textAlign = style.textAlign || al; - ctx.textBaseline = style.textBaseLine || bl; - - ctx.fillText(style.text, tx, ty); + _fillText( + ctx, + style.text, + tx, ty, + style.textFont, + style.textAlign || al, + style.textBaseline || bl + ); + } + } + + function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { + if (textFont) { + ctx.font = textFont; + } + ctx.textAlign = textAlign; + ctx.textBaseline = textBaseline; + var rect = _getTextRect( + text, x, y, textFont, textAlign, textBaseline + ); + + text = (text + '').split('\n'); + var lineHeight = area.getTextHeight('国', textFont); + var x = x; + var y; + if (textBaseline == 'top') { + y = rect.y; + } + else if (textBaseline == 'bottom') { + y = rect.y + lineHeight; + } + else { + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + ctx.fillText(text[i], x, y); + y += lineHeight; } } + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { + var width = area.getTextWidth(text, textFont); + var lineHeight = area.getTextHeight('国', textFont); + + text = (text + '').split('\n'); + + var textX = x; //默认start == left + if (textAlign == 'end' || textAlign == 'right') { + textX -= width; + } + else if (textAlign == 'center') { + textX -= (width / 2); + } + + var textY; + if (textBaseline == 'top') { + textY = y; + } + else if (textBaseline == 'bottom') { + textY = y - lineHeight * text.length; + } + else { + // middle + textY = y - lineHeight * text.length / 2; + } + return { + x : textX, + y : textY, + width : width, + height : lineHeight * text.length + }; + } + /** * 根据默认样式扩展高亮样式 * @param ctx Canvas 2D上下文 @@ -5109,7 +5299,9 @@ define( // 可自定义覆盖默认值 for (var k in highlightStyle) { - newStyle[k] = highlightStyle[k]; + if (typeof highlightStyle[k] != 'undefined') { + newStyle[k] = highlightStyle[k]; + } } return newStyle; @@ -6747,6 +6939,8 @@ define( */ define( 'zrender/shape/text',['require','../tool/area','./base','../shape'],function(require) { + var area = require('../tool/area'); + function Text() { this.type = 'text'; } @@ -6766,6 +6960,10 @@ define( style, e.highlightStyle || {} ); } + + if (typeof style.text == 'undefined') { + return; + } ctx.save(); this.setContext(ctx, style); @@ -6781,52 +6979,70 @@ define( ctx.textAlign = style.textAlign || 'start'; ctx.textBaseline = style.textBaseline || 'middle'; - if (style.maxWidth) { - switch (style.brushType) { - case 'fill': - ctx.fillText( - style.text, - style.x, style.y, style.maxWidth - ); - break; - case 'stroke': - ctx.strokeText( - style.text, - style.x, style.y, style.maxWidth - ); - break; - case 'both': - ctx.strokeText( - style.text, - style.x, style.y, style.maxWidth - ); - ctx.fillText( - style.text, - style.x, style.y, style.maxWidth - ); - break; - default: - ctx.fillText( - style.text, - style.x, style.y, style.maxWidth - ); - } + var text = (style.text + '').split('\n'); + var lineHeight = area.getTextHeight('国', style.textFont); + var rect = this.getRect(style); + var x = style.x; + var y; + if (style.textBaseline == 'top') { + y = rect.y; } - else{ - switch (style.brushType) { - case 'fill': - ctx.fillText(style.text, style.x, style.y); - break; - case 'stroke': - ctx.strokeText(style.text, style.x, style.y); - break; - case 'both': - ctx.strokeText(style.text, style.x, style.y); - ctx.fillText(style.text, style.x, style.y); - break; - default: - ctx.fillText(style.text, style.x, style.y); + else if (style.textBaseline == 'bottom') { + y = rect.y + lineHeight; + } + else { + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + if (style.maxWidth) { + switch (style.brushType) { + case 'fill': + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + break; + case 'stroke': + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + break; + case 'both': + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + break; + default: + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + } + } + else{ + switch (style.brushType) { + case 'fill': + ctx.fillText(text[i], x, y); + break; + case 'stroke': + ctx.strokeText(text[i], x, y); + break; + case 'both': + ctx.strokeText(text[i], x, y); + ctx.fillText(text[i], x, y); + break; + default: + ctx.fillText(text[i], x, y); + } } + y += lineHeight; } ctx.restore(); @@ -6838,10 +7054,10 @@ define( * @param {Object} style */ getRect : function(style) { - var area = require('../tool/area'); - - var width = area.getTextWidth(style.text, style.textFont); - var height = area.getTextWidth('国', style.textFont); //比较粗暴 + var width = area.getTextWidth(style.text, style.textFont); + var lineHeight = area.getTextHeight('国', style.textFont); + + var text = (style.text + '').split('\n'); var textX = style.x; //默认start == left if (style.textAlign == 'end' || style.textAlign == 'right') { @@ -6851,19 +7067,23 @@ define( textX -= (width / 2); } - var textY = style.y - height / 2; //默认middle + var textY; if (style.textBaseline == 'top') { - textY += height / 2; + textY = style.y; } else if (style.textBaseline == 'bottom') { - textX -= height / 2; + textY = style.y - lineHeight * text.length; + } + else { + // middle + textY = style.y - lineHeight * text.length / 2; } return { x : textX, y : textY, width : width, - height : height + height : lineHeight * text.length }; } }; @@ -7240,14 +7460,19 @@ define('zrender/shape/path',['require','./base','../shape'],function(require) { 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' ]; + + cs = cs.replace(/-/g, ' -'); cs = cs.replace(/ /g, ' '); cs = cs.replace(/ /g, ','); cs = cs.replace(/,,/g, ','); + + var n; // create pipes so that we can split the data for (n = 0; n < cc.length; n++) { cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); } + // create array var arr = cs.split('|'); var ca = []; @@ -8741,7 +8966,7 @@ define( var Clip = require('./clip'); -var requrestAnimationFrame = window.requrestAnimationFrame +var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame @@ -8778,7 +9003,7 @@ Animation.prototype = { update : function() { var time = new Date().getTime(); - var delta = time - this._time; + //var delta = time - this._time; var clips = this._clips; var len = clips.length; @@ -8830,11 +9055,11 @@ Animation.prototype = { function step() { if (self._running) { self.update(); - requrestAnimationFrame(step); + requestAnimationFrame(step); } } - requrestAnimationFrame(step); + requestAnimationFrame(step); }, stop : function() { this._running = false; @@ -10134,32 +10359,8 @@ define( * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ /** @@ -10191,7 +10392,7 @@ define( var _idx = 0; //ZRender instance's id var _instances = {}; //ZRender实例map索引 - self.version = '1.0.7'; + self.version = '1.0.8'; /** * zrender初始化 @@ -10758,6 +10959,9 @@ define( } else { // 批量删除 + if (shapeId.lenth < 1) { // 空数组 + return; + } for (var i = 0, l = shapeId.length; i < l; i++) { delMap[shapeId[i].id] = true; } @@ -11596,6 +11800,7 @@ define( var _isMouseDown = false; var _isDragging = false; var _lastTouchMoment; + var _lastDownButton; var _lastX = 0; var _lastY = 0; @@ -11699,7 +11904,6 @@ define( //if (_mouseX - _lastX > 1 || _mouseY - _lastY > 1) { _dragStartHandler(); //} - _hasfound = false; storage.iterShape(_findHover, { normal: 'down'}); @@ -11802,11 +12006,18 @@ define( * @param {event} event dom事件对象 */ function _mouseDownHandler(event) { + if (_lastDownButton == 2) { + _lastDownButton = event.button; + _mouseDownTarget = null; + // 仅作为关闭右键菜单使用 + return; + } _event = _zrenderEventFixed(event); _isMouseDown = true; //分发config.EVENT.MOUSEDOWN事件 _mouseDownTarget = _lastHover; _dispatchAgency(_lastHover, config.EVENT.MOUSEDOWN); + _lastDownButton = event.button; } /** @@ -11862,7 +12073,7 @@ define( if (new Date() - _lastTouchMoment < config.EVENT.touchClickDelay ) { - _mobildFindFixed() + _mobildFindFixed(); _clickHandler(_event); } painter.clearHover(); @@ -12323,7 +12534,7 @@ define('zrender', ['zrender/zrender'], function (main) { return main; }); } */ define( - 'echarts/util/shape/icon',['require','zrender/tool/matrix','zrender/shape','zrender/shape','zrender/shape/base','zrender/shape'],function(require) { + 'echarts/util/shape/icon',['require','zrender/tool/matrix','zrender/shape','zrender/shape','zrender/shape','zrender/shape','zrender/shape/base','zrender/shape'],function(require) { var matrix = require('zrender/tool/matrix'); function Icon() { @@ -12347,6 +12558,9 @@ define( diamond : _iconDiamond, arrow : _iconArrow, star : _iconStar, + heart : _iconHeart, + droplet : _iconDroplet, + pin : _iconPin, image : _iconImage }; } @@ -12640,6 +12854,42 @@ define( }); } + function _iconHeart(ctx, style) { + var heart = require('zrender/shape').get('heart'); + heart.buildPath(ctx, { + x : style.x + style.width / 2, + y : style.y + style.height * 0.2, + a : style.width / 2, + b : style.height * 0.8 + }); + } + + function _iconDroplet(ctx, style) { + var droplet = require('zrender/shape').get('droplet'); + droplet.buildPath(ctx, { + x : style.x + style.width * 0.5, + y : style.y + style.height * 0.5, + a : style.width * 0.5, + b : style.height * 0.8 + }); + } + + function _iconPin(ctx, style) { + var x = style.x; + var y = style.y - style.height / 2 * 1.5; + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.arc( + x + width, + y + height, + r, + Math.PI / 5 * 4, + Math.PI / 5 + ); + ctx.lineTo(x + width, y + height + r * 1.5); + } + function _iconImage(ctx, style) { setTimeout(function(){ require('zrender/shape').get('image').brush(ctx, { @@ -12674,9 +12924,12 @@ define( * @param {Object} style */ getRect : function(style) { + // pin比较特殊,让尖端在目标x,y上 return { x : Math.round(style.x), - y : Math.round(style.y), + y : Math.round(style.y - (style.iconType == 'pin' + ? (style.height / 2 * 1.5) : 0) + ), width : style.width, height : style.height }; @@ -12719,8 +12972,8 @@ define( rect = this.getRect(e.style); e.style.__rect = rect; } - // 提高交互体验,包围盒四向扩大5px - var delta = 5; + // 提高交互体验,太小的图形包围盒四向扩大4px + var delta = rect.height < 10 ? 4 : 0; if (x >= rect.x - delta && x <= (rect.x + rect.width + 2 * delta) && y >= rect.y - delta @@ -12749,6 +13002,263 @@ define( return Icon; } ); +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:标线 + */ +define( + 'echarts/util/shape/markLine',['require','zrender/tool/matrix','zrender/shape','zrender/shape','zrender/shape/base','zrender/shape'],function(require) { + var matrix = require('zrender/tool/matrix'); + + function MarkLine() { + this.type = 'markLine'; + } + + MarkLine.prototype = { + /** + * 画刷 + * @param ctx 画布句柄 + * @param e 形状实体 + * @param isHighlight 是否为高亮状态 + * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + brush : function(ctx, e, isHighlight) { + var style = e.style || {}; + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + e.highlightStyle || {} + ); + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + if (e.__needTransform) { + ctx.transform.apply(ctx,this.updateTransform(e)); + } + + ctx.beginPath(); + this.buildLinePath(ctx, style); + ctx.stroke(); + + this.brushSymbol(e, ctx, style, 0); + this.brushSymbol(e, ctx, style, 1); + + if (typeof style.text != 'undefined') { + this.drawText(ctx, style, e.style); + } + + ctx.restore(); + + return; + }, + + /** + * 创建线条路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildLinePath : function(ctx, style) { + //var symbolSize = style.symbolSize; + var xStart = style.xStart; + var xEnd = style.xEnd; + var yStart = style.yStart; + var yEnd = style.yEnd; + /* + if (xStart > xEnd) { + xStart -= symbolSize[0]; + xEnd += symbolSize[1]; + } + else { + xStart += symbolSize[0]; + xEnd -= symbolSize[1]; + } + if (yStart > yEnd) { + yStart -= symbolSize[0]; + yEnd += symbolSize[1]; + } + else { + yStart += symbolSize[0]; + yEnd -= symbolSize[1]; + } + */ + if (!style.lineType || style.lineType == 'solid') { + //默认为实线 + ctx.moveTo(xStart, yStart); + ctx.lineTo(xEnd, yEnd); + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength =(style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + this.dashedLineTo( + ctx, + xStart, yStart, + xEnd, yEnd, + dashLength + ); + } + }, + + /** + * 标线始末标注 + */ + brushSymbol : function(e, ctx, style, idx) { + ctx.save(); + ctx.beginPath(); + + ctx.lineWidth = style.symbolBorder; + ctx.strokeStyle = style.symbolBorderColor; + // symbol + style.iconType = style.symbol[idx].replace('empty', '') + .toLowerCase(); + if (style.symbol[idx].match('empty')) { + ctx.fillStyle = 'rgba(0, 0, 0, 0)'; + } + + // symbolRotate + var x = idx === 0 ? style.xStart : style.xEnd; + var y = idx === 0 ? style.yStart : style.yEnd; + var rotate = typeof style.symbolRotate[idx] != 'undefined' + ? (style.symbolRotate[idx] - 0) : 0; + var transform; + if (rotate !== 0) { + transform = matrix.create(); + matrix.identity(transform); + if (x || y ) { + matrix.translate(transform, transform, [-x, -y]); + } + matrix.rotate( + transform, transform, + rotate * Math.PI / 180 + ); + if (x || y ) { + matrix.translate(transform, transform, [x, y]); + } + ctx.transform.apply(ctx, transform); + } + + if (style.iconType == 'arrow' && rotate === 0) { + // 箭头自动旋转,手动画 + this.buildArrawPath(ctx, style, idx); + } + else { + // symbolSize + var symbolSize = style.symbolSize[idx]; + style.x = x - symbolSize; + style.y = y - symbolSize, + style.width = symbolSize * 2; + style.height = symbolSize * 2; + require('zrender/shape').get('icon').buildPath(ctx, style); + } + + ctx.closePath(); + ctx.stroke(); + ctx.fill(); + ctx.restore(); + }, + + buildArrawPath : function (ctx, style, idx) { + var symbolSize = style.symbolSize[idx]; + var xStart = style.xStart; + var xEnd = style.xEnd; + var yStart = style.yStart; + var yEnd = style.yEnd; + // 原谅我吧,这三角函数实在没想明白,只能这么笨了 + var rotate = Math.atan( + Math.abs((yEnd - yStart) / (xStart - xEnd) + )); + if (idx === 0) { + if (xEnd > xStart) { + if (yEnd > yStart) { + rotate = Math.PI * 2 - rotate; + } + } + else { + if (yEnd > yStart) { + rotate += Math.PI; + } + else { + rotate = Math.PI - rotate; + } + } + } + else { + if (xStart > xEnd) { + if (yStart > yEnd) { + rotate = Math.PI * 2 - rotate; + } + } + else { + if (yStart > yEnd) { + rotate += Math.PI; + } + else { + rotate = Math.PI - rotate; + } + } + } + + var halfRotate = Math.PI / 8; // 夹角 + var x = idx === 0 ? xStart : xEnd; + var y = idx === 0 ? yStart : yEnd; + var point= [ + [ + x + symbolSize * Math.cos(rotate - halfRotate), + y - symbolSize * Math.sin(rotate - halfRotate), + ], + [ + x + symbolSize * 0.6 * Math.cos(rotate), + y - symbolSize * 0.6 * Math.sin(rotate), + ], + [ + x + symbolSize * Math.cos(rotate + halfRotate), + y - symbolSize * Math.sin(rotate + halfRotate), + ] + ]; + ctx.moveTo(x, y); + for (var i = 0, l = point.length; i 1 + ? mlOption.symbol + : [mlOption.symbol[0], mlOption.symbol[0]] + : [mlOption.symbol, mlOption.symbol]; + mlOption.symbolSize = mlOption.symbolSize instanceof Array + ? mlOption.symbolSize.length > 1 + ? mlOption.symbolSize + : [mlOption.symbolSize[0], mlOption.symbolSize[0]] + : [mlOption.symbolSize, mlOption.symbolSize]; + mlOption.symbolRotate = mlOption.symbolRotate instanceof Array + ? mlOption.symbolRotate.length > 1 + ? mlOption.symbolRotate + : [mlOption.symbolRotate[0], mlOption.symbolRotate[0]] + : [mlOption.symbolRotate, mlOption.symbolRotate]; + + mlOption.name = serie.name; + + var pList = []; + var data = mlOption.data; + var itemShape; + + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget; + var nColor; + var eColor; + var zrWidth = self.zr.getWidth(); + var zrHeight = self.zr.getHeight(); + for (var i = 0, l = data.length; i < l; i++) { + // 图例 + if (legend) { + color = legend.getColor(serie.name); + } + // 值域 + if (dataRange) { + value = typeof data[i][0] != 'undefined' + ? (typeof data[i][0].value != 'undefined' + ? data[i][0].value + : data[i][0]) + : '-'; + color = isNaN(value) ? color : dataRange.getColor(value); + + queryTarget = [data[i][0], mlOption]; + nColor = self.deepQuery( + queryTarget, 'itemStyle.normal.color' + ) || color; + eColor = self.deepQuery( + queryTarget, 'itemStyle.emphasis.color' + ) || nColor; + // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark + if (nColor == null && eColor == null) { + continue; + } + } + + // 标准化一些参数 + data[i][0].tooltip = {trigger:'item'}; // tooltip.trigger指定为item + data[i][0].name = typeof data[i][0].name != 'undefined' + ? data[i][0].name : ''; + data[i][1].name = typeof data[i][1].name != 'undefined' + ? data[i][1].name : ''; + data[i][0].value = typeof data[i][0].value != 'undefined' + ? data[i][0].value : ''; + + // 复用getSymbolShape + itemShape = getLineMarkShape( + mlOption, // markLine + data[i], // 数据 + parsePercent(data[i][0].x, zrWidth), // 坐标 + parsePercent(data[i][0].y, zrHeight), // 坐标 + parsePercent(data[i][1].x, zrWidth), // 坐标 + parsePercent(data[i][1].y, zrHeight), // 坐标 + color // 默认symbol和color + ); + + // 重新pack一下数据 + ecData.pack( + itemShape, + serie, seriesIndex, + data[i][0], 0, + data[i][0].name + ' : ' + data[i][1].name + ); + pList.push(itemShape); + } + //console.log(pList); + return pList; + } + + function getMarkCoord() { + // 无转换位置 + return [0, 0]; + } + + function getSymbolShape( + serie, seriesIndex, // 系列 + data, dataIndex, name, // 数据 + x, y, // 坐标 + symbol, color, // 默认symbol和color,来自legend或dataRange全局分配 + emptyColor, // 折线的emptySymbol用白色填充 + orient // 走向,用于默认文字定位 + ) { + var queryTarget = [data, serie]; + var value = typeof data != 'undefined' + ? (typeof data.value != 'undefined' + ? data.value + : data) + : '-'; + + symbol = self.deepQuery(queryTarget, 'symbol') || symbol; + var symbolSize = self.deepQuery(queryTarget, 'symbolSize'); + symbolSize = typeof symbolSize == 'function' + ? symbolSize(value) + : symbolSize; + var symbolRotate = self.deepQuery(queryTarget, 'symbolRotate'); + + var normal = self.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + var emphasis = self.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + var nBorderWidth = typeof normal.borderWidth != 'undefined' + ? normal.borderWidth + : (normal.lineStyle && normal.lineStyle.width * 2); + if (typeof nBorderWidth == 'undefined') { + nBorderWidth = 0; + } + var eBorderWidth = typeof emphasis.borderWidth != 'undefined' + ? emphasis.borderWidth + : (emphasis.lineStyle && emphasis.lineStyle.width * 2); + if (typeof eBorderWidth == 'undefined') { + eBorderWidth = nBorderWidth + 2; + } + + var itemShape = { + shape : 'icon', + style : { + iconType : symbol.replace('empty', '').toLowerCase(), + x : x - symbolSize, + y : y - symbolSize, + width : symbolSize * 2, + height : symbolSize * 2, + brushType : 'both', + color : symbol.match('empty') + ? emptyColor + : (normal.color || color), + strokeColor : normal.borderColor || normal.color || color, + lineWidth: nBorderWidth + }, + highlightStyle : { + color : symbol.match('empty') + ? emptyColor + : (emphasis.color|| normal.color || color), + strokeColor : emphasis.borderColor || normal.borderColor + || emphasis.color || normal.color || color, + lineWidth: eBorderWidth + }, + clickable : true + }; + + if (symbol.match('image')) { + itemShape.style.image = + symbol.replace(new RegExp('^image:\\/\\/'), ''); + itemShape.shape = 'image'; + } + + if (typeof symbolRotate != 'undefined') { + itemShape.rotation = [ + symbolRotate * Math.PI / 180, x, y + ]; + } + + if (symbol.match('star')) { + itemShape.style.iconType = 'star'; + itemShape.style.n = + (symbol.replace('empty', '').replace('star','') - 0) || 5; + } + + if (symbol == 'none') { + itemShape.invisible = true; + itemShape.hoverable = false; + } + + /* + if (self.deepQuery([data, serie, option], 'calculable')) { + self.setCalculable(itemShape); + itemShape.draggable = true; + } + */ + + itemShape = self.addLabel( + itemShape, + serie, data, name, + orient + ); + + if (symbol.match('empty')) { + if (typeof itemShape.style.textColor == 'undefined') { + itemShape.style.textColor = itemShape.style.strokeColor; + } + if (typeof itemShape.highlightStyle.textColor == 'undefined') { + itemShape.highlightStyle.textColor = + itemShape.highlightStyle.strokeColor; + } + } + + ecData.pack( + itemShape, + serie, seriesIndex, + data, dataIndex, + name + ); + + itemShape._mark = 'point'; // 复用animationMark + itemShape._x = x; + itemShape._y = y; + + itemShape._dataIndex = dataIndex; + itemShape._seriesIndex = seriesIndex; + + return itemShape; + } + + function getLineMarkShape( + mlOption, // 系列 + data, // 数据 + xStart, yStart, // 坐标 + xEnd, yEnd, // 坐标 + color // 默认color,来自legend或dataRange全局分配 + ) { + var value0 = typeof data[0] != 'undefined' + ? (typeof data[0].value != 'undefined' + ? data[0].value + : data[0]) + : '-'; + var value1 = typeof data[1] != 'undefined' + ? (typeof data[1].value != 'undefined' + ? data[1].value + : data[1]) + : '-'; + var symbol = [ + self.query(data[0], 'symbol') || mlOption.symbol[0], + self.query(data[1], 'symbol') || mlOption.symbol[1] + ]; + var symbolSize = [ + self.query(data[0], 'symbolSize') || mlOption.symbolSize[0], + self.query(data[1], 'symbolSize') || mlOption.symbolSize[1] + ]; + symbolSize[0] = typeof symbolSize[0] == 'function' + ? symbolSize[0](value0) + : symbolSize[0]; + symbolSize[1] = typeof symbolSize[1] == 'function' + ? symbolSize[1](value1) + : symbolSize[1]; + var symbolRotate = [ + self.query(data[0], 'symbolRotate') || mlOption.symbolRotate[0], + self.query(data[1], 'symbolRotate') || mlOption.symbolRotate[1] + ]; + //console.log(symbol, symbolSize, symbolRotate); + + var queryTarget = [data[0], mlOption]; + var normal = self.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + var emphasis = self.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + + var nlineStyle = normal.lineStyle; + var elineStyle = emphasis.lineStyle; + + var nBorderWidth = nlineStyle.width; + if (typeof nBorderWidth == 'undefined') { + nBorderWidth = normal.borderWidth; + } + var eBorderWidth = elineStyle.width; + if (typeof eBorderWidth == 'undefined') { + if (typeof emphasis.borderWidth != 'undefined') { + eBorderWidth = emphasis.borderWidth; + } + else { + eBorderWidth = nBorderWidth + 2; + } + } + + var itemShape = { + shape : 'markLine', + style : { + symbol : symbol, + symbolSize : symbolSize, + symbolRotate : symbolRotate, + //data : [data[0].name,data[1].name], + xStart : xStart, + yStart : yStart, // 坐标 + xEnd : xEnd, + yEnd : yEnd, // 坐标 + brushType : 'both', + lineType : nlineStyle.type, + shadowColor : nlineStyle.shadowColor, + shadowBlur: nlineStyle.shadowBlur, + shadowOffsetX: nlineStyle.shadowOffsetX, + shadowOffsetY: nlineStyle.shadowOffsetY, + color : normal.color || color, + strokeColor : nlineStyle.color + || normal.borderColor + || color + || normal.color, + lineWidth: nBorderWidth, + symbolBorderColor: normal.borderColor + || color + || normal.color, + symbolBorder: normal.borderWidth * 2 + }, + highlightStyle : { + shadowColor : elineStyle.shadowColor, + shadowBlur: elineStyle.shadowBlur, + shadowOffsetX: elineStyle.shadowOffsetX, + shadowOffsetY: elineStyle.shadowOffsetY, + color : emphasis.color|| normal.color || color, + strokeColor : elineStyle.color + || nlineStyle.color + || emphasis.borderColor + || normal.borderColor + || color + || emphasis.color + || normal.color, + lineWidth: eBorderWidth, + symbolBorderColor: emphasis.borderColor + || normal.borderColor + || color + || emphasis.color + || normal.color, + symbolBorder: typeof emphasis.borderWidth == 'undefined' + ? (normal.borderWidth * 2 + 2) + : (emphasis.borderWidth * 2) + }, + clickable : true + }; + + itemShape = self.addLabel( + itemShape, + mlOption, + data[0], + data[0].name + ' : ' + data[1].name + ); + + itemShape._mark = 'line'; + itemShape._x = xEnd; + itemShape._y = yEnd; + + return itemShape; + } + /** * 百分比计算 */ @@ -13092,6 +14298,63 @@ define('echarts/component/base',['require','../config','zrender/tool/util'],func } return position; } + + /** + * 动画设定 + */ + function animation() { + if (_aniMap[self.type]) { + self.animationMark(ecConfig.animationDuration); + } + } + + function animationMark(duration /*, easing*/) { + var x; + var y; + for (var i = 0, l = self.shapeList.length; i < l; i++) { + if (!self.shapeList[i]._mark) { + continue; + } + x = self.shapeList[i]._x || 0; + y = self.shapeList[i]._y || 0; + if (self.shapeList[i]._mark == 'point') { + zr.modShape( + self.shapeList[i].id, + { + scale : [0, 0, x, y] + }, + true + ); + zr.animate(self.shapeList[i].id, '') + .when( + duration, + {scale : [1, 1, x, y]} + ) + .start('QuinticOut'); + } + else if (self.shapeList[i]._mark == 'line') { + zr.modShape( + self.shapeList[i].id, + { + style : { + xEnd : self.shapeList[i].style.xStart, + yEnd : self.shapeList[i].style.yStart + } + }, + true + ); + zr.animate(self.shapeList[i].id, 'style') + .when( + duration, + { + xEnd : x, + yEnd : y + } + ) + .start('QuinticOut'); + } + } + } function resize() { self.refresh && self.refresh(); @@ -13129,138 +14392,23 @@ define('echarts/component/base',['require','../config','zrender/tool/util'],func self.deepMerge = deepMerge; self.getFont = getFont; self.addLabel = addLabel; + self.buildMark = buildMark; + self.getMarkCoord = getMarkCoord; + self.getSymbolShape = getSymbolShape; self.parsePercent = parsePercent; self.parseCenter = parseCenter; self.parseRadius = parseRadius; self.subPixelOptimize = subPixelOptimize; + self.animation = animation; + self.animationMark = animationMark; + self.resize = resize; self.clear = clear; self.dispose = dispose; - self.resize = resize; } return Base; }); -/** - * echarts通用私有数据服务 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/ecData',[],function() { - /** - * 打包私有数据 - * - * @param {shape} shape 修改目标 - * @param {Object} series - * @param {number} seriesIndex - * @param {number | Object} data - * @param {number} dataIndex - * @param {*=} special - * @param {*=} special2 - */ - function pack( - shape, series, seriesIndex, data, dataIndex, name, special, special2 - ) { - var value; - if (typeof data != 'undefined') { - if (typeof data.value != 'undefined') { - value = data.value; - } - else { - value = data; - } - } - - shape._echartsData = { - '_series' : series, - '_seriesIndex' : seriesIndex, - '_data' : data, - '_dataIndex' : dataIndex, - '_name' : name, - '_value' : value, - '_special' : special, - '_special2' : special2 - }; - return shape._echartsData; - } - - /** - * 从私有数据中获取特定项 - * @param {shape} shape - * @param {string} key - */ - function get(shape, key) { - var data = shape._echartsData; - if (!key) { - return data; - } - - switch (key) { - case 'series' : - return data && data._series; - case 'seriesIndex' : - return data && data._seriesIndex; - case 'data' : - return data && data._data; - case 'dataIndex' : - return data && data._dataIndex; - case 'name' : - return data && data._name; - case 'value' : - return data && data._value; - case 'special' : - return data && data._special; - case 'special2' : - return data && data._special2; - } - - return null; - } - - /** - * 修改私有数据中获取特定项 - * @param {shape} shape - * @param {string} key - * @param {*} value - */ - function set(shape, key, value) { - shape._echartsData = shape._echartsData || {}; - switch (key) { - case 'series' : // 当前系列值 - shape._echartsData._series = value; - break; - case 'seriesIndex' : // 系列数组位置索引 - shape._echartsData._seriesIndex = value; - break; - case 'data' : // 当前数据值 - shape._echartsData._data = value; - break; - case 'dataIndex' : // 数据数组位置索引 - shape._echartsData._dataIndex = value; - break; - case 'name' : - shape._echartsData._name = value; - break; - case 'value' : - shape._echartsData._value = value; - break; - case 'special' : - shape._echartsData._special = value; - break; - case 'special2' : - shape._echartsData._special2 = value; - break; - } - } - - return { - pack : pack, - set : set, - get : get - }; -}); /** * 高精度数学运算 */ @@ -13957,11 +15105,11 @@ define('echarts/component/title',['require','./base','../config','zrender/tool/a zrArea.getTextWidth(text, font), zrArea.getTextWidth(subtext, subfont) ); - var totalHeight = zrArea.getTextWidth('国', font) + var totalHeight = zrArea.getTextHeight(text, font) + (subtext === '' ? 0 : (titleOption.itemGap - + zrArea.getTextWidth('国', subfont)) + + zrArea.getTextHeight(subtext, subfont)) ); var x; @@ -14309,7 +15457,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender // 小标记 function _buildAxisTick() { var axShape; - var data = option.data; + //var data = option.data; var dataLength = option.data.length; var length = option.axisTick.length; var color = option.axisTick.lineStyle.color; @@ -14326,9 +15474,9 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender zlevel : _zlevelBase, hoverable : false, style : { - xStart : getCoord(data[i].value || data[i]), + xStart : getCoordByIndex(i), yStart : yPosition, - xEnd : getCoord(data[i].value || data[i]), + xEnd : getCoordByIndex(i), yEnd : yPosition + length, strokeColor : color, lineWidth : lineWidth @@ -14349,9 +15497,9 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender hoverable : false, style : { xStart : xPosition, - yStart : getCoord(data[i].value || data[i]), + yStart : getCoordByIndex(i), xEnd : xPosition + length, - yEnd : getCoord(data[i].value || data[i]), + yEnd : getCoordByIndex(i), strokeColor : color, lineWidth : lineWidth } @@ -14385,6 +15533,10 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender } for (var i = 0; i < dataLength; i += _interval) { + if ((_labelData[i].value || _labelData[i]) === '') { + // 空文本优化 + continue; + } dataTextStyle = zrUtil.merge( data[i].textStyle || {}, textStyle, @@ -14395,7 +15547,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender zlevel : _zlevelBase, hoverable : false, style : { - x : getCoord(data[i].value || data[i]), + x : getCoordByIndex(i), y : yPosition, color : dataTextStyle.color, text : _labelData[i].value || _labelData[i], @@ -14433,6 +15585,10 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender } for (var i = 0; i < dataLength; i += _interval) { + if ((_labelData[i].value || _labelData[i]) === '') { + // 空文本优化 + continue; + } dataTextStyle = zrUtil.merge( data[i].textStyle || {}, textStyle, @@ -14444,7 +15600,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender hoverable : false, style : { x : xPosition, - y : getCoord(data[i].value || data[i]), + y : getCoordByIndex(i), color : dataTextStyle.color, text : _labelData[i].value || _labelData[i], textFont : self.getFont(dataTextStyle), @@ -14466,7 +15622,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender function _buildSplitLine() { var axShape; - var data = option.data; + //var data = option.data; var dataLength = option.data.length; var lineType = option.splitLine.lineStyle.type; var lineWidth = option.splitLine.lineStyle.width; @@ -14483,7 +15639,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i < dataLength; i += _interval) { // 亚像素优化 x = self.subPixelOptimize( - getCoord(data[i].value || data[i]), lineWidth + getCoordByIndex(i), lineWidth ); axShape = { shape : 'line', @@ -14512,7 +15668,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i < dataLength; i += _interval) { // 亚像素优化 y = self.subPixelOptimize( - getCoord(data[i].value || data[i]), lineWidth + getCoordByIndex(i), lineWidth ); axShape = { shape : 'line', @@ -14538,7 +15694,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender var color = option.splitArea.areaStyle.color; color = color instanceof Array ? color : [color]; var colorLength = color.length; - var data = option.data; + //var data = option.data; var dataLength = option.data.length; if (option.position == 'bottom' || option.position == 'top') { @@ -14550,7 +15706,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i <= dataLength; i += _interval) { curX = i < dataLength - ? getCoord(data[i].value || data[i]) + ? getCoordByIndex(i) : grid.getXend(); axShape = { shape : 'rectangle', @@ -14578,7 +15734,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i <= dataLength; i += _interval) { curY = i < dataLength - ? getCoord(data[i].value || data[i]) + ? getCoordByIndex(i) : grid.getY(); axShape = { shape : 'rectangle', @@ -14735,7 +15891,27 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender // 根据类目轴数据索引换算类目轴名称 function getNameByIndex(dataIndex) { - return option.data[dataIndex]; + if (typeof option.data[dataIndex].value != 'undefined') { + return option.data[dataIndex].value; + } + else { + return option.data[dataIndex]; + } + } + + // 根据类目轴名称换算类目轴数据索引 + function getIndexByName(name) { + var data = option.data; + var dataLength = data.length; + + for (var i = 0; i < dataLength; i++) { + if (data[i] == name + || (typeof data[i].value != 'undefined' + && data[i].value == name) + ) { + return i; + } + } } /** @@ -14757,6 +15933,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender self.getCoord = getCoord; self.getCoordByIndex = getCoordByIndex; self.getNameByIndex = getNameByIndex; + self.getIndexByName = getIndexByName; self.isMainAxis = isMainAxis; self.getPosition = getPosition; @@ -15904,25 +17081,26 @@ define('echarts/component/grid',['require','./base','../config','../component'], option.grid = self.reformOption(option.grid); var gridOption = option.grid; - _x = gridOption.x; - _y = gridOption.y; - var x2 = gridOption.x2; - var y2 = gridOption.y2; _zrWidth = zr.getWidth(); _zrHeight = zr.getHeight(); + _x = self.parsePercent(gridOption.x, _zrWidth); + _y = self.parsePercent(gridOption.y, _zrHeight); + var x2 = self.parsePercent(gridOption.x2, _zrWidth); + var y2 = self.parsePercent(gridOption.y2, _zrHeight); + if (typeof gridOption.width == 'undefined') { _width = _zrWidth - _x - x2; } else { - _width = gridOption.width; + _width = self.parsePercent(gridOption.width, _zrWidth); } if (typeof gridOption.height == 'undefined') { _height = _zrHeight - _y - y2; } else { - _height = gridOption.height; + _height = self.parsePercent(gridOption.height, _zrHeight); } _x = self.subPixelOptimize(_x, gridOption.borderWidth); @@ -16785,11 +17963,13 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen } // console.log(xStart,xEnd,yStart,yEnd); + var value; for (var i = 0, l = data.length; i < l; i++) { - if (data[i][0] >= xStart - && data[i][0] <= xEnd - && data[i][1] >= yStart - && data[i][1] <= yEnd + value = data[i].value || data[i]; + if (value[0] >= xStart + && value[0] <= xEnd + && value[1] >= yStart + && value[1] <= yEnd ) { newData.push(data[i]); } @@ -16901,8 +18081,8 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen var total; var sdx = (rect.x - gridArea.x) / gridArea.width; - var edx = 1- (rect.x + rect.width - gridArea.x) / gridArea.width; - var sdy = 1- (rect.y + rect.height - gridArea.y) / gridArea.height; + var edx = 1 - (rect.x + rect.width - gridArea.x) / gridArea.width; + var sdy = 1 - (rect.y + rect.height - gridArea.y) / gridArea.height; var edy = (rect.y - gridArea.y) / gridArea.height; //console.log('this',sdy,edy,_zoom.start,_zoom.end) if (zoomOption.orient == 'horizontal') { @@ -16959,9 +18139,22 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen } } } + function silence(s) { _isSilence = s; } + + function getRealDataIndex(sIdx, dIdx) { + if (!_originalData) { + return dIdx; + } + var sreies = _originalData.series; + if (sreies[sIdx]) { + return Math.floor(_zoom.start / 100 * sreies[sIdx].length) + + dIdx; + } + return -1; + } function init(newOption) { option = newOption; @@ -16975,8 +18168,8 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen // 自己show 或者 toolbox启用且dataZoom有效 if (option.dataZoom.show || ( - self.deepQuery([option], 'toolbox.show') - && self.deepQuery([option], 'toolbox.feature.dataZoom') + self.query(option, 'toolbox.show') + && self.query(option, 'toolbox.feature.dataZoom') ) ) { _location = _getLocation(); @@ -16998,8 +18191,8 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen // 自己show 或者 toolbox启用且dataZoom有效 if (option.dataZoom.show || ( - self.deepQuery([option], 'toolbox.show') - && self.deepQuery([option], 'toolbox.feature.dataZoom') + self.query(option, 'toolbox.show') + && self.query(option, 'toolbox.feature.dataZoom') ) ) { _location = _getLocation(); @@ -17027,6 +18220,7 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen self.ondragend = ondragend; self.ondataZoom = ondataZoom; self.silence = silence; + self.getRealDataIndex = getRealDataIndex; init(option); } @@ -17469,12 +18663,12 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ break; case 'k' : itemShape.style.brushType = 'both'; - itemShape.style.color = self.deepQuery( - [ecConfig], 'k.itemStyle.normal.color' + itemShape.style.color = self.query( + ecConfig, 'k.itemStyle.normal.color' ) || '#fff'; itemShape.style.strokeColor = color != '#ccc' - ? self.deepQuery( - [ecConfig], 'k.itemStyle.normal.lineStyle.color' + ? self.query( + ecConfig, 'k.itemStyle.normal.lineStyle.color' ) || '#ff3200' : color; } @@ -17492,7 +18686,7 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ } function init(newOption) { - if (!self.deepQuery([newOption], 'legend.data')) { + if (!self.query(newOption, 'legend.data')) { return; } @@ -17524,8 +18718,8 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ _selectedMap[itemName] = false; } else { - color = self.deepQuery( - [serie], 'itemStyle.normal.color' + color = self.query( + serie, 'itemStyle.normal.color' ); if (color && serie.type != ecConfig.CHART_TYPE_K) { setColor(itemName, color); @@ -17647,6 +18841,10 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ return true; } } + + function getSelectedMap() { + return _selectedMap; + } self.init = init; self.refresh = refresh; @@ -17658,6 +18856,7 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ self.getItemShape = getItemShape; self.setItemShape = setItemShape; self.isSelected = isSelected; + self.getSelectedMap = getSelectedMap; init(option); } @@ -17876,7 +19075,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var itemWidth = dataRangeOption.itemWidth; var itemHeight = dataRangeOption.itemHeight; var itemGap = dataRangeOption.itemGap; - var textHeight = zrArea.getTextWidth('国', font); + var textHeight = zrArea.getTextHeight('国', font); var color; if (dataRangeOption.orient == 'vertical' @@ -17903,6 +19102,8 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } else { lastY += textHeight + _textGap; + textShape.style.y += textHeight / 2 + _textGap; + textShape.style.textBaseline = 'bottom'; } self.shapeList.push(textShape); } @@ -17973,6 +19174,11 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to textShape = _getTextShape( lastX, lastY, dataRangeOption.text[1] ); + + if (dataRangeOption.orient != 'horizontal') { + textShape.style.y -= 5; + textShape.style.textBaseline = 'top'; + } self.shapeList.push(textShape); } @@ -17990,7 +19196,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var lastY = _itemGroupLocation.y; var itemWidth = dataRangeOption.itemWidth; var itemHeight = dataRangeOption.itemHeight; - var textHeight = zrArea.getTextWidth('国', font); + var textHeight = zrArea.getTextHeight('国', font); var needValueText = true; @@ -18010,6 +19216,8 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } else { lastY += textHeight + _textGap; + textShape.style.y += textHeight / 2 + _textGap; + textShape.style.textBaseline = 'bottom'; } self.shapeList.push(textShape); } @@ -18108,7 +19316,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var height = _calculableLocation.height; var font = self.getFont(dataRangeOption.textStyle); - var textHieght = zrArea.getTextWidth('国', font) + 2; + var textHeight = zrArea.getTextHeight('国', font); var textWidth = Math.max( zrArea.getTextWidth( dataRangeOption.precision === 0 @@ -18139,23 +19347,23 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to // 手柄统统在下方 pointListStart = [ [x, y], - [x, y + height + textHieght / 2 * 3], - [x - textWidth, y + height + textHieght / 2 * 3], - [x - textWidth, y + height + textHieght / 2], - [x - textHieght / 2, y + height + textHieght / 2], + [x, y + height + textHeight / 2 * 3], + [x - textWidth, y + height + textHeight / 2 * 3], + [x - textWidth, y + height + textHeight / 2], + [x - textHeight / 2, y + height + textHeight / 2], [x - 1, y + height], [x - 1, y] ]; textXStart = x - textWidth / 2; - textYStart = y + height + textHieght; + textYStart = y + height + textHeight; pointListEnd = [ [x + width, y], - [x + width, y + height + textHieght / 2 * 3], - [x + width + textWidth, y + height + textHieght/2*3], - [x + width + textWidth, y + height + textHieght / 2], - [x + width + textHieght / 2, y + height + textHieght/2], + [x + width, y + height + textHeight / 2 * 3], + [x + width + textWidth, y + height + textHeight/2*3], + [x + width + textWidth, y + height + textHeight / 2], + [x + width + textHeight / 2, y + height + textHeight/2], [x + width + 1, y + height], [x + width + 1, y] ]; @@ -18166,23 +19374,23 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to // 手柄在上方 pointListStart = [ [x, y + height], - [x, y - textHieght / 2 * 3], - [x - textWidth, y - textHieght / 2 * 3], - [x - textWidth, y - textHieght / 2], - [x - textHieght / 2, y - textHieght / 2], + [x, y - textHeight / 2 * 3], + [x - textWidth, y - textHeight / 2 * 3], + [x - textWidth, y - textHeight / 2], + [x - textHeight / 2, y - textHeight / 2], [x - 1, y], [x - 1, y + height] ]; textXStart = x - textWidth / 2; - textYStart = y - textHieght; + textYStart = y - textHeight; pointListEnd = [ [x + width, y + height], - [x + width, y - textHieght / 2 * 3], - [x + width + textWidth, y - textHieght / 2 * 3], - [x + width + textWidth, y - textHieght / 2], - [x + width + textHieght / 2, y - textHieght / 2], + [x + width, y - textHeight / 2 * 3], + [x + width + textWidth, y - textHeight / 2 * 3], + [x + width + textWidth, y - textHeight / 2], + [x + width + textHeight / 2, y - textHeight / 2], [x + width + 1, y], [x + width + 1, y + height] ]; @@ -18191,55 +19399,54 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } } else { - textWidth += textHieght; + textWidth += textHeight; // 垂直 if (dataRangeOption.x != 'right') { // 手柄统统在右侧 pointListStart = [ [x, y], [x + width + textWidth, y], - [x + width + textWidth, y - textHieght], - [x + width + textHieght, y - textHieght], + [x + width + textWidth, y - textHeight], + [x + width + textHeight, y - textHeight], [x + width, y - 1], [x, y - 1] ]; - textXStart = x + width + textWidth / 2 + textHieght / 2; - textYStart = y - textHieght / 2; - + textXStart = x + width + textWidth / 2 + textHeight / 2; + textYStart = y - textHeight / 2; pointListEnd = [ [x, y + height], [x + width + textWidth, y + height], - [x + width + textWidth, y + textHieght + height], - [x + width + textHieght, y + textHieght + height], + [x + width + textWidth, y + textHeight + height], + [x + width + textHeight, y + textHeight + height], [x + width, y + 1 + height], [x, y + height + 1] ]; textXEnd = textXStart; - textYEnd = y + height + textHieght / 2; + textYEnd = y + height + textHeight / 2; } else { // 手柄在左侧 pointListStart = [ [x + width, y], [x - textWidth, y], - [x - textWidth, y - textHieght], - [x - textHieght, y - textHieght], + [x - textWidth, y - textHeight], + [x - textHeight, y - textHeight], [x, y - 1], [x + width, y - 1] ]; - textXStart = x - textWidth / 2 - textHieght / 2; - textYStart = y - textHieght / 2; + textXStart = x - textWidth / 2 - textHeight / 2; + textYStart = y - textHeight / 2; pointListEnd = [ [x + width, y + height], [x - textWidth, y + height], - [x - textWidth, y + textHieght + height], - [x - textHieght, y + textHieght + height], + [x - textWidth, y + textHeight + height], + [x - textHeight, y + textHeight + height], [x, y + 1 + height], [x + width, y + height + 1] ]; textXEnd = textXStart; - textYEnd = y + height + textHieght / 2; + textYEnd = y + height + textHeight / 2; } } @@ -18253,7 +19460,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to textY : textYStart, textPosition : 'specific', textAlign : 'center', - textBaseline : 'middle ', + textBaseline : 'middle', textColor: dataRangeOption.textStyle.color, color : getColor(dataRangeOption.max), width : 0, // for ondrif计算统一 @@ -18278,7 +19485,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to textY : textYEnd, textPosition : 'specific', textAlign : 'center', - textBaseline : 'middle ', + textBaseline : 'middle', textColor: dataRangeOption.textStyle.color, color : getColor(dataRangeOption.min), width : 0, // for ondrif计算统一 @@ -18371,7 +19578,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var totalWidth = 0; var totalHeight = 0; var font = self.getFont(dataRangeOption.textStyle); - var textHeight = zrArea.getTextWidth('国', font); + var textHeight = zrArea.getTextHeight('国', font); if (dataRangeOption.orient == 'horizontal') { // 水平布局,计算总宽度 @@ -18487,7 +19694,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to - dataRangeOption.borderWidth; break; default : - x = dataRangeOption.x - 0; + x = self.parsePercent(dataRangeOption.x, zrWidth); x = isNaN(x) ? 0 : x; break; } @@ -18509,7 +19716,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to y = Math.floor((zrHeight - totalHeight) / 2); break; default : - y = dataRangeOption.y - 0; + y = self.parsePercent(dataRangeOption.y, zrHeight); y = isNaN(y) ? 0 : y; break; } @@ -18882,9 +20089,9 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } function init(newOption) { - if (typeof self.deepQuery([newOption], 'dataRange.min') + if (typeof self.query(newOption, 'dataRange.min') == 'undefined' - || typeof self.deepQuery([newOption], 'dataRange.max') + || typeof self.query(newOption, 'dataRange.max') == 'undefined' ) { return; @@ -19072,6 +20279,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa var yAxis; var polar; + var _selectedMap = {}; // tooltip dom & css var _tDom = document.createElement('div'); // 通用样式 @@ -19506,21 +20714,24 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 categoryAxis = xAxis.getAxis(xAxisIndex); for (var i = 0, l = series.length; i < l; i++) { + if (!_isSelected(series[i].name)) { + continue; + } if (series[i].xAxisIndex == xAxisIndex && self.deepQuery( [series[i], option], 'tooltip.trigger' ) == 'axis' ) { - showContent = self.deepQuery( - [series[i]], + showContent = self.query( + series[i], 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [series[i]], + formatter = self.query( + series[i], 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [series[i]], 'tooltip' + specialCssText += _style(self.query( + series[i], 'tooltip' )); seriesArray.push(series[i]); seriesIndex.push(i); @@ -19532,7 +20743,12 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa _event, { seriesIndex : seriesIndex, - dataIndex : dataIndex + dataIndex : component.dataZoom + ? component.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex } ); y = zrEvent.getY(_event) + 10; @@ -19552,21 +20768,24 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 categoryAxis = yAxis.getAxis(yAxisIndex); for (var i = 0, l = series.length; i < l; i++) { + if (!_isSelected(series[i].name)) { + continue; + } if (series[i].yAxisIndex == yAxisIndex && self.deepQuery( [series[i], option], 'tooltip.trigger' ) == 'axis' ) { - showContent = self.deepQuery( - [series[i]], + showContent = self.query( + series[i], 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [series[i]], + formatter = self.query( + series[i], 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [series[i]], 'tooltip' + specialCssText += _style(self.query( + series[i], 'tooltip' )); seriesArray.push(series[i]); seriesIndex.push(i); @@ -19578,7 +20797,12 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa _event, { seriesIndex : seriesIndex, - dataIndex : dataIndex + dataIndex : component.dataZoom + ? component.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex } ); x = zrEvent.getX(_event) + 10; @@ -19701,24 +20925,29 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa } formatter = option.tooltip.formatter; } + var indicatorName = + option.polar[polarIndex].indicator[dataIndex].text; // 找到所有用这个极坐标并且axis触发的系列数据 for (var i = 0, l = series.length; i < l; i++) { + if (!_isSelected(series[i].name)) { + continue; + } if (series[i].polarIndex == polarIndex && self.deepQuery( [series[i], option], 'tooltip.trigger' ) == 'axis' ) { - showContent = self.deepQuery( - [series[i]], + showContent = self.query( + series[i], 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [series[i]], + formatter = self.query( + series[i], 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [series[i]], 'tooltip' + specialCssText += _style(self.query( + series[i], 'tooltip' )); seriesArray.push(series[i]); } @@ -19727,13 +20956,14 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa var polarData; var data; var params = []; - var indicatorName = - option.polar[polarIndex].indicator[dataIndex].text; for (var i = 0, l = seriesArray.length; i < l; i++) { polarData = seriesArray[i].data; for (var j = 0, k = polarData.length; j < k; j++) { data = polarData[j]; + if (!_isSelected(data.name)) { + continue; + } data = typeof data != 'undefined' ? data : {name:'', value: {dataIndex:'-'}}; @@ -19832,25 +21062,25 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa formatter = option.tooltip.formatter; } // 系列 - if (self.deepQuery([serie], 'tooltip.trigger') == 'item') { - showContent = self.deepQuery( - [serie], 'tooltip.showContent' + if (self.query(serie, 'tooltip.trigger') == 'item') { + showContent = self.query( + serie, 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [serie], 'tooltip.formatter' + formatter = self.query( + serie, 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [serie], 'tooltip' + specialCssText += _style(self.query( + serie, 'tooltip' )); } // 数据项 - showContent = self.deepQuery( - [data], 'tooltip.showContent' + showContent = self.query( + data, 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [data], 'tooltip.formatter' + formatter = self.query( + data, 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery([data], 'tooltip')); + specialCssText += _style(self.query(data, 'tooltip')); } else { showContent = self.deepQuery( @@ -19912,7 +21142,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa ? '' : (' (' + special + ')')); } - else if (serie.type == ecConfig.CHART_TYPE_RADAR) { + else if (serie.type == ecConfig.CHART_TYPE_RADAR && special) { indicator = special; html += _encodeHTML( name === '' ? (serie.name || '') : name @@ -19999,32 +21229,32 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa [seriesArray[i], option], 'tooltip.trigger' ) == 'axis' ) { - queryTarget = [seriesArray[i]]; - curType = self.deepQuery( + queryTarget = seriesArray[i]; + curType = self.query( queryTarget, 'tooltip.axisPointer.type' ); pointType = curType || pointType; if (curType == 'line') { - lineColor = self.deepQuery( + lineColor = self.query( queryTarget, 'tooltip.axisPointer.lineStyle.color' ) || lineColor; - lineWidth = self.deepQuery( + lineWidth = self.query( queryTarget, 'tooltip.axisPointer.lineStyle.width' ) || lineWidth; - lineType = self.deepQuery( + lineType = self.query( queryTarget, 'tooltip.axisPointer.lineStyle.type' ) || lineType; } else if (curType == 'shadow') { - areaSize = self.deepQuery( + areaSize = self.query( queryTarget, 'tooltip.axisPointer.areaStyle.size' ) || areaSize; - areaColor = self.deepQuery( + areaColor = self.query( queryTarget, 'tooltip.axisPointer.areaStyle.color' ) || areaColor; @@ -20240,6 +21470,29 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa function ondragend() { _hide(); } + + /** + * 图例选择 + */ + function onlegendSelected(param) { + _selectedMap = param.selected; + } + function _setSelectedMap() { + if (option.legend && option.legend.selected) { + _selectedMap = option.legend.selected; + } + else { + _selectedMap = {}; + } + } + function _isSelected(itemName) { + if (typeof _selectedMap[itemName] != 'undefined') { + return _selectedMap[itemName]; + } + else { + return true; // 没在legend里定义的都为true啊~ + } + } function init(newOption, newDom) { option = newOption; @@ -20266,9 +21519,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa var series = option.series; for (var i = 0, l = series.length; i < l; i++) { - if (self.deepQuery([series[i]], 'tooltip.trigger') - == 'axis' - ) { + if (self.query(series[i], 'tooltip.trigger') == 'axis') { _needAxisTrigger = true; break; } @@ -20279,6 +21530,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa _defaultCssText = _style(option.tooltip); _tDom.style.position = 'absolute'; // 不是多余的,别删! self.hasAppend = false; + _setSelectedMap(); } /** @@ -20300,6 +21552,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa option.tooltip.padding = self.reformCssArray( option.tooltip.padding ); + _setSelectedMap(); } } @@ -20354,6 +21607,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa self.setComponent = setComponent; self.ontooltipHover = ontooltipHover; self.ondragend = ondragend; + self.onlegendSelected = onlegendSelected; init(option, dom); } @@ -20479,13 +21733,13 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf var textFont = self.getFont(toolboxOption.textStyle); var textPosition; var textAlign; - var textBaseLine; + var textBaseline; if (toolboxOption.orient == 'horizontal') { textPosition = _itemGroupLocation.y / zr.getHeight() < 0.5 ? 'bottom' : 'top'; textAlign = _itemGroupLocation.x / zr.getWidth() < 0.5 ? 'left' : 'right'; - textBaseLine = _itemGroupLocation.y / zr.getHeight() < 0.5 + textBaseline = _itemGroupLocation.y / zr.getHeight() < 0.5 ? 'top' : 'bottom'; } else { @@ -20494,7 +21748,7 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf /* textAlign = _itemGroupLocation.x / zr.getWidth() < 0.5 ? 'right' : 'left'; - textBaseLine = 'top'; + textBaseline = 'top'; */ } @@ -20537,18 +21791,18 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf if (i === 0 && textAlign == 'left') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; - itemShape.highlightStyle.textBaseLine = textBaseLine; + itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX; - itemShape.highlightStyle.textY = textBaseLine == 'top' + itemShape.highlightStyle.textY = textBaseline == 'top' ? lastY + itemSize + 10 : lastY - 10; } if (i == iconLength - 1 && textAlign == 'right') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; - itemShape.highlightStyle.textBaseLine = textBaseLine; + itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX + itemSize; - itemShape.highlightStyle.textY = textBaseLine == 'top' + itemShape.highlightStyle.textY = textBaseline == 'top' ? lastY + itemSize + 10 : lastY - 10; } @@ -20857,16 +22111,16 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf yStart : y, xEnd : x, yEnd : y, - lineWidth : self.deepQuery( - [option], + lineWidth : self.query( + option, 'toolbox.feature.mark.lineStyle.width' ) || 2, - strokeColor : self.deepQuery( - [option], + strokeColor : self.query( + option, 'toolbox.feature.mark.lineStyle.color' ) || _markColor, - lineType : self.deepQuery( - [option], + lineType : self.query( + option, 'toolbox.feature.mark.lineStyle.type' ) || 'dashed' } @@ -21284,12 +22538,12 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf function resize() { _resetMark(); self.clear(); - if (option.toolbox.show) { + if (option && option.toolbox && option.toolbox.show) { _buildShape(); - } - if (_dataView) { - _dataView.resize(); - } + } + if (_dataView) { + _dataView.resize(); + } } function hideDataView() { @@ -21405,7 +22659,7 @@ define('echarts/component/dataView',['require','./base','../config','../componen function show(newOption) { _hasShow = true; - var lang = self.deepQuery([option],'toolbox.feature.dataView.lang') + var lang = self.query(option, 'toolbox.feature.dataView.lang') || _lang; option = newOption; @@ -21420,8 +22674,8 @@ define('echarts/component/dataView',['require','./base','../config','../componen 'display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;' + 'width:' + (_zrWidth - 15) + 'px;' + 'height:' + (_zrHeight - 100) + 'px;'; - var customContent = self.deepQuery( - [option], 'toolbox.feature.dataView.optionToContent' + var customContent = self.query( + option, 'toolbox.feature.dataView.optionToContent' ); if (typeof customContent != 'function') { _textArea.value = _optionToContent(); @@ -21436,7 +22690,7 @@ define('echarts/component/dataView',['require','./base','../config','../componen _buttonClose.onclick = hide; _tDom.appendChild(_buttonClose); - if (self.deepQuery([option], 'toolbox.feature.dataView.readOnly') + if (self.query(option, 'toolbox.feature.dataView.readOnly') === false ) { _buttonRefresh.style.cssText = @@ -21553,8 +22807,8 @@ define('echarts/component/dataView',['require','./base','../config','../componen function _save() { var text = _textArea.value; - var customContent = self.deepQuery( - [option], 'toolbox.feature.dataView.contentToOption' + var customContent = self.query( + option, 'toolbox.feature.dataView.contentToOption' ); if (typeof customContent != 'function') { text = text.split('\n'); @@ -22050,8 +23304,10 @@ define( if (!name.show) { continue; } - textStyle = self.deepQuery([name, item, option], - 'textStyle'); + textStyle = self.deepQuery( + [name, item, option], + 'textStyle' + ); style = {}; @@ -22414,6 +23670,9 @@ define( for (var i = 0; i < series.length; i ++) { serie = series[i]; + if (serie.type != ecConfig.CHART_TYPE_RADAR) { + continue; + } serieData = serie.data || []; for (var j = 0; j < serieData.length; j ++) { polarIndex = self.deepQuery( @@ -22763,32 +24022,8 @@ define( * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt */ /** @@ -22798,12 +24033,12 @@ define( * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -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','./component/polar','./util/ecData','./chart','./component','zrender/tool/util','zrender/tool/util','zrender/tool/util','zrender/tool/color','zrender/tool/util','zrender/tool/util','zrender/tool/util'],function(require) { +define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zrender/tool/event','zrender/config','./util/shape/icon','./util/shape/markLine','./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','./component/polar','./util/ecData','./chart','./component','zrender/tool/util','zrender/tool/util','zrender/tool/util','zrender/tool/color','zrender/tool/util','zrender/tool/util','zrender/tool/util'],function(require) { var self = {}; var echarts = self; // 提供内部反向使用静态方法; - self.version = '1.3.5'; + self.version = '1.3.6'; self.dependencies = { - zrender : '1.0.7' + zrender : '1.0.8' }; /** * 入口方法 @@ -22811,6 +24046,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr self.init = function(dom, libOption) { libOption = libOption || {type : 'canvas'}; if (libOption.type == 'canvas') { + dom = dom instanceof Array ? dom[0] : dom; return new Echarts(dom); } else if (libOption.type == 'flash') { @@ -22908,8 +24144,9 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _zr.on(zrConfig.EVENT.DRAGLEAVE, _ondragleave); _zr.on(zrConfig.EVENT.DROP, _ondrop); - // 动态扩展zrender shape:icon + // 动态扩展zrender shape:icon、markLine require('./util/shape/icon'); + require('./util/shape/markLine'); // 内置图表注册 var chartLibrary = require('./chart'); @@ -22935,6 +24172,8 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr // 工具箱 var Toolbox = componentLibrary.get('toolbox'); _toolbox = new Toolbox(_messageCenter, _zr, dom); + + _disposeChartList(); } /** @@ -23263,10 +24502,22 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr function _eventPackage(target) { if (target) { var ecData = require('./util/ecData'); + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + dataIndex = self.compoent.dataZoom + ? self.compoent.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex; return { - seriesIndex : ecData.get(target, 'seriesIndex'), - dataIndex : ecData.get(target, 'dataIndex'), - data : ecData.get(target, 'data') + seriesIndex : seriesIndex, + dataIndex : dataIndex, + data : ecData.get(target, 'data'), + name : ecData.get(target, 'name'), + value : ecData.get(target, 'value') }; } return; @@ -23290,6 +24541,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _messageCenter, _zr, magicOption ); _chartList.push(title); + self.compoent.title = title; } // 提示 @@ -23298,6 +24550,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr var Tooltip = componentLibrary.get('tooltip'); tooltip = new Tooltip(_messageCenter, _zr, magicOption, dom); _chartList.push(tooltip); + self.compoent.tooltip = tooltip; } // 图例 @@ -23308,6 +24561,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _messageCenter, _zr, magicOption, _selectedMap ); _chartList.push(legend); + self.compoent.legend = legend; } // 值域控件 @@ -23318,6 +24572,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _messageCenter, _zr, magicOption ); _chartList.push(dataRange); + self.compoent.dataRange = dataRange; } // 直角坐标系 @@ -23329,6 +24584,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr var Grid = componentLibrary.get('grid'); grid = new Grid(_messageCenter, _zr, magicOption); _chartList.push(grid); + self.compoent.grid = grid; var DataZoom = componentLibrary.get('dataZoom'); dataZoom = new DataZoom( @@ -23341,6 +24597,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr } ); _chartList.push(dataZoom); + self.compoent.dataZoom = dataZoom; var Axis = componentLibrary.get('axis'); xAxis = new Axis( @@ -23354,6 +24611,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr 'xAxis' ); _chartList.push(xAxis); + self.compoent.xAxis = xAxis; yAxis = new Axis( _messageCenter, @@ -23366,6 +24624,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr 'yAxis' ); _chartList.push(yAxis); + self.compoent.yAxis = yAxis; } // 极坐标系 @@ -23381,6 +24640,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr } ); _chartList.push(polar); + self.compoent.polar = polar; } tooltip && tooltip.setComponent({ @@ -23418,6 +24678,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr } ); _chartList.push(chart); + self.chart[chartType] = chart; } } } @@ -23429,9 +24690,15 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr if (magicOption.animation && !magicOption.renderAsImage) { var len = _chartList.length; while (len--) { - _chartList[len] - && _chartList[len].animation - && _chartList[len].animation(); + chart = _chartList[len]; + if (chart + && chart.animation + && chart.shapeList + && chart.shapeList.length + < magicOption.animationThreshold + ) { + chart.animation(); + } } } @@ -23542,6 +24809,13 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr && _chartList[len].dispose(); } _chartList = []; + + self.chart = { + island : _island + }; + self.compoent = { + toolbox : _toolbox + }; } /** @@ -23583,6 +24857,9 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr if (typeof _option.animation == 'undefined') { _option.animation = ecConfig.animation; } + if (typeof _option.animationThreshold == 'undefined') { + _option.animationThreshold = ecConfig.animationThreshold; + } if (typeof _option.animationDuration == 'undefined') { _option.animationDuration = ecConfig.animationDuration; } @@ -23973,6 +25250,9 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _island.resize(); _toolbox.resize(); _zr.refresh(); + _messageCenter.dispatch( + ecConfig.EVENT.RESIZE + ); return self; } @@ -24189,11 +25469,17 @@ define( var ratio = window.devicePixelRatio || 1; // console.log(rect) // var ti = new Date(); + // bbox取整 + rect = { + x : Math.floor(rect.x), + y : Math.floor(rect.y), + width : Math.floor(rect.width), + height : Math.floor(rect.height) + }; var pixels = ctx.getImageData( rect.x * ratio, rect.y * ratio, rect.width * ratio, rect.height * ratio ); - var data = pixels.data; var idx; var zrColor = require('zrender/tool/color'); @@ -24244,7 +25530,7 @@ define( * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -define('echarts/chart/scatter',['require','../component/base','./calculableBase','../config','../util/ecData','zrender/tool/color','../util/shape/symbol','../chart'],function(require) { +define('echarts/chart/scatter',['require','../component/base','./calculableBase','../config','zrender/tool/color','../util/shape/symbol','../chart'],function(require) { /** * 构造函数 * @param {Object} messageCenter echart消息中心 @@ -24261,7 +25547,6 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' CalculableBase.call(this, zr, option); var ecConfig = require('../config'); - var ecData = require('../util/ecData'); var zrColor = require('zrender/tool/color'); @@ -24293,7 +25578,7 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' serieName = serie.name; if (serie.type == ecConfig.CHART_TYPE_SCATTER) { series[i] = self.reformOption(series[i]); - _sIndex2ShapeMap[i] = self.deepQuery([serie], 'symbol') + _sIndex2ShapeMap[i] = self.query(serie, 'symbol') || _symbol[i % _symbol.length]; if (legend){ self.selectedMap[serieName] = @@ -24368,7 +25653,6 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' var pointList = {}; var x; var y; - var symbolSize; for (var j = 0, k = seriesArray.length; j < k; j++) { seriesIndex = seriesArray[j]; serie = series[seriesIndex]; @@ -24379,7 +25663,6 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' xAxis = component.xAxis.getAxis(serie.xAxisIndex || 0); yAxis = component.yAxis.getAxis(serie.yAxisIndex || 0); - symbolSize = self.deepQuery([serie], 'symbolSize'); pointList[seriesIndex] = []; for (var i = 0, l = serie.data.length; i < l; i++) { data = serie.data[i]; @@ -24395,16 +25678,17 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' x = xAxis.getCoord(value[0]); y = yAxis.getCoord(value[1]); pointList[seriesIndex].push([ - x, // 横坐标 - y, // 纵坐标 - (typeof symbolSize == 'function' - ? symbolSize(value) - : symbolSize), // 图形大小 - _sIndex2ShapeMap[seriesIndex], // 图形类型 - i, // 数据index - data.name || '' // 名称 + x, // 横坐标 + y, // 纵坐标 + i, // 数据index + data.name || '' // 名称 ]); } + self.buildMark( + serie, + seriesIndex, + component + ); } // console.log(pointList) _buildPointList(pointList); @@ -24414,46 +25698,19 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' * 生成折线和折线上的拐点 */ function _buildPointList(pointList) { - var dataRange = component.dataRange; - var rangColor; // 更高优先级 - var nColor; // normal - var nLineWidth; - var eColor; // emphasis - var eLineWidth; - var serie; - var queryTarget; - var data; var seriesPL; var singlePoint; - var symbolRotate; - + var shape; for (var seriesIndex in pointList) { serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - // 多级控制 - queryTarget = [serie]; - nColor = self.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || _sIndex2ColorMap[seriesIndex]; - nLineWidth = self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - ); - - eColor = self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ); - eLineWidth = self.deepQuery( - queryTarget, 'itemStyle.emphasis.lineStyle.width' - ); - - symbolRotate = self.deepQuery( - queryTarget, 'symbolRotate' - ); - + seriesPL = pointList[seriesIndex]; if (serie.large && serie.data.length > serie.largeThreshold) { self.shapeList.push(_getLargeSymbol( - seriesPL, nColor, eColor + seriesPL, + self.query( + serie, 'itemStyle.normal.color' + ) || _sIndex2ColorMap[seriesIndex] )); continue; } @@ -24462,171 +25719,92 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' * pointlist=[ * 0 x, * 1 y, - * 2 图形大小 - * 3 图形类型 - * 4 数据index - * 5 名称 + * 2 数据index + * 3 名称 * ] */ + for (var i = 0, l = seriesPL.length; i < l; i++) { singlePoint = seriesPL[i]; - data = serie.data[singlePoint[4]]; - - if (dataRange) { - if (isNaN(data[2])) { - continue; - } - rangColor = dataRange.getColor(data[2]); - if (!rangColor) { - continue; - } - } - else { - rangColor = nColor; - } - - queryTarget = [data]; - self.shapeList.push(_getSymbol( + shape = _getSymbol( seriesIndex, // seriesIndex - singlePoint[4], // dataIndex - singlePoint[5], // name - + singlePoint[2], // dataIndex + singlePoint[3], // name singlePoint[0], // x - singlePoint[1], // y - - // 大小 - self.deepQuery(queryTarget, 'symbolSize') - || singlePoint[2], - - // 方向 - self.deepQuery(queryTarget, 'symbolRotate') - || symbolRotate, - - // 类型 - self.deepQuery(queryTarget, 'symbol') - || singlePoint[3], - - // 填充颜色 - self.deepQuery(queryTarget, 'itemStyle.normal.color') - || rangColor, - // 线宽 - self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - )|| nLineWidth, - - //------------高亮 - // 填充颜色 - self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || eColor || nColor, - // 线宽 - self.deepQuery( - queryTarget, 'itemStyle.emphasis.lineStyle.width' - )|| eLineWidth || nLineWidth - )); + singlePoint[1] // y + ); + shape && self.shapeList.push(shape); } } // console.log(self.shapeList) } /** - * 生成散点图上的图形 + * 生成折线图上的拐点图形 */ - function _getSymbol( - seriesIndex, dataIndex, name, - x, y, symbolSize, symbolRotate, symbol, - nColor, nLineWidth, eColor, eLineWidth - ) { - var itemShape = { - shape : 'icon', - zlevel : _zlevelBase, - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : symbol.match('empty') ? 'stroke' : 'fill', - color : nColor, - strokeColor : nColor, - lineWidth: nLineWidth - }, - highlightStyle : { - color : eColor, - strokeColor : eColor, - lineWidth : eLineWidth - }, - clickable : true - }; - - if (typeof symbolRotate != 'undefined') { - itemShape.rotation = [ - symbolRotate * Math.PI / 180, x, y - ]; - } + function _getSymbol(seriesIndex, dataIndex, name, x, y) { + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; - if (symbol.match('image')) { - itemShape.style.image = - symbol.replace(new RegExp('^image:\\/\\/'), ''); - itemShape.shape = 'image'; + var dataRange = component.dataRange; + var rangColor; + if (dataRange) { + rangColor = isNaN(data[2]) + ? _sIndex2ColorMap[seriesIndex] + : dataRange.getColor(data[2]); + if (!rangColor) { + return null; + } } - - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; + else { + rangColor = _sIndex2ColorMap[seriesIndex]; } - if (symbol == 'none') { - itemShape.invisible = true; - itemShape.hoverable = false; - } - - /* - if (self.deepQuery([data, serie, option], 'calculable')) { - self.setCalculable(itemShape); - itemShape.draggable = true; - } - */ - - itemShape = self.addLabel( - itemShape, - series[seriesIndex], - series[seriesIndex].data[dataIndex], - name, + var itemShape = self.getSymbolShape( + serie, seriesIndex, data, dataIndex, name, + x, y, + _sIndex2ShapeMap[seriesIndex], + rangColor, + 'rgba(0,0,0,0)', 'vertical' ); - - ecData.pack( - itemShape, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - name - ); - - // for animation - itemShape._x = x; - itemShape._y = y; - + itemShape.zlevel = _zlevelBase; + itemShape._mark = false; // 非mark + itemShape._main = true; return itemShape; } - function _getLargeSymbol(symbolList, nColor, eColor) { + function _getLargeSymbol(symbolList, nColor) { return { shape : 'symbol', zlevel : _zlevelBase, + _main : true, hoverable: false, style : { pointList : symbolList, color : nColor, strokeColor : nColor - }, - highlightStyle : { - color : eColor, - strokeColor : eColor } }; } + + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' + && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' + && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 @@ -24668,38 +25846,49 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var serie; for (var i = 0, l = self.shapeList.length; i < l; i++) { - x = self.shapeList[i]._x || 0; - y = self.shapeList[i]._y || 0; - zr.modShape( - self.shapeList[i].id, - { - scale : [0, 0, x, y] - }, - true - ); - zr.animate(self.shapeList[i].id, '') - .when( - (self.deepQuery([serie],'animationDuration') - || duration), - {scale : [1, 1, x, y]} - ) - .start( - self.deepQuery([serie], 'animationEasing') || easing + if (self.shapeList[i]._main) { + if (self.shapeList[i].shape == 'symbol') { + continue; + } + serie = series[self.shapeList[i]._seriesIndex]; + x = self.shapeList[i]._x || 0; + y = self.shapeList[i]._y || 0; + zr.modShape( + self.shapeList[i].id, + { + scale : [0, 0, x, y] + }, + true ); + zr.animate(self.shapeList[i].id, '') + .when( + (self.query(serie,'animationDuration') + || duration), + {scale : [1, 1, x, y]} + ) + .start( + self.query(serie, 'animationEasing') || easing + ); + } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.ondataRange = ondataRange; - self.animation = animation; init(option, component); } @@ -24927,7 +26116,7 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c var ecConfig = require('../config'); var ecData = require('../util/ecData'); - + var self = this; self.type = ecConfig.CHART_TYPE_K; @@ -24983,6 +26172,14 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c return; } _buildHorizontal(maxDataLength, locationMap); + + for (var i = 0, l = seriesArray.length; i < l; i++) { + self.buildMark( + series[seriesArray[i]], + seriesArray[i], + component + ); + } } /** @@ -25119,36 +26316,36 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c && typeof seriesPL != 'undefined' ) { // 多级控制 - queryTarget = [serie]; - nLineWidth = self.deepQuery( + queryTarget = serie; + nLineWidth = self.query( queryTarget, 'itemStyle.normal.lineStyle.width' ); - nLineColor = self.deepQuery( + nLineColor = self.query( queryTarget, 'itemStyle.normal.lineStyle.color' ); - nLineColor0 = self.deepQuery( + nLineColor0 = self.query( queryTarget, 'itemStyle.normal.lineStyle.color0' ); - nColor = self.deepQuery( + nColor = self.query( queryTarget, 'itemStyle.normal.color' ); - nColor0 = self.deepQuery( + nColor0 = self.query( queryTarget, 'itemStyle.normal.color0' ); - eLineWidth = self.deepQuery( + eLineWidth = self.query( queryTarget, 'itemStyle.emphasis.lineStyle.width' ); - eLineColor = self.deepQuery( + eLineColor = self.query( queryTarget, 'itemStyle.emphasis.lineStyle.color' ); - eLineColor0 = self.deepQuery( + eLineColor0 = self.query( queryTarget, 'itemStyle.emphasis.lineStyle.color0' ); - eColor = self.deepQuery( + eColor = self.query( queryTarget, 'itemStyle.emphasis.color' ); - eColor0 = self.deepQuery( + eColor0 = self.query( queryTarget, 'itemStyle.emphasis.color0' ); @@ -25167,7 +26364,7 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c for (var i = 0, l = seriesPL.length; i < l; i++) { singlePoint = seriesPL[i]; data = serie.data[singlePoint[6]]; - queryTarget = [data]; + queryTarget = data; candleType = singlePoint[3] < singlePoint[2]; self.shapeList.push(_getCandle( seriesIndex, // seriesIndex @@ -25183,25 +26380,25 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c // 填充颜色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.normal.color' ) || nColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.normal.color0' ) || nColor0), // 线宽 - self.deepQuery( + self.query( queryTarget, 'itemStyle.normal.lineStyle.width' ) || nLineWidth, // 线色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.normal.lineStyle.color' ) || nLineColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.normal.lineStyle.color0' ) || nLineColor0), @@ -25210,25 +26407,25 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c // 填充颜色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.emphasis.color' ) || eColor || nColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.emphasis.color0' ) || eColor0 || nColor0), // 线宽 - self.deepQuery( + self.query( queryTarget, 'itemStyle.emphasis.lineStyle.width' ) || eLineWidth || nLineWidth, // 线色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.emphasis.lineStyle.color' ) || eLineColor || nLineColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.emphasis.lineStyle.color0' ) || eLineColor0 || nLineColor0) @@ -25278,6 +26475,24 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c return itemShape; } + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' + && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' + && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } + /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * @param {Object} newSeries @@ -25353,8 +26568,8 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var serie; @@ -25371,21 +26586,26 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c ); zr.animate(self.shapeList[i].id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration), {scale : [1, 1, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.addDataAnimation = addDataAnimation; - self.animation = animation; init(option, component); } @@ -25448,20 +26668,34 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c /** * 绘制图形 */ - function _buildShape() { + function _buildShape() { + var legend = component.legend; self.selectedMap = {}; _dropBoxList = []; _radarDataCounter = 0; + var serieName; for (var i = 0, l = series.length; i < l ; i ++) { if (series[i].type == ecConfig.CHART_TYPE_RADAR) { serie = self.reformOption(series[i]); - _queryTarget = [serie, option]; - - // 添加可拖拽提示框,多系列共用一个极坐标,第一个优先 - if (self.deepQuery(_queryTarget, 'calculable')) { - _addDropBox(i); + serieName = serie.name || ''; + // 系列图例开关 + self.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + + if (self.selectedMap[serieName]) { + _queryTarget = [serie, option]; + + // 添加可拖拽提示框,多系列共用一个极坐标,第一个优先 + if (self.deepQuery(_queryTarget, 'calculable')) { + _addDropBox(i); + } + _buildSingleRadar(i); + self.buildMark( + series[i], + i, + component + ); } - _buildSingleRadar(i); } } @@ -25515,7 +26749,7 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c pointList = _getPointList(serie.polarIndex, data[i]); // 添加拐点形状 - _addSymbol(pointList, defaultColor, data[i], index); + _addSymbol(pointList, defaultColor, i, index); // 添加数据形状 _addDataShape( pointList, defaultColor, data[i], @@ -25546,41 +26780,6 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c return pointList; } - /** - * 生成折线图上的拐点图形 - */ - function _getSymbol( - x, y, symbol, symbolSize, normalColor, emphasisColor, lineWidth - ) { - var itemShape = { - shape : 'icon', - zlevel : _zlevelBase + 1, - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') ? '#fff' : normalColor, - strokeColor : normalColor, - lineWidth: lineWidth * 2 - }, - hoverable: false - }; - - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; - } - - itemShape._x = x; - itemShape._y = y; - - return itemShape; - } - /** * 添加拐点 * @param {Array>} pointList 点集 @@ -25588,36 +26787,21 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c * @param {object} data 数据 * @param {number} serieIndex */ - function _addSymbol(pointList, defaultColor, data) { - // 多级控制 - var queryTarget = [data, serie]; - var symbol = self.deepQuery(queryTarget,'symbol') - || _symbol[_radarDataCounter % _symbol.length] - || 'cricle'; - - if (symbol != 'none') { - var symbolSize = self.deepQuery(queryTarget,'symbolSize'); - var nColor = self.deepQuery( - queryTarget, 'itemStyle.normal.color' - ); - var eColor = self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ); - var lineWidth = self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' + function _addSymbol(pointList, defaultColor, dataIndex, seriesIndex) { + var itemShape; + for (var i = 0, l = pointList.length; i < l; i++) { + itemShape = self.getSymbolShape( + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, '', + pointList[i][0], // x + pointList[i][1], // y + _symbol[_radarDataCounter % _symbol.length], + defaultColor, + '#fff', + 'vertical' ); - - for (var i = 0, l = pointList.length; i < l; i++) { - self.shapeList.push(_getSymbol( - pointList[i][0], // x - pointList[i][1], // y - symbol, - symbolSize, - nColor || defaultColor, - eColor || nColor || defaultColor, - lineWidth - )); - } + itemShape.zlevel = _zlevelBase + 1; + self.shapeList.push(itemShape); } } @@ -25725,7 +26909,6 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c } } - /** * 数据项被拖拽出去,重载基类方法 */ @@ -25840,8 +27023,8 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c } function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var dataIndex; var seriesIndex; var data; @@ -25877,39 +27060,25 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c zr.animate(item.id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 100, {scale : [1, 1, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } - else { - x = self.shapeList[i]._x || 0; - y = self.shapeList[i]._y || 0; - zr.modShape( - self.shapeList[i].id, - { - scale : [0, 0, x, y] - }, - true - ); - zr.animate(self.shapeList[i].id, '') - .when( - duration, - {scale : [1, 1, x, y]} - ) - .start('QuinticOut'); - } } - + + self.animationMark(duration, easing); } + // 重载基类方法 + self.animation = animation; + self.init = init; self.refresh = refresh; - self.animation = animation; self.ondrop = ondrop; self.ondragend = ondragend; @@ -28527,7 +29696,6 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base var matrix = []; var serieNumber = 0; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type === self.type) { // Use the config of first chord serie if (!chordSerieSample) { @@ -28542,6 +29710,11 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base continue; } chordSeries.push(series[i]); + self.buildMark( + series[i], + i, + component + ); matrix.push(series[i].matrix); serieNumber++; } @@ -28757,11 +29930,11 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base var timeout; - var showLabel = self.deepQuery( - [chordSerieSample], 'itemStyle.normal.label.show' + var showLabel = self.query( + chordSerieSample, 'itemStyle.normal.label.show' ); - var labelColor = self.deepQuery( - [chordSerieSample], 'itemStyle.normal.label.color' + var labelColor = self.query( + chordSerieSample, 'itemStyle.normal.label.color' ); function createMouseOver(idx) { @@ -29149,8 +30322,8 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base // key is serie name for (var i = 0; i < chordSeries.length; i++) { if (chordSeries[i].name === key) { - colorMap[key] = self.deepQuery( - [chordSeries[i]], + colorMap[key] = self.query( + chordSeries[i], 'itemStyle.normal.color' ); break; @@ -29161,8 +30334,8 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base // key is group name for (var i = 0; i < len; i++) { if (groups[i].name === key) { - colorMap[key] = self.deepQuery( - [groups[i]], + colorMap[key] = self.query( + groups[i], 'itemStyle.normal.color' ); break; @@ -29223,7 +30396,7 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base define('echarts/chart/force',['require','../component/base','./calculableBase','../config','../util/ecData','zrender/config','zrender/tool/event','zrender/tool/util','zrender/tool/vector','../util/ndarray','../chart'],function(require) { - var requrestAnimationFrame = window.requrestAnimationFrame + var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame @@ -29254,6 +30427,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' var NDArray = require('../util/ndarray'); + var legend; var self = this; self.type = ecConfig.CHART_TYPE_FORCE; @@ -29313,32 +30487,47 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' var mouseX, mouseY; function _buildShape() { - var legend = component.legend; + legend = component.legend; temperature = 1.0; viewportWidth = zr.getWidth(); viewportHeight = zr.getHeight(); centroid = [viewportWidth/2, viewportHeight/2]; - + + var serieName; for (var i = 0, l = series.length; i < l; i++) { var serie = series[i]; if (serie.type === ecConfig.CHART_TYPE_FORCE) { series[i] = self.reformOption(series[i]); + + serieName = series[i].name || ''; + // 系列图例开关 + self.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + if (!self.selectedMap[serieName]) { + continue; + } + self.buildMark( + series[i], + i, + component + ); + forceSerie = serie; - var minRadius = self.deepQuery([serie], 'minRadius'); - var maxRadius = self.deepQuery([serie], 'maxRadius'); + var minRadius = self.query(serie, 'minRadius'); + var maxRadius = self.query(serie, 'maxRadius'); // ----------获取外部参数 - attractiveness = self.deepQuery( - [serie], 'attractiveness' + attractiveness = self.query( + serie, 'attractiveness' ); - density = self.deepQuery([serie], 'density'); - initSize = self.deepQuery([serie], 'initSize'); - centripetal = self.deepQuery([serie], 'centripetal'); - coolDown = self.deepQuery([serie], 'coolDown'); + density = self.query(serie, 'density'); + initSize = self.query(serie, 'initSize'); + centripetal = self.query(serie, 'centripetal'); + coolDown = self.query(serie, 'coolDown'); // ---------- - categories = self.deepQuery([serie], 'categories'); + categories = self.query(serie, 'categories'); // 同步selected状态 for (var j = 0, len = categories.length; j < len; j++) { @@ -29352,21 +30541,21 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' } } - linkStyle = self.deepQuery( - [serie], 'itemStyle.normal.linkStyle' + linkStyle = self.query( + serie, 'itemStyle.normal.linkStyle' ); - linkEmphasisStyle = self.deepQuery( - [serie], 'itemStyle.emphasis.linkStyle' + linkEmphasisStyle = self.query( + serie, 'itemStyle.emphasis.linkStyle' ); - nodeStyle = self.deepQuery( - [serie], 'itemStyle.normal.nodeStyle' + nodeStyle = self.query( + serie, 'itemStyle.normal.nodeStyle' ); - nodeEmphasisStyle = self.deepQuery( - [serie], 'itemStyle.emphasis.nodeStyle' + nodeEmphasisStyle = self.query( + serie, 'itemStyle.emphasis.nodeStyle' ); - rawNodes = self.deepQuery([serie], 'nodes'); - rawLinks = zrUtil.clone(self.deepQuery([serie], 'links')); + rawNodes = self.query(serie, 'nodes'); + rawLinks = zrUtil.clone(self.query(serie, 'links')); _preProcessData(rawNodes, rawLinks); // Reset data nodePositions = []; @@ -29484,32 +30673,29 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' // Label var labelStyle; - if (self.deepQuery([forceSerie], 'itemStyle.normal.label.show') + if (self.query(forceSerie, 'itemStyle.normal.label.show') ) { shape.style.text = node.name; shape.style.textPosition = 'inside'; - labelStyle = self.deepQuery( - [forceSerie], 'itemStyle.normal.label.textStyle' + labelStyle = self.query( + forceSerie, 'itemStyle.normal.label.textStyle' ) || {}; shape.style.textColor = labelStyle.color || '#fff'; shape.style.textAlign = labelStyle.align || 'center'; - shape.style.textBaseLine = labelStyle.baseline || 'middle'; + shape.style.textBaseline = labelStyle.baseline || 'middle'; shape.style.textFont = self.getFont(labelStyle); } - if (self.deepQuery( - [forceSerie], 'itemStyle.emphasis.label.show' - ) - ) { + if (self.query(forceSerie, 'itemStyle.emphasis.label.show')) { shape.highlightStyle.text = node.name; shape.highlightStyle.textPosition = 'inside'; - labelStyle = self.deepQuery( - [forceSerie], 'itemStyle.emphasis.label.textStyle' + labelStyle = self.query( + forceSerie, 'itemStyle.emphasis.label.textStyle' ) || {}; shape.highlightStyle.textColor = labelStyle.color || '#fff'; shape.highlightStyle.textAlign = labelStyle.align || 'center'; - shape.highlightStyle.textBaseLine = labelStyle.baseline + shape.highlightStyle.textBaseline = labelStyle.baseline || 'middle'; shape.highlightStyle.textFont = self.getFont(labelStyle); } @@ -29521,6 +30707,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' if (typeof(node.category) !== 'undefined') { var category = categories[node.category]; if (category) { + shape.style.color = legend.getColor(category.name); var style = category.itemStyle; if (style) { if (style.normal) { @@ -29577,7 +30764,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' // data node, // data index - rawNodes.indexOf(node), + zrUtil.indexOf(rawNodes, node), // name node.name || '', // value @@ -29830,7 +31017,6 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' } var _updating; - function init(newOption, newComponent) { option = newOption; component = newComponent; @@ -29844,10 +31030,10 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' function cb() { if (_updating) { _step(); - requrestAnimationFrame(cb); + requestAnimationFrame(cb); } } - requrestAnimationFrame(cb); + requestAnimationFrame(cb); } function refresh(newOption) { @@ -29871,8 +31057,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' self.isDragstart = true; }; - function onclick() { - } + function onclick() { } /** * 拖拽开始 @@ -30101,7 +31286,7 @@ define( * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -define('echarts/chart/line',['require','../component/base','./calculableBase','../config','../util/ecData','zrender/tool/color','zrender/shape','zrender/shape','../util/shape/halfSmoothPolygon','../chart'],function(require) { +define('echarts/chart/line',['require','../component/base','./calculableBase','../config','zrender/tool/color','zrender/shape','zrender/shape','../util/shape/halfSmoothPolygon','../chart'],function(require) { /** * 构造函数 * @param {Object} messageCenter echart消息中心 @@ -30118,7 +31303,6 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. CalculableBase.call(this, zr, option); var ecConfig = require('../config'); - var ecData = require('../util/ecData'); var zrColor = require('zrender/tool/color'); @@ -30212,6 +31396,13 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. _buildVertical(maxDataLength, locationMap); break; } + for (var i = 0, l = seriesArray.length; i < l; i++) { + self.buildMark( + series[seriesArray[i]], + seriesArray[i], + component + ); + } } /** @@ -30236,7 +31427,7 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. _sIndex2ShapeMap[seriesArray[i]] = _sIndex2ShapeMap[seriesArray[i]] - || self.deepQuery([serie],'symbol') + || self.query(serie,'symbol') || _symbol[i % _symbol.length]; if (legend){ @@ -30552,7 +31743,6 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. var lineType; var lineColor; var normalColor; - var emphasisColor; // 填充相关 var isFill; @@ -30573,28 +31763,25 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. if (serie.type == self.type && typeof seriesPL != 'undefined') { defaultColor = _sIndex2ColorMap[seriesIndex]; // 多级控制 - lineWidth = self.deepQuery( - [serie], 'itemStyle.normal.lineStyle.width' - ); - lineType = self.deepQuery( - [serie], 'itemStyle.normal.lineStyle.type' + lineWidth = self.query( + serie, 'itemStyle.normal.lineStyle.width' ); - lineColor = self.deepQuery( - [serie], 'itemStyle.normal.lineStyle.color' + lineType = self.query( + serie, 'itemStyle.normal.lineStyle.type' ); - normalColor = self.deepQuery( - [serie], 'itemStyle.normal.color' + lineColor = self.query( + serie, 'itemStyle.normal.lineStyle.color' ); - emphasisColor = self.deepQuery( - [serie], 'itemStyle.emphasis.color' + normalColor = self.query( + serie, 'itemStyle.normal.color' ); - isFill = typeof self.deepQuery( - [serie], 'itemStyle.normal.areaStyle' + isFill = typeof self.query( + serie, 'itemStyle.normal.areaStyle' ) != 'undefined'; - fillNormalColor = self.deepQuery( - [serie], 'itemStyle.normal.areaStyle.color' + fillNormalColor = self.query( + serie, 'itemStyle.normal.areaStyle.color' ); for (var i = 0, l = seriesPL.length; i < l; i++) { @@ -30620,19 +31807,6 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. singlePL[j][3], // name singlePL[j][0], // x singlePL[j][1], // y - self.deepQuery( - [data], 'itemStyle.normal.color' - ) || normalColor - || defaultColor, - self.deepQuery( - [data], 'itemStyle.emphasis.color' - ) || emphasisColor - || normalColor - || defaultColor, - lineWidth, - self.deepQuery( - [data, serie], 'symbolRotate' - ), orient )); } @@ -30650,20 +31824,20 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. lineWidth : lineWidth, lineType : lineType, smooth : _getSmooth(serie.smooth), - shadowColor : self.deepQuery( - [serie], + shadowColor : self.query( + serie, 'itemStyle.normal.lineStyle.shadowColor' ), - shadowBlur: self.deepQuery( - [serie], + shadowBlur: self.query( + serie, 'itemStyle.normal.lineStyle.shadowBlur' ), - shadowOffsetX: self.deepQuery( - [serie], + shadowOffsetX: self.query( + serie, 'itemStyle.normal.lineStyle.shadowOffsetX' ), - shadowOffsetY: self.deepQuery( - [serie], + shadowOffsetY: self.query( + serie, 'itemStyle.normal.lineStyle.shadowOffsetY' ) }, @@ -30734,18 +31908,14 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. var itemShape = _getSymbol( seriesIndex, dataIndex, name, - x, y, - color, - _sIndex2ColorMap[seriesIndex], - 2, - 0, - orient + x, y, orient ); - + itemShape.style.color = color; + itemShape.style.strokeColor = color; + itemShape.rotation = [0,0]; itemShape.hoverable = false; itemShape.draggable = false; itemShape.style.text = undefined; - //itemShape.highlightStyle.lineWidth = 20; return itemShape; } @@ -30753,99 +31923,46 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. /** * 生成折线图上的拐点图形 */ - function _getSymbol( - seriesIndex, dataIndex, name, x, y, - normalColor, emphasisColor, lineWidth, rotate, orient - ) { + function _getSymbol(seriesIndex, dataIndex, name, x, y, orient) { var serie = series[seriesIndex]; var data = serie.data[dataIndex]; - var symbol = self.deepQuery([data], 'symbol') - || _sIndex2ShapeMap[seriesIndex] - || 'cricle'; - var symbolSize = self.deepQuery([data, serie],'symbolSize'); - - var itemShape = { - shape : 'icon', - zlevel : _zlevelBase + 1, - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') ? '#fff' : normalColor, - strokeColor : normalColor, - lineWidth: lineWidth * 2 - }, - highlightStyle : { - color : symbol.match('empty') ? '#fff' : emphasisColor, - strokeColor : emphasisColor, - lineWidth: lineWidth * 2 + 2 - }, - clickable : true - }; - - if (symbol.match('image')) { - itemShape.style.image = - symbol.replace(new RegExp('^image:\\/\\/'), ''); - itemShape.shape = 'image'; - } - - if (typeof rotate != 'undefined') { - itemShape.rotation = [ - rotate * Math.PI / 180, x, y - ]; - } - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; - } + var itemShape = self.getSymbolShape( + serie, seriesIndex, data, dataIndex, name, + x, y, + _sIndex2ShapeMap[seriesIndex], + _sIndex2ColorMap[seriesIndex], + '#fff', + orient == 'vertical' ? 'horizontal' : 'vertical' // 翻转 + ); + itemShape.zlevel = _zlevelBase + 1; - if (symbol == 'none') { - itemShape.invisible = true; - itemShape.hoverable = false; - } - if (self.deepQuery([data, serie, option], 'calculable')) { self.setCalculable(itemShape); itemShape.draggable = true; } - - itemShape = self.addLabel( - itemShape, - series[seriesIndex], - series[seriesIndex].data[dataIndex], - name, - orient == 'vertical' ? 'horizontal' : 'vertical' - ); - if (symbol.match('empty')) { - if (typeof itemShape.style.textColor == 'undefined') { - itemShape.style.textColor = itemShape.style.strokeColor; - } - if (typeof itemShape.highlightStyle.textColor == 'undefined') { - itemShape.highlightStyle.textColor = - itemShape.highlightStyle.strokeColor; - } - } - ecData.pack( - itemShape, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - name - ); - - itemShape._x = x; - itemShape._y = y; - itemShape._dataIndex = dataIndex; - itemShape._seriesIndex = seriesIndex; - return itemShape; } + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' + && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' + && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } + /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * @param {Object} newSeries @@ -30873,62 +31990,22 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. var dataIndex = param.dataIndex; var seriesPL; var singlePL; - var serie; - var queryTarget; - - var lineWidth; - var normalColor; - var emphasisColor; - var defaultColor; - var len = seriesIndex.length; while (len--) { seriesPL = finalPLMap[seriesIndex[len]]; if (seriesPL) { - serie = series[seriesIndex[len]]; - queryTarget = [serie]; - defaultColor = _sIndex2ColorMap[seriesIndex[len]]; - // 多级控制 - lineWidth = self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - ); - normalColor = self.deepQuery( - queryTarget, 'itemStyle.normal.color' - ); - emphasisColor = self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ); - var shape; - var data; for (var i = 0, l = seriesPL.length; i < l; i++) { singlePL = seriesPL[i]; for (var j = 0, k = singlePL.length; j < k; j++) { if (dataIndex == singlePL[j][2]) { - data = serie.data[singlePL[j][2]]; - shape = _getSymbol( - seriesIndex[len], - singlePL[j][2], // dataIndex - singlePL[j][3], // name - singlePL[j][0], // x - singlePL[j][1], // y - self.deepQuery( - [data], 'itemStyle.normal.color' - ) || normalColor - || defaultColor, - self.deepQuery( - [data], 'itemStyle.emphasis.color' - ) || emphasisColor - || normalColor - || defaultColor, - lineWidth, - self.deepQuery( - [data, serie], 'symbolRotate' - ), + tipShape.push(_getSymbol( + seriesIndex[len], // seriesIndex + singlePL[j][2], // dataIndex + singlePL[j][3], // name + singlePL[j][0], // x + singlePL[j][1], // y 'horizontal' - ); - //console.log(shape) - //zr.addHoverShape(shape); - tipShape.push(shape); + )); } } } @@ -31042,8 +32119,8 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var serie; @@ -31075,40 +32152,28 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. } zr.animate(self.shapeList[i].id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 100, {scale : [1, 1, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } - else { - x = self.shapeList[i]._x || 0; - y = self.shapeList[i]._y || 0; - zr.modShape( - self.shapeList[i].id, - { - scale : [0, 0, x, y] - }, - true - ); - zr.animate(self.shapeList[i].id, '') - .when( - duration, - {scale : [1, 1, x, y]} - ) - .start('QuinticOut'); - } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.ontooltipHover = ontooltipHover; self.addDataAnimation = addDataAnimation; - self.animation = animation; init(option, component); } @@ -31270,11 +32335,11 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. switch (position) { case 'bottom' : case 'top' : - _buildHorizontal(maxDataLength, locationMap); + _buildHorizontal(maxDataLength, locationMap, seriesArray); break; case 'left' : case 'right' : - _buildVertical(maxDataLength, locationMap); + _buildVertical(maxDataLength, locationMap, seriesArray); break; } } @@ -31362,7 +32427,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. /** * 构建类目轴为水平方向的柱形图系列 */ - function _buildHorizontal(maxDataLength, locationMap) { + function _buildHorizontal(maxDataLength, locationMap, seriesArray) { // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; @@ -31379,6 +32444,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. var barMinHeightMap = size.barMinHeightMap; var barHeight; + var xMarkMap = {}; // 为标注记录一个横向偏移 var x; var y; var lastYP; // 正向堆叠处理 @@ -31457,6 +32523,10 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. barHeight, 'vertical' ); + + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {}; + xMarkMap[seriesIndex][i] = + x + (barWidthMap[seriesIndex] || barWidth) / 2; self.shapeList.push(barShape); } @@ -31505,12 +32575,13 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. x += ((barWidthMap[seriesIndex] || barWidth) + barGap); } } + _buildMark(seriesArray, xMarkMap, true); } /** * 构建类目轴为垂直方向的柱形图系列 */ - function _buildVertical(maxDataLength, locationMap) { + function _buildVertical(maxDataLength, locationMap, seriesArray) { // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; @@ -31527,6 +32598,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. var barMinHeightMap = size.barMinHeightMap; var barHeight; + var xMarkMap = {}; // 为标注记录一个横向偏移 var x; var y; var lastXP; // 正向堆叠处理 @@ -31605,6 +32677,10 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. barWidthMap[seriesIndex] || barWidth, 'horizontal' ); + + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {}; + xMarkMap[seriesIndex][i] = + y - (barWidthMap[seriesIndex] || barWidth) / 2; self.shapeList.push(barShape); } @@ -31655,6 +32731,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. y -= ((barWidthMap[seriesIndex] || barWidth) + barGap); } } + _buildMark(seriesArray, xMarkMap, false); } /** * 我真是自找麻烦啊,为啥要允许系列级个性化最小宽度和高度啊!!! @@ -31889,6 +32966,52 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. return barShape; } + // 添加标注 + function _buildMark(seriesArray, xMarkMap ,isHorizontal) { + for (var i = 0, l = seriesArray.length; i < l; i++) { + self.buildMark( + series[seriesArray[i]], + seriesArray[i], + component, + { + isHorizontal : isHorizontal, + xMarkMap : xMarkMap + } + ); + } + } + + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData, markCoordParams) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + var dataIndex; + var pos; + if (markCoordParams.isHorizontal) { + // 横向 + dataIndex = typeof mpData.xAxis == 'string' + && xAxis.getIndexByName + ? xAxis.getIndexByName(mpData.xAxis) + : (mpData.xAxis || 0); + pos = [ + markCoordParams.xMarkMap[seriesIndex][dataIndex], + yAxis.getCoord(mpData.yAxis || 0) + ]; + } + else { + // 纵向 + dataIndex = typeof mpData.xAxis == 'string' + && xAxis.getIndexByName + ? xAxis.getIndexByName(mpData.xAxis) + : (mpData.xAxis || 0); + pos = [ + xAxis.getCoord(mpData.xAxis || 0), + markCoordParams.xMarkMap[seriesIndex][dataIndex] + ]; + } + return pos; + } + /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * @param {Object} newSeries @@ -32090,12 +33213,17 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. } } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.addDataAnimation = addDataAnimation; - self.animation = animation; init(option, component); } @@ -32146,6 +33274,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. var _selected = {}; function _buildShape() { + var legend = component.legend; self.selectedMap = {}; _selected = {}; var center; @@ -32153,9 +33282,18 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. var pieCase; // 饼图箱子 _selectedMode = false; + var serieName; for (var i = 0, l = series.length; i < l; i++) { if (series[i].type == ecConfig.CHART_TYPE_PIE) { series[i] = self.reformOption(series[i]); + serieName = series[i].name || ''; + // 系列图例开关 + self.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + if (!self.selectedMap[serieName]) { + continue; + } + center = self.parseCenter(series[i].center); radius = self.parseRadius(series[i].radius); _selectedMode = _selectedMode || series[i].selectedMode; @@ -32181,6 +33319,11 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. self.shapeList.push(pieCase); } _buildSinglePie(i); + self.buildMark( + series[i], + i, + component + ); } } @@ -32336,16 +33479,17 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. ) { var serie = series[seriesIndex]; var data = serie.data[dataIndex]; + var queryTarget = [data, serie]; var center = self.parseCenter(serie.center); // 多级控制 var normalColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.color' ) || defaultColor; var emphasisColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.color' ); @@ -32385,7 +33529,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. sector.style._hasSelected = true; sector.style._x = sector.style.x; sector.style._y = sector.style.y; - var offset = self.deepQuery([serie], 'selectedOffset'); + var offset = self.query(serie, 'selectedOffset'); sector.style.x += zrMath.cos(midAngle, true) * offset; sector.style.y -= zrMath.sin(midAngle, true) * offset; @@ -32407,7 +33551,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. if (_needLabel(serie, data, false) && self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.position' ) == 'inner' ) { @@ -32416,15 +33560,15 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. ); sector.style.textPosition = 'specific'; sector.style.textColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.textStyle.color' ) || '#fff'; sector.style.textAlign = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.textStyle.align' ) || 'center'; - sector.style.textBaseLine = self.deepQuery( - [data, serie], + sector.style.textBaseline = self.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle.baseline' ) || 'middle'; sector.style.textX = Math.round( @@ -32438,14 +33582,14 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. * zrMath.sin((startAngle + endAngle) / 2, true) ); sector.style.textFont = self.getFont(self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.textStyle' )); } if (_needLabel(serie, data, true) && self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.position' ) == 'inner' ) { @@ -32454,15 +33598,15 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. ); sector.highlightStyle.textPosition = 'specific'; sector.highlightStyle.textColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.textStyle.color' ) || '#fff'; sector.highlightStyle.textAlign = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.textStyle.align' ) || 'center'; - sector.highlightStyle.textBaseLine = self.deepQuery( - [data, serie], + sector.highlightStyle.textBaseline = self.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle.baseline' ) || 'middle'; sector.highlightStyle.textX = Math.round( @@ -32476,7 +33620,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. * zrMath.sin((startAngle + endAngle) / 2, true) ); sector.highlightStyle.textFont = self.getFont(self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.textStyle' )); } @@ -32722,6 +33866,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. +'.labelLine.show' ); } + /** * 参数修正&默认值赋值,重载基类方法 * @param {Object} opt 参数 @@ -32979,8 +34124,8 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var r0; @@ -33014,7 +34159,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. dataIndex = ecData.get(self.shapeList[i], 'dataIndex'); zr.animate(self.shapeList[i].id, 'style') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 10, { @@ -33025,16 +34170,16 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. .start('QuinticOut'); zr.animate(self.shapeList[i].id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 100, {rotation : [0, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } - else { + else if (!self.shapeList[i]._mark){ dataIndex = self.shapeList[i]._dataIndex; zr.modShape( self.shapeList[i].id, @@ -33051,6 +34196,8 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. .start('QuinticOut'); } } + + self.animationMark(duration, easing); } function onclick(param) { @@ -33077,8 +34224,8 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. _selected[seriesIndex][dataIndex] = true; target.style._x = target.style.x; target.style._y = target.style.y; - offset = self.deepQuery( - [series[seriesIndex]], + offset = self.query( + series[seriesIndex], 'selectedOffset' ); target.style.x += zrMath.cos(midAngle, true) @@ -33247,12 +34394,12 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. }; self.reformOption = reformOption; // 重载基类方法 + self.animation = animation; // 接口方法 self.init = init; self.refresh = refresh; self.addDataAnimation = addDataAnimation; - self.animation = animation; self.onclick = onclick; self.ondrop = ondrop; self.ondragend = ondragend; diff --git a/build/echarts-plain-map.js b/build/echarts-plain-map.js index f29394dce2..d81e8b0fb6 100644 --- a/build/echarts-plain-map.js +++ b/build/echarts-plain-map.js @@ -19,32 +19,8 @@ * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ /*! @@ -53,32 +29,8 @@ * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt */ -(function(e){var t,n,r;(function(e){function d(e,t){return h.call(e,t)}function v(e,t){var n,r,i,s,o,u,a,f,c,h,p=t&&t.split("/"),d=l.map,v=d&&d["*"]||{};if(e&&e.charAt(0)===".")if(t){p=p.slice(0,p.length-1),e=p.concat(e.split("/"));for(f=0;f0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(t){if(d(f,t)){var n=f[t];delete f[t],c[t]=!0,i.apply(e,n)}if(!d(a,t)&&!d(c,t))throw new Error("No "+t);return a[t]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var i,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},i=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{lineStyle:{width:2,type:"solid"}},emphasis:{}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1,position:"outer"},labelLine:{show:!1,length:40,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),r("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),r("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),r("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),r("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),r("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),r("zrender/tool/area",["require","../tool/util"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),r("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,p;if(typeof t.pointList!="undefined"){var d=t.pointList;if(d.length<2)return;var v=d.length;switch(a){case"start":l=d[0][0],c=d[1][0],h=d[0][1],p=d[1][1];break;case"end":l=d[v-2][0],c=d[v-1][0],h=d[v-2][1],p=d[v-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,p=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function g(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:p,getHighlightZoom:d,drift:v,isCover:m,updateTransform:g},t}),r("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),r("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),r("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),r("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),r("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),r("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function t(){this.type="text"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";if(r.maxWidth)switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y,r.maxWidth);break;case"stroke":e.strokeText(r.text,r.x,r.y,r.maxWidth);break;case"both":e.strokeText(r.text,r.x,r.y,r.maxWidth),e.fillText(r.text,r.x,r.y,r.maxWidth);break;default:e.fillText(r.text,r.x,r.y,r.maxWidth)}else switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y);break;case"stroke":e.strokeText(r.text,r.x,r.y);break;case"both":e.strokeText(r.text,r.x,r.y),e.fillText(r.text,r.x,r.y);break;default:e.fillText(r.text,r.x,r.y)}e.restore();return},getRect:function(t){var n=e("../tool/area"),r=n.getTextWidth(t.text,t.textFont),i=n.getTextWidth("国",t.textFont),s=t.x;t.textAlign=="end"||t.textAlign=="right"?s-=r:t.textAlign=="center"&&(s-=r/2);var o=t.y-i/2;return t.textBaseline=="top"?o+=i/2:t.textBaseline=="bottom"&&(s-=i/2),{x:s,y:o,width:r,height:i}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("text",new t),t}),r("zrender/shape/heart",["require","./base","../shape"],function(e){function t(){this.type="heart"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y),e.bezierCurveTo(t.x+t.a/2,t.y-t.b*2/3,t.x+t.a*2,t.y+t.b/3,t.x,t.y+t.b),e.bezierCurveTo(t.x-t.a*2,t.y+t.b/3,t.x-t.a/2,t.y-t.b*2/3,t.x,t.y);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b/4-t/2),width:e.a*2+t,height:e.b*5/4+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("heart",new t),t}),r("zrender/shape/droplet",["require","./base","../shape"],function(e){function t(){this.type="droplet"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y+t.a),e.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+t.a*3/2,t.y-t.a/3,t.x,t.y-t.b),e.bezierCurveTo(t.x-t.a*3/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.a+e.b+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("droplet",new t),t}),r("zrender/shape/path",["require","./base","../shape"],function(e){function t(){this.type="path"}t.prototype={_parsePathData:function(e){if(!e)return[];var t=e,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];t=t.replace(/ /g," "),t=t.replace(/ /g,","),t=t.replace(/,,/g,",");var r;for(r=0;r0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),r("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),r("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),r("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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}),r("zrender",["zrender/zrender"],function(e){return e}),r("echarts/util/shape/icon",["require","zrender/tool/matrix","zrender/shape","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,arrow:y,star:b,image:w}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=5;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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}),r("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}),r("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:case n.CHART_TYPE_CHORD: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 a(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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}return e("../chart").define("island",t),t}),r("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}),r("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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}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}),r("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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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}),r("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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),r("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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 H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(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||e0&&(n.delShape(B.tipShape),B=!1),e&&n.refresh()}function R(e,t,n){var r=x.offsetHeight,i=x.offsetWidth;e+i>H&&(e=H-i),t+r>P&&(t=P-r),t<20&&(t=0),x.style.cssText=T+N+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(H-e<100||P-t<100)&&setTimeout(U,20)}function U(){if(x){var e="",t=x.offsetHeight,n=x.offsetWidth;x.offsetLeft+n>H&&(e+="left:"+(H-n)+"px;"),x.offsetTop+t>P&&(e+="top:"+(P-t)+"px;"),e!==""&&(x.style.cssText+=e)}}function z(){var e,t;if(!M)X()||W();else{if(M._type=="island"&&r.tooltip.show){K();return}var n=u.get(M,"series"),i=u.get(M,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(k),clearTimeout(A),k=setTimeout(q,L)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?$(n.xAxisIndex,n.yAxisIndex,u.get(M,"dataIndex")):K())}}function W(){if(!w||!E){k=setTimeout(q,L);return}var e=r.series,t,n;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 $(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(k),clearTimeout(A),k=setTimeout(q,L);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var y=0,S=u.length;y0){var T;if(typeof d=="function"){var N=[];for(var y=0,S=a.length;y"+ut(a[y].name||"")+" : ",T=a[y].data[s],T=typeof T!="undefined"?typeof T.value!="undefined"?T.value:T:"-",d+=T;x.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(h,p,g)}}function J(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}for(var f=0,c=n.length;f0){var h,p,d=[],v=r.polar[e].indicator[t].text;for(var f=0,c=s.length;f"+ut(d[0][3])+" : "+d[0][2];for(var f=1,c=d.length;f"+ut(d[f][1])+"
",o+=ut(d[f][3])+" : "+d[f][2];x.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_),l.getY(_),a),!0}}function K(){var e=u.get(M,"series"),t=u.get(M,"data"),s=u.get(M,"name"),a=u.get(M,"value"),f=u.get(M,"special"),c=u.get(M,"special2"),h,p,d="",v,g="";M._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.deepQuery([e],"tooltip.trigger")=="item"&&(p=m.deepQuery([e],"tooltip.showContent")||p,h=m.deepQuery([e],"tooltip.formatter")||h,d+=I(m.deepQuery([e],"tooltip"))),p=m.deepQuery([t],"tooltip.showContent")||p,h=m.deepQuery([t],"tooltip.formatter")||h,d+=I(m.deepQuery([t],"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")D=(e.name||"")+":"+u.get(M,"dataIndex"),x.innerHTML=h([e.name||"",s,a,f,c],D,Z);else if(typeof h=="string")D=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ut(e.name||"")).replace("{b0}",ut(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(M,"special2")||""),x.innerHTML=h;else{D=NaN;if(e.type==o.CHART_TYPE_SCATTER)x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
":"")+(s===""?"":ut(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR){v=f,g+=ut(s===""?e.name||"":s),g+=g===""?"":"
";for(var y=0;y";x.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")x.innerHTML=ut(s)+" ("+a+")";else{var b=ut(s),w=ut(f);x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
":"")+b+" -> "+w+" ("+a+")"+"
"+w+" -> "+b+" ("+c+")"}else x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
":"")+ut(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}j.invisible||(j.invisible=!0,n.modShape(j.id,j),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_)+20,l.getY(_)-20,d)}function Q(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yH&&(n+="left:"+(H-i)+"px;"),x.offsetTop+r>P&&(n+="top:"+(P-r)+"px;"),n!==""&&(x.style.cssText+=n),(H-x.offsetLeft<100||P-x.offsetTop<100)&&setTimeout(U,20)}function et(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function tt(e,t){if(!B||B&&B.dataIndex!=e.dataIndex){B&&B.tipShape.length>0&&n.delShape(B.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x=document.createElement("div"),T="position:absolute;display:block;border-style:solid;white-space:nowrap;",N,C,k,L,A,O,M,_,D,P=n.getHeight(),H=n.getWidth(),B=!1,j={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},F={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(j),n.addShape(F),n.on(a.EVENT.MOUSEMOVE,G),n.on(a.EVENT.GLOBALOUT,Y),m.dispose=ot,m.init=rt,m.refresh=it,m.resize=st,m.setComponent=et,m.ontooltipHover=tt,m.ondragend=nt,rt(r,i)}return e("../component").define("tooltip",t),t}),r("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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}),r("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),r("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",t),t}),r("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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wa.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}),r("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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),r("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Y(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(D[i],D[i],n,-c),v.scaleAndAdd(D[s],D[s],n,c)}for(var i=0,h=O.length;i>1^-(o&1),u=u>>1^-(u&1),o+=r,u+=i,r=o,i=u,n.push([o/1024,u/1024])}return n}var r={world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],r="",i=e[0],s=e[1];for(var o=0,u=n.length;o180?n-360:n,r=90-(r/e.scale.y+e.offset.y),[n,r]}function o(e,t){return n.offset=e.offset,n.scale=e.scale,t instanceof Array?n.makePoint([t[0]*1,t[1]*1]):n.makePoint([t.x*1,t.y*1])}var n={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,r=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxr&&(t.xmin=r),t.xmaxi&&(t.ymin=i),t.ymax10?n[L][g].value=Math.round(n[L][g].value):n[L][g].value=n[L][g].value.toFixed(2)-0;y[L]=y[L]||{},y[L].mapData?P(L,n[L],a[L])(y[L].mapData):x[L.replace(/\|.*/,"")].getGeoJson&&(w[L]=x[L.replace(/\|.*/,"")].specialArea||w[L],x[L.replace(/\|.*/,"")].getGeoJson(P(L,n[L],a[L])))}}function P(e,t,r){return function(i){e.indexOf("|")!=-1&&(i=H(e,i)),y[e].mapData=i,q(e,B(e,i,r),t,r);if(--S<=0){for(var s=0,o=h.shapeList.length;s1&&(r={geometry:{coordinates:r.geometry.coordinates.slice(5,6),type:r.geometry.type},id:r.id,properties:r.properties,type:r.type});break}return{type:"FeatureCollection",features:[r]}}function B(t,n,r){var i=e("../util/projection/normal"),s=[],o=y[t].bbox||i.getBbox(n,w[t]),u;y[t].hasRoam?u=y[t].transform:u=I(o,r);var a=y[t].lastTransform||{scale:{}},f;u.left!=a.left||u.top!=a.top||u.scale.x!=a.scale.x||u.scale.y!=a.scale.y?(f=i.geoJson2Path(n,u,w[t]),a=l.clone(u)):(u=y[t].transform,f=y[t].pathArray),y[t].bbox=o,y[t].transform=u,y[t].lastTransform=a,y[t].pathArray=f;var c=[u.left,u.top];for(var h=0,p=f.length;hv?(d=v*.75,l=h*d):(v=d,d=v*.75,c=p*v);var m={OffsetLeft:a[0],OffsetTop:a[1],scale:{x:d,y:v}},g=o.geoJson2Path(n,m);return F(t,g[0],s)}function F(e,t,n){var r,i=t.properties.name;return N[i]?r=Z(e,N[i]):t.cp&&(r=[t.cp[0],t.cp[1]]),T[i]&&(r[0]+=T[i][0],r[1]+=T[i][1]),{text:R(e,i),path:t.path,position:n,textX:r[0],textY:r[1]}}function I(e,t){var r,i,s,o,u,a,f,l=n.getWidth(),c=n.getHeight(),d=Math.round(Math.min(l,c)*.02);for(var v in t)r=p[v].mapLocation,s=r.x||s,u=r.y||u,a=r.width||a,f=r.height||f;i=h.parsePercent(s,l),i=isNaN(i)?d:i,o=h.parsePercent(u,c),o=isNaN(o)?d:o,typeof a=="undefined"?a=isNaN(s)?l-2*d:l-i-2*d:a=h.parsePercent(a,l),typeof f=="undefined"?f=isNaN(u)?c-2*d:c-o-2*d:f=h.parsePercent(f,c);var m=e.width,g=e.height,y=a/.75/m,b=f/g;y>b?(y=b*.75,a=m*y):(b=y,y=b*.75,f=g*b);if(isNaN(s))switch(s+""){case"center":i=Math.floor((l-a)/2);break;case"right":i=l-a;break;default:}if(isNaN(u))switch(u+""){case"center":o=Math.floor((c-f)/2);break;case"bottom":o=c-f;break;default:}return{left:i,top:o,width:a,height:f,scale:{x:y,y:b}}}function q(e,t,n,r){var s=i.legend,o=i.dataRange,f,c,y,b,w,E=u.map,S,x,T,N,C,k;for(var L=0,A=t.length;L=r&&e<=r+s&&t>=i&&t<=i+o)return u}return}function W(e){var t=e.event,n=c.getX(t),r=c.getY(t),i=c.getDelta(t),s=z(n,r);if(s){var o=y[s].transform,u=o.left,a=o.top,f=o.width,l=o.height;geoAndPos=Y(s,[n-u,r-a]),i>0?(i=1.2,o.scale.x*=i,o.scale.y*=i,o.width=f*i,o.height=l*i):(i=1.2,o.scale.x/=i,o.scale.y/=i,o.width=f/i,o.height=l/i),y[s].hasRoam=!0,y[s].transform=o,geoAndPos=Z(s,geoAndPos),o.left-=geoAndPos[0]-(n-u),o.top-=geoAndPos[1]-(r-a),y[s].transform=o,clearTimeout(E),E=setTimeout(Q,100),c.stop(t)}}function X(e){var t=e.target;if(t&&t.draggable)return;var r=e.event,i=c.getX(r),s=c.getY(r),o=z(i,s);o&&(O=!0,L=i,A=s,_=o,setTimeout(function(){n.on(f.EVENT.MOUSEMOVE,V),n.on(f.EVENT.MOUSEUP,$)},50))}function V(e){if(!O||!h)return;var t=e.event,r=c.getX(t),i=c.getY(t),s=y[_].transform;s.hasRoam=!0,s.left-=L-r,s.top-=A-i,L=r,A=i,y[_].transform=s;var o=[s.left,s.top],u={position:[s.left,s.top]};for(var a=0,f=h.shapeList.length;a0&&b(l,e[l]);for(var u=0,f=c.shapeList.length;u0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}p=f.getCoord(E),E>=0?(v-=m-p,p=v):E<0&&(g+=p-y,p=g),b[n].push([l,p,S,u.getNameByIndex(S),l,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"horizontal")}function S(e,t){var n=t[0][0],r=h[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,l,p,v,m,g,y,b={},w,E;for(var S=0,T=e;S0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}l=f.getCoord(E),E>=0?(v+=l-m,l=v):E<0&&(g-=y-l,l=g),b[n].push([l,p,S,u.getNameByIndex(S),m,p])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"vertical")}function x(e,t,n){var r,s,o,u,a,f,d,m,g,y,b,w;for(var E=h.length-1;E>=0;E--){g=h[E],b=e[E];if(g.type==c.type&&typeof b!="undefined"){r=v[E],s=c.deepQuery([g],"itemStyle.normal.lineStyle.width"),o=c.deepQuery([g],"itemStyle.normal.lineStyle.type"),u=c.deepQuery([g],"itemStyle.normal.lineStyle.color"),a=c.deepQuery([g],"itemStyle.normal.color"),f=c.deepQuery([g],"itemStyle.emphasis.color"),d=typeof c.deepQuery([g],"itemStyle.normal.areaStyle")!="undefined",m=c.deepQuery([g],"itemStyle.normal.areaStyle.color");for(var S=0,x=b.length;S=0;n--){f=c.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(c.shapeList[n]._main){l=c.shapeList[n].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),p=c.shapeList[n]._orient=="horizontal";if(t[f][2]){if(c.shapeList[n].shape=="polygon"){var d=l.length;c.shapeList[n].style.pointList[d-3]=l[d-2],p?c.shapeList[n].style.pointList[d-3][0]=l[d-4][0]:c.shapeList[n].style.pointList[d-3][1]=l[d-4][1],c.shapeList[n].style.pointList[d-2]=l[d-1]}c.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{c.shapeList[n].style.pointList.shift();if(c.shapeList[n].shape=="polygon"){var v=c.shapeList[n].style.pointList.pop();p?v[0]=l[0][0]:v[1]=l[0][1],c.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(c.shapeList[n].id,{style:{pointList:c.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&c.shapeList[n]._dataIndex==h[f].data.length-1){r.delShape(c.shapeList[n].id);continue}if(!t[f][2]&&c.shapeList[n]._dataIndex===0){r.delShape(c.shapeList[n].id);continue}}r.animate(c.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=c.deepQuery([i],"animationDuration"),t=c.deepQuery([i],"animationEasing"),n,s,o,u=0;for(var a=0,f=c.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(E=N-x,B==1&&y[n]>E&&(E=y[n]),T-=E,x=T):O<0?(E=x-k,B==1&&y[n]>E&&(E=y[n]),x=C,C+=E):(E=N-x,T-=E,x=T),L=w(n,M,a.getNameByIndex(M),S,x,m[n]||g,E,"vertical"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H0?(E=S-N,B==1&&y[n]>E&&(E=y[n]),S=T,T+=E):O<0?(E=k-S,B==1&&y[n]>E&&(E=y[n]),C-=E,S=C):(E=S-N,S=T,T+=E),L=w(n,M,a.getNameByIndex(M),S,x-(m[n]||g),E,m[n]||g,"horizontal"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t){i=t,S(e)}function S(e){e&&(r=e,c=r.series),l.clear(),d()}function x(e){var t={};for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function T(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(t){if(d(f,t)){var n=f[t];delete f[t],c[t]=!0,i.apply(e,n)}if(!d(a,t)&&!d(c,t))throw new Error("No "+t);return a[t]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var i,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},i=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1},labelLine:{show:!1,length:30,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},hoverable:!0,itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},markPoint:{symbol:"pin",symbolSize:10,itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{symbol:["circle","arrow"],symbolSize:[2,4],itemStyle:{normal:{borderWidth:2,label:{show:!1,position:"inside",textStyle:{color:"#333"}},lineStyle:{type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,animationThreshold:2500,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),r("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),r("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),r("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),r("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),r("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),r("zrender/tool/area",["require","../tool/util","../shape"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),r("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,d;if(typeof t.pointList!="undefined"){var v=t.pointList;if(v.length<2)return;var m=v.length;switch(a){case"start":l=v[0][0],c=v[1][0],h=v[0][1],d=v[1][1];break;case"end":l=v[m-2][0],c=v[m-1][0],h=v[m-2][1],d=v[m-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,d=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function b(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:v,getHighlightZoom:m,drift:g,isCover:y,updateTransform:b},t}),r("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),r("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),r("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),r("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),r("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),r("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function n(){this.type="text"}var t=e("../tool/area");n.prototype={brush:function(e,n,r){var i=n.style||{};r&&(i=this.getHighlightStyle(i,n.highlightStyle||{}));if(typeof i.text=="undefined")return;e.save(),this.setContext(e,i),n.__needTransform&&e.transform.apply(e,this.updateTransform(n)),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var s=(i.text+"").split("\n"),o=t.getTextHeight("国",i.textFont),u=this.getRect(i),a=i.x,f;i.textBaseline=="top"?f=u.y:i.textBaseline=="bottom"?f=u.y+o:f=u.y+o/2;for(var l=0,c=s.length;l0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),r("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),r("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),r("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=this._clips,n=t.length,r=[],i=[];for(var s=0;s=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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){if(e.lenth<1)return;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}),r("zrender",["zrender/zrender"],function(e){return e}),r("echarts/util/shape/icon",["require","zrender/tool/matrix","zrender/shape","zrender/shape","zrender/shape","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,arrow:y,star:b,heart:w,droplet:E,pin:S,image:x}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){var r=e("zrender/shape").get("heart");r.buildPath(t,{x:n.x+n.width/2,y:n.y+n.height*.2,a:n.width/2,b:n.height*.8})}function E(t,n){var r=e("zrender/shape").get("droplet");r.buildPath(t,{x:n.x+n.width*.5,y:n.y+n.height*.5,a:n.width*.5,b:n.height*.8})}function S(e,t){var n=t.x,r=t.y-t.height/2*1.5,i=t.width/2,s=t.height/2,o=Math.min(i,s);e.arc(n+i,r+s,o,Math.PI/5*4,Math.PI/5),e.lineTo(n+i,r+s+o*1.5)}function x(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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-(e.iconType=="pin"?e.height/2*1.5:0)),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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=o.height<10?4:0;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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}),r("echarts/util/shape/markLine",["require","zrender/tool/matrix","zrender/shape","zrender/shape","zrender/shape/base","zrender/shape"],function(e){function n(){this.type="markLine"}var t=e("zrender/tool/matrix");return n.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildLinePath(e,r),e.stroke(),this.brushSymbol(t,e,r,0),this.brushSymbol(t,e,r,1),typeof r.text!="undefined"&&this.drawText(e,r,t.style),e.restore();return},buildLinePath:function(e,t){var n=t.xStart,r=t.xEnd,i=t.yStart,s=t.yEnd;if(!t.lineType||t.lineType=="solid")e.moveTo(n,i),e.lineTo(r,s);else if(t.lineType=="dashed"||t.lineType=="dotted"){var o=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,n,i,r,s,o)}},brushSymbol:function(n,r,i,s){r.save(),r.beginPath(),r.lineWidth=i.symbolBorder,r.strokeStyle=i.symbolBorderColor,i.iconType=i.symbol[s].replace("empty","").toLowerCase(),i.symbol[s].match("empty")&&(r.fillStyle="rgba(0, 0, 0, 0)");var o=s===0?i.xStart:i.xEnd,u=s===0?i.yStart:i.yEnd,a=typeof i.symbolRotate[s]!="undefined"?i.symbolRotate[s]-0:0,f;a!==0&&(f=t.create(),t.identity(f),(o||u)&&t.translate(f,f,[-o,-u]),t.rotate(f,f,a*Math.PI/180),(o||u)&&t.translate(f,f,[o,u]),r.transform.apply(r,f));if(i.iconType=="arrow"&&a===0)this.buildArrawPath(r,i,s);else{var l=i.symbolSize[s];i.x=o-l,i.y=u-l,i.width=l*2,i.height=l*2,e("zrender/shape").get("icon").buildPath(r,i)}r.closePath(),r.stroke(),r.fill(),r.restore()},buildArrawPath:function(e,t,n){var r=t.symbolSize[n],i=t.xStart,s=t.xEnd,o=t.yStart,u=t.yEnd,a=Math.atan(Math.abs((u-o)/(i-s)));n===0?s>i?u>o&&(a=Math.PI*2-a):u>o?a+=Math.PI:a=Math.PI-a:i>s?o>u&&(a=Math.PI*2-a):o>u?a+=Math.PI:a=Math.PI-a;var f=Math.PI/8,l=n===0?i:s,c=n===0?o:u,h=[[l+r*Math.cos(a-f),c-r*Math.sin(a-f)],[l+r*.6*Math.cos(a),c-r*.6*Math.sin(a)],[l+r*Math.cos(a+f),c-r*Math.sin(a+f)]];e.moveTo(l,c);for(var p=0,d=h.length;p1?o.symbol:[o.symbol[0],o.symbol[0]]:[o.symbol,o.symbol],o.symbolSize=o.symbolSize instanceof Array?o.symbolSize.length>1?o.symbolSize:[o.symbolSize[0],o.symbolSize[0]]:[o.symbolSize,o.symbolSize],o.symbolRotate=o.symbolRotate instanceof Array?o.symbolRotate.length>1?o.symbolRotate:[o.symbolRotate[0],o.symbolRotate[0]]:[o.symbolRotate,o.symbolRotate],o.name=e.name;var a=[],f=o.data,l,c=u.dataRange,h=u.legend,p,d,v,m,g,y=s.zr.getWidth(),b=s.zr.getHeight();for(var w=0,E=f.length;w0?-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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}return e("../chart").define("island",t),t}),r("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}),r("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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}function k(e){return typeof r.data[e].value!="undefined"?r.data[e].value:r.data[e]}function L(e){var t=r.data,n=t.length;for(var i=0;i0?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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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}),r("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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),r("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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);var l;for(var c=0,h=t.length;c=s&&l[0]<=o&&l[1]>=u&&l[1]<=a&&n.push(t[c]);return n}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(t){if(typeof u.query(t,"dataRange.min")=="undefined"||typeof u.query(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||e0&&(n.delShape(j.tipShape),j=!1),e&&n.refresh()}function U(e,t,n){var r=T.offsetHeight,i=T.offsetWidth;e+i>B&&(e=B-i),t+r>H&&(t=H-r),t<20&&(t=0),T.style.cssText=N+C+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(B-e<100||H-t<100)&&setTimeout(z,20)}function z(){if(T){var e="",t=T.offsetHeight,n=T.offsetWidth;T.offsetLeft+n>B&&(e+="left:"+(B-n)+"px;"),T.offsetTop+t>H&&(e+="top:"+(H-t)+"px;"),e!==""&&(T.style.cssText+=e)}}function W(){var e,t;if(!_)V()||X();else{if(_._type=="island"&&r.tooltip.show){Q();return}var n=u.get(_,"series"),i=u.get(_,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(L),clearTimeout(O),L=setTimeout(R,A)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?J(n.xAxisIndex,n.yAxisIndex,u.get(_,"dataIndex")):Q())}}function X(){if(!w||!E){L=setTimeout(R,A);return}var e=r.series,t,n;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 J(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(L),clearTimeout(O),L=setTimeout(R,A);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var S=0,x=u.length;S0){var N;if(typeof d=="function"){var C=[];for(var S=0,x=a.length;S"+ct(a[S].name||"")+" : ",N=a[S].data[s],N=typeof N!="undefined"?typeof N.value!="undefined"?N.value:N:"-",d+=N;T.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(h,p,g)}}function K(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}var f=r.polar[e].indicator[t].text;for(var c=0,h=n.length;c0){var p,d,v=[];for(var c=0,h=s.length;c"+ct(v[0][3])+" : "+v[0][2];for(var c=1,h=v.length;c"+ct(v[c][1])+"
",o+=ct(v[c][3])+" : "+v[c][2];T.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D),l.getY(D),a),!0}}function Q(){var e=u.get(_,"series"),t=u.get(_,"data"),s=u.get(_,"name"),a=u.get(_,"value"),f=u.get(_,"special"),c=u.get(_,"special2"),h,p,d="",v,g="";_._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.query(e,"tooltip.trigger")=="item"&&(p=m.query(e,"tooltip.showContent")||p,h=m.query(e,"tooltip.formatter")||h,d+=q(m.query(e,"tooltip"))),p=m.query(t,"tooltip.showContent")||p,h=m.query(t,"tooltip.formatter")||h,d+=q(m.query(t,"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")P=(e.name||"")+":"+u.get(_,"dataIndex"),T.innerHTML=h([e.name||"",s,a,f,c],P,et);else if(typeof h=="string")P=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ct(e.name||"")).replace("{b0}",ct(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(_,"special2")||""),T.innerHTML=h;else{P=NaN;if(e.type==o.CHART_TYPE_SCATTER)T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
":"")+(s===""?"":ct(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR&&f){v=f,g+=ct(s===""?e.name||"":s),g+=g===""?"":"
";for(var y=0;y";T.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")T.innerHTML=ct(s)+" ("+a+")";else{var b=ct(s),w=ct(f);T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
":"")+b+" -> "+w+" ("+a+")"+"
"+w+" -> "+b+" ("+c+")"}else T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
":"")+ct(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}F.invisible||(F.invisible=!0,n.modShape(F.id,F),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D)+20,l.getY(D)-20,d)}function G(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yB&&(n+="left:"+(B-i)+"px;"),T.offsetTop+r>H&&(n+="top:"+(H-r)+"px;"),n!==""&&(T.style.cssText+=n),(B-T.offsetLeft<100||H-T.offsetTop<100)&&setTimeout(z,20)}function tt(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function nt(e,t){if(!j||j&&j.dataIndex!=e.dataIndex){j&&j.tipShape.length>0&&n.delShape(j.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x={},T=document.createElement("div"),N="position:absolute;display:block;border-style:solid;white-space:nowrap;",C,k,L,A,O,M,_,D,P,H=n.getHeight(),B=n.getWidth(),j=!1,F={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},I={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(F),n.addShape(I),n.on(a.EVENT.MOUSEMOVE,Y),n.on(a.EVENT.GLOBALOUT,Z),m.dispose=lt,m.init=ut,m.refresh=at,m.resize=ft,m.setComponent=tt,m.ontooltipHover=nt,m.ondragend=rt,m.onlegendSelected=it,ut(r,i)}return e("../component").define("tooltip",t),t}),r("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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.query(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.query(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}),r("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),r("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",t),t}),r("echarts/echarts",["require","./config","zrender","zrender/tool/util","zrender/tool/event","zrender/config","./util/shape/icon","./util/shape/markLine","./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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wt.largeThreshold){f.shapeList.push(b(n,f.query(t,"itemStyle.normal.color")||h[s]));continue}for(var o=0,u=n.length;o1e-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}),r("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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),r("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Z(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(P[i],P[i],n,-c),v.scaleAndAdd(P[s],P[s],n,c)}for(var i=0,h=M.length;i>1^-(o&1),u=u>>1^-(u&1),o+=r,u+=i,r=o,i=u,n.push([o/1024,u/1024])}return n}var r={world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],r="",i=e[0],s=e[1];for(var o=0,u=n.length;o180?n-360:n,r=90-(r/e.scale.y+e.offset.y),[n,r]}function o(e,t){return n.offset=e.offset,n.scale=e.scale,t instanceof Array?n.makePoint([t[0]*1,t[1]*1]):n.makePoint([t.x*1,t.y*1])}var n={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,r=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxr&&(t.xmin=r),t.xmaxi&&(t.ymin=i),t.ymax10?n[A][y].value=Math.round(n[A][y].value):n[A][y].value=n[A][y].value.toFixed(2)-0;b[A]=b[A]||{},b[A].mapData?B(A,n[A],a[A])(b[A].mapData):T[A.replace(/\|.*/,"")].getGeoJson&&(E[A]=T[A.replace(/\|.*/,"")].specialArea||E[A],T[A.replace(/\|.*/,"")].getGeoJson(B(A,n[A],a[A])))}}function B(e,t,i){return function(s){e.indexOf("|")!=-1&&(s=j(e,s)),b[e].mapData=s,U(e,F(e,s,i),t,i),z(e,i);if(--x<=0){for(var o=0,u=h.shapeList.length;o1&&(r={geometry:{coordinates:r.geometry.coordinates.slice(5,6),type:r.geometry.type},id:r.id,properties:r.properties,type:r.type});break}return{type:"FeatureCollection",features:[r]}}function F(t,n,r){var i=e("../util/projection/normal"),s=[],o=b[t].bbox||i.getBbox(n,E[t]),u;b[t].hasRoam?u=b[t].transform:u=R(o,r);var a=b[t].lastTransform||{scale:{}},f;u.left!=a.left||u.top!=a.top||u.scale.x!=a.scale.x||u.scale.y!=a.scale.y?(f=i.geoJson2Path(n,u,E[t]),a=l.clone(u)):(u=b[t].transform,f=b[t].pathArray),b[t].bbox=o,b[t].transform=u,b[t].lastTransform=a,b[t].pathArray=f;var c=[u.left,u.top];for(var h=0,p=f.length;hv?(d=v*.75,l=h*d):(v=d,d=v*.75,c=p*v);var m={OffsetLeft:a[0],OffsetTop:a[1],scale:{x:d,y:v}},g=o.geoJson2Path(n,m);return q(t,g[0],s)}function q(e,t,n){var r,i=t.properties.name;return C[i]?r=it(e,C[i]):t.cp&&(r=[t.cp[0],t.cp[1]]),N[i]&&(r[0]+=N[i][0],r[1]+=N[i][1]),{text:X(e,i),path:t.path,position:n,textX:r[0],textY:r[1]}}function R(e,t){var r,i,s,o,u,a,f,l=n.getWidth(),c=n.getHeight(),d=Math.round(Math.min(l,c)*.02);for(var v in t)r=p[v].mapLocation,s=r.x||s,u=r.y||u,a=r.width||a,f=r.height||f;i=h.parsePercent(s,l),i=isNaN(i)?d:i,o=h.parsePercent(u,c),o=isNaN(o)?d:o,typeof a=="undefined"?a=isNaN(s)?l-2*d:l-i-2*d:a=h.parsePercent(a,l),typeof f=="undefined"?f=isNaN(u)?c-2*d:c-o-2*d:f=h.parsePercent(f,c);var m=e.width,g=e.height,y=a/.75/m,b=f/g;y>b?(y=b*.75,a=m*y):(b=y,y=b*.75,f=g*b);if(isNaN(s))switch(s+""){case"center":i=Math.floor((l-a)/2);break;case"right":i=l-a;break;default:}if(isNaN(u))switch(u+""){case"center":o=Math.floor((c-f)/2);break;case"bottom":o=c-f;break;default:}return{left:i,top:o,width:a,height:f,scale:{x:y,y:b}}}function U(e,t,n,r){var s=i.legend,o=i.dataRange,f,c,b,w,E,S=u.map,x,T,N,C,k,L;for(var A=0,O=t.length;A=r&&e<=r+s&&t>=i&&t<=i+o)return u}return}function J(e){var n=e.event,r=c.getX(n),i=c.getY(n),s=c.getDelta(n),o=$(r,i);if(o){var a=b[o].transform,f=a.left,l=a.top,h=a.width,p=a.height;geoAndPos=nt(o,[r-f,i-l]),s>0?(s=1.2,a.scale.x*=s,a.scale.y*=s,a.width=h*s,a.height=p*s):(s=1.2,a.scale.x/=s,a.scale.y/=s,a.width=h/s,a.height=p/s),b[o].hasRoam=!0,b[o].transform=a,geoAndPos=it(o,geoAndPos),a.left-=geoAndPos[0]-(r-f),a.top-=geoAndPos[1]-(i-l),b[o].transform=a,clearTimeout(S),S=setTimeout(et,100),t.dispatch(u.EVENT.MAP_ROAM,e.event,{type:"scale"}),c.stop(n)}}function K(e){var t=e.target;if(t&&t.draggable)return;var r=e.event,i=c.getX(r),s=c.getY(r),o=$(i,s);o&&(M=!0,A=i,O=s,D=o,setTimeout(function(){n.on(f.EVENT.MOUSEMOVE,Q),n.on(f.EVENT.MOUSEUP,G)},50))}function Q(e){if(!M||!h)return;var r=e.event,i=c.getX(r),s=c.getY(r),o=b[D].transform;o.hasRoam=!0,o.left-=A-i,o.top-=O-s,A=i,O=s,b[D].transform=o;var a=[o.left,o.top],f={position:[o.left,o.top]};for(var l=0,p=h.shapeList.length;l0&&y(h,e[h]);for(var u=0,f=l.shapeList.length;u0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}d=f.getCoord(E),E>=0?(v-=m-d,d=v):E<0&&(g+=d-y,d=g),b[n].push([h,d,x,u.getNameByIndex(x),h,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"horizontal")}function E(e,t){var n=t[0][0],r=c[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,h,d,v,m,g,y,b={},w,E;for(var x=0,N=e;x0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}h=f.getCoord(E),E>=0?(v+=h-m,h=v):E<0&&(g-=y-h,h=g),b[n].push([h,d,x,u.getNameByIndex(x),m,d])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"vertical")}function S(e,t,n){var r,s,o,u,a,p,v,m,g,y,b;for(var w=c.length-1;w>=0;w--){m=c[w],y=e[w];if(m.type==l.type&&typeof y!="undefined"){r=d[w],s=l.query(m,"itemStyle.normal.lineStyle.width"),o=l.query(m,"itemStyle.normal.lineStyle.type"),u=l.query(m,"itemStyle.normal.lineStyle.color"),a=l.query(m,"itemStyle.normal.color"),p=typeof l.query(m,"itemStyle.normal.areaStyle")!="undefined",v=l.query(m,"itemStyle.normal.areaStyle.color");for(var E=0,S=y.length;E=0;n--){f=l.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(l.shapeList[n]._main){h=l.shapeList[n].style.pointList,o=Math.abs(h[0][0]-h[1][0]),a=Math.abs(h[0][1]-h[1][1]),p=l.shapeList[n]._orient=="horizontal";if(t[f][2]){if(l.shapeList[n].shape=="polygon"){var d=h.length;l.shapeList[n].style.pointList[d-3]=h[d-2],p?l.shapeList[n].style.pointList[d-3][0]=h[d-4][0]:l.shapeList[n].style.pointList[d-3][1]=h[d-4][1],l.shapeList[n].style.pointList[d-2]=h[d-1]}l.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{l.shapeList[n].style.pointList.shift();if(l.shapeList[n].shape=="polygon"){var v=l.shapeList[n].style.pointList.pop();p?v[0]=h[0][0]:v[1]=h[0][1],l.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(l.shapeList[n].id,{style:{pointList:l.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&l.shapeList[n]._dataIndex==c[f].data.length-1){r.delShape(l.shapeList[n].id);continue}if(!t[f][2]&&l.shapeList[n]._dataIndex===0){r.delShape(l.shapeList[n].id);continue}}r.animate(l.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=l.query(i,"animationDuration"),t=l.query(i,"animationEasing"),n,s,o,u=0;for(var a=0,f=l.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(x=L-C,I==1&&S[s]>x&&(x=S[s]),k-=x,C=k):D<0?(x=C-O,I==1&&S[s]>x&&(x=S[s]),C=A,A+=x):(x=L-C,k-=x,C=k),M=w(s,P,f.getNameByIndex(P),N,C,g[s]||y,x,"vertical"),T[s]=T[s]||{},T[s][P]=N+(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F0?(x=N-L,I==1&&S[s]>x&&(x=S[s]),N=k,k+=x):D<0?(x=O-N,I==1&&S[s]>x&&(x=S[s]),A-=x,N=A):(x=N-L,N=k,k+=x),M=w(s,P,f.getNameByIndex(P),N,C-(g[s]||y),x,g[s]||y,"horizontal"),T[s]=T[s]||{},T[s][P]=C-(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t,n){for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function C(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r{b} : {c}', // 数据孤岛内容格式器,非标准参数 + islandFormatter: '{a}
{b} : {c}', // 数据孤岛内容格式器 showDelay: 20, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms hideDelay: 100, // 隐藏延迟,单位ms transitionDuration : 0.4, // 动画变换时间,单位s @@ -843,7 +843,7 @@ define('echarts/config',[],function() { label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, @@ -860,7 +860,7 @@ define('echarts/config',[],function() { label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -868,8 +868,8 @@ define('echarts/config',[],function() { } }, //smooth : false, - //symbol: null, // 拐点图形类型,非标准参数 - symbolSize: 2, // 可计算特性参数,空数据拖拽提示图形大小 + //symbol: null, // 拐点图形类型 + symbolSize: 2, // 拐点图形大小 //symbolRotate : null, // 拐点图形旋转控制 showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) }, @@ -900,13 +900,14 @@ define('echarts/config',[],function() { scatter: { xAxisIndex: 0, yAxisIndex: 0, - //symbol: null, // 图形类型,非标准参数 + //symbol: null, // 图形类型 symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 //symbolRotate : null, // 拐点图形旋转控制 large: false, // 大规模散点图 largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 itemStyle: { normal: { + // color: 各异, label: { show: false, // 标签文本格式器,同Tooltip.formatter,不支持回调 @@ -918,7 +919,7 @@ define('echarts/config',[],function() { return c[0] + ' , ' + c[1]; } } - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -935,7 +936,7 @@ define('echarts/config',[],function() { return c[0] + ' , ' + c[1]; } } - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -949,16 +950,22 @@ define('echarts/config',[],function() { itemStyle: { normal: { // color: 各异, + label: { + show: false + }, lineStyle: { width: 2, type: 'solid' } }, emphasis: { + label: { + show: false + } // color: 各异, } }, - //symbol: null, // 拐点图形类型,非标准参数 + //symbol: null, // 拐点图形类型 symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 }, @@ -973,6 +980,7 @@ define('echarts/config',[],function() { // roseType : null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) itemStyle: { normal: { + // color: 各异, label: { show: true, position: 'outer' @@ -991,14 +999,14 @@ define('echarts/config',[],function() { }, emphasis: { label: { - show: false, - position: 'outer' + show: false + // position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, labelLine: { show: false, - length: 40, + length: 30, lineStyle: { // color: 各异, width: 1, @@ -1020,6 +1028,7 @@ define('echarts/config',[],function() { // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: // 'sum' | 'average' | 'max' | 'min' // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + hoverable: true, // roam : false, // 是否开启缩放及漫游模式 itemStyle: { normal: { @@ -1161,6 +1170,80 @@ define('echarts/config',[],function() { r: 15, calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% }, + + markPoint : { + symbol: 'pin', // 标注类型 + symbolSize: 10, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + //symbolRotate : null,// 标注旋转控制 + itemStyle: { + normal: { + // color: 各异, + // borderColor: 各异, // 标注边线颜色,优先于color + borderWidth: 2, // 标注边线线宽,单位px,默认为1 + label: { + show: true, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + position: 'inside' // 可选为'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + label: { + show: true + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + // position: 'inside' // 'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } + }, + + markLine : { + // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string + symbol: ['circle', 'arrow'], + // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + symbolSize: [2, 4], + // 标线起始和结束的symbol旋转控制 + //symbolRotate : null, + itemStyle: { + normal: { + // color: 各异, // 标线主色,线色,symbol主色 + // borderColor: 随color, // 标线symbol边框颜色,优先于color + borderWidth: 2, // 标线symbol边框线宽,单位px,默认为2 + label: { + show: false, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom' + position: 'inside', + textStyle: { // 默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + lineStyle: { + // color: 随borderColor, // 主色,线色,优先级高于borderColor和color + // width: 随borderWidth, // 优先于borderWidth + type: 'solid', + shadowColor : 'rgba(0,0,0,0)', //默认透明 + shadowBlur: 5, + shadowOffsetX: 3, + shadowOffsetY: 3 + } + }, + emphasis: { + label: { + show: false + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + // position: 'inside' // 'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle : {} + } + } + }, textStyle: { decoration: 'none', @@ -1174,6 +1257,7 @@ define('echarts/config',[],function() { // -------全局通用 REFRESH: 'refresh', RESTORE: 'restore', + RESIZE: 'resize', CLICK: 'click', HOVER: 'hover', MOUSEWHEEL: 'mousewheel', @@ -1186,6 +1270,7 @@ define('echarts/config',[],function() { PIE_SELECTED: 'pieSelected', MAGIC_TYPE_CHANGED: 'magicTypeChanged', DATA_VIEW_CHANGED: 'dataViewChanged', + MAP_ROAM : 'mapRoam', // -------内部通信 TOOLTIP_HOVER: 'tooltipHover' }, @@ -1197,6 +1282,7 @@ define('echarts/config',[],function() { nameConnector: ' & ', valueConnector: ' : ', animation: true, + animationThreshold: 2500, // 动画元素阀值,产生的图形原素超过2500不出动画 addDataAnimation: true, // 动态数据接口是否开启动画效果 animationDuration: 2000, animationEasing: 'ExponentialOut' //BounceOut @@ -3336,7 +3422,7 @@ define( * getTextWidth:测算单行文本宽度 */ define( - 'zrender/tool/area',['require','../tool/util'],function(require) { + 'zrender/tool/area',['require','../tool/util','../shape'],function(require) { var util = require('../tool/util'); var _ctx; @@ -3748,6 +3834,9 @@ define( * 路径包含判断,依赖多边形判断 */ function _isInsidePath(area, x, y) { + if (!area.pointList) { + require('../shape').get('path').buildPath(_ctx, area); + } var pointList = area.pointList; var insideCatch = false; for (var i = 0, l = pointList.length; i < l; i++) { @@ -3762,7 +3851,7 @@ define( } /** - * 测算单行文本欢度 + * 测算多行文本宽度 * @param {Object} text * @param {Object} textFont */ @@ -3775,16 +3864,49 @@ define( if (textFont) { _ctx.font = textFont; } - var width = _ctx.measureText(text).width; + + text = (text + '').split('\n'); + var width = 0; + for (var i = 0, l = text.length; i < l; i++) { + width = Math.max( + _ctx.measureText(text[i]).width, + width + ); + } _ctx.restore(); return width; } + + /** + * 测算多行文本高度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextHeight(text, textFont) { + if (!_ctx) { + _ctx = util.getContext(); + } + + _ctx.save(); + if (textFont) { + _ctx.font = textFont; + } + + text = (text + '').split('\n'); + //比较粗暴 + var height = (_ctx.measureText('国').width + 2) * text.length; + + _ctx.restore(); + + return height; + } return { isInside : isInside, isOutside : isOutside, - getTextWidth : getTextWidth + getTextWidth : getTextWidth, + getTextHeight : getTextHeight }; } ); @@ -5466,16 +5588,84 @@ define( } if (typeof tx != 'undefined' && typeof ty != 'undefined') { - if (style.textFont) { - ctx.font = style.textFont; - } - ctx.textAlign = style.textAlign || al; - ctx.textBaseline = style.textBaseLine || bl; - - ctx.fillText(style.text, tx, ty); + _fillText( + ctx, + style.text, + tx, ty, + style.textFont, + style.textAlign || al, + style.textBaseline || bl + ); } } + + function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { + if (textFont) { + ctx.font = textFont; + } + ctx.textAlign = textAlign; + ctx.textBaseline = textBaseline; + var rect = _getTextRect( + text, x, y, textFont, textAlign, textBaseline + ); + + text = (text + '').split('\n'); + var lineHeight = area.getTextHeight('国', textFont); + var x = x; + var y; + if (textBaseline == 'top') { + y = rect.y; + } + else if (textBaseline == 'bottom') { + y = rect.y + lineHeight; + } + else { + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + ctx.fillText(text[i], x, y); + y += lineHeight; + } + } + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { + var width = area.getTextWidth(text, textFont); + var lineHeight = area.getTextHeight('国', textFont); + + text = (text + '').split('\n'); + + var textX = x; //默认start == left + if (textAlign == 'end' || textAlign == 'right') { + textX -= width; + } + else if (textAlign == 'center') { + textX -= (width / 2); + } + + var textY; + if (textBaseline == 'top') { + textY = y; + } + else if (textBaseline == 'bottom') { + textY = y - lineHeight * text.length; + } + else { + // middle + textY = y - lineHeight * text.length / 2; + } + return { + x : textX, + y : textY, + width : width, + height : lineHeight * text.length + }; + } + /** * 根据默认样式扩展高亮样式 * @param ctx Canvas 2D上下文 @@ -5516,7 +5706,9 @@ define( // 可自定义覆盖默认值 for (var k in highlightStyle) { - newStyle[k] = highlightStyle[k]; + if (typeof highlightStyle[k] != 'undefined') { + newStyle[k] = highlightStyle[k]; + } } return newStyle; @@ -7154,6 +7346,8 @@ define( */ define( 'zrender/shape/text',['require','../tool/area','./base','../shape'],function(require) { + var area = require('../tool/area'); + function Text() { this.type = 'text'; } @@ -7173,6 +7367,10 @@ define( style, e.highlightStyle || {} ); } + + if (typeof style.text == 'undefined') { + return; + } ctx.save(); this.setContext(ctx, style); @@ -7188,52 +7386,70 @@ define( ctx.textAlign = style.textAlign || 'start'; ctx.textBaseline = style.textBaseline || 'middle'; - if (style.maxWidth) { - switch (style.brushType) { - case 'fill': - ctx.fillText( - style.text, - style.x, style.y, style.maxWidth - ); - break; - case 'stroke': - ctx.strokeText( - style.text, - style.x, style.y, style.maxWidth - ); - break; - case 'both': - ctx.strokeText( - style.text, - style.x, style.y, style.maxWidth - ); - ctx.fillText( - style.text, - style.x, style.y, style.maxWidth - ); - break; - default: - ctx.fillText( - style.text, - style.x, style.y, style.maxWidth - ); - } + var text = (style.text + '').split('\n'); + var lineHeight = area.getTextHeight('国', style.textFont); + var rect = this.getRect(style); + var x = style.x; + var y; + if (style.textBaseline == 'top') { + y = rect.y; } - else{ - switch (style.brushType) { - case 'fill': - ctx.fillText(style.text, style.x, style.y); - break; - case 'stroke': - ctx.strokeText(style.text, style.x, style.y); - break; - case 'both': - ctx.strokeText(style.text, style.x, style.y); - ctx.fillText(style.text, style.x, style.y); - break; - default: - ctx.fillText(style.text, style.x, style.y); + else if (style.textBaseline == 'bottom') { + y = rect.y + lineHeight; + } + else { + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + if (style.maxWidth) { + switch (style.brushType) { + case 'fill': + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + break; + case 'stroke': + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + break; + case 'both': + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + break; + default: + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + } } + else{ + switch (style.brushType) { + case 'fill': + ctx.fillText(text[i], x, y); + break; + case 'stroke': + ctx.strokeText(text[i], x, y); + break; + case 'both': + ctx.strokeText(text[i], x, y); + ctx.fillText(text[i], x, y); + break; + default: + ctx.fillText(text[i], x, y); + } + } + y += lineHeight; } ctx.restore(); @@ -7245,10 +7461,10 @@ define( * @param {Object} style */ getRect : function(style) { - var area = require('../tool/area'); - - var width = area.getTextWidth(style.text, style.textFont); - var height = area.getTextWidth('国', style.textFont); //比较粗暴 + var width = area.getTextWidth(style.text, style.textFont); + var lineHeight = area.getTextHeight('国', style.textFont); + + var text = (style.text + '').split('\n'); var textX = style.x; //默认start == left if (style.textAlign == 'end' || style.textAlign == 'right') { @@ -7258,19 +7474,23 @@ define( textX -= (width / 2); } - var textY = style.y - height / 2; //默认middle + var textY; if (style.textBaseline == 'top') { - textY += height / 2; + textY = style.y; } else if (style.textBaseline == 'bottom') { - textX -= height / 2; + textY = style.y - lineHeight * text.length; + } + else { + // middle + textY = style.y - lineHeight * text.length / 2; } return { x : textX, y : textY, width : width, - height : height + height : lineHeight * text.length }; } }; @@ -7647,14 +7867,19 @@ define('zrender/shape/path',['require','./base','../shape'],function(require) { 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' ]; + + cs = cs.replace(/-/g, ' -'); cs = cs.replace(/ /g, ' '); cs = cs.replace(/ /g, ','); cs = cs.replace(/,,/g, ','); + + var n; // create pipes so that we can split the data for (n = 0; n < cc.length; n++) { cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); } + // create array var arr = cs.split('|'); var ca = []; @@ -9148,7 +9373,7 @@ define( var Clip = require('./clip'); -var requrestAnimationFrame = window.requrestAnimationFrame +var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame @@ -9185,7 +9410,7 @@ Animation.prototype = { update : function() { var time = new Date().getTime(); - var delta = time - this._time; + //var delta = time - this._time; var clips = this._clips; var len = clips.length; @@ -9237,11 +9462,11 @@ Animation.prototype = { function step() { if (self._running) { self.update(); - requrestAnimationFrame(step); + requestAnimationFrame(step); } } - requrestAnimationFrame(step); + requestAnimationFrame(step); }, stop : function() { this._running = false; @@ -10541,32 +10766,8 @@ define( * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ /** @@ -10598,7 +10799,7 @@ define( var _idx = 0; //ZRender instance's id var _instances = {}; //ZRender实例map索引 - self.version = '1.0.7'; + self.version = '1.0.8'; /** * zrender初始化 @@ -11165,6 +11366,9 @@ define( } else { // 批量删除 + if (shapeId.lenth < 1) { // 空数组 + return; + } for (var i = 0, l = shapeId.length; i < l; i++) { delMap[shapeId[i].id] = true; } @@ -12003,6 +12207,7 @@ define( var _isMouseDown = false; var _isDragging = false; var _lastTouchMoment; + var _lastDownButton; var _lastX = 0; var _lastY = 0; @@ -12106,7 +12311,6 @@ define( //if (_mouseX - _lastX > 1 || _mouseY - _lastY > 1) { _dragStartHandler(); //} - _hasfound = false; storage.iterShape(_findHover, { normal: 'down'}); @@ -12209,11 +12413,18 @@ define( * @param {event} event dom事件对象 */ function _mouseDownHandler(event) { + if (_lastDownButton == 2) { + _lastDownButton = event.button; + _mouseDownTarget = null; + // 仅作为关闭右键菜单使用 + return; + } _event = _zrenderEventFixed(event); _isMouseDown = true; //分发config.EVENT.MOUSEDOWN事件 _mouseDownTarget = _lastHover; _dispatchAgency(_lastHover, config.EVENT.MOUSEDOWN); + _lastDownButton = event.button; } /** @@ -12269,7 +12480,7 @@ define( if (new Date() - _lastTouchMoment < config.EVENT.touchClickDelay ) { - _mobildFindFixed() + _mobildFindFixed(); _clickHandler(_event); } painter.clearHover(); @@ -12730,7 +12941,7 @@ define('zrender', ['zrender/zrender'], function (main) { return main; }); } */ define( - 'echarts/util/shape/icon',['require','zrender/tool/matrix','zrender/shape','zrender/shape','zrender/shape/base','zrender/shape'],function(require) { + 'echarts/util/shape/icon',['require','zrender/tool/matrix','zrender/shape','zrender/shape','zrender/shape','zrender/shape','zrender/shape/base','zrender/shape'],function(require) { var matrix = require('zrender/tool/matrix'); function Icon() { @@ -12754,6 +12965,9 @@ define( diamond : _iconDiamond, arrow : _iconArrow, star : _iconStar, + heart : _iconHeart, + droplet : _iconDroplet, + pin : _iconPin, image : _iconImage }; } @@ -13047,6 +13261,42 @@ define( }); } + function _iconHeart(ctx, style) { + var heart = require('zrender/shape').get('heart'); + heart.buildPath(ctx, { + x : style.x + style.width / 2, + y : style.y + style.height * 0.2, + a : style.width / 2, + b : style.height * 0.8 + }); + } + + function _iconDroplet(ctx, style) { + var droplet = require('zrender/shape').get('droplet'); + droplet.buildPath(ctx, { + x : style.x + style.width * 0.5, + y : style.y + style.height * 0.5, + a : style.width * 0.5, + b : style.height * 0.8 + }); + } + + function _iconPin(ctx, style) { + var x = style.x; + var y = style.y - style.height / 2 * 1.5; + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.arc( + x + width, + y + height, + r, + Math.PI / 5 * 4, + Math.PI / 5 + ); + ctx.lineTo(x + width, y + height + r * 1.5); + } + function _iconImage(ctx, style) { setTimeout(function(){ require('zrender/shape').get('image').brush(ctx, { @@ -13081,9 +13331,12 @@ define( * @param {Object} style */ getRect : function(style) { + // pin比较特殊,让尖端在目标x,y上 return { x : Math.round(style.x), - y : Math.round(style.y), + y : Math.round(style.y - (style.iconType == 'pin' + ? (style.height / 2 * 1.5) : 0) + ), width : style.width, height : style.height }; @@ -13126,8 +13379,8 @@ define( rect = this.getRect(e.style); e.style.__rect = rect; } - // 提高交互体验,包围盒四向扩大5px - var delta = 5; + // 提高交互体验,太小的图形包围盒四向扩大4px + var delta = rect.height < 10 ? 4 : 0; if (x >= rect.x - delta && x <= (rect.x + rect.width + 2 * delta) && y >= rect.y - delta @@ -13156,6 +13409,263 @@ define( return Icon; } ); +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:标线 + */ +define( + 'echarts/util/shape/markLine',['require','zrender/tool/matrix','zrender/shape','zrender/shape','zrender/shape/base','zrender/shape'],function(require) { + var matrix = require('zrender/tool/matrix'); + + function MarkLine() { + this.type = 'markLine'; + } + + MarkLine.prototype = { + /** + * 画刷 + * @param ctx 画布句柄 + * @param e 形状实体 + * @param isHighlight 是否为高亮状态 + * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + brush : function(ctx, e, isHighlight) { + var style = e.style || {}; + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + e.highlightStyle || {} + ); + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + if (e.__needTransform) { + ctx.transform.apply(ctx,this.updateTransform(e)); + } + + ctx.beginPath(); + this.buildLinePath(ctx, style); + ctx.stroke(); + + this.brushSymbol(e, ctx, style, 0); + this.brushSymbol(e, ctx, style, 1); + + if (typeof style.text != 'undefined') { + this.drawText(ctx, style, e.style); + } + + ctx.restore(); + + return; + }, + + /** + * 创建线条路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildLinePath : function(ctx, style) { + //var symbolSize = style.symbolSize; + var xStart = style.xStart; + var xEnd = style.xEnd; + var yStart = style.yStart; + var yEnd = style.yEnd; + /* + if (xStart > xEnd) { + xStart -= symbolSize[0]; + xEnd += symbolSize[1]; + } + else { + xStart += symbolSize[0]; + xEnd -= symbolSize[1]; + } + if (yStart > yEnd) { + yStart -= symbolSize[0]; + yEnd += symbolSize[1]; + } + else { + yStart += symbolSize[0]; + yEnd -= symbolSize[1]; + } + */ + if (!style.lineType || style.lineType == 'solid') { + //默认为实线 + ctx.moveTo(xStart, yStart); + ctx.lineTo(xEnd, yEnd); + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength =(style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + this.dashedLineTo( + ctx, + xStart, yStart, + xEnd, yEnd, + dashLength + ); + } + }, + + /** + * 标线始末标注 + */ + brushSymbol : function(e, ctx, style, idx) { + ctx.save(); + ctx.beginPath(); + + ctx.lineWidth = style.symbolBorder; + ctx.strokeStyle = style.symbolBorderColor; + // symbol + style.iconType = style.symbol[idx].replace('empty', '') + .toLowerCase(); + if (style.symbol[idx].match('empty')) { + ctx.fillStyle = 'rgba(0, 0, 0, 0)'; + } + + // symbolRotate + var x = idx === 0 ? style.xStart : style.xEnd; + var y = idx === 0 ? style.yStart : style.yEnd; + var rotate = typeof style.symbolRotate[idx] != 'undefined' + ? (style.symbolRotate[idx] - 0) : 0; + var transform; + if (rotate !== 0) { + transform = matrix.create(); + matrix.identity(transform); + if (x || y ) { + matrix.translate(transform, transform, [-x, -y]); + } + matrix.rotate( + transform, transform, + rotate * Math.PI / 180 + ); + if (x || y ) { + matrix.translate(transform, transform, [x, y]); + } + ctx.transform.apply(ctx, transform); + } + + if (style.iconType == 'arrow' && rotate === 0) { + // 箭头自动旋转,手动画 + this.buildArrawPath(ctx, style, idx); + } + else { + // symbolSize + var symbolSize = style.symbolSize[idx]; + style.x = x - symbolSize; + style.y = y - symbolSize, + style.width = symbolSize * 2; + style.height = symbolSize * 2; + require('zrender/shape').get('icon').buildPath(ctx, style); + } + + ctx.closePath(); + ctx.stroke(); + ctx.fill(); + ctx.restore(); + }, + + buildArrawPath : function (ctx, style, idx) { + var symbolSize = style.symbolSize[idx]; + var xStart = style.xStart; + var xEnd = style.xEnd; + var yStart = style.yStart; + var yEnd = style.yEnd; + // 原谅我吧,这三角函数实在没想明白,只能这么笨了 + var rotate = Math.atan( + Math.abs((yEnd - yStart) / (xStart - xEnd) + )); + if (idx === 0) { + if (xEnd > xStart) { + if (yEnd > yStart) { + rotate = Math.PI * 2 - rotate; + } + } + else { + if (yEnd > yStart) { + rotate += Math.PI; + } + else { + rotate = Math.PI - rotate; + } + } + } + else { + if (xStart > xEnd) { + if (yStart > yEnd) { + rotate = Math.PI * 2 - rotate; + } + } + else { + if (yStart > yEnd) { + rotate += Math.PI; + } + else { + rotate = Math.PI - rotate; + } + } + } + + var halfRotate = Math.PI / 8; // 夹角 + var x = idx === 0 ? xStart : xEnd; + var y = idx === 0 ? yStart : yEnd; + var point= [ + [ + x + symbolSize * Math.cos(rotate - halfRotate), + y - symbolSize * Math.sin(rotate - halfRotate), + ], + [ + x + symbolSize * 0.6 * Math.cos(rotate), + y - symbolSize * 0.6 * Math.sin(rotate), + ], + [ + x + symbolSize * Math.cos(rotate + halfRotate), + y - symbolSize * Math.sin(rotate + halfRotate), + ] + ]; + ctx.moveTo(x, y); + for (var i = 0, l = point.length; i 1 + ? mlOption.symbol + : [mlOption.symbol[0], mlOption.symbol[0]] + : [mlOption.symbol, mlOption.symbol]; + mlOption.symbolSize = mlOption.symbolSize instanceof Array + ? mlOption.symbolSize.length > 1 + ? mlOption.symbolSize + : [mlOption.symbolSize[0], mlOption.symbolSize[0]] + : [mlOption.symbolSize, mlOption.symbolSize]; + mlOption.symbolRotate = mlOption.symbolRotate instanceof Array + ? mlOption.symbolRotate.length > 1 + ? mlOption.symbolRotate + : [mlOption.symbolRotate[0], mlOption.symbolRotate[0]] + : [mlOption.symbolRotate, mlOption.symbolRotate]; + + mlOption.name = serie.name; + + var pList = []; + var data = mlOption.data; + var itemShape; + + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget; + var nColor; + var eColor; + var zrWidth = self.zr.getWidth(); + var zrHeight = self.zr.getHeight(); + for (var i = 0, l = data.length; i < l; i++) { + // 图例 + if (legend) { + color = legend.getColor(serie.name); + } + // 值域 + if (dataRange) { + value = typeof data[i][0] != 'undefined' + ? (typeof data[i][0].value != 'undefined' + ? data[i][0].value + : data[i][0]) + : '-'; + color = isNaN(value) ? color : dataRange.getColor(value); + + queryTarget = [data[i][0], mlOption]; + nColor = self.deepQuery( + queryTarget, 'itemStyle.normal.color' + ) || color; + eColor = self.deepQuery( + queryTarget, 'itemStyle.emphasis.color' + ) || nColor; + // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark + if (nColor == null && eColor == null) { + continue; + } + } + + // 标准化一些参数 + data[i][0].tooltip = {trigger:'item'}; // tooltip.trigger指定为item + data[i][0].name = typeof data[i][0].name != 'undefined' + ? data[i][0].name : ''; + data[i][1].name = typeof data[i][1].name != 'undefined' + ? data[i][1].name : ''; + data[i][0].value = typeof data[i][0].value != 'undefined' + ? data[i][0].value : ''; + + // 复用getSymbolShape + itemShape = getLineMarkShape( + mlOption, // markLine + data[i], // 数据 + parsePercent(data[i][0].x, zrWidth), // 坐标 + parsePercent(data[i][0].y, zrHeight), // 坐标 + parsePercent(data[i][1].x, zrWidth), // 坐标 + parsePercent(data[i][1].y, zrHeight), // 坐标 + color // 默认symbol和color + ); + + // 重新pack一下数据 + ecData.pack( + itemShape, + serie, seriesIndex, + data[i][0], 0, + data[i][0].name + ' : ' + data[i][1].name + ); + pList.push(itemShape); + } + //console.log(pList); + return pList; + } + + function getMarkCoord() { + // 无转换位置 + return [0, 0]; + } + + function getSymbolShape( + serie, seriesIndex, // 系列 + data, dataIndex, name, // 数据 + x, y, // 坐标 + symbol, color, // 默认symbol和color,来自legend或dataRange全局分配 + emptyColor, // 折线的emptySymbol用白色填充 + orient // 走向,用于默认文字定位 + ) { + var queryTarget = [data, serie]; + var value = typeof data != 'undefined' + ? (typeof data.value != 'undefined' + ? data.value + : data) + : '-'; + + symbol = self.deepQuery(queryTarget, 'symbol') || symbol; + var symbolSize = self.deepQuery(queryTarget, 'symbolSize'); + symbolSize = typeof symbolSize == 'function' + ? symbolSize(value) + : symbolSize; + var symbolRotate = self.deepQuery(queryTarget, 'symbolRotate'); + + var normal = self.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + var emphasis = self.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + var nBorderWidth = typeof normal.borderWidth != 'undefined' + ? normal.borderWidth + : (normal.lineStyle && normal.lineStyle.width * 2); + if (typeof nBorderWidth == 'undefined') { + nBorderWidth = 0; + } + var eBorderWidth = typeof emphasis.borderWidth != 'undefined' + ? emphasis.borderWidth + : (emphasis.lineStyle && emphasis.lineStyle.width * 2); + if (typeof eBorderWidth == 'undefined') { + eBorderWidth = nBorderWidth + 2; + } + + var itemShape = { + shape : 'icon', + style : { + iconType : symbol.replace('empty', '').toLowerCase(), + x : x - symbolSize, + y : y - symbolSize, + width : symbolSize * 2, + height : symbolSize * 2, + brushType : 'both', + color : symbol.match('empty') + ? emptyColor + : (normal.color || color), + strokeColor : normal.borderColor || normal.color || color, + lineWidth: nBorderWidth + }, + highlightStyle : { + color : symbol.match('empty') + ? emptyColor + : (emphasis.color|| normal.color || color), + strokeColor : emphasis.borderColor || normal.borderColor + || emphasis.color || normal.color || color, + lineWidth: eBorderWidth + }, + clickable : true + }; + + if (symbol.match('image')) { + itemShape.style.image = + symbol.replace(new RegExp('^image:\\/\\/'), ''); + itemShape.shape = 'image'; + } + + if (typeof symbolRotate != 'undefined') { + itemShape.rotation = [ + symbolRotate * Math.PI / 180, x, y + ]; + } + + if (symbol.match('star')) { + itemShape.style.iconType = 'star'; + itemShape.style.n = + (symbol.replace('empty', '').replace('star','') - 0) || 5; + } + + if (symbol == 'none') { + itemShape.invisible = true; + itemShape.hoverable = false; + } + + /* + if (self.deepQuery([data, serie, option], 'calculable')) { + self.setCalculable(itemShape); + itemShape.draggable = true; + } + */ + + itemShape = self.addLabel( + itemShape, + serie, data, name, + orient + ); + + if (symbol.match('empty')) { + if (typeof itemShape.style.textColor == 'undefined') { + itemShape.style.textColor = itemShape.style.strokeColor; + } + if (typeof itemShape.highlightStyle.textColor == 'undefined') { + itemShape.highlightStyle.textColor = + itemShape.highlightStyle.strokeColor; + } + } + + ecData.pack( + itemShape, + serie, seriesIndex, + data, dataIndex, + name + ); + + itemShape._mark = 'point'; // 复用animationMark + itemShape._x = x; + itemShape._y = y; + + itemShape._dataIndex = dataIndex; + itemShape._seriesIndex = seriesIndex; + + return itemShape; + } + + function getLineMarkShape( + mlOption, // 系列 + data, // 数据 + xStart, yStart, // 坐标 + xEnd, yEnd, // 坐标 + color // 默认color,来自legend或dataRange全局分配 + ) { + var value0 = typeof data[0] != 'undefined' + ? (typeof data[0].value != 'undefined' + ? data[0].value + : data[0]) + : '-'; + var value1 = typeof data[1] != 'undefined' + ? (typeof data[1].value != 'undefined' + ? data[1].value + : data[1]) + : '-'; + var symbol = [ + self.query(data[0], 'symbol') || mlOption.symbol[0], + self.query(data[1], 'symbol') || mlOption.symbol[1] + ]; + var symbolSize = [ + self.query(data[0], 'symbolSize') || mlOption.symbolSize[0], + self.query(data[1], 'symbolSize') || mlOption.symbolSize[1] + ]; + symbolSize[0] = typeof symbolSize[0] == 'function' + ? symbolSize[0](value0) + : symbolSize[0]; + symbolSize[1] = typeof symbolSize[1] == 'function' + ? symbolSize[1](value1) + : symbolSize[1]; + var symbolRotate = [ + self.query(data[0], 'symbolRotate') || mlOption.symbolRotate[0], + self.query(data[1], 'symbolRotate') || mlOption.symbolRotate[1] + ]; + //console.log(symbol, symbolSize, symbolRotate); + + var queryTarget = [data[0], mlOption]; + var normal = self.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + var emphasis = self.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + + var nlineStyle = normal.lineStyle; + var elineStyle = emphasis.lineStyle; + + var nBorderWidth = nlineStyle.width; + if (typeof nBorderWidth == 'undefined') { + nBorderWidth = normal.borderWidth; + } + var eBorderWidth = elineStyle.width; + if (typeof eBorderWidth == 'undefined') { + if (typeof emphasis.borderWidth != 'undefined') { + eBorderWidth = emphasis.borderWidth; + } + else { + eBorderWidth = nBorderWidth + 2; + } + } + + var itemShape = { + shape : 'markLine', + style : { + symbol : symbol, + symbolSize : symbolSize, + symbolRotate : symbolRotate, + //data : [data[0].name,data[1].name], + xStart : xStart, + yStart : yStart, // 坐标 + xEnd : xEnd, + yEnd : yEnd, // 坐标 + brushType : 'both', + lineType : nlineStyle.type, + shadowColor : nlineStyle.shadowColor, + shadowBlur: nlineStyle.shadowBlur, + shadowOffsetX: nlineStyle.shadowOffsetX, + shadowOffsetY: nlineStyle.shadowOffsetY, + color : normal.color || color, + strokeColor : nlineStyle.color + || normal.borderColor + || color + || normal.color, + lineWidth: nBorderWidth, + symbolBorderColor: normal.borderColor + || color + || normal.color, + symbolBorder: normal.borderWidth * 2 + }, + highlightStyle : { + shadowColor : elineStyle.shadowColor, + shadowBlur: elineStyle.shadowBlur, + shadowOffsetX: elineStyle.shadowOffsetX, + shadowOffsetY: elineStyle.shadowOffsetY, + color : emphasis.color|| normal.color || color, + strokeColor : elineStyle.color + || nlineStyle.color + || emphasis.borderColor + || normal.borderColor + || color + || emphasis.color + || normal.color, + lineWidth: eBorderWidth, + symbolBorderColor: emphasis.borderColor + || normal.borderColor + || color + || emphasis.color + || normal.color, + symbolBorder: typeof emphasis.borderWidth == 'undefined' + ? (normal.borderWidth * 2 + 2) + : (emphasis.borderWidth * 2) + }, + clickable : true + }; + + itemShape = self.addLabel( + itemShape, + mlOption, + data[0], + data[0].name + ' : ' + data[1].name + ); + + itemShape._mark = 'line'; + itemShape._x = xEnd; + itemShape._y = yEnd; + + return itemShape; + } + /** * 百分比计算 */ @@ -13499,6 +14705,63 @@ define('echarts/component/base',['require','../config','zrender/tool/util'],func } return position; } + + /** + * 动画设定 + */ + function animation() { + if (_aniMap[self.type]) { + self.animationMark(ecConfig.animationDuration); + } + } + + function animationMark(duration /*, easing*/) { + var x; + var y; + for (var i = 0, l = self.shapeList.length; i < l; i++) { + if (!self.shapeList[i]._mark) { + continue; + } + x = self.shapeList[i]._x || 0; + y = self.shapeList[i]._y || 0; + if (self.shapeList[i]._mark == 'point') { + zr.modShape( + self.shapeList[i].id, + { + scale : [0, 0, x, y] + }, + true + ); + zr.animate(self.shapeList[i].id, '') + .when( + duration, + {scale : [1, 1, x, y]} + ) + .start('QuinticOut'); + } + else if (self.shapeList[i]._mark == 'line') { + zr.modShape( + self.shapeList[i].id, + { + style : { + xEnd : self.shapeList[i].style.xStart, + yEnd : self.shapeList[i].style.yStart + } + }, + true + ); + zr.animate(self.shapeList[i].id, 'style') + .when( + duration, + { + xEnd : x, + yEnd : y + } + ) + .start('QuinticOut'); + } + } + } function resize() { self.refresh && self.refresh(); @@ -13536,138 +14799,23 @@ define('echarts/component/base',['require','../config','zrender/tool/util'],func self.deepMerge = deepMerge; self.getFont = getFont; self.addLabel = addLabel; + self.buildMark = buildMark; + self.getMarkCoord = getMarkCoord; + self.getSymbolShape = getSymbolShape; self.parsePercent = parsePercent; self.parseCenter = parseCenter; self.parseRadius = parseRadius; self.subPixelOptimize = subPixelOptimize; + self.animation = animation; + self.animationMark = animationMark; + self.resize = resize; self.clear = clear; self.dispose = dispose; - self.resize = resize; } return Base; }); -/** - * echarts通用私有数据服务 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/ecData',[],function() { - /** - * 打包私有数据 - * - * @param {shape} shape 修改目标 - * @param {Object} series - * @param {number} seriesIndex - * @param {number | Object} data - * @param {number} dataIndex - * @param {*=} special - * @param {*=} special2 - */ - function pack( - shape, series, seriesIndex, data, dataIndex, name, special, special2 - ) { - var value; - if (typeof data != 'undefined') { - if (typeof data.value != 'undefined') { - value = data.value; - } - else { - value = data; - } - } - - shape._echartsData = { - '_series' : series, - '_seriesIndex' : seriesIndex, - '_data' : data, - '_dataIndex' : dataIndex, - '_name' : name, - '_value' : value, - '_special' : special, - '_special2' : special2 - }; - return shape._echartsData; - } - - /** - * 从私有数据中获取特定项 - * @param {shape} shape - * @param {string} key - */ - function get(shape, key) { - var data = shape._echartsData; - if (!key) { - return data; - } - - switch (key) { - case 'series' : - return data && data._series; - case 'seriesIndex' : - return data && data._seriesIndex; - case 'data' : - return data && data._data; - case 'dataIndex' : - return data && data._dataIndex; - case 'name' : - return data && data._name; - case 'value' : - return data && data._value; - case 'special' : - return data && data._special; - case 'special2' : - return data && data._special2; - } - - return null; - } - - /** - * 修改私有数据中获取特定项 - * @param {shape} shape - * @param {string} key - * @param {*} value - */ - function set(shape, key, value) { - shape._echartsData = shape._echartsData || {}; - switch (key) { - case 'series' : // 当前系列值 - shape._echartsData._series = value; - break; - case 'seriesIndex' : // 系列数组位置索引 - shape._echartsData._seriesIndex = value; - break; - case 'data' : // 当前数据值 - shape._echartsData._data = value; - break; - case 'dataIndex' : // 数据数组位置索引 - shape._echartsData._dataIndex = value; - break; - case 'name' : - shape._echartsData._name = value; - break; - case 'value' : - shape._echartsData._value = value; - break; - case 'special' : - shape._echartsData._special = value; - break; - case 'special2' : - shape._echartsData._special2 = value; - break; - } - } - - return { - pack : pack, - set : set, - get : get - }; -}); /** * 高精度数学运算 */ @@ -14364,11 +15512,11 @@ define('echarts/component/title',['require','./base','../config','zrender/tool/a zrArea.getTextWidth(text, font), zrArea.getTextWidth(subtext, subfont) ); - var totalHeight = zrArea.getTextWidth('国', font) + var totalHeight = zrArea.getTextHeight(text, font) + (subtext === '' ? 0 : (titleOption.itemGap - + zrArea.getTextWidth('国', subfont)) + + zrArea.getTextHeight(subtext, subfont)) ); var x; @@ -14716,7 +15864,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender // 小标记 function _buildAxisTick() { var axShape; - var data = option.data; + //var data = option.data; var dataLength = option.data.length; var length = option.axisTick.length; var color = option.axisTick.lineStyle.color; @@ -14733,9 +15881,9 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender zlevel : _zlevelBase, hoverable : false, style : { - xStart : getCoord(data[i].value || data[i]), + xStart : getCoordByIndex(i), yStart : yPosition, - xEnd : getCoord(data[i].value || data[i]), + xEnd : getCoordByIndex(i), yEnd : yPosition + length, strokeColor : color, lineWidth : lineWidth @@ -14756,9 +15904,9 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender hoverable : false, style : { xStart : xPosition, - yStart : getCoord(data[i].value || data[i]), + yStart : getCoordByIndex(i), xEnd : xPosition + length, - yEnd : getCoord(data[i].value || data[i]), + yEnd : getCoordByIndex(i), strokeColor : color, lineWidth : lineWidth } @@ -14792,6 +15940,10 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender } for (var i = 0; i < dataLength; i += _interval) { + if ((_labelData[i].value || _labelData[i]) === '') { + // 空文本优化 + continue; + } dataTextStyle = zrUtil.merge( data[i].textStyle || {}, textStyle, @@ -14802,7 +15954,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender zlevel : _zlevelBase, hoverable : false, style : { - x : getCoord(data[i].value || data[i]), + x : getCoordByIndex(i), y : yPosition, color : dataTextStyle.color, text : _labelData[i].value || _labelData[i], @@ -14840,6 +15992,10 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender } for (var i = 0; i < dataLength; i += _interval) { + if ((_labelData[i].value || _labelData[i]) === '') { + // 空文本优化 + continue; + } dataTextStyle = zrUtil.merge( data[i].textStyle || {}, textStyle, @@ -14851,7 +16007,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender hoverable : false, style : { x : xPosition, - y : getCoord(data[i].value || data[i]), + y : getCoordByIndex(i), color : dataTextStyle.color, text : _labelData[i].value || _labelData[i], textFont : self.getFont(dataTextStyle), @@ -14873,7 +16029,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender function _buildSplitLine() { var axShape; - var data = option.data; + //var data = option.data; var dataLength = option.data.length; var lineType = option.splitLine.lineStyle.type; var lineWidth = option.splitLine.lineStyle.width; @@ -14890,7 +16046,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i < dataLength; i += _interval) { // 亚像素优化 x = self.subPixelOptimize( - getCoord(data[i].value || data[i]), lineWidth + getCoordByIndex(i), lineWidth ); axShape = { shape : 'line', @@ -14919,7 +16075,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i < dataLength; i += _interval) { // 亚像素优化 y = self.subPixelOptimize( - getCoord(data[i].value || data[i]), lineWidth + getCoordByIndex(i), lineWidth ); axShape = { shape : 'line', @@ -14945,7 +16101,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender var color = option.splitArea.areaStyle.color; color = color instanceof Array ? color : [color]; var colorLength = color.length; - var data = option.data; + //var data = option.data; var dataLength = option.data.length; if (option.position == 'bottom' || option.position == 'top') { @@ -14957,7 +16113,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i <= dataLength; i += _interval) { curX = i < dataLength - ? getCoord(data[i].value || data[i]) + ? getCoordByIndex(i) : grid.getXend(); axShape = { shape : 'rectangle', @@ -14985,7 +16141,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i <= dataLength; i += _interval) { curY = i < dataLength - ? getCoord(data[i].value || data[i]) + ? getCoordByIndex(i) : grid.getY(); axShape = { shape : 'rectangle', @@ -15142,7 +16298,27 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender // 根据类目轴数据索引换算类目轴名称 function getNameByIndex(dataIndex) { - return option.data[dataIndex]; + if (typeof option.data[dataIndex].value != 'undefined') { + return option.data[dataIndex].value; + } + else { + return option.data[dataIndex]; + } + } + + // 根据类目轴名称换算类目轴数据索引 + function getIndexByName(name) { + var data = option.data; + var dataLength = data.length; + + for (var i = 0; i < dataLength; i++) { + if (data[i] == name + || (typeof data[i].value != 'undefined' + && data[i].value == name) + ) { + return i; + } + } } /** @@ -15164,6 +16340,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender self.getCoord = getCoord; self.getCoordByIndex = getCoordByIndex; self.getNameByIndex = getNameByIndex; + self.getIndexByName = getIndexByName; self.isMainAxis = isMainAxis; self.getPosition = getPosition; @@ -16311,25 +17488,26 @@ define('echarts/component/grid',['require','./base','../config','../component'], option.grid = self.reformOption(option.grid); var gridOption = option.grid; - _x = gridOption.x; - _y = gridOption.y; - var x2 = gridOption.x2; - var y2 = gridOption.y2; _zrWidth = zr.getWidth(); _zrHeight = zr.getHeight(); + _x = self.parsePercent(gridOption.x, _zrWidth); + _y = self.parsePercent(gridOption.y, _zrHeight); + var x2 = self.parsePercent(gridOption.x2, _zrWidth); + var y2 = self.parsePercent(gridOption.y2, _zrHeight); + if (typeof gridOption.width == 'undefined') { _width = _zrWidth - _x - x2; } else { - _width = gridOption.width; + _width = self.parsePercent(gridOption.width, _zrWidth); } if (typeof gridOption.height == 'undefined') { _height = _zrHeight - _y - y2; } else { - _height = gridOption.height; + _height = self.parsePercent(gridOption.height, _zrHeight); } _x = self.subPixelOptimize(_x, gridOption.borderWidth); @@ -17192,11 +18370,13 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen } // console.log(xStart,xEnd,yStart,yEnd); + var value; for (var i = 0, l = data.length; i < l; i++) { - if (data[i][0] >= xStart - && data[i][0] <= xEnd - && data[i][1] >= yStart - && data[i][1] <= yEnd + value = data[i].value || data[i]; + if (value[0] >= xStart + && value[0] <= xEnd + && value[1] >= yStart + && value[1] <= yEnd ) { newData.push(data[i]); } @@ -17308,8 +18488,8 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen var total; var sdx = (rect.x - gridArea.x) / gridArea.width; - var edx = 1- (rect.x + rect.width - gridArea.x) / gridArea.width; - var sdy = 1- (rect.y + rect.height - gridArea.y) / gridArea.height; + var edx = 1 - (rect.x + rect.width - gridArea.x) / gridArea.width; + var sdy = 1 - (rect.y + rect.height - gridArea.y) / gridArea.height; var edy = (rect.y - gridArea.y) / gridArea.height; //console.log('this',sdy,edy,_zoom.start,_zoom.end) if (zoomOption.orient == 'horizontal') { @@ -17366,9 +18546,22 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen } } } + function silence(s) { _isSilence = s; } + + function getRealDataIndex(sIdx, dIdx) { + if (!_originalData) { + return dIdx; + } + var sreies = _originalData.series; + if (sreies[sIdx]) { + return Math.floor(_zoom.start / 100 * sreies[sIdx].length) + + dIdx; + } + return -1; + } function init(newOption) { option = newOption; @@ -17382,8 +18575,8 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen // 自己show 或者 toolbox启用且dataZoom有效 if (option.dataZoom.show || ( - self.deepQuery([option], 'toolbox.show') - && self.deepQuery([option], 'toolbox.feature.dataZoom') + self.query(option, 'toolbox.show') + && self.query(option, 'toolbox.feature.dataZoom') ) ) { _location = _getLocation(); @@ -17405,8 +18598,8 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen // 自己show 或者 toolbox启用且dataZoom有效 if (option.dataZoom.show || ( - self.deepQuery([option], 'toolbox.show') - && self.deepQuery([option], 'toolbox.feature.dataZoom') + self.query(option, 'toolbox.show') + && self.query(option, 'toolbox.feature.dataZoom') ) ) { _location = _getLocation(); @@ -17434,6 +18627,7 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen self.ondragend = ondragend; self.ondataZoom = ondataZoom; self.silence = silence; + self.getRealDataIndex = getRealDataIndex; init(option); } @@ -17876,12 +19070,12 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ break; case 'k' : itemShape.style.brushType = 'both'; - itemShape.style.color = self.deepQuery( - [ecConfig], 'k.itemStyle.normal.color' + itemShape.style.color = self.query( + ecConfig, 'k.itemStyle.normal.color' ) || '#fff'; itemShape.style.strokeColor = color != '#ccc' - ? self.deepQuery( - [ecConfig], 'k.itemStyle.normal.lineStyle.color' + ? self.query( + ecConfig, 'k.itemStyle.normal.lineStyle.color' ) || '#ff3200' : color; } @@ -17899,7 +19093,7 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ } function init(newOption) { - if (!self.deepQuery([newOption], 'legend.data')) { + if (!self.query(newOption, 'legend.data')) { return; } @@ -17931,8 +19125,8 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ _selectedMap[itemName] = false; } else { - color = self.deepQuery( - [serie], 'itemStyle.normal.color' + color = self.query( + serie, 'itemStyle.normal.color' ); if (color && serie.type != ecConfig.CHART_TYPE_K) { setColor(itemName, color); @@ -18054,6 +19248,10 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ return true; } } + + function getSelectedMap() { + return _selectedMap; + } self.init = init; self.refresh = refresh; @@ -18065,6 +19263,7 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ self.getItemShape = getItemShape; self.setItemShape = setItemShape; self.isSelected = isSelected; + self.getSelectedMap = getSelectedMap; init(option); } @@ -18283,7 +19482,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var itemWidth = dataRangeOption.itemWidth; var itemHeight = dataRangeOption.itemHeight; var itemGap = dataRangeOption.itemGap; - var textHeight = zrArea.getTextWidth('国', font); + var textHeight = zrArea.getTextHeight('国', font); var color; if (dataRangeOption.orient == 'vertical' @@ -18310,6 +19509,8 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } else { lastY += textHeight + _textGap; + textShape.style.y += textHeight / 2 + _textGap; + textShape.style.textBaseline = 'bottom'; } self.shapeList.push(textShape); } @@ -18380,6 +19581,11 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to textShape = _getTextShape( lastX, lastY, dataRangeOption.text[1] ); + + if (dataRangeOption.orient != 'horizontal') { + textShape.style.y -= 5; + textShape.style.textBaseline = 'top'; + } self.shapeList.push(textShape); } @@ -18397,7 +19603,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var lastY = _itemGroupLocation.y; var itemWidth = dataRangeOption.itemWidth; var itemHeight = dataRangeOption.itemHeight; - var textHeight = zrArea.getTextWidth('国', font); + var textHeight = zrArea.getTextHeight('国', font); var needValueText = true; @@ -18417,6 +19623,8 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } else { lastY += textHeight + _textGap; + textShape.style.y += textHeight / 2 + _textGap; + textShape.style.textBaseline = 'bottom'; } self.shapeList.push(textShape); } @@ -18515,7 +19723,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var height = _calculableLocation.height; var font = self.getFont(dataRangeOption.textStyle); - var textHieght = zrArea.getTextWidth('国', font) + 2; + var textHeight = zrArea.getTextHeight('国', font); var textWidth = Math.max( zrArea.getTextWidth( dataRangeOption.precision === 0 @@ -18546,23 +19754,23 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to // 手柄统统在下方 pointListStart = [ [x, y], - [x, y + height + textHieght / 2 * 3], - [x - textWidth, y + height + textHieght / 2 * 3], - [x - textWidth, y + height + textHieght / 2], - [x - textHieght / 2, y + height + textHieght / 2], + [x, y + height + textHeight / 2 * 3], + [x - textWidth, y + height + textHeight / 2 * 3], + [x - textWidth, y + height + textHeight / 2], + [x - textHeight / 2, y + height + textHeight / 2], [x - 1, y + height], [x - 1, y] ]; textXStart = x - textWidth / 2; - textYStart = y + height + textHieght; + textYStart = y + height + textHeight; pointListEnd = [ [x + width, y], - [x + width, y + height + textHieght / 2 * 3], - [x + width + textWidth, y + height + textHieght/2*3], - [x + width + textWidth, y + height + textHieght / 2], - [x + width + textHieght / 2, y + height + textHieght/2], + [x + width, y + height + textHeight / 2 * 3], + [x + width + textWidth, y + height + textHeight/2*3], + [x + width + textWidth, y + height + textHeight / 2], + [x + width + textHeight / 2, y + height + textHeight/2], [x + width + 1, y + height], [x + width + 1, y] ]; @@ -18573,23 +19781,23 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to // 手柄在上方 pointListStart = [ [x, y + height], - [x, y - textHieght / 2 * 3], - [x - textWidth, y - textHieght / 2 * 3], - [x - textWidth, y - textHieght / 2], - [x - textHieght / 2, y - textHieght / 2], + [x, y - textHeight / 2 * 3], + [x - textWidth, y - textHeight / 2 * 3], + [x - textWidth, y - textHeight / 2], + [x - textHeight / 2, y - textHeight / 2], [x - 1, y], [x - 1, y + height] ]; textXStart = x - textWidth / 2; - textYStart = y - textHieght; + textYStart = y - textHeight; pointListEnd = [ [x + width, y + height], - [x + width, y - textHieght / 2 * 3], - [x + width + textWidth, y - textHieght / 2 * 3], - [x + width + textWidth, y - textHieght / 2], - [x + width + textHieght / 2, y - textHieght / 2], + [x + width, y - textHeight / 2 * 3], + [x + width + textWidth, y - textHeight / 2 * 3], + [x + width + textWidth, y - textHeight / 2], + [x + width + textHeight / 2, y - textHeight / 2], [x + width + 1, y], [x + width + 1, y + height] ]; @@ -18598,55 +19806,54 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } } else { - textWidth += textHieght; + textWidth += textHeight; // 垂直 if (dataRangeOption.x != 'right') { // 手柄统统在右侧 pointListStart = [ [x, y], [x + width + textWidth, y], - [x + width + textWidth, y - textHieght], - [x + width + textHieght, y - textHieght], + [x + width + textWidth, y - textHeight], + [x + width + textHeight, y - textHeight], [x + width, y - 1], [x, y - 1] ]; - textXStart = x + width + textWidth / 2 + textHieght / 2; - textYStart = y - textHieght / 2; - + textXStart = x + width + textWidth / 2 + textHeight / 2; + textYStart = y - textHeight / 2; pointListEnd = [ [x, y + height], [x + width + textWidth, y + height], - [x + width + textWidth, y + textHieght + height], - [x + width + textHieght, y + textHieght + height], + [x + width + textWidth, y + textHeight + height], + [x + width + textHeight, y + textHeight + height], [x + width, y + 1 + height], [x, y + height + 1] ]; textXEnd = textXStart; - textYEnd = y + height + textHieght / 2; + textYEnd = y + height + textHeight / 2; } else { // 手柄在左侧 pointListStart = [ [x + width, y], [x - textWidth, y], - [x - textWidth, y - textHieght], - [x - textHieght, y - textHieght], + [x - textWidth, y - textHeight], + [x - textHeight, y - textHeight], [x, y - 1], [x + width, y - 1] ]; - textXStart = x - textWidth / 2 - textHieght / 2; - textYStart = y - textHieght / 2; + textXStart = x - textWidth / 2 - textHeight / 2; + textYStart = y - textHeight / 2; pointListEnd = [ [x + width, y + height], [x - textWidth, y + height], - [x - textWidth, y + textHieght + height], - [x - textHieght, y + textHieght + height], + [x - textWidth, y + textHeight + height], + [x - textHeight, y + textHeight + height], [x, y + 1 + height], [x + width, y + height + 1] ]; textXEnd = textXStart; - textYEnd = y + height + textHieght / 2; + textYEnd = y + height + textHeight / 2; } } @@ -18660,7 +19867,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to textY : textYStart, textPosition : 'specific', textAlign : 'center', - textBaseline : 'middle ', + textBaseline : 'middle', textColor: dataRangeOption.textStyle.color, color : getColor(dataRangeOption.max), width : 0, // for ondrif计算统一 @@ -18685,7 +19892,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to textY : textYEnd, textPosition : 'specific', textAlign : 'center', - textBaseline : 'middle ', + textBaseline : 'middle', textColor: dataRangeOption.textStyle.color, color : getColor(dataRangeOption.min), width : 0, // for ondrif计算统一 @@ -18778,7 +19985,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var totalWidth = 0; var totalHeight = 0; var font = self.getFont(dataRangeOption.textStyle); - var textHeight = zrArea.getTextWidth('国', font); + var textHeight = zrArea.getTextHeight('国', font); if (dataRangeOption.orient == 'horizontal') { // 水平布局,计算总宽度 @@ -18894,7 +20101,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to - dataRangeOption.borderWidth; break; default : - x = dataRangeOption.x - 0; + x = self.parsePercent(dataRangeOption.x, zrWidth); x = isNaN(x) ? 0 : x; break; } @@ -18916,7 +20123,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to y = Math.floor((zrHeight - totalHeight) / 2); break; default : - y = dataRangeOption.y - 0; + y = self.parsePercent(dataRangeOption.y, zrHeight); y = isNaN(y) ? 0 : y; break; } @@ -19289,9 +20496,9 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } function init(newOption) { - if (typeof self.deepQuery([newOption], 'dataRange.min') + if (typeof self.query(newOption, 'dataRange.min') == 'undefined' - || typeof self.deepQuery([newOption], 'dataRange.max') + || typeof self.query(newOption, 'dataRange.max') == 'undefined' ) { return; @@ -19479,6 +20686,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa var yAxis; var polar; + var _selectedMap = {}; // tooltip dom & css var _tDom = document.createElement('div'); // 通用样式 @@ -19913,21 +21121,24 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 categoryAxis = xAxis.getAxis(xAxisIndex); for (var i = 0, l = series.length; i < l; i++) { + if (!_isSelected(series[i].name)) { + continue; + } if (series[i].xAxisIndex == xAxisIndex && self.deepQuery( [series[i], option], 'tooltip.trigger' ) == 'axis' ) { - showContent = self.deepQuery( - [series[i]], + showContent = self.query( + series[i], 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [series[i]], + formatter = self.query( + series[i], 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [series[i]], 'tooltip' + specialCssText += _style(self.query( + series[i], 'tooltip' )); seriesArray.push(series[i]); seriesIndex.push(i); @@ -19939,7 +21150,12 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa _event, { seriesIndex : seriesIndex, - dataIndex : dataIndex + dataIndex : component.dataZoom + ? component.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex } ); y = zrEvent.getY(_event) + 10; @@ -19959,21 +21175,24 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 categoryAxis = yAxis.getAxis(yAxisIndex); for (var i = 0, l = series.length; i < l; i++) { + if (!_isSelected(series[i].name)) { + continue; + } if (series[i].yAxisIndex == yAxisIndex && self.deepQuery( [series[i], option], 'tooltip.trigger' ) == 'axis' ) { - showContent = self.deepQuery( - [series[i]], + showContent = self.query( + series[i], 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [series[i]], + formatter = self.query( + series[i], 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [series[i]], 'tooltip' + specialCssText += _style(self.query( + series[i], 'tooltip' )); seriesArray.push(series[i]); seriesIndex.push(i); @@ -19985,7 +21204,12 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa _event, { seriesIndex : seriesIndex, - dataIndex : dataIndex + dataIndex : component.dataZoom + ? component.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex } ); x = zrEvent.getX(_event) + 10; @@ -20108,24 +21332,29 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa } formatter = option.tooltip.formatter; } + var indicatorName = + option.polar[polarIndex].indicator[dataIndex].text; // 找到所有用这个极坐标并且axis触发的系列数据 for (var i = 0, l = series.length; i < l; i++) { + if (!_isSelected(series[i].name)) { + continue; + } if (series[i].polarIndex == polarIndex && self.deepQuery( [series[i], option], 'tooltip.trigger' ) == 'axis' ) { - showContent = self.deepQuery( - [series[i]], + showContent = self.query( + series[i], 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [series[i]], + formatter = self.query( + series[i], 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [series[i]], 'tooltip' + specialCssText += _style(self.query( + series[i], 'tooltip' )); seriesArray.push(series[i]); } @@ -20134,13 +21363,14 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa var polarData; var data; var params = []; - var indicatorName = - option.polar[polarIndex].indicator[dataIndex].text; for (var i = 0, l = seriesArray.length; i < l; i++) { polarData = seriesArray[i].data; for (var j = 0, k = polarData.length; j < k; j++) { data = polarData[j]; + if (!_isSelected(data.name)) { + continue; + } data = typeof data != 'undefined' ? data : {name:'', value: {dataIndex:'-'}}; @@ -20239,25 +21469,25 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa formatter = option.tooltip.formatter; } // 系列 - if (self.deepQuery([serie], 'tooltip.trigger') == 'item') { - showContent = self.deepQuery( - [serie], 'tooltip.showContent' + if (self.query(serie, 'tooltip.trigger') == 'item') { + showContent = self.query( + serie, 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [serie], 'tooltip.formatter' + formatter = self.query( + serie, 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [serie], 'tooltip' + specialCssText += _style(self.query( + serie, 'tooltip' )); } // 数据项 - showContent = self.deepQuery( - [data], 'tooltip.showContent' + showContent = self.query( + data, 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [data], 'tooltip.formatter' + formatter = self.query( + data, 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery([data], 'tooltip')); + specialCssText += _style(self.query(data, 'tooltip')); } else { showContent = self.deepQuery( @@ -20319,7 +21549,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa ? '' : (' (' + special + ')')); } - else if (serie.type == ecConfig.CHART_TYPE_RADAR) { + else if (serie.type == ecConfig.CHART_TYPE_RADAR && special) { indicator = special; html += _encodeHTML( name === '' ? (serie.name || '') : name @@ -20406,32 +21636,32 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa [seriesArray[i], option], 'tooltip.trigger' ) == 'axis' ) { - queryTarget = [seriesArray[i]]; - curType = self.deepQuery( + queryTarget = seriesArray[i]; + curType = self.query( queryTarget, 'tooltip.axisPointer.type' ); pointType = curType || pointType; if (curType == 'line') { - lineColor = self.deepQuery( + lineColor = self.query( queryTarget, 'tooltip.axisPointer.lineStyle.color' ) || lineColor; - lineWidth = self.deepQuery( + lineWidth = self.query( queryTarget, 'tooltip.axisPointer.lineStyle.width' ) || lineWidth; - lineType = self.deepQuery( + lineType = self.query( queryTarget, 'tooltip.axisPointer.lineStyle.type' ) || lineType; } else if (curType == 'shadow') { - areaSize = self.deepQuery( + areaSize = self.query( queryTarget, 'tooltip.axisPointer.areaStyle.size' ) || areaSize; - areaColor = self.deepQuery( + areaColor = self.query( queryTarget, 'tooltip.axisPointer.areaStyle.color' ) || areaColor; @@ -20647,6 +21877,29 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa function ondragend() { _hide(); } + + /** + * 图例选择 + */ + function onlegendSelected(param) { + _selectedMap = param.selected; + } + function _setSelectedMap() { + if (option.legend && option.legend.selected) { + _selectedMap = option.legend.selected; + } + else { + _selectedMap = {}; + } + } + function _isSelected(itemName) { + if (typeof _selectedMap[itemName] != 'undefined') { + return _selectedMap[itemName]; + } + else { + return true; // 没在legend里定义的都为true啊~ + } + } function init(newOption, newDom) { option = newOption; @@ -20673,9 +21926,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa var series = option.series; for (var i = 0, l = series.length; i < l; i++) { - if (self.deepQuery([series[i]], 'tooltip.trigger') - == 'axis' - ) { + if (self.query(series[i], 'tooltip.trigger') == 'axis') { _needAxisTrigger = true; break; } @@ -20686,6 +21937,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa _defaultCssText = _style(option.tooltip); _tDom.style.position = 'absolute'; // 不是多余的,别删! self.hasAppend = false; + _setSelectedMap(); } /** @@ -20707,6 +21959,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa option.tooltip.padding = self.reformCssArray( option.tooltip.padding ); + _setSelectedMap(); } } @@ -20761,6 +22014,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa self.setComponent = setComponent; self.ontooltipHover = ontooltipHover; self.ondragend = ondragend; + self.onlegendSelected = onlegendSelected; init(option, dom); } @@ -20886,13 +22140,13 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf var textFont = self.getFont(toolboxOption.textStyle); var textPosition; var textAlign; - var textBaseLine; + var textBaseline; if (toolboxOption.orient == 'horizontal') { textPosition = _itemGroupLocation.y / zr.getHeight() < 0.5 ? 'bottom' : 'top'; textAlign = _itemGroupLocation.x / zr.getWidth() < 0.5 ? 'left' : 'right'; - textBaseLine = _itemGroupLocation.y / zr.getHeight() < 0.5 + textBaseline = _itemGroupLocation.y / zr.getHeight() < 0.5 ? 'top' : 'bottom'; } else { @@ -20901,7 +22155,7 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf /* textAlign = _itemGroupLocation.x / zr.getWidth() < 0.5 ? 'right' : 'left'; - textBaseLine = 'top'; + textBaseline = 'top'; */ } @@ -20944,18 +22198,18 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf if (i === 0 && textAlign == 'left') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; - itemShape.highlightStyle.textBaseLine = textBaseLine; + itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX; - itemShape.highlightStyle.textY = textBaseLine == 'top' + itemShape.highlightStyle.textY = textBaseline == 'top' ? lastY + itemSize + 10 : lastY - 10; } if (i == iconLength - 1 && textAlign == 'right') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; - itemShape.highlightStyle.textBaseLine = textBaseLine; + itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX + itemSize; - itemShape.highlightStyle.textY = textBaseLine == 'top' + itemShape.highlightStyle.textY = textBaseline == 'top' ? lastY + itemSize + 10 : lastY - 10; } @@ -21264,16 +22518,16 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf yStart : y, xEnd : x, yEnd : y, - lineWidth : self.deepQuery( - [option], + lineWidth : self.query( + option, 'toolbox.feature.mark.lineStyle.width' ) || 2, - strokeColor : self.deepQuery( - [option], + strokeColor : self.query( + option, 'toolbox.feature.mark.lineStyle.color' ) || _markColor, - lineType : self.deepQuery( - [option], + lineType : self.query( + option, 'toolbox.feature.mark.lineStyle.type' ) || 'dashed' } @@ -21691,12 +22945,12 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf function resize() { _resetMark(); self.clear(); - if (option.toolbox.show) { + if (option && option.toolbox && option.toolbox.show) { _buildShape(); - } - if (_dataView) { - _dataView.resize(); - } + } + if (_dataView) { + _dataView.resize(); + } } function hideDataView() { @@ -21812,7 +23066,7 @@ define('echarts/component/dataView',['require','./base','../config','../componen function show(newOption) { _hasShow = true; - var lang = self.deepQuery([option],'toolbox.feature.dataView.lang') + var lang = self.query(option, 'toolbox.feature.dataView.lang') || _lang; option = newOption; @@ -21827,8 +23081,8 @@ define('echarts/component/dataView',['require','./base','../config','../componen 'display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;' + 'width:' + (_zrWidth - 15) + 'px;' + 'height:' + (_zrHeight - 100) + 'px;'; - var customContent = self.deepQuery( - [option], 'toolbox.feature.dataView.optionToContent' + var customContent = self.query( + option, 'toolbox.feature.dataView.optionToContent' ); if (typeof customContent != 'function') { _textArea.value = _optionToContent(); @@ -21843,7 +23097,7 @@ define('echarts/component/dataView',['require','./base','../config','../componen _buttonClose.onclick = hide; _tDom.appendChild(_buttonClose); - if (self.deepQuery([option], 'toolbox.feature.dataView.readOnly') + if (self.query(option, 'toolbox.feature.dataView.readOnly') === false ) { _buttonRefresh.style.cssText = @@ -21960,8 +23214,8 @@ define('echarts/component/dataView',['require','./base','../config','../componen function _save() { var text = _textArea.value; - var customContent = self.deepQuery( - [option], 'toolbox.feature.dataView.contentToOption' + var customContent = self.query( + option, 'toolbox.feature.dataView.contentToOption' ); if (typeof customContent != 'function') { text = text.split('\n'); @@ -22457,8 +23711,10 @@ define( if (!name.show) { continue; } - textStyle = self.deepQuery([name, item, option], - 'textStyle'); + textStyle = self.deepQuery( + [name, item, option], + 'textStyle' + ); style = {}; @@ -22821,6 +24077,9 @@ define( for (var i = 0; i < series.length; i ++) { serie = series[i]; + if (serie.type != ecConfig.CHART_TYPE_RADAR) { + continue; + } serieData = serie.data || []; for (var j = 0; j < serieData.length; j ++) { polarIndex = self.deepQuery( @@ -23170,32 +24429,8 @@ define( * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt */ /** @@ -23205,12 +24440,12 @@ define( * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -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','./component/polar','./util/ecData','./chart','./component','zrender/tool/util','zrender/tool/util','zrender/tool/util','zrender/tool/color','zrender/tool/util','zrender/tool/util','zrender/tool/util'],function(require) { +define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zrender/tool/event','zrender/config','./util/shape/icon','./util/shape/markLine','./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','./component/polar','./util/ecData','./chart','./component','zrender/tool/util','zrender/tool/util','zrender/tool/util','zrender/tool/color','zrender/tool/util','zrender/tool/util','zrender/tool/util'],function(require) { var self = {}; var echarts = self; // 提供内部反向使用静态方法; - self.version = '1.3.5'; + self.version = '1.3.6'; self.dependencies = { - zrender : '1.0.7' + zrender : '1.0.8' }; /** * 入口方法 @@ -23218,6 +24453,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr self.init = function(dom, libOption) { libOption = libOption || {type : 'canvas'}; if (libOption.type == 'canvas') { + dom = dom instanceof Array ? dom[0] : dom; return new Echarts(dom); } else if (libOption.type == 'flash') { @@ -23315,8 +24551,9 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _zr.on(zrConfig.EVENT.DRAGLEAVE, _ondragleave); _zr.on(zrConfig.EVENT.DROP, _ondrop); - // 动态扩展zrender shape:icon + // 动态扩展zrender shape:icon、markLine require('./util/shape/icon'); + require('./util/shape/markLine'); // 内置图表注册 var chartLibrary = require('./chart'); @@ -23342,6 +24579,8 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr // 工具箱 var Toolbox = componentLibrary.get('toolbox'); _toolbox = new Toolbox(_messageCenter, _zr, dom); + + _disposeChartList(); } /** @@ -23670,10 +24909,22 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr function _eventPackage(target) { if (target) { var ecData = require('./util/ecData'); + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + dataIndex = self.compoent.dataZoom + ? self.compoent.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex; return { - seriesIndex : ecData.get(target, 'seriesIndex'), - dataIndex : ecData.get(target, 'dataIndex'), - data : ecData.get(target, 'data') + seriesIndex : seriesIndex, + dataIndex : dataIndex, + data : ecData.get(target, 'data'), + name : ecData.get(target, 'name'), + value : ecData.get(target, 'value') }; } return; @@ -23697,6 +24948,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _messageCenter, _zr, magicOption ); _chartList.push(title); + self.compoent.title = title; } // 提示 @@ -23705,6 +24957,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr var Tooltip = componentLibrary.get('tooltip'); tooltip = new Tooltip(_messageCenter, _zr, magicOption, dom); _chartList.push(tooltip); + self.compoent.tooltip = tooltip; } // 图例 @@ -23715,6 +24968,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _messageCenter, _zr, magicOption, _selectedMap ); _chartList.push(legend); + self.compoent.legend = legend; } // 值域控件 @@ -23725,6 +24979,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _messageCenter, _zr, magicOption ); _chartList.push(dataRange); + self.compoent.dataRange = dataRange; } // 直角坐标系 @@ -23736,6 +24991,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr var Grid = componentLibrary.get('grid'); grid = new Grid(_messageCenter, _zr, magicOption); _chartList.push(grid); + self.compoent.grid = grid; var DataZoom = componentLibrary.get('dataZoom'); dataZoom = new DataZoom( @@ -23748,6 +25004,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr } ); _chartList.push(dataZoom); + self.compoent.dataZoom = dataZoom; var Axis = componentLibrary.get('axis'); xAxis = new Axis( @@ -23761,6 +25018,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr 'xAxis' ); _chartList.push(xAxis); + self.compoent.xAxis = xAxis; yAxis = new Axis( _messageCenter, @@ -23773,6 +25031,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr 'yAxis' ); _chartList.push(yAxis); + self.compoent.yAxis = yAxis; } // 极坐标系 @@ -23788,6 +25047,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr } ); _chartList.push(polar); + self.compoent.polar = polar; } tooltip && tooltip.setComponent({ @@ -23825,6 +25085,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr } ); _chartList.push(chart); + self.chart[chartType] = chart; } } } @@ -23836,9 +25097,15 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr if (magicOption.animation && !magicOption.renderAsImage) { var len = _chartList.length; while (len--) { - _chartList[len] - && _chartList[len].animation - && _chartList[len].animation(); + chart = _chartList[len]; + if (chart + && chart.animation + && chart.shapeList + && chart.shapeList.length + < magicOption.animationThreshold + ) { + chart.animation(); + } } } @@ -23949,6 +25216,13 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr && _chartList[len].dispose(); } _chartList = []; + + self.chart = { + island : _island + }; + self.compoent = { + toolbox : _toolbox + }; } /** @@ -23990,6 +25264,9 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr if (typeof _option.animation == 'undefined') { _option.animation = ecConfig.animation; } + if (typeof _option.animationThreshold == 'undefined') { + _option.animationThreshold = ecConfig.animationThreshold; + } if (typeof _option.animationDuration == 'undefined') { _option.animationDuration = ecConfig.animationDuration; } @@ -24380,6 +25657,9 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _island.resize(); _toolbox.resize(); _zr.refresh(); + _messageCenter.dispatch( + ecConfig.EVENT.RESIZE + ); return self; } @@ -24596,11 +25876,17 @@ define( var ratio = window.devicePixelRatio || 1; // console.log(rect) // var ti = new Date(); + // bbox取整 + rect = { + x : Math.floor(rect.x), + y : Math.floor(rect.y), + width : Math.floor(rect.width), + height : Math.floor(rect.height) + }; var pixels = ctx.getImageData( rect.x * ratio, rect.y * ratio, rect.width * ratio, rect.height * ratio ); - var data = pixels.data; var idx; var zrColor = require('zrender/tool/color'); @@ -24651,7 +25937,7 @@ define( * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -define('echarts/chart/scatter',['require','../component/base','./calculableBase','../config','../util/ecData','zrender/tool/color','../util/shape/symbol','../chart'],function(require) { +define('echarts/chart/scatter',['require','../component/base','./calculableBase','../config','zrender/tool/color','../util/shape/symbol','../chart'],function(require) { /** * 构造函数 * @param {Object} messageCenter echart消息中心 @@ -24668,7 +25954,6 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' CalculableBase.call(this, zr, option); var ecConfig = require('../config'); - var ecData = require('../util/ecData'); var zrColor = require('zrender/tool/color'); @@ -24700,7 +25985,7 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' serieName = serie.name; if (serie.type == ecConfig.CHART_TYPE_SCATTER) { series[i] = self.reformOption(series[i]); - _sIndex2ShapeMap[i] = self.deepQuery([serie], 'symbol') + _sIndex2ShapeMap[i] = self.query(serie, 'symbol') || _symbol[i % _symbol.length]; if (legend){ self.selectedMap[serieName] = @@ -24775,7 +26060,6 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' var pointList = {}; var x; var y; - var symbolSize; for (var j = 0, k = seriesArray.length; j < k; j++) { seriesIndex = seriesArray[j]; serie = series[seriesIndex]; @@ -24786,7 +26070,6 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' xAxis = component.xAxis.getAxis(serie.xAxisIndex || 0); yAxis = component.yAxis.getAxis(serie.yAxisIndex || 0); - symbolSize = self.deepQuery([serie], 'symbolSize'); pointList[seriesIndex] = []; for (var i = 0, l = serie.data.length; i < l; i++) { data = serie.data[i]; @@ -24802,16 +26085,17 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' x = xAxis.getCoord(value[0]); y = yAxis.getCoord(value[1]); pointList[seriesIndex].push([ - x, // 横坐标 - y, // 纵坐标 - (typeof symbolSize == 'function' - ? symbolSize(value) - : symbolSize), // 图形大小 - _sIndex2ShapeMap[seriesIndex], // 图形类型 - i, // 数据index - data.name || '' // 名称 + x, // 横坐标 + y, // 纵坐标 + i, // 数据index + data.name || '' // 名称 ]); } + self.buildMark( + serie, + seriesIndex, + component + ); } // console.log(pointList) _buildPointList(pointList); @@ -24821,46 +26105,19 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' * 生成折线和折线上的拐点 */ function _buildPointList(pointList) { - var dataRange = component.dataRange; - var rangColor; // 更高优先级 - var nColor; // normal - var nLineWidth; - var eColor; // emphasis - var eLineWidth; - var serie; - var queryTarget; - var data; var seriesPL; var singlePoint; - var symbolRotate; - + var shape; for (var seriesIndex in pointList) { serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - // 多级控制 - queryTarget = [serie]; - nColor = self.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || _sIndex2ColorMap[seriesIndex]; - nLineWidth = self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - ); - - eColor = self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ); - eLineWidth = self.deepQuery( - queryTarget, 'itemStyle.emphasis.lineStyle.width' - ); - - symbolRotate = self.deepQuery( - queryTarget, 'symbolRotate' - ); - + seriesPL = pointList[seriesIndex]; if (serie.large && serie.data.length > serie.largeThreshold) { self.shapeList.push(_getLargeSymbol( - seriesPL, nColor, eColor + seriesPL, + self.query( + serie, 'itemStyle.normal.color' + ) || _sIndex2ColorMap[seriesIndex] )); continue; } @@ -24869,171 +26126,92 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' * pointlist=[ * 0 x, * 1 y, - * 2 图形大小 - * 3 图形类型 - * 4 数据index - * 5 名称 + * 2 数据index + * 3 名称 * ] */ + for (var i = 0, l = seriesPL.length; i < l; i++) { singlePoint = seriesPL[i]; - data = serie.data[singlePoint[4]]; - - if (dataRange) { - if (isNaN(data[2])) { - continue; - } - rangColor = dataRange.getColor(data[2]); - if (!rangColor) { - continue; - } - } - else { - rangColor = nColor; - } - - queryTarget = [data]; - self.shapeList.push(_getSymbol( + shape = _getSymbol( seriesIndex, // seriesIndex - singlePoint[4], // dataIndex - singlePoint[5], // name - + singlePoint[2], // dataIndex + singlePoint[3], // name singlePoint[0], // x - singlePoint[1], // y - - // 大小 - self.deepQuery(queryTarget, 'symbolSize') - || singlePoint[2], - - // 方向 - self.deepQuery(queryTarget, 'symbolRotate') - || symbolRotate, - - // 类型 - self.deepQuery(queryTarget, 'symbol') - || singlePoint[3], - - // 填充颜色 - self.deepQuery(queryTarget, 'itemStyle.normal.color') - || rangColor, - // 线宽 - self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - )|| nLineWidth, - - //------------高亮 - // 填充颜色 - self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || eColor || nColor, - // 线宽 - self.deepQuery( - queryTarget, 'itemStyle.emphasis.lineStyle.width' - )|| eLineWidth || nLineWidth - )); + singlePoint[1] // y + ); + shape && self.shapeList.push(shape); } } // console.log(self.shapeList) } /** - * 生成散点图上的图形 + * 生成折线图上的拐点图形 */ - function _getSymbol( - seriesIndex, dataIndex, name, - x, y, symbolSize, symbolRotate, symbol, - nColor, nLineWidth, eColor, eLineWidth - ) { - var itemShape = { - shape : 'icon', - zlevel : _zlevelBase, - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : symbol.match('empty') ? 'stroke' : 'fill', - color : nColor, - strokeColor : nColor, - lineWidth: nLineWidth - }, - highlightStyle : { - color : eColor, - strokeColor : eColor, - lineWidth : eLineWidth - }, - clickable : true - }; - - if (typeof symbolRotate != 'undefined') { - itemShape.rotation = [ - symbolRotate * Math.PI / 180, x, y - ]; - } + function _getSymbol(seriesIndex, dataIndex, name, x, y) { + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; - if (symbol.match('image')) { - itemShape.style.image = - symbol.replace(new RegExp('^image:\\/\\/'), ''); - itemShape.shape = 'image'; + var dataRange = component.dataRange; + var rangColor; + if (dataRange) { + rangColor = isNaN(data[2]) + ? _sIndex2ColorMap[seriesIndex] + : dataRange.getColor(data[2]); + if (!rangColor) { + return null; + } } - - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; + else { + rangColor = _sIndex2ColorMap[seriesIndex]; } - if (symbol == 'none') { - itemShape.invisible = true; - itemShape.hoverable = false; - } - - /* - if (self.deepQuery([data, serie, option], 'calculable')) { - self.setCalculable(itemShape); - itemShape.draggable = true; - } - */ - - itemShape = self.addLabel( - itemShape, - series[seriesIndex], - series[seriesIndex].data[dataIndex], - name, + var itemShape = self.getSymbolShape( + serie, seriesIndex, data, dataIndex, name, + x, y, + _sIndex2ShapeMap[seriesIndex], + rangColor, + 'rgba(0,0,0,0)', 'vertical' ); - - ecData.pack( - itemShape, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - name - ); - - // for animation - itemShape._x = x; - itemShape._y = y; - + itemShape.zlevel = _zlevelBase; + itemShape._mark = false; // 非mark + itemShape._main = true; return itemShape; } - function _getLargeSymbol(symbolList, nColor, eColor) { + function _getLargeSymbol(symbolList, nColor) { return { shape : 'symbol', zlevel : _zlevelBase, + _main : true, hoverable: false, style : { pointList : symbolList, color : nColor, strokeColor : nColor - }, - highlightStyle : { - color : eColor, - strokeColor : eColor } }; } + + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' + && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' + && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 @@ -25075,38 +26253,49 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var serie; for (var i = 0, l = self.shapeList.length; i < l; i++) { - x = self.shapeList[i]._x || 0; - y = self.shapeList[i]._y || 0; - zr.modShape( - self.shapeList[i].id, - { - scale : [0, 0, x, y] - }, - true - ); - zr.animate(self.shapeList[i].id, '') - .when( - (self.deepQuery([serie],'animationDuration') - || duration), - {scale : [1, 1, x, y]} - ) - .start( - self.deepQuery([serie], 'animationEasing') || easing + if (self.shapeList[i]._main) { + if (self.shapeList[i].shape == 'symbol') { + continue; + } + serie = series[self.shapeList[i]._seriesIndex]; + x = self.shapeList[i]._x || 0; + y = self.shapeList[i]._y || 0; + zr.modShape( + self.shapeList[i].id, + { + scale : [0, 0, x, y] + }, + true ); + zr.animate(self.shapeList[i].id, '') + .when( + (self.query(serie,'animationDuration') + || duration), + {scale : [1, 1, x, y]} + ) + .start( + self.query(serie, 'animationEasing') || easing + ); + } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.ondataRange = ondataRange; - self.animation = animation; init(option, component); } @@ -25334,7 +26523,7 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c var ecConfig = require('../config'); var ecData = require('../util/ecData'); - + var self = this; self.type = ecConfig.CHART_TYPE_K; @@ -25390,6 +26579,14 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c return; } _buildHorizontal(maxDataLength, locationMap); + + for (var i = 0, l = seriesArray.length; i < l; i++) { + self.buildMark( + series[seriesArray[i]], + seriesArray[i], + component + ); + } } /** @@ -25526,36 +26723,36 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c && typeof seriesPL != 'undefined' ) { // 多级控制 - queryTarget = [serie]; - nLineWidth = self.deepQuery( + queryTarget = serie; + nLineWidth = self.query( queryTarget, 'itemStyle.normal.lineStyle.width' ); - nLineColor = self.deepQuery( + nLineColor = self.query( queryTarget, 'itemStyle.normal.lineStyle.color' ); - nLineColor0 = self.deepQuery( + nLineColor0 = self.query( queryTarget, 'itemStyle.normal.lineStyle.color0' ); - nColor = self.deepQuery( + nColor = self.query( queryTarget, 'itemStyle.normal.color' ); - nColor0 = self.deepQuery( + nColor0 = self.query( queryTarget, 'itemStyle.normal.color0' ); - eLineWidth = self.deepQuery( + eLineWidth = self.query( queryTarget, 'itemStyle.emphasis.lineStyle.width' ); - eLineColor = self.deepQuery( + eLineColor = self.query( queryTarget, 'itemStyle.emphasis.lineStyle.color' ); - eLineColor0 = self.deepQuery( + eLineColor0 = self.query( queryTarget, 'itemStyle.emphasis.lineStyle.color0' ); - eColor = self.deepQuery( + eColor = self.query( queryTarget, 'itemStyle.emphasis.color' ); - eColor0 = self.deepQuery( + eColor0 = self.query( queryTarget, 'itemStyle.emphasis.color0' ); @@ -25574,7 +26771,7 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c for (var i = 0, l = seriesPL.length; i < l; i++) { singlePoint = seriesPL[i]; data = serie.data[singlePoint[6]]; - queryTarget = [data]; + queryTarget = data; candleType = singlePoint[3] < singlePoint[2]; self.shapeList.push(_getCandle( seriesIndex, // seriesIndex @@ -25590,25 +26787,25 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c // 填充颜色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.normal.color' ) || nColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.normal.color0' ) || nColor0), // 线宽 - self.deepQuery( + self.query( queryTarget, 'itemStyle.normal.lineStyle.width' ) || nLineWidth, // 线色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.normal.lineStyle.color' ) || nLineColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.normal.lineStyle.color0' ) || nLineColor0), @@ -25617,25 +26814,25 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c // 填充颜色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.emphasis.color' ) || eColor || nColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.emphasis.color0' ) || eColor0 || nColor0), // 线宽 - self.deepQuery( + self.query( queryTarget, 'itemStyle.emphasis.lineStyle.width' ) || eLineWidth || nLineWidth, // 线色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.emphasis.lineStyle.color' ) || eLineColor || nLineColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.emphasis.lineStyle.color0' ) || eLineColor0 || nLineColor0) @@ -25685,6 +26882,24 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c return itemShape; } + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' + && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' + && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } + /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * @param {Object} newSeries @@ -25760,8 +26975,8 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var serie; @@ -25778,21 +26993,26 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c ); zr.animate(self.shapeList[i].id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration), {scale : [1, 1, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.addDataAnimation = addDataAnimation; - self.animation = animation; init(option, component); } @@ -25855,20 +27075,34 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c /** * 绘制图形 */ - function _buildShape() { + function _buildShape() { + var legend = component.legend; self.selectedMap = {}; _dropBoxList = []; _radarDataCounter = 0; + var serieName; for (var i = 0, l = series.length; i < l ; i ++) { if (series[i].type == ecConfig.CHART_TYPE_RADAR) { serie = self.reformOption(series[i]); - _queryTarget = [serie, option]; - - // 添加可拖拽提示框,多系列共用一个极坐标,第一个优先 - if (self.deepQuery(_queryTarget, 'calculable')) { - _addDropBox(i); + serieName = serie.name || ''; + // 系列图例开关 + self.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + + if (self.selectedMap[serieName]) { + _queryTarget = [serie, option]; + + // 添加可拖拽提示框,多系列共用一个极坐标,第一个优先 + if (self.deepQuery(_queryTarget, 'calculable')) { + _addDropBox(i); + } + _buildSingleRadar(i); + self.buildMark( + series[i], + i, + component + ); } - _buildSingleRadar(i); } } @@ -25922,7 +27156,7 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c pointList = _getPointList(serie.polarIndex, data[i]); // 添加拐点形状 - _addSymbol(pointList, defaultColor, data[i], index); + _addSymbol(pointList, defaultColor, i, index); // 添加数据形状 _addDataShape( pointList, defaultColor, data[i], @@ -25953,41 +27187,6 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c return pointList; } - /** - * 生成折线图上的拐点图形 - */ - function _getSymbol( - x, y, symbol, symbolSize, normalColor, emphasisColor, lineWidth - ) { - var itemShape = { - shape : 'icon', - zlevel : _zlevelBase + 1, - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') ? '#fff' : normalColor, - strokeColor : normalColor, - lineWidth: lineWidth * 2 - }, - hoverable: false - }; - - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; - } - - itemShape._x = x; - itemShape._y = y; - - return itemShape; - } - /** * 添加拐点 * @param {Array>} pointList 点集 @@ -25995,36 +27194,21 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c * @param {object} data 数据 * @param {number} serieIndex */ - function _addSymbol(pointList, defaultColor, data) { - // 多级控制 - var queryTarget = [data, serie]; - var symbol = self.deepQuery(queryTarget,'symbol') - || _symbol[_radarDataCounter % _symbol.length] - || 'cricle'; - - if (symbol != 'none') { - var symbolSize = self.deepQuery(queryTarget,'symbolSize'); - var nColor = self.deepQuery( - queryTarget, 'itemStyle.normal.color' - ); - var eColor = self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ); - var lineWidth = self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' + function _addSymbol(pointList, defaultColor, dataIndex, seriesIndex) { + var itemShape; + for (var i = 0, l = pointList.length; i < l; i++) { + itemShape = self.getSymbolShape( + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, '', + pointList[i][0], // x + pointList[i][1], // y + _symbol[_radarDataCounter % _symbol.length], + defaultColor, + '#fff', + 'vertical' ); - - for (var i = 0, l = pointList.length; i < l; i++) { - self.shapeList.push(_getSymbol( - pointList[i][0], // x - pointList[i][1], // y - symbol, - symbolSize, - nColor || defaultColor, - eColor || nColor || defaultColor, - lineWidth - )); - } + itemShape.zlevel = _zlevelBase + 1; + self.shapeList.push(itemShape); } } @@ -26132,7 +27316,6 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c } } - /** * 数据项被拖拽出去,重载基类方法 */ @@ -26247,8 +27430,8 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c } function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var dataIndex; var seriesIndex; var data; @@ -26284,39 +27467,25 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c zr.animate(item.id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 100, {scale : [1, 1, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } - else { - x = self.shapeList[i]._x || 0; - y = self.shapeList[i]._y || 0; - zr.modShape( - self.shapeList[i].id, - { - scale : [0, 0, x, y] - }, - true - ); - zr.animate(self.shapeList[i].id, '') - .when( - duration, - {scale : [1, 1, x, y]} - ) - .start('QuinticOut'); - } } - + + self.animationMark(duration, easing); } + // 重载基类方法 + self.animation = animation; + self.init = init; self.refresh = refresh; - self.animation = animation; self.ondrop = ondrop; self.ondragend = ondragend; @@ -28934,7 +30103,6 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base var matrix = []; var serieNumber = 0; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type === self.type) { // Use the config of first chord serie if (!chordSerieSample) { @@ -28949,6 +30117,11 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base continue; } chordSeries.push(series[i]); + self.buildMark( + series[i], + i, + component + ); matrix.push(series[i].matrix); serieNumber++; } @@ -29164,11 +30337,11 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base var timeout; - var showLabel = self.deepQuery( - [chordSerieSample], 'itemStyle.normal.label.show' + var showLabel = self.query( + chordSerieSample, 'itemStyle.normal.label.show' ); - var labelColor = self.deepQuery( - [chordSerieSample], 'itemStyle.normal.label.color' + var labelColor = self.query( + chordSerieSample, 'itemStyle.normal.label.color' ); function createMouseOver(idx) { @@ -29556,8 +30729,8 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base // key is serie name for (var i = 0; i < chordSeries.length; i++) { if (chordSeries[i].name === key) { - colorMap[key] = self.deepQuery( - [chordSeries[i]], + colorMap[key] = self.query( + chordSeries[i], 'itemStyle.normal.color' ); break; @@ -29568,8 +30741,8 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base // key is group name for (var i = 0; i < len; i++) { if (groups[i].name === key) { - colorMap[key] = self.deepQuery( - [groups[i]], + colorMap[key] = self.query( + groups[i], 'itemStyle.normal.color' ); break; @@ -29630,7 +30803,7 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base define('echarts/chart/force',['require','../component/base','./calculableBase','../config','../util/ecData','zrender/config','zrender/tool/event','zrender/tool/util','zrender/tool/vector','../util/ndarray','../chart'],function(require) { - var requrestAnimationFrame = window.requrestAnimationFrame + var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame @@ -29661,6 +30834,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' var NDArray = require('../util/ndarray'); + var legend; var self = this; self.type = ecConfig.CHART_TYPE_FORCE; @@ -29720,32 +30894,47 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' var mouseX, mouseY; function _buildShape() { - var legend = component.legend; + legend = component.legend; temperature = 1.0; viewportWidth = zr.getWidth(); viewportHeight = zr.getHeight(); centroid = [viewportWidth/2, viewportHeight/2]; - + + var serieName; for (var i = 0, l = series.length; i < l; i++) { var serie = series[i]; if (serie.type === ecConfig.CHART_TYPE_FORCE) { series[i] = self.reformOption(series[i]); + + serieName = series[i].name || ''; + // 系列图例开关 + self.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + if (!self.selectedMap[serieName]) { + continue; + } + self.buildMark( + series[i], + i, + component + ); + forceSerie = serie; - var minRadius = self.deepQuery([serie], 'minRadius'); - var maxRadius = self.deepQuery([serie], 'maxRadius'); + var minRadius = self.query(serie, 'minRadius'); + var maxRadius = self.query(serie, 'maxRadius'); // ----------获取外部参数 - attractiveness = self.deepQuery( - [serie], 'attractiveness' + attractiveness = self.query( + serie, 'attractiveness' ); - density = self.deepQuery([serie], 'density'); - initSize = self.deepQuery([serie], 'initSize'); - centripetal = self.deepQuery([serie], 'centripetal'); - coolDown = self.deepQuery([serie], 'coolDown'); + density = self.query(serie, 'density'); + initSize = self.query(serie, 'initSize'); + centripetal = self.query(serie, 'centripetal'); + coolDown = self.query(serie, 'coolDown'); // ---------- - categories = self.deepQuery([serie], 'categories'); + categories = self.query(serie, 'categories'); // 同步selected状态 for (var j = 0, len = categories.length; j < len; j++) { @@ -29759,21 +30948,21 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' } } - linkStyle = self.deepQuery( - [serie], 'itemStyle.normal.linkStyle' + linkStyle = self.query( + serie, 'itemStyle.normal.linkStyle' ); - linkEmphasisStyle = self.deepQuery( - [serie], 'itemStyle.emphasis.linkStyle' + linkEmphasisStyle = self.query( + serie, 'itemStyle.emphasis.linkStyle' ); - nodeStyle = self.deepQuery( - [serie], 'itemStyle.normal.nodeStyle' + nodeStyle = self.query( + serie, 'itemStyle.normal.nodeStyle' ); - nodeEmphasisStyle = self.deepQuery( - [serie], 'itemStyle.emphasis.nodeStyle' + nodeEmphasisStyle = self.query( + serie, 'itemStyle.emphasis.nodeStyle' ); - rawNodes = self.deepQuery([serie], 'nodes'); - rawLinks = zrUtil.clone(self.deepQuery([serie], 'links')); + rawNodes = self.query(serie, 'nodes'); + rawLinks = zrUtil.clone(self.query(serie, 'links')); _preProcessData(rawNodes, rawLinks); // Reset data nodePositions = []; @@ -29891,32 +31080,29 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' // Label var labelStyle; - if (self.deepQuery([forceSerie], 'itemStyle.normal.label.show') + if (self.query(forceSerie, 'itemStyle.normal.label.show') ) { shape.style.text = node.name; shape.style.textPosition = 'inside'; - labelStyle = self.deepQuery( - [forceSerie], 'itemStyle.normal.label.textStyle' + labelStyle = self.query( + forceSerie, 'itemStyle.normal.label.textStyle' ) || {}; shape.style.textColor = labelStyle.color || '#fff'; shape.style.textAlign = labelStyle.align || 'center'; - shape.style.textBaseLine = labelStyle.baseline || 'middle'; + shape.style.textBaseline = labelStyle.baseline || 'middle'; shape.style.textFont = self.getFont(labelStyle); } - if (self.deepQuery( - [forceSerie], 'itemStyle.emphasis.label.show' - ) - ) { + if (self.query(forceSerie, 'itemStyle.emphasis.label.show')) { shape.highlightStyle.text = node.name; shape.highlightStyle.textPosition = 'inside'; - labelStyle = self.deepQuery( - [forceSerie], 'itemStyle.emphasis.label.textStyle' + labelStyle = self.query( + forceSerie, 'itemStyle.emphasis.label.textStyle' ) || {}; shape.highlightStyle.textColor = labelStyle.color || '#fff'; shape.highlightStyle.textAlign = labelStyle.align || 'center'; - shape.highlightStyle.textBaseLine = labelStyle.baseline + shape.highlightStyle.textBaseline = labelStyle.baseline || 'middle'; shape.highlightStyle.textFont = self.getFont(labelStyle); } @@ -29928,6 +31114,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' if (typeof(node.category) !== 'undefined') { var category = categories[node.category]; if (category) { + shape.style.color = legend.getColor(category.name); var style = category.itemStyle; if (style) { if (style.normal) { @@ -29984,7 +31171,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' // data node, // data index - rawNodes.indexOf(node), + zrUtil.indexOf(rawNodes, node), // name node.name || '', // value @@ -30237,7 +31424,6 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' } var _updating; - function init(newOption, newComponent) { option = newOption; component = newComponent; @@ -30251,10 +31437,10 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' function cb() { if (_updating) { _step(); - requrestAnimationFrame(cb); + requestAnimationFrame(cb); } } - requrestAnimationFrame(cb); + requestAnimationFrame(cb); } function refresh(newOption) { @@ -30278,8 +31464,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' self.isDragstart = true; }; - function onclick() { - } + function onclick() { } /** * 拖拽开始 @@ -31053,8 +32238,17 @@ define('echarts/util/projection/normal',[],function() { * @param {Array} p */ function pos2geo(obj, p) { - var x = p[0] * 1; - var y = p[1] * 1; + var x; + var y; + if (p instanceof Array) { + x = p[0] * 1; + y = p[1] * 1; + } + else { + x = p.x * 1; + y = p.y * 1; + } + x = x / obj.scale.x + obj.offset.x - 168.5; x = x > 180 ? x - 360 : x; y = 90 - (y / obj.scale.y + obj.offset.y); @@ -31117,6 +32311,7 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. var _zlevelBase = self.getZlevelBase(); var _selectedMode; // 选择模式 + var _hoverable; // 悬浮高亮模式 var _selected = {}; // 地图选择状态 var _mapTypeMap = {}; // 图例类型索引 var _mapDataMap = {}; // 根据地图类型索引bbox,transform,path @@ -31137,6 +32332,8 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. var _mousedown; var _justMove; // 避免移动响应点击 var _curMapType; // 当前移动的地图类型 + + var _markAnimation = false; function _buildShape() { self.selectedMap = {}; @@ -31149,6 +32346,7 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. var name; var mapSeries = {}; _selectedMode = {}; + _hoverable = {}; var valueCalculation = {}; _needRoam = false; for (var i = 0, l = series.length; i < l; i++) { @@ -31176,7 +32374,13 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. _selectedMode[mapType] = _selectedMode[mapType] || series[i].selectedMode; - + if (typeof _hoverable[mapType] == 'undefined' + || _hoverable[mapType] + ) { + _hoverable[mapType] = !series[i].hoverable + ? false : true; // 1票否决 + } + valueCalculation[mapType] = valueCalculation[mapType] || series[i].mapValueCalculation; @@ -31277,12 +32481,19 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. vd, // 用户数据 ms // 系列 ); + _buildMark(mt, ms); if (--_mapDataRequireCounter <= 0) { for (var i = 0, l = self.shapeList.length; i < l; i++) { self.shapeList[i].id = zr.newShapeId(self.type); zr.addShape(self.shapeList[i]); } zr.refresh(); + if (!_markAnimation) { + _markAnimation = true; + if (option.animation && !option.renderAsImage) { + self.animationMark(option.animationDuration); + } + } } }; } @@ -31759,7 +32970,7 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. textShape = { shape : 'text', zlevel : _zlevelBase + 1, - hoverable: tooSmall, + hoverable: tooSmall ? _hoverable[mapType] : tooSmall, clickable : tooSmall, position : style.position, _mapType : mapType, @@ -31871,6 +33082,7 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. _mapTypeMap[name] = mapType; shape.onclick = self.shapeHandler.onclick; } + shape.hoverable = _hoverable[mapType]; // console.log(name,shape); ecData.pack( @@ -31888,6 +33100,37 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. //console.log(_selected); } + // 添加标注 + function _buildMark(mapType, mapSeries) { + var position = [ + _mapDataMap[mapType].transform.left, + _mapDataMap[mapType].transform.top + ]; + for (var sIdx in mapSeries) { + self.buildMark( + series[sIdx], + sIdx, + component, + { + mapType : mapType + }, + { + position : position, + _mapType : mapType + } + ); + } + } + + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData, markCoordParams) { + return _geoCoord[mpData.name] + ? geo2pos( + markCoordParams.mapType, _geoCoord[mpData.name] + ) + : [0, 0]; + } + function _nameChange(mapType, name) { return _nameMap[mapType][name] || name; } @@ -31991,7 +33234,11 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. // 让refresh飞一会 clearTimeout(_refreshDelayTicket); _refreshDelayTicket = setTimeout(refresh, 100); - + messageCenter.dispatch( + ecConfig.EVENT.MAP_ROAM, + param.event, + {type : 'scale'} + ); zrEvent.stop(event); } } @@ -32041,6 +33288,11 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. zr.modShape(self.shapeList[i].id, mod, true); } } + messageCenter.dispatch( + ecConfig.EVENT.MAP_ROAM, + param.event, + {type : 'move'} + ); zr.refresh(); _justMove = true; zrEvent.stop(event); @@ -32133,6 +33385,7 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. _nameMap = {}; _roamMap = {}; _specialArea = {}; + _markAnimation = false; refresh(newOption); @@ -32172,21 +33425,94 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. * 平面坐标转经纬度 */ function pos2geo(mapType, p) { + if (!_mapDataMap[mapType].transform) { + return null; + } return require('../util/projection/normal').pos2geo( _mapDataMap[mapType].transform, p ); } + /** + * 公开接口 : 平面坐标转经纬度 + */ + function getGeoByPos(mapType, p) { + if (!_mapDataMap[mapType].transform) { + return null; + } + var position = [ + _mapDataMap[mapType].transform.left, + _mapDataMap[mapType].transform.top + ]; + if (p instanceof Array) { + p[0] -= position[0]; + p[1] -= position[1]; + } + else { + p.x -= position[0]; + p.y -= position[1]; + } + return pos2geo(mapType, p); + } + /** * 经纬度转平面坐标 * @param {Object} p */ function geo2pos(mapType, p) { + if (!_mapDataMap[mapType].transform) { + return null; + } return require('../util/projection/normal').geo2pos( _mapDataMap[mapType].transform, p ); } + /** + * 公开接口 : 经纬度转平面坐标 + */ + function getPosByGeo(mapType, p) { + if (!_mapDataMap[mapType].transform) { + return null; + } + var pos = geo2pos(mapType, p); + pos[0] += _mapDataMap[mapType].transform.left; + pos[1] += _mapDataMap[mapType].transform.top; + return pos; + } + + /** + * 公开接口 : 地图参考坐标 + */ + function getMapPosition(mapType) { + if (!_mapDataMap[mapType].transform) { + return null; + } + return [ + _mapDataMap[mapType].transform.left, + _mapDataMap[mapType].transform.top + ]; + } + + /* + function appendShape(mapType, shapeList) { + shapeList = shapeList instanceof Array + ? shapeList : [shapeList]; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (typeof shapeList[i].id == 'undefined') { + shapeList[i].id = zr.newShapeId(self.type); + } + if (typeof shapeList[i].zlevel == 'undefined') { + shapeList[i].zlevel = _zlevelBase + 1; + } + shapeList[i]._mapType = mapType; + self.shapeList.push(shapeList[i]); + zr.addShape(shapeList[i]); + } + zr.refresh(); + } + */ + /** * 释放后实例不可用 */ @@ -32201,14 +33527,21 @@ define('echarts/chart/map',['require','../component/base','./calculableBase','.. } // 重载基类方法 + self.getMarkCoord = getMarkCoord; self.dispose = dispose; self.init = init; self.refresh = refresh; self.ondataRange = ondataRange; + self.onclick = onclick; + + // 稳定接口 self.pos2geo = pos2geo; self.geo2pos = geo2pos; - self.onclick = onclick; + self.getMapPosition = getMapPosition; + self.getPosByGeo = getPosByGeo; + self.getGeoByPos = getGeoByPos; + //self.appendShape = appendShape; init(option, component); } @@ -32459,7 +33792,7 @@ define( * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -define('echarts/chart/line',['require','../component/base','./calculableBase','../config','../util/ecData','zrender/tool/color','zrender/shape','zrender/shape','../util/shape/halfSmoothPolygon','../chart'],function(require) { +define('echarts/chart/line',['require','../component/base','./calculableBase','../config','zrender/tool/color','zrender/shape','zrender/shape','../util/shape/halfSmoothPolygon','../chart'],function(require) { /** * 构造函数 * @param {Object} messageCenter echart消息中心 @@ -32476,7 +33809,6 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. CalculableBase.call(this, zr, option); var ecConfig = require('../config'); - var ecData = require('../util/ecData'); var zrColor = require('zrender/tool/color'); @@ -32570,6 +33902,13 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. _buildVertical(maxDataLength, locationMap); break; } + for (var i = 0, l = seriesArray.length; i < l; i++) { + self.buildMark( + series[seriesArray[i]], + seriesArray[i], + component + ); + } } /** @@ -32594,7 +33933,7 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. _sIndex2ShapeMap[seriesArray[i]] = _sIndex2ShapeMap[seriesArray[i]] - || self.deepQuery([serie],'symbol') + || self.query(serie,'symbol') || _symbol[i % _symbol.length]; if (legend){ @@ -32910,7 +34249,6 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. var lineType; var lineColor; var normalColor; - var emphasisColor; // 填充相关 var isFill; @@ -32931,28 +34269,25 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. if (serie.type == self.type && typeof seriesPL != 'undefined') { defaultColor = _sIndex2ColorMap[seriesIndex]; // 多级控制 - lineWidth = self.deepQuery( - [serie], 'itemStyle.normal.lineStyle.width' - ); - lineType = self.deepQuery( - [serie], 'itemStyle.normal.lineStyle.type' + lineWidth = self.query( + serie, 'itemStyle.normal.lineStyle.width' ); - lineColor = self.deepQuery( - [serie], 'itemStyle.normal.lineStyle.color' + lineType = self.query( + serie, 'itemStyle.normal.lineStyle.type' ); - normalColor = self.deepQuery( - [serie], 'itemStyle.normal.color' + lineColor = self.query( + serie, 'itemStyle.normal.lineStyle.color' ); - emphasisColor = self.deepQuery( - [serie], 'itemStyle.emphasis.color' + normalColor = self.query( + serie, 'itemStyle.normal.color' ); - isFill = typeof self.deepQuery( - [serie], 'itemStyle.normal.areaStyle' + isFill = typeof self.query( + serie, 'itemStyle.normal.areaStyle' ) != 'undefined'; - fillNormalColor = self.deepQuery( - [serie], 'itemStyle.normal.areaStyle.color' + fillNormalColor = self.query( + serie, 'itemStyle.normal.areaStyle.color' ); for (var i = 0, l = seriesPL.length; i < l; i++) { @@ -32978,19 +34313,6 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. singlePL[j][3], // name singlePL[j][0], // x singlePL[j][1], // y - self.deepQuery( - [data], 'itemStyle.normal.color' - ) || normalColor - || defaultColor, - self.deepQuery( - [data], 'itemStyle.emphasis.color' - ) || emphasisColor - || normalColor - || defaultColor, - lineWidth, - self.deepQuery( - [data, serie], 'symbolRotate' - ), orient )); } @@ -33008,20 +34330,20 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. lineWidth : lineWidth, lineType : lineType, smooth : _getSmooth(serie.smooth), - shadowColor : self.deepQuery( - [serie], + shadowColor : self.query( + serie, 'itemStyle.normal.lineStyle.shadowColor' ), - shadowBlur: self.deepQuery( - [serie], + shadowBlur: self.query( + serie, 'itemStyle.normal.lineStyle.shadowBlur' ), - shadowOffsetX: self.deepQuery( - [serie], + shadowOffsetX: self.query( + serie, 'itemStyle.normal.lineStyle.shadowOffsetX' ), - shadowOffsetY: self.deepQuery( - [serie], + shadowOffsetY: self.query( + serie, 'itemStyle.normal.lineStyle.shadowOffsetY' ) }, @@ -33092,18 +34414,14 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. var itemShape = _getSymbol( seriesIndex, dataIndex, name, - x, y, - color, - _sIndex2ColorMap[seriesIndex], - 2, - 0, - orient + x, y, orient ); - + itemShape.style.color = color; + itemShape.style.strokeColor = color; + itemShape.rotation = [0,0]; itemShape.hoverable = false; itemShape.draggable = false; itemShape.style.text = undefined; - //itemShape.highlightStyle.lineWidth = 20; return itemShape; } @@ -33111,99 +34429,46 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. /** * 生成折线图上的拐点图形 */ - function _getSymbol( - seriesIndex, dataIndex, name, x, y, - normalColor, emphasisColor, lineWidth, rotate, orient - ) { + function _getSymbol(seriesIndex, dataIndex, name, x, y, orient) { var serie = series[seriesIndex]; var data = serie.data[dataIndex]; - var symbol = self.deepQuery([data], 'symbol') - || _sIndex2ShapeMap[seriesIndex] - || 'cricle'; - var symbolSize = self.deepQuery([data, serie],'symbolSize'); - - var itemShape = { - shape : 'icon', - zlevel : _zlevelBase + 1, - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') ? '#fff' : normalColor, - strokeColor : normalColor, - lineWidth: lineWidth * 2 - }, - highlightStyle : { - color : symbol.match('empty') ? '#fff' : emphasisColor, - strokeColor : emphasisColor, - lineWidth: lineWidth * 2 + 2 - }, - clickable : true - }; - - if (symbol.match('image')) { - itemShape.style.image = - symbol.replace(new RegExp('^image:\\/\\/'), ''); - itemShape.shape = 'image'; - } - - if (typeof rotate != 'undefined') { - itemShape.rotation = [ - rotate * Math.PI / 180, x, y - ]; - } - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; - } + var itemShape = self.getSymbolShape( + serie, seriesIndex, data, dataIndex, name, + x, y, + _sIndex2ShapeMap[seriesIndex], + _sIndex2ColorMap[seriesIndex], + '#fff', + orient == 'vertical' ? 'horizontal' : 'vertical' // 翻转 + ); + itemShape.zlevel = _zlevelBase + 1; - if (symbol == 'none') { - itemShape.invisible = true; - itemShape.hoverable = false; - } - if (self.deepQuery([data, serie, option], 'calculable')) { self.setCalculable(itemShape); itemShape.draggable = true; } - - itemShape = self.addLabel( - itemShape, - series[seriesIndex], - series[seriesIndex].data[dataIndex], - name, - orient == 'vertical' ? 'horizontal' : 'vertical' - ); - if (symbol.match('empty')) { - if (typeof itemShape.style.textColor == 'undefined') { - itemShape.style.textColor = itemShape.style.strokeColor; - } - if (typeof itemShape.highlightStyle.textColor == 'undefined') { - itemShape.highlightStyle.textColor = - itemShape.highlightStyle.strokeColor; - } - } - ecData.pack( - itemShape, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - name - ); - - itemShape._x = x; - itemShape._y = y; - itemShape._dataIndex = dataIndex; - itemShape._seriesIndex = seriesIndex; - return itemShape; } + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' + && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' + && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } + /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * @param {Object} newSeries @@ -33231,62 +34496,22 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. var dataIndex = param.dataIndex; var seriesPL; var singlePL; - var serie; - var queryTarget; - - var lineWidth; - var normalColor; - var emphasisColor; - var defaultColor; - var len = seriesIndex.length; while (len--) { seriesPL = finalPLMap[seriesIndex[len]]; if (seriesPL) { - serie = series[seriesIndex[len]]; - queryTarget = [serie]; - defaultColor = _sIndex2ColorMap[seriesIndex[len]]; - // 多级控制 - lineWidth = self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - ); - normalColor = self.deepQuery( - queryTarget, 'itemStyle.normal.color' - ); - emphasisColor = self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ); - var shape; - var data; for (var i = 0, l = seriesPL.length; i < l; i++) { singlePL = seriesPL[i]; for (var j = 0, k = singlePL.length; j < k; j++) { if (dataIndex == singlePL[j][2]) { - data = serie.data[singlePL[j][2]]; - shape = _getSymbol( - seriesIndex[len], - singlePL[j][2], // dataIndex - singlePL[j][3], // name - singlePL[j][0], // x - singlePL[j][1], // y - self.deepQuery( - [data], 'itemStyle.normal.color' - ) || normalColor - || defaultColor, - self.deepQuery( - [data], 'itemStyle.emphasis.color' - ) || emphasisColor - || normalColor - || defaultColor, - lineWidth, - self.deepQuery( - [data, serie], 'symbolRotate' - ), + tipShape.push(_getSymbol( + seriesIndex[len], // seriesIndex + singlePL[j][2], // dataIndex + singlePL[j][3], // name + singlePL[j][0], // x + singlePL[j][1], // y 'horizontal' - ); - //console.log(shape) - //zr.addHoverShape(shape); - tipShape.push(shape); + )); } } } @@ -33400,8 +34625,8 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var serie; @@ -33433,40 +34658,28 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. } zr.animate(self.shapeList[i].id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 100, {scale : [1, 1, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } - else { - x = self.shapeList[i]._x || 0; - y = self.shapeList[i]._y || 0; - zr.modShape( - self.shapeList[i].id, - { - scale : [0, 0, x, y] - }, - true - ); - zr.animate(self.shapeList[i].id, '') - .when( - duration, - {scale : [1, 1, x, y]} - ) - .start('QuinticOut'); - } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.ontooltipHover = ontooltipHover; self.addDataAnimation = addDataAnimation; - self.animation = animation; init(option, component); } @@ -33628,11 +34841,11 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. switch (position) { case 'bottom' : case 'top' : - _buildHorizontal(maxDataLength, locationMap); + _buildHorizontal(maxDataLength, locationMap, seriesArray); break; case 'left' : case 'right' : - _buildVertical(maxDataLength, locationMap); + _buildVertical(maxDataLength, locationMap, seriesArray); break; } } @@ -33720,7 +34933,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. /** * 构建类目轴为水平方向的柱形图系列 */ - function _buildHorizontal(maxDataLength, locationMap) { + function _buildHorizontal(maxDataLength, locationMap, seriesArray) { // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; @@ -33737,6 +34950,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. var barMinHeightMap = size.barMinHeightMap; var barHeight; + var xMarkMap = {}; // 为标注记录一个横向偏移 var x; var y; var lastYP; // 正向堆叠处理 @@ -33815,6 +35029,10 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. barHeight, 'vertical' ); + + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {}; + xMarkMap[seriesIndex][i] = + x + (barWidthMap[seriesIndex] || barWidth) / 2; self.shapeList.push(barShape); } @@ -33863,12 +35081,13 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. x += ((barWidthMap[seriesIndex] || barWidth) + barGap); } } + _buildMark(seriesArray, xMarkMap, true); } /** * 构建类目轴为垂直方向的柱形图系列 */ - function _buildVertical(maxDataLength, locationMap) { + function _buildVertical(maxDataLength, locationMap, seriesArray) { // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; @@ -33885,6 +35104,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. var barMinHeightMap = size.barMinHeightMap; var barHeight; + var xMarkMap = {}; // 为标注记录一个横向偏移 var x; var y; var lastXP; // 正向堆叠处理 @@ -33963,6 +35183,10 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. barWidthMap[seriesIndex] || barWidth, 'horizontal' ); + + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {}; + xMarkMap[seriesIndex][i] = + y - (barWidthMap[seriesIndex] || barWidth) / 2; self.shapeList.push(barShape); } @@ -34013,6 +35237,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. y -= ((barWidthMap[seriesIndex] || barWidth) + barGap); } } + _buildMark(seriesArray, xMarkMap, false); } /** * 我真是自找麻烦啊,为啥要允许系列级个性化最小宽度和高度啊!!! @@ -34247,6 +35472,52 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. return barShape; } + // 添加标注 + function _buildMark(seriesArray, xMarkMap ,isHorizontal) { + for (var i = 0, l = seriesArray.length; i < l; i++) { + self.buildMark( + series[seriesArray[i]], + seriesArray[i], + component, + { + isHorizontal : isHorizontal, + xMarkMap : xMarkMap + } + ); + } + } + + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData, markCoordParams) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + var dataIndex; + var pos; + if (markCoordParams.isHorizontal) { + // 横向 + dataIndex = typeof mpData.xAxis == 'string' + && xAxis.getIndexByName + ? xAxis.getIndexByName(mpData.xAxis) + : (mpData.xAxis || 0); + pos = [ + markCoordParams.xMarkMap[seriesIndex][dataIndex], + yAxis.getCoord(mpData.yAxis || 0) + ]; + } + else { + // 纵向 + dataIndex = typeof mpData.xAxis == 'string' + && xAxis.getIndexByName + ? xAxis.getIndexByName(mpData.xAxis) + : (mpData.xAxis || 0); + pos = [ + xAxis.getCoord(mpData.xAxis || 0), + markCoordParams.xMarkMap[seriesIndex][dataIndex] + ]; + } + return pos; + } + /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * @param {Object} newSeries @@ -34448,12 +35719,17 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. } } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.addDataAnimation = addDataAnimation; - self.animation = animation; init(option, component); } @@ -34504,6 +35780,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. var _selected = {}; function _buildShape() { + var legend = component.legend; self.selectedMap = {}; _selected = {}; var center; @@ -34511,9 +35788,18 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. var pieCase; // 饼图箱子 _selectedMode = false; + var serieName; for (var i = 0, l = series.length; i < l; i++) { if (series[i].type == ecConfig.CHART_TYPE_PIE) { series[i] = self.reformOption(series[i]); + serieName = series[i].name || ''; + // 系列图例开关 + self.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + if (!self.selectedMap[serieName]) { + continue; + } + center = self.parseCenter(series[i].center); radius = self.parseRadius(series[i].radius); _selectedMode = _selectedMode || series[i].selectedMode; @@ -34539,6 +35825,11 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. self.shapeList.push(pieCase); } _buildSinglePie(i); + self.buildMark( + series[i], + i, + component + ); } } @@ -34694,16 +35985,17 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. ) { var serie = series[seriesIndex]; var data = serie.data[dataIndex]; + var queryTarget = [data, serie]; var center = self.parseCenter(serie.center); // 多级控制 var normalColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.color' ) || defaultColor; var emphasisColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.color' ); @@ -34743,7 +36035,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. sector.style._hasSelected = true; sector.style._x = sector.style.x; sector.style._y = sector.style.y; - var offset = self.deepQuery([serie], 'selectedOffset'); + var offset = self.query(serie, 'selectedOffset'); sector.style.x += zrMath.cos(midAngle, true) * offset; sector.style.y -= zrMath.sin(midAngle, true) * offset; @@ -34765,7 +36057,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. if (_needLabel(serie, data, false) && self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.position' ) == 'inner' ) { @@ -34774,15 +36066,15 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. ); sector.style.textPosition = 'specific'; sector.style.textColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.textStyle.color' ) || '#fff'; sector.style.textAlign = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.textStyle.align' ) || 'center'; - sector.style.textBaseLine = self.deepQuery( - [data, serie], + sector.style.textBaseline = self.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle.baseline' ) || 'middle'; sector.style.textX = Math.round( @@ -34796,14 +36088,14 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. * zrMath.sin((startAngle + endAngle) / 2, true) ); sector.style.textFont = self.getFont(self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.textStyle' )); } if (_needLabel(serie, data, true) && self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.position' ) == 'inner' ) { @@ -34812,15 +36104,15 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. ); sector.highlightStyle.textPosition = 'specific'; sector.highlightStyle.textColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.textStyle.color' ) || '#fff'; sector.highlightStyle.textAlign = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.textStyle.align' ) || 'center'; - sector.highlightStyle.textBaseLine = self.deepQuery( - [data, serie], + sector.highlightStyle.textBaseline = self.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle.baseline' ) || 'middle'; sector.highlightStyle.textX = Math.round( @@ -34834,7 +36126,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. * zrMath.sin((startAngle + endAngle) / 2, true) ); sector.highlightStyle.textFont = self.getFont(self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.textStyle' )); } @@ -35080,6 +36372,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. +'.labelLine.show' ); } + /** * 参数修正&默认值赋值,重载基类方法 * @param {Object} opt 参数 @@ -35337,8 +36630,8 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var r0; @@ -35372,7 +36665,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. dataIndex = ecData.get(self.shapeList[i], 'dataIndex'); zr.animate(self.shapeList[i].id, 'style') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 10, { @@ -35383,16 +36676,16 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. .start('QuinticOut'); zr.animate(self.shapeList[i].id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 100, {rotation : [0, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } - else { + else if (!self.shapeList[i]._mark){ dataIndex = self.shapeList[i]._dataIndex; zr.modShape( self.shapeList[i].id, @@ -35409,6 +36702,8 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. .start('QuinticOut'); } } + + self.animationMark(duration, easing); } function onclick(param) { @@ -35435,8 +36730,8 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. _selected[seriesIndex][dataIndex] = true; target.style._x = target.style.x; target.style._y = target.style.y; - offset = self.deepQuery( - [series[seriesIndex]], + offset = self.query( + series[seriesIndex], 'selectedOffset' ); target.style.x += zrMath.cos(midAngle, true) @@ -35605,12 +36900,12 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. }; self.reformOption = reformOption; // 重载基类方法 + self.animation = animation; // 接口方法 self.init = init; self.refresh = refresh; self.addDataAnimation = addDataAnimation; - self.animation = animation; self.onclick = onclick; self.ondrop = ondrop; self.ondragend = ondragend; diff --git a/build/echarts-plain-original.js b/build/echarts-plain-original.js index 02ba2f7aeb..ff8d8bfaa5 100644 --- a/build/echarts-plain-original.js +++ b/build/echarts-plain-original.js @@ -496,8 +496,8 @@ define('echarts/config',[],function() { // 接受数组分别设定上右下左边距,同css itemGap: 10, // 各个item之间的间隔,单位px,默认为10, // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemWidth: 20, // 图例图形宽度,非标准参数 - itemHeight: 14, // 图例图形高度,非标准参数 + itemWidth: 20, // 图例图形宽度 + itemHeight: 14, // 图例图形高度 textStyle: { color: '#333' // 图例文字颜色 }, @@ -556,7 +556,7 @@ define('echarts/config',[],function() { // 接受数组分别设定上右下左边距,同css itemGap: 10, // 各个item之间的间隔,单位px,默认为10, // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemSize: 16, // 工具箱图形宽度,非标准参数 + itemSize: 16, // 工具箱图形宽度 feature : { //mark : true, //dataZoom : true, @@ -586,7 +586,7 @@ define('echarts/config',[],function() { showContent: true, // tooltip主体内容 trigger: 'item', // 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis' // formatter: null // 内容格式器:{string}(Template) ¦ {Function} - islandFormatter: '{a}
{b} : {c}', // 数据孤岛内容格式器,非标准参数 + islandFormatter: '{a}
{b} : {c}', // 数据孤岛内容格式器 showDelay: 20, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms hideDelay: 100, // 隐藏延迟,单位ms transitionDuration : 0.4, // 动画变换时间,单位s @@ -843,7 +843,7 @@ define('echarts/config',[],function() { label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, @@ -860,7 +860,7 @@ define('echarts/config',[],function() { label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -868,8 +868,8 @@ define('echarts/config',[],function() { } }, //smooth : false, - //symbol: null, // 拐点图形类型,非标准参数 - symbolSize: 2, // 可计算特性参数,空数据拖拽提示图形大小 + //symbol: null, // 拐点图形类型 + symbolSize: 2, // 拐点图形大小 //symbolRotate : null, // 拐点图形旋转控制 showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) }, @@ -900,13 +900,14 @@ define('echarts/config',[],function() { scatter: { xAxisIndex: 0, yAxisIndex: 0, - //symbol: null, // 图形类型,非标准参数 + //symbol: null, // 图形类型 symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 //symbolRotate : null, // 拐点图形旋转控制 large: false, // 大规模散点图 largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 itemStyle: { normal: { + // color: 各异, label: { show: false, // 标签文本格式器,同Tooltip.formatter,不支持回调 @@ -918,7 +919,7 @@ define('echarts/config',[],function() { return c[0] + ' , ' + c[1]; } } - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -935,7 +936,7 @@ define('echarts/config',[],function() { return c[0] + ' , ' + c[1]; } } - // position: 默认自使用,水平布局为'top',垂直布局为'right',可选为 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 // 'inside'|'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -949,16 +950,22 @@ define('echarts/config',[],function() { itemStyle: { normal: { // color: 各异, + label: { + show: false + }, lineStyle: { width: 2, type: 'solid' } }, emphasis: { + label: { + show: false + } // color: 各异, } }, - //symbol: null, // 拐点图形类型,非标准参数 + //symbol: null, // 拐点图形类型 symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 }, @@ -973,6 +980,7 @@ define('echarts/config',[],function() { // roseType : null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) itemStyle: { normal: { + // color: 各异, label: { show: true, position: 'outer' @@ -991,14 +999,14 @@ define('echarts/config',[],function() { }, emphasis: { label: { - show: false, - position: 'outer' + show: false + // position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, labelLine: { show: false, - length: 40, + length: 30, lineStyle: { // color: 各异, width: 1, @@ -1020,6 +1028,7 @@ define('echarts/config',[],function() { // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: // 'sum' | 'average' | 'max' | 'min' // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + hoverable: true, // roam : false, // 是否开启缩放及漫游模式 itemStyle: { normal: { @@ -1161,6 +1170,80 @@ define('echarts/config',[],function() { r: 15, calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% }, + + markPoint : { + symbol: 'pin', // 标注类型 + symbolSize: 10, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + //symbolRotate : null,// 标注旋转控制 + itemStyle: { + normal: { + // color: 各异, + // borderColor: 各异, // 标注边线颜色,优先于color + borderWidth: 2, // 标注边线线宽,单位px,默认为1 + label: { + show: true, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + position: 'inside' // 可选为'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + label: { + show: true + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + // position: 'inside' // 'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } + }, + + markLine : { + // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string + symbol: ['circle', 'arrow'], + // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + symbolSize: [2, 4], + // 标线起始和结束的symbol旋转控制 + //symbolRotate : null, + itemStyle: { + normal: { + // color: 各异, // 标线主色,线色,symbol主色 + // borderColor: 随color, // 标线symbol边框颜色,优先于color + borderWidth: 2, // 标线symbol边框线宽,单位px,默认为2 + label: { + show: false, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom' + position: 'inside', + textStyle: { // 默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + lineStyle: { + // color: 随borderColor, // 主色,线色,优先级高于borderColor和color + // width: 随borderWidth, // 优先于borderWidth + type: 'solid', + shadowColor : 'rgba(0,0,0,0)', //默认透明 + shadowBlur: 5, + shadowOffsetX: 3, + shadowOffsetY: 3 + } + }, + emphasis: { + label: { + show: false + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter : null, + // position: 'inside' // 'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle : {} + } + } + }, textStyle: { decoration: 'none', @@ -1174,6 +1257,7 @@ define('echarts/config',[],function() { // -------全局通用 REFRESH: 'refresh', RESTORE: 'restore', + RESIZE: 'resize', CLICK: 'click', HOVER: 'hover', MOUSEWHEEL: 'mousewheel', @@ -1186,6 +1270,7 @@ define('echarts/config',[],function() { PIE_SELECTED: 'pieSelected', MAGIC_TYPE_CHANGED: 'magicTypeChanged', DATA_VIEW_CHANGED: 'dataViewChanged', + MAP_ROAM : 'mapRoam', // -------内部通信 TOOLTIP_HOVER: 'tooltipHover' }, @@ -1197,6 +1282,7 @@ define('echarts/config',[],function() { nameConnector: ' & ', valueConnector: ' : ', animation: true, + animationThreshold: 2500, // 动画元素阀值,产生的图形原素超过2500不出动画 addDataAnimation: true, // 动态数据接口是否开启动画效果 animationDuration: 2000, animationEasing: 'ExponentialOut' //BounceOut @@ -3336,7 +3422,7 @@ define( * getTextWidth:测算单行文本宽度 */ define( - 'zrender/tool/area',['require','../tool/util'],function(require) { + 'zrender/tool/area',['require','../tool/util','../shape'],function(require) { var util = require('../tool/util'); var _ctx; @@ -3748,6 +3834,9 @@ define( * 路径包含判断,依赖多边形判断 */ function _isInsidePath(area, x, y) { + if (!area.pointList) { + require('../shape').get('path').buildPath(_ctx, area); + } var pointList = area.pointList; var insideCatch = false; for (var i = 0, l = pointList.length; i < l; i++) { @@ -3762,7 +3851,7 @@ define( } /** - * 测算单行文本欢度 + * 测算多行文本宽度 * @param {Object} text * @param {Object} textFont */ @@ -3775,16 +3864,49 @@ define( if (textFont) { _ctx.font = textFont; } - var width = _ctx.measureText(text).width; + + text = (text + '').split('\n'); + var width = 0; + for (var i = 0, l = text.length; i < l; i++) { + width = Math.max( + _ctx.measureText(text[i]).width, + width + ); + } _ctx.restore(); return width; } + + /** + * 测算多行文本高度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextHeight(text, textFont) { + if (!_ctx) { + _ctx = util.getContext(); + } + + _ctx.save(); + if (textFont) { + _ctx.font = textFont; + } + + text = (text + '').split('\n'); + //比较粗暴 + var height = (_ctx.measureText('国').width + 2) * text.length; + + _ctx.restore(); + + return height; + } return { isInside : isInside, isOutside : isOutside, - getTextWidth : getTextWidth + getTextWidth : getTextWidth, + getTextHeight : getTextHeight }; } ); @@ -5466,16 +5588,84 @@ define( } if (typeof tx != 'undefined' && typeof ty != 'undefined') { - if (style.textFont) { - ctx.font = style.textFont; - } - ctx.textAlign = style.textAlign || al; - ctx.textBaseline = style.textBaseLine || bl; - - ctx.fillText(style.text, tx, ty); + _fillText( + ctx, + style.text, + tx, ty, + style.textFont, + style.textAlign || al, + style.textBaseline || bl + ); + } + } + + function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { + if (textFont) { + ctx.font = textFont; + } + ctx.textAlign = textAlign; + ctx.textBaseline = textBaseline; + var rect = _getTextRect( + text, x, y, textFont, textAlign, textBaseline + ); + + text = (text + '').split('\n'); + var lineHeight = area.getTextHeight('国', textFont); + var x = x; + var y; + if (textBaseline == 'top') { + y = rect.y; + } + else if (textBaseline == 'bottom') { + y = rect.y + lineHeight; + } + else { + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + ctx.fillText(text[i], x, y); + y += lineHeight; } } + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { + var width = area.getTextWidth(text, textFont); + var lineHeight = area.getTextHeight('国', textFont); + + text = (text + '').split('\n'); + + var textX = x; //默认start == left + if (textAlign == 'end' || textAlign == 'right') { + textX -= width; + } + else if (textAlign == 'center') { + textX -= (width / 2); + } + + var textY; + if (textBaseline == 'top') { + textY = y; + } + else if (textBaseline == 'bottom') { + textY = y - lineHeight * text.length; + } + else { + // middle + textY = y - lineHeight * text.length / 2; + } + return { + x : textX, + y : textY, + width : width, + height : lineHeight * text.length + }; + } + /** * 根据默认样式扩展高亮样式 * @param ctx Canvas 2D上下文 @@ -5516,7 +5706,9 @@ define( // 可自定义覆盖默认值 for (var k in highlightStyle) { - newStyle[k] = highlightStyle[k]; + if (typeof highlightStyle[k] != 'undefined') { + newStyle[k] = highlightStyle[k]; + } } return newStyle; @@ -7154,6 +7346,8 @@ define( */ define( 'zrender/shape/text',['require','../tool/area','./base','../shape'],function(require) { + var area = require('../tool/area'); + function Text() { this.type = 'text'; } @@ -7173,6 +7367,10 @@ define( style, e.highlightStyle || {} ); } + + if (typeof style.text == 'undefined') { + return; + } ctx.save(); this.setContext(ctx, style); @@ -7188,52 +7386,70 @@ define( ctx.textAlign = style.textAlign || 'start'; ctx.textBaseline = style.textBaseline || 'middle'; - if (style.maxWidth) { - switch (style.brushType) { - case 'fill': - ctx.fillText( - style.text, - style.x, style.y, style.maxWidth - ); - break; - case 'stroke': - ctx.strokeText( - style.text, - style.x, style.y, style.maxWidth - ); - break; - case 'both': - ctx.strokeText( - style.text, - style.x, style.y, style.maxWidth - ); - ctx.fillText( - style.text, - style.x, style.y, style.maxWidth - ); - break; - default: - ctx.fillText( - style.text, - style.x, style.y, style.maxWidth - ); - } + var text = (style.text + '').split('\n'); + var lineHeight = area.getTextHeight('国', style.textFont); + var rect = this.getRect(style); + var x = style.x; + var y; + if (style.textBaseline == 'top') { + y = rect.y; } - else{ - switch (style.brushType) { - case 'fill': - ctx.fillText(style.text, style.x, style.y); - break; - case 'stroke': - ctx.strokeText(style.text, style.x, style.y); - break; - case 'both': - ctx.strokeText(style.text, style.x, style.y); - ctx.fillText(style.text, style.x, style.y); - break; - default: - ctx.fillText(style.text, style.x, style.y); + else if (style.textBaseline == 'bottom') { + y = rect.y + lineHeight; + } + else { + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + if (style.maxWidth) { + switch (style.brushType) { + case 'fill': + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + break; + case 'stroke': + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + break; + case 'both': + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + break; + default: + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + } + } + else{ + switch (style.brushType) { + case 'fill': + ctx.fillText(text[i], x, y); + break; + case 'stroke': + ctx.strokeText(text[i], x, y); + break; + case 'both': + ctx.strokeText(text[i], x, y); + ctx.fillText(text[i], x, y); + break; + default: + ctx.fillText(text[i], x, y); + } } + y += lineHeight; } ctx.restore(); @@ -7245,10 +7461,10 @@ define( * @param {Object} style */ getRect : function(style) { - var area = require('../tool/area'); - - var width = area.getTextWidth(style.text, style.textFont); - var height = area.getTextWidth('国', style.textFont); //比较粗暴 + var width = area.getTextWidth(style.text, style.textFont); + var lineHeight = area.getTextHeight('国', style.textFont); + + var text = (style.text + '').split('\n'); var textX = style.x; //默认start == left if (style.textAlign == 'end' || style.textAlign == 'right') { @@ -7258,19 +7474,23 @@ define( textX -= (width / 2); } - var textY = style.y - height / 2; //默认middle + var textY; if (style.textBaseline == 'top') { - textY += height / 2; + textY = style.y; } else if (style.textBaseline == 'bottom') { - textX -= height / 2; + textY = style.y - lineHeight * text.length; + } + else { + // middle + textY = style.y - lineHeight * text.length / 2; } return { x : textX, y : textY, width : width, - height : height + height : lineHeight * text.length }; } }; @@ -7647,14 +7867,19 @@ define('zrender/shape/path',['require','./base','../shape'],function(require) { 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' ]; + + cs = cs.replace(/-/g, ' -'); cs = cs.replace(/ /g, ' '); cs = cs.replace(/ /g, ','); cs = cs.replace(/,,/g, ','); + + var n; // create pipes so that we can split the data for (n = 0; n < cc.length; n++) { cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); } + // create array var arr = cs.split('|'); var ca = []; @@ -9148,7 +9373,7 @@ define( var Clip = require('./clip'); -var requrestAnimationFrame = window.requrestAnimationFrame +var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame @@ -9185,7 +9410,7 @@ Animation.prototype = { update : function() { var time = new Date().getTime(); - var delta = time - this._time; + //var delta = time - this._time; var clips = this._clips; var len = clips.length; @@ -9237,11 +9462,11 @@ Animation.prototype = { function step() { if (self._running) { self.update(); - requrestAnimationFrame(step); + requestAnimationFrame(step); } } - requrestAnimationFrame(step); + requestAnimationFrame(step); }, stop : function() { this._running = false; @@ -10541,32 +10766,8 @@ define( * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ /** @@ -10598,7 +10799,7 @@ define( var _idx = 0; //ZRender instance's id var _instances = {}; //ZRender实例map索引 - self.version = '1.0.7'; + self.version = '1.0.8'; /** * zrender初始化 @@ -11165,6 +11366,9 @@ define( } else { // 批量删除 + if (shapeId.lenth < 1) { // 空数组 + return; + } for (var i = 0, l = shapeId.length; i < l; i++) { delMap[shapeId[i].id] = true; } @@ -12003,6 +12207,7 @@ define( var _isMouseDown = false; var _isDragging = false; var _lastTouchMoment; + var _lastDownButton; var _lastX = 0; var _lastY = 0; @@ -12106,7 +12311,6 @@ define( //if (_mouseX - _lastX > 1 || _mouseY - _lastY > 1) { _dragStartHandler(); //} - _hasfound = false; storage.iterShape(_findHover, { normal: 'down'}); @@ -12209,11 +12413,18 @@ define( * @param {event} event dom事件对象 */ function _mouseDownHandler(event) { + if (_lastDownButton == 2) { + _lastDownButton = event.button; + _mouseDownTarget = null; + // 仅作为关闭右键菜单使用 + return; + } _event = _zrenderEventFixed(event); _isMouseDown = true; //分发config.EVENT.MOUSEDOWN事件 _mouseDownTarget = _lastHover; _dispatchAgency(_lastHover, config.EVENT.MOUSEDOWN); + _lastDownButton = event.button; } /** @@ -12269,7 +12480,7 @@ define( if (new Date() - _lastTouchMoment < config.EVENT.touchClickDelay ) { - _mobildFindFixed() + _mobildFindFixed(); _clickHandler(_event); } painter.clearHover(); @@ -12730,7 +12941,7 @@ define('zrender', ['zrender/zrender'], function (main) { return main; }); } */ define( - 'echarts/util/shape/icon',['require','zrender/tool/matrix','zrender/shape','zrender/shape','zrender/shape/base','zrender/shape'],function(require) { + 'echarts/util/shape/icon',['require','zrender/tool/matrix','zrender/shape','zrender/shape','zrender/shape','zrender/shape','zrender/shape/base','zrender/shape'],function(require) { var matrix = require('zrender/tool/matrix'); function Icon() { @@ -12754,6 +12965,9 @@ define( diamond : _iconDiamond, arrow : _iconArrow, star : _iconStar, + heart : _iconHeart, + droplet : _iconDroplet, + pin : _iconPin, image : _iconImage }; } @@ -13047,6 +13261,42 @@ define( }); } + function _iconHeart(ctx, style) { + var heart = require('zrender/shape').get('heart'); + heart.buildPath(ctx, { + x : style.x + style.width / 2, + y : style.y + style.height * 0.2, + a : style.width / 2, + b : style.height * 0.8 + }); + } + + function _iconDroplet(ctx, style) { + var droplet = require('zrender/shape').get('droplet'); + droplet.buildPath(ctx, { + x : style.x + style.width * 0.5, + y : style.y + style.height * 0.5, + a : style.width * 0.5, + b : style.height * 0.8 + }); + } + + function _iconPin(ctx, style) { + var x = style.x; + var y = style.y - style.height / 2 * 1.5; + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.arc( + x + width, + y + height, + r, + Math.PI / 5 * 4, + Math.PI / 5 + ); + ctx.lineTo(x + width, y + height + r * 1.5); + } + function _iconImage(ctx, style) { setTimeout(function(){ require('zrender/shape').get('image').brush(ctx, { @@ -13081,9 +13331,12 @@ define( * @param {Object} style */ getRect : function(style) { + // pin比较特殊,让尖端在目标x,y上 return { x : Math.round(style.x), - y : Math.round(style.y), + y : Math.round(style.y - (style.iconType == 'pin' + ? (style.height / 2 * 1.5) : 0) + ), width : style.width, height : style.height }; @@ -13126,8 +13379,8 @@ define( rect = this.getRect(e.style); e.style.__rect = rect; } - // 提高交互体验,包围盒四向扩大5px - var delta = 5; + // 提高交互体验,太小的图形包围盒四向扩大4px + var delta = rect.height < 10 ? 4 : 0; if (x >= rect.x - delta && x <= (rect.x + rect.width + 2 * delta) && y >= rect.y - delta @@ -13156,6 +13409,263 @@ define( return Icon; } ); +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:标线 + */ +define( + 'echarts/util/shape/markLine',['require','zrender/tool/matrix','zrender/shape','zrender/shape','zrender/shape/base','zrender/shape'],function(require) { + var matrix = require('zrender/tool/matrix'); + + function MarkLine() { + this.type = 'markLine'; + } + + MarkLine.prototype = { + /** + * 画刷 + * @param ctx 画布句柄 + * @param e 形状实体 + * @param isHighlight 是否为高亮状态 + * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + brush : function(ctx, e, isHighlight) { + var style = e.style || {}; + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + e.highlightStyle || {} + ); + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + if (e.__needTransform) { + ctx.transform.apply(ctx,this.updateTransform(e)); + } + + ctx.beginPath(); + this.buildLinePath(ctx, style); + ctx.stroke(); + + this.brushSymbol(e, ctx, style, 0); + this.brushSymbol(e, ctx, style, 1); + + if (typeof style.text != 'undefined') { + this.drawText(ctx, style, e.style); + } + + ctx.restore(); + + return; + }, + + /** + * 创建线条路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildLinePath : function(ctx, style) { + //var symbolSize = style.symbolSize; + var xStart = style.xStart; + var xEnd = style.xEnd; + var yStart = style.yStart; + var yEnd = style.yEnd; + /* + if (xStart > xEnd) { + xStart -= symbolSize[0]; + xEnd += symbolSize[1]; + } + else { + xStart += symbolSize[0]; + xEnd -= symbolSize[1]; + } + if (yStart > yEnd) { + yStart -= symbolSize[0]; + yEnd += symbolSize[1]; + } + else { + yStart += symbolSize[0]; + yEnd -= symbolSize[1]; + } + */ + if (!style.lineType || style.lineType == 'solid') { + //默认为实线 + ctx.moveTo(xStart, yStart); + ctx.lineTo(xEnd, yEnd); + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength =(style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + this.dashedLineTo( + ctx, + xStart, yStart, + xEnd, yEnd, + dashLength + ); + } + }, + + /** + * 标线始末标注 + */ + brushSymbol : function(e, ctx, style, idx) { + ctx.save(); + ctx.beginPath(); + + ctx.lineWidth = style.symbolBorder; + ctx.strokeStyle = style.symbolBorderColor; + // symbol + style.iconType = style.symbol[idx].replace('empty', '') + .toLowerCase(); + if (style.symbol[idx].match('empty')) { + ctx.fillStyle = 'rgba(0, 0, 0, 0)'; + } + + // symbolRotate + var x = idx === 0 ? style.xStart : style.xEnd; + var y = idx === 0 ? style.yStart : style.yEnd; + var rotate = typeof style.symbolRotate[idx] != 'undefined' + ? (style.symbolRotate[idx] - 0) : 0; + var transform; + if (rotate !== 0) { + transform = matrix.create(); + matrix.identity(transform); + if (x || y ) { + matrix.translate(transform, transform, [-x, -y]); + } + matrix.rotate( + transform, transform, + rotate * Math.PI / 180 + ); + if (x || y ) { + matrix.translate(transform, transform, [x, y]); + } + ctx.transform.apply(ctx, transform); + } + + if (style.iconType == 'arrow' && rotate === 0) { + // 箭头自动旋转,手动画 + this.buildArrawPath(ctx, style, idx); + } + else { + // symbolSize + var symbolSize = style.symbolSize[idx]; + style.x = x - symbolSize; + style.y = y - symbolSize, + style.width = symbolSize * 2; + style.height = symbolSize * 2; + require('zrender/shape').get('icon').buildPath(ctx, style); + } + + ctx.closePath(); + ctx.stroke(); + ctx.fill(); + ctx.restore(); + }, + + buildArrawPath : function (ctx, style, idx) { + var symbolSize = style.symbolSize[idx]; + var xStart = style.xStart; + var xEnd = style.xEnd; + var yStart = style.yStart; + var yEnd = style.yEnd; + // 原谅我吧,这三角函数实在没想明白,只能这么笨了 + var rotate = Math.atan( + Math.abs((yEnd - yStart) / (xStart - xEnd) + )); + if (idx === 0) { + if (xEnd > xStart) { + if (yEnd > yStart) { + rotate = Math.PI * 2 - rotate; + } + } + else { + if (yEnd > yStart) { + rotate += Math.PI; + } + else { + rotate = Math.PI - rotate; + } + } + } + else { + if (xStart > xEnd) { + if (yStart > yEnd) { + rotate = Math.PI * 2 - rotate; + } + } + else { + if (yStart > yEnd) { + rotate += Math.PI; + } + else { + rotate = Math.PI - rotate; + } + } + } + + var halfRotate = Math.PI / 8; // 夹角 + var x = idx === 0 ? xStart : xEnd; + var y = idx === 0 ? yStart : yEnd; + var point= [ + [ + x + symbolSize * Math.cos(rotate - halfRotate), + y - symbolSize * Math.sin(rotate - halfRotate), + ], + [ + x + symbolSize * 0.6 * Math.cos(rotate), + y - symbolSize * 0.6 * Math.sin(rotate), + ], + [ + x + symbolSize * Math.cos(rotate + halfRotate), + y - symbolSize * Math.sin(rotate + halfRotate), + ] + ]; + ctx.moveTo(x, y); + for (var i = 0, l = point.length; i 1 + ? mlOption.symbol + : [mlOption.symbol[0], mlOption.symbol[0]] + : [mlOption.symbol, mlOption.symbol]; + mlOption.symbolSize = mlOption.symbolSize instanceof Array + ? mlOption.symbolSize.length > 1 + ? mlOption.symbolSize + : [mlOption.symbolSize[0], mlOption.symbolSize[0]] + : [mlOption.symbolSize, mlOption.symbolSize]; + mlOption.symbolRotate = mlOption.symbolRotate instanceof Array + ? mlOption.symbolRotate.length > 1 + ? mlOption.symbolRotate + : [mlOption.symbolRotate[0], mlOption.symbolRotate[0]] + : [mlOption.symbolRotate, mlOption.symbolRotate]; + + mlOption.name = serie.name; + + var pList = []; + var data = mlOption.data; + var itemShape; + + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget; + var nColor; + var eColor; + var zrWidth = self.zr.getWidth(); + var zrHeight = self.zr.getHeight(); + for (var i = 0, l = data.length; i < l; i++) { + // 图例 + if (legend) { + color = legend.getColor(serie.name); + } + // 值域 + if (dataRange) { + value = typeof data[i][0] != 'undefined' + ? (typeof data[i][0].value != 'undefined' + ? data[i][0].value + : data[i][0]) + : '-'; + color = isNaN(value) ? color : dataRange.getColor(value); + + queryTarget = [data[i][0], mlOption]; + nColor = self.deepQuery( + queryTarget, 'itemStyle.normal.color' + ) || color; + eColor = self.deepQuery( + queryTarget, 'itemStyle.emphasis.color' + ) || nColor; + // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark + if (nColor == null && eColor == null) { + continue; + } + } + + // 标准化一些参数 + data[i][0].tooltip = {trigger:'item'}; // tooltip.trigger指定为item + data[i][0].name = typeof data[i][0].name != 'undefined' + ? data[i][0].name : ''; + data[i][1].name = typeof data[i][1].name != 'undefined' + ? data[i][1].name : ''; + data[i][0].value = typeof data[i][0].value != 'undefined' + ? data[i][0].value : ''; + + // 复用getSymbolShape + itemShape = getLineMarkShape( + mlOption, // markLine + data[i], // 数据 + parsePercent(data[i][0].x, zrWidth), // 坐标 + parsePercent(data[i][0].y, zrHeight), // 坐标 + parsePercent(data[i][1].x, zrWidth), // 坐标 + parsePercent(data[i][1].y, zrHeight), // 坐标 + color // 默认symbol和color + ); + + // 重新pack一下数据 + ecData.pack( + itemShape, + serie, seriesIndex, + data[i][0], 0, + data[i][0].name + ' : ' + data[i][1].name + ); + pList.push(itemShape); + } + //console.log(pList); + return pList; + } + + function getMarkCoord() { + // 无转换位置 + return [0, 0]; + } + + function getSymbolShape( + serie, seriesIndex, // 系列 + data, dataIndex, name, // 数据 + x, y, // 坐标 + symbol, color, // 默认symbol和color,来自legend或dataRange全局分配 + emptyColor, // 折线的emptySymbol用白色填充 + orient // 走向,用于默认文字定位 + ) { + var queryTarget = [data, serie]; + var value = typeof data != 'undefined' + ? (typeof data.value != 'undefined' + ? data.value + : data) + : '-'; + + symbol = self.deepQuery(queryTarget, 'symbol') || symbol; + var symbolSize = self.deepQuery(queryTarget, 'symbolSize'); + symbolSize = typeof symbolSize == 'function' + ? symbolSize(value) + : symbolSize; + var symbolRotate = self.deepQuery(queryTarget, 'symbolRotate'); + + var normal = self.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + var emphasis = self.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + var nBorderWidth = typeof normal.borderWidth != 'undefined' + ? normal.borderWidth + : (normal.lineStyle && normal.lineStyle.width * 2); + if (typeof nBorderWidth == 'undefined') { + nBorderWidth = 0; + } + var eBorderWidth = typeof emphasis.borderWidth != 'undefined' + ? emphasis.borderWidth + : (emphasis.lineStyle && emphasis.lineStyle.width * 2); + if (typeof eBorderWidth == 'undefined') { + eBorderWidth = nBorderWidth + 2; + } + + var itemShape = { + shape : 'icon', + style : { + iconType : symbol.replace('empty', '').toLowerCase(), + x : x - symbolSize, + y : y - symbolSize, + width : symbolSize * 2, + height : symbolSize * 2, + brushType : 'both', + color : symbol.match('empty') + ? emptyColor + : (normal.color || color), + strokeColor : normal.borderColor || normal.color || color, + lineWidth: nBorderWidth + }, + highlightStyle : { + color : symbol.match('empty') + ? emptyColor + : (emphasis.color|| normal.color || color), + strokeColor : emphasis.borderColor || normal.borderColor + || emphasis.color || normal.color || color, + lineWidth: eBorderWidth + }, + clickable : true + }; + + if (symbol.match('image')) { + itemShape.style.image = + symbol.replace(new RegExp('^image:\\/\\/'), ''); + itemShape.shape = 'image'; + } + + if (typeof symbolRotate != 'undefined') { + itemShape.rotation = [ + symbolRotate * Math.PI / 180, x, y + ]; + } + + if (symbol.match('star')) { + itemShape.style.iconType = 'star'; + itemShape.style.n = + (symbol.replace('empty', '').replace('star','') - 0) || 5; + } + + if (symbol == 'none') { + itemShape.invisible = true; + itemShape.hoverable = false; + } + + /* + if (self.deepQuery([data, serie, option], 'calculable')) { + self.setCalculable(itemShape); + itemShape.draggable = true; + } + */ + + itemShape = self.addLabel( + itemShape, + serie, data, name, + orient + ); + + if (symbol.match('empty')) { + if (typeof itemShape.style.textColor == 'undefined') { + itemShape.style.textColor = itemShape.style.strokeColor; + } + if (typeof itemShape.highlightStyle.textColor == 'undefined') { + itemShape.highlightStyle.textColor = + itemShape.highlightStyle.strokeColor; + } + } + + ecData.pack( + itemShape, + serie, seriesIndex, + data, dataIndex, + name + ); + + itemShape._mark = 'point'; // 复用animationMark + itemShape._x = x; + itemShape._y = y; + + itemShape._dataIndex = dataIndex; + itemShape._seriesIndex = seriesIndex; + + return itemShape; + } + + function getLineMarkShape( + mlOption, // 系列 + data, // 数据 + xStart, yStart, // 坐标 + xEnd, yEnd, // 坐标 + color // 默认color,来自legend或dataRange全局分配 + ) { + var value0 = typeof data[0] != 'undefined' + ? (typeof data[0].value != 'undefined' + ? data[0].value + : data[0]) + : '-'; + var value1 = typeof data[1] != 'undefined' + ? (typeof data[1].value != 'undefined' + ? data[1].value + : data[1]) + : '-'; + var symbol = [ + self.query(data[0], 'symbol') || mlOption.symbol[0], + self.query(data[1], 'symbol') || mlOption.symbol[1] + ]; + var symbolSize = [ + self.query(data[0], 'symbolSize') || mlOption.symbolSize[0], + self.query(data[1], 'symbolSize') || mlOption.symbolSize[1] + ]; + symbolSize[0] = typeof symbolSize[0] == 'function' + ? symbolSize[0](value0) + : symbolSize[0]; + symbolSize[1] = typeof symbolSize[1] == 'function' + ? symbolSize[1](value1) + : symbolSize[1]; + var symbolRotate = [ + self.query(data[0], 'symbolRotate') || mlOption.symbolRotate[0], + self.query(data[1], 'symbolRotate') || mlOption.symbolRotate[1] + ]; + //console.log(symbol, symbolSize, symbolRotate); + + var queryTarget = [data[0], mlOption]; + var normal = self.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + var emphasis = self.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + + var nlineStyle = normal.lineStyle; + var elineStyle = emphasis.lineStyle; + + var nBorderWidth = nlineStyle.width; + if (typeof nBorderWidth == 'undefined') { + nBorderWidth = normal.borderWidth; + } + var eBorderWidth = elineStyle.width; + if (typeof eBorderWidth == 'undefined') { + if (typeof emphasis.borderWidth != 'undefined') { + eBorderWidth = emphasis.borderWidth; + } + else { + eBorderWidth = nBorderWidth + 2; + } + } + + var itemShape = { + shape : 'markLine', + style : { + symbol : symbol, + symbolSize : symbolSize, + symbolRotate : symbolRotate, + //data : [data[0].name,data[1].name], + xStart : xStart, + yStart : yStart, // 坐标 + xEnd : xEnd, + yEnd : yEnd, // 坐标 + brushType : 'both', + lineType : nlineStyle.type, + shadowColor : nlineStyle.shadowColor, + shadowBlur: nlineStyle.shadowBlur, + shadowOffsetX: nlineStyle.shadowOffsetX, + shadowOffsetY: nlineStyle.shadowOffsetY, + color : normal.color || color, + strokeColor : nlineStyle.color + || normal.borderColor + || color + || normal.color, + lineWidth: nBorderWidth, + symbolBorderColor: normal.borderColor + || color + || normal.color, + symbolBorder: normal.borderWidth * 2 + }, + highlightStyle : { + shadowColor : elineStyle.shadowColor, + shadowBlur: elineStyle.shadowBlur, + shadowOffsetX: elineStyle.shadowOffsetX, + shadowOffsetY: elineStyle.shadowOffsetY, + color : emphasis.color|| normal.color || color, + strokeColor : elineStyle.color + || nlineStyle.color + || emphasis.borderColor + || normal.borderColor + || color + || emphasis.color + || normal.color, + lineWidth: eBorderWidth, + symbolBorderColor: emphasis.borderColor + || normal.borderColor + || color + || emphasis.color + || normal.color, + symbolBorder: typeof emphasis.borderWidth == 'undefined' + ? (normal.borderWidth * 2 + 2) + : (emphasis.borderWidth * 2) + }, + clickable : true + }; + + itemShape = self.addLabel( + itemShape, + mlOption, + data[0], + data[0].name + ' : ' + data[1].name + ); + + itemShape._mark = 'line'; + itemShape._x = xEnd; + itemShape._y = yEnd; + + return itemShape; + } + /** * 百分比计算 */ @@ -13499,6 +14705,63 @@ define('echarts/component/base',['require','../config','zrender/tool/util'],func } return position; } + + /** + * 动画设定 + */ + function animation() { + if (_aniMap[self.type]) { + self.animationMark(ecConfig.animationDuration); + } + } + + function animationMark(duration /*, easing*/) { + var x; + var y; + for (var i = 0, l = self.shapeList.length; i < l; i++) { + if (!self.shapeList[i]._mark) { + continue; + } + x = self.shapeList[i]._x || 0; + y = self.shapeList[i]._y || 0; + if (self.shapeList[i]._mark == 'point') { + zr.modShape( + self.shapeList[i].id, + { + scale : [0, 0, x, y] + }, + true + ); + zr.animate(self.shapeList[i].id, '') + .when( + duration, + {scale : [1, 1, x, y]} + ) + .start('QuinticOut'); + } + else if (self.shapeList[i]._mark == 'line') { + zr.modShape( + self.shapeList[i].id, + { + style : { + xEnd : self.shapeList[i].style.xStart, + yEnd : self.shapeList[i].style.yStart + } + }, + true + ); + zr.animate(self.shapeList[i].id, 'style') + .when( + duration, + { + xEnd : x, + yEnd : y + } + ) + .start('QuinticOut'); + } + } + } function resize() { self.refresh && self.refresh(); @@ -13536,138 +14799,23 @@ define('echarts/component/base',['require','../config','zrender/tool/util'],func self.deepMerge = deepMerge; self.getFont = getFont; self.addLabel = addLabel; + self.buildMark = buildMark; + self.getMarkCoord = getMarkCoord; + self.getSymbolShape = getSymbolShape; self.parsePercent = parsePercent; self.parseCenter = parseCenter; self.parseRadius = parseRadius; self.subPixelOptimize = subPixelOptimize; + self.animation = animation; + self.animationMark = animationMark; + self.resize = resize; self.clear = clear; self.dispose = dispose; - self.resize = resize; } return Base; }); -/** - * echarts通用私有数据服务 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/ecData',[],function() { - /** - * 打包私有数据 - * - * @param {shape} shape 修改目标 - * @param {Object} series - * @param {number} seriesIndex - * @param {number | Object} data - * @param {number} dataIndex - * @param {*=} special - * @param {*=} special2 - */ - function pack( - shape, series, seriesIndex, data, dataIndex, name, special, special2 - ) { - var value; - if (typeof data != 'undefined') { - if (typeof data.value != 'undefined') { - value = data.value; - } - else { - value = data; - } - } - - shape._echartsData = { - '_series' : series, - '_seriesIndex' : seriesIndex, - '_data' : data, - '_dataIndex' : dataIndex, - '_name' : name, - '_value' : value, - '_special' : special, - '_special2' : special2 - }; - return shape._echartsData; - } - - /** - * 从私有数据中获取特定项 - * @param {shape} shape - * @param {string} key - */ - function get(shape, key) { - var data = shape._echartsData; - if (!key) { - return data; - } - - switch (key) { - case 'series' : - return data && data._series; - case 'seriesIndex' : - return data && data._seriesIndex; - case 'data' : - return data && data._data; - case 'dataIndex' : - return data && data._dataIndex; - case 'name' : - return data && data._name; - case 'value' : - return data && data._value; - case 'special' : - return data && data._special; - case 'special2' : - return data && data._special2; - } - - return null; - } - - /** - * 修改私有数据中获取特定项 - * @param {shape} shape - * @param {string} key - * @param {*} value - */ - function set(shape, key, value) { - shape._echartsData = shape._echartsData || {}; - switch (key) { - case 'series' : // 当前系列值 - shape._echartsData._series = value; - break; - case 'seriesIndex' : // 系列数组位置索引 - shape._echartsData._seriesIndex = value; - break; - case 'data' : // 当前数据值 - shape._echartsData._data = value; - break; - case 'dataIndex' : // 数据数组位置索引 - shape._echartsData._dataIndex = value; - break; - case 'name' : - shape._echartsData._name = value; - break; - case 'value' : - shape._echartsData._value = value; - break; - case 'special' : - shape._echartsData._special = value; - break; - case 'special2' : - shape._echartsData._special2 = value; - break; - } - } - - return { - pack : pack, - set : set, - get : get - }; -}); /** * 高精度数学运算 */ @@ -14364,11 +15512,11 @@ define('echarts/component/title',['require','./base','../config','zrender/tool/a zrArea.getTextWidth(text, font), zrArea.getTextWidth(subtext, subfont) ); - var totalHeight = zrArea.getTextWidth('国', font) + var totalHeight = zrArea.getTextHeight(text, font) + (subtext === '' ? 0 : (titleOption.itemGap - + zrArea.getTextWidth('国', subfont)) + + zrArea.getTextHeight(subtext, subfont)) ); var x; @@ -14716,7 +15864,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender // 小标记 function _buildAxisTick() { var axShape; - var data = option.data; + //var data = option.data; var dataLength = option.data.length; var length = option.axisTick.length; var color = option.axisTick.lineStyle.color; @@ -14733,9 +15881,9 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender zlevel : _zlevelBase, hoverable : false, style : { - xStart : getCoord(data[i].value || data[i]), + xStart : getCoordByIndex(i), yStart : yPosition, - xEnd : getCoord(data[i].value || data[i]), + xEnd : getCoordByIndex(i), yEnd : yPosition + length, strokeColor : color, lineWidth : lineWidth @@ -14756,9 +15904,9 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender hoverable : false, style : { xStart : xPosition, - yStart : getCoord(data[i].value || data[i]), + yStart : getCoordByIndex(i), xEnd : xPosition + length, - yEnd : getCoord(data[i].value || data[i]), + yEnd : getCoordByIndex(i), strokeColor : color, lineWidth : lineWidth } @@ -14792,6 +15940,10 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender } for (var i = 0; i < dataLength; i += _interval) { + if ((_labelData[i].value || _labelData[i]) === '') { + // 空文本优化 + continue; + } dataTextStyle = zrUtil.merge( data[i].textStyle || {}, textStyle, @@ -14802,7 +15954,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender zlevel : _zlevelBase, hoverable : false, style : { - x : getCoord(data[i].value || data[i]), + x : getCoordByIndex(i), y : yPosition, color : dataTextStyle.color, text : _labelData[i].value || _labelData[i], @@ -14840,6 +15992,10 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender } for (var i = 0; i < dataLength; i += _interval) { + if ((_labelData[i].value || _labelData[i]) === '') { + // 空文本优化 + continue; + } dataTextStyle = zrUtil.merge( data[i].textStyle || {}, textStyle, @@ -14851,7 +16007,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender hoverable : false, style : { x : xPosition, - y : getCoord(data[i].value || data[i]), + y : getCoordByIndex(i), color : dataTextStyle.color, text : _labelData[i].value || _labelData[i], textFont : self.getFont(dataTextStyle), @@ -14873,7 +16029,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender function _buildSplitLine() { var axShape; - var data = option.data; + //var data = option.data; var dataLength = option.data.length; var lineType = option.splitLine.lineStyle.type; var lineWidth = option.splitLine.lineStyle.width; @@ -14890,7 +16046,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i < dataLength; i += _interval) { // 亚像素优化 x = self.subPixelOptimize( - getCoord(data[i].value || data[i]), lineWidth + getCoordByIndex(i), lineWidth ); axShape = { shape : 'line', @@ -14919,7 +16075,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i < dataLength; i += _interval) { // 亚像素优化 y = self.subPixelOptimize( - getCoord(data[i].value || data[i]), lineWidth + getCoordByIndex(i), lineWidth ); axShape = { shape : 'line', @@ -14945,7 +16101,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender var color = option.splitArea.areaStyle.color; color = color instanceof Array ? color : [color]; var colorLength = color.length; - var data = option.data; + //var data = option.data; var dataLength = option.data.length; if (option.position == 'bottom' || option.position == 'top') { @@ -14957,7 +16113,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i <= dataLength; i += _interval) { curX = i < dataLength - ? getCoord(data[i].value || data[i]) + ? getCoordByIndex(i) : grid.getXend(); axShape = { shape : 'rectangle', @@ -14985,7 +16141,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender for (var i = 0; i <= dataLength; i += _interval) { curY = i < dataLength - ? getCoord(data[i].value || data[i]) + ? getCoordByIndex(i) : grid.getY(); axShape = { shape : 'rectangle', @@ -15142,7 +16298,27 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender // 根据类目轴数据索引换算类目轴名称 function getNameByIndex(dataIndex) { - return option.data[dataIndex]; + if (typeof option.data[dataIndex].value != 'undefined') { + return option.data[dataIndex].value; + } + else { + return option.data[dataIndex]; + } + } + + // 根据类目轴名称换算类目轴数据索引 + function getIndexByName(name) { + var data = option.data; + var dataLength = data.length; + + for (var i = 0; i < dataLength; i++) { + if (data[i] == name + || (typeof data[i].value != 'undefined' + && data[i].value == name) + ) { + return i; + } + } } /** @@ -15164,6 +16340,7 @@ define('echarts/component/categoryAxis',['require','./base','../config','zrender self.getCoord = getCoord; self.getCoordByIndex = getCoordByIndex; self.getNameByIndex = getNameByIndex; + self.getIndexByName = getIndexByName; self.isMainAxis = isMainAxis; self.getPosition = getPosition; @@ -16311,25 +17488,26 @@ define('echarts/component/grid',['require','./base','../config','../component'], option.grid = self.reformOption(option.grid); var gridOption = option.grid; - _x = gridOption.x; - _y = gridOption.y; - var x2 = gridOption.x2; - var y2 = gridOption.y2; _zrWidth = zr.getWidth(); _zrHeight = zr.getHeight(); + _x = self.parsePercent(gridOption.x, _zrWidth); + _y = self.parsePercent(gridOption.y, _zrHeight); + var x2 = self.parsePercent(gridOption.x2, _zrWidth); + var y2 = self.parsePercent(gridOption.y2, _zrHeight); + if (typeof gridOption.width == 'undefined') { _width = _zrWidth - _x - x2; } else { - _width = gridOption.width; + _width = self.parsePercent(gridOption.width, _zrWidth); } if (typeof gridOption.height == 'undefined') { _height = _zrHeight - _y - y2; } else { - _height = gridOption.height; + _height = self.parsePercent(gridOption.height, _zrHeight); } _x = self.subPixelOptimize(_x, gridOption.borderWidth); @@ -17192,11 +18370,13 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen } // console.log(xStart,xEnd,yStart,yEnd); + var value; for (var i = 0, l = data.length; i < l; i++) { - if (data[i][0] >= xStart - && data[i][0] <= xEnd - && data[i][1] >= yStart - && data[i][1] <= yEnd + value = data[i].value || data[i]; + if (value[0] >= xStart + && value[0] <= xEnd + && value[1] >= yStart + && value[1] <= yEnd ) { newData.push(data[i]); } @@ -17308,8 +18488,8 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen var total; var sdx = (rect.x - gridArea.x) / gridArea.width; - var edx = 1- (rect.x + rect.width - gridArea.x) / gridArea.width; - var sdy = 1- (rect.y + rect.height - gridArea.y) / gridArea.height; + var edx = 1 - (rect.x + rect.width - gridArea.x) / gridArea.width; + var sdy = 1 - (rect.y + rect.height - gridArea.y) / gridArea.height; var edy = (rect.y - gridArea.y) / gridArea.height; //console.log('this',sdy,edy,_zoom.start,_zoom.end) if (zoomOption.orient == 'horizontal') { @@ -17366,9 +18546,22 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen } } } + function silence(s) { _isSilence = s; } + + function getRealDataIndex(sIdx, dIdx) { + if (!_originalData) { + return dIdx; + } + var sreies = _originalData.series; + if (sreies[sIdx]) { + return Math.floor(_zoom.start / 100 * sreies[sIdx].length) + + dIdx; + } + return -1; + } function init(newOption) { option = newOption; @@ -17382,8 +18575,8 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen // 自己show 或者 toolbox启用且dataZoom有效 if (option.dataZoom.show || ( - self.deepQuery([option], 'toolbox.show') - && self.deepQuery([option], 'toolbox.feature.dataZoom') + self.query(option, 'toolbox.show') + && self.query(option, 'toolbox.feature.dataZoom') ) ) { _location = _getLocation(); @@ -17405,8 +18598,8 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen // 自己show 或者 toolbox启用且dataZoom有效 if (option.dataZoom.show || ( - self.deepQuery([option], 'toolbox.show') - && self.deepQuery([option], 'toolbox.feature.dataZoom') + self.query(option, 'toolbox.show') + && self.query(option, 'toolbox.feature.dataZoom') ) ) { _location = _getLocation(); @@ -17434,6 +18627,7 @@ define('echarts/component/dataZoom',['require','./base','../config','../componen self.ondragend = ondragend; self.ondataZoom = ondataZoom; self.silence = silence; + self.getRealDataIndex = getRealDataIndex; init(option); } @@ -17876,12 +19070,12 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ break; case 'k' : itemShape.style.brushType = 'both'; - itemShape.style.color = self.deepQuery( - [ecConfig], 'k.itemStyle.normal.color' + itemShape.style.color = self.query( + ecConfig, 'k.itemStyle.normal.color' ) || '#fff'; itemShape.style.strokeColor = color != '#ccc' - ? self.deepQuery( - [ecConfig], 'k.itemStyle.normal.lineStyle.color' + ? self.query( + ecConfig, 'k.itemStyle.normal.lineStyle.color' ) || '#ff3200' : color; } @@ -17899,7 +19093,7 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ } function init(newOption) { - if (!self.deepQuery([newOption], 'legend.data')) { + if (!self.query(newOption, 'legend.data')) { return; } @@ -17931,8 +19125,8 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ _selectedMap[itemName] = false; } else { - color = self.deepQuery( - [serie], 'itemStyle.normal.color' + color = self.query( + serie, 'itemStyle.normal.color' ); if (color && serie.type != ecConfig.CHART_TYPE_K) { setColor(itemName, color); @@ -18054,6 +19248,10 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ return true; } } + + function getSelectedMap() { + return _selectedMap; + } self.init = init; self.refresh = refresh; @@ -18065,6 +19263,7 @@ define('echarts/component/legend',['require','./base','../config','zrender/tool/ self.getItemShape = getItemShape; self.setItemShape = setItemShape; self.isSelected = isSelected; + self.getSelectedMap = getSelectedMap; init(option); } @@ -18283,7 +19482,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var itemWidth = dataRangeOption.itemWidth; var itemHeight = dataRangeOption.itemHeight; var itemGap = dataRangeOption.itemGap; - var textHeight = zrArea.getTextWidth('国', font); + var textHeight = zrArea.getTextHeight('国', font); var color; if (dataRangeOption.orient == 'vertical' @@ -18310,6 +19509,8 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } else { lastY += textHeight + _textGap; + textShape.style.y += textHeight / 2 + _textGap; + textShape.style.textBaseline = 'bottom'; } self.shapeList.push(textShape); } @@ -18380,6 +19581,11 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to textShape = _getTextShape( lastX, lastY, dataRangeOption.text[1] ); + + if (dataRangeOption.orient != 'horizontal') { + textShape.style.y -= 5; + textShape.style.textBaseline = 'top'; + } self.shapeList.push(textShape); } @@ -18397,7 +19603,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var lastY = _itemGroupLocation.y; var itemWidth = dataRangeOption.itemWidth; var itemHeight = dataRangeOption.itemHeight; - var textHeight = zrArea.getTextWidth('国', font); + var textHeight = zrArea.getTextHeight('国', font); var needValueText = true; @@ -18417,6 +19623,8 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } else { lastY += textHeight + _textGap; + textShape.style.y += textHeight / 2 + _textGap; + textShape.style.textBaseline = 'bottom'; } self.shapeList.push(textShape); } @@ -18515,7 +19723,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var height = _calculableLocation.height; var font = self.getFont(dataRangeOption.textStyle); - var textHieght = zrArea.getTextWidth('国', font) + 2; + var textHeight = zrArea.getTextHeight('国', font); var textWidth = Math.max( zrArea.getTextWidth( dataRangeOption.precision === 0 @@ -18546,23 +19754,23 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to // 手柄统统在下方 pointListStart = [ [x, y], - [x, y + height + textHieght / 2 * 3], - [x - textWidth, y + height + textHieght / 2 * 3], - [x - textWidth, y + height + textHieght / 2], - [x - textHieght / 2, y + height + textHieght / 2], + [x, y + height + textHeight / 2 * 3], + [x - textWidth, y + height + textHeight / 2 * 3], + [x - textWidth, y + height + textHeight / 2], + [x - textHeight / 2, y + height + textHeight / 2], [x - 1, y + height], [x - 1, y] ]; textXStart = x - textWidth / 2; - textYStart = y + height + textHieght; + textYStart = y + height + textHeight; pointListEnd = [ [x + width, y], - [x + width, y + height + textHieght / 2 * 3], - [x + width + textWidth, y + height + textHieght/2*3], - [x + width + textWidth, y + height + textHieght / 2], - [x + width + textHieght / 2, y + height + textHieght/2], + [x + width, y + height + textHeight / 2 * 3], + [x + width + textWidth, y + height + textHeight/2*3], + [x + width + textWidth, y + height + textHeight / 2], + [x + width + textHeight / 2, y + height + textHeight/2], [x + width + 1, y + height], [x + width + 1, y] ]; @@ -18573,23 +19781,23 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to // 手柄在上方 pointListStart = [ [x, y + height], - [x, y - textHieght / 2 * 3], - [x - textWidth, y - textHieght / 2 * 3], - [x - textWidth, y - textHieght / 2], - [x - textHieght / 2, y - textHieght / 2], + [x, y - textHeight / 2 * 3], + [x - textWidth, y - textHeight / 2 * 3], + [x - textWidth, y - textHeight / 2], + [x - textHeight / 2, y - textHeight / 2], [x - 1, y], [x - 1, y + height] ]; textXStart = x - textWidth / 2; - textYStart = y - textHieght; + textYStart = y - textHeight; pointListEnd = [ [x + width, y + height], - [x + width, y - textHieght / 2 * 3], - [x + width + textWidth, y - textHieght / 2 * 3], - [x + width + textWidth, y - textHieght / 2], - [x + width + textHieght / 2, y - textHieght / 2], + [x + width, y - textHeight / 2 * 3], + [x + width + textWidth, y - textHeight / 2 * 3], + [x + width + textWidth, y - textHeight / 2], + [x + width + textHeight / 2, y - textHeight / 2], [x + width + 1, y], [x + width + 1, y + height] ]; @@ -18598,55 +19806,54 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } } else { - textWidth += textHieght; + textWidth += textHeight; // 垂直 if (dataRangeOption.x != 'right') { // 手柄统统在右侧 pointListStart = [ [x, y], [x + width + textWidth, y], - [x + width + textWidth, y - textHieght], - [x + width + textHieght, y - textHieght], + [x + width + textWidth, y - textHeight], + [x + width + textHeight, y - textHeight], [x + width, y - 1], [x, y - 1] ]; - textXStart = x + width + textWidth / 2 + textHieght / 2; - textYStart = y - textHieght / 2; - + textXStart = x + width + textWidth / 2 + textHeight / 2; + textYStart = y - textHeight / 2; pointListEnd = [ [x, y + height], [x + width + textWidth, y + height], - [x + width + textWidth, y + textHieght + height], - [x + width + textHieght, y + textHieght + height], + [x + width + textWidth, y + textHeight + height], + [x + width + textHeight, y + textHeight + height], [x + width, y + 1 + height], [x, y + height + 1] ]; textXEnd = textXStart; - textYEnd = y + height + textHieght / 2; + textYEnd = y + height + textHeight / 2; } else { // 手柄在左侧 pointListStart = [ [x + width, y], [x - textWidth, y], - [x - textWidth, y - textHieght], - [x - textHieght, y - textHieght], + [x - textWidth, y - textHeight], + [x - textHeight, y - textHeight], [x, y - 1], [x + width, y - 1] ]; - textXStart = x - textWidth / 2 - textHieght / 2; - textYStart = y - textHieght / 2; + textXStart = x - textWidth / 2 - textHeight / 2; + textYStart = y - textHeight / 2; pointListEnd = [ [x + width, y + height], [x - textWidth, y + height], - [x - textWidth, y + textHieght + height], - [x - textHieght, y + textHieght + height], + [x - textWidth, y + textHeight + height], + [x - textHeight, y + textHeight + height], [x, y + 1 + height], [x + width, y + height + 1] ]; textXEnd = textXStart; - textYEnd = y + height + textHieght / 2; + textYEnd = y + height + textHeight / 2; } } @@ -18660,7 +19867,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to textY : textYStart, textPosition : 'specific', textAlign : 'center', - textBaseline : 'middle ', + textBaseline : 'middle', textColor: dataRangeOption.textStyle.color, color : getColor(dataRangeOption.max), width : 0, // for ondrif计算统一 @@ -18685,7 +19892,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to textY : textYEnd, textPosition : 'specific', textAlign : 'center', - textBaseline : 'middle ', + textBaseline : 'middle', textColor: dataRangeOption.textStyle.color, color : getColor(dataRangeOption.min), width : 0, // for ondrif计算统一 @@ -18778,7 +19985,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to var totalWidth = 0; var totalHeight = 0; var font = self.getFont(dataRangeOption.textStyle); - var textHeight = zrArea.getTextWidth('国', font); + var textHeight = zrArea.getTextHeight('国', font); if (dataRangeOption.orient == 'horizontal') { // 水平布局,计算总宽度 @@ -18894,7 +20101,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to - dataRangeOption.borderWidth; break; default : - x = dataRangeOption.x - 0; + x = self.parsePercent(dataRangeOption.x, zrWidth); x = isNaN(x) ? 0 : x; break; } @@ -18916,7 +20123,7 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to y = Math.floor((zrHeight - totalHeight) / 2); break; default : - y = dataRangeOption.y - 0; + y = self.parsePercent(dataRangeOption.y, zrHeight); y = isNaN(y) ? 0 : y; break; } @@ -19289,9 +20496,9 @@ define('echarts/component/dataRange',['require','./base','../config','zrender/to } function init(newOption) { - if (typeof self.deepQuery([newOption], 'dataRange.min') + if (typeof self.query(newOption, 'dataRange.min') == 'undefined' - || typeof self.deepQuery([newOption], 'dataRange.max') + || typeof self.query(newOption, 'dataRange.max') == 'undefined' ) { return; @@ -19479,6 +20686,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa var yAxis; var polar; + var _selectedMap = {}; // tooltip dom & css var _tDom = document.createElement('div'); // 通用样式 @@ -19913,21 +21121,24 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 categoryAxis = xAxis.getAxis(xAxisIndex); for (var i = 0, l = series.length; i < l; i++) { + if (!_isSelected(series[i].name)) { + continue; + } if (series[i].xAxisIndex == xAxisIndex && self.deepQuery( [series[i], option], 'tooltip.trigger' ) == 'axis' ) { - showContent = self.deepQuery( - [series[i]], + showContent = self.query( + series[i], 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [series[i]], + formatter = self.query( + series[i], 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [series[i]], 'tooltip' + specialCssText += _style(self.query( + series[i], 'tooltip' )); seriesArray.push(series[i]); seriesIndex.push(i); @@ -19939,7 +21150,12 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa _event, { seriesIndex : seriesIndex, - dataIndex : dataIndex + dataIndex : component.dataZoom + ? component.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex } ); y = zrEvent.getY(_event) + 10; @@ -19959,21 +21175,24 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 categoryAxis = yAxis.getAxis(yAxisIndex); for (var i = 0, l = series.length; i < l; i++) { + if (!_isSelected(series[i].name)) { + continue; + } if (series[i].yAxisIndex == yAxisIndex && self.deepQuery( [series[i], option], 'tooltip.trigger' ) == 'axis' ) { - showContent = self.deepQuery( - [series[i]], + showContent = self.query( + series[i], 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [series[i]], + formatter = self.query( + series[i], 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [series[i]], 'tooltip' + specialCssText += _style(self.query( + series[i], 'tooltip' )); seriesArray.push(series[i]); seriesIndex.push(i); @@ -19985,7 +21204,12 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa _event, { seriesIndex : seriesIndex, - dataIndex : dataIndex + dataIndex : component.dataZoom + ? component.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex } ); x = zrEvent.getX(_event) + 10; @@ -20108,24 +21332,29 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa } formatter = option.tooltip.formatter; } + var indicatorName = + option.polar[polarIndex].indicator[dataIndex].text; // 找到所有用这个极坐标并且axis触发的系列数据 for (var i = 0, l = series.length; i < l; i++) { + if (!_isSelected(series[i].name)) { + continue; + } if (series[i].polarIndex == polarIndex && self.deepQuery( [series[i], option], 'tooltip.trigger' ) == 'axis' ) { - showContent = self.deepQuery( - [series[i]], + showContent = self.query( + series[i], 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [series[i]], + formatter = self.query( + series[i], 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [series[i]], 'tooltip' + specialCssText += _style(self.query( + series[i], 'tooltip' )); seriesArray.push(series[i]); } @@ -20134,13 +21363,14 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa var polarData; var data; var params = []; - var indicatorName = - option.polar[polarIndex].indicator[dataIndex].text; for (var i = 0, l = seriesArray.length; i < l; i++) { polarData = seriesArray[i].data; for (var j = 0, k = polarData.length; j < k; j++) { data = polarData[j]; + if (!_isSelected(data.name)) { + continue; + } data = typeof data != 'undefined' ? data : {name:'', value: {dataIndex:'-'}}; @@ -20239,25 +21469,25 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa formatter = option.tooltip.formatter; } // 系列 - if (self.deepQuery([serie], 'tooltip.trigger') == 'item') { - showContent = self.deepQuery( - [serie], 'tooltip.showContent' + if (self.query(serie, 'tooltip.trigger') == 'item') { + showContent = self.query( + serie, 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [serie], 'tooltip.formatter' + formatter = self.query( + serie, 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery( - [serie], 'tooltip' + specialCssText += _style(self.query( + serie, 'tooltip' )); } // 数据项 - showContent = self.deepQuery( - [data], 'tooltip.showContent' + showContent = self.query( + data, 'tooltip.showContent' ) || showContent; - formatter = self.deepQuery( - [data], 'tooltip.formatter' + formatter = self.query( + data, 'tooltip.formatter' ) || formatter; - specialCssText += _style(self.deepQuery([data], 'tooltip')); + specialCssText += _style(self.query(data, 'tooltip')); } else { showContent = self.deepQuery( @@ -20319,7 +21549,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa ? '' : (' (' + special + ')')); } - else if (serie.type == ecConfig.CHART_TYPE_RADAR) { + else if (serie.type == ecConfig.CHART_TYPE_RADAR && special) { indicator = special; html += _encodeHTML( name === '' ? (serie.name || '') : name @@ -20406,32 +21636,32 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa [seriesArray[i], option], 'tooltip.trigger' ) == 'axis' ) { - queryTarget = [seriesArray[i]]; - curType = self.deepQuery( + queryTarget = seriesArray[i]; + curType = self.query( queryTarget, 'tooltip.axisPointer.type' ); pointType = curType || pointType; if (curType == 'line') { - lineColor = self.deepQuery( + lineColor = self.query( queryTarget, 'tooltip.axisPointer.lineStyle.color' ) || lineColor; - lineWidth = self.deepQuery( + lineWidth = self.query( queryTarget, 'tooltip.axisPointer.lineStyle.width' ) || lineWidth; - lineType = self.deepQuery( + lineType = self.query( queryTarget, 'tooltip.axisPointer.lineStyle.type' ) || lineType; } else if (curType == 'shadow') { - areaSize = self.deepQuery( + areaSize = self.query( queryTarget, 'tooltip.axisPointer.areaStyle.size' ) || areaSize; - areaColor = self.deepQuery( + areaColor = self.query( queryTarget, 'tooltip.axisPointer.areaStyle.color' ) || areaColor; @@ -20647,6 +21877,29 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa function ondragend() { _hide(); } + + /** + * 图例选择 + */ + function onlegendSelected(param) { + _selectedMap = param.selected; + } + function _setSelectedMap() { + if (option.legend && option.legend.selected) { + _selectedMap = option.legend.selected; + } + else { + _selectedMap = {}; + } + } + function _isSelected(itemName) { + if (typeof _selectedMap[itemName] != 'undefined') { + return _selectedMap[itemName]; + } + else { + return true; // 没在legend里定义的都为true啊~ + } + } function init(newOption, newDom) { option = newOption; @@ -20673,9 +21926,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa var series = option.series; for (var i = 0, l = series.length; i < l; i++) { - if (self.deepQuery([series[i]], 'tooltip.trigger') - == 'axis' - ) { + if (self.query(series[i], 'tooltip.trigger') == 'axis') { _needAxisTrigger = true; break; } @@ -20686,6 +21937,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa _defaultCssText = _style(option.tooltip); _tDom.style.position = 'absolute'; // 不是多余的,别删! self.hasAppend = false; + _setSelectedMap(); } /** @@ -20707,6 +21959,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa option.tooltip.padding = self.reformCssArray( option.tooltip.padding ); + _setSelectedMap(); } } @@ -20761,6 +22014,7 @@ define('echarts/component/tooltip',['require','./base','../config','../util/ecDa self.setComponent = setComponent; self.ontooltipHover = ontooltipHover; self.ondragend = ondragend; + self.onlegendSelected = onlegendSelected; init(option, dom); } @@ -20886,13 +22140,13 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf var textFont = self.getFont(toolboxOption.textStyle); var textPosition; var textAlign; - var textBaseLine; + var textBaseline; if (toolboxOption.orient == 'horizontal') { textPosition = _itemGroupLocation.y / zr.getHeight() < 0.5 ? 'bottom' : 'top'; textAlign = _itemGroupLocation.x / zr.getWidth() < 0.5 ? 'left' : 'right'; - textBaseLine = _itemGroupLocation.y / zr.getHeight() < 0.5 + textBaseline = _itemGroupLocation.y / zr.getHeight() < 0.5 ? 'top' : 'bottom'; } else { @@ -20901,7 +22155,7 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf /* textAlign = _itemGroupLocation.x / zr.getWidth() < 0.5 ? 'right' : 'left'; - textBaseLine = 'top'; + textBaseline = 'top'; */ } @@ -20944,18 +22198,18 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf if (i === 0 && textAlign == 'left') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; - itemShape.highlightStyle.textBaseLine = textBaseLine; + itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX; - itemShape.highlightStyle.textY = textBaseLine == 'top' + itemShape.highlightStyle.textY = textBaseline == 'top' ? lastY + itemSize + 10 : lastY - 10; } if (i == iconLength - 1 && textAlign == 'right') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; - itemShape.highlightStyle.textBaseLine = textBaseLine; + itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX + itemSize; - itemShape.highlightStyle.textY = textBaseLine == 'top' + itemShape.highlightStyle.textY = textBaseline == 'top' ? lastY + itemSize + 10 : lastY - 10; } @@ -21264,16 +22518,16 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf yStart : y, xEnd : x, yEnd : y, - lineWidth : self.deepQuery( - [option], + lineWidth : self.query( + option, 'toolbox.feature.mark.lineStyle.width' ) || 2, - strokeColor : self.deepQuery( - [option], + strokeColor : self.query( + option, 'toolbox.feature.mark.lineStyle.color' ) || _markColor, - lineType : self.deepQuery( - [option], + lineType : self.query( + option, 'toolbox.feature.mark.lineStyle.type' ) || 'dashed' } @@ -21691,12 +22945,12 @@ define('echarts/component/toolbox',['require','./base','../config','zrender/conf function resize() { _resetMark(); self.clear(); - if (option.toolbox.show) { + if (option && option.toolbox && option.toolbox.show) { _buildShape(); - } - if (_dataView) { - _dataView.resize(); - } + } + if (_dataView) { + _dataView.resize(); + } } function hideDataView() { @@ -21812,7 +23066,7 @@ define('echarts/component/dataView',['require','./base','../config','../componen function show(newOption) { _hasShow = true; - var lang = self.deepQuery([option],'toolbox.feature.dataView.lang') + var lang = self.query(option, 'toolbox.feature.dataView.lang') || _lang; option = newOption; @@ -21827,8 +23081,8 @@ define('echarts/component/dataView',['require','./base','../config','../componen 'display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;' + 'width:' + (_zrWidth - 15) + 'px;' + 'height:' + (_zrHeight - 100) + 'px;'; - var customContent = self.deepQuery( - [option], 'toolbox.feature.dataView.optionToContent' + var customContent = self.query( + option, 'toolbox.feature.dataView.optionToContent' ); if (typeof customContent != 'function') { _textArea.value = _optionToContent(); @@ -21843,7 +23097,7 @@ define('echarts/component/dataView',['require','./base','../config','../componen _buttonClose.onclick = hide; _tDom.appendChild(_buttonClose); - if (self.deepQuery([option], 'toolbox.feature.dataView.readOnly') + if (self.query(option, 'toolbox.feature.dataView.readOnly') === false ) { _buttonRefresh.style.cssText = @@ -21960,8 +23214,8 @@ define('echarts/component/dataView',['require','./base','../config','../componen function _save() { var text = _textArea.value; - var customContent = self.deepQuery( - [option], 'toolbox.feature.dataView.contentToOption' + var customContent = self.query( + option, 'toolbox.feature.dataView.contentToOption' ); if (typeof customContent != 'function') { text = text.split('\n'); @@ -22457,8 +23711,10 @@ define( if (!name.show) { continue; } - textStyle = self.deepQuery([name, item, option], - 'textStyle'); + textStyle = self.deepQuery( + [name, item, option], + 'textStyle' + ); style = {}; @@ -22821,6 +24077,9 @@ define( for (var i = 0; i < series.length; i ++) { serie = series[i]; + if (serie.type != ecConfig.CHART_TYPE_RADAR) { + continue; + } serieData = serie.data || []; for (var j = 0; j < serieData.length; j ++) { polarIndex = self.deepQuery( @@ -23170,32 +24429,8 @@ define( * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt */ /** @@ -23205,12 +24440,12 @@ define( * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -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','./component/polar','./util/ecData','./chart','./component','zrender/tool/util','zrender/tool/util','zrender/tool/util','zrender/tool/color','zrender/tool/util','zrender/tool/util','zrender/tool/util'],function(require) { +define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zrender/tool/event','zrender/config','./util/shape/icon','./util/shape/markLine','./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','./component/polar','./util/ecData','./chart','./component','zrender/tool/util','zrender/tool/util','zrender/tool/util','zrender/tool/color','zrender/tool/util','zrender/tool/util','zrender/tool/util'],function(require) { var self = {}; var echarts = self; // 提供内部反向使用静态方法; - self.version = '1.3.5'; + self.version = '1.3.6'; self.dependencies = { - zrender : '1.0.7' + zrender : '1.0.8' }; /** * 入口方法 @@ -23218,6 +24453,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr self.init = function(dom, libOption) { libOption = libOption || {type : 'canvas'}; if (libOption.type == 'canvas') { + dom = dom instanceof Array ? dom[0] : dom; return new Echarts(dom); } else if (libOption.type == 'flash') { @@ -23315,8 +24551,9 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _zr.on(zrConfig.EVENT.DRAGLEAVE, _ondragleave); _zr.on(zrConfig.EVENT.DROP, _ondrop); - // 动态扩展zrender shape:icon + // 动态扩展zrender shape:icon、markLine require('./util/shape/icon'); + require('./util/shape/markLine'); // 内置图表注册 var chartLibrary = require('./chart'); @@ -23342,6 +24579,8 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr // 工具箱 var Toolbox = componentLibrary.get('toolbox'); _toolbox = new Toolbox(_messageCenter, _zr, dom); + + _disposeChartList(); } /** @@ -23670,10 +24909,22 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr function _eventPackage(target) { if (target) { var ecData = require('./util/ecData'); + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + dataIndex = self.compoent.dataZoom + ? self.compoent.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex; return { - seriesIndex : ecData.get(target, 'seriesIndex'), - dataIndex : ecData.get(target, 'dataIndex'), - data : ecData.get(target, 'data') + seriesIndex : seriesIndex, + dataIndex : dataIndex, + data : ecData.get(target, 'data'), + name : ecData.get(target, 'name'), + value : ecData.get(target, 'value') }; } return; @@ -23697,6 +24948,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _messageCenter, _zr, magicOption ); _chartList.push(title); + self.compoent.title = title; } // 提示 @@ -23705,6 +24957,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr var Tooltip = componentLibrary.get('tooltip'); tooltip = new Tooltip(_messageCenter, _zr, magicOption, dom); _chartList.push(tooltip); + self.compoent.tooltip = tooltip; } // 图例 @@ -23715,6 +24968,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _messageCenter, _zr, magicOption, _selectedMap ); _chartList.push(legend); + self.compoent.legend = legend; } // 值域控件 @@ -23725,6 +24979,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _messageCenter, _zr, magicOption ); _chartList.push(dataRange); + self.compoent.dataRange = dataRange; } // 直角坐标系 @@ -23736,6 +24991,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr var Grid = componentLibrary.get('grid'); grid = new Grid(_messageCenter, _zr, magicOption); _chartList.push(grid); + self.compoent.grid = grid; var DataZoom = componentLibrary.get('dataZoom'); dataZoom = new DataZoom( @@ -23748,6 +25004,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr } ); _chartList.push(dataZoom); + self.compoent.dataZoom = dataZoom; var Axis = componentLibrary.get('axis'); xAxis = new Axis( @@ -23761,6 +25018,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr 'xAxis' ); _chartList.push(xAxis); + self.compoent.xAxis = xAxis; yAxis = new Axis( _messageCenter, @@ -23773,6 +25031,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr 'yAxis' ); _chartList.push(yAxis); + self.compoent.yAxis = yAxis; } // 极坐标系 @@ -23788,6 +25047,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr } ); _chartList.push(polar); + self.compoent.polar = polar; } tooltip && tooltip.setComponent({ @@ -23825,6 +25085,7 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr } ); _chartList.push(chart); + self.chart[chartType] = chart; } } } @@ -23836,9 +25097,15 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr if (magicOption.animation && !magicOption.renderAsImage) { var len = _chartList.length; while (len--) { - _chartList[len] - && _chartList[len].animation - && _chartList[len].animation(); + chart = _chartList[len]; + if (chart + && chart.animation + && chart.shapeList + && chart.shapeList.length + < magicOption.animationThreshold + ) { + chart.animation(); + } } } @@ -23949,6 +25216,13 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr && _chartList[len].dispose(); } _chartList = []; + + self.chart = { + island : _island + }; + self.compoent = { + toolbox : _toolbox + }; } /** @@ -23990,6 +25264,9 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr if (typeof _option.animation == 'undefined') { _option.animation = ecConfig.animation; } + if (typeof _option.animationThreshold == 'undefined') { + _option.animationThreshold = ecConfig.animationThreshold; + } if (typeof _option.animationDuration == 'undefined') { _option.animationDuration = ecConfig.animationDuration; } @@ -24380,6 +25657,9 @@ define('echarts/echarts',['require','./config','zrender','zrender/tool/util','zr _island.resize(); _toolbox.resize(); _zr.refresh(); + _messageCenter.dispatch( + ecConfig.EVENT.RESIZE + ); return self; } @@ -24596,11 +25876,17 @@ define( var ratio = window.devicePixelRatio || 1; // console.log(rect) // var ti = new Date(); + // bbox取整 + rect = { + x : Math.floor(rect.x), + y : Math.floor(rect.y), + width : Math.floor(rect.width), + height : Math.floor(rect.height) + }; var pixels = ctx.getImageData( rect.x * ratio, rect.y * ratio, rect.width * ratio, rect.height * ratio ); - var data = pixels.data; var idx; var zrColor = require('zrender/tool/color'); @@ -24651,7 +25937,7 @@ define( * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -define('echarts/chart/scatter',['require','../component/base','./calculableBase','../config','../util/ecData','zrender/tool/color','../util/shape/symbol','../chart'],function(require) { +define('echarts/chart/scatter',['require','../component/base','./calculableBase','../config','zrender/tool/color','../util/shape/symbol','../chart'],function(require) { /** * 构造函数 * @param {Object} messageCenter echart消息中心 @@ -24668,7 +25954,6 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' CalculableBase.call(this, zr, option); var ecConfig = require('../config'); - var ecData = require('../util/ecData'); var zrColor = require('zrender/tool/color'); @@ -24700,7 +25985,7 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' serieName = serie.name; if (serie.type == ecConfig.CHART_TYPE_SCATTER) { series[i] = self.reformOption(series[i]); - _sIndex2ShapeMap[i] = self.deepQuery([serie], 'symbol') + _sIndex2ShapeMap[i] = self.query(serie, 'symbol') || _symbol[i % _symbol.length]; if (legend){ self.selectedMap[serieName] = @@ -24775,7 +26060,6 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' var pointList = {}; var x; var y; - var symbolSize; for (var j = 0, k = seriesArray.length; j < k; j++) { seriesIndex = seriesArray[j]; serie = series[seriesIndex]; @@ -24786,7 +26070,6 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' xAxis = component.xAxis.getAxis(serie.xAxisIndex || 0); yAxis = component.yAxis.getAxis(serie.yAxisIndex || 0); - symbolSize = self.deepQuery([serie], 'symbolSize'); pointList[seriesIndex] = []; for (var i = 0, l = serie.data.length; i < l; i++) { data = serie.data[i]; @@ -24802,16 +26085,17 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' x = xAxis.getCoord(value[0]); y = yAxis.getCoord(value[1]); pointList[seriesIndex].push([ - x, // 横坐标 - y, // 纵坐标 - (typeof symbolSize == 'function' - ? symbolSize(value) - : symbolSize), // 图形大小 - _sIndex2ShapeMap[seriesIndex], // 图形类型 - i, // 数据index - data.name || '' // 名称 + x, // 横坐标 + y, // 纵坐标 + i, // 数据index + data.name || '' // 名称 ]); } + self.buildMark( + serie, + seriesIndex, + component + ); } // console.log(pointList) _buildPointList(pointList); @@ -24821,46 +26105,19 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' * 生成折线和折线上的拐点 */ function _buildPointList(pointList) { - var dataRange = component.dataRange; - var rangColor; // 更高优先级 - var nColor; // normal - var nLineWidth; - var eColor; // emphasis - var eLineWidth; - var serie; - var queryTarget; - var data; var seriesPL; var singlePoint; - var symbolRotate; - + var shape; for (var seriesIndex in pointList) { serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - // 多级控制 - queryTarget = [serie]; - nColor = self.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || _sIndex2ColorMap[seriesIndex]; - nLineWidth = self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - ); - - eColor = self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ); - eLineWidth = self.deepQuery( - queryTarget, 'itemStyle.emphasis.lineStyle.width' - ); - - symbolRotate = self.deepQuery( - queryTarget, 'symbolRotate' - ); - + seriesPL = pointList[seriesIndex]; if (serie.large && serie.data.length > serie.largeThreshold) { self.shapeList.push(_getLargeSymbol( - seriesPL, nColor, eColor + seriesPL, + self.query( + serie, 'itemStyle.normal.color' + ) || _sIndex2ColorMap[seriesIndex] )); continue; } @@ -24869,171 +26126,92 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' * pointlist=[ * 0 x, * 1 y, - * 2 图形大小 - * 3 图形类型 - * 4 数据index - * 5 名称 + * 2 数据index + * 3 名称 * ] */ + for (var i = 0, l = seriesPL.length; i < l; i++) { singlePoint = seriesPL[i]; - data = serie.data[singlePoint[4]]; - - if (dataRange) { - if (isNaN(data[2])) { - continue; - } - rangColor = dataRange.getColor(data[2]); - if (!rangColor) { - continue; - } - } - else { - rangColor = nColor; - } - - queryTarget = [data]; - self.shapeList.push(_getSymbol( + shape = _getSymbol( seriesIndex, // seriesIndex - singlePoint[4], // dataIndex - singlePoint[5], // name - + singlePoint[2], // dataIndex + singlePoint[3], // name singlePoint[0], // x - singlePoint[1], // y - - // 大小 - self.deepQuery(queryTarget, 'symbolSize') - || singlePoint[2], - - // 方向 - self.deepQuery(queryTarget, 'symbolRotate') - || symbolRotate, - - // 类型 - self.deepQuery(queryTarget, 'symbol') - || singlePoint[3], - - // 填充颜色 - self.deepQuery(queryTarget, 'itemStyle.normal.color') - || rangColor, - // 线宽 - self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - )|| nLineWidth, - - //------------高亮 - // 填充颜色 - self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || eColor || nColor, - // 线宽 - self.deepQuery( - queryTarget, 'itemStyle.emphasis.lineStyle.width' - )|| eLineWidth || nLineWidth - )); + singlePoint[1] // y + ); + shape && self.shapeList.push(shape); } } // console.log(self.shapeList) } /** - * 生成散点图上的图形 + * 生成折线图上的拐点图形 */ - function _getSymbol( - seriesIndex, dataIndex, name, - x, y, symbolSize, symbolRotate, symbol, - nColor, nLineWidth, eColor, eLineWidth - ) { - var itemShape = { - shape : 'icon', - zlevel : _zlevelBase, - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : symbol.match('empty') ? 'stroke' : 'fill', - color : nColor, - strokeColor : nColor, - lineWidth: nLineWidth - }, - highlightStyle : { - color : eColor, - strokeColor : eColor, - lineWidth : eLineWidth - }, - clickable : true - }; - - if (typeof symbolRotate != 'undefined') { - itemShape.rotation = [ - symbolRotate * Math.PI / 180, x, y - ]; - } + function _getSymbol(seriesIndex, dataIndex, name, x, y) { + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; - if (symbol.match('image')) { - itemShape.style.image = - symbol.replace(new RegExp('^image:\\/\\/'), ''); - itemShape.shape = 'image'; + var dataRange = component.dataRange; + var rangColor; + if (dataRange) { + rangColor = isNaN(data[2]) + ? _sIndex2ColorMap[seriesIndex] + : dataRange.getColor(data[2]); + if (!rangColor) { + return null; + } } - - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; + else { + rangColor = _sIndex2ColorMap[seriesIndex]; } - if (symbol == 'none') { - itemShape.invisible = true; - itemShape.hoverable = false; - } - - /* - if (self.deepQuery([data, serie, option], 'calculable')) { - self.setCalculable(itemShape); - itemShape.draggable = true; - } - */ - - itemShape = self.addLabel( - itemShape, - series[seriesIndex], - series[seriesIndex].data[dataIndex], - name, + var itemShape = self.getSymbolShape( + serie, seriesIndex, data, dataIndex, name, + x, y, + _sIndex2ShapeMap[seriesIndex], + rangColor, + 'rgba(0,0,0,0)', 'vertical' ); - - ecData.pack( - itemShape, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - name - ); - - // for animation - itemShape._x = x; - itemShape._y = y; - + itemShape.zlevel = _zlevelBase; + itemShape._mark = false; // 非mark + itemShape._main = true; return itemShape; } - function _getLargeSymbol(symbolList, nColor, eColor) { + function _getLargeSymbol(symbolList, nColor) { return { shape : 'symbol', zlevel : _zlevelBase, + _main : true, hoverable: false, style : { pointList : symbolList, color : nColor, strokeColor : nColor - }, - highlightStyle : { - color : eColor, - strokeColor : eColor } }; } + + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' + && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' + && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 @@ -25075,38 +26253,49 @@ define('echarts/chart/scatter',['require','../component/base','./calculableBase' * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var serie; for (var i = 0, l = self.shapeList.length; i < l; i++) { - x = self.shapeList[i]._x || 0; - y = self.shapeList[i]._y || 0; - zr.modShape( - self.shapeList[i].id, - { - scale : [0, 0, x, y] - }, - true - ); - zr.animate(self.shapeList[i].id, '') - .when( - (self.deepQuery([serie],'animationDuration') - || duration), - {scale : [1, 1, x, y]} - ) - .start( - self.deepQuery([serie], 'animationEasing') || easing + if (self.shapeList[i]._main) { + if (self.shapeList[i].shape == 'symbol') { + continue; + } + serie = series[self.shapeList[i]._seriesIndex]; + x = self.shapeList[i]._x || 0; + y = self.shapeList[i]._y || 0; + zr.modShape( + self.shapeList[i].id, + { + scale : [0, 0, x, y] + }, + true ); + zr.animate(self.shapeList[i].id, '') + .when( + (self.query(serie,'animationDuration') + || duration), + {scale : [1, 1, x, y]} + ) + .start( + self.query(serie, 'animationEasing') || easing + ); + } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.ondataRange = ondataRange; - self.animation = animation; init(option, component); } @@ -25334,7 +26523,7 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c var ecConfig = require('../config'); var ecData = require('../util/ecData'); - + var self = this; self.type = ecConfig.CHART_TYPE_K; @@ -25390,6 +26579,14 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c return; } _buildHorizontal(maxDataLength, locationMap); + + for (var i = 0, l = seriesArray.length; i < l; i++) { + self.buildMark( + series[seriesArray[i]], + seriesArray[i], + component + ); + } } /** @@ -25526,36 +26723,36 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c && typeof seriesPL != 'undefined' ) { // 多级控制 - queryTarget = [serie]; - nLineWidth = self.deepQuery( + queryTarget = serie; + nLineWidth = self.query( queryTarget, 'itemStyle.normal.lineStyle.width' ); - nLineColor = self.deepQuery( + nLineColor = self.query( queryTarget, 'itemStyle.normal.lineStyle.color' ); - nLineColor0 = self.deepQuery( + nLineColor0 = self.query( queryTarget, 'itemStyle.normal.lineStyle.color0' ); - nColor = self.deepQuery( + nColor = self.query( queryTarget, 'itemStyle.normal.color' ); - nColor0 = self.deepQuery( + nColor0 = self.query( queryTarget, 'itemStyle.normal.color0' ); - eLineWidth = self.deepQuery( + eLineWidth = self.query( queryTarget, 'itemStyle.emphasis.lineStyle.width' ); - eLineColor = self.deepQuery( + eLineColor = self.query( queryTarget, 'itemStyle.emphasis.lineStyle.color' ); - eLineColor0 = self.deepQuery( + eLineColor0 = self.query( queryTarget, 'itemStyle.emphasis.lineStyle.color0' ); - eColor = self.deepQuery( + eColor = self.query( queryTarget, 'itemStyle.emphasis.color' ); - eColor0 = self.deepQuery( + eColor0 = self.query( queryTarget, 'itemStyle.emphasis.color0' ); @@ -25574,7 +26771,7 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c for (var i = 0, l = seriesPL.length; i < l; i++) { singlePoint = seriesPL[i]; data = serie.data[singlePoint[6]]; - queryTarget = [data]; + queryTarget = data; candleType = singlePoint[3] < singlePoint[2]; self.shapeList.push(_getCandle( seriesIndex, // seriesIndex @@ -25590,25 +26787,25 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c // 填充颜色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.normal.color' ) || nColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.normal.color0' ) || nColor0), // 线宽 - self.deepQuery( + self.query( queryTarget, 'itemStyle.normal.lineStyle.width' ) || nLineWidth, // 线色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.normal.lineStyle.color' ) || nLineColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.normal.lineStyle.color0' ) || nLineColor0), @@ -25617,25 +26814,25 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c // 填充颜色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.emphasis.color' ) || eColor || nColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.emphasis.color0' ) || eColor0 || nColor0), // 线宽 - self.deepQuery( + self.query( queryTarget, 'itemStyle.emphasis.lineStyle.width' ) || eLineWidth || nLineWidth, // 线色 candleType - ? (self.deepQuery( // 阳 + ? (self.query( // 阳 queryTarget, 'itemStyle.emphasis.lineStyle.color' ) || eLineColor || nLineColor) - : (self.deepQuery( // 阴 + : (self.query( // 阴 queryTarget, 'itemStyle.emphasis.lineStyle.color0' ) || eLineColor0 || nLineColor0) @@ -25685,6 +26882,24 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c return itemShape; } + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' + && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' + && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } + /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * @param {Object} newSeries @@ -25760,8 +26975,8 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var serie; @@ -25778,21 +26993,26 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c ); zr.animate(self.shapeList[i].id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration), {scale : [1, 1, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.addDataAnimation = addDataAnimation; - self.animation = animation; init(option, component); } @@ -25855,20 +27075,34 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c /** * 绘制图形 */ - function _buildShape() { + function _buildShape() { + var legend = component.legend; self.selectedMap = {}; _dropBoxList = []; _radarDataCounter = 0; + var serieName; for (var i = 0, l = series.length; i < l ; i ++) { if (series[i].type == ecConfig.CHART_TYPE_RADAR) { serie = self.reformOption(series[i]); - _queryTarget = [serie, option]; - - // 添加可拖拽提示框,多系列共用一个极坐标,第一个优先 - if (self.deepQuery(_queryTarget, 'calculable')) { - _addDropBox(i); + serieName = serie.name || ''; + // 系列图例开关 + self.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + + if (self.selectedMap[serieName]) { + _queryTarget = [serie, option]; + + // 添加可拖拽提示框,多系列共用一个极坐标,第一个优先 + if (self.deepQuery(_queryTarget, 'calculable')) { + _addDropBox(i); + } + _buildSingleRadar(i); + self.buildMark( + series[i], + i, + component + ); } - _buildSingleRadar(i); } } @@ -25922,7 +27156,7 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c pointList = _getPointList(serie.polarIndex, data[i]); // 添加拐点形状 - _addSymbol(pointList, defaultColor, data[i], index); + _addSymbol(pointList, defaultColor, i, index); // 添加数据形状 _addDataShape( pointList, defaultColor, data[i], @@ -25953,41 +27187,6 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c return pointList; } - /** - * 生成折线图上的拐点图形 - */ - function _getSymbol( - x, y, symbol, symbolSize, normalColor, emphasisColor, lineWidth - ) { - var itemShape = { - shape : 'icon', - zlevel : _zlevelBase + 1, - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') ? '#fff' : normalColor, - strokeColor : normalColor, - lineWidth: lineWidth * 2 - }, - hoverable: false - }; - - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; - } - - itemShape._x = x; - itemShape._y = y; - - return itemShape; - } - /** * 添加拐点 * @param {Array>} pointList 点集 @@ -25995,36 +27194,21 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c * @param {object} data 数据 * @param {number} serieIndex */ - function _addSymbol(pointList, defaultColor, data) { - // 多级控制 - var queryTarget = [data, serie]; - var symbol = self.deepQuery(queryTarget,'symbol') - || _symbol[_radarDataCounter % _symbol.length] - || 'cricle'; - - if (symbol != 'none') { - var symbolSize = self.deepQuery(queryTarget,'symbolSize'); - var nColor = self.deepQuery( - queryTarget, 'itemStyle.normal.color' - ); - var eColor = self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ); - var lineWidth = self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' + function _addSymbol(pointList, defaultColor, dataIndex, seriesIndex) { + var itemShape; + for (var i = 0, l = pointList.length; i < l; i++) { + itemShape = self.getSymbolShape( + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, '', + pointList[i][0], // x + pointList[i][1], // y + _symbol[_radarDataCounter % _symbol.length], + defaultColor, + '#fff', + 'vertical' ); - - for (var i = 0, l = pointList.length; i < l; i++) { - self.shapeList.push(_getSymbol( - pointList[i][0], // x - pointList[i][1], // y - symbol, - symbolSize, - nColor || defaultColor, - eColor || nColor || defaultColor, - lineWidth - )); - } + itemShape.zlevel = _zlevelBase + 1; + self.shapeList.push(itemShape); } } @@ -26132,7 +27316,6 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c } } - /** * 数据项被拖拽出去,重载基类方法 */ @@ -26247,8 +27430,8 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c } function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var dataIndex; var seriesIndex; var data; @@ -26284,39 +27467,25 @@ define('echarts/chart/k',['require','../component/base','./calculableBase','../c zr.animate(item.id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 100, {scale : [1, 1, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } - else { - x = self.shapeList[i]._x || 0; - y = self.shapeList[i]._y || 0; - zr.modShape( - self.shapeList[i].id, - { - scale : [0, 0, x, y] - }, - true - ); - zr.animate(self.shapeList[i].id, '') - .when( - duration, - {scale : [1, 1, x, y]} - ) - .start('QuinticOut'); - } } - + + self.animationMark(duration, easing); } + // 重载基类方法 + self.animation = animation; + self.init = init; self.refresh = refresh; - self.animation = animation; self.ondrop = ondrop; self.ondragend = ondragend; @@ -28934,7 +30103,6 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base var matrix = []; var serieNumber = 0; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type === self.type) { // Use the config of first chord serie if (!chordSerieSample) { @@ -28949,6 +30117,11 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base continue; } chordSeries.push(series[i]); + self.buildMark( + series[i], + i, + component + ); matrix.push(series[i].matrix); serieNumber++; } @@ -29164,11 +30337,11 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base var timeout; - var showLabel = self.deepQuery( - [chordSerieSample], 'itemStyle.normal.label.show' + var showLabel = self.query( + chordSerieSample, 'itemStyle.normal.label.show' ); - var labelColor = self.deepQuery( - [chordSerieSample], 'itemStyle.normal.label.color' + var labelColor = self.query( + chordSerieSample, 'itemStyle.normal.label.color' ); function createMouseOver(idx) { @@ -29556,8 +30729,8 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base // key is serie name for (var i = 0; i < chordSeries.length; i++) { if (chordSeries[i].name === key) { - colorMap[key] = self.deepQuery( - [chordSeries[i]], + colorMap[key] = self.query( + chordSeries[i], 'itemStyle.normal.color' ); break; @@ -29568,8 +30741,8 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base // key is group name for (var i = 0; i < len; i++) { if (groups[i].name === key) { - colorMap[key] = self.deepQuery( - [groups[i]], + colorMap[key] = self.query( + groups[i], 'itemStyle.normal.color' ); break; @@ -29630,7 +30803,7 @@ define('echarts/chart/chord',['require','../util/shape/chord','../component/base define('echarts/chart/force',['require','../component/base','./calculableBase','../config','../util/ecData','zrender/config','zrender/tool/event','zrender/tool/util','zrender/tool/vector','../util/ndarray','../chart'],function(require) { - var requrestAnimationFrame = window.requrestAnimationFrame + var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame @@ -29661,6 +30834,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' var NDArray = require('../util/ndarray'); + var legend; var self = this; self.type = ecConfig.CHART_TYPE_FORCE; @@ -29720,32 +30894,47 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' var mouseX, mouseY; function _buildShape() { - var legend = component.legend; + legend = component.legend; temperature = 1.0; viewportWidth = zr.getWidth(); viewportHeight = zr.getHeight(); centroid = [viewportWidth/2, viewportHeight/2]; - + + var serieName; for (var i = 0, l = series.length; i < l; i++) { var serie = series[i]; if (serie.type === ecConfig.CHART_TYPE_FORCE) { series[i] = self.reformOption(series[i]); + + serieName = series[i].name || ''; + // 系列图例开关 + self.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + if (!self.selectedMap[serieName]) { + continue; + } + self.buildMark( + series[i], + i, + component + ); + forceSerie = serie; - var minRadius = self.deepQuery([serie], 'minRadius'); - var maxRadius = self.deepQuery([serie], 'maxRadius'); + var minRadius = self.query(serie, 'minRadius'); + var maxRadius = self.query(serie, 'maxRadius'); // ----------获取外部参数 - attractiveness = self.deepQuery( - [serie], 'attractiveness' + attractiveness = self.query( + serie, 'attractiveness' ); - density = self.deepQuery([serie], 'density'); - initSize = self.deepQuery([serie], 'initSize'); - centripetal = self.deepQuery([serie], 'centripetal'); - coolDown = self.deepQuery([serie], 'coolDown'); + density = self.query(serie, 'density'); + initSize = self.query(serie, 'initSize'); + centripetal = self.query(serie, 'centripetal'); + coolDown = self.query(serie, 'coolDown'); // ---------- - categories = self.deepQuery([serie], 'categories'); + categories = self.query(serie, 'categories'); // 同步selected状态 for (var j = 0, len = categories.length; j < len; j++) { @@ -29759,21 +30948,21 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' } } - linkStyle = self.deepQuery( - [serie], 'itemStyle.normal.linkStyle' + linkStyle = self.query( + serie, 'itemStyle.normal.linkStyle' ); - linkEmphasisStyle = self.deepQuery( - [serie], 'itemStyle.emphasis.linkStyle' + linkEmphasisStyle = self.query( + serie, 'itemStyle.emphasis.linkStyle' ); - nodeStyle = self.deepQuery( - [serie], 'itemStyle.normal.nodeStyle' + nodeStyle = self.query( + serie, 'itemStyle.normal.nodeStyle' ); - nodeEmphasisStyle = self.deepQuery( - [serie], 'itemStyle.emphasis.nodeStyle' + nodeEmphasisStyle = self.query( + serie, 'itemStyle.emphasis.nodeStyle' ); - rawNodes = self.deepQuery([serie], 'nodes'); - rawLinks = zrUtil.clone(self.deepQuery([serie], 'links')); + rawNodes = self.query(serie, 'nodes'); + rawLinks = zrUtil.clone(self.query(serie, 'links')); _preProcessData(rawNodes, rawLinks); // Reset data nodePositions = []; @@ -29891,32 +31080,29 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' // Label var labelStyle; - if (self.deepQuery([forceSerie], 'itemStyle.normal.label.show') + if (self.query(forceSerie, 'itemStyle.normal.label.show') ) { shape.style.text = node.name; shape.style.textPosition = 'inside'; - labelStyle = self.deepQuery( - [forceSerie], 'itemStyle.normal.label.textStyle' + labelStyle = self.query( + forceSerie, 'itemStyle.normal.label.textStyle' ) || {}; shape.style.textColor = labelStyle.color || '#fff'; shape.style.textAlign = labelStyle.align || 'center'; - shape.style.textBaseLine = labelStyle.baseline || 'middle'; + shape.style.textBaseline = labelStyle.baseline || 'middle'; shape.style.textFont = self.getFont(labelStyle); } - if (self.deepQuery( - [forceSerie], 'itemStyle.emphasis.label.show' - ) - ) { + if (self.query(forceSerie, 'itemStyle.emphasis.label.show')) { shape.highlightStyle.text = node.name; shape.highlightStyle.textPosition = 'inside'; - labelStyle = self.deepQuery( - [forceSerie], 'itemStyle.emphasis.label.textStyle' + labelStyle = self.query( + forceSerie, 'itemStyle.emphasis.label.textStyle' ) || {}; shape.highlightStyle.textColor = labelStyle.color || '#fff'; shape.highlightStyle.textAlign = labelStyle.align || 'center'; - shape.highlightStyle.textBaseLine = labelStyle.baseline + shape.highlightStyle.textBaseline = labelStyle.baseline || 'middle'; shape.highlightStyle.textFont = self.getFont(labelStyle); } @@ -29928,6 +31114,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' if (typeof(node.category) !== 'undefined') { var category = categories[node.category]; if (category) { + shape.style.color = legend.getColor(category.name); var style = category.itemStyle; if (style) { if (style.normal) { @@ -29984,7 +31171,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' // data node, // data index - rawNodes.indexOf(node), + zrUtil.indexOf(rawNodes, node), // name node.name || '', // value @@ -30237,7 +31424,6 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' } var _updating; - function init(newOption, newComponent) { option = newOption; component = newComponent; @@ -30251,10 +31437,10 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' function cb() { if (_updating) { _step(); - requrestAnimationFrame(cb); + requestAnimationFrame(cb); } } - requrestAnimationFrame(cb); + requestAnimationFrame(cb); } function refresh(newOption) { @@ -30278,8 +31464,7 @@ define('echarts/chart/force',['require','../component/base','./calculableBase',' self.isDragstart = true; }; - function onclick() { - } + function onclick() { } /** * 拖拽开始 @@ -30508,7 +31693,7 @@ define( * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -define('echarts/chart/line',['require','../component/base','./calculableBase','../config','../util/ecData','zrender/tool/color','zrender/shape','zrender/shape','../util/shape/halfSmoothPolygon','../chart'],function(require) { +define('echarts/chart/line',['require','../component/base','./calculableBase','../config','zrender/tool/color','zrender/shape','zrender/shape','../util/shape/halfSmoothPolygon','../chart'],function(require) { /** * 构造函数 * @param {Object} messageCenter echart消息中心 @@ -30525,7 +31710,6 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. CalculableBase.call(this, zr, option); var ecConfig = require('../config'); - var ecData = require('../util/ecData'); var zrColor = require('zrender/tool/color'); @@ -30619,6 +31803,13 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. _buildVertical(maxDataLength, locationMap); break; } + for (var i = 0, l = seriesArray.length; i < l; i++) { + self.buildMark( + series[seriesArray[i]], + seriesArray[i], + component + ); + } } /** @@ -30643,7 +31834,7 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. _sIndex2ShapeMap[seriesArray[i]] = _sIndex2ShapeMap[seriesArray[i]] - || self.deepQuery([serie],'symbol') + || self.query(serie,'symbol') || _symbol[i % _symbol.length]; if (legend){ @@ -30959,7 +32150,6 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. var lineType; var lineColor; var normalColor; - var emphasisColor; // 填充相关 var isFill; @@ -30980,28 +32170,25 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. if (serie.type == self.type && typeof seriesPL != 'undefined') { defaultColor = _sIndex2ColorMap[seriesIndex]; // 多级控制 - lineWidth = self.deepQuery( - [serie], 'itemStyle.normal.lineStyle.width' - ); - lineType = self.deepQuery( - [serie], 'itemStyle.normal.lineStyle.type' + lineWidth = self.query( + serie, 'itemStyle.normal.lineStyle.width' ); - lineColor = self.deepQuery( - [serie], 'itemStyle.normal.lineStyle.color' + lineType = self.query( + serie, 'itemStyle.normal.lineStyle.type' ); - normalColor = self.deepQuery( - [serie], 'itemStyle.normal.color' + lineColor = self.query( + serie, 'itemStyle.normal.lineStyle.color' ); - emphasisColor = self.deepQuery( - [serie], 'itemStyle.emphasis.color' + normalColor = self.query( + serie, 'itemStyle.normal.color' ); - isFill = typeof self.deepQuery( - [serie], 'itemStyle.normal.areaStyle' + isFill = typeof self.query( + serie, 'itemStyle.normal.areaStyle' ) != 'undefined'; - fillNormalColor = self.deepQuery( - [serie], 'itemStyle.normal.areaStyle.color' + fillNormalColor = self.query( + serie, 'itemStyle.normal.areaStyle.color' ); for (var i = 0, l = seriesPL.length; i < l; i++) { @@ -31027,19 +32214,6 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. singlePL[j][3], // name singlePL[j][0], // x singlePL[j][1], // y - self.deepQuery( - [data], 'itemStyle.normal.color' - ) || normalColor - || defaultColor, - self.deepQuery( - [data], 'itemStyle.emphasis.color' - ) || emphasisColor - || normalColor - || defaultColor, - lineWidth, - self.deepQuery( - [data, serie], 'symbolRotate' - ), orient )); } @@ -31057,20 +32231,20 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. lineWidth : lineWidth, lineType : lineType, smooth : _getSmooth(serie.smooth), - shadowColor : self.deepQuery( - [serie], + shadowColor : self.query( + serie, 'itemStyle.normal.lineStyle.shadowColor' ), - shadowBlur: self.deepQuery( - [serie], + shadowBlur: self.query( + serie, 'itemStyle.normal.lineStyle.shadowBlur' ), - shadowOffsetX: self.deepQuery( - [serie], + shadowOffsetX: self.query( + serie, 'itemStyle.normal.lineStyle.shadowOffsetX' ), - shadowOffsetY: self.deepQuery( - [serie], + shadowOffsetY: self.query( + serie, 'itemStyle.normal.lineStyle.shadowOffsetY' ) }, @@ -31141,18 +32315,14 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. var itemShape = _getSymbol( seriesIndex, dataIndex, name, - x, y, - color, - _sIndex2ColorMap[seriesIndex], - 2, - 0, - orient + x, y, orient ); - + itemShape.style.color = color; + itemShape.style.strokeColor = color; + itemShape.rotation = [0,0]; itemShape.hoverable = false; itemShape.draggable = false; itemShape.style.text = undefined; - //itemShape.highlightStyle.lineWidth = 20; return itemShape; } @@ -31160,99 +32330,46 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. /** * 生成折线图上的拐点图形 */ - function _getSymbol( - seriesIndex, dataIndex, name, x, y, - normalColor, emphasisColor, lineWidth, rotate, orient - ) { + function _getSymbol(seriesIndex, dataIndex, name, x, y, orient) { var serie = series[seriesIndex]; var data = serie.data[dataIndex]; - var symbol = self.deepQuery([data], 'symbol') - || _sIndex2ShapeMap[seriesIndex] - || 'cricle'; - var symbolSize = self.deepQuery([data, serie],'symbolSize'); - - var itemShape = { - shape : 'icon', - zlevel : _zlevelBase + 1, - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') ? '#fff' : normalColor, - strokeColor : normalColor, - lineWidth: lineWidth * 2 - }, - highlightStyle : { - color : symbol.match('empty') ? '#fff' : emphasisColor, - strokeColor : emphasisColor, - lineWidth: lineWidth * 2 + 2 - }, - clickable : true - }; - - if (symbol.match('image')) { - itemShape.style.image = - symbol.replace(new RegExp('^image:\\/\\/'), ''); - itemShape.shape = 'image'; - } - - if (typeof rotate != 'undefined') { - itemShape.rotation = [ - rotate * Math.PI / 180, x, y - ]; - } - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; - } + var itemShape = self.getSymbolShape( + serie, seriesIndex, data, dataIndex, name, + x, y, + _sIndex2ShapeMap[seriesIndex], + _sIndex2ColorMap[seriesIndex], + '#fff', + orient == 'vertical' ? 'horizontal' : 'vertical' // 翻转 + ); + itemShape.zlevel = _zlevelBase + 1; - if (symbol == 'none') { - itemShape.invisible = true; - itemShape.hoverable = false; - } - if (self.deepQuery([data, serie, option], 'calculable')) { self.setCalculable(itemShape); itemShape.draggable = true; } - - itemShape = self.addLabel( - itemShape, - series[seriesIndex], - series[seriesIndex].data[dataIndex], - name, - orient == 'vertical' ? 'horizontal' : 'vertical' - ); - if (symbol.match('empty')) { - if (typeof itemShape.style.textColor == 'undefined') { - itemShape.style.textColor = itemShape.style.strokeColor; - } - if (typeof itemShape.highlightStyle.textColor == 'undefined') { - itemShape.highlightStyle.textColor = - itemShape.highlightStyle.strokeColor; - } - } - ecData.pack( - itemShape, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - name - ); - - itemShape._x = x; - itemShape._y = y; - itemShape._dataIndex = dataIndex; - itemShape._seriesIndex = seriesIndex; - return itemShape; } + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' + && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' + && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } + /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * @param {Object} newSeries @@ -31280,62 +32397,22 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. var dataIndex = param.dataIndex; var seriesPL; var singlePL; - var serie; - var queryTarget; - - var lineWidth; - var normalColor; - var emphasisColor; - var defaultColor; - var len = seriesIndex.length; while (len--) { seriesPL = finalPLMap[seriesIndex[len]]; if (seriesPL) { - serie = series[seriesIndex[len]]; - queryTarget = [serie]; - defaultColor = _sIndex2ColorMap[seriesIndex[len]]; - // 多级控制 - lineWidth = self.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - ); - normalColor = self.deepQuery( - queryTarget, 'itemStyle.normal.color' - ); - emphasisColor = self.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ); - var shape; - var data; for (var i = 0, l = seriesPL.length; i < l; i++) { singlePL = seriesPL[i]; for (var j = 0, k = singlePL.length; j < k; j++) { if (dataIndex == singlePL[j][2]) { - data = serie.data[singlePL[j][2]]; - shape = _getSymbol( - seriesIndex[len], - singlePL[j][2], // dataIndex - singlePL[j][3], // name - singlePL[j][0], // x - singlePL[j][1], // y - self.deepQuery( - [data], 'itemStyle.normal.color' - ) || normalColor - || defaultColor, - self.deepQuery( - [data], 'itemStyle.emphasis.color' - ) || emphasisColor - || normalColor - || defaultColor, - lineWidth, - self.deepQuery( - [data, serie], 'symbolRotate' - ), + tipShape.push(_getSymbol( + seriesIndex[len], // seriesIndex + singlePL[j][2], // dataIndex + singlePL[j][3], // name + singlePL[j][0], // x + singlePL[j][1], // y 'horizontal' - ); - //console.log(shape) - //zr.addHoverShape(shape); - tipShape.push(shape); + )); } } } @@ -31449,8 +32526,8 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var serie; @@ -31482,40 +32559,28 @@ define('echarts/chart/line',['require','../component/base','./calculableBase','. } zr.animate(self.shapeList[i].id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 100, {scale : [1, 1, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } - else { - x = self.shapeList[i]._x || 0; - y = self.shapeList[i]._y || 0; - zr.modShape( - self.shapeList[i].id, - { - scale : [0, 0, x, y] - }, - true - ); - zr.animate(self.shapeList[i].id, '') - .when( - duration, - {scale : [1, 1, x, y]} - ) - .start('QuinticOut'); - } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.ontooltipHover = ontooltipHover; self.addDataAnimation = addDataAnimation; - self.animation = animation; init(option, component); } @@ -31677,11 +32742,11 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. switch (position) { case 'bottom' : case 'top' : - _buildHorizontal(maxDataLength, locationMap); + _buildHorizontal(maxDataLength, locationMap, seriesArray); break; case 'left' : case 'right' : - _buildVertical(maxDataLength, locationMap); + _buildVertical(maxDataLength, locationMap, seriesArray); break; } } @@ -31769,7 +32834,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. /** * 构建类目轴为水平方向的柱形图系列 */ - function _buildHorizontal(maxDataLength, locationMap) { + function _buildHorizontal(maxDataLength, locationMap, seriesArray) { // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; @@ -31786,6 +32851,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. var barMinHeightMap = size.barMinHeightMap; var barHeight; + var xMarkMap = {}; // 为标注记录一个横向偏移 var x; var y; var lastYP; // 正向堆叠处理 @@ -31864,6 +32930,10 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. barHeight, 'vertical' ); + + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {}; + xMarkMap[seriesIndex][i] = + x + (barWidthMap[seriesIndex] || barWidth) / 2; self.shapeList.push(barShape); } @@ -31912,12 +32982,13 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. x += ((barWidthMap[seriesIndex] || barWidth) + barGap); } } + _buildMark(seriesArray, xMarkMap, true); } /** * 构建类目轴为垂直方向的柱形图系列 */ - function _buildVertical(maxDataLength, locationMap) { + function _buildVertical(maxDataLength, locationMap, seriesArray) { // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; @@ -31934,6 +33005,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. var barMinHeightMap = size.barMinHeightMap; var barHeight; + var xMarkMap = {}; // 为标注记录一个横向偏移 var x; var y; var lastXP; // 正向堆叠处理 @@ -32012,6 +33084,10 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. barWidthMap[seriesIndex] || barWidth, 'horizontal' ); + + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || {}; + xMarkMap[seriesIndex][i] = + y - (barWidthMap[seriesIndex] || barWidth) / 2; self.shapeList.push(barShape); } @@ -32062,6 +33138,7 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. y -= ((barWidthMap[seriesIndex] || barWidth) + barGap); } } + _buildMark(seriesArray, xMarkMap, false); } /** * 我真是自找麻烦啊,为啥要允许系列级个性化最小宽度和高度啊!!! @@ -32296,6 +33373,52 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. return barShape; } + // 添加标注 + function _buildMark(seriesArray, xMarkMap ,isHorizontal) { + for (var i = 0, l = seriesArray.length; i < l; i++) { + self.buildMark( + series[seriesArray[i]], + seriesArray[i], + component, + { + isHorizontal : isHorizontal, + xMarkMap : xMarkMap + } + ); + } + } + + // 位置转换 + function getMarkCoord(serie, seriesIndex, mpData, markCoordParams) { + var xAxis = component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = component.yAxis.getAxis(serie.yAxisIndex); + var dataIndex; + var pos; + if (markCoordParams.isHorizontal) { + // 横向 + dataIndex = typeof mpData.xAxis == 'string' + && xAxis.getIndexByName + ? xAxis.getIndexByName(mpData.xAxis) + : (mpData.xAxis || 0); + pos = [ + markCoordParams.xMarkMap[seriesIndex][dataIndex], + yAxis.getCoord(mpData.yAxis || 0) + ]; + } + else { + // 纵向 + dataIndex = typeof mpData.xAxis == 'string' + && xAxis.getIndexByName + ? xAxis.getIndexByName(mpData.xAxis) + : (mpData.xAxis || 0); + pos = [ + xAxis.getCoord(mpData.xAxis || 0), + markCoordParams.xMarkMap[seriesIndex][dataIndex] + ]; + } + return pos; + } + /** * 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * @param {Object} newSeries @@ -32497,12 +33620,17 @@ define('echarts/chart/bar',['require','../component/base','./calculableBase','.. } } } + + self.animationMark(duration, easing); } + // 重载基类方法 + self.getMarkCoord = getMarkCoord; + self.animation = animation; + self.init = init; self.refresh = refresh; self.addDataAnimation = addDataAnimation; - self.animation = animation; init(option, component); } @@ -32553,6 +33681,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. var _selected = {}; function _buildShape() { + var legend = component.legend; self.selectedMap = {}; _selected = {}; var center; @@ -32560,9 +33689,18 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. var pieCase; // 饼图箱子 _selectedMode = false; + var serieName; for (var i = 0, l = series.length; i < l; i++) { if (series[i].type == ecConfig.CHART_TYPE_PIE) { series[i] = self.reformOption(series[i]); + serieName = series[i].name || ''; + // 系列图例开关 + self.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + if (!self.selectedMap[serieName]) { + continue; + } + center = self.parseCenter(series[i].center); radius = self.parseRadius(series[i].radius); _selectedMode = _selectedMode || series[i].selectedMode; @@ -32588,6 +33726,11 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. self.shapeList.push(pieCase); } _buildSinglePie(i); + self.buildMark( + series[i], + i, + component + ); } } @@ -32743,16 +33886,17 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. ) { var serie = series[seriesIndex]; var data = serie.data[dataIndex]; + var queryTarget = [data, serie]; var center = self.parseCenter(serie.center); // 多级控制 var normalColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.color' ) || defaultColor; var emphasisColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.color' ); @@ -32792,7 +33936,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. sector.style._hasSelected = true; sector.style._x = sector.style.x; sector.style._y = sector.style.y; - var offset = self.deepQuery([serie], 'selectedOffset'); + var offset = self.query(serie, 'selectedOffset'); sector.style.x += zrMath.cos(midAngle, true) * offset; sector.style.y -= zrMath.sin(midAngle, true) * offset; @@ -32814,7 +33958,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. if (_needLabel(serie, data, false) && self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.position' ) == 'inner' ) { @@ -32823,15 +33967,15 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. ); sector.style.textPosition = 'specific'; sector.style.textColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.textStyle.color' ) || '#fff'; sector.style.textAlign = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.textStyle.align' ) || 'center'; - sector.style.textBaseLine = self.deepQuery( - [data, serie], + sector.style.textBaseline = self.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle.baseline' ) || 'middle'; sector.style.textX = Math.round( @@ -32845,14 +33989,14 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. * zrMath.sin((startAngle + endAngle) / 2, true) ); sector.style.textFont = self.getFont(self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.normal.label.textStyle' )); } if (_needLabel(serie, data, true) && self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.position' ) == 'inner' ) { @@ -32861,15 +34005,15 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. ); sector.highlightStyle.textPosition = 'specific'; sector.highlightStyle.textColor = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.textStyle.color' ) || '#fff'; sector.highlightStyle.textAlign = self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.textStyle.align' ) || 'center'; - sector.highlightStyle.textBaseLine = self.deepQuery( - [data, serie], + sector.highlightStyle.textBaseline = self.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle.baseline' ) || 'middle'; sector.highlightStyle.textX = Math.round( @@ -32883,7 +34027,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. * zrMath.sin((startAngle + endAngle) / 2, true) ); sector.highlightStyle.textFont = self.getFont(self.deepQuery( - [data, serie], + queryTarget, 'itemStyle.emphasis.label.textStyle' )); } @@ -33129,6 +34273,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. +'.labelLine.show' ); } + /** * 参数修正&默认值赋值,重载基类方法 * @param {Object} opt 参数 @@ -33386,8 +34531,8 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. * 动画设定 */ function animation() { - var duration = self.deepQuery([option], 'animationDuration'); - var easing = self.deepQuery([option], 'animationEasing'); + var duration = self.query(option, 'animationDuration'); + var easing = self.query(option, 'animationEasing'); var x; var y; var r0; @@ -33421,7 +34566,7 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. dataIndex = ecData.get(self.shapeList[i], 'dataIndex'); zr.animate(self.shapeList[i].id, 'style') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 10, { @@ -33432,16 +34577,16 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. .start('QuinticOut'); zr.animate(self.shapeList[i].id, '') .when( - (self.deepQuery([serie],'animationDuration') + (self.query(serie,'animationDuration') || duration) + dataIndex * 100, {rotation : [0, x, y]} ) .start( - self.deepQuery([serie], 'animationEasing') || easing + self.query(serie, 'animationEasing') || easing ); } - else { + else if (!self.shapeList[i]._mark){ dataIndex = self.shapeList[i]._dataIndex; zr.modShape( self.shapeList[i].id, @@ -33458,6 +34603,8 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. .start('QuinticOut'); } } + + self.animationMark(duration, easing); } function onclick(param) { @@ -33484,8 +34631,8 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. _selected[seriesIndex][dataIndex] = true; target.style._x = target.style.x; target.style._y = target.style.y; - offset = self.deepQuery( - [series[seriesIndex]], + offset = self.query( + series[seriesIndex], 'selectedOffset' ); target.style.x += zrMath.cos(midAngle, true) @@ -33654,12 +34801,12 @@ define('echarts/chart/pie',['require','../component/base','./calculableBase','.. }; self.reformOption = reformOption; // 重载基类方法 + self.animation = animation; // 接口方法 self.init = init; self.refresh = refresh; self.addDataAnimation = addDataAnimation; - self.animation = animation; self.onclick = onclick; self.ondrop = ondrop; self.ondragend = ondragend; @@ -33699,11 +34846,7 @@ zrender.animation = { } var echarts = require('echarts'); echarts.config = require('echarts/config'); -echarts.util = { - mapData : { - params : require('echarts/util/mapData/params') - } -} +echarts.util = {}; // 加载需要的图表,由build.js临时生成 var chart = require('_chart'); diff --git a/build/echarts-plain.js b/build/echarts-plain.js index 992f72c3f6..12b4c90ff8 100644 --- a/build/echarts-plain.js +++ b/build/echarts-plain.js @@ -19,32 +19,8 @@ * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ /*! @@ -53,32 +29,8 @@ * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt */ -(function(e){var t,n,r;(function(e){function d(e,t){return h.call(e,t)}function v(e,t){var n,r,i,s,o,u,a,f,c,h,p=t&&t.split("/"),d=l.map,v=d&&d["*"]||{};if(e&&e.charAt(0)===".")if(t){p=p.slice(0,p.length-1),e=p.concat(e.split("/"));for(f=0;f0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(t){if(d(f,t)){var n=f[t];delete f[t],c[t]=!0,i.apply(e,n)}if(!d(a,t)&&!d(c,t))throw new Error("No "+t);return a[t]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var i,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},i=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{lineStyle:{width:2,type:"solid"}},emphasis:{}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1,position:"outer"},labelLine:{show:!1,length:40,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),r("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),r("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),r("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),r("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),r("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),r("zrender/tool/area",["require","../tool/util"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),r("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,p;if(typeof t.pointList!="undefined"){var d=t.pointList;if(d.length<2)return;var v=d.length;switch(a){case"start":l=d[0][0],c=d[1][0],h=d[0][1],p=d[1][1];break;case"end":l=d[v-2][0],c=d[v-1][0],h=d[v-2][1],p=d[v-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,p=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function g(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:p,getHighlightZoom:d,drift:v,isCover:m,updateTransform:g},t}),r("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),r("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),r("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),r("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),r("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),r("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function t(){this.type="text"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";if(r.maxWidth)switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y,r.maxWidth);break;case"stroke":e.strokeText(r.text,r.x,r.y,r.maxWidth);break;case"both":e.strokeText(r.text,r.x,r.y,r.maxWidth),e.fillText(r.text,r.x,r.y,r.maxWidth);break;default:e.fillText(r.text,r.x,r.y,r.maxWidth)}else switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y);break;case"stroke":e.strokeText(r.text,r.x,r.y);break;case"both":e.strokeText(r.text,r.x,r.y),e.fillText(r.text,r.x,r.y);break;default:e.fillText(r.text,r.x,r.y)}e.restore();return},getRect:function(t){var n=e("../tool/area"),r=n.getTextWidth(t.text,t.textFont),i=n.getTextWidth("国",t.textFont),s=t.x;t.textAlign=="end"||t.textAlign=="right"?s-=r:t.textAlign=="center"&&(s-=r/2);var o=t.y-i/2;return t.textBaseline=="top"?o+=i/2:t.textBaseline=="bottom"&&(s-=i/2),{x:s,y:o,width:r,height:i}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("text",new t),t}),r("zrender/shape/heart",["require","./base","../shape"],function(e){function t(){this.type="heart"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y),e.bezierCurveTo(t.x+t.a/2,t.y-t.b*2/3,t.x+t.a*2,t.y+t.b/3,t.x,t.y+t.b),e.bezierCurveTo(t.x-t.a*2,t.y+t.b/3,t.x-t.a/2,t.y-t.b*2/3,t.x,t.y);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b/4-t/2),width:e.a*2+t,height:e.b*5/4+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("heart",new t),t}),r("zrender/shape/droplet",["require","./base","../shape"],function(e){function t(){this.type="droplet"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y+t.a),e.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+t.a*3/2,t.y-t.a/3,t.x,t.y-t.b),e.bezierCurveTo(t.x-t.a*3/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.a+e.b+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("droplet",new t),t}),r("zrender/shape/path",["require","./base","../shape"],function(e){function t(){this.type="path"}t.prototype={_parsePathData:function(e){if(!e)return[];var t=e,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];t=t.replace(/ /g," "),t=t.replace(/ /g,","),t=t.replace(/,,/g,",");var r;for(r=0;r0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),r("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),r("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),r("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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}),r("zrender",["zrender/zrender"],function(e){return e}),r("echarts/util/shape/icon",["require","zrender/tool/matrix","zrender/shape","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,arrow:y,star:b,image:w}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=5;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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}),r("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}),r("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:case n.CHART_TYPE_CHORD: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 a(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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}return e("../chart").define("island",t),t}),r("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}),r("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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}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}),r("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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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}),r("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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),r("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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 H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(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||e0&&(n.delShape(B.tipShape),B=!1),e&&n.refresh()}function R(e,t,n){var r=x.offsetHeight,i=x.offsetWidth;e+i>H&&(e=H-i),t+r>P&&(t=P-r),t<20&&(t=0),x.style.cssText=T+N+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(H-e<100||P-t<100)&&setTimeout(U,20)}function U(){if(x){var e="",t=x.offsetHeight,n=x.offsetWidth;x.offsetLeft+n>H&&(e+="left:"+(H-n)+"px;"),x.offsetTop+t>P&&(e+="top:"+(P-t)+"px;"),e!==""&&(x.style.cssText+=e)}}function z(){var e,t;if(!M)X()||W();else{if(M._type=="island"&&r.tooltip.show){K();return}var n=u.get(M,"series"),i=u.get(M,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(k),clearTimeout(A),k=setTimeout(q,L)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?$(n.xAxisIndex,n.yAxisIndex,u.get(M,"dataIndex")):K())}}function W(){if(!w||!E){k=setTimeout(q,L);return}var e=r.series,t,n;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 $(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(k),clearTimeout(A),k=setTimeout(q,L);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var y=0,S=u.length;y0){var T;if(typeof d=="function"){var N=[];for(var y=0,S=a.length;y"+ut(a[y].name||"")+" : ",T=a[y].data[s],T=typeof T!="undefined"?typeof T.value!="undefined"?T.value:T:"-",d+=T;x.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(h,p,g)}}function J(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}for(var f=0,c=n.length;f0){var h,p,d=[],v=r.polar[e].indicator[t].text;for(var f=0,c=s.length;f"+ut(d[0][3])+" : "+d[0][2];for(var f=1,c=d.length;f"+ut(d[f][1])+"
",o+=ut(d[f][3])+" : "+d[f][2];x.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_),l.getY(_),a),!0}}function K(){var e=u.get(M,"series"),t=u.get(M,"data"),s=u.get(M,"name"),a=u.get(M,"value"),f=u.get(M,"special"),c=u.get(M,"special2"),h,p,d="",v,g="";M._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.deepQuery([e],"tooltip.trigger")=="item"&&(p=m.deepQuery([e],"tooltip.showContent")||p,h=m.deepQuery([e],"tooltip.formatter")||h,d+=I(m.deepQuery([e],"tooltip"))),p=m.deepQuery([t],"tooltip.showContent")||p,h=m.deepQuery([t],"tooltip.formatter")||h,d+=I(m.deepQuery([t],"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")D=(e.name||"")+":"+u.get(M,"dataIndex"),x.innerHTML=h([e.name||"",s,a,f,c],D,Z);else if(typeof h=="string")D=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ut(e.name||"")).replace("{b0}",ut(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(M,"special2")||""),x.innerHTML=h;else{D=NaN;if(e.type==o.CHART_TYPE_SCATTER)x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
":"")+(s===""?"":ut(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR){v=f,g+=ut(s===""?e.name||"":s),g+=g===""?"":"
";for(var y=0;y";x.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")x.innerHTML=ut(s)+" ("+a+")";else{var b=ut(s),w=ut(f);x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
":"")+b+" -> "+w+" ("+a+")"+"
"+w+" -> "+b+" ("+c+")"}else x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
":"")+ut(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}j.invisible||(j.invisible=!0,n.modShape(j.id,j),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_)+20,l.getY(_)-20,d)}function Q(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yH&&(n+="left:"+(H-i)+"px;"),x.offsetTop+r>P&&(n+="top:"+(P-r)+"px;"),n!==""&&(x.style.cssText+=n),(H-x.offsetLeft<100||P-x.offsetTop<100)&&setTimeout(U,20)}function et(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function tt(e,t){if(!B||B&&B.dataIndex!=e.dataIndex){B&&B.tipShape.length>0&&n.delShape(B.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x=document.createElement("div"),T="position:absolute;display:block;border-style:solid;white-space:nowrap;",N,C,k,L,A,O,M,_,D,P=n.getHeight(),H=n.getWidth(),B=!1,j={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},F={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(j),n.addShape(F),n.on(a.EVENT.MOUSEMOVE,G),n.on(a.EVENT.GLOBALOUT,Y),m.dispose=ot,m.init=rt,m.refresh=it,m.resize=st,m.setComponent=et,m.ontooltipHover=tt,m.ondragend=nt,rt(r,i)}return e("../component").define("tooltip",t),t}),r("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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}),r("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),r("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",t),t}),r("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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wa.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}),r("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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),r("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Y(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(D[i],D[i],n,-c),v.scaleAndAdd(D[s],D[s],n,c)}for(var i=0,h=O.length;i0&&b(l,e[l]);for(var u=0,f=c.shapeList.length;u0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}p=f.getCoord(E),E>=0?(v-=m-p,p=v):E<0&&(g+=p-y,p=g),b[n].push([l,p,S,u.getNameByIndex(S),l,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"horizontal")}function S(e,t){var n=t[0][0],r=h[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,l,p,v,m,g,y,b={},w,E;for(var S=0,T=e;S0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}l=f.getCoord(E),E>=0?(v+=l-m,l=v):E<0&&(g-=y-l,l=g),b[n].push([l,p,S,u.getNameByIndex(S),m,p])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"vertical")}function x(e,t,n){var r,s,o,u,a,f,d,m,g,y,b,w;for(var E=h.length-1;E>=0;E--){g=h[E],b=e[E];if(g.type==c.type&&typeof b!="undefined"){r=v[E],s=c.deepQuery([g],"itemStyle.normal.lineStyle.width"),o=c.deepQuery([g],"itemStyle.normal.lineStyle.type"),u=c.deepQuery([g],"itemStyle.normal.lineStyle.color"),a=c.deepQuery([g],"itemStyle.normal.color"),f=c.deepQuery([g],"itemStyle.emphasis.color"),d=typeof c.deepQuery([g],"itemStyle.normal.areaStyle")!="undefined",m=c.deepQuery([g],"itemStyle.normal.areaStyle.color");for(var S=0,x=b.length;S=0;n--){f=c.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(c.shapeList[n]._main){l=c.shapeList[n].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),p=c.shapeList[n]._orient=="horizontal";if(t[f][2]){if(c.shapeList[n].shape=="polygon"){var d=l.length;c.shapeList[n].style.pointList[d-3]=l[d-2],p?c.shapeList[n].style.pointList[d-3][0]=l[d-4][0]:c.shapeList[n].style.pointList[d-3][1]=l[d-4][1],c.shapeList[n].style.pointList[d-2]=l[d-1]}c.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{c.shapeList[n].style.pointList.shift();if(c.shapeList[n].shape=="polygon"){var v=c.shapeList[n].style.pointList.pop();p?v[0]=l[0][0]:v[1]=l[0][1],c.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(c.shapeList[n].id,{style:{pointList:c.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&c.shapeList[n]._dataIndex==h[f].data.length-1){r.delShape(c.shapeList[n].id);continue}if(!t[f][2]&&c.shapeList[n]._dataIndex===0){r.delShape(c.shapeList[n].id);continue}}r.animate(c.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=c.deepQuery([i],"animationDuration"),t=c.deepQuery([i],"animationEasing"),n,s,o,u=0;for(var a=0,f=c.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(E=N-x,B==1&&y[n]>E&&(E=y[n]),T-=E,x=T):O<0?(E=x-k,B==1&&y[n]>E&&(E=y[n]),x=C,C+=E):(E=N-x,T-=E,x=T),L=w(n,M,a.getNameByIndex(M),S,x,m[n]||g,E,"vertical"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H0?(E=S-N,B==1&&y[n]>E&&(E=y[n]),S=T,T+=E):O<0?(E=k-S,B==1&&y[n]>E&&(E=y[n]),C-=E,S=C):(E=S-N,S=T,T+=E),L=w(n,M,a.getNameByIndex(M),S,x-(m[n]||g),E,m[n]||g,"horizontal"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t){i=t,S(e)}function S(e){e&&(r=e,c=r.series),l.clear(),d()}function x(e){var t={};for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function T(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(t){if(d(f,t)){var n=f[t];delete f[t],c[t]=!0,i.apply(e,n)}if(!d(a,t)&&!d(c,t))throw new Error("No "+t);return a[t]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var i,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},i=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1},labelLine:{show:!1,length:30,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},hoverable:!0,itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},markPoint:{symbol:"pin",symbolSize:10,itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{symbol:["circle","arrow"],symbolSize:[2,4],itemStyle:{normal:{borderWidth:2,label:{show:!1,position:"inside",textStyle:{color:"#333"}},lineStyle:{type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,animationThreshold:2500,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),r("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),r("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),r("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),r("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),r("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),r("zrender/tool/area",["require","../tool/util","../shape"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),r("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,d;if(typeof t.pointList!="undefined"){var v=t.pointList;if(v.length<2)return;var m=v.length;switch(a){case"start":l=v[0][0],c=v[1][0],h=v[0][1],d=v[1][1];break;case"end":l=v[m-2][0],c=v[m-1][0],h=v[m-2][1],d=v[m-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,d=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function b(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:v,getHighlightZoom:m,drift:g,isCover:y,updateTransform:b},t}),r("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),r("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),r("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),r("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),r("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),r("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function n(){this.type="text"}var t=e("../tool/area");n.prototype={brush:function(e,n,r){var i=n.style||{};r&&(i=this.getHighlightStyle(i,n.highlightStyle||{}));if(typeof i.text=="undefined")return;e.save(),this.setContext(e,i),n.__needTransform&&e.transform.apply(e,this.updateTransform(n)),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var s=(i.text+"").split("\n"),o=t.getTextHeight("国",i.textFont),u=this.getRect(i),a=i.x,f;i.textBaseline=="top"?f=u.y:i.textBaseline=="bottom"?f=u.y+o:f=u.y+o/2;for(var l=0,c=s.length;l0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),r("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),r("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),r("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=this._clips,n=t.length,r=[],i=[];for(var s=0;s=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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){if(e.lenth<1)return;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}),r("zrender",["zrender/zrender"],function(e){return e}),r("echarts/util/shape/icon",["require","zrender/tool/matrix","zrender/shape","zrender/shape","zrender/shape","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,arrow:y,star:b,heart:w,droplet:E,pin:S,image:x}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){var r=e("zrender/shape").get("heart");r.buildPath(t,{x:n.x+n.width/2,y:n.y+n.height*.2,a:n.width/2,b:n.height*.8})}function E(t,n){var r=e("zrender/shape").get("droplet");r.buildPath(t,{x:n.x+n.width*.5,y:n.y+n.height*.5,a:n.width*.5,b:n.height*.8})}function S(e,t){var n=t.x,r=t.y-t.height/2*1.5,i=t.width/2,s=t.height/2,o=Math.min(i,s);e.arc(n+i,r+s,o,Math.PI/5*4,Math.PI/5),e.lineTo(n+i,r+s+o*1.5)}function x(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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-(e.iconType=="pin"?e.height/2*1.5:0)),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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=o.height<10?4:0;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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}),r("echarts/util/shape/markLine",["require","zrender/tool/matrix","zrender/shape","zrender/shape","zrender/shape/base","zrender/shape"],function(e){function n(){this.type="markLine"}var t=e("zrender/tool/matrix");return n.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildLinePath(e,r),e.stroke(),this.brushSymbol(t,e,r,0),this.brushSymbol(t,e,r,1),typeof r.text!="undefined"&&this.drawText(e,r,t.style),e.restore();return},buildLinePath:function(e,t){var n=t.xStart,r=t.xEnd,i=t.yStart,s=t.yEnd;if(!t.lineType||t.lineType=="solid")e.moveTo(n,i),e.lineTo(r,s);else if(t.lineType=="dashed"||t.lineType=="dotted"){var o=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,n,i,r,s,o)}},brushSymbol:function(n,r,i,s){r.save(),r.beginPath(),r.lineWidth=i.symbolBorder,r.strokeStyle=i.symbolBorderColor,i.iconType=i.symbol[s].replace("empty","").toLowerCase(),i.symbol[s].match("empty")&&(r.fillStyle="rgba(0, 0, 0, 0)");var o=s===0?i.xStart:i.xEnd,u=s===0?i.yStart:i.yEnd,a=typeof i.symbolRotate[s]!="undefined"?i.symbolRotate[s]-0:0,f;a!==0&&(f=t.create(),t.identity(f),(o||u)&&t.translate(f,f,[-o,-u]),t.rotate(f,f,a*Math.PI/180),(o||u)&&t.translate(f,f,[o,u]),r.transform.apply(r,f));if(i.iconType=="arrow"&&a===0)this.buildArrawPath(r,i,s);else{var l=i.symbolSize[s];i.x=o-l,i.y=u-l,i.width=l*2,i.height=l*2,e("zrender/shape").get("icon").buildPath(r,i)}r.closePath(),r.stroke(),r.fill(),r.restore()},buildArrawPath:function(e,t,n){var r=t.symbolSize[n],i=t.xStart,s=t.xEnd,o=t.yStart,u=t.yEnd,a=Math.atan(Math.abs((u-o)/(i-s)));n===0?s>i?u>o&&(a=Math.PI*2-a):u>o?a+=Math.PI:a=Math.PI-a:i>s?o>u&&(a=Math.PI*2-a):o>u?a+=Math.PI:a=Math.PI-a;var f=Math.PI/8,l=n===0?i:s,c=n===0?o:u,h=[[l+r*Math.cos(a-f),c-r*Math.sin(a-f)],[l+r*.6*Math.cos(a),c-r*.6*Math.sin(a)],[l+r*Math.cos(a+f),c-r*Math.sin(a+f)]];e.moveTo(l,c);for(var p=0,d=h.length;p1?o.symbol:[o.symbol[0],o.symbol[0]]:[o.symbol,o.symbol],o.symbolSize=o.symbolSize instanceof Array?o.symbolSize.length>1?o.symbolSize:[o.symbolSize[0],o.symbolSize[0]]:[o.symbolSize,o.symbolSize],o.symbolRotate=o.symbolRotate instanceof Array?o.symbolRotate.length>1?o.symbolRotate:[o.symbolRotate[0],o.symbolRotate[0]]:[o.symbolRotate,o.symbolRotate],o.name=e.name;var a=[],f=o.data,l,c=u.dataRange,h=u.legend,p,d,v,m,g,y=s.zr.getWidth(),b=s.zr.getHeight();for(var w=0,E=f.length;w0?-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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}return e("../chart").define("island",t),t}),r("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}),r("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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}function k(e){return typeof r.data[e].value!="undefined"?r.data[e].value:r.data[e]}function L(e){var t=r.data,n=t.length;for(var i=0;i0?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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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}),r("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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),r("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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);var l;for(var c=0,h=t.length;c=s&&l[0]<=o&&l[1]>=u&&l[1]<=a&&n.push(t[c]);return n}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(t){if(typeof u.query(t,"dataRange.min")=="undefined"||typeof u.query(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||e0&&(n.delShape(j.tipShape),j=!1),e&&n.refresh()}function U(e,t,n){var r=T.offsetHeight,i=T.offsetWidth;e+i>B&&(e=B-i),t+r>H&&(t=H-r),t<20&&(t=0),T.style.cssText=N+C+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(B-e<100||H-t<100)&&setTimeout(z,20)}function z(){if(T){var e="",t=T.offsetHeight,n=T.offsetWidth;T.offsetLeft+n>B&&(e+="left:"+(B-n)+"px;"),T.offsetTop+t>H&&(e+="top:"+(H-t)+"px;"),e!==""&&(T.style.cssText+=e)}}function W(){var e,t;if(!_)V()||X();else{if(_._type=="island"&&r.tooltip.show){Q();return}var n=u.get(_,"series"),i=u.get(_,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(L),clearTimeout(O),L=setTimeout(R,A)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?J(n.xAxisIndex,n.yAxisIndex,u.get(_,"dataIndex")):Q())}}function X(){if(!w||!E){L=setTimeout(R,A);return}var e=r.series,t,n;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 J(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(L),clearTimeout(O),L=setTimeout(R,A);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var S=0,x=u.length;S0){var N;if(typeof d=="function"){var C=[];for(var S=0,x=a.length;S"+ct(a[S].name||"")+" : ",N=a[S].data[s],N=typeof N!="undefined"?typeof N.value!="undefined"?N.value:N:"-",d+=N;T.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(h,p,g)}}function K(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}var f=r.polar[e].indicator[t].text;for(var c=0,h=n.length;c0){var p,d,v=[];for(var c=0,h=s.length;c"+ct(v[0][3])+" : "+v[0][2];for(var c=1,h=v.length;c"+ct(v[c][1])+"
",o+=ct(v[c][3])+" : "+v[c][2];T.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D),l.getY(D),a),!0}}function Q(){var e=u.get(_,"series"),t=u.get(_,"data"),s=u.get(_,"name"),a=u.get(_,"value"),f=u.get(_,"special"),c=u.get(_,"special2"),h,p,d="",v,g="";_._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.query(e,"tooltip.trigger")=="item"&&(p=m.query(e,"tooltip.showContent")||p,h=m.query(e,"tooltip.formatter")||h,d+=q(m.query(e,"tooltip"))),p=m.query(t,"tooltip.showContent")||p,h=m.query(t,"tooltip.formatter")||h,d+=q(m.query(t,"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")P=(e.name||"")+":"+u.get(_,"dataIndex"),T.innerHTML=h([e.name||"",s,a,f,c],P,et);else if(typeof h=="string")P=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ct(e.name||"")).replace("{b0}",ct(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(_,"special2")||""),T.innerHTML=h;else{P=NaN;if(e.type==o.CHART_TYPE_SCATTER)T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
":"")+(s===""?"":ct(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR&&f){v=f,g+=ct(s===""?e.name||"":s),g+=g===""?"":"
";for(var y=0;y";T.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")T.innerHTML=ct(s)+" ("+a+")";else{var b=ct(s),w=ct(f);T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
":"")+b+" -> "+w+" ("+a+")"+"
"+w+" -> "+b+" ("+c+")"}else T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
":"")+ct(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}F.invisible||(F.invisible=!0,n.modShape(F.id,F),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D)+20,l.getY(D)-20,d)}function G(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yB&&(n+="left:"+(B-i)+"px;"),T.offsetTop+r>H&&(n+="top:"+(H-r)+"px;"),n!==""&&(T.style.cssText+=n),(B-T.offsetLeft<100||H-T.offsetTop<100)&&setTimeout(z,20)}function tt(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function nt(e,t){if(!j||j&&j.dataIndex!=e.dataIndex){j&&j.tipShape.length>0&&n.delShape(j.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x={},T=document.createElement("div"),N="position:absolute;display:block;border-style:solid;white-space:nowrap;",C,k,L,A,O,M,_,D,P,H=n.getHeight(),B=n.getWidth(),j=!1,F={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},I={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(F),n.addShape(I),n.on(a.EVENT.MOUSEMOVE,Y),n.on(a.EVENT.GLOBALOUT,Z),m.dispose=lt,m.init=ut,m.refresh=at,m.resize=ft,m.setComponent=tt,m.ontooltipHover=nt,m.ondragend=rt,m.onlegendSelected=it,ut(r,i)}return e("../component").define("tooltip",t),t}),r("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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.query(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.query(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}),r("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),r("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",t),t}),r("echarts/echarts",["require","./config","zrender","zrender/tool/util","zrender/tool/event","zrender/config","./util/shape/icon","./util/shape/markLine","./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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wt.largeThreshold){f.shapeList.push(b(n,f.query(t,"itemStyle.normal.color")||h[s]));continue}for(var o=0,u=n.length;o1e-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}),r("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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),r("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Z(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(P[i],P[i],n,-c),v.scaleAndAdd(P[s],P[s],n,c)}for(var i=0,h=M.length;i0&&y(h,e[h]);for(var u=0,f=l.shapeList.length;u0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}d=f.getCoord(E),E>=0?(v-=m-d,d=v):E<0&&(g+=d-y,d=g),b[n].push([h,d,x,u.getNameByIndex(x),h,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"horizontal")}function E(e,t){var n=t[0][0],r=c[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,h,d,v,m,g,y,b={},w,E;for(var x=0,N=e;x0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}h=f.getCoord(E),E>=0?(v+=h-m,h=v):E<0&&(g-=y-h,h=g),b[n].push([h,d,x,u.getNameByIndex(x),m,d])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"vertical")}function S(e,t,n){var r,s,o,u,a,p,v,m,g,y,b;for(var w=c.length-1;w>=0;w--){m=c[w],y=e[w];if(m.type==l.type&&typeof y!="undefined"){r=d[w],s=l.query(m,"itemStyle.normal.lineStyle.width"),o=l.query(m,"itemStyle.normal.lineStyle.type"),u=l.query(m,"itemStyle.normal.lineStyle.color"),a=l.query(m,"itemStyle.normal.color"),p=typeof l.query(m,"itemStyle.normal.areaStyle")!="undefined",v=l.query(m,"itemStyle.normal.areaStyle.color");for(var E=0,S=y.length;E=0;n--){f=l.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(l.shapeList[n]._main){h=l.shapeList[n].style.pointList,o=Math.abs(h[0][0]-h[1][0]),a=Math.abs(h[0][1]-h[1][1]),p=l.shapeList[n]._orient=="horizontal";if(t[f][2]){if(l.shapeList[n].shape=="polygon"){var d=h.length;l.shapeList[n].style.pointList[d-3]=h[d-2],p?l.shapeList[n].style.pointList[d-3][0]=h[d-4][0]:l.shapeList[n].style.pointList[d-3][1]=h[d-4][1],l.shapeList[n].style.pointList[d-2]=h[d-1]}l.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{l.shapeList[n].style.pointList.shift();if(l.shapeList[n].shape=="polygon"){var v=l.shapeList[n].style.pointList.pop();p?v[0]=h[0][0]:v[1]=h[0][1],l.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(l.shapeList[n].id,{style:{pointList:l.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&l.shapeList[n]._dataIndex==c[f].data.length-1){r.delShape(l.shapeList[n].id);continue}if(!t[f][2]&&l.shapeList[n]._dataIndex===0){r.delShape(l.shapeList[n].id);continue}}r.animate(l.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=l.query(i,"animationDuration"),t=l.query(i,"animationEasing"),n,s,o,u=0;for(var a=0,f=l.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(x=L-C,I==1&&S[s]>x&&(x=S[s]),k-=x,C=k):D<0?(x=C-O,I==1&&S[s]>x&&(x=S[s]),C=A,A+=x):(x=L-C,k-=x,C=k),M=w(s,P,f.getNameByIndex(P),N,C,g[s]||y,x,"vertical"),T[s]=T[s]||{},T[s][P]=N+(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F0?(x=N-L,I==1&&S[s]>x&&(x=S[s]),N=k,k+=x):D<0?(x=O-N,I==1&&S[s]>x&&(x=S[s]),A-=x,N=A):(x=N-L,N=k,k+=x),M=w(s,P,f.getNameByIndex(P),N,C-(g[s]||y),x,g[s]||y,"horizontal"),T[s]=T[s]||{},T[s][P]=C-(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t,n){for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function C(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{lineStyle:{width:2,type:"solid"}},emphasis:{}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1,position:"outer"},labelLine:{show:!1,length:40,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),define("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),define("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),define("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),define("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),define("zrender/tool/area",["require","../tool/util"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,p;if(typeof t.pointList!="undefined"){var d=t.pointList;if(d.length<2)return;var v=d.length;switch(a){case"start":l=d[0][0],c=d[1][0],h=d[0][1],p=d[1][1];break;case"end":l=d[v-2][0],c=d[v-1][0],h=d[v-2][1],p=d[v-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,p=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function g(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:p,getHighlightZoom:d,drift:v,isCover:m,updateTransform:g},t}),define("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),define("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),define("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),define("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),define("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),define("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function t(){this.type="text"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";if(r.maxWidth)switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y,r.maxWidth);break;case"stroke":e.strokeText(r.text,r.x,r.y,r.maxWidth);break;case"both":e.strokeText(r.text,r.x,r.y,r.maxWidth),e.fillText(r.text,r.x,r.y,r.maxWidth);break;default:e.fillText(r.text,r.x,r.y,r.maxWidth)}else switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y);break;case"stroke":e.strokeText(r.text,r.x,r.y);break;case"both":e.strokeText(r.text,r.x,r.y),e.fillText(r.text,r.x,r.y);break;default:e.fillText(r.text,r.x,r.y)}e.restore();return},getRect:function(t){var n=e("../tool/area"),r=n.getTextWidth(t.text,t.textFont),i=n.getTextWidth("国",t.textFont),s=t.x;t.textAlign=="end"||t.textAlign=="right"?s-=r:t.textAlign=="center"&&(s-=r/2);var o=t.y-i/2;return t.textBaseline=="top"?o+=i/2:t.textBaseline=="bottom"&&(s-=i/2),{x:s,y:o,width:r,height:i}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("text",new t),t}),define("zrender/shape/heart",["require","./base","../shape"],function(e){function t(){this.type="heart"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y),e.bezierCurveTo(t.x+t.a/2,t.y-t.b*2/3,t.x+t.a*2,t.y+t.b/3,t.x,t.y+t.b),e.bezierCurveTo(t.x-t.a*2,t.y+t.b/3,t.x-t.a/2,t.y-t.b*2/3,t.x,t.y);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b/4-t/2),width:e.a*2+t,height:e.b*5/4+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("heart",new t),t}),define("zrender/shape/droplet",["require","./base","../shape"],function(e){function t(){this.type="droplet"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y+t.a),e.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+t.a*3/2,t.y-t.a/3,t.x,t.y-t.b),e.bezierCurveTo(t.x-t.a*3/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.a+e.b+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("droplet",new t),t}),define("zrender/shape/path",["require","./base","../shape"],function(e){function t(){this.type="path"}t.prototype={_parsePathData:function(e){if(!e)return[];var t=e,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];t=t.replace(/ /g," "),t=t.replace(/ /g,","),t=t.replace(/,,/g,",");var r;for(r=0;r0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),define("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),define("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),define("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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","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,arrow:y,star:b,image:w}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=5;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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:case n.CHART_TYPE_CHORD: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 a(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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),define("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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 H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(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||e0&&(n.delShape(B.tipShape),B=!1),e&&n.refresh()}function R(e,t,n){var r=x.offsetHeight,i=x.offsetWidth;e+i>H&&(e=H-i),t+r>P&&(t=P-r),t<20&&(t=0),x.style.cssText=T+N+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(H-e<100||P-t<100)&&setTimeout(U,20)}function U(){if(x){var e="",t=x.offsetHeight,n=x.offsetWidth;x.offsetLeft+n>H&&(e+="left:"+(H-n)+"px;"),x.offsetTop+t>P&&(e+="top:"+(P-t)+"px;"),e!==""&&(x.style.cssText+=e)}}function z(){var e,t;if(!M)X()||W();else{if(M._type=="island"&&r.tooltip.show){K();return}var n=u.get(M,"series"),i=u.get(M,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(k),clearTimeout(A),k=setTimeout(q,L)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?$(n.xAxisIndex,n.yAxisIndex,u.get(M,"dataIndex")):K())}}function W(){if(!w||!E){k=setTimeout(q,L);return}var e=r.series,t,n;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 $(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(k),clearTimeout(A),k=setTimeout(q,L);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var y=0,S=u.length;y0){var T;if(typeof d=="function"){var N=[];for(var y=0,S=a.length;y"+ut(a[y].name||"")+" : ",T=a[y].data[s],T=typeof T!="undefined"?typeof T.value!="undefined"?T.value:T:"-",d+=T;x.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(h,p,g)}}function J(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}for(var f=0,c=n.length;f0){var h,p,d=[],v=r.polar[e].indicator[t].text;for(var f=0,c=s.length;f"+ut(d[0][3])+" : "+d[0][2];for(var f=1,c=d.length;f"+ut(d[f][1])+"
",o+=ut(d[f][3])+" : "+d[f][2];x.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_),l.getY(_),a),!0}}function K(){var e=u.get(M,"series"),t=u.get(M,"data"),s=u.get(M,"name"),a=u.get(M,"value"),f=u.get(M,"special"),c=u.get(M,"special2"),h,p,d="",v,g="";M._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.deepQuery([e],"tooltip.trigger")=="item"&&(p=m.deepQuery([e],"tooltip.showContent")||p,h=m.deepQuery([e],"tooltip.formatter")||h,d+=I(m.deepQuery([e],"tooltip"))),p=m.deepQuery([t],"tooltip.showContent")||p,h=m.deepQuery([t],"tooltip.formatter")||h,d+=I(m.deepQuery([t],"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")D=(e.name||"")+":"+u.get(M,"dataIndex"),x.innerHTML=h([e.name||"",s,a,f,c],D,Z);else if(typeof h=="string")D=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ut(e.name||"")).replace("{b0}",ut(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(M,"special2")||""),x.innerHTML=h;else{D=NaN;if(e.type==o.CHART_TYPE_SCATTER)x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
":"")+(s===""?"":ut(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR){v=f,g+=ut(s===""?e.name||"":s),g+=g===""?"":"
";for(var y=0;y";x.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")x.innerHTML=ut(s)+" ("+a+")";else{var b=ut(s),w=ut(f);x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
":"")+b+" -> "+w+" ("+a+")"+"
"+w+" -> "+b+" ("+c+")"}else x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
":"")+ut(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}j.invisible||(j.invisible=!0,n.modShape(j.id,j),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_)+20,l.getY(_)-20,d)}function Q(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yH&&(n+="left:"+(H-i)+"px;"),x.offsetTop+r>P&&(n+="top:"+(P-r)+"px;"),n!==""&&(x.style.cssText+=n),(H-x.offsetLeft<100||P-x.offsetTop<100)&&setTimeout(U,20)}function et(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function tt(e,t){if(!B||B&&B.dataIndex!=e.dataIndex){B&&B.tipShape.length>0&&n.delShape(B.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x=document.createElement("div"),T="position:absolute;display:block;border-style:solid;white-space:nowrap;",N,C,k,L,A,O,M,_,D,P=n.getHeight(),H=n.getWidth(),B=!1,j={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},F={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(j),n.addShape(F),n.on(a.EVENT.MOUSEMOVE,G),n.on(a.EVENT.GLOBALOUT,Y),m.dispose=ot,m.init=rt,m.refresh=it,m.resize=st,m.setComponent=et,m.ontooltipHover=tt,m.ondragend=nt,rt(r,i)}return e("../component").define("tooltip",t),t}),define("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),define("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wa.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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),define("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Y(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(D[i],D[i],n,-c),v.scaleAndAdd(D[s],D[s],n,c)}for(var i=0,h=O.length;i0&&b(l,e[l]);for(var u=0,f=c.shapeList.length;u0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}p=f.getCoord(E),E>=0?(v-=m-p,p=v):E<0&&(g+=p-y,p=g),b[n].push([l,p,S,u.getNameByIndex(S),l,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"horizontal")}function S(e,t){var n=t[0][0],r=h[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,l,p,v,m,g,y,b={},w,E;for(var S=0,T=e;S0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}l=f.getCoord(E),E>=0?(v+=l-m,l=v):E<0&&(g-=y-l,l=g),b[n].push([l,p,S,u.getNameByIndex(S),m,p])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"vertical")}function x(e,t,n){var r,s,o,u,a,f,d,m,g,y,b,w;for(var E=h.length-1;E>=0;E--){g=h[E],b=e[E];if(g.type==c.type&&typeof b!="undefined"){r=v[E],s=c.deepQuery([g],"itemStyle.normal.lineStyle.width"),o=c.deepQuery([g],"itemStyle.normal.lineStyle.type"),u=c.deepQuery([g],"itemStyle.normal.lineStyle.color"),a=c.deepQuery([g],"itemStyle.normal.color"),f=c.deepQuery([g],"itemStyle.emphasis.color"),d=typeof c.deepQuery([g],"itemStyle.normal.areaStyle")!="undefined",m=c.deepQuery([g],"itemStyle.normal.areaStyle.color");for(var S=0,x=b.length;S=0;n--){f=c.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(c.shapeList[n]._main){l=c.shapeList[n].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),p=c.shapeList[n]._orient=="horizontal";if(t[f][2]){if(c.shapeList[n].shape=="polygon"){var d=l.length;c.shapeList[n].style.pointList[d-3]=l[d-2],p?c.shapeList[n].style.pointList[d-3][0]=l[d-4][0]:c.shapeList[n].style.pointList[d-3][1]=l[d-4][1],c.shapeList[n].style.pointList[d-2]=l[d-1]}c.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{c.shapeList[n].style.pointList.shift();if(c.shapeList[n].shape=="polygon"){var v=c.shapeList[n].style.pointList.pop();p?v[0]=l[0][0]:v[1]=l[0][1],c.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(c.shapeList[n].id,{style:{pointList:c.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&c.shapeList[n]._dataIndex==h[f].data.length-1){r.delShape(c.shapeList[n].id);continue}if(!t[f][2]&&c.shapeList[n]._dataIndex===0){r.delShape(c.shapeList[n].id);continue}}r.animate(c.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=c.deepQuery([i],"animationDuration"),t=c.deepQuery([i],"animationEasing"),n,s,o,u=0;for(var a=0,f=c.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(E=N-x,B==1&&y[n]>E&&(E=y[n]),T-=E,x=T):O<0?(E=x-k,B==1&&y[n]>E&&(E=y[n]),x=C,C+=E):(E=N-x,T-=E,x=T),L=w(n,M,a.getNameByIndex(M),S,x,m[n]||g,E,"vertical"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H0?(E=S-N,B==1&&y[n]>E&&(E=y[n]),S=T,T+=E):O<0?(E=k-S,B==1&&y[n]>E&&(E=y[n]),C-=E,S=C):(E=S-N,S=T,T+=E),L=w(n,M,a.getNameByIndex(M),S,x-(m[n]||g),E,m[n]||g,"horizontal"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t){i=t,S(e)}function S(e){e&&(r=e,c=r.series),l.clear(),d()}function x(e){var t={};for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function T(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1},labelLine:{show:!1,length:30,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},hoverable:!0,itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},markPoint:{symbol:"pin",symbolSize:10,itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{symbol:["circle","arrow"],symbolSize:[2,4],itemStyle:{normal:{borderWidth:2,label:{show:!1,position:"inside",textStyle:{color:"#333"}},lineStyle:{type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,animationThreshold:2500,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),define("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),define("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),define("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),define("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),define("zrender/tool/area",["require","../tool/util","../shape"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,d;if(typeof t.pointList!="undefined"){var v=t.pointList;if(v.length<2)return;var m=v.length;switch(a){case"start":l=v[0][0],c=v[1][0],h=v[0][1],d=v[1][1];break;case"end":l=v[m-2][0],c=v[m-1][0],h=v[m-2][1],d=v[m-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,d=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function b(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:v,getHighlightZoom:m,drift:g,isCover:y,updateTransform:b},t}),define("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),define("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),define("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),define("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),define("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),define("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function n(){this.type="text"}var t=e("../tool/area");n.prototype={brush:function(e,n,r){var i=n.style||{};r&&(i=this.getHighlightStyle(i,n.highlightStyle||{}));if(typeof i.text=="undefined")return;e.save(),this.setContext(e,i),n.__needTransform&&e.transform.apply(e,this.updateTransform(n)),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var s=(i.text+"").split("\n"),o=t.getTextHeight("国",i.textFont),u=this.getRect(i),a=i.x,f;i.textBaseline=="top"?f=u.y:i.textBaseline=="bottom"?f=u.y+o:f=u.y+o/2;for(var l=0,c=s.length;l0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),define("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),define("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),define("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=this._clips,n=t.length,r=[],i=[];for(var s=0;s=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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){if(e.lenth<1)return;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","zrender/shape","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,arrow:y,star:b,heart:w,droplet:E,pin:S,image:x}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){var r=e("zrender/shape").get("heart");r.buildPath(t,{x:n.x+n.width/2,y:n.y+n.height*.2,a:n.width/2,b:n.height*.8})}function E(t,n){var r=e("zrender/shape").get("droplet");r.buildPath(t,{x:n.x+n.width*.5,y:n.y+n.height*.5,a:n.width*.5,b:n.height*.8})}function S(e,t){var n=t.x,r=t.y-t.height/2*1.5,i=t.width/2,s=t.height/2,o=Math.min(i,s);e.arc(n+i,r+s,o,Math.PI/5*4,Math.PI/5),e.lineTo(n+i,r+s+o*1.5)}function x(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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-(e.iconType=="pin"?e.height/2*1.5:0)),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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=o.height<10?4:0;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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/util/shape/markLine",["require","zrender/tool/matrix","zrender/shape","zrender/shape","zrender/shape/base","zrender/shape"],function(e){function n(){this.type="markLine"}var t=e("zrender/tool/matrix");return n.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildLinePath(e,r),e.stroke(),this.brushSymbol(t,e,r,0),this.brushSymbol(t,e,r,1),typeof r.text!="undefined"&&this.drawText(e,r,t.style),e.restore();return},buildLinePath:function(e,t){var n=t.xStart,r=t.xEnd,i=t.yStart,s=t.yEnd;if(!t.lineType||t.lineType=="solid")e.moveTo(n,i),e.lineTo(r,s);else if(t.lineType=="dashed"||t.lineType=="dotted"){var o=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,n,i,r,s,o)}},brushSymbol:function(n,r,i,s){r.save(),r.beginPath(),r.lineWidth=i.symbolBorder,r.strokeStyle=i.symbolBorderColor,i.iconType=i.symbol[s].replace("empty","").toLowerCase(),i.symbol[s].match("empty")&&(r.fillStyle="rgba(0, 0, 0, 0)");var o=s===0?i.xStart:i.xEnd,u=s===0?i.yStart:i.yEnd,a=typeof i.symbolRotate[s]!="undefined"?i.symbolRotate[s]-0:0,f;a!==0&&(f=t.create(),t.identity(f),(o||u)&&t.translate(f,f,[-o,-u]),t.rotate(f,f,a*Math.PI/180),(o||u)&&t.translate(f,f,[o,u]),r.transform.apply(r,f));if(i.iconType=="arrow"&&a===0)this.buildArrawPath(r,i,s);else{var l=i.symbolSize[s];i.x=o-l,i.y=u-l,i.width=l*2,i.height=l*2,e("zrender/shape").get("icon").buildPath(r,i)}r.closePath(),r.stroke(),r.fill(),r.restore()},buildArrawPath:function(e,t,n){var r=t.symbolSize[n],i=t.xStart,s=t.xEnd,o=t.yStart,u=t.yEnd,a=Math.atan(Math.abs((u-o)/(i-s)));n===0?s>i?u>o&&(a=Math.PI*2-a):u>o?a+=Math.PI:a=Math.PI-a:i>s?o>u&&(a=Math.PI*2-a):o>u?a+=Math.PI:a=Math.PI-a;var f=Math.PI/8,l=n===0?i:s,c=n===0?o:u,h=[[l+r*Math.cos(a-f),c-r*Math.sin(a-f)],[l+r*.6*Math.cos(a),c-r*.6*Math.sin(a)],[l+r*Math.cos(a+f),c-r*Math.sin(a+f)]];e.moveTo(l,c);for(var p=0,d=h.length;p1?o.symbol:[o.symbol[0],o.symbol[0]]:[o.symbol,o.symbol],o.symbolSize=o.symbolSize instanceof Array?o.symbolSize.length>1?o.symbolSize:[o.symbolSize[0],o.symbolSize[0]]:[o.symbolSize,o.symbolSize],o.symbolRotate=o.symbolRotate instanceof Array?o.symbolRotate.length>1?o.symbolRotate:[o.symbolRotate[0],o.symbolRotate[0]]:[o.symbolRotate,o.symbolRotate],o.name=e.name;var a=[],f=o.data,l,c=u.dataRange,h=u.legend,p,d,v,m,g,y=s.zr.getWidth(),b=s.zr.getHeight();for(var w=0,E=f.length;w0?-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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}function k(e){return typeof r.data[e].value!="undefined"?r.data[e].value:r.data[e]}function L(e){var t=r.data,n=t.length;for(var i=0;i0?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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),define("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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);var l;for(var c=0,h=t.length;c=s&&l[0]<=o&&l[1]>=u&&l[1]<=a&&n.push(t[c]);return n}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(t){if(typeof u.query(t,"dataRange.min")=="undefined"||typeof u.query(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||e0&&(n.delShape(j.tipShape),j=!1),e&&n.refresh()}function U(e,t,n){var r=T.offsetHeight,i=T.offsetWidth;e+i>B&&(e=B-i),t+r>H&&(t=H-r),t<20&&(t=0),T.style.cssText=N+C+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(B-e<100||H-t<100)&&setTimeout(z,20)}function z(){if(T){var e="",t=T.offsetHeight,n=T.offsetWidth;T.offsetLeft+n>B&&(e+="left:"+(B-n)+"px;"),T.offsetTop+t>H&&(e+="top:"+(H-t)+"px;"),e!==""&&(T.style.cssText+=e)}}function W(){var e,t;if(!_)V()||X();else{if(_._type=="island"&&r.tooltip.show){Q();return}var n=u.get(_,"series"),i=u.get(_,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(L),clearTimeout(O),L=setTimeout(R,A)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?J(n.xAxisIndex,n.yAxisIndex,u.get(_,"dataIndex")):Q())}}function X(){if(!w||!E){L=setTimeout(R,A);return}var e=r.series,t,n;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 J(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(L),clearTimeout(O),L=setTimeout(R,A);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var S=0,x=u.length;S0){var N;if(typeof d=="function"){var C=[];for(var S=0,x=a.length;S"+ct(a[S].name||"")+" : ",N=a[S].data[s],N=typeof N!="undefined"?typeof N.value!="undefined"?N.value:N:"-",d+=N;T.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(h,p,g)}}function K(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}var f=r.polar[e].indicator[t].text;for(var c=0,h=n.length;c0){var p,d,v=[];for(var c=0,h=s.length;c"+ct(v[0][3])+" : "+v[0][2];for(var c=1,h=v.length;c"+ct(v[c][1])+"
",o+=ct(v[c][3])+" : "+v[c][2];T.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D),l.getY(D),a),!0}}function Q(){var e=u.get(_,"series"),t=u.get(_,"data"),s=u.get(_,"name"),a=u.get(_,"value"),f=u.get(_,"special"),c=u.get(_,"special2"),h,p,d="",v,g="";_._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.query(e,"tooltip.trigger")=="item"&&(p=m.query(e,"tooltip.showContent")||p,h=m.query(e,"tooltip.formatter")||h,d+=q(m.query(e,"tooltip"))),p=m.query(t,"tooltip.showContent")||p,h=m.query(t,"tooltip.formatter")||h,d+=q(m.query(t,"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")P=(e.name||"")+":"+u.get(_,"dataIndex"),T.innerHTML=h([e.name||"",s,a,f,c],P,et);else if(typeof h=="string")P=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ct(e.name||"")).replace("{b0}",ct(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(_,"special2")||""),T.innerHTML=h;else{P=NaN;if(e.type==o.CHART_TYPE_SCATTER)T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
":"")+(s===""?"":ct(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR&&f){v=f,g+=ct(s===""?e.name||"":s),g+=g===""?"":"
";for(var y=0;y";T.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")T.innerHTML=ct(s)+" ("+a+")";else{var b=ct(s),w=ct(f);T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
":"")+b+" -> "+w+" ("+a+")"+"
"+w+" -> "+b+" ("+c+")"}else T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
":"")+ct(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}F.invisible||(F.invisible=!0,n.modShape(F.id,F),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D)+20,l.getY(D)-20,d)}function G(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yB&&(n+="left:"+(B-i)+"px;"),T.offsetTop+r>H&&(n+="top:"+(H-r)+"px;"),n!==""&&(T.style.cssText+=n),(B-T.offsetLeft<100||H-T.offsetTop<100)&&setTimeout(z,20)}function tt(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function nt(e,t){if(!j||j&&j.dataIndex!=e.dataIndex){j&&j.tipShape.length>0&&n.delShape(j.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x={},T=document.createElement("div"),N="position:absolute;display:block;border-style:solid;white-space:nowrap;",C,k,L,A,O,M,_,D,P,H=n.getHeight(),B=n.getWidth(),j=!1,F={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},I={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(F),n.addShape(I),n.on(a.EVENT.MOUSEMOVE,Y),n.on(a.EVENT.GLOBALOUT,Z),m.dispose=lt,m.init=ut,m.refresh=at,m.resize=ft,m.setComponent=tt,m.ontooltipHover=nt,m.ondragend=rt,m.onlegendSelected=it,ut(r,i)}return e("../component").define("tooltip",t),t}),define("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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.query(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.query(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/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),define("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",t),t}),define("echarts/echarts",["require","./config","zrender","zrender/tool/util","zrender/tool/event","zrender/config","./util/shape/icon","./util/shape/markLine","./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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wt.largeThreshold){f.shapeList.push(b(n,f.query(t,"itemStyle.normal.color")||h[s]));continue}for(var o=0,u=n.length;o1e-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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),define("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Z(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(P[i],P[i],n,-c),v.scaleAndAdd(P[s],P[s],n,c)}for(var i=0,h=M.length;i0&&y(h,e[h]);for(var u=0,f=l.shapeList.length;u0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}d=f.getCoord(E),E>=0?(v-=m-d,d=v):E<0&&(g+=d-y,d=g),b[n].push([h,d,x,u.getNameByIndex(x),h,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"horizontal")}function E(e,t){var n=t[0][0],r=c[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,h,d,v,m,g,y,b={},w,E;for(var x=0,N=e;x0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}h=f.getCoord(E),E>=0?(v+=h-m,h=v):E<0&&(g-=y-h,h=g),b[n].push([h,d,x,u.getNameByIndex(x),m,d])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"vertical")}function S(e,t,n){var r,s,o,u,a,p,v,m,g,y,b;for(var w=c.length-1;w>=0;w--){m=c[w],y=e[w];if(m.type==l.type&&typeof y!="undefined"){r=d[w],s=l.query(m,"itemStyle.normal.lineStyle.width"),o=l.query(m,"itemStyle.normal.lineStyle.type"),u=l.query(m,"itemStyle.normal.lineStyle.color"),a=l.query(m,"itemStyle.normal.color"),p=typeof l.query(m,"itemStyle.normal.areaStyle")!="undefined",v=l.query(m,"itemStyle.normal.areaStyle.color");for(var E=0,S=y.length;E=0;n--){f=l.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(l.shapeList[n]._main){h=l.shapeList[n].style.pointList,o=Math.abs(h[0][0]-h[1][0]),a=Math.abs(h[0][1]-h[1][1]),p=l.shapeList[n]._orient=="horizontal";if(t[f][2]){if(l.shapeList[n].shape=="polygon"){var d=h.length;l.shapeList[n].style.pointList[d-3]=h[d-2],p?l.shapeList[n].style.pointList[d-3][0]=h[d-4][0]:l.shapeList[n].style.pointList[d-3][1]=h[d-4][1],l.shapeList[n].style.pointList[d-2]=h[d-1]}l.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{l.shapeList[n].style.pointList.shift();if(l.shapeList[n].shape=="polygon"){var v=l.shapeList[n].style.pointList.pop();p?v[0]=h[0][0]:v[1]=h[0][1],l.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(l.shapeList[n].id,{style:{pointList:l.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&l.shapeList[n]._dataIndex==c[f].data.length-1){r.delShape(l.shapeList[n].id);continue}if(!t[f][2]&&l.shapeList[n]._dataIndex===0){r.delShape(l.shapeList[n].id);continue}}r.animate(l.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=l.query(i,"animationDuration"),t=l.query(i,"animationEasing"),n,s,o,u=0;for(var a=0,f=l.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(x=L-C,I==1&&S[s]>x&&(x=S[s]),k-=x,C=k):D<0?(x=C-O,I==1&&S[s]>x&&(x=S[s]),C=A,A+=x):(x=L-C,k-=x,C=k),M=w(s,P,f.getNameByIndex(P),N,C,g[s]||y,x,"vertical"),T[s]=T[s]||{},T[s][P]=N+(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F0?(x=N-L,I==1&&S[s]>x&&(x=S[s]),N=k,k+=x):D<0?(x=O-N,I==1&&S[s]>x&&(x=S[s]),A-=x,N=A):(x=N-L,N=k,k+=x),M=w(s,P,f.getNameByIndex(P),N,C-(g[s]||y),x,g[s]||y,"horizontal"),T[s]=T[s]||{},T[s][P]=C-(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t,n){for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function C(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r1.3.6(2014-01-15)
  • [^] [tooltip]支持图例开关过滤
  • [^] [grid][dataRange]x,y,width,height支持百分比
  • [^] 通用文本分行支持,'\n' 指定
  • +
  • [^] 动画元素阀值(大规模数据时强制关闭动画效果)
  • +
  • [#] [dataZoom]数据区域缩放下抛出事件dataIndex参数修正
  • [#] [sactter]大规模散点图像素偏移
  • +
  • [#] [force]默认颜色从legend获取
  • [#] 修复script标签式引入文件构建错误,fix this »
  • [+] 新增专题 中国主要城市空气质量实况
  • [?] 依赖升级,ZRender 1.0.8+
  • diff --git a/doc/doc.html b/doc/doc.html index bcd302188b..01b4e51aad 100644 --- a/doc/doc.html +++ b/doc/doc.html @@ -2013,11 +2013,17 @@

    series

    折线图 平滑曲线显示 + + {boolean} large + false + 散点图 + 启动大规模散点图 + {number} largeThreshold 2000 散点图 - 大规模散点图自动切换阀值 + 大规模散点图自动切换阀值,large为true下有效 {Array} center diff --git a/doc/example/topic/aqi-china/js/main.js b/doc/example/topic/aqi-china/js/main.js index a5c8266cc6..14c31948f5 100644 --- a/doc/example/topic/aqi-china/js/main.js +++ b/doc/example/topic/aqi-china/js/main.js @@ -1,4 +1,4 @@ -var developMode = true; +var developMode = false; if (developMode) { // for develop require.config({ diff --git a/doc/example/www/js/echarts-map.js b/doc/example/www/js/echarts-map.js index bbf4492a2d..5bb4e096dd 100644 --- a/doc/example/www/js/echarts-map.js +++ b/doc/example/www/js/echarts-map.js @@ -13,32 +13,8 @@ * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ /*! @@ -47,32 +23,8 @@ * Copyright (c) 2013, Baidu Inc. * All rights reserved. * - * Redistribution and use of this software in source and binary forms, with or - * without modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of Baidu Inc. nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission of Baidu Inc. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * LICENSE + * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt */ -define("echarts/config",[],function(){var e={CHART_TYPE_LINE:"line",CHART_TYPE_BAR:"bar",CHART_TYPE_SCATTER:"scatter",CHART_TYPE_PIE:"pie",CHART_TYPE_RADAR:"radar",CHART_TYPE_MAP:"map",CHART_TYPE_K:"k",CHART_TYPE_ISLAND:"island",CHART_TYPE_FORCE:"force",CHART_TYPE_CHORD:"chord",COMPONENT_TYPE_TITLE:"title",COMPONENT_TYPE_LEGEND:"legend",COMPONENT_TYPE_DATARANGE:"dataRange",COMPONENT_TYPE_DATAVIEW:"dataView",COMPONENT_TYPE_DATAZOOM:"dataZoom",COMPONENT_TYPE_TOOLBOX:"toolbox",COMPONENT_TYPE_TOOLTIP:"tooltip",COMPONENT_TYPE_GRID:"grid",COMPONENT_TYPE_AXIS:"axis",COMPONENT_TYPE_POLAR:"polar",COMPONENT_TYPE_X_AXIS:"xAxis",COMPONENT_TYPE_Y_AXIS:"yAxis",COMPONENT_TYPE_AXIS_CATEGORY:"categoryAxis",COMPONENT_TYPE_AXIS_VALUE:"valueAxis",color:["#ff7f50","#87cefa","#da70d6","#32cd32","#6495ed","#ff69b4","#ba55d3","#cd5c5c","#ffa500","#40e0d0","#1e90ff","#ff6347","#7b68ee","#00fa9a","#ffd700","#6699FF","#ff6666","#3cb371","#b8860b","#30e0e0"],title:{text:"",subtext:"",x:"left",y:"top",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}},legend:{orient:"horizontal",x:"center",y:"top",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,textStyle:{color:"#333"},selectedMode:!0},dataRange:{orient:"vertical",x:"left",y:"bottom",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,precision:0,splitNumber:5,calculable:!1,realtime:!0,color:["#1e90ff","#f0ffff"],textStyle:{color:"#333"}},toolbox:{show:!1,orient:"horizontal",x:"right",y:"top",color:["#1e90ff","#22bb22","#4b0082","#d2691e"],backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemSize:16,feature:{},showTitle:!0,featureTitle:{mark:"辅助线开关",markUndo:"删除辅助线",markClear:"清空辅助线",dataZoom:"区域缩放",dataZoomReset:"区域缩放后退",dataView:"数据视图",lineChart:"折线图切换",barChart:"柱形图切换",restore:"还原",saveAsImage:"保存为图片"}},tooltip:{show:!0,showContent:!0,trigger:"item",islandFormatter:"{a}
    {b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{lineStyle:{width:2,type:"solid"}},emphasis:{}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1,position:"outer"},labelLine:{show:!1,length:40,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),define("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),define("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),define("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),define("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),define("zrender/tool/area",["require","../tool/util"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,p;if(typeof t.pointList!="undefined"){var d=t.pointList;if(d.length<2)return;var v=d.length;switch(a){case"start":l=d[0][0],c=d[1][0],h=d[0][1],p=d[1][1];break;case"end":l=d[v-2][0],c=d[v-1][0],h=d[v-2][1],p=d[v-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,p=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function g(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:p,getHighlightZoom:d,drift:v,isCover:m,updateTransform:g},t}),define("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),define("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),define("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),define("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),define("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),define("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function t(){this.type="text"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";if(r.maxWidth)switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y,r.maxWidth);break;case"stroke":e.strokeText(r.text,r.x,r.y,r.maxWidth);break;case"both":e.strokeText(r.text,r.x,r.y,r.maxWidth),e.fillText(r.text,r.x,r.y,r.maxWidth);break;default:e.fillText(r.text,r.x,r.y,r.maxWidth)}else switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y);break;case"stroke":e.strokeText(r.text,r.x,r.y);break;case"both":e.strokeText(r.text,r.x,r.y),e.fillText(r.text,r.x,r.y);break;default:e.fillText(r.text,r.x,r.y)}e.restore();return},getRect:function(t){var n=e("../tool/area"),r=n.getTextWidth(t.text,t.textFont),i=n.getTextWidth("国",t.textFont),s=t.x;t.textAlign=="end"||t.textAlign=="right"?s-=r:t.textAlign=="center"&&(s-=r/2);var o=t.y-i/2;return t.textBaseline=="top"?o+=i/2:t.textBaseline=="bottom"&&(s-=i/2),{x:s,y:o,width:r,height:i}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("text",new t),t}),define("zrender/shape/heart",["require","./base","../shape"],function(e){function t(){this.type="heart"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y),e.bezierCurveTo(t.x+t.a/2,t.y-t.b*2/3,t.x+t.a*2,t.y+t.b/3,t.x,t.y+t.b),e.bezierCurveTo(t.x-t.a*2,t.y+t.b/3,t.x-t.a/2,t.y-t.b*2/3,t.x,t.y);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b/4-t/2),width:e.a*2+t,height:e.b*5/4+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("heart",new t),t}),define("zrender/shape/droplet",["require","./base","../shape"],function(e){function t(){this.type="droplet"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y+t.a),e.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+t.a*3/2,t.y-t.a/3,t.x,t.y-t.b),e.bezierCurveTo(t.x-t.a*3/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.a+e.b+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("droplet",new t),t}),define("zrender/shape/path",["require","./base","../shape"],function(e){function t(){this.type="path"}t.prototype={_parsePathData:function(e){if(!e)return[];var t=e,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];t=t.replace(/ /g," "),t=t.replace(/ /g,","),t=t.replace(/,,/g,",");var r;for(r=0;r0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),define("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),define("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),define("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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","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,arrow:y,star:b,image:w}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=5;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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:case n.CHART_TYPE_CHORD: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 a(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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),define("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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 H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(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||e0&&(n.delShape(B.tipShape),B=!1),e&&n.refresh()}function R(e,t,n){var r=x.offsetHeight,i=x.offsetWidth;e+i>H&&(e=H-i),t+r>P&&(t=P-r),t<20&&(t=0),x.style.cssText=T+N+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(H-e<100||P-t<100)&&setTimeout(U,20)}function U(){if(x){var e="",t=x.offsetHeight,n=x.offsetWidth;x.offsetLeft+n>H&&(e+="left:"+(H-n)+"px;"),x.offsetTop+t>P&&(e+="top:"+(P-t)+"px;"),e!==""&&(x.style.cssText+=e)}}function z(){var e,t;if(!M)X()||W();else{if(M._type=="island"&&r.tooltip.show){K();return}var n=u.get(M,"series"),i=u.get(M,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(k),clearTimeout(A),k=setTimeout(q,L)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?$(n.xAxisIndex,n.yAxisIndex,u.get(M,"dataIndex")):K())}}function W(){if(!w||!E){k=setTimeout(q,L);return}var e=r.series,t,n;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 $(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(k),clearTimeout(A),k=setTimeout(q,L);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var y=0,S=u.length;y0){var T;if(typeof d=="function"){var N=[];for(var y=0,S=a.length;y"+ut(a[y].name||"")+" : ",T=a[y].data[s],T=typeof T!="undefined"?typeof T.value!="undefined"?T.value:T:"-",d+=T;x.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(h,p,g)}}function J(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}for(var f=0,c=n.length;f0){var h,p,d=[],v=r.polar[e].indicator[t].text;for(var f=0,c=s.length;f"+ut(d[0][3])+" : "+d[0][2];for(var f=1,c=d.length;f"+ut(d[f][1])+"
    ",o+=ut(d[f][3])+" : "+d[f][2];x.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_),l.getY(_),a),!0}}function K(){var e=u.get(M,"series"),t=u.get(M,"data"),s=u.get(M,"name"),a=u.get(M,"value"),f=u.get(M,"special"),c=u.get(M,"special2"),h,p,d="",v,g="";M._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.deepQuery([e],"tooltip.trigger")=="item"&&(p=m.deepQuery([e],"tooltip.showContent")||p,h=m.deepQuery([e],"tooltip.formatter")||h,d+=I(m.deepQuery([e],"tooltip"))),p=m.deepQuery([t],"tooltip.showContent")||p,h=m.deepQuery([t],"tooltip.formatter")||h,d+=I(m.deepQuery([t],"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")D=(e.name||"")+":"+u.get(M,"dataIndex"),x.innerHTML=h([e.name||"",s,a,f,c],D,Z);else if(typeof h=="string")D=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ut(e.name||"")).replace("{b0}",ut(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(M,"special2")||""),x.innerHTML=h;else{D=NaN;if(e.type==o.CHART_TYPE_SCATTER)x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
    ":"")+(s===""?"":ut(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR){v=f,g+=ut(s===""?e.name||"":s),g+=g===""?"":"
    ";for(var y=0;y";x.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")x.innerHTML=ut(s)+" ("+a+")";else{var b=ut(s),w=ut(f);x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
    ":"")+b+" -> "+w+" ("+a+")"+"
    "+w+" -> "+b+" ("+c+")"}else x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
    ":"")+ut(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}j.invisible||(j.invisible=!0,n.modShape(j.id,j),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_)+20,l.getY(_)-20,d)}function Q(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yH&&(n+="left:"+(H-i)+"px;"),x.offsetTop+r>P&&(n+="top:"+(P-r)+"px;"),n!==""&&(x.style.cssText+=n),(H-x.offsetLeft<100||P-x.offsetTop<100)&&setTimeout(U,20)}function et(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function tt(e,t){if(!B||B&&B.dataIndex!=e.dataIndex){B&&B.tipShape.length>0&&n.delShape(B.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x=document.createElement("div"),T="position:absolute;display:block;border-style:solid;white-space:nowrap;",N,C,k,L,A,O,M,_,D,P=n.getHeight(),H=n.getWidth(),B=!1,j={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},F={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(j),n.addShape(F),n.on(a.EVENT.MOUSEMOVE,G),n.on(a.EVENT.GLOBALOUT,Y),m.dispose=ot,m.init=rt,m.refresh=it,m.resize=st,m.setComponent=et,m.ontooltipHover=tt,m.ondragend=nt,rt(r,i)}return e("../component").define("tooltip",t),t}),define("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),define("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wa.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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),define("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Y(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(D[i],D[i],n,-c),v.scaleAndAdd(D[s],D[s],n,c)}for(var i=0,h=O.length;i>1^-(o&1),u=u>>1^-(u&1),o+=r,u+=i,r=o,i=u,n.push([o/1024,u/1024])}return n}var r={world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],r="",i=e[0],s=e[1];for(var o=0,u=n.length;o180?n-360:n,r=90-(r/e.scale.y+e.offset.y),[n,r]}function o(e,t){return n.offset=e.offset,n.scale=e.scale,t instanceof Array?n.makePoint([t[0]*1,t[1]*1]):n.makePoint([t.x*1,t.y*1])}var n={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,r=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxr&&(t.xmin=r),t.xmaxi&&(t.ymin=i),t.ymax10?n[L][g].value=Math.round(n[L][g].value):n[L][g].value=n[L][g].value.toFixed(2)-0;y[L]=y[L]||{},y[L].mapData?P(L,n[L],a[L])(y[L].mapData):x[L.replace(/\|.*/,"")].getGeoJson&&(w[L]=x[L.replace(/\|.*/,"")].specialArea||w[L],x[L.replace(/\|.*/,"")].getGeoJson(P(L,n[L],a[L])))}}function P(e,t,r){return function(i){e.indexOf("|")!=-1&&(i=H(e,i)),y[e].mapData=i,q(e,B(e,i,r),t,r);if(--S<=0){for(var s=0,o=h.shapeList.length;s1&&(r={geometry:{coordinates:r.geometry.coordinates.slice(5,6),type:r.geometry.type},id:r.id,properties:r.properties,type:r.type});break}return{type:"FeatureCollection",features:[r]}}function B(t,n,r){var i=e("../util/projection/normal"),s=[],o=y[t].bbox||i.getBbox(n,w[t]),u;y[t].hasRoam?u=y[t].transform:u=I(o,r);var a=y[t].lastTransform||{scale:{}},f;u.left!=a.left||u.top!=a.top||u.scale.x!=a.scale.x||u.scale.y!=a.scale.y?(f=i.geoJson2Path(n,u,w[t]),a=l.clone(u)):(u=y[t].transform,f=y[t].pathArray),y[t].bbox=o,y[t].transform=u,y[t].lastTransform=a,y[t].pathArray=f;var c=[u.left,u.top];for(var h=0,p=f.length;hv?(d=v*.75,l=h*d):(v=d,d=v*.75,c=p*v);var m={OffsetLeft:a[0],OffsetTop:a[1],scale:{x:d,y:v}},g=o.geoJson2Path(n,m);return F(t,g[0],s)}function F(e,t,n){var r,i=t.properties.name;return N[i]?r=Z(e,N[i]):t.cp&&(r=[t.cp[0],t.cp[1]]),T[i]&&(r[0]+=T[i][0],r[1]+=T[i][1]),{text:R(e,i),path:t.path,position:n,textX:r[0],textY:r[1]}}function I(e,t){var r,i,s,o,u,a,f,l=n.getWidth(),c=n.getHeight(),d=Math.round(Math.min(l,c)*.02);for(var v in t)r=p[v].mapLocation,s=r.x||s,u=r.y||u,a=r.width||a,f=r.height||f;i=h.parsePercent(s,l),i=isNaN(i)?d:i,o=h.parsePercent(u,c),o=isNaN(o)?d:o,typeof a=="undefined"?a=isNaN(s)?l-2*d:l-i-2*d:a=h.parsePercent(a,l),typeof f=="undefined"?f=isNaN(u)?c-2*d:c-o-2*d:f=h.parsePercent(f,c);var m=e.width,g=e.height,y=a/.75/m,b=f/g;y>b?(y=b*.75,a=m*y):(b=y,y=b*.75,f=g*b);if(isNaN(s))switch(s+""){case"center":i=Math.floor((l-a)/2);break;case"right":i=l-a;break;default:}if(isNaN(u))switch(u+""){case"center":o=Math.floor((c-f)/2);break;case"bottom":o=c-f;break;default:}return{left:i,top:o,width:a,height:f,scale:{x:y,y:b}}}function q(e,t,n,r){var s=i.legend,o=i.dataRange,f,c,y,b,w,E=u.map,S,x,T,N,C,k;for(var L=0,A=t.length;L=r&&e<=r+s&&t>=i&&t<=i+o)return u}return}function W(e){var t=e.event,n=c.getX(t),r=c.getY(t),i=c.getDelta(t),s=z(n,r);if(s){var o=y[s].transform,u=o.left,a=o.top,f=o.width,l=o.height;geoAndPos=Y(s,[n-u,r-a]),i>0?(i=1.2,o.scale.x*=i,o.scale.y*=i,o.width=f*i,o.height=l*i):(i=1.2,o.scale.x/=i,o.scale.y/=i,o.width=f/i,o.height=l/i),y[s].hasRoam=!0,y[s].transform=o,geoAndPos=Z(s,geoAndPos),o.left-=geoAndPos[0]-(n-u),o.top-=geoAndPos[1]-(r-a),y[s].transform=o,clearTimeout(E),E=setTimeout(Q,100),c.stop(t)}}function X(e){var t=e.target;if(t&&t.draggable)return;var r=e.event,i=c.getX(r),s=c.getY(r),o=z(i,s);o&&(O=!0,L=i,A=s,_=o,setTimeout(function(){n.on(f.EVENT.MOUSEMOVE,V),n.on(f.EVENT.MOUSEUP,$)},50))}function V(e){if(!O||!h)return;var t=e.event,r=c.getX(t),i=c.getY(t),s=y[_].transform;s.hasRoam=!0,s.left-=L-r,s.top-=A-i,L=r,A=i,y[_].transform=s;var o=[s.left,s.top],u={position:[s.left,s.top]};for(var a=0,f=h.shapeList.length;a0&&b(l,e[l]);for(var u=0,f=c.shapeList.length;u0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}p=f.getCoord(E),E>=0?(v-=m-p,p=v):E<0&&(g+=p-y,p=g),b[n].push([l,p,S,u.getNameByIndex(S),l,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"horizontal")}function S(e,t){var n=t[0][0],r=h[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,l,p,v,m,g,y,b={},w,E;for(var S=0,T=e;S0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}l=f.getCoord(E),E>=0?(v+=l-m,l=v):E<0&&(g-=y-l,l=g),b[n].push([l,p,S,u.getNameByIndex(S),m,p])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"vertical")}function x(e,t,n){var r,s,o,u,a,f,d,m,g,y,b,w;for(var E=h.length-1;E>=0;E--){g=h[E],b=e[E];if(g.type==c.type&&typeof b!="undefined"){r=v[E],s=c.deepQuery([g],"itemStyle.normal.lineStyle.width"),o=c.deepQuery([g],"itemStyle.normal.lineStyle.type"),u=c.deepQuery([g],"itemStyle.normal.lineStyle.color"),a=c.deepQuery([g],"itemStyle.normal.color"),f=c.deepQuery([g],"itemStyle.emphasis.color"),d=typeof c.deepQuery([g],"itemStyle.normal.areaStyle")!="undefined",m=c.deepQuery([g],"itemStyle.normal.areaStyle.color");for(var S=0,x=b.length;S=0;n--){f=c.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(c.shapeList[n]._main){l=c.shapeList[n].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),p=c.shapeList[n]._orient=="horizontal";if(t[f][2]){if(c.shapeList[n].shape=="polygon"){var d=l.length;c.shapeList[n].style.pointList[d-3]=l[d-2],p?c.shapeList[n].style.pointList[d-3][0]=l[d-4][0]:c.shapeList[n].style.pointList[d-3][1]=l[d-4][1],c.shapeList[n].style.pointList[d-2]=l[d-1]}c.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{c.shapeList[n].style.pointList.shift();if(c.shapeList[n].shape=="polygon"){var v=c.shapeList[n].style.pointList.pop();p?v[0]=l[0][0]:v[1]=l[0][1],c.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(c.shapeList[n].id,{style:{pointList:c.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&c.shapeList[n]._dataIndex==h[f].data.length-1){r.delShape(c.shapeList[n].id);continue}if(!t[f][2]&&c.shapeList[n]._dataIndex===0){r.delShape(c.shapeList[n].id);continue}}r.animate(c.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=c.deepQuery([i],"animationDuration"),t=c.deepQuery([i],"animationEasing"),n,s,o,u=0;for(var a=0,f=c.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(E=N-x,B==1&&y[n]>E&&(E=y[n]),T-=E,x=T):O<0?(E=x-k,B==1&&y[n]>E&&(E=y[n]),x=C,C+=E):(E=N-x,T-=E,x=T),L=w(n,M,a.getNameByIndex(M),S,x,m[n]||g,E,"vertical"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H0?(E=S-N,B==1&&y[n]>E&&(E=y[n]),S=T,T+=E):O<0?(E=k-S,B==1&&y[n]>E&&(E=y[n]),C-=E,S=C):(E=S-N,S=T,T+=E),L=w(n,M,a.getNameByIndex(M),S,x-(m[n]||g),E,m[n]||g,"horizontal"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t){i=t,S(e)}function S(e){e&&(r=e,c=r.series),l.clear(),d()}function x(e){var t={};for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function T(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1},labelLine:{show:!1,length:30,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},hoverable:!0,itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},markPoint:{symbol:"pin",symbolSize:10,itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{symbol:["circle","arrow"],symbolSize:[2,4],itemStyle:{normal:{borderWidth:2,label:{show:!1,position:"inside",textStyle:{color:"#333"}},lineStyle:{type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,animationThreshold:2500,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),define("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),define("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),define("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),define("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),define("zrender/tool/area",["require","../tool/util","../shape"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,d;if(typeof t.pointList!="undefined"){var v=t.pointList;if(v.length<2)return;var m=v.length;switch(a){case"start":l=v[0][0],c=v[1][0],h=v[0][1],d=v[1][1];break;case"end":l=v[m-2][0],c=v[m-1][0],h=v[m-2][1],d=v[m-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,d=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function b(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:v,getHighlightZoom:m,drift:g,isCover:y,updateTransform:b},t}),define("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),define("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),define("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),define("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),define("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),define("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function n(){this.type="text"}var t=e("../tool/area");n.prototype={brush:function(e,n,r){var i=n.style||{};r&&(i=this.getHighlightStyle(i,n.highlightStyle||{}));if(typeof i.text=="undefined")return;e.save(),this.setContext(e,i),n.__needTransform&&e.transform.apply(e,this.updateTransform(n)),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var s=(i.text+"").split("\n"),o=t.getTextHeight("国",i.textFont),u=this.getRect(i),a=i.x,f;i.textBaseline=="top"?f=u.y:i.textBaseline=="bottom"?f=u.y+o:f=u.y+o/2;for(var l=0,c=s.length;l0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),define("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),define("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),define("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=this._clips,n=t.length,r=[],i=[];for(var s=0;s=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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){if(e.lenth<1)return;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","zrender/shape","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,arrow:y,star:b,heart:w,droplet:E,pin:S,image:x}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){var r=e("zrender/shape").get("heart");r.buildPath(t,{x:n.x+n.width/2,y:n.y+n.height*.2,a:n.width/2,b:n.height*.8})}function E(t,n){var r=e("zrender/shape").get("droplet");r.buildPath(t,{x:n.x+n.width*.5,y:n.y+n.height*.5,a:n.width*.5,b:n.height*.8})}function S(e,t){var n=t.x,r=t.y-t.height/2*1.5,i=t.width/2,s=t.height/2,o=Math.min(i,s);e.arc(n+i,r+s,o,Math.PI/5*4,Math.PI/5),e.lineTo(n+i,r+s+o*1.5)}function x(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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-(e.iconType=="pin"?e.height/2*1.5:0)),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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=o.height<10?4:0;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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/util/shape/markLine",["require","zrender/tool/matrix","zrender/shape","zrender/shape","zrender/shape/base","zrender/shape"],function(e){function n(){this.type="markLine"}var t=e("zrender/tool/matrix");return n.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildLinePath(e,r),e.stroke(),this.brushSymbol(t,e,r,0),this.brushSymbol(t,e,r,1),typeof r.text!="undefined"&&this.drawText(e,r,t.style),e.restore();return},buildLinePath:function(e,t){var n=t.xStart,r=t.xEnd,i=t.yStart,s=t.yEnd;if(!t.lineType||t.lineType=="solid")e.moveTo(n,i),e.lineTo(r,s);else if(t.lineType=="dashed"||t.lineType=="dotted"){var o=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,n,i,r,s,o)}},brushSymbol:function(n,r,i,s){r.save(),r.beginPath(),r.lineWidth=i.symbolBorder,r.strokeStyle=i.symbolBorderColor,i.iconType=i.symbol[s].replace("empty","").toLowerCase(),i.symbol[s].match("empty")&&(r.fillStyle="rgba(0, 0, 0, 0)");var o=s===0?i.xStart:i.xEnd,u=s===0?i.yStart:i.yEnd,a=typeof i.symbolRotate[s]!="undefined"?i.symbolRotate[s]-0:0,f;a!==0&&(f=t.create(),t.identity(f),(o||u)&&t.translate(f,f,[-o,-u]),t.rotate(f,f,a*Math.PI/180),(o||u)&&t.translate(f,f,[o,u]),r.transform.apply(r,f));if(i.iconType=="arrow"&&a===0)this.buildArrawPath(r,i,s);else{var l=i.symbolSize[s];i.x=o-l,i.y=u-l,i.width=l*2,i.height=l*2,e("zrender/shape").get("icon").buildPath(r,i)}r.closePath(),r.stroke(),r.fill(),r.restore()},buildArrawPath:function(e,t,n){var r=t.symbolSize[n],i=t.xStart,s=t.xEnd,o=t.yStart,u=t.yEnd,a=Math.atan(Math.abs((u-o)/(i-s)));n===0?s>i?u>o&&(a=Math.PI*2-a):u>o?a+=Math.PI:a=Math.PI-a:i>s?o>u&&(a=Math.PI*2-a):o>u?a+=Math.PI:a=Math.PI-a;var f=Math.PI/8,l=n===0?i:s,c=n===0?o:u,h=[[l+r*Math.cos(a-f),c-r*Math.sin(a-f)],[l+r*.6*Math.cos(a),c-r*.6*Math.sin(a)],[l+r*Math.cos(a+f),c-r*Math.sin(a+f)]];e.moveTo(l,c);for(var p=0,d=h.length;p1?o.symbol:[o.symbol[0],o.symbol[0]]:[o.symbol,o.symbol],o.symbolSize=o.symbolSize instanceof Array?o.symbolSize.length>1?o.symbolSize:[o.symbolSize[0],o.symbolSize[0]]:[o.symbolSize,o.symbolSize],o.symbolRotate=o.symbolRotate instanceof Array?o.symbolRotate.length>1?o.symbolRotate:[o.symbolRotate[0],o.symbolRotate[0]]:[o.symbolRotate,o.symbolRotate],o.name=e.name;var a=[],f=o.data,l,c=u.dataRange,h=u.legend,p,d,v,m,g,y=s.zr.getWidth(),b=s.zr.getHeight();for(var w=0,E=f.length;w0?-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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}function k(e){return typeof r.data[e].value!="undefined"?r.data[e].value:r.data[e]}function L(e){var t=r.data,n=t.length;for(var i=0;i0?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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),define("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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);var l;for(var c=0,h=t.length;c=s&&l[0]<=o&&l[1]>=u&&l[1]<=a&&n.push(t[c]);return n}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(t){if(typeof u.query(t,"dataRange.min")=="undefined"||typeof u.query(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||e0&&(n.delShape(j.tipShape),j=!1),e&&n.refresh()}function U(e,t,n){var r=T.offsetHeight,i=T.offsetWidth;e+i>B&&(e=B-i),t+r>H&&(t=H-r),t<20&&(t=0),T.style.cssText=N+C+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(B-e<100||H-t<100)&&setTimeout(z,20)}function z(){if(T){var e="",t=T.offsetHeight,n=T.offsetWidth;T.offsetLeft+n>B&&(e+="left:"+(B-n)+"px;"),T.offsetTop+t>H&&(e+="top:"+(H-t)+"px;"),e!==""&&(T.style.cssText+=e)}}function W(){var e,t;if(!_)V()||X();else{if(_._type=="island"&&r.tooltip.show){Q();return}var n=u.get(_,"series"),i=u.get(_,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(L),clearTimeout(O),L=setTimeout(R,A)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?J(n.xAxisIndex,n.yAxisIndex,u.get(_,"dataIndex")):Q())}}function X(){if(!w||!E){L=setTimeout(R,A);return}var e=r.series,t,n;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 J(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(L),clearTimeout(O),L=setTimeout(R,A);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var S=0,x=u.length;S0){var N;if(typeof d=="function"){var C=[];for(var S=0,x=a.length;S"+ct(a[S].name||"")+" : ",N=a[S].data[s],N=typeof N!="undefined"?typeof N.value!="undefined"?N.value:N:"-",d+=N;T.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(h,p,g)}}function K(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}var f=r.polar[e].indicator[t].text;for(var c=0,h=n.length;c0){var p,d,v=[];for(var c=0,h=s.length;c"+ct(v[0][3])+" : "+v[0][2];for(var c=1,h=v.length;c"+ct(v[c][1])+"
    ",o+=ct(v[c][3])+" : "+v[c][2];T.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D),l.getY(D),a),!0}}function Q(){var e=u.get(_,"series"),t=u.get(_,"data"),s=u.get(_,"name"),a=u.get(_,"value"),f=u.get(_,"special"),c=u.get(_,"special2"),h,p,d="",v,g="";_._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.query(e,"tooltip.trigger")=="item"&&(p=m.query(e,"tooltip.showContent")||p,h=m.query(e,"tooltip.formatter")||h,d+=q(m.query(e,"tooltip"))),p=m.query(t,"tooltip.showContent")||p,h=m.query(t,"tooltip.formatter")||h,d+=q(m.query(t,"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")P=(e.name||"")+":"+u.get(_,"dataIndex"),T.innerHTML=h([e.name||"",s,a,f,c],P,et);else if(typeof h=="string")P=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ct(e.name||"")).replace("{b0}",ct(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(_,"special2")||""),T.innerHTML=h;else{P=NaN;if(e.type==o.CHART_TYPE_SCATTER)T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
    ":"")+(s===""?"":ct(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR&&f){v=f,g+=ct(s===""?e.name||"":s),g+=g===""?"":"
    ";for(var y=0;y";T.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")T.innerHTML=ct(s)+" ("+a+")";else{var b=ct(s),w=ct(f);T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
    ":"")+b+" -> "+w+" ("+a+")"+"
    "+w+" -> "+b+" ("+c+")"}else T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
    ":"")+ct(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}F.invisible||(F.invisible=!0,n.modShape(F.id,F),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D)+20,l.getY(D)-20,d)}function G(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yB&&(n+="left:"+(B-i)+"px;"),T.offsetTop+r>H&&(n+="top:"+(H-r)+"px;"),n!==""&&(T.style.cssText+=n),(B-T.offsetLeft<100||H-T.offsetTop<100)&&setTimeout(z,20)}function tt(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function nt(e,t){if(!j||j&&j.dataIndex!=e.dataIndex){j&&j.tipShape.length>0&&n.delShape(j.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x={},T=document.createElement("div"),N="position:absolute;display:block;border-style:solid;white-space:nowrap;",C,k,L,A,O,M,_,D,P,H=n.getHeight(),B=n.getWidth(),j=!1,F={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},I={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(F),n.addShape(I),n.on(a.EVENT.MOUSEMOVE,Y),n.on(a.EVENT.GLOBALOUT,Z),m.dispose=lt,m.init=ut,m.refresh=at,m.resize=ft,m.setComponent=tt,m.ontooltipHover=nt,m.ondragend=rt,m.onlegendSelected=it,ut(r,i)}return e("../component").define("tooltip",t),t}),define("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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.query(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.query(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/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),define("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",t),t}),define("echarts/echarts",["require","./config","zrender","zrender/tool/util","zrender/tool/event","zrender/config","./util/shape/icon","./util/shape/markLine","./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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wt.largeThreshold){f.shapeList.push(b(n,f.query(t,"itemStyle.normal.color")||h[s]));continue}for(var o=0,u=n.length;o1e-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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),define("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Z(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(P[i],P[i],n,-c),v.scaleAndAdd(P[s],P[s],n,c)}for(var i=0,h=M.length;i>1^-(o&1),u=u>>1^-(u&1),o+=r,u+=i,r=o,i=u,n.push([o/1024,u/1024])}return n}var r={world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],r="",i=e[0],s=e[1];for(var o=0,u=n.length;o180?n-360:n,r=90-(r/e.scale.y+e.offset.y),[n,r]}function o(e,t){return n.offset=e.offset,n.scale=e.scale,t instanceof Array?n.makePoint([t[0]*1,t[1]*1]):n.makePoint([t.x*1,t.y*1])}var n={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,r=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxr&&(t.xmin=r),t.xmaxi&&(t.ymin=i),t.ymax10?n[A][y].value=Math.round(n[A][y].value):n[A][y].value=n[A][y].value.toFixed(2)-0;b[A]=b[A]||{},b[A].mapData?B(A,n[A],a[A])(b[A].mapData):T[A.replace(/\|.*/,"")].getGeoJson&&(E[A]=T[A.replace(/\|.*/,"")].specialArea||E[A],T[A.replace(/\|.*/,"")].getGeoJson(B(A,n[A],a[A])))}}function B(e,t,i){return function(s){e.indexOf("|")!=-1&&(s=j(e,s)),b[e].mapData=s,U(e,F(e,s,i),t,i),z(e,i);if(--x<=0){for(var o=0,u=h.shapeList.length;o1&&(r={geometry:{coordinates:r.geometry.coordinates.slice(5,6),type:r.geometry.type},id:r.id,properties:r.properties,type:r.type});break}return{type:"FeatureCollection",features:[r]}}function F(t,n,r){var i=e("../util/projection/normal"),s=[],o=b[t].bbox||i.getBbox(n,E[t]),u;b[t].hasRoam?u=b[t].transform:u=R(o,r);var a=b[t].lastTransform||{scale:{}},f;u.left!=a.left||u.top!=a.top||u.scale.x!=a.scale.x||u.scale.y!=a.scale.y?(f=i.geoJson2Path(n,u,E[t]),a=l.clone(u)):(u=b[t].transform,f=b[t].pathArray),b[t].bbox=o,b[t].transform=u,b[t].lastTransform=a,b[t].pathArray=f;var c=[u.left,u.top];for(var h=0,p=f.length;hv?(d=v*.75,l=h*d):(v=d,d=v*.75,c=p*v);var m={OffsetLeft:a[0],OffsetTop:a[1],scale:{x:d,y:v}},g=o.geoJson2Path(n,m);return q(t,g[0],s)}function q(e,t,n){var r,i=t.properties.name;return C[i]?r=it(e,C[i]):t.cp&&(r=[t.cp[0],t.cp[1]]),N[i]&&(r[0]+=N[i][0],r[1]+=N[i][1]),{text:X(e,i),path:t.path,position:n,textX:r[0],textY:r[1]}}function R(e,t){var r,i,s,o,u,a,f,l=n.getWidth(),c=n.getHeight(),d=Math.round(Math.min(l,c)*.02);for(var v in t)r=p[v].mapLocation,s=r.x||s,u=r.y||u,a=r.width||a,f=r.height||f;i=h.parsePercent(s,l),i=isNaN(i)?d:i,o=h.parsePercent(u,c),o=isNaN(o)?d:o,typeof a=="undefined"?a=isNaN(s)?l-2*d:l-i-2*d:a=h.parsePercent(a,l),typeof f=="undefined"?f=isNaN(u)?c-2*d:c-o-2*d:f=h.parsePercent(f,c);var m=e.width,g=e.height,y=a/.75/m,b=f/g;y>b?(y=b*.75,a=m*y):(b=y,y=b*.75,f=g*b);if(isNaN(s))switch(s+""){case"center":i=Math.floor((l-a)/2);break;case"right":i=l-a;break;default:}if(isNaN(u))switch(u+""){case"center":o=Math.floor((c-f)/2);break;case"bottom":o=c-f;break;default:}return{left:i,top:o,width:a,height:f,scale:{x:y,y:b}}}function U(e,t,n,r){var s=i.legend,o=i.dataRange,f,c,b,w,E,S=u.map,x,T,N,C,k,L;for(var A=0,O=t.length;A=r&&e<=r+s&&t>=i&&t<=i+o)return u}return}function J(e){var n=e.event,r=c.getX(n),i=c.getY(n),s=c.getDelta(n),o=$(r,i);if(o){var a=b[o].transform,f=a.left,l=a.top,h=a.width,p=a.height;geoAndPos=nt(o,[r-f,i-l]),s>0?(s=1.2,a.scale.x*=s,a.scale.y*=s,a.width=h*s,a.height=p*s):(s=1.2,a.scale.x/=s,a.scale.y/=s,a.width=h/s,a.height=p/s),b[o].hasRoam=!0,b[o].transform=a,geoAndPos=it(o,geoAndPos),a.left-=geoAndPos[0]-(r-f),a.top-=geoAndPos[1]-(i-l),b[o].transform=a,clearTimeout(S),S=setTimeout(et,100),t.dispatch(u.EVENT.MAP_ROAM,e.event,{type:"scale"}),c.stop(n)}}function K(e){var t=e.target;if(t&&t.draggable)return;var r=e.event,i=c.getX(r),s=c.getY(r),o=$(i,s);o&&(M=!0,A=i,O=s,D=o,setTimeout(function(){n.on(f.EVENT.MOUSEMOVE,Q),n.on(f.EVENT.MOUSEUP,G)},50))}function Q(e){if(!M||!h)return;var r=e.event,i=c.getX(r),s=c.getY(r),o=b[D].transform;o.hasRoam=!0,o.left-=A-i,o.top-=O-s,A=i,O=s,b[D].transform=o;var a=[o.left,o.top],f={position:[o.left,o.top]};for(var l=0,p=h.shapeList.length;l0&&y(h,e[h]);for(var u=0,f=l.shapeList.length;u0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}d=f.getCoord(E),E>=0?(v-=m-d,d=v):E<0&&(g+=d-y,d=g),b[n].push([h,d,x,u.getNameByIndex(x),h,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"horizontal")}function E(e,t){var n=t[0][0],r=c[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,h,d,v,m,g,y,b={},w,E;for(var x=0,N=e;x0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}h=f.getCoord(E),E>=0?(v+=h-m,h=v):E<0&&(g-=y-h,h=g),b[n].push([h,d,x,u.getNameByIndex(x),m,d])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"vertical")}function S(e,t,n){var r,s,o,u,a,p,v,m,g,y,b;for(var w=c.length-1;w>=0;w--){m=c[w],y=e[w];if(m.type==l.type&&typeof y!="undefined"){r=d[w],s=l.query(m,"itemStyle.normal.lineStyle.width"),o=l.query(m,"itemStyle.normal.lineStyle.type"),u=l.query(m,"itemStyle.normal.lineStyle.color"),a=l.query(m,"itemStyle.normal.color"),p=typeof l.query(m,"itemStyle.normal.areaStyle")!="undefined",v=l.query(m,"itemStyle.normal.areaStyle.color");for(var E=0,S=y.length;E=0;n--){f=l.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(l.shapeList[n]._main){h=l.shapeList[n].style.pointList,o=Math.abs(h[0][0]-h[1][0]),a=Math.abs(h[0][1]-h[1][1]),p=l.shapeList[n]._orient=="horizontal";if(t[f][2]){if(l.shapeList[n].shape=="polygon"){var d=h.length;l.shapeList[n].style.pointList[d-3]=h[d-2],p?l.shapeList[n].style.pointList[d-3][0]=h[d-4][0]:l.shapeList[n].style.pointList[d-3][1]=h[d-4][1],l.shapeList[n].style.pointList[d-2]=h[d-1]}l.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{l.shapeList[n].style.pointList.shift();if(l.shapeList[n].shape=="polygon"){var v=l.shapeList[n].style.pointList.pop();p?v[0]=h[0][0]:v[1]=h[0][1],l.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(l.shapeList[n].id,{style:{pointList:l.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&l.shapeList[n]._dataIndex==c[f].data.length-1){r.delShape(l.shapeList[n].id);continue}if(!t[f][2]&&l.shapeList[n]._dataIndex===0){r.delShape(l.shapeList[n].id);continue}}r.animate(l.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=l.query(i,"animationDuration"),t=l.query(i,"animationEasing"),n,s,o,u=0;for(var a=0,f=l.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(x=L-C,I==1&&S[s]>x&&(x=S[s]),k-=x,C=k):D<0?(x=C-O,I==1&&S[s]>x&&(x=S[s]),C=A,A+=x):(x=L-C,k-=x,C=k),M=w(s,P,f.getNameByIndex(P),N,C,g[s]||y,x,"vertical"),T[s]=T[s]||{},T[s][P]=N+(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F0?(x=N-L,I==1&&S[s]>x&&(x=S[s]),N=k,k+=x):D<0?(x=O-N,I==1&&S[s]>x&&(x=S[s]),A-=x,N=A):(x=N-L,N=k,k+=x),M=w(s,P,f.getNameByIndex(P),N,C-(g[s]||y),x,g[s]||y,"horizontal"),T[s]=T[s]||{},T[s][P]=C-(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t,n){for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function C(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{lineStyle:{width:2,type:"solid"}},emphasis:{}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1,position:"outer"},labelLine:{show:!1,length:40,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),define("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),define("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),define("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),define("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),define("zrender/tool/area",["require","../tool/util"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,p;if(typeof t.pointList!="undefined"){var d=t.pointList;if(d.length<2)return;var v=d.length;switch(a){case"start":l=d[0][0],c=d[1][0],h=d[0][1],p=d[1][1];break;case"end":l=d[v-2][0],c=d[v-1][0],h=d[v-2][1],p=d[v-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,p=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function g(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:p,getHighlightZoom:d,drift:v,isCover:m,updateTransform:g},t}),define("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),define("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),define("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),define("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),define("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),define("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function t(){this.type="text"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";if(r.maxWidth)switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y,r.maxWidth);break;case"stroke":e.strokeText(r.text,r.x,r.y,r.maxWidth);break;case"both":e.strokeText(r.text,r.x,r.y,r.maxWidth),e.fillText(r.text,r.x,r.y,r.maxWidth);break;default:e.fillText(r.text,r.x,r.y,r.maxWidth)}else switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y);break;case"stroke":e.strokeText(r.text,r.x,r.y);break;case"both":e.strokeText(r.text,r.x,r.y),e.fillText(r.text,r.x,r.y);break;default:e.fillText(r.text,r.x,r.y)}e.restore();return},getRect:function(t){var n=e("../tool/area"),r=n.getTextWidth(t.text,t.textFont),i=n.getTextWidth("国",t.textFont),s=t.x;t.textAlign=="end"||t.textAlign=="right"?s-=r:t.textAlign=="center"&&(s-=r/2);var o=t.y-i/2;return t.textBaseline=="top"?o+=i/2:t.textBaseline=="bottom"&&(s-=i/2),{x:s,y:o,width:r,height:i}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("text",new t),t}),define("zrender/shape/heart",["require","./base","../shape"],function(e){function t(){this.type="heart"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y),e.bezierCurveTo(t.x+t.a/2,t.y-t.b*2/3,t.x+t.a*2,t.y+t.b/3,t.x,t.y+t.b),e.bezierCurveTo(t.x-t.a*2,t.y+t.b/3,t.x-t.a/2,t.y-t.b*2/3,t.x,t.y);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b/4-t/2),width:e.a*2+t,height:e.b*5/4+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("heart",new t),t}),define("zrender/shape/droplet",["require","./base","../shape"],function(e){function t(){this.type="droplet"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y+t.a),e.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+t.a*3/2,t.y-t.a/3,t.x,t.y-t.b),e.bezierCurveTo(t.x-t.a*3/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.a+e.b+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("droplet",new t),t}),define("zrender/shape/path",["require","./base","../shape"],function(e){function t(){this.type="path"}t.prototype={_parsePathData:function(e){if(!e)return[];var t=e,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];t=t.replace(/ /g," "),t=t.replace(/ /g,","),t=t.replace(/,,/g,",");var r;for(r=0;r0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),define("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),define("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),define("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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","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,arrow:y,star:b,image:w}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=5;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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:case n.CHART_TYPE_CHORD: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 a(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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),define("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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 H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(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||e0&&(n.delShape(B.tipShape),B=!1),e&&n.refresh()}function R(e,t,n){var r=x.offsetHeight,i=x.offsetWidth;e+i>H&&(e=H-i),t+r>P&&(t=P-r),t<20&&(t=0),x.style.cssText=T+N+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(H-e<100||P-t<100)&&setTimeout(U,20)}function U(){if(x){var e="",t=x.offsetHeight,n=x.offsetWidth;x.offsetLeft+n>H&&(e+="left:"+(H-n)+"px;"),x.offsetTop+t>P&&(e+="top:"+(P-t)+"px;"),e!==""&&(x.style.cssText+=e)}}function z(){var e,t;if(!M)X()||W();else{if(M._type=="island"&&r.tooltip.show){K();return}var n=u.get(M,"series"),i=u.get(M,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(k),clearTimeout(A),k=setTimeout(q,L)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?$(n.xAxisIndex,n.yAxisIndex,u.get(M,"dataIndex")):K())}}function W(){if(!w||!E){k=setTimeout(q,L);return}var e=r.series,t,n;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 $(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(k),clearTimeout(A),k=setTimeout(q,L);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var y=0,S=u.length;y0){var T;if(typeof d=="function"){var N=[];for(var y=0,S=a.length;y"+ut(a[y].name||"")+" : ",T=a[y].data[s],T=typeof T!="undefined"?typeof T.value!="undefined"?T.value:T:"-",d+=T;x.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(h,p,g)}}function J(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}for(var f=0,c=n.length;f0){var h,p,d=[],v=r.polar[e].indicator[t].text;for(var f=0,c=s.length;f"+ut(d[0][3])+" : "+d[0][2];for(var f=1,c=d.length;f"+ut(d[f][1])+"
    ",o+=ut(d[f][3])+" : "+d[f][2];x.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_),l.getY(_),a),!0}}function K(){var e=u.get(M,"series"),t=u.get(M,"data"),s=u.get(M,"name"),a=u.get(M,"value"),f=u.get(M,"special"),c=u.get(M,"special2"),h,p,d="",v,g="";M._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.deepQuery([e],"tooltip.trigger")=="item"&&(p=m.deepQuery([e],"tooltip.showContent")||p,h=m.deepQuery([e],"tooltip.formatter")||h,d+=I(m.deepQuery([e],"tooltip"))),p=m.deepQuery([t],"tooltip.showContent")||p,h=m.deepQuery([t],"tooltip.formatter")||h,d+=I(m.deepQuery([t],"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")D=(e.name||"")+":"+u.get(M,"dataIndex"),x.innerHTML=h([e.name||"",s,a,f,c],D,Z);else if(typeof h=="string")D=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ut(e.name||"")).replace("{b0}",ut(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(M,"special2")||""),x.innerHTML=h;else{D=NaN;if(e.type==o.CHART_TYPE_SCATTER)x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
    ":"")+(s===""?"":ut(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR){v=f,g+=ut(s===""?e.name||"":s),g+=g===""?"":"
    ";for(var y=0;y";x.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")x.innerHTML=ut(s)+" ("+a+")";else{var b=ut(s),w=ut(f);x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
    ":"")+b+" -> "+w+" ("+a+")"+"
    "+w+" -> "+b+" ("+c+")"}else x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
    ":"")+ut(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}j.invisible||(j.invisible=!0,n.modShape(j.id,j),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_)+20,l.getY(_)-20,d)}function Q(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yH&&(n+="left:"+(H-i)+"px;"),x.offsetTop+r>P&&(n+="top:"+(P-r)+"px;"),n!==""&&(x.style.cssText+=n),(H-x.offsetLeft<100||P-x.offsetTop<100)&&setTimeout(U,20)}function et(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function tt(e,t){if(!B||B&&B.dataIndex!=e.dataIndex){B&&B.tipShape.length>0&&n.delShape(B.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x=document.createElement("div"),T="position:absolute;display:block;border-style:solid;white-space:nowrap;",N,C,k,L,A,O,M,_,D,P=n.getHeight(),H=n.getWidth(),B=!1,j={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},F={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(j),n.addShape(F),n.on(a.EVENT.MOUSEMOVE,G),n.on(a.EVENT.GLOBALOUT,Y),m.dispose=ot,m.init=rt,m.refresh=it,m.resize=st,m.setComponent=et,m.ontooltipHover=tt,m.ondragend=nt,rt(r,i)}return e("../component").define("tooltip",t),t}),define("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),define("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wa.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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),define("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Y(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(D[i],D[i],n,-c),v.scaleAndAdd(D[s],D[s],n,c)}for(var i=0,h=O.length;i0&&b(l,e[l]);for(var u=0,f=c.shapeList.length;u0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}p=f.getCoord(E),E>=0?(v-=m-p,p=v):E<0&&(g+=p-y,p=g),b[n].push([l,p,S,u.getNameByIndex(S),l,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"horizontal")}function S(e,t){var n=t[0][0],r=h[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,l,p,v,m,g,y,b={},w,E;for(var S=0,T=e;S0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}l=f.getCoord(E),E>=0?(v+=l-m,l=v):E<0&&(g-=y-l,l=g),b[n].push([l,p,S,u.getNameByIndex(S),m,p])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"vertical")}function x(e,t,n){var r,s,o,u,a,f,d,m,g,y,b,w;for(var E=h.length-1;E>=0;E--){g=h[E],b=e[E];if(g.type==c.type&&typeof b!="undefined"){r=v[E],s=c.deepQuery([g],"itemStyle.normal.lineStyle.width"),o=c.deepQuery([g],"itemStyle.normal.lineStyle.type"),u=c.deepQuery([g],"itemStyle.normal.lineStyle.color"),a=c.deepQuery([g],"itemStyle.normal.color"),f=c.deepQuery([g],"itemStyle.emphasis.color"),d=typeof c.deepQuery([g],"itemStyle.normal.areaStyle")!="undefined",m=c.deepQuery([g],"itemStyle.normal.areaStyle.color");for(var S=0,x=b.length;S=0;n--){f=c.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(c.shapeList[n]._main){l=c.shapeList[n].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),p=c.shapeList[n]._orient=="horizontal";if(t[f][2]){if(c.shapeList[n].shape=="polygon"){var d=l.length;c.shapeList[n].style.pointList[d-3]=l[d-2],p?c.shapeList[n].style.pointList[d-3][0]=l[d-4][0]:c.shapeList[n].style.pointList[d-3][1]=l[d-4][1],c.shapeList[n].style.pointList[d-2]=l[d-1]}c.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{c.shapeList[n].style.pointList.shift();if(c.shapeList[n].shape=="polygon"){var v=c.shapeList[n].style.pointList.pop();p?v[0]=l[0][0]:v[1]=l[0][1],c.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(c.shapeList[n].id,{style:{pointList:c.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&c.shapeList[n]._dataIndex==h[f].data.length-1){r.delShape(c.shapeList[n].id);continue}if(!t[f][2]&&c.shapeList[n]._dataIndex===0){r.delShape(c.shapeList[n].id);continue}}r.animate(c.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=c.deepQuery([i],"animationDuration"),t=c.deepQuery([i],"animationEasing"),n,s,o,u=0;for(var a=0,f=c.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(E=N-x,B==1&&y[n]>E&&(E=y[n]),T-=E,x=T):O<0?(E=x-k,B==1&&y[n]>E&&(E=y[n]),x=C,C+=E):(E=N-x,T-=E,x=T),L=w(n,M,a.getNameByIndex(M),S,x,m[n]||g,E,"vertical"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H0?(E=S-N,B==1&&y[n]>E&&(E=y[n]),S=T,T+=E):O<0?(E=k-S,B==1&&y[n]>E&&(E=y[n]),C-=E,S=C):(E=S-N,S=T,T+=E),L=w(n,M,a.getNameByIndex(M),S,x-(m[n]||g),E,m[n]||g,"horizontal"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t){i=t,S(e)}function S(e){e&&(r=e,c=r.series),l.clear(),d()}function x(e){var t={};for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function T(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1},labelLine:{show:!1,length:30,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},hoverable:!0,itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},markPoint:{symbol:"pin",symbolSize:10,itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{symbol:["circle","arrow"],symbolSize:[2,4],itemStyle:{normal:{borderWidth:2,label:{show:!1,position:"inside",textStyle:{color:"#333"}},lineStyle:{type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,animationThreshold:2500,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),define("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),define("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),define("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),define("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),define("zrender/tool/area",["require","../tool/util","../shape"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,d;if(typeof t.pointList!="undefined"){var v=t.pointList;if(v.length<2)return;var m=v.length;switch(a){case"start":l=v[0][0],c=v[1][0],h=v[0][1],d=v[1][1];break;case"end":l=v[m-2][0],c=v[m-1][0],h=v[m-2][1],d=v[m-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,d=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function b(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:v,getHighlightZoom:m,drift:g,isCover:y,updateTransform:b},t}),define("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),define("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),define("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),define("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),define("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),define("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function n(){this.type="text"}var t=e("../tool/area");n.prototype={brush:function(e,n,r){var i=n.style||{};r&&(i=this.getHighlightStyle(i,n.highlightStyle||{}));if(typeof i.text=="undefined")return;e.save(),this.setContext(e,i),n.__needTransform&&e.transform.apply(e,this.updateTransform(n)),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var s=(i.text+"").split("\n"),o=t.getTextHeight("国",i.textFont),u=this.getRect(i),a=i.x,f;i.textBaseline=="top"?f=u.y:i.textBaseline=="bottom"?f=u.y+o:f=u.y+o/2;for(var l=0,c=s.length;l0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),define("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),define("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),define("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=this._clips,n=t.length,r=[],i=[];for(var s=0;s=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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){if(e.lenth<1)return;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","zrender/shape","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,arrow:y,star:b,heart:w,droplet:E,pin:S,image:x}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){var r=e("zrender/shape").get("heart");r.buildPath(t,{x:n.x+n.width/2,y:n.y+n.height*.2,a:n.width/2,b:n.height*.8})}function E(t,n){var r=e("zrender/shape").get("droplet");r.buildPath(t,{x:n.x+n.width*.5,y:n.y+n.height*.5,a:n.width*.5,b:n.height*.8})}function S(e,t){var n=t.x,r=t.y-t.height/2*1.5,i=t.width/2,s=t.height/2,o=Math.min(i,s);e.arc(n+i,r+s,o,Math.PI/5*4,Math.PI/5),e.lineTo(n+i,r+s+o*1.5)}function x(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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-(e.iconType=="pin"?e.height/2*1.5:0)),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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=o.height<10?4:0;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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/util/shape/markLine",["require","zrender/tool/matrix","zrender/shape","zrender/shape","zrender/shape/base","zrender/shape"],function(e){function n(){this.type="markLine"}var t=e("zrender/tool/matrix");return n.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildLinePath(e,r),e.stroke(),this.brushSymbol(t,e,r,0),this.brushSymbol(t,e,r,1),typeof r.text!="undefined"&&this.drawText(e,r,t.style),e.restore();return},buildLinePath:function(e,t){var n=t.xStart,r=t.xEnd,i=t.yStart,s=t.yEnd;if(!t.lineType||t.lineType=="solid")e.moveTo(n,i),e.lineTo(r,s);else if(t.lineType=="dashed"||t.lineType=="dotted"){var o=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,n,i,r,s,o)}},brushSymbol:function(n,r,i,s){r.save(),r.beginPath(),r.lineWidth=i.symbolBorder,r.strokeStyle=i.symbolBorderColor,i.iconType=i.symbol[s].replace("empty","").toLowerCase(),i.symbol[s].match("empty")&&(r.fillStyle="rgba(0, 0, 0, 0)");var o=s===0?i.xStart:i.xEnd,u=s===0?i.yStart:i.yEnd,a=typeof i.symbolRotate[s]!="undefined"?i.symbolRotate[s]-0:0,f;a!==0&&(f=t.create(),t.identity(f),(o||u)&&t.translate(f,f,[-o,-u]),t.rotate(f,f,a*Math.PI/180),(o||u)&&t.translate(f,f,[o,u]),r.transform.apply(r,f));if(i.iconType=="arrow"&&a===0)this.buildArrawPath(r,i,s);else{var l=i.symbolSize[s];i.x=o-l,i.y=u-l,i.width=l*2,i.height=l*2,e("zrender/shape").get("icon").buildPath(r,i)}r.closePath(),r.stroke(),r.fill(),r.restore()},buildArrawPath:function(e,t,n){var r=t.symbolSize[n],i=t.xStart,s=t.xEnd,o=t.yStart,u=t.yEnd,a=Math.atan(Math.abs((u-o)/(i-s)));n===0?s>i?u>o&&(a=Math.PI*2-a):u>o?a+=Math.PI:a=Math.PI-a:i>s?o>u&&(a=Math.PI*2-a):o>u?a+=Math.PI:a=Math.PI-a;var f=Math.PI/8,l=n===0?i:s,c=n===0?o:u,h=[[l+r*Math.cos(a-f),c-r*Math.sin(a-f)],[l+r*.6*Math.cos(a),c-r*.6*Math.sin(a)],[l+r*Math.cos(a+f),c-r*Math.sin(a+f)]];e.moveTo(l,c);for(var p=0,d=h.length;p1?o.symbol:[o.symbol[0],o.symbol[0]]:[o.symbol,o.symbol],o.symbolSize=o.symbolSize instanceof Array?o.symbolSize.length>1?o.symbolSize:[o.symbolSize[0],o.symbolSize[0]]:[o.symbolSize,o.symbolSize],o.symbolRotate=o.symbolRotate instanceof Array?o.symbolRotate.length>1?o.symbolRotate:[o.symbolRotate[0],o.symbolRotate[0]]:[o.symbolRotate,o.symbolRotate],o.name=e.name;var a=[],f=o.data,l,c=u.dataRange,h=u.legend,p,d,v,m,g,y=s.zr.getWidth(),b=s.zr.getHeight();for(var w=0,E=f.length;w0?-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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}function k(e){return typeof r.data[e].value!="undefined"?r.data[e].value:r.data[e]}function L(e){var t=r.data,n=t.length;for(var i=0;i0?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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),define("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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);var l;for(var c=0,h=t.length;c=s&&l[0]<=o&&l[1]>=u&&l[1]<=a&&n.push(t[c]);return n}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(t){if(typeof u.query(t,"dataRange.min")=="undefined"||typeof u.query(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||e0&&(n.delShape(j.tipShape),j=!1),e&&n.refresh()}function U(e,t,n){var r=T.offsetHeight,i=T.offsetWidth;e+i>B&&(e=B-i),t+r>H&&(t=H-r),t<20&&(t=0),T.style.cssText=N+C+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(B-e<100||H-t<100)&&setTimeout(z,20)}function z(){if(T){var e="",t=T.offsetHeight,n=T.offsetWidth;T.offsetLeft+n>B&&(e+="left:"+(B-n)+"px;"),T.offsetTop+t>H&&(e+="top:"+(H-t)+"px;"),e!==""&&(T.style.cssText+=e)}}function W(){var e,t;if(!_)V()||X();else{if(_._type=="island"&&r.tooltip.show){Q();return}var n=u.get(_,"series"),i=u.get(_,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(L),clearTimeout(O),L=setTimeout(R,A)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?J(n.xAxisIndex,n.yAxisIndex,u.get(_,"dataIndex")):Q())}}function X(){if(!w||!E){L=setTimeout(R,A);return}var e=r.series,t,n;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 J(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(L),clearTimeout(O),L=setTimeout(R,A);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var S=0,x=u.length;S0){var N;if(typeof d=="function"){var C=[];for(var S=0,x=a.length;S"+ct(a[S].name||"")+" : ",N=a[S].data[s],N=typeof N!="undefined"?typeof N.value!="undefined"?N.value:N:"-",d+=N;T.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(h,p,g)}}function K(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}var f=r.polar[e].indicator[t].text;for(var c=0,h=n.length;c0){var p,d,v=[];for(var c=0,h=s.length;c"+ct(v[0][3])+" : "+v[0][2];for(var c=1,h=v.length;c"+ct(v[c][1])+"
    ",o+=ct(v[c][3])+" : "+v[c][2];T.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D),l.getY(D),a),!0}}function Q(){var e=u.get(_,"series"),t=u.get(_,"data"),s=u.get(_,"name"),a=u.get(_,"value"),f=u.get(_,"special"),c=u.get(_,"special2"),h,p,d="",v,g="";_._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.query(e,"tooltip.trigger")=="item"&&(p=m.query(e,"tooltip.showContent")||p,h=m.query(e,"tooltip.formatter")||h,d+=q(m.query(e,"tooltip"))),p=m.query(t,"tooltip.showContent")||p,h=m.query(t,"tooltip.formatter")||h,d+=q(m.query(t,"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")P=(e.name||"")+":"+u.get(_,"dataIndex"),T.innerHTML=h([e.name||"",s,a,f,c],P,et);else if(typeof h=="string")P=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ct(e.name||"")).replace("{b0}",ct(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(_,"special2")||""),T.innerHTML=h;else{P=NaN;if(e.type==o.CHART_TYPE_SCATTER)T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
    ":"")+(s===""?"":ct(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR&&f){v=f,g+=ct(s===""?e.name||"":s),g+=g===""?"":"
    ";for(var y=0;y";T.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")T.innerHTML=ct(s)+" ("+a+")";else{var b=ct(s),w=ct(f);T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
    ":"")+b+" -> "+w+" ("+a+")"+"
    "+w+" -> "+b+" ("+c+")"}else T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
    ":"")+ct(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}F.invisible||(F.invisible=!0,n.modShape(F.id,F),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D)+20,l.getY(D)-20,d)}function G(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yB&&(n+="left:"+(B-i)+"px;"),T.offsetTop+r>H&&(n+="top:"+(H-r)+"px;"),n!==""&&(T.style.cssText+=n),(B-T.offsetLeft<100||H-T.offsetTop<100)&&setTimeout(z,20)}function tt(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function nt(e,t){if(!j||j&&j.dataIndex!=e.dataIndex){j&&j.tipShape.length>0&&n.delShape(j.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x={},T=document.createElement("div"),N="position:absolute;display:block;border-style:solid;white-space:nowrap;",C,k,L,A,O,M,_,D,P,H=n.getHeight(),B=n.getWidth(),j=!1,F={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},I={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(F),n.addShape(I),n.on(a.EVENT.MOUSEMOVE,Y),n.on(a.EVENT.GLOBALOUT,Z),m.dispose=lt,m.init=ut,m.refresh=at,m.resize=ft,m.setComponent=tt,m.ontooltipHover=nt,m.ondragend=rt,m.onlegendSelected=it,ut(r,i)}return e("../component").define("tooltip",t),t}),define("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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.query(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.query(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/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),define("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",t),t}),define("echarts/echarts",["require","./config","zrender","zrender/tool/util","zrender/tool/event","zrender/config","./util/shape/icon","./util/shape/markLine","./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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wt.largeThreshold){f.shapeList.push(b(n,f.query(t,"itemStyle.normal.color")||h[s]));continue}for(var o=0,u=n.length;o1e-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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),define("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Z(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(P[i],P[i],n,-c),v.scaleAndAdd(P[s],P[s],n,c)}for(var i=0,h=M.length;i0&&y(h,e[h]);for(var u=0,f=l.shapeList.length;u0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}d=f.getCoord(E),E>=0?(v-=m-d,d=v):E<0&&(g+=d-y,d=g),b[n].push([h,d,x,u.getNameByIndex(x),h,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"horizontal")}function E(e,t){var n=t[0][0],r=c[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,h,d,v,m,g,y,b={},w,E;for(var x=0,N=e;x0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}h=f.getCoord(E),E>=0?(v+=h-m,h=v):E<0&&(g-=y-h,h=g),b[n].push([h,d,x,u.getNameByIndex(x),m,d])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"vertical")}function S(e,t,n){var r,s,o,u,a,p,v,m,g,y,b;for(var w=c.length-1;w>=0;w--){m=c[w],y=e[w];if(m.type==l.type&&typeof y!="undefined"){r=d[w],s=l.query(m,"itemStyle.normal.lineStyle.width"),o=l.query(m,"itemStyle.normal.lineStyle.type"),u=l.query(m,"itemStyle.normal.lineStyle.color"),a=l.query(m,"itemStyle.normal.color"),p=typeof l.query(m,"itemStyle.normal.areaStyle")!="undefined",v=l.query(m,"itemStyle.normal.areaStyle.color");for(var E=0,S=y.length;E=0;n--){f=l.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(l.shapeList[n]._main){h=l.shapeList[n].style.pointList,o=Math.abs(h[0][0]-h[1][0]),a=Math.abs(h[0][1]-h[1][1]),p=l.shapeList[n]._orient=="horizontal";if(t[f][2]){if(l.shapeList[n].shape=="polygon"){var d=h.length;l.shapeList[n].style.pointList[d-3]=h[d-2],p?l.shapeList[n].style.pointList[d-3][0]=h[d-4][0]:l.shapeList[n].style.pointList[d-3][1]=h[d-4][1],l.shapeList[n].style.pointList[d-2]=h[d-1]}l.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{l.shapeList[n].style.pointList.shift();if(l.shapeList[n].shape=="polygon"){var v=l.shapeList[n].style.pointList.pop();p?v[0]=h[0][0]:v[1]=h[0][1],l.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(l.shapeList[n].id,{style:{pointList:l.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&l.shapeList[n]._dataIndex==c[f].data.length-1){r.delShape(l.shapeList[n].id);continue}if(!t[f][2]&&l.shapeList[n]._dataIndex===0){r.delShape(l.shapeList[n].id);continue}}r.animate(l.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=l.query(i,"animationDuration"),t=l.query(i,"animationEasing"),n,s,o,u=0;for(var a=0,f=l.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(x=L-C,I==1&&S[s]>x&&(x=S[s]),k-=x,C=k):D<0?(x=C-O,I==1&&S[s]>x&&(x=S[s]),C=A,A+=x):(x=L-C,k-=x,C=k),M=w(s,P,f.getNameByIndex(P),N,C,g[s]||y,x,"vertical"),T[s]=T[s]||{},T[s][P]=N+(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F0?(x=N-L,I==1&&S[s]>x&&(x=S[s]),N=k,k+=x):D<0?(x=O-N,I==1&&S[s]>x&&(x=S[s]),A-=x,N=A):(x=N-L,N=k,k+=x),M=w(s,P,f.getNameByIndex(P),N,C-(g[s]||y),x,g[s]||y,"horizontal"),T[s]=T[s]||{},T[s][P]=C-(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t,n){for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function C(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(t){if(d(f,t)){var n=f[t];delete f[t],c[t]=!0,i.apply(e,n)}if(!d(a,t)&&!d(c,t))throw new Error("No "+t);return a[t]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var i,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},i=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{lineStyle:{width:2,type:"solid"}},emphasis:{}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1,position:"outer"},labelLine:{show:!1,length:40,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),r("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),r("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),r("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),r("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),r("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),r("zrender/tool/area",["require","../tool/util"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),r("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,p;if(typeof t.pointList!="undefined"){var d=t.pointList;if(d.length<2)return;var v=d.length;switch(a){case"start":l=d[0][0],c=d[1][0],h=d[0][1],p=d[1][1];break;case"end":l=d[v-2][0],c=d[v-1][0],h=d[v-2][1],p=d[v-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,p=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function g(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:p,getHighlightZoom:d,drift:v,isCover:m,updateTransform:g},t}),r("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),r("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),r("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),r("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),r("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),r("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function t(){this.type="text"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";if(r.maxWidth)switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y,r.maxWidth);break;case"stroke":e.strokeText(r.text,r.x,r.y,r.maxWidth);break;case"both":e.strokeText(r.text,r.x,r.y,r.maxWidth),e.fillText(r.text,r.x,r.y,r.maxWidth);break;default:e.fillText(r.text,r.x,r.y,r.maxWidth)}else switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y);break;case"stroke":e.strokeText(r.text,r.x,r.y);break;case"both":e.strokeText(r.text,r.x,r.y),e.fillText(r.text,r.x,r.y);break;default:e.fillText(r.text,r.x,r.y)}e.restore();return},getRect:function(t){var n=e("../tool/area"),r=n.getTextWidth(t.text,t.textFont),i=n.getTextWidth("国",t.textFont),s=t.x;t.textAlign=="end"||t.textAlign=="right"?s-=r:t.textAlign=="center"&&(s-=r/2);var o=t.y-i/2;return t.textBaseline=="top"?o+=i/2:t.textBaseline=="bottom"&&(s-=i/2),{x:s,y:o,width:r,height:i}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("text",new t),t}),r("zrender/shape/heart",["require","./base","../shape"],function(e){function t(){this.type="heart"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y),e.bezierCurveTo(t.x+t.a/2,t.y-t.b*2/3,t.x+t.a*2,t.y+t.b/3,t.x,t.y+t.b),e.bezierCurveTo(t.x-t.a*2,t.y+t.b/3,t.x-t.a/2,t.y-t.b*2/3,t.x,t.y);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b/4-t/2),width:e.a*2+t,height:e.b*5/4+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("heart",new t),t}),r("zrender/shape/droplet",["require","./base","../shape"],function(e){function t(){this.type="droplet"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y+t.a),e.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+t.a*3/2,t.y-t.a/3,t.x,t.y-t.b),e.bezierCurveTo(t.x-t.a*3/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.a+e.b+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("droplet",new t),t}),r("zrender/shape/path",["require","./base","../shape"],function(e){function t(){this.type="path"}t.prototype={_parsePathData:function(e){if(!e)return[];var t=e,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];t=t.replace(/ /g," "),t=t.replace(/ /g,","),t=t.replace(/,,/g,",");var r;for(r=0;r0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),r("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),r("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),r("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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}),r("zrender",["zrender/zrender"],function(e){return e}),r("echarts/util/shape/icon",["require","zrender/tool/matrix","zrender/shape","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,arrow:y,star:b,image:w}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=5;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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}),r("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}),r("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:case n.CHART_TYPE_CHORD: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 a(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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}return e("../chart").define("island",t),t}),r("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}),r("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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}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}),r("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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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}),r("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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),r("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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 H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(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||e0&&(n.delShape(B.tipShape),B=!1),e&&n.refresh()}function R(e,t,n){var r=x.offsetHeight,i=x.offsetWidth;e+i>H&&(e=H-i),t+r>P&&(t=P-r),t<20&&(t=0),x.style.cssText=T+N+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(H-e<100||P-t<100)&&setTimeout(U,20)}function U(){if(x){var e="",t=x.offsetHeight,n=x.offsetWidth;x.offsetLeft+n>H&&(e+="left:"+(H-n)+"px;"),x.offsetTop+t>P&&(e+="top:"+(P-t)+"px;"),e!==""&&(x.style.cssText+=e)}}function z(){var e,t;if(!M)X()||W();else{if(M._type=="island"&&r.tooltip.show){K();return}var n=u.get(M,"series"),i=u.get(M,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(k),clearTimeout(A),k=setTimeout(q,L)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?$(n.xAxisIndex,n.yAxisIndex,u.get(M,"dataIndex")):K())}}function W(){if(!w||!E){k=setTimeout(q,L);return}var e=r.series,t,n;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 $(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(k),clearTimeout(A),k=setTimeout(q,L);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var y=0,S=u.length;y0){var T;if(typeof d=="function"){var N=[];for(var y=0,S=a.length;y"+ut(a[y].name||"")+" : ",T=a[y].data[s],T=typeof T!="undefined"?typeof T.value!="undefined"?T.value:T:"-",d+=T;x.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(h,p,g)}}function J(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}for(var f=0,c=n.length;f0){var h,p,d=[],v=r.polar[e].indicator[t].text;for(var f=0,c=s.length;f"+ut(d[0][3])+" : "+d[0][2];for(var f=1,c=d.length;f"+ut(d[f][1])+"
    ",o+=ut(d[f][3])+" : "+d[f][2];x.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_),l.getY(_),a),!0}}function K(){var e=u.get(M,"series"),t=u.get(M,"data"),s=u.get(M,"name"),a=u.get(M,"value"),f=u.get(M,"special"),c=u.get(M,"special2"),h,p,d="",v,g="";M._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.deepQuery([e],"tooltip.trigger")=="item"&&(p=m.deepQuery([e],"tooltip.showContent")||p,h=m.deepQuery([e],"tooltip.formatter")||h,d+=I(m.deepQuery([e],"tooltip"))),p=m.deepQuery([t],"tooltip.showContent")||p,h=m.deepQuery([t],"tooltip.formatter")||h,d+=I(m.deepQuery([t],"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")D=(e.name||"")+":"+u.get(M,"dataIndex"),x.innerHTML=h([e.name||"",s,a,f,c],D,Z);else if(typeof h=="string")D=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ut(e.name||"")).replace("{b0}",ut(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(M,"special2")||""),x.innerHTML=h;else{D=NaN;if(e.type==o.CHART_TYPE_SCATTER)x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
    ":"")+(s===""?"":ut(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR){v=f,g+=ut(s===""?e.name||"":s),g+=g===""?"":"
    ";for(var y=0;y";x.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")x.innerHTML=ut(s)+" ("+a+")";else{var b=ut(s),w=ut(f);x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
    ":"")+b+" -> "+w+" ("+a+")"+"
    "+w+" -> "+b+" ("+c+")"}else x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
    ":"")+ut(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}j.invisible||(j.invisible=!0,n.modShape(j.id,j),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_)+20,l.getY(_)-20,d)}function Q(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yH&&(n+="left:"+(H-i)+"px;"),x.offsetTop+r>P&&(n+="top:"+(P-r)+"px;"),n!==""&&(x.style.cssText+=n),(H-x.offsetLeft<100||P-x.offsetTop<100)&&setTimeout(U,20)}function et(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function tt(e,t){if(!B||B&&B.dataIndex!=e.dataIndex){B&&B.tipShape.length>0&&n.delShape(B.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x=document.createElement("div"),T="position:absolute;display:block;border-style:solid;white-space:nowrap;",N,C,k,L,A,O,M,_,D,P=n.getHeight(),H=n.getWidth(),B=!1,j={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},F={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(j),n.addShape(F),n.on(a.EVENT.MOUSEMOVE,G),n.on(a.EVENT.GLOBALOUT,Y),m.dispose=ot,m.init=rt,m.refresh=it,m.resize=st,m.setComponent=et,m.ontooltipHover=tt,m.ondragend=nt,rt(r,i)}return e("../component").define("tooltip",t),t}),r("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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}),r("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),r("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",t),t}),r("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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wa.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}),r("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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),r("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Y(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(D[i],D[i],n,-c),v.scaleAndAdd(D[s],D[s],n,c)}for(var i=0,h=O.length;i>1^-(o&1),u=u>>1^-(u&1),o+=r,u+=i,r=o,i=u,n.push([o/1024,u/1024])}return n}var r={world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],r="",i=e[0],s=e[1];for(var o=0,u=n.length;o180?n-360:n,r=90-(r/e.scale.y+e.offset.y),[n,r]}function o(e,t){return n.offset=e.offset,n.scale=e.scale,t instanceof Array?n.makePoint([t[0]*1,t[1]*1]):n.makePoint([t.x*1,t.y*1])}var n={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,r=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxr&&(t.xmin=r),t.xmaxi&&(t.ymin=i),t.ymax10?n[L][g].value=Math.round(n[L][g].value):n[L][g].value=n[L][g].value.toFixed(2)-0;y[L]=y[L]||{},y[L].mapData?P(L,n[L],a[L])(y[L].mapData):x[L.replace(/\|.*/,"")].getGeoJson&&(w[L]=x[L.replace(/\|.*/,"")].specialArea||w[L],x[L.replace(/\|.*/,"")].getGeoJson(P(L,n[L],a[L])))}}function P(e,t,r){return function(i){e.indexOf("|")!=-1&&(i=H(e,i)),y[e].mapData=i,q(e,B(e,i,r),t,r);if(--S<=0){for(var s=0,o=h.shapeList.length;s1&&(r={geometry:{coordinates:r.geometry.coordinates.slice(5,6),type:r.geometry.type},id:r.id,properties:r.properties,type:r.type});break}return{type:"FeatureCollection",features:[r]}}function B(t,n,r){var i=e("../util/projection/normal"),s=[],o=y[t].bbox||i.getBbox(n,w[t]),u;y[t].hasRoam?u=y[t].transform:u=I(o,r);var a=y[t].lastTransform||{scale:{}},f;u.left!=a.left||u.top!=a.top||u.scale.x!=a.scale.x||u.scale.y!=a.scale.y?(f=i.geoJson2Path(n,u,w[t]),a=l.clone(u)):(u=y[t].transform,f=y[t].pathArray),y[t].bbox=o,y[t].transform=u,y[t].lastTransform=a,y[t].pathArray=f;var c=[u.left,u.top];for(var h=0,p=f.length;hv?(d=v*.75,l=h*d):(v=d,d=v*.75,c=p*v);var m={OffsetLeft:a[0],OffsetTop:a[1],scale:{x:d,y:v}},g=o.geoJson2Path(n,m);return F(t,g[0],s)}function F(e,t,n){var r,i=t.properties.name;return N[i]?r=Z(e,N[i]):t.cp&&(r=[t.cp[0],t.cp[1]]),T[i]&&(r[0]+=T[i][0],r[1]+=T[i][1]),{text:R(e,i),path:t.path,position:n,textX:r[0],textY:r[1]}}function I(e,t){var r,i,s,o,u,a,f,l=n.getWidth(),c=n.getHeight(),d=Math.round(Math.min(l,c)*.02);for(var v in t)r=p[v].mapLocation,s=r.x||s,u=r.y||u,a=r.width||a,f=r.height||f;i=h.parsePercent(s,l),i=isNaN(i)?d:i,o=h.parsePercent(u,c),o=isNaN(o)?d:o,typeof a=="undefined"?a=isNaN(s)?l-2*d:l-i-2*d:a=h.parsePercent(a,l),typeof f=="undefined"?f=isNaN(u)?c-2*d:c-o-2*d:f=h.parsePercent(f,c);var m=e.width,g=e.height,y=a/.75/m,b=f/g;y>b?(y=b*.75,a=m*y):(b=y,y=b*.75,f=g*b);if(isNaN(s))switch(s+""){case"center":i=Math.floor((l-a)/2);break;case"right":i=l-a;break;default:}if(isNaN(u))switch(u+""){case"center":o=Math.floor((c-f)/2);break;case"bottom":o=c-f;break;default:}return{left:i,top:o,width:a,height:f,scale:{x:y,y:b}}}function q(e,t,n,r){var s=i.legend,o=i.dataRange,f,c,y,b,w,E=u.map,S,x,T,N,C,k;for(var L=0,A=t.length;L=r&&e<=r+s&&t>=i&&t<=i+o)return u}return}function W(e){var t=e.event,n=c.getX(t),r=c.getY(t),i=c.getDelta(t),s=z(n,r);if(s){var o=y[s].transform,u=o.left,a=o.top,f=o.width,l=o.height;geoAndPos=Y(s,[n-u,r-a]),i>0?(i=1.2,o.scale.x*=i,o.scale.y*=i,o.width=f*i,o.height=l*i):(i=1.2,o.scale.x/=i,o.scale.y/=i,o.width=f/i,o.height=l/i),y[s].hasRoam=!0,y[s].transform=o,geoAndPos=Z(s,geoAndPos),o.left-=geoAndPos[0]-(n-u),o.top-=geoAndPos[1]-(r-a),y[s].transform=o,clearTimeout(E),E=setTimeout(Q,100),c.stop(t)}}function X(e){var t=e.target;if(t&&t.draggable)return;var r=e.event,i=c.getX(r),s=c.getY(r),o=z(i,s);o&&(O=!0,L=i,A=s,_=o,setTimeout(function(){n.on(f.EVENT.MOUSEMOVE,V),n.on(f.EVENT.MOUSEUP,$)},50))}function V(e){if(!O||!h)return;var t=e.event,r=c.getX(t),i=c.getY(t),s=y[_].transform;s.hasRoam=!0,s.left-=L-r,s.top-=A-i,L=r,A=i,y[_].transform=s;var o=[s.left,s.top],u={position:[s.left,s.top]};for(var a=0,f=h.shapeList.length;a0&&b(l,e[l]);for(var u=0,f=c.shapeList.length;u0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}p=f.getCoord(E),E>=0?(v-=m-p,p=v):E<0&&(g+=p-y,p=g),b[n].push([l,p,S,u.getNameByIndex(S),l,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"horizontal")}function S(e,t){var n=t[0][0],r=h[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,l,p,v,m,g,y,b={},w,E;for(var S=0,T=e;S0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}l=f.getCoord(E),E>=0?(v+=l-m,l=v):E<0&&(g-=y-l,l=g),b[n].push([l,p,S,u.getNameByIndex(S),m,p])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"vertical")}function x(e,t,n){var r,s,o,u,a,f,d,m,g,y,b,w;for(var E=h.length-1;E>=0;E--){g=h[E],b=e[E];if(g.type==c.type&&typeof b!="undefined"){r=v[E],s=c.deepQuery([g],"itemStyle.normal.lineStyle.width"),o=c.deepQuery([g],"itemStyle.normal.lineStyle.type"),u=c.deepQuery([g],"itemStyle.normal.lineStyle.color"),a=c.deepQuery([g],"itemStyle.normal.color"),f=c.deepQuery([g],"itemStyle.emphasis.color"),d=typeof c.deepQuery([g],"itemStyle.normal.areaStyle")!="undefined",m=c.deepQuery([g],"itemStyle.normal.areaStyle.color");for(var S=0,x=b.length;S=0;n--){f=c.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(c.shapeList[n]._main){l=c.shapeList[n].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),p=c.shapeList[n]._orient=="horizontal";if(t[f][2]){if(c.shapeList[n].shape=="polygon"){var d=l.length;c.shapeList[n].style.pointList[d-3]=l[d-2],p?c.shapeList[n].style.pointList[d-3][0]=l[d-4][0]:c.shapeList[n].style.pointList[d-3][1]=l[d-4][1],c.shapeList[n].style.pointList[d-2]=l[d-1]}c.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{c.shapeList[n].style.pointList.shift();if(c.shapeList[n].shape=="polygon"){var v=c.shapeList[n].style.pointList.pop();p?v[0]=l[0][0]:v[1]=l[0][1],c.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(c.shapeList[n].id,{style:{pointList:c.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&c.shapeList[n]._dataIndex==h[f].data.length-1){r.delShape(c.shapeList[n].id);continue}if(!t[f][2]&&c.shapeList[n]._dataIndex===0){r.delShape(c.shapeList[n].id);continue}}r.animate(c.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=c.deepQuery([i],"animationDuration"),t=c.deepQuery([i],"animationEasing"),n,s,o,u=0;for(var a=0,f=c.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(E=N-x,B==1&&y[n]>E&&(E=y[n]),T-=E,x=T):O<0?(E=x-k,B==1&&y[n]>E&&(E=y[n]),x=C,C+=E):(E=N-x,T-=E,x=T),L=w(n,M,a.getNameByIndex(M),S,x,m[n]||g,E,"vertical"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H0?(E=S-N,B==1&&y[n]>E&&(E=y[n]),S=T,T+=E):O<0?(E=k-S,B==1&&y[n]>E&&(E=y[n]),C-=E,S=C):(E=S-N,S=T,T+=E),L=w(n,M,a.getNameByIndex(M),S,x-(m[n]||g),E,m[n]||g,"horizontal"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t){i=t,S(e)}function S(e){e&&(r=e,c=r.series),l.clear(),d()}function x(e){var t={};for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function T(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(t){if(d(f,t)){var n=f[t];delete f[t],c[t]=!0,i.apply(e,n)}if(!d(a,t)&&!d(c,t))throw new Error("No "+t);return a[t]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var i,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},i=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1},labelLine:{show:!1,length:30,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},hoverable:!0,itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},markPoint:{symbol:"pin",symbolSize:10,itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{symbol:["circle","arrow"],symbolSize:[2,4],itemStyle:{normal:{borderWidth:2,label:{show:!1,position:"inside",textStyle:{color:"#333"}},lineStyle:{type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,animationThreshold:2500,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),r("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),r("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),r("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),r("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),r("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),r("zrender/tool/area",["require","../tool/util","../shape"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),r("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,d;if(typeof t.pointList!="undefined"){var v=t.pointList;if(v.length<2)return;var m=v.length;switch(a){case"start":l=v[0][0],c=v[1][0],h=v[0][1],d=v[1][1];break;case"end":l=v[m-2][0],c=v[m-1][0],h=v[m-2][1],d=v[m-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,d=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function b(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:v,getHighlightZoom:m,drift:g,isCover:y,updateTransform:b},t}),r("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),r("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),r("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),r("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),r("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),r("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function n(){this.type="text"}var t=e("../tool/area");n.prototype={brush:function(e,n,r){var i=n.style||{};r&&(i=this.getHighlightStyle(i,n.highlightStyle||{}));if(typeof i.text=="undefined")return;e.save(),this.setContext(e,i),n.__needTransform&&e.transform.apply(e,this.updateTransform(n)),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var s=(i.text+"").split("\n"),o=t.getTextHeight("国",i.textFont),u=this.getRect(i),a=i.x,f;i.textBaseline=="top"?f=u.y:i.textBaseline=="bottom"?f=u.y+o:f=u.y+o/2;for(var l=0,c=s.length;l0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),r("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),r("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),r("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=this._clips,n=t.length,r=[],i=[];for(var s=0;s=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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){if(e.lenth<1)return;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}),r("zrender",["zrender/zrender"],function(e){return e}),r("echarts/util/shape/icon",["require","zrender/tool/matrix","zrender/shape","zrender/shape","zrender/shape","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,arrow:y,star:b,heart:w,droplet:E,pin:S,image:x}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){var r=e("zrender/shape").get("heart");r.buildPath(t,{x:n.x+n.width/2,y:n.y+n.height*.2,a:n.width/2,b:n.height*.8})}function E(t,n){var r=e("zrender/shape").get("droplet");r.buildPath(t,{x:n.x+n.width*.5,y:n.y+n.height*.5,a:n.width*.5,b:n.height*.8})}function S(e,t){var n=t.x,r=t.y-t.height/2*1.5,i=t.width/2,s=t.height/2,o=Math.min(i,s);e.arc(n+i,r+s,o,Math.PI/5*4,Math.PI/5),e.lineTo(n+i,r+s+o*1.5)}function x(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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-(e.iconType=="pin"?e.height/2*1.5:0)),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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=o.height<10?4:0;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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}),r("echarts/util/shape/markLine",["require","zrender/tool/matrix","zrender/shape","zrender/shape","zrender/shape/base","zrender/shape"],function(e){function n(){this.type="markLine"}var t=e("zrender/tool/matrix");return n.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildLinePath(e,r),e.stroke(),this.brushSymbol(t,e,r,0),this.brushSymbol(t,e,r,1),typeof r.text!="undefined"&&this.drawText(e,r,t.style),e.restore();return},buildLinePath:function(e,t){var n=t.xStart,r=t.xEnd,i=t.yStart,s=t.yEnd;if(!t.lineType||t.lineType=="solid")e.moveTo(n,i),e.lineTo(r,s);else if(t.lineType=="dashed"||t.lineType=="dotted"){var o=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,n,i,r,s,o)}},brushSymbol:function(n,r,i,s){r.save(),r.beginPath(),r.lineWidth=i.symbolBorder,r.strokeStyle=i.symbolBorderColor,i.iconType=i.symbol[s].replace("empty","").toLowerCase(),i.symbol[s].match("empty")&&(r.fillStyle="rgba(0, 0, 0, 0)");var o=s===0?i.xStart:i.xEnd,u=s===0?i.yStart:i.yEnd,a=typeof i.symbolRotate[s]!="undefined"?i.symbolRotate[s]-0:0,f;a!==0&&(f=t.create(),t.identity(f),(o||u)&&t.translate(f,f,[-o,-u]),t.rotate(f,f,a*Math.PI/180),(o||u)&&t.translate(f,f,[o,u]),r.transform.apply(r,f));if(i.iconType=="arrow"&&a===0)this.buildArrawPath(r,i,s);else{var l=i.symbolSize[s];i.x=o-l,i.y=u-l,i.width=l*2,i.height=l*2,e("zrender/shape").get("icon").buildPath(r,i)}r.closePath(),r.stroke(),r.fill(),r.restore()},buildArrawPath:function(e,t,n){var r=t.symbolSize[n],i=t.xStart,s=t.xEnd,o=t.yStart,u=t.yEnd,a=Math.atan(Math.abs((u-o)/(i-s)));n===0?s>i?u>o&&(a=Math.PI*2-a):u>o?a+=Math.PI:a=Math.PI-a:i>s?o>u&&(a=Math.PI*2-a):o>u?a+=Math.PI:a=Math.PI-a;var f=Math.PI/8,l=n===0?i:s,c=n===0?o:u,h=[[l+r*Math.cos(a-f),c-r*Math.sin(a-f)],[l+r*.6*Math.cos(a),c-r*.6*Math.sin(a)],[l+r*Math.cos(a+f),c-r*Math.sin(a+f)]];e.moveTo(l,c);for(var p=0,d=h.length;p1?o.symbol:[o.symbol[0],o.symbol[0]]:[o.symbol,o.symbol],o.symbolSize=o.symbolSize instanceof Array?o.symbolSize.length>1?o.symbolSize:[o.symbolSize[0],o.symbolSize[0]]:[o.symbolSize,o.symbolSize],o.symbolRotate=o.symbolRotate instanceof Array?o.symbolRotate.length>1?o.symbolRotate:[o.symbolRotate[0],o.symbolRotate[0]]:[o.symbolRotate,o.symbolRotate],o.name=e.name;var a=[],f=o.data,l,c=u.dataRange,h=u.legend,p,d,v,m,g,y=s.zr.getWidth(),b=s.zr.getHeight();for(var w=0,E=f.length;w0?-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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}return e("../chart").define("island",t),t}),r("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}),r("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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}function k(e){return typeof r.data[e].value!="undefined"?r.data[e].value:r.data[e]}function L(e){var t=r.data,n=t.length;for(var i=0;i0?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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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}),r("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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),r("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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);var l;for(var c=0,h=t.length;c=s&&l[0]<=o&&l[1]>=u&&l[1]<=a&&n.push(t[c]);return n}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(t){if(typeof u.query(t,"dataRange.min")=="undefined"||typeof u.query(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||e0&&(n.delShape(j.tipShape),j=!1),e&&n.refresh()}function U(e,t,n){var r=T.offsetHeight,i=T.offsetWidth;e+i>B&&(e=B-i),t+r>H&&(t=H-r),t<20&&(t=0),T.style.cssText=N+C+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(B-e<100||H-t<100)&&setTimeout(z,20)}function z(){if(T){var e="",t=T.offsetHeight,n=T.offsetWidth;T.offsetLeft+n>B&&(e+="left:"+(B-n)+"px;"),T.offsetTop+t>H&&(e+="top:"+(H-t)+"px;"),e!==""&&(T.style.cssText+=e)}}function W(){var e,t;if(!_)V()||X();else{if(_._type=="island"&&r.tooltip.show){Q();return}var n=u.get(_,"series"),i=u.get(_,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(L),clearTimeout(O),L=setTimeout(R,A)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?J(n.xAxisIndex,n.yAxisIndex,u.get(_,"dataIndex")):Q())}}function X(){if(!w||!E){L=setTimeout(R,A);return}var e=r.series,t,n;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 J(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(L),clearTimeout(O),L=setTimeout(R,A);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var S=0,x=u.length;S0){var N;if(typeof d=="function"){var C=[];for(var S=0,x=a.length;S"+ct(a[S].name||"")+" : ",N=a[S].data[s],N=typeof N!="undefined"?typeof N.value!="undefined"?N.value:N:"-",d+=N;T.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(h,p,g)}}function K(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}var f=r.polar[e].indicator[t].text;for(var c=0,h=n.length;c0){var p,d,v=[];for(var c=0,h=s.length;c"+ct(v[0][3])+" : "+v[0][2];for(var c=1,h=v.length;c"+ct(v[c][1])+"
    ",o+=ct(v[c][3])+" : "+v[c][2];T.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D),l.getY(D),a),!0}}function Q(){var e=u.get(_,"series"),t=u.get(_,"data"),s=u.get(_,"name"),a=u.get(_,"value"),f=u.get(_,"special"),c=u.get(_,"special2"),h,p,d="",v,g="";_._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.query(e,"tooltip.trigger")=="item"&&(p=m.query(e,"tooltip.showContent")||p,h=m.query(e,"tooltip.formatter")||h,d+=q(m.query(e,"tooltip"))),p=m.query(t,"tooltip.showContent")||p,h=m.query(t,"tooltip.formatter")||h,d+=q(m.query(t,"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")P=(e.name||"")+":"+u.get(_,"dataIndex"),T.innerHTML=h([e.name||"",s,a,f,c],P,et);else if(typeof h=="string")P=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ct(e.name||"")).replace("{b0}",ct(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(_,"special2")||""),T.innerHTML=h;else{P=NaN;if(e.type==o.CHART_TYPE_SCATTER)T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
    ":"")+(s===""?"":ct(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR&&f){v=f,g+=ct(s===""?e.name||"":s),g+=g===""?"":"
    ";for(var y=0;y";T.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")T.innerHTML=ct(s)+" ("+a+")";else{var b=ct(s),w=ct(f);T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
    ":"")+b+" -> "+w+" ("+a+")"+"
    "+w+" -> "+b+" ("+c+")"}else T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
    ":"")+ct(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}F.invisible||(F.invisible=!0,n.modShape(F.id,F),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D)+20,l.getY(D)-20,d)}function G(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yB&&(n+="left:"+(B-i)+"px;"),T.offsetTop+r>H&&(n+="top:"+(H-r)+"px;"),n!==""&&(T.style.cssText+=n),(B-T.offsetLeft<100||H-T.offsetTop<100)&&setTimeout(z,20)}function tt(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function nt(e,t){if(!j||j&&j.dataIndex!=e.dataIndex){j&&j.tipShape.length>0&&n.delShape(j.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x={},T=document.createElement("div"),N="position:absolute;display:block;border-style:solid;white-space:nowrap;",C,k,L,A,O,M,_,D,P,H=n.getHeight(),B=n.getWidth(),j=!1,F={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},I={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(F),n.addShape(I),n.on(a.EVENT.MOUSEMOVE,Y),n.on(a.EVENT.GLOBALOUT,Z),m.dispose=lt,m.init=ut,m.refresh=at,m.resize=ft,m.setComponent=tt,m.ontooltipHover=nt,m.ondragend=rt,m.onlegendSelected=it,ut(r,i)}return e("../component").define("tooltip",t),t}),r("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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.query(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.query(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}),r("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),r("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",t),t}),r("echarts/echarts",["require","./config","zrender","zrender/tool/util","zrender/tool/event","zrender/config","./util/shape/icon","./util/shape/markLine","./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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wt.largeThreshold){f.shapeList.push(b(n,f.query(t,"itemStyle.normal.color")||h[s]));continue}for(var o=0,u=n.length;o1e-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}),r("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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),r("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Z(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(P[i],P[i],n,-c),v.scaleAndAdd(P[s],P[s],n,c)}for(var i=0,h=M.length;i>1^-(o&1),u=u>>1^-(u&1),o+=r,u+=i,r=o,i=u,n.push([o/1024,u/1024])}return n}var r={world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],r="",i=e[0],s=e[1];for(var o=0,u=n.length;o180?n-360:n,r=90-(r/e.scale.y+e.offset.y),[n,r]}function o(e,t){return n.offset=e.offset,n.scale=e.scale,t instanceof Array?n.makePoint([t[0]*1,t[1]*1]):n.makePoint([t.x*1,t.y*1])}var n={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,r=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxr&&(t.xmin=r),t.xmaxi&&(t.ymin=i),t.ymax10?n[A][y].value=Math.round(n[A][y].value):n[A][y].value=n[A][y].value.toFixed(2)-0;b[A]=b[A]||{},b[A].mapData?B(A,n[A],a[A])(b[A].mapData):T[A.replace(/\|.*/,"")].getGeoJson&&(E[A]=T[A.replace(/\|.*/,"")].specialArea||E[A],T[A.replace(/\|.*/,"")].getGeoJson(B(A,n[A],a[A])))}}function B(e,t,i){return function(s){e.indexOf("|")!=-1&&(s=j(e,s)),b[e].mapData=s,U(e,F(e,s,i),t,i),z(e,i);if(--x<=0){for(var o=0,u=h.shapeList.length;o1&&(r={geometry:{coordinates:r.geometry.coordinates.slice(5,6),type:r.geometry.type},id:r.id,properties:r.properties,type:r.type});break}return{type:"FeatureCollection",features:[r]}}function F(t,n,r){var i=e("../util/projection/normal"),s=[],o=b[t].bbox||i.getBbox(n,E[t]),u;b[t].hasRoam?u=b[t].transform:u=R(o,r);var a=b[t].lastTransform||{scale:{}},f;u.left!=a.left||u.top!=a.top||u.scale.x!=a.scale.x||u.scale.y!=a.scale.y?(f=i.geoJson2Path(n,u,E[t]),a=l.clone(u)):(u=b[t].transform,f=b[t].pathArray),b[t].bbox=o,b[t].transform=u,b[t].lastTransform=a,b[t].pathArray=f;var c=[u.left,u.top];for(var h=0,p=f.length;hv?(d=v*.75,l=h*d):(v=d,d=v*.75,c=p*v);var m={OffsetLeft:a[0],OffsetTop:a[1],scale:{x:d,y:v}},g=o.geoJson2Path(n,m);return q(t,g[0],s)}function q(e,t,n){var r,i=t.properties.name;return C[i]?r=it(e,C[i]):t.cp&&(r=[t.cp[0],t.cp[1]]),N[i]&&(r[0]+=N[i][0],r[1]+=N[i][1]),{text:X(e,i),path:t.path,position:n,textX:r[0],textY:r[1]}}function R(e,t){var r,i,s,o,u,a,f,l=n.getWidth(),c=n.getHeight(),d=Math.round(Math.min(l,c)*.02);for(var v in t)r=p[v].mapLocation,s=r.x||s,u=r.y||u,a=r.width||a,f=r.height||f;i=h.parsePercent(s,l),i=isNaN(i)?d:i,o=h.parsePercent(u,c),o=isNaN(o)?d:o,typeof a=="undefined"?a=isNaN(s)?l-2*d:l-i-2*d:a=h.parsePercent(a,l),typeof f=="undefined"?f=isNaN(u)?c-2*d:c-o-2*d:f=h.parsePercent(f,c);var m=e.width,g=e.height,y=a/.75/m,b=f/g;y>b?(y=b*.75,a=m*y):(b=y,y=b*.75,f=g*b);if(isNaN(s))switch(s+""){case"center":i=Math.floor((l-a)/2);break;case"right":i=l-a;break;default:}if(isNaN(u))switch(u+""){case"center":o=Math.floor((c-f)/2);break;case"bottom":o=c-f;break;default:}return{left:i,top:o,width:a,height:f,scale:{x:y,y:b}}}function U(e,t,n,r){var s=i.legend,o=i.dataRange,f,c,b,w,E,S=u.map,x,T,N,C,k,L;for(var A=0,O=t.length;A=r&&e<=r+s&&t>=i&&t<=i+o)return u}return}function J(e){var n=e.event,r=c.getX(n),i=c.getY(n),s=c.getDelta(n),o=$(r,i);if(o){var a=b[o].transform,f=a.left,l=a.top,h=a.width,p=a.height;geoAndPos=nt(o,[r-f,i-l]),s>0?(s=1.2,a.scale.x*=s,a.scale.y*=s,a.width=h*s,a.height=p*s):(s=1.2,a.scale.x/=s,a.scale.y/=s,a.width=h/s,a.height=p/s),b[o].hasRoam=!0,b[o].transform=a,geoAndPos=it(o,geoAndPos),a.left-=geoAndPos[0]-(r-f),a.top-=geoAndPos[1]-(i-l),b[o].transform=a,clearTimeout(S),S=setTimeout(et,100),t.dispatch(u.EVENT.MAP_ROAM,e.event,{type:"scale"}),c.stop(n)}}function K(e){var t=e.target;if(t&&t.draggable)return;var r=e.event,i=c.getX(r),s=c.getY(r),o=$(i,s);o&&(M=!0,A=i,O=s,D=o,setTimeout(function(){n.on(f.EVENT.MOUSEMOVE,Q),n.on(f.EVENT.MOUSEUP,G)},50))}function Q(e){if(!M||!h)return;var r=e.event,i=c.getX(r),s=c.getY(r),o=b[D].transform;o.hasRoam=!0,o.left-=A-i,o.top-=O-s,A=i,O=s,b[D].transform=o;var a=[o.left,o.top],f={position:[o.left,o.top]};for(var l=0,p=h.shapeList.length;l0&&y(h,e[h]);for(var u=0,f=l.shapeList.length;u0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}d=f.getCoord(E),E>=0?(v-=m-d,d=v):E<0&&(g+=d-y,d=g),b[n].push([h,d,x,u.getNameByIndex(x),h,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"horizontal")}function E(e,t){var n=t[0][0],r=c[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,h,d,v,m,g,y,b={},w,E;for(var x=0,N=e;x0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}h=f.getCoord(E),E>=0?(v+=h-m,h=v):E<0&&(g-=y-h,h=g),b[n].push([h,d,x,u.getNameByIndex(x),m,d])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"vertical")}function S(e,t,n){var r,s,o,u,a,p,v,m,g,y,b;for(var w=c.length-1;w>=0;w--){m=c[w],y=e[w];if(m.type==l.type&&typeof y!="undefined"){r=d[w],s=l.query(m,"itemStyle.normal.lineStyle.width"),o=l.query(m,"itemStyle.normal.lineStyle.type"),u=l.query(m,"itemStyle.normal.lineStyle.color"),a=l.query(m,"itemStyle.normal.color"),p=typeof l.query(m,"itemStyle.normal.areaStyle")!="undefined",v=l.query(m,"itemStyle.normal.areaStyle.color");for(var E=0,S=y.length;E=0;n--){f=l.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(l.shapeList[n]._main){h=l.shapeList[n].style.pointList,o=Math.abs(h[0][0]-h[1][0]),a=Math.abs(h[0][1]-h[1][1]),p=l.shapeList[n]._orient=="horizontal";if(t[f][2]){if(l.shapeList[n].shape=="polygon"){var d=h.length;l.shapeList[n].style.pointList[d-3]=h[d-2],p?l.shapeList[n].style.pointList[d-3][0]=h[d-4][0]:l.shapeList[n].style.pointList[d-3][1]=h[d-4][1],l.shapeList[n].style.pointList[d-2]=h[d-1]}l.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{l.shapeList[n].style.pointList.shift();if(l.shapeList[n].shape=="polygon"){var v=l.shapeList[n].style.pointList.pop();p?v[0]=h[0][0]:v[1]=h[0][1],l.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(l.shapeList[n].id,{style:{pointList:l.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&l.shapeList[n]._dataIndex==c[f].data.length-1){r.delShape(l.shapeList[n].id);continue}if(!t[f][2]&&l.shapeList[n]._dataIndex===0){r.delShape(l.shapeList[n].id);continue}}r.animate(l.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=l.query(i,"animationDuration"),t=l.query(i,"animationEasing"),n,s,o,u=0;for(var a=0,f=l.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(x=L-C,I==1&&S[s]>x&&(x=S[s]),k-=x,C=k):D<0?(x=C-O,I==1&&S[s]>x&&(x=S[s]),C=A,A+=x):(x=L-C,k-=x,C=k),M=w(s,P,f.getNameByIndex(P),N,C,g[s]||y,x,"vertical"),T[s]=T[s]||{},T[s][P]=N+(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F0?(x=N-L,I==1&&S[s]>x&&(x=S[s]),N=k,k+=x):D<0?(x=O-N,I==1&&S[s]>x&&(x=S[s]),A-=x,N=A):(x=N-L,N=k,k+=x),M=w(s,P,f.getNameByIndex(P),N,C-(g[s]||y),x,g[s]||y,"horizontal"),T[s]=T[s]||{},T[s][P]=C-(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t,n){for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function C(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(t){if(d(f,t)){var n=f[t];delete f[t],c[t]=!0,i.apply(e,n)}if(!d(a,t)&&!d(c,t))throw new Error("No "+t);return a[t]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var i,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},i=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{lineStyle:{width:2,type:"solid"}},emphasis:{}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1,position:"outer"},labelLine:{show:!1,length:40,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),r("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),r("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),r("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),r("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),r("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),r("zrender/tool/area",["require","../tool/util"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),r("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,p;if(typeof t.pointList!="undefined"){var d=t.pointList;if(d.length<2)return;var v=d.length;switch(a){case"start":l=d[0][0],c=d[1][0],h=d[0][1],p=d[1][1];break;case"end":l=d[v-2][0],c=d[v-1][0],h=d[v-2][1],p=d[v-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,p=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function g(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:p,getHighlightZoom:d,drift:v,isCover:m,updateTransform:g},t}),r("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),r("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),r("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),r("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),r("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),r("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function t(){this.type="text"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";if(r.maxWidth)switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y,r.maxWidth);break;case"stroke":e.strokeText(r.text,r.x,r.y,r.maxWidth);break;case"both":e.strokeText(r.text,r.x,r.y,r.maxWidth),e.fillText(r.text,r.x,r.y,r.maxWidth);break;default:e.fillText(r.text,r.x,r.y,r.maxWidth)}else switch(r.brushType){case"fill":e.fillText(r.text,r.x,r.y);break;case"stroke":e.strokeText(r.text,r.x,r.y);break;case"both":e.strokeText(r.text,r.x,r.y),e.fillText(r.text,r.x,r.y);break;default:e.fillText(r.text,r.x,r.y)}e.restore();return},getRect:function(t){var n=e("../tool/area"),r=n.getTextWidth(t.text,t.textFont),i=n.getTextWidth("国",t.textFont),s=t.x;t.textAlign=="end"||t.textAlign=="right"?s-=r:t.textAlign=="center"&&(s-=r/2);var o=t.y-i/2;return t.textBaseline=="top"?o+=i/2:t.textBaseline=="bottom"&&(s-=i/2),{x:s,y:o,width:r,height:i}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("text",new t),t}),r("zrender/shape/heart",["require","./base","../shape"],function(e){function t(){this.type="heart"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y),e.bezierCurveTo(t.x+t.a/2,t.y-t.b*2/3,t.x+t.a*2,t.y+t.b/3,t.x,t.y+t.b),e.bezierCurveTo(t.x-t.a*2,t.y+t.b/3,t.x-t.a/2,t.y-t.b*2/3,t.x,t.y);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b/4-t/2),width:e.a*2+t,height:e.b*5/4+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("heart",new t),t}),r("zrender/shape/droplet",["require","./base","../shape"],function(e){function t(){this.type="droplet"}t.prototype={buildPath:function(e,t){e.moveTo(t.x,t.y+t.a),e.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+t.a*3/2,t.y-t.a/3,t.x,t.y-t.b),e.bezierCurveTo(t.x-t.a*3/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.a+e.b+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("droplet",new t),t}),r("zrender/shape/path",["require","./base","../shape"],function(e){function t(){this.type="path"}t.prototype={_parsePathData:function(e){if(!e)return[];var t=e,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];t=t.replace(/ /g," "),t=t.replace(/ /g,","),t=t.replace(/,,/g,",");var r;for(r=0;r0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),r("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),r("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),r("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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}),r("zrender",["zrender/zrender"],function(e){return e}),r("echarts/util/shape/icon",["require","zrender/tool/matrix","zrender/shape","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,arrow:y,star:b,image:w}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=5;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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}),r("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}),r("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:case n.CHART_TYPE_CHORD: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 a(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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}return e("../chart").define("island",t),t}),r("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}),r("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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}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}),r("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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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}),r("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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),r("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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 H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(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||e0&&(n.delShape(B.tipShape),B=!1),e&&n.refresh()}function R(e,t,n){var r=x.offsetHeight,i=x.offsetWidth;e+i>H&&(e=H-i),t+r>P&&(t=P-r),t<20&&(t=0),x.style.cssText=T+N+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(H-e<100||P-t<100)&&setTimeout(U,20)}function U(){if(x){var e="",t=x.offsetHeight,n=x.offsetWidth;x.offsetLeft+n>H&&(e+="left:"+(H-n)+"px;"),x.offsetTop+t>P&&(e+="top:"+(P-t)+"px;"),e!==""&&(x.style.cssText+=e)}}function z(){var e,t;if(!M)X()||W();else{if(M._type=="island"&&r.tooltip.show){K();return}var n=u.get(M,"series"),i=u.get(M,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(k),clearTimeout(A),k=setTimeout(q,L)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?$(n.xAxisIndex,n.yAxisIndex,u.get(M,"dataIndex")):K())}}function W(){if(!w||!E){k=setTimeout(q,L);return}var e=r.series,t,n;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 $(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(k),clearTimeout(A),k=setTimeout(q,L);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var y=0,S=u.length;y0){var T;if(typeof d=="function"){var N=[];for(var y=0,S=a.length;y"+ut(a[y].name||"")+" : ",T=a[y].data[s],T=typeof T!="undefined"?typeof T.value!="undefined"?T.value:T:"-",d+=T;x.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(h,p,g)}}function J(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}for(var f=0,c=n.length;f0){var h,p,d=[],v=r.polar[e].indicator[t].text;for(var f=0,c=s.length;f"+ut(d[0][3])+" : "+d[0][2];for(var f=1,c=d.length;f"+ut(d[f][1])+"
    ",o+=ut(d[f][3])+" : "+d[f][2];x.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_),l.getY(_),a),!0}}function K(){var e=u.get(M,"series"),t=u.get(M,"data"),s=u.get(M,"name"),a=u.get(M,"value"),f=u.get(M,"special"),c=u.get(M,"special2"),h,p,d="",v,g="";M._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.deepQuery([e],"tooltip.trigger")=="item"&&(p=m.deepQuery([e],"tooltip.showContent")||p,h=m.deepQuery([e],"tooltip.formatter")||h,d+=I(m.deepQuery([e],"tooltip"))),p=m.deepQuery([t],"tooltip.showContent")||p,h=m.deepQuery([t],"tooltip.formatter")||h,d+=I(m.deepQuery([t],"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")D=(e.name||"")+":"+u.get(M,"dataIndex"),x.innerHTML=h([e.name||"",s,a,f,c],D,Z);else if(typeof h=="string")D=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ut(e.name||"")).replace("{b0}",ut(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(M,"special2")||""),x.innerHTML=h;else{D=NaN;if(e.type==o.CHART_TYPE_SCATTER)x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
    ":"")+(s===""?"":ut(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR){v=f,g+=ut(s===""?e.name||"":s),g+=g===""?"":"
    ";for(var y=0;y";x.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")x.innerHTML=ut(s)+" ("+a+")";else{var b=ut(s),w=ut(f);x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
    ":"")+b+" -> "+w+" ("+a+")"+"
    "+w+" -> "+b+" ("+c+")"}else x.innerHTML=(typeof e.name!="undefined"?ut(e.name)+"
    ":"")+ut(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}j.invisible||(j.invisible=!0,n.modShape(j.id,j),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(x.style.left=H/2+"px",x.style.top=P/2+"px",i.firstChild.appendChild(x),m.hasAppend=!0),R(l.getX(_)+20,l.getY(_)-20,d)}function Q(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yH&&(n+="left:"+(H-i)+"px;"),x.offsetTop+r>P&&(n+="top:"+(P-r)+"px;"),n!==""&&(x.style.cssText+=n),(H-x.offsetLeft<100||P-x.offsetTop<100)&&setTimeout(U,20)}function et(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function tt(e,t){if(!B||B&&B.dataIndex!=e.dataIndex){B&&B.tipShape.length>0&&n.delShape(B.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x=document.createElement("div"),T="position:absolute;display:block;border-style:solid;white-space:nowrap;",N,C,k,L,A,O,M,_,D,P=n.getHeight(),H=n.getWidth(),B=!1,j={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},F={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(j),n.addShape(F),n.on(a.EVENT.MOUSEMOVE,G),n.on(a.EVENT.GLOBALOUT,Y),m.dispose=ot,m.init=rt,m.refresh=it,m.resize=st,m.setComponent=et,m.ontooltipHover=tt,m.ondragend=nt,rt(r,i)}return e("../component").define("tooltip",t),t}),r("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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}),r("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),r("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",t),t}),r("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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wa.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}),r("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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),r("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Y(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(D[i],D[i],n,-c),v.scaleAndAdd(D[s],D[s],n,c)}for(var i=0,h=O.length;i0&&b(l,e[l]);for(var u=0,f=c.shapeList.length;u0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}p=f.getCoord(E),E>=0?(v-=m-p,p=v):E<0&&(g+=p-y,p=g),b[n].push([l,p,S,u.getNameByIndex(S),l,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"horizontal")}function S(e,t){var n=t[0][0],r=h[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,l,p,v,m,g,y,b={},w,E;for(var S=0,T=e;S0&&(d[n]=d[n]||[],d[n].push(b[n]),b[n]=[]);continue}l=f.getCoord(E),E>=0?(v+=l-m,l=v):E<0&&(g-=y-l,l=g),b[n].push([l,p,S,u.getNameByIndex(S),m,p])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(d[M]=d[M]||[],d[M].push(b[M]),b[M]=[]);x(d,u,"vertical")}function x(e,t,n){var r,s,o,u,a,f,d,m,g,y,b,w;for(var E=h.length-1;E>=0;E--){g=h[E],b=e[E];if(g.type==c.type&&typeof b!="undefined"){r=v[E],s=c.deepQuery([g],"itemStyle.normal.lineStyle.width"),o=c.deepQuery([g],"itemStyle.normal.lineStyle.type"),u=c.deepQuery([g],"itemStyle.normal.lineStyle.color"),a=c.deepQuery([g],"itemStyle.normal.color"),f=c.deepQuery([g],"itemStyle.emphasis.color"),d=typeof c.deepQuery([g],"itemStyle.normal.areaStyle")!="undefined",m=c.deepQuery([g],"itemStyle.normal.areaStyle.color");for(var S=0,x=b.length;S=0;n--){f=c.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(c.shapeList[n]._main){l=c.shapeList[n].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),p=c.shapeList[n]._orient=="horizontal";if(t[f][2]){if(c.shapeList[n].shape=="polygon"){var d=l.length;c.shapeList[n].style.pointList[d-3]=l[d-2],p?c.shapeList[n].style.pointList[d-3][0]=l[d-4][0]:c.shapeList[n].style.pointList[d-3][1]=l[d-4][1],c.shapeList[n].style.pointList[d-2]=l[d-1]}c.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{c.shapeList[n].style.pointList.shift();if(c.shapeList[n].shape=="polygon"){var v=c.shapeList[n].style.pointList.pop();p?v[0]=l[0][0]:v[1]=l[0][1],c.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(c.shapeList[n].id,{style:{pointList:c.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&c.shapeList[n]._dataIndex==h[f].data.length-1){r.delShape(c.shapeList[n].id);continue}if(!t[f][2]&&c.shapeList[n]._dataIndex===0){r.delShape(c.shapeList[n].id);continue}}r.animate(c.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=c.deepQuery([i],"animationDuration"),t=c.deepQuery([i],"animationEasing"),n,s,o,u=0;for(var a=0,f=c.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(E=N-x,B==1&&y[n]>E&&(E=y[n]),T-=E,x=T):O<0?(E=x-k,B==1&&y[n]>E&&(E=y[n]),x=C,C+=E):(E=N-x,T-=E,x=T),L=w(n,M,a.getNameByIndex(M),S,x,m[n]||g,E,"vertical"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H0?(E=S-N,B==1&&y[n]>E&&(E=y[n]),S=T,T+=E):O<0?(E=k-S,B==1&&y[n]>E&&(E=y[n]),C-=E,S=C):(E=S-N,S=T,T+=E),L=w(n,M,a.getNameByIndex(M),S,x-(m[n]||g),E,m[n]||g,"horizontal"),l.shapeList.push(L)}for(var H=0,B=t[D].length;H1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t){i=t,S(e)}function S(e){e&&(r=e,c=r.series),l.clear(),d()}function x(e){var t={};for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function T(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(t){if(d(f,t)){var n=f[t];delete f[t],c[t]=!0,i.apply(e,n)}if(!d(a,t)&&!d(c,t))throw new Error("No "+t);return a[t]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var i,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},i=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},areaStyle:{size:"auto",color:"rgba(150,150,150,0.3)"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"#eee",dataBackgroundColor:"#ccc",fillerColor:"rgba(50,205,50,0.4)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",boundaryGap:!0,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},valueAxis:{position:"left",name:"",nameLocation:"end",boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,length:4,lineStyle:{color:"#ccc",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"],type:"default"}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}}},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:1,label:{show:!1}},emphasis:{borderColor:"rgba(0,0,0,0)",borderRadius:0,borderWidth:1,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{label:{show:!0,position:"outer"},labelLine:{show:!0,length:30,lineStyle:{width:1,type:"solid"}}},emphasis:{label:{show:!1},labelLine:{show:!1,length:30,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapLocation:{x:"center",y:"center"},hoverable:!0,itemStyle:{normal:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}},emphasis:{lineStyle:{width:2,color:"#fff"},areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgba(139,69,19,1)"}}}}},force:{minRadius:10,maxRadius:20,density:1,attractiveness:1,initSize:300,centripetal:1,coolDown:.99,categories:[],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab"},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!1,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:2,color:"#333"}}}},matrix:[]},island:{r:15,calculateStep:.1},markPoint:{symbol:"pin",symbolSize:10,itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{symbol:["circle","arrow"],symbolSize:[2,4],itemStyle:{normal:{borderWidth:2,label:{show:!1,position:"inside",textStyle:{color:"#333"}},lineStyle:{type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:5,shadowOffsetX:3,shadowOffsetY:3}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",HOVER:"hover",MOUSEWHEEL:"mousewheel",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover"},calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,animationThreshold:2500,addDataAnimation:!0,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),r("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style;try{n.font=e}catch(r){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:n.fontFamily||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n.size*=.981,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px "+e.family}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n','",""),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),r("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),r("zrender/shape",[],function(){var e={},t={};return e.define=function(n,r){return t[n]=r,e},e.get=function(e){return t[e]},e}),r("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){e[0]=t[0],e[1]=t[1]},set:function(e,t,n){e[0]=t,e[1]=n},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},length:function(e){return Math.sqrt(this.lengthSquare(e))},lengthSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.length(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},negate:function(e,t){e[0]=-t[0],e[1]=-t[1]},middle:function(e,t,n){return e[0]=(t[0]+n[0])/2,e[1]=(t[1]+n[1])/2,e}};return t}),r("zrender/tool/util",["require","./vector","../lib/excanvas"],function(e){function n(e){var t={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},n=e,r,i;if(!e||e instanceof Number||e instanceof String||e instanceof Boolean)return n;if(e instanceof Array){n=[];var s=0;for(r=0,i=e.length;rf&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;ni&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function y(e,t,n,r,i,s){var o=b(e[0],t[0],n[0],r[0]),u=b(e[1],t[1],n[1],r[1]);o.push(e[0],r[0]),u.push(e[1],r[1]);var a=Math.min.apply(null,o),f=Math.max.apply(null,o),l=Math.min.apply(null,u),c=Math.max.apply(null,u);i[0]=a,i[1]=l,s[0]=f,s[1]=c}function b(e,t,n,r){var i=[],s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,a=s*s-4*o*u;if(a>0){var f=Math.sqrt(a),l=(-s+f)/(2*o),c=(-s-f)/(2*o);i.push(l,c)}else a===0&&i.push(-s/(2*o));var h=[];for(var p=0;p1e-4&&d<1&&d>0){var v=1-d,m=v*v*v*e+3*v*v*d*t+3*v*d*d*n+d*d*d*r;h.push(m)}}return h}function w(e,t,n,r,i){var s=e[0]+n[0]-2*t[0],o;s===0?o=.5:o=(e[0]-t[0])/s,s=e[1]+n[1]-2*t[1];var u;s===0?u=.5:u=(e[1]-t[1])/s,o=Math.max(Math.min(o,1),0),u=Math.max(Math.min(u,1),0);var a=1-o,f=1-u,l=a*a*e[0]+2*a*o*t[0]+o*o*n[0],c=a*a*e[1]+2*a*o*t[1]+o*o*n[1],h=f*f*e[0]+2*f*u*t[0]+u*u*n[0],p=f*f*e[1]+2*f*u*t[1]+u*u*n[1];return g([e.slice(),n.slice(),[l,c],[h,p]],r,i)}var t=e("./vector"),r=function(){function t(t,n,i,s,o){if(n.hasOwnProperty(i))if(o&&typeof t[i]=="object"&&e[Object.prototype.toString.call(t[i])]!=1)r(t[i],n[i],{overwrite:s,recursive:o});else if(s||!(i in t))t[i]=n[i]}var e={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1};return function(e,n,r){var i=0,s=r||{},o=s.overwrite,u=s.whiteList,a=s.recursive,f;if(u&&u.length){f=u.length;for(;iu&&(u+=Math.PI*2);var c=0;for(var h=0;ho){var p=r[c++];p[0]=Math.cos(h),p[1]=Math.sin(h)*a,t.scale(p,p,s),t.add(p,p,i)}var d=r.slice(0,c);d.push(e,n),g(d,f,l)}}();return{clone:n,merge:r,mergeFast:i,getContext:o,getPixelContext:p,getPixelOffset:v,adjustCanvasSize:d,computeBoundingBox:g,computeCubeBezierBoundingBox:y,computeQuadraticBezierBoundingBox:w,computeArcBoundingBox:E,indexOf:m}}),r("zrender/tool/area",["require","../tool/util","../shape"],function(e){function r(e,r,u,a){if(!r||!e)return!1;var f=e.type;n||(n=t.getContext());if(!h(r.__rect||e.getRect(r),u,a))return!1;var l=i(f,r,u,a);if(typeof l!="undefined")return l;if(f!="beziercurve"&&e.buildPath&&n.isPointInPath)return s(e,n,r,u,a);if(n.getImageData)return o(e,r,u,a);switch(f){case"heart":return!0;case"droplet":return!0;case"ellipse":return!0;case"trochoid":var c=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return p(r,u,a,c);case"rose":return p(r,u,a,r.maxr);default:return!1}}function i(e,t,n,r){switch(e){case"line":return f(t,n,r);case"brokenLine":return l(t,n,r);case"text":return!0;case"ring":return c(t,n,r);case"rectangle":return!0;case"circle":return p(t,n,r,t.r);case"sector":return d(t,n,r);case"path":return m(t,n,r);case"polygon":case"star":case"isogon":return v(t,n,r);case"image":return!0}}function s(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function o(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),a=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),u(o,r+a.x,i+a.y)}function u(e,t,n,r){var i;typeof r!="undefined"?(r=Math.floor((r||1)/2),i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function a(e,t,n,i){return!r(e,t,n,i)}function f(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,3),a=0,f=r;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var l=(a*t-n+f)*(a*t-n+f)/(a*a+1);return l<=u/2*u/2}function l(e,t,n){var r=e.pointList,i,s=!1;for(var o=0,u=r.length-1;o=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height?!0:!1}function p(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&p({x:e.x,y:e.y},t,n,e.r0))return!1;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function v(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return e=q(e.slice(0,3),function(e){return e=Number(e).toString(16),e.length===1?"0"+e:e}),"#"+e.join("");if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("#")>-1&&(e=x(e));var t=e.replace(/[rgbahsvl%\(\)]/ig,"").split(",");return t=q(t,function(e){return Number(e)}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return e=String(e),e=e.replace(/(^\s*)|(\s*$)/g,""),/^[^#]*?$/i.test(e)&&(e=e.replace(/\s/g,"")),e}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[0-9a-f]{3}$/i.test(e)){var t=e.replace("#","").split("");e="#"+t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=Math.floor(r[i]*(1-t)):r[i]=Math.floor((255-r[i])*t+r[i]);return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return T("rgb("+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+","+Math.round(Math.random()*256)+")")}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=Math.floor(u),f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),r("zrender/shape/base",["require","../tool/area","../tool/matrix","../tool/vector","../tool/color"],function(e){function s(e){var n=["brush","setContext","dashedLineTo","smoothBezier","smoothSpline","drawText","getHighlightStyle","getHighlightZoom","drift","isCover","updateTransform"],r=n.length,i=e.prototype,s=0,o;for(;sn-2?n-1:f+1],v=e[f>n-3?n-1:f+2]);var m=l*l,g=l*m;r.push([c(h[0],p[0],d[0],v[0],l,m,g),c(h[1],p[1],d[1],v[1],l,m,g)])}return r}function c(e,t,n,r,i,s,o){var u=(n-e)*.5,a=(r-t)*.5;return(2*(t-n)+u+a)*o+(-3*(t-n)-2*u-a)*s+u*i+t}function h(e,t,n){t.textColor=t.textColor||t.color||t.strokeColor,e.fillStyle=t.textColor,t.textPosition=="inside"&&(e.shadowColor="rgba(0,0,0,0)");var r=10,i,s,o,u,a=t.textPosition||this.textPosition||"top";if(a!="inside"&&a!="top"&&a!="bottom"&&a!="left"&&a!="right"||!this.getRect)if(a=="start"||a=="end"){var l,c,h,d;if(typeof t.pointList!="undefined"){var v=t.pointList;if(v.length<2)return;var m=v.length;switch(a){case"start":l=v[0][0],c=v[1][0],h=v[0][1],d=v[1][1];break;case"end":l=v[m-2][0],c=v[m-1][0],h=v[m-2][1],d=v[m-1][1]}}else l=t.xStart||0,c=t.xEnd||0,h=t.yStart||0,d=t.yEnd||0;switch(a){case"start":i=l1e-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),t=o[0],i=o[1]}var u;return e.style.__rect?u=e.style.__rect:(u=this.getRect(e.style),e.style.__rect=u),t>=u.x&&t<=u.x+u.width&&i>=u.y&&i<=u.y+u.height?n.isInside(this,e.style,t,i):!1}function b(e){var t=e._transform||r.create();r.identity(t);if(e.scale&&(e.scale[0]!==1||e.scale[1]!==1)){var n=e.scale[2]||0,i=e.scale[3]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.scale(t,t,e.scale),(n||i)&&r.translate(t,t,[n,i])}if(e.rotation)if(e.rotation instanceof Array){if(e.rotation[0]!==0){var n=e.rotation[1]||0,i=e.rotation[2]||0;(n||i)&&r.translate(t,t,[-n,-i]),r.rotate(t,t,e.rotation[0]),(n||i)&&r.translate(t,t,[n,i])}}else e.rotation!==0&&r.rotate(t,t,e.rotation);return e.position&&(e.position[0]!==0||e.position[1]!==0)&&r.translate(t,t,e.position),e._transform=t,t}var t,n=e("../tool/area"),r=e("../tool/matrix"),i=e("../tool/vector");return t={derive:s,brush:o,setContext:u,dashedLineTo:a,smoothBezier:f,smoothSpline:l,drawText:h,getHighlightStyle:v,getHighlightZoom:m,drift:g,isCover:y,updateTransform:b},t}),r("zrender/shape/circle",["require","./base","../shape"],function(e){function t(){this.type="circle"}t.prototype={buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("circle",new t),t}),r("zrender/shape/ellipse",["require","./base","../shape"],function(e){function t(){this.type="ellipse"}t.prototype={buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i);return},getRect:function(e){var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,{x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("ellipse",new t),t}),r("zrender/shape/line",["require","./base","../shape"],function(e){function t(){this.type="line",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){if(!t.lineType||t.lineType=="solid")e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd);else if(t.lineType=="dashed"||t.lineType=="dotted"){var n=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}},getRect:function(e){var t=e.lineWidth||1;return{x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("line",new t),t}),r("zrender/shape/polygon",["require","./base","../shape"],function(e){function t(){this.type="polygon"}t.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildPath(e,r),e.closePath(),(r.brushType=="stroke"||r.brushType=="both")&&e.stroke();if(r.brushType=="fill"||r.brushType=="both"||typeof r.brushType=="undefined"){if(r.lineType=="dashed"||r.lineType=="dotted")e.beginPath(),this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}),e.closePath();e.fill()}r.text&&this.drawText(e,r,t.style),e.restore();return},buildPath:function(e,t){var n=t.pointList,r=n[0],i=n[n.length-1];r&&i&&r[0]==i[0]&&r[1]==i[1]&&n.pop();if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var s=this.smoothBezier(n,t.smooth,!0);e.moveTo(n[0][0],n[0][1]);var o,u,a,f=n.length;for(var l=0;ln&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,{x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("polygon",new t),t}),r("zrender/shape/brokenLine",["require","../shape","./base","../shape"],function(e){function t(){this.type="brokenLine",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){var n=t.pointList;if(n.length<2)return;if(t.smooth&&t.smooth!=="spline"){var r=this.smoothBezier(n,t.smooth,!1);e.moveTo(n[0][0],n[0][1]);var i,s,o;for(var u=0,a=n.length;u90&&f.push([r,i-o]),u<180&&a>180&&f.push([r-o,i]),u<270&&a>270&&f.push([r,i+o]),u<360&&a>360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]);var l=e("../shape");return l.get("polygon").getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f})}};var r=e("./base");r.derive(n);var i=e("../shape");return i.define("sector",new n),n}),r("zrender/shape/text",["require","../tool/area","./base","../shape"],function(e){function n(){this.type="text"}var t=e("../tool/area");n.prototype={brush:function(e,n,r){var i=n.style||{};r&&(i=this.getHighlightStyle(i,n.highlightStyle||{}));if(typeof i.text=="undefined")return;e.save(),this.setContext(e,i),n.__needTransform&&e.transform.apply(e,this.updateTransform(n)),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var s=(i.text+"").split("\n"),o=t.getTextHeight("国",i.textFont),u=this.getRect(i),a=i.x,f;i.textBaseline=="top"?f=u.y:i.textBaseline=="bottom"?f=u.y+o:f=u.y+o/2;for(var l=0,c=s.length;l0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},h}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("path",new t),t}),r("zrender/shape/image",["require","./base","../shape"],function(e){function i(){this.type="image"}var t={},n=[],r;i.prototype={brush:function(e,i,s,o){var u=i.style||{};s&&(u=this.getHighlightStyle(u,i.highlightStyle||{}));var a=u.image;if(typeof a=="string"){var f=a;t[f]?a=t[f]:(a=new Image,a.onload=function(){a.onload=null,clearTimeout(r),n.push(i),r=setTimeout(function(){o(n),n=[]},10)},t[f]=a,a.src=f)}if(a){if(window.ActiveXObject){if(a.readyState!="complete")return}else if(!a.complete)return;e.save(),this.setContext(e,u),i.__needTransform&&e.transform.apply(e,this.updateTransform(i));var l=u.width||a.width,c=u.height||a.height,h=u.x,p=u.y;if(u.sWidth&&u.sHeight){var d=u.sx||0,v=u.sy||0;e.drawImage(a,d,v,u.sWidth,u.sHeight,h,p,l,c)}else if(u.sx&&u.sy){var d=u.sx,v=u.sy,m=l-d,g=c-v;e.drawImage(a,d,v,m,g,h,p,l,c)}else e.drawImage(a,h,p,l,c);u.width=l,u.height=c,i.style.width=l,i.style.height=c,u.text&&this.drawText(e,u,i.style),e.restore()}return},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}};var s=e("./base");s.derive(i);var o=e("../shape");return o.define("image",new i),i}),r("zrender/shape/beziercurve",["require","./base","../shape"],function(e){function t(){this.type="beziercurve",this.brushTypeOnly="stroke",this.textPosition="end"}t.prototype={buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),typeof t.cpX2!="undefined"&&typeof t.cpY2!="undefined"?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),r=Math.max(e.xStart,e.xEnd,e.cpX1),i=Math.max(e.yStart,e.yEnd,e.cpY1),s=e.cpX2,o=e.cpY2;typeof s!="undefined"&&typeof o!="undefined"&&(t=Math.min(t,s),n=Math.min(n,o),r=Math.max(r,s),i=Math.max(i,o));var u=e.lineWidth||1;return{x:t-u,y:n-u,width:r-t+u,height:i-n+u}}};var n=e("./base");n.derive(t);var r=e("../shape");return r.define("beziercurve",new t),t}),r("zrender/shape/star",["require","../tool/math","./base","../shape"],function(e){function s(){this.type="heart"}var t=e("../tool/math"),n=t.sin,r=t.cos,i=Math.PI;s.prototype={buildPath:function(e,t){var s=t.n;if(!s||s<2)return;var o=t.x,u=t.y,a=t.r,f=t.r0;f==null&&(f=s>4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=this._clips,n=t.length,r=[],i=[];for(var s=0;s=0;x--)if(E[x]<=t)break;x=Math.min(x,m-2)}else{for(x=N;xt)break;x=Math.min(x-1,m-2)}N=x,C=t;var r=E[x+1]-E[x];if(r===0)return;L=(t-E[x])/r,L<0&&console.log(L),h?(O=S[x],A=S[x===0?x:x-1],M=S[x>m-2?m-1:x+1],_=S[x>m-3?m-1:x+2],y?l(A,O,M,_,L,L*L,L*L*L,s(e,v),b):i(e,v,c(A,O,M,_,L,L*L,L*L*L))):y?a(S[x],S[x+1],L,s(e,v),b):i(e,v,u(S[x],S[x+1],L));for(x=0;x=t[1]&&(e=t[1]),e}function c(n,r,i){var u=e("./color");n=t.merge(n,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:o/2-30,width:s,height:5,brushType:"fill",timeInterval:100}},{overwrite:!1,recursive:!0});var c=a(n.textStyle),h=f(n.backgroundColor),p=n.effectOption,d={shape:"rectangle",highlightStyle:t.clone(p)};d.highlightStyle.color=p.color||u.getLinearGradient(p.x,p.y,p.x+p.width,p.y+p.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(typeof n.progress!="undefined"){r(h),d.highlightStyle.width=l(n.progress,[0,1])*n.effectOption.width,r(d),r(c),i();return}return d.highlightStyle.width=0,setInterval(function(){r(h),d.highlightStyle.width=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){if(e.lenth<1)return;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}),r("zrender",["zrender/zrender"],function(e){return e}),r("echarts/util/shape/icon",["require","zrender/tool/matrix","zrender/shape","zrender/shape","zrender/shape","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,arrow:y,star:b,heart:w,droplet:E,pin:S,image:x}}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(e,t){var n=t.x,r=t.y,i=t.width/16;e.moveTo(n+8*i,r),e.lineTo(n+i,r+t.height),e.lineTo(n+8*i,r+t.height/4*3),e.lineTo(n+15*i,r+t.height),e.lineTo(n+8*i,r)}function b(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})}function w(t,n){var r=e("zrender/shape").get("heart");r.buildPath(t,{x:n.x+n.width/2,y:n.y+n.height*.2,a:n.width/2,b:n.height*.8})}function E(t,n){var r=e("zrender/shape").get("droplet");r.buildPath(t,{x:n.x+n.width*.5,y:n.y+n.height*.5,a:n.width*.5,b:n.height*.8})}function S(e,t){var n=t.x,r=t.y-t.height/2*1.5,i=t.width/2,s=t.height/2,o=Math.min(i,s);e.arc(n+i,r+s,o,Math.PI/5*4,Math.PI/5),e.lineTo(n+i,r+s+o*1.5)}function x(t,n){setTimeout(function(){e("zrender/shape").get("image").brush(t,{style:n})},100)}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-(e.iconType=="pin"?e.height/2*1.5:0)),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;e.style.__rect?o=e.style.__rect:(o=this.getRect(e.style),e.style.__rect=o);var u=o.height<10?4:0;return n>=o.x-u&&n<=o.x+o.width+2*u&&r>=o.y-u&&r<=o.y+o.height+2*u?!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}),r("echarts/util/shape/markLine",["require","zrender/tool/matrix","zrender/shape","zrender/shape","zrender/shape/base","zrender/shape"],function(e){function n(){this.type="markLine"}var t=e("zrender/tool/matrix");return n.prototype={brush:function(e,t,n){var r=t.style||{};n&&(r=this.getHighlightStyle(r,t.highlightStyle||{})),e.save(),this.setContext(e,r),t.__needTransform&&e.transform.apply(e,this.updateTransform(t)),e.beginPath(),this.buildLinePath(e,r),e.stroke(),this.brushSymbol(t,e,r,0),this.brushSymbol(t,e,r,1),typeof r.text!="undefined"&&this.drawText(e,r,t.style),e.restore();return},buildLinePath:function(e,t){var n=t.xStart,r=t.xEnd,i=t.yStart,s=t.yEnd;if(!t.lineType||t.lineType=="solid")e.moveTo(n,i),e.lineTo(r,s);else if(t.lineType=="dashed"||t.lineType=="dotted"){var o=(t.lineWidth||1)*(t.lineType=="dashed"?5:1);this.dashedLineTo(e,n,i,r,s,o)}},brushSymbol:function(n,r,i,s){r.save(),r.beginPath(),r.lineWidth=i.symbolBorder,r.strokeStyle=i.symbolBorderColor,i.iconType=i.symbol[s].replace("empty","").toLowerCase(),i.symbol[s].match("empty")&&(r.fillStyle="rgba(0, 0, 0, 0)");var o=s===0?i.xStart:i.xEnd,u=s===0?i.yStart:i.yEnd,a=typeof i.symbolRotate[s]!="undefined"?i.symbolRotate[s]-0:0,f;a!==0&&(f=t.create(),t.identity(f),(o||u)&&t.translate(f,f,[-o,-u]),t.rotate(f,f,a*Math.PI/180),(o||u)&&t.translate(f,f,[o,u]),r.transform.apply(r,f));if(i.iconType=="arrow"&&a===0)this.buildArrawPath(r,i,s);else{var l=i.symbolSize[s];i.x=o-l,i.y=u-l,i.width=l*2,i.height=l*2,e("zrender/shape").get("icon").buildPath(r,i)}r.closePath(),r.stroke(),r.fill(),r.restore()},buildArrawPath:function(e,t,n){var r=t.symbolSize[n],i=t.xStart,s=t.xEnd,o=t.yStart,u=t.yEnd,a=Math.atan(Math.abs((u-o)/(i-s)));n===0?s>i?u>o&&(a=Math.PI*2-a):u>o?a+=Math.PI:a=Math.PI-a:i>s?o>u&&(a=Math.PI*2-a):o>u?a+=Math.PI:a=Math.PI-a;var f=Math.PI/8,l=n===0?i:s,c=n===0?o:u,h=[[l+r*Math.cos(a-f),c-r*Math.sin(a-f)],[l+r*.6*Math.cos(a),c-r*.6*Math.sin(a)],[l+r*Math.cos(a+f),c-r*Math.sin(a+f)]];e.moveTo(l,c);for(var p=0,d=h.length;p1?o.symbol:[o.symbol[0],o.symbol[0]]:[o.symbol,o.symbol],o.symbolSize=o.symbolSize instanceof Array?o.symbolSize.length>1?o.symbolSize:[o.symbolSize[0],o.symbolSize[0]]:[o.symbolSize,o.symbolSize],o.symbolRotate=o.symbolRotate instanceof Array?o.symbolRotate.length>1?o.symbolRotate:[o.symbolRotate[0],o.symbolRotate[0]]:[o.symbolRotate,o.symbolRotate],o.name=e.name;var a=[],f=o.data,l,c=u.dataRange,h=u.legend,p,d,v,m,g,y=s.zr.getWidth(),b=s.zr.getHeight();for(var w=0,E=f.length;w0?-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.refresh=m,a.render=g,a.resize=b,a.getOption=y,a.add=w,a.del=E,a.ondrop=S,a.ondragend=x}return e("../chart").define("island",t),t}),r("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}),r("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=T(),l=!1,c,h;e=0;while(!l&&e3){var o=T();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)return r.position=="bottom"||r.position=="top"?l.getXend():l.getY();var t=T(),n=r.boundaryGap?t:0;return n+=e*t,r.position=="bottom"||r.position=="top"?n=l.getX()+n:n=l.getYend()-n,e===0||e==r.data.length-1?n:Math.floor(n)}function k(e){return typeof r.data[e].value!="undefined"?r.data[e].value:r.data[e]}function L(e){var t=r.data,n=t.length;for(var i=0;i0?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;m0?r.power:1:p>0?h=p/r.splitNumber:p/=r.splitNumber),T(r.scale)}function T(e){var t=r.splitNumber,n=r.precision,i,s;n===0?s=r.power:(s=Math.pow(10,n),h*=s,p*=s,s=r.power);var o;if(h>=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}),r("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;t0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}}),n.addShape(o.shapeList[0])}function v(){return a}function m(){return f}function g(){return l}function y(){return c}function b(){return a+l}function w(){return f+c}function E(){return{x:a,y:f,width:l,height:c}}function S(e){if(h!=n.getWidth()||p!=n.getHeight()||e)o.clear(),d(e||r)}var i=e("./base");i.call(this,n);var s=e("../config"),o=this;o.type=s.COMPONENT_TYPE_GRID;var u=o.getZlevelBase(),a,f,l,c,h,p;o.init=d,o.getX=v,o.getY=m,o.getWidth=g,o.getHeight=y,o.getXend=b,o.getYend=w,o.getArea=E,o.refresh=S,d(r)}return e("../component").define("grid",t),t}),r("echarts/component/dataZoom",["require","./base","../config","../component","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function w(){N(),C(),k(),L();for(var e=0,t=u.shapeList.length;e=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 x(){b={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"?O():M(),f.realtime?D():(clearTimeout(g),g=setTimeout(D,200)),!0}function O(){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 M(){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 _(){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 D(e){var n,i,s,u,a;for(var l in b){n=b[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=P(c,a)}!y&&(f.realtime||e)&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),f.start=p.start,f.end=p.end}function P(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);var l;for(var c=0,h=t.length;c=s&&l[0]<=o&&l[1]>=u&&l[1]<=a&&n.push(t[c]);return n}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;D(),n.dragOut=!0,n.dragIn=!0,!y&&!f.realtime&&t.dispatch(o.EVENT.DATA_ZOOM,null,{zoom:p}),n.needRefresh=!1,u.isDragend=!1;return}function j(e,t){t.needRefresh=!0;return}function F(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,_(),D(!0);return}function I(e){if(!e)return f.start=f.start2=p.start=p.start2=0,f.end=f.end2=p.end=p.end2=100,_(),D(!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,_(),D(!0),p}function q(e,t){var n,r=b.series,i=e.series,s;for(var o=0,u=i.length;o=p-m&&(m=h.x,g+=b+w):d-g<200&&b+(N==t-1||e[N+1]===""?0:w)>=d-g&&(l.x=="right"?m-=h.maxWidth+w:m+=h.maxWidth+w,g=h.y),s=x(m,g,y,b,v[n]?E:"#ccc",i),s._name=n,l.selectedMode&&(s.onclick=T),f.shapeList.push(s),o={shape:"text",zlevel:c,style:{x:m+y+5,y:g,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-=y+10,o.style.textAlign="right"),o._name=n,l.selectedMode&&(o.onclick=T),f.shapeList.push(o),l.orient=="horizontal"?m+=y+5+a.getTextWidth(n,u)+w:g+=b+w}}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,h=l.padding,p=r.getWidth()-h[1]-h[3],d=r.getHeight()-h[0]-h[2],v=0,m=0;if(l.orient=="horizontal"){c=s;for(var g=0;gp?(u=p,c+=s+n):u=Math.max(u,v),c+=s+n,v=0;continue}v+=i+a.getTextWidth(e[g],o)+n}c=Math.max(c,s),v-=n,v>p?(u=p,c+=s+n):u=Math.max(u,v)}else{for(var g=0;gd?(c=d,u+=m+n):c=Math.max(c,v),u+=m+n,v=0;continue}v+=s+n}u=Math.max(u,m),v-=n,v>d?(c=d,u+=m+n):c=Math.max(c,v)}p=r.getWidth(),d=r.getHeight();var y;switch(l.x){case"center":y=Math.floor((p-u)/2);break;case"left":y=l.padding[3]+l.borderWidth;break;case"right":y=p-u-l.padding[1]-l.padding[3]-l.borderWidth*2;break;default:y=l.x-0,y=isNaN(y)?0:y}var b;switch(l.y){case"top":b=l.padding[0]+l.borderWidth;break;case"bottom":b=d-c-l.padding[0]-l.padding[2]-l.borderWidth*2;break;case"center":b=Math.floor((d-c)/2);break;default:b=l.y-0,b=isNaN(b)?0:b}return{x:y,y:b,width:u,height:c,maxWidth:m}}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"?F():I(e),a.realtime?R():(clearTimeout(y),y=setTimeout(R,200)),!0}function H(){u.isDragend=!0}function B(e,n){if(!u.isDragend||!e.target)return;R(),n.dragOut=!0,n.dragIn=!0,a.realtime||t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}}),n.needRefresh=!1,u.isDragend=!1;return}function j(){if(a.range){typeof a.range.start!="undefined"&&(g.end=a.range.start),typeof a.range.end!="undefined"&&(g.start=a.range.end);if(g.start!=100||g.end!==0){if(a.orient=="horizontal"){var e=m.style.width;m.style.x+=e*(100-g.start)/100,m.style.width=e*(g.start-g.end)/100}else{var t=m.style.height;m.style.y+=t*(100-g.start)/100,m.style.height=t*(g.start-g.end)/100}n.modShape(m.id,m),F()}}}function F(){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)),q(!1)}function I(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)),q(!0)}function q(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=X(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=X(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 R(){a.realtime&&t.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:g.end,end:g.start}})}function U(e){var n=e.target._idx;x[n]=!x[n],t.dispatch(s.EVENT.REFRESH)}function z(t){if(typeof u.query(t,"dataRange.min")=="undefined"||typeof u.query(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||e0&&(n.delShape(j.tipShape),j=!1),e&&n.refresh()}function U(e,t,n){var r=T.offsetHeight,i=T.offsetWidth;e+i>B&&(e=B-i),t+r>H&&(t=H-r),t<20&&(t=0),T.style.cssText=N+C+(n?n:"")+"left:"+e+"px;top:"+t+"px;",(B-e<100||H-t<100)&&setTimeout(z,20)}function z(){if(T){var e="",t=T.offsetHeight,n=T.offsetWidth;T.offsetLeft+n>B&&(e+="left:"+(B-n)+"px;"),T.offsetTop+t>H&&(e+="top:"+(H-t)+"px;"),e!==""&&(T.style.cssText+=e)}}function W(){var e,t;if(!_)V()||X();else{if(_._type=="island"&&r.tooltip.show){Q();return}var n=u.get(_,"series"),i=u.get(_,"data");e=m.deepQuery([i,n,r],"tooltip.show"),typeof n=="undefined"||typeof i=="undefined"||e===!1?(clearTimeout(L),clearTimeout(O),L=setTimeout(R,A)):(t=m.deepQuery([i,n,r],"tooltip.trigger"),t=="axis"?J(n.xAxisIndex,n.yAxisIndex,u.get(_,"dataIndex")):Q())}}function X(){if(!w||!E){L=setTimeout(R,A);return}var e=r.series,t,n;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 J(e,n,s){if(typeof w=="undefined"||typeof E=="undefined"||typeof e=="undefined"||typeof n=="undefined"||s<0){clearTimeout(L),clearTimeout(O),L=setTimeout(R,A);return}var u=r.series,a=[],f=[],c,h,p,d,v,g="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return;d=r.tooltip.formatter}if(e!=-1&&w.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){c=w.getAxis(e);for(var S=0,x=u.length;S0){var N;if(typeof d=="function"){var C=[];for(var S=0,x=a.length;S"+ct(a[S].name||"")+" : ",N=a[S].data[s],N=typeof N!="undefined"?typeof N.value!="undefined"?N.value:N:"-",d+=N;T.innerHTML=d}if(v===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(h,p,g)}}function K(e,t){if(typeof S=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=r.series,s=[],o,u,a="";if(r.tooltip.trigger=="axis"){if(r.tooltip.show===!1)return!1;o=r.tooltip.formatter}var f=r.polar[e].indicator[t].text;for(var c=0,h=n.length;c0){var p,d,v=[];for(var c=0,h=s.length;c"+ct(v[0][3])+" : "+v[0][2];for(var c=1,h=v.length;c"+ct(v[c][1])+"
    ",o+=ct(v[c][3])+" : "+v[c][2];T.innerHTML=o}if(u===!1||!r.tooltip.showContent)return;return m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D),l.getY(D),a),!0}}function Q(){var e=u.get(_,"series"),t=u.get(_,"data"),s=u.get(_,"name"),a=u.get(_,"value"),f=u.get(_,"special"),c=u.get(_,"special2"),h,p,d="",v,g="";_._type!="island"?(r.tooltip.trigger=="item"&&(h=r.tooltip.formatter),m.query(e,"tooltip.trigger")=="item"&&(p=m.query(e,"tooltip.showContent")||p,h=m.query(e,"tooltip.formatter")||h,d+=q(m.query(e,"tooltip"))),p=m.query(t,"tooltip.showContent")||p,h=m.query(t,"tooltip.formatter")||h,d+=q(m.query(t,"tooltip"))):(p=m.deepQuery([t,e,r],"tooltip.showContent"),h=m.deepQuery([t,e,r],"tooltip.islandFormatter"));if(typeof h=="function")P=(e.name||"")+":"+u.get(_,"dataIndex"),T.innerHTML=h([e.name||"",s,a,f,c],P,et);else if(typeof h=="string")P=NaN,h=h.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),h=h.replace("{a0}",ct(e.name||"")).replace("{b0}",ct(s)).replace("{c0}",a),h=h.replace("{d}","{d0}").replace("{d0}",f||""),h=h.replace("{e}","{e0}").replace("{e0}",u.get(_,"special2")||""),T.innerHTML=h;else{P=NaN;if(e.type==o.CHART_TYPE_SCATTER)T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
    ":"")+(s===""?"":ct(s)+" : ")+a+(typeof f=="undefined"?"":" ("+f+")");else if(e.type==o.CHART_TYPE_RADAR&&f){v=f,g+=ct(s===""?e.name||"":s),g+=g===""?"":"
    ";for(var y=0;y";T.innerHTML=g}else if(e.type==o.CHART_TYPE_CHORD)if(typeof c=="undefined")T.innerHTML=ct(s)+" ("+a+")";else{var b=ct(s),w=ct(f);T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
    ":"")+b+" -> "+w+" ("+a+")"+"
    "+w+" -> "+b+" ("+c+")"}else T.innerHTML=(typeof e.name!="undefined"?ct(e.name)+"
    ":"")+ct(s)+" : "+a+(typeof f=="undefined"?"":" ("+f+")")}F.invisible||(F.invisible=!0,n.modShape(F.id,F),n.refresh());if(p===!1||!r.tooltip.showContent)return;m.hasAppend||(T.style.left=B/2+"px",T.style.top=H/2+"px",i.firstChild.appendChild(T),m.hasAppend=!0),U(l.getX(D)+20,l.getY(D)-20,d)}function G(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,v=l.areaStyle.size,g=l.areaStyle.color;for(var y=0,w=e.length;yB&&(n+="left:"+(B-i)+"px;"),T.offsetTop+r>H&&(n+="top:"+(H-r)+"px;"),n!==""&&(T.style.cssText+=n),(B-T.offsetLeft<100||H-T.offsetTop<100)&&setTimeout(z,20)}function tt(e){y=e,b=y.grid,w=y.xAxis,E=y.yAxis,S=y.polar}function nt(e,t){if(!j||j&&j.dataIndex!=e.dataIndex){j&&j.tipShape.length>0&&n.delShape(j.tipShape);for(var r=0,i=t.length;r/g,">").replace(/"/g,""").replace(/'/g,"'")}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/ecData"),a=e("zrender/config"),f=e("zrender/shape"),l=e("zrender/tool/event"),c=e("zrender/tool/area"),h=e("zrender/tool/color"),p=e("zrender/tool/util"),d=e("zrender/shape/base"),v=f.get("rectangle"),m=this;m.type=o.COMPONENT_TYPE_TOOLTIP;var g=m.getZlevelBase(),y={},b,w,E,S,x={},T=document.createElement("div"),N="position:absolute;display:block;border-style:solid;white-space:nowrap;",C,k,L,A,O,M,_,D,P,H=n.getHeight(),B=n.getWidth(),j=!1,F={shape:"line",id:n.newShapeId("tooltip"),zlevel:g,invisible:!0,hoverable:!1,style:{}},I={shape:"line",id:n.newShapeId("tooltip"),zlevel:1,invisible:!0,hoverable:!1,style:{}};n.addShape(F),n.addShape(I),n.on(a.EVENT.MOUSEMOVE,Y),n.on(a.EVENT.GLOBALOUT,Z),m.dispose=lt,m.init=ut,m.refresh=at,m.resize=ft,m.setComponent=tt,m.ontooltipHover=nt,m.ondragend=rt,m.onlegendSelected=it,ut(r,i)}return e("../component").define("tooltip",t),t}),r("echarts/component/toolbox",["require","./base","../config","zrender/config","zrender/tool/event","../component","../component"],function(e){function t(t,n,r){function L(){d=[];var e=a.toolbox.feature;for(var t in e)if(e[t])switch(t){case"mark":d.push("mark"),d.push("markUndo"),d.push("markClear");break;case"magicType":for(var r=0,i=e[t].length;r0){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 $(){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;";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,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);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.query(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.query(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}),r("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function n(e,n){return[e*t.sin(n),e*t.cos(n)]}function r(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var t=e("zrender/tool/math");return{polar2cartesian:n,cartesian2polar:r}}),r("echarts/component/polar",["require","./base","../config","../util/coordinates","zrender/tool/util","../component"],function(e){function t(t,n,r,i){function p(e,t){i=t,B(e)}function d(){for(var e=0;e0?a="left":Math.round(i[0])<0?a="right":a="center",c.margin?(m=c.margin,d=i[0]>0?m:-m,v=i[1]>0?m:-m,d=i[0]===0?0:d,v=i[1]===0?0:v,i=T(i,o,1)):i=T(i,o,1.2),u.textAlign=a,u.x=i[0]+d,u.y=i[1]+v,c.rotate&&(p=[c.rotate/180*Math.PI,i[0],i[1]]),f.shapeList.push({shape:"text",style:u,draggable:!1,hoverable:!1,rotation:p})}}function b(e){var e=e||0,t=l[e],n=N(e),r=t.__ecIndicator,i=r.length,s=[],o,u;for(var a=0;au||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}}function M(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o[0]>=5?Math.pow(10,u):(o[0]-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)}function _(e,t,n){e=e||0,t=t||0;var r=l[e].__ecIndicator;if(t>=r.length)return;var i=l[e].__ecIndicator[t],s=N(e),o=i.vector,u=i.value.max,a=i.value.min,f;return typeof n!="number"?s:(u!=a?f=(n-a)/(u-a):f=.5,T(o,s,f))}function D(e){var t=P(e);return t?t.polarIndex:-1}function P(e){var t,r,i,s,o,a,c,h,p,d=Math.min(n.getWidth(),n.getHeight())/2;for(var v=0;vs[0])return{polarIndex:v,valueIndex:Math.floor((p+h/2)/h)%c}}}function H(e){var e=e||0;return l[e].indicator}function B(e){e&&(r=e,l=r.polar,c=r.series),f.clear(),d()}var s=e("./base");s.call(this,n);var o=e("../config"),u=e("../util/coordinates"),a=e("zrender/tool/util"),f=this;f.type=o.COMPONENT_TYPE_POLAR;var l,c,h;f.refresh=B,f.getVector=_,f.getDropBox=b,f.getCenter=N,f.getIndicator=H,f.isInside=D,f.getNearestIndex=P,p(r,i)}return e("../component").define("polar",t),t}),r("echarts/echarts",["require","./config","zrender","zrender/tool/util","zrender/tool/event","zrender/config","./util/shape/icon","./util/shape/markLine","./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","./component/polar","./util/ecData","./chart","./component","zrender/tool/util","zrender/tool/util","zrender/tool/util","zrender/tool/color","zrender/tool/util","zrender/tool/util","zrender/tool/util"],function(e){function r(t,r){function y(){var s=e("zrender");(s.version||"1.0.3").replace(".","")-00?n=B():n=B(v.getOption()),r.merge(n,t.option,{overwrite:!0,recursive:!0}),r.merge(f,t.option,{overwrite:!0,recursive:!0}),r.merge(l,t.option,{overwrite:!0,recursive:!0}),v.refresh(n),m.refresh(n)}for(var i=0,s=c.length;i0?u.getColor=function(e){return o.getColor(e,a.color)}:u.getColor=function(e){return o.getColor(e,i.color)},u.getCalculableColor=function(){return a.calculableColor||i.calculableColor},f=r.clone(a),l=r.clone(a),a.legend&&a.legend.selected?d=a.legend.selected:d={},v.clear(),m.reset(a),I(a),s}function W(){var t=e("zrender/tool/util");return f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?t.clone(B()):t.clone(B(v.getOption()))}function X(e,t){return t?(a.series=e,s.setOption(a,t)):s.setOption({series:e}),s}function V(){return W().series}function $(t,n,r,o,u){var a=e("zrender/tool/util"),p=t instanceof Array?t:[[t,n,r,o,u]],g,y,b;f.toolbox&&f.toolbox.show&&f.toolbox.feature.magicType&&f.toolbox.feature.magicType.length>0?b=B():b=B(v.getOption());for(var w=0,E=p.length;wt.largeThreshold){f.shapeList.push(b(n,f.query(t,"itemStyle.normal.color")||h[s]));continue}for(var o=0,u=n.length;o1e-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}),r("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;r1e-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),t=o[0],i=o[1]}return r.beginPath(),n.prototype.buildPath.call(null,r,e.style),r.closePath(),r.isPointInPath(t,i)}},e("zrender/shape/base").derive(n),e("zrender/shape").define("chord",new n),n}),r("echarts/util/kwargs",[],function(){function e(e){var t=this,n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=t.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return e!==Object(e)&&(e={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}.kwargs(),swapaxes:function(e,t,n){return this.transpose([e,t],n)}.kwargs(),rollaxis:function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),min:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),argmin:function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}().kwargs(),sort:function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}.kwargs(),append:function(){console.warn("TODO")}.kwargs(),"delete":function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(k.style.brushType="both"),k.highlightStyle.lineWidth>0&&(k.highlightStyle.brushType="both"),l.pack(k,w[0],0,t[p],0,d.name);if(u){var L=[g+C]/2;L%=360;var O=L<=90||L>=270;L=L*Math.PI/180;var _=[Math.cos(L),-Math.sin(L)],D=M?45:20,B=h.scale([],_,N+D);h.add(B,B,A);var j={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:B[0],y:B[1],text:d.name,textAlign:O?"left":"right",color:a}};j.style.textColor=o.deepQuery([d,b],"itemStyle.normal.label.textStyle.color")||"#fff",j.style.textFont=o.getFont(o.deepQuery([d,b],"itemStyle.normal.label.textStyle")),r.addShape(j),o.shapeList.push(j)}k.onmouseover=f(p),k.onmouseout=c(),o.shapeList.push(k),P.push(k),r.addShape(k)}}function R(e,t){var n=e.length;if(!n)return;var i=e[0][0].length,s=b.itemStyle.normal.chordStyle.lineStyle,u=b.itemStyle.emphasis.chordStyle.lineStyle;for(var a=0;a=270,T={shape:"text",id:r.newShapeId(o.type),zlevel:y-1,hoverable:!1,style:{x:E?N+B+4:-N-B-4,y:0,text:Math.round(w.shift()*10)/10+t,textAlign:E?"left":"right"},position:A.slice(),rotation:E?[l/180*Math.PI,0,0]:[(l+180)/180*Math.PI,0,0]};o.shapeList.push(T),r.addShape(T),g+=j*5}}}function z(e){var t=[],n=(new p(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s=0?e.source=n[s]:u=!1,n[o]>=0?e.target=n[o]:u=!1,e.rawIndex=t,u})}function Z(e,t,n){var i=[],o=e.length;for(var u=0;u500)continue;l<5&&(l=5),v.scale(n,n,1/l);var c=1*(o+u)*r/l;v.scaleAndAdd(P[i],P[i],n,-c),v.scaleAndAdd(P[s],P[s],n,c)}for(var i=0,h=M.length;i0&&y(h,e[h]);for(var u=0,f=l.shapeList.length;u0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}d=f.getCoord(E),E>=0?(v-=m-d,d=v):E<0&&(g+=d-y,d=g),b[n].push([h,d,x,u.getNameByIndex(x),h,m])}}v=s.grid.getY();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"horizontal")}function E(e,t){var n=t[0][0],r=c[n],o=r.yAxisIndex,u=s.yAxis.getAxis(o),a,f,h,d,v,m,g,y,b={},w,E;for(var x=0,N=e;x0&&(p[n]=p[n]||[],p[n].push(b[n]),b[n]=[]);continue}h=f.getCoord(E),E>=0?(v+=h-m,h=v):E<0&&(g-=y-h,h=g),b[n].push([h,d,x,u.getNameByIndex(x),m,d])}}v=s.grid.getXend();var O;for(var C=0,k=t.length;C0&&(p[M]=p[M]||[],p[M].push(b[M]),b[M]=[]);S(p,u,"vertical")}function S(e,t,n){var r,s,o,u,a,p,v,m,g,y,b;for(var w=c.length-1;w>=0;w--){m=c[w],y=e[w];if(m.type==l.type&&typeof y!="undefined"){r=d[w],s=l.query(m,"itemStyle.normal.lineStyle.width"),o=l.query(m,"itemStyle.normal.lineStyle.type"),u=l.query(m,"itemStyle.normal.lineStyle.color"),a=l.query(m,"itemStyle.normal.color"),p=typeof l.query(m,"itemStyle.normal.areaStyle")!="undefined",v=l.query(m,"itemStyle.normal.areaStyle.color");for(var E=0,S=y.length;E=0;n--){f=l.shapeList[n]._seriesIndex;if(t[f]&&!t[f][3]){if(l.shapeList[n]._main){h=l.shapeList[n].style.pointList,o=Math.abs(h[0][0]-h[1][0]),a=Math.abs(h[0][1]-h[1][1]),p=l.shapeList[n]._orient=="horizontal";if(t[f][2]){if(l.shapeList[n].shape=="polygon"){var d=h.length;l.shapeList[n].style.pointList[d-3]=h[d-2],p?l.shapeList[n].style.pointList[d-3][0]=h[d-4][0]:l.shapeList[n].style.pointList[d-3][1]=h[d-4][1],l.shapeList[n].style.pointList[d-2]=h[d-1]}l.shapeList[n].style.pointList.pop(),p?(s=o,u=0):(s=0,u=-a)}else{l.shapeList[n].style.pointList.shift();if(l.shapeList[n].shape=="polygon"){var v=l.shapeList[n].style.pointList.pop();p?v[0]=h[0][0]:v[1]=h[0][1],l.shapeList[n].style.pointList.push(v)}p?(s=-o,u=0):(s=0,u=a)}r.modShape(l.shapeList[n].id,{style:{pointList:l.shapeList[n].style.pointList}},!0)}else{if(t[f][2]&&l.shapeList[n]._dataIndex==c[f].data.length-1){r.delShape(l.shapeList[n].id);continue}if(!t[f][2]&&l.shapeList[n]._dataIndex===0){r.delShape(l.shapeList[n].id);continue}}r.animate(l.shapeList[n].id,"").when(500,{position:[s,u]}).start()}}}function M(){var e=l.query(i,"animationDuration"),t=l.query(i,"animationEasing"),n,s,o,u=0;for(var a=0,f=l.shapeList.length;a0&&v(h,e[h]);for(var a=0,f=l.shapeList.length;a0?(x=L-C,I==1&&S[s]>x&&(x=S[s]),k-=x,C=k):D<0?(x=C-O,I==1&&S[s]>x&&(x=S[s]),C=A,A+=x):(x=L-C,k-=x,C=k),M=w(s,P,f.getNameByIndex(P),N,C,g[s]||y,x,"vertical"),T[s]=T[s]||{},T[s][P]=N+(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F0?(x=N-L,I==1&&S[s]>x&&(x=S[s]),N=k,k+=x):D<0?(x=O-N,I==1&&S[s]>x&&(x=S[s]),A-=x,N=A):(x=N-L,N=k,k+=x),M=w(s,P,f.getNameByIndex(P),N,C-(g[s]||y),x,g[s]||y,"horizontal"),T[s]=T[s]||{},T[s][P]=C-(g[s]||y)/2,l.shapeList.push(M)}for(var F=0,I=t[B].length;F1?typeof f=="string"&&f.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(f))/100):e.getGap()-f:u,w=0,a=o>1?Math.floor((y-u)/(o-1)):0;if(a<0)return b(e,t,!0)}return{barWidthMap:r,barMinHeightMap:i,gap:y,barWidth:w,barGap:a}}function w(e,t,n,i,s,o,u,d){var v,m=c[e],g=m.data[t],y=p[e],b=[g,m],w=l.deepQuery(b,"itemStyle.normal.color")||y,E=l.deepQuery(b,"itemStyle.emphasis.color"),S=l.deepMerge(b,"itemStyle.normal"),x=S.borderWidth,T=l.deepMerge(b,"itemStyle.emphasis");return v={shape:"rectangle",zlevel:h,clickable:!0,style:{x:i,y:s,width:o,height:u,brushType:"both",color:w,radius:S.borderRadius,lineWidth:x,strokeColor:S.borderColor},highlightStyle:{color:E||(typeof w=="string"?f.lift(w,-0.2):w),radius:T.borderRadius,lineWidth:T.borderWidth,strokeColor:T.borderColor},_orient:d},v.style.height>x&&v.style.width>x?(v.style.y+=x/2,v.style.height-=x,v.style.x+=x/2,v.style.width-=x):v.style.brushType="fill",v.highlightStyle.textColor=v.highlightStyle.color,v=l.addLabel(v,m,g,n,d),l.deepQuery([g,m,r],"calculable")&&(l.setCalculable(v),v.draggable=!0),a.pack(v,c[e],e,c[e].data[t],t,n),v}function E(e,t,n){for(var r=0,s=e.length;r=0;r--){d=a.get(l.shapeList[r],"seriesIndex");if(t[d]&&!t[d][3]&&l.shapeList[r].shape=="rectangle"){v=a.get(l.shapeList[r],"dataIndex"),p=c[d];if(t[d][2]&&v==p.data.length-1){n.delShape(l.shapeList[r].id);continue}if(!t[d][2]&&v===0){n.delShape(l.shapeList[r].id);continue}l.shapeList[r]._orient=="horizontal"?(h=i.yAxis.getAxis(p.yAxisIndex||0).getGap(),f=t[d][2]?-h:h,o=0):(u=i.xAxis.getAxis(p.xAxisIndex||0).getGap(),o=t[d][2]?u:-u,f=0),n.animate(l.shapeList[r].id,"").when(500,{position:[o,f]}).start()}}}function C(){var e,t,i,s,o,u,f,c,h;for(var p=0,d=l.shapeList.length;p=150&&E<=210?"right":E<=30||E>=330?"left":"center",{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b+x*f.cos(E,!0),y:w-x*f.sin(E,!0),color:g.color||s,text:S(e,t,n,c),textAlign:g.align||N,textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};if(m.position=="center")return{shape:"text",zlevel:d+1,hoverable:!1,style:{x:b,y:w,color:g.color||s,text:S(e,t,n,c),textAlign:g.align||"center",textBaseline:g.baseline||"middle",textFont:h.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t};return}return}function S(e,t,n,r){var i=p[e],s=i.data[t],o=h.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 x(e,t,n,r,i,s,o,u){var a=p[e],c=a.data[t];if(N(a,c,u)){var v=u?"emphasis":"normal",m=l.merge(l.clone(c.itemStyle)||{},a.itemStyle,{overwrite:!1,recursive:!0}),g=m[v].labelLine,y=g.lineStyle||{},b=h.parseCenter(a.center),w=b[0],E=b[1],S=r,x=h.parseRadius(a.radius)[1]- -g.length,T=(s+i)/2%360,C=f.cos(T,!0),k=f.sin(T,!0);return{shape:"line",zlevel:d+1,hoverable:!1,style:{xStart:w+S*C,yStart:E-S*k,xEnd:w+x*C,yEnd:E-x*k,strokeColor:y.color||o,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t}}return}function T(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")}function N(e,t,n){return h.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")}function C(e){var t=l.merge;return e=t(e||{},u.pie,{overwrite:!1,recursive:!0}),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 k(e,t){i=t,L(e)}function L(e){e&&(r=e,p=r.series),h.clear(),g()}function A(e){var t={};for(var r=0,i=e.length;r diff --git a/package.json b/package.json index e1fd7b2db2..2029d0f32b 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { "name": "echarts", "description": "Enterprise Charts,基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据可视化表。", - "version": "1.2.1", + "version": "1.3.6", "maintainers": [ { "name": "Kener", "email": "linzhifeng@baidu.com" }, { "name": "Pissang", "email": "shenyi01@baidu.com" }, { "name": "Yangji", "email": "yangji01@baidu.com" } ], "dependencies": { - "zrender": "~1.0.4" + "zrender": "~1.0.8" }, "repository": "git://github.com/ecomfe/echarts", "main": "echarts", diff --git a/src/chart/force.js b/src/chart/force.js index 89973caf1a..2fc6cd5f54 100644 --- a/src/chart/force.js +++ b/src/chart/force.js @@ -376,7 +376,7 @@ define(function(require) { // data node, // data index - rawNodes.indexOf(node), + zrUtil.indexOf(rawNodes, node), // name node.name || '', // value diff --git a/src/echarts.js b/src/echarts.js index 514b9a9f81..5bab036a32 100644 --- a/src/echarts.js +++ b/src/echarts.js @@ -18,9 +18,9 @@ define(function(require) { var self = {}; var echarts = self; // 提供内部反向使用静态方法; - self.version = '1.3.5'; + self.version = '1.3.6'; self.dependencies = { - zrender : '1.0.7' + zrender : '1.0.8' }; /** * 入口方法 diff --git a/test/allchart/all.html b/test/allchart/all.html index a537e0fa5d..1d5c89db62 100644 --- a/test/allchart/all.html +++ b/test/allchart/all.html @@ -404,7 +404,7 @@

    ECharts - test all