define("echarts/chart/line",["require","./base","zrender/shape/Polyline","../util/shape/Icon","../util/shape/HalfSmoothPolygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(t){function e(t,e,i,s,n){o.call(this,t,e,i,s,n),this.refresh(s)}function i(t,e,i){var o=e.x,s=e.y,r=e.width,a=e.height,h=a/2;e.symbol.match("empty")&&(t.fillStyle="#fff"),e.brushType="both";var l=e.symbol.replace("empty","").toLowerCase();l.match("star")?(h=l.replace("star","")-0||5,s-=1,l="star"):("rectangle"===l||"arrow"===l)&&(o+=(r-a)/2,r=a);var d="";if(l.match("image")&&(d=l.replace(new RegExp("^image:\\/\\/"),""),l="image",o+=Math.round((r-a)/2)-1,r=a+=2),l=n.prototype.iconLibrary[l]){var c=e.x,p=e.y;t.moveTo(c,p+h),t.lineTo(c+5,p+h),t.moveTo(c+e.width-5,p+h),t.lineTo(c+e.width,p+h);var u=this;l(t,{x:o+4,y:s+4,width:r-8,height:a-8,n:h,image:d},function(){u.modSelf(),i()})}else t.moveTo(o,s+h),t.lineTo(o+r,s+h)}var o=t("./base"),s=t("zrender/shape/Polyline"),n=t("../util/shape/Icon"),r=t("../util/shape/HalfSmoothPolygon");t("../component/axis"),t("../component/grid"),t("../component/dataZoom");var a=t("../config");a.line={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:1.5,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1};var h=t("../util/ecData"),l=t("zrender/tool/util"),d=t("zrender/tool/color");return e.prototype={type:a.CHART_TYPE_LINE,_buildShape:function(){this.finalPLMap={},this._buildPosition()},_buildHorizontal:function(t,e,i,o){for(var s,n,r,a,h,l,d,c,p,u=this.series,g=i[0][0],f=u[g],m=this.component.xAxis.getAxis(f.xAxisIndex||0),y={},_=0,v=e;v>_&&null!=m.getNameByIndex(_);_++){n=m.getCoordByIndex(_);for(var x=0,b=i.length;b>x;x++){s=this.component.yAxis.getAxis(u[i[x][0]].yAxisIndex||0),h=a=d=l=s.getCoord(0);for(var S=0,T=i[x].length;T>S;S++)g=i[x][S],f=u[g],c=f.data[_],p=this.getDataFromOption(c,"-"),y[g]=y[g]||[],o[g]=o[g]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==p?(p>=0?(a-=S>0?s.getCoordSize(p):h-s.getCoord(p),r=a):0>p&&(l+=S>0?s.getCoordSize(p):s.getCoord(p)-d,r=l),y[g].push([n,r,_,m.getNameByIndex(_),n,h]),o[g].min>p&&(o[g].min=p,o[g].minY=r,o[g].minX=n),o[g].max
0&&(this.finalPLMap[g]=this.finalPLMap[g]||[],this.finalPLMap[g].push(y[g]),y[g]=[])}a=this.component.grid.getY();for(var z,x=0,b=i.length;b>x;x++)for(var S=0,T=i[x].length;T>S;S++)g=i[x][S],f=u[g],c=f.data[_],p=this.getDataFromOption(c,"-"),"-"==p&&this.deepQuery([c,f,this.option],"calculable")&&(z=this.deepQuery([c,f],"symbolSize"),a+=2*z+5,r=a,this.shapeList.push(this._getCalculableItem(g,_,m.getNameByIndex(_),n,r,"horizontal")))}for(var L in y)y[L].length>0&&(this.finalPLMap[L]=this.finalPLMap[L]||[],this.finalPLMap[L].push(y[L]),y[L]=[]);this._calculMarkMapXY(o,i,"y"),this._buildBorkenLine(t,this.finalPLMap,m,"horizontal")},_buildVertical:function(t,e,i,o){for(var s,n,r,a,h,l,d,c,p,u=this.series,g=i[0][0],f=u[g],m=this.component.yAxis.getAxis(f.yAxisIndex||0),y={},_=0,v=e;v>_&&null!=m.getNameByIndex(_);_++){r=m.getCoordByIndex(_);for(var x=0,b=i.length;b>x;x++){s=this.component.xAxis.getAxis(u[i[x][0]].xAxisIndex||0),h=a=d=l=s.getCoord(0);for(var S=0,T=i[x].length;T>S;S++)g=i[x][S],f=u[g],c=f.data[_],p=this.getDataFromOption(c,"-"),y[g]=y[g]||[],o[g]=o[g]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==p?(p>=0?(a+=S>0?s.getCoordSize(p):s.getCoord(p)-h,n=a):0>p&&(l-=S>0?s.getCoordSize(p):d-s.getCoord(p),n=l),y[g].push([n,r,_,m.getNameByIndex(_),h,r]),o[g].min>p&&(o[g].min=p,o[g].minX=n,o[g].minY=r),o[g].max
0&&(this.finalPLMap[g]=this.finalPLMap[g]||[],this.finalPLMap[g].push(y[g]),y[g]=[])}a=this.component.grid.getXend();for(var z,x=0,b=i.length;b>x;x++)for(var S=0,T=i[x].length;T>S;S++)g=i[x][S],f=u[g],c=f.data[_],p=this.getDataFromOption(c,"-"),"-"==p&&this.deepQuery([c,f,this.option],"calculable")&&(z=this.deepQuery([c,f],"symbolSize"),a-=2*z+5,n=a,this.shapeList.push(this._getCalculableItem(g,_,m.getNameByIndex(_),n,r,"vertical")))}for(var L in y)y[L].length>0&&(this.finalPLMap[L]=this.finalPLMap[L]||[],this.finalPLMap[L].push(y[L]),y[L]=[]);this._calculMarkMapXY(o,i,"x"),this._buildBorkenLine(t,this.finalPLMap,m,"vertical")},_buildOther:function(t,e,i,o){for(var s,n=this.series,r={},a=0,h=i.length;h>a;a++)for(var l=0,d=i[a].length;d>l;l++){var c=i[a][l],p=n[c];s=this.component.xAxis.getAxis(p.xAxisIndex||0);var u=this.component.yAxis.getAxis(p.yAxisIndex||0),g=u.getCoord(0);r[c]=r[c]||[],o[c]=o[c]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var f=0,m=p.data.length;m>f;f++){var y=p.data[f],_=this.getDataFromOption(y,"-");if(_ instanceof Array){var v=s.getCoord(_[0]),x=u.getCoord(_[1]);r[c].push([v,x,f,_[0],v,g]),o[c].min0>_[0]&&(o[c].min0=_[0],o[c].minY0=x,o[c].minX0=v),o[c].max0<_[0]&&(o[c].max0=_[0],o[c].maxY0=x,o[c].maxX0=v),o[c].sum0+=_[0],o[c].counter0++,o[c].min1>_[1]&&(o[c].min1=_[1],o[c].minY1=x,o[c].minX1=v),o[c].max1<_[1]&&(o[c].max1=_[1],o[c].maxY1=x,o[c].maxX1=v),o[c].sum1+=_[1],o[c].counter1++}}}for(var b in r)r[b].length>0&&(this.finalPLMap[b]=this.finalPLMap[b]||[],this.finalPLMap[b].push(r[b]),r[b]=[]);this._calculMarkMapXY(o,i,"xy"),this._buildBorkenLine(t,this.finalPLMap,s,"other")},_buildBorkenLine:function(t,e,i,o){for(var n,a="other"==o?"horizontal":o,c=this.series,p=t.length-1;p>=0;p--){var u=t[p],g=c[u],f=e[u];if(g.type===this.type&&null!=f)for(var m=this._getBbox(u,a),y=this._sIndex2ColorMap[u],_=this.query(g,"itemStyle.normal.lineStyle.width"),v=this.query(g,"itemStyle.normal.lineStyle.type"),x=this.query(g,"itemStyle.normal.lineStyle.color"),b=this.getItemStyleColor(this.query(g,"itemStyle.normal.color"),u,-1),S=null!=this.query(g,"itemStyle.normal.areaStyle"),T=this.query(g,"itemStyle.normal.areaStyle.color"),z=0,L=f.length;L>z;z++){var C=f[z],w="other"!=o&&this._isLarge(a,C);if(w)C=this._getLargePointList(a,C);else for(var M=0,A=C.length;A>M;M++)n=g.data[C[M][2]],(this.deepQuery([n,g,this.option],"calculable")||this.deepQuery([n,g],"showAllSymbol")||"categoryAxis"===i.type&&i.isMainAxis(C[M][2])&&"none"!=this.deepQuery([n,g],"symbol"))&&this.shapeList.push(this._getSymbol(u,C[M][2],C[M][3],C[M][0],C[M][1],a));var E=new s({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:_,pointList:C,strokeColor:x||b||y,lineWidth:_,lineType:v,smooth:this._getSmooth(g.smooth),smoothConstraint:m,shadowColor:this.query(g,"itemStyle.normal.lineStyle.shadowColor"),shadowBlur:this.query(g,"itemStyle.normal.lineStyle.shadowBlur"),shadowOffsetX:this.query(g,"itemStyle.normal.lineStyle.shadowOffsetX"),shadowOffsetY:this.query(g,"itemStyle.normal.lineStyle.shadowOffsetY")},hoverable:!1,_main:!0,_seriesIndex:u,_orient:a});if(h.pack(E,c[u],u,0,z,c[u].name),this.shapeList.push(E),S){var k=new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:_,pointList:l.clone(C).concat([[C[C.length-1][4],C[C.length-1][5]],[C[0][4],C[0][5]]]),brushType:"fill",smooth:this._getSmooth(g.smooth),smoothConstraint:m,color:T?T:d.alpha(y,.5)},highlightStyle:{brushType:"fill"},hoverable:!1,_main:!0,_seriesIndex:u,_orient:a});h.pack(k,c[u],u,0,z,c[u].name),this.shapeList.push(k)}}}},_getBbox:function(t,e){var i=this.component.grid.getBbox(),o=this.xMarkMap[t];return null!=o.minX0?[[Math.min(o.minX0,o.maxX0,o.minX1,o.maxX1),Math.min(o.minY0,o.maxY0,o.minY1,o.maxY1)],[Math.max(o.minX0,o.maxX0,o.minX1,o.maxX1),Math.max(o.minY0,o.maxY0,o.minY1,o.maxY1)]]:("horizontal"===e?(i[0][1]=Math.min(o.minY,o.maxY),i[1][1]=Math.max(o.minY,o.maxY)):(i[0][0]=Math.min(o.minX,o.maxX),i[1][0]=Math.max(o.minX,o.maxX)),i)},_isLarge:function(t,e){return e.length<2?!1:"horizontal"===t?Math.abs(e[0][0]-e[1][0])<.5:Math.abs(e[0][1]-e[1][1])<.5},_getLargePointList:function(t,e){var i;i="horizontal"===t?this.component.grid.getWidth():this.component.grid.getHeight();for(var o=e.length,s=[],n=0;i>n;n++)s[n]=e[Math.floor(o/i*n)];return s},_getSmooth:function(t){return t?.3:0},_getCalculableItem:function(t,e,i,o,s,n){var r=this.series,h=r[t].calculableHolderColor||this.ecTheme.calculableHolderColor||a.calculableHolderColor,l=this._getSymbol(t,e,i,o,s,n);return l.style.color=h,l.style.strokeColor=h,l.rotation=[0,0],l.hoverable=!1,l.draggable=!1,l.style.text=void 0,l},_getSymbol:function(t,e,i,o,s,n){var r=this.series,a=r[t],h=a.data[e],l=this.getSymbolShape(a,t,h,e,i,o,s,this._sIndex2ShapeMap[t],this._sIndex2ColorMap[t],"#fff","vertical"===n?"horizontal":"vertical");return l.zlevel=this.getZlevelBase(),l.z=this.getZBase()+1,this.deepQuery([h,a,this.option],"calculable")&&(this.setCalculable(l),l.draggable=!0),l},getMarkCoord:function(t,e){var i=this.series[t],o=this.xMarkMap[t],s=this.component.xAxis.getAxis(i.xAxisIndex),n=this.component.yAxis.getAxis(i.yAxisIndex);if(e.type&&("max"===e.type||"min"===e.type||"average"===e.type)){var r=null!=e.valueIndex?e.valueIndex:null!=o.maxX0?"1":"";return[o[e.type+"X"+r],o[e.type+"Y"+r],o[e.type+"Line"+r],o[e.type+r]]}return["string"!=typeof e.xAxis&&s.getCoordByIndex?s.getCoordByIndex(e.xAxis||0):s.getCoord(e.xAxis||0),"string"!=typeof e.yAxis&&n.getCoordByIndex?n.getCoordByIndex(e.yAxis||0):n.getCoord(e.yAxis||0)]},refresh:function(t){t&&(this.option=t,this.series=t.series),this.backupShapeList(),this._buildShape()},ontooltipHover:function(t,e){for(var i,o,s=t.seriesIndex,n=t.dataIndex,r=s.length;r--;)if(i=this.finalPLMap[s[r]])for(var a=0,h=i.length;h>a;a++){o=i[a];for(var l=0,d=o.length;d>l;l++)n===o[l][2]&&e.push(this._getSymbol(s[r],o[l][2],o[l][3],o[l][0],o[l][1],"horizontal"))}},addDataAnimation:function(t){for(var e=this.series,i={},o=0,s=t.length;s>o;o++)i[t[o][0]]=t[o];for(var n,r,a,h,l,d,c,o=this.shapeList.length-1;o>=0;o--)if(l=this.shapeList[o]._seriesIndex,i[l]&&!i[l][3]){if(this.shapeList[o]._main&&this.shapeList[o].style.pointList.length>1){if(d=this.shapeList[o].style.pointList,r=Math.abs(d[0][0]-d[1][0]),h=Math.abs(d[0][1]-d[1][1]),c="horizontal"===this.shapeList[o]._orient,i[l][2]){if("half-smooth-polygon"===this.shapeList[o].type){var p=d.length;this.shapeList[o].style.pointList[p-3]=d[p-2],this.shapeList[o].style.pointList[p-3][c?0:1]=d[p-4][c?0:1],this.shapeList[o].style.pointList[p-2]=d[p-1]}this.shapeList[o].style.pointList.pop(),c?(n=r,a=0):(n=0,a=-h)}else{if(this.shapeList[o].style.pointList.shift(),"half-smooth-polygon"===this.shapeList[o].type){var u=this.shapeList[o].style.pointList.pop();c?u[0]=d[0][0]:u[1]=d[0][1],this.shapeList[o].style.pointList.push(u)}c?(n=-r,a=0):(n=0,a=h)}this.zr.modShape(this.shapeList[o].id,{style:{pointList:this.shapeList[o].style.pointList}},!0)}else{if(i[l][2]&&this.shapeList[o]._dataIndex===e[l].data.length-1){this.zr.delShape(this.shapeList[o].id);continue}if(!i[l][2]&&0===this.shapeList[o]._dataIndex){this.zr.delShape(this.shapeList[o].id);continue}}this.shapeList[o].position=[0,0],this.zr.animate(this.shapeList[o].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[n,a]}).start()}}},n.prototype.iconLibrary.legendLineIcon=i,l.inherits(e,o),t("../chart").define("line",e),e}),define("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(t){function e(t){i.call(this,t)}var i=t("zrender/shape/Base"),o=t("zrender/shape/util/smoothBezier"),s=t("zrender/tool/util");return e.prototype={type:"half-smooth-polygon",buildPath:function(e,i){var s=i.pointList;if(!(s.length<2))if(i.smooth){var n=o(s.slice(0,-2),i.smooth,!1,i.smoothConstraint);e.moveTo(s[0][0],s[0][1]);for(var r,a,h,l=s.length,d=0;l-3>d;d++)r=n[2*d],a=n[2*d+1],h=s[d+1],e.bezierCurveTo(r[0],r[1],a[0],a[1],h[0],h[1]);e.lineTo(s[l-2][0],s[l-2][1]),e.lineTo(s[l-1][0],s[l-1][1]),e.lineTo(s[0][0],s[0][1])}else t("zrender/shape/Polygon").prototype.buildPath(e,i)}},s.inherits(e,i),e}),define("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(t){function e(t,e,o,s,n,r){i.call(this,t,e,o,s,n),this.axisType=r,this._axisList=[],this.refresh(s)}var i=t("./base"),o=t("zrender/shape/Line"),s=t("../config"),n=t("../util/ecData"),r=t("zrender/tool/util"),a=t("zrender/tool/color");return e.prototype={type:s.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var t=this.option.axisLine.lineStyle.width,e=t/2,i={_axisShape:"axisLine",zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1},s=this.grid;switch(this.option.position){case"left":i.style={xStart:s.getX()-e,yStart:s.getYend(),xEnd:s.getX()-e,yEnd:s.getY(),lineCap:"round"};break;case"right":i.style={xStart:s.getXend()+e,yStart:s.getYend(),xEnd:s.getXend()+e,yEnd:s.getY(),lineCap:"round"};break;case"bottom":i.style={xStart:s.getX(),yStart:s.getYend()+e,xEnd:s.getXend(),yEnd:s.getYend()+e,lineCap:"round"};break;case"top":i.style={xStart:s.getX(),yStart:s.getY()-e,xEnd:s.getXend(),yEnd:s.getY()-e,lineCap:"round"}}var n=i.style;""!==this.option.name&&(n.text=this.option.name,n.textPosition=this.option.nameLocation,n.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(n.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(n.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(n.textColor=this.option.nameTextStyle.color)),n.strokeColor=this.option.axisLine.lineStyle.color,n.lineWidth=t,this.isHorizontal()?n.yStart=n.yEnd=this.subPixelOptimize(n.yEnd,t):n.xStart=n.xEnd=this.subPixelOptimize(n.xEnd,t),n.lineType=this.option.axisLine.lineStyle.type,i=new o(i),this.shapeList.push(i)},_axisLabelClickable:function(t,e){return t?(n.pack(e,void 0,-1,void 0,-1,e.style.text),e.hoverable=!0,e.clickable=!0,e.highlightStyle={color:a.lift(e.style.color,1),brushType:"fill"},e):e},refixAxisShape:function(t,e){if(this.option.axisLine.onZero){var i;if(this.isHorizontal()&&null!=e)for(var o=0,s=this.shapeList.length;s>o;o++)"axisLine"===this.shapeList[o]._axisShape?(this.shapeList[o].style.yStart=this.shapeList[o].style.yEnd=this.subPixelOptimize(e,this.shapeList[o].stylelineWidth),this.zr.modShape(this.shapeList[o].id)):"axisTick"===this.shapeList[o]._axisShape&&(i=this.shapeList[o].style.yEnd-this.shapeList[o].style.yStart,this.shapeList[o].style.yStart=e-i,this.shapeList[o].style.yEnd=e,this.zr.modShape(this.shapeList[o].id));if(!this.isHorizontal()&&null!=t)for(var o=0,s=this.shapeList.length;s>o;o++)"axisLine"===this.shapeList[o]._axisShape?(this.shapeList[o].style.xStart=this.shapeList[o].style.xEnd=this.subPixelOptimize(t,this.shapeList[o].stylelineWidth),this.zr.modShape(this.shapeList[o].id)):"axisTick"===this.shapeList[o]._axisShape&&(i=this.shapeList[o].style.xEnd-this.shapeList[o].style.xStart,this.shapeList[o].style.xStart=t,this.shapeList[o].style.xEnd=t+i,this.zr.modShape(this.shapeList[o].id))}},getPosition:function(){return this.option.position},isHorizontal:function(){return"bottom"===this.option.position||"top"===this.option.position}},reformOption:function(t){if(!t||t instanceof Array&&0===t.length?t=[{type:s.COMPONENT_TYPE_AXIS_VALUE}]:t instanceof Array||(t=[t]),t.length>2&&(t=[t[0],t[1]]),"xAxis"===this.axisType){(!t[0].position||"bottom"!=t[0].position&&"top"!=t[0].position)&&(t[0].position="bottom"),t.length>1&&(t[1].position="bottom"===t[0].position?"top":"bottom");for(var e=0,i=t.length;i>e;e++)t[e].type=t[e].type||"category",t[e].xAxisIndex=e,t[e].yAxisIndex=-1}else{(!t[0].position||"left"!=t[0].position&&"right"!=t[0].position)&&(t[0].position="left"),t.length>1&&(t[1].position="left"===t[0].position?"right":"left");for(var e=0,i=t.length;i>e;e++)t[e].type=t[e].type||"value",t[e].xAxisIndex=-1,t[e].yAxisIndex=e}return t},refresh:function(e){var i;e&&(this.option=e,"xAxis"===this.axisType?(this.option.xAxis=this.reformOption(e.xAxis),i=this.option.xAxis):(this.option.yAxis=this.reformOption(e.yAxis),i=this.option.yAxis),this.series=e.series);for(var o=t("./categoryAxis"),s=t("./valueAxis"),n=Math.max(i&&i.length||0,this._axisList.length),r=0;n>r;r++)!this._axisList[r]||!e||i[r]&&this._axisList[r].type==i[r].type||(this._axisList[r].dispose&&this._axisList[r].dispose(),this._axisList[r]=!1),this._axisList[r]?this._axisList[r].refresh&&this._axisList[r].refresh(i?i[r]:!1,this.series):i&&i[r]&&(this._axisList[r]="category"===i[r].type?new o(this.ecTheme,this.messageCenter,this.zr,i[r],this.myChart,this.axisBase):new s(this.ecTheme,this.messageCenter,this.zr,i[r],this.myChart,this.axisBase,this.series))},getAxis:function(t){return this._axisList[t]},clear:function(){for(var t=0,e=this._axisList.length;e>t;t++)this._axisList[t].dispose&&this._axisList[t].dispose();this._axisList=[]}},r.inherits(e,i),t("../component").define("axis",e),e}),define("echarts/component/grid",["require","./base","zrender/shape/Rectangle","../config","zrender/tool/util","../component"],function(t){function e(t,e,o,s,n){i.call(this,t,e,o,s,n),this.refresh(s)}var i=t("./base"),o=t("zrender/shape/Rectangle"),s=t("../config");s.grid={zlevel:0,z:0,x:12,y:60,x2:12,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc"};var n=t("zrender/tool/util");return e.prototype={type:s.COMPONENT_TYPE_GRID,getX:function(){return this._x},getY:function(){return this._y},getWidth:function(){return this._width},getHeight:function(){return this._height},getXend:function(){return this._x+this._width},getYend:function(){return this._y+this._height},getArea:function(){return{x:this._x,y:this._y,width:this._width,height:this._height}},getBbox:function(){return[[this._x,this._y],[this.getXend(),this.getYend()]]},refixAxisShape:function(t){for(var e,i,o,n=t.xAxis._axisList.concat(t.yAxis?t.yAxis._axisList:[]),r=n.length;r--;)o=n[r],o.type==s.COMPONENT_TYPE_AXIS_VALUE&&o._min<0&&o._max>=0&&(o.isHorizontal()?e=o.getCoord(0):i=o.getCoord(0));if("undefined"!=typeof e||"undefined"!=typeof i)for(r=n.length;r--;)n[r].refixAxisShape(e,i)},refresh:function(t){if(t||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=t||this.option,this.option.grid=this.reformOption(this.option.grid);var e=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(e.x,this._zrWidth),this._y=this.parsePercent(e.y,this._zrHeight);var i=this.parsePercent(e.x2,this._zrWidth),s=this.parsePercent(e.y2,this._zrHeight);this._width="undefined"==typeof e.width?this._zrWidth-this._x-i:this.parsePercent(e.width,this._zrWidth),this._width=this._width<=0?10:this._width,this._height="undefined"==typeof e.height?this._zrHeight-this._y-s:this.parsePercent(e.height,this._zrHeight),this._height=this._height<=0?10:this._height,this._x=this.subPixelOptimize(this._x,e.borderWidth),this._y=this.subPixelOptimize(this._y,e.borderWidth),this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:e.borderWidth>0?"both":"fill",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},n.inherits(e,i),t("../component").define("grid",e),e}),define("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","../util/date","zrender/tool/util","../component"],function(t){function e(t,e,o,s,n){i.call(this,t,e,o,s,n);var r=this;r._ondrift=function(t,e){return r.__ondrift(this,t,e)},r._ondragend=function(){return r.__ondragend()},this._fillerSize=30,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this._handleSize=this.zoomOption.handleSize,this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var i=t("./base"),o=t("zrender/shape/Rectangle"),s=t("zrender/shape/Polygon"),n=t("../util/shape/Icon"),r=t("../config");r.dataZoom={zlevel:0,z:4,show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",handleSize:20,showDetail:!0,realtime:!1};var a=t("../util/date"),h=t("zrender/tool/util");return e.prototype={type:r.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var t=0,e=this.shapeList.length;e>t;t++)this.zr.addShape(this.shapeList[t]);this._syncFrameShape()},_getLocation:function(){var t,e,i,o,s=this.component.grid;return"horizontal"==this.zoomOption.orient?(i=this.zoomOption.width||s.getWidth(),o=this.zoomOption.height||this._fillerSize,t=null!=this.zoomOption.x?this.zoomOption.x:s.getX(),e=null!=this.zoomOption.y?this.zoomOption.y:this.zr.getHeight()-o-2):(i=this.zoomOption.width||this._fillerSize,o=this.zoomOption.height||s.getHeight(),t=null!=this.zoomOption.x?this.zoomOption.x:2,e=null!=this.zoomOption.y?this.zoomOption.y:s.getY()),{x:t,y:e,width:i,height:o}},_getZoom:function(){var t=this.option.series,e=this.option.xAxis;!e||e instanceof Array||(e=[e],this.option.xAxis=e);var i=this.option.yAxis;!i||i instanceof Array||(i=[i],this.option.yAxis=i);var o,s,n=[],a=this.zoomOption.xAxisIndex;if(e&&null==a){o=[];for(var h=0,l=e.length;l>h;h++)("category"==e[h].type||null==e[h].type)&&o.push(h)}else o=a instanceof Array?a:null!=a?[a]:[];if(a=this.zoomOption.yAxisIndex,i&&null==a){s=[];for(var h=0,l=i.length;l>h;h++)"category"==i[h].type&&s.push(h)}else s=a instanceof Array?a:null!=a?[a]:[];for(var d,h=0,l=t.length;l>h;h++)if(d=t[h],d.type==r.CHART_TYPE_LINE||d.type==r.CHART_TYPE_BAR||d.type==r.CHART_TYPE_SCATTER||d.type==r.CHART_TYPE_K){for(var c=0,p=o.length;p>c;c++)if(o[c]==(d.xAxisIndex||0)){n.push(h);break}for(var c=0,p=s.length;p>c;c++)if(s[c]==(d.yAxisIndex||0)){n.push(h);break}null==this.zoomOption.xAxisIndex&&null==this.zoomOption.yAxisIndex&&d.data&&this.getDataFromOption(d.data[0])instanceof Array&&(d.type==r.CHART_TYPE_SCATTER||d.type==r.CHART_TYPE_LINE||d.type==r.CHART_TYPE_BAR)&&n.push(h)}var u=null!=this._zoom.start?this._zoom.start:null!=this.zoomOption.start?this.zoomOption.start:0,g=null!=this._zoom.end?this._zoom.end:null!=this.zoomOption.end?this.zoomOption.end:100;u>g&&(u+=g,g=u-g,u-=g);var f=Math.round((g-u)/100*("horizontal"==this.zoomOption.orient?this._location.width:this._location.height));return{start:u,end:g,start2:0,end2:100,size:f,xAxisIndex:o,yAxisIndex:s,seriesIndex:n,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};for(var t=this.option.xAxis,e=this._zoom.xAxisIndex,i=0,o=e.length;o>i;i++)this._originalData.xAxis[e[i]]=t[e[i]].data;for(var s=this.option.yAxis,n=this._zoom.yAxisIndex,i=0,o=n.length;o>i;i++)this._originalData.yAxis[n[i]]=s[n[i]].data;for(var a,h=this.option.series,l=this._zoom.seriesIndex,i=0,o=l.length;o>i;i++)a=h[l[i]],this._originalData.series[l[i]]=a.data,a.data&&this.getDataFromOption(a.data[0])instanceof Array&&(a.type==r.CHART_TYPE_SCATTER||a.type==r.CHART_TYPE_LINE||a.type==r.CHART_TYPE_BAR)&&(this._backupScale(),this._calculScatterMap(l[i]))},_calculScatterMap:function(e){this._zoom.scatterMap=this._zoom.scatterMap||{},this._zoom.scatterMap[e]=this._zoom.scatterMap[e]||{};var i=t("../component"),o=i.get("axis"),s=h.clone(this.option.xAxis);"category"==s[0].type&&(s[0].type="value"),s[1]&&"category"==s[1].type&&(s[1].type="value");var n=new o(this.ecTheme,null,!1,{xAxis:s,series:this.option.series},this,"xAxis"),r=this.option.series[e].xAxisIndex||0;this._zoom.scatterMap[e].x=n.getAxis(r).getExtremum(),n.dispose(),s=h.clone(this.option.yAxis),"category"==s[0].type&&(s[0].type="value"),s[1]&&"category"==s[1].type&&(s[1].type="value"),n=new o(this.ecTheme,null,!1,{yAxis:s,series:this.option.series},this,"yAxis"),r=this.option.series[e].yAxisIndex||0,this._zoom.scatterMap[e].y=n.getAxis(r).getExtremum(),n.dispose()},_buildBackground:function(){var t=this._location.width,e=this._location.height;this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._location.x,y:this._location.y,width:t,height:e,color:this.zoomOption.backgroundColor}}));for(var i=0,n=this._originalData.xAxis,a=this._zoom.xAxisIndex,h=0,l=a.length;l>h;h++)i=Math.max(i,n[a[h]].length);for(var d=this._originalData.yAxis,c=this._zoom.yAxisIndex,h=0,l=c.length;l>h;h++)i=Math.max(i,d[c[h]].length);for(var p,u=this._zoom.seriesIndex[0],g=this._originalData.series[u],f=Number.MIN_VALUE,m=Number.MAX_VALUE,h=0,l=g.length;l>h;h++)p=this.getDataFromOption(g[h],0),this.option.series[u].type==r.CHART_TYPE_K&&(p=p[1]),isNaN(p)&&(p=0),f=Math.max(f,p),m=Math.min(m,p);var y=f-m,_=[],v=t/(i-(i>1?1:0)),x=e/(i-(i>1?1:0)),b=1;"horizontal"==this.zoomOption.orient&&1>v?b=Math.floor(3*i/t):"vertical"==this.zoomOption.orient&&1>x&&(b=Math.floor(3*i/e));for(var h=0,l=i;l>h;h+=b)p=this.getDataFromOption(g[h],0),this.option.series[u].type==r.CHART_TYPE_K&&(p=p[1]),isNaN(p)&&(p=0),_.push("horizontal"==this.zoomOption.orient?[this._location.x+v*h,this._location.y+e-1-Math.round((p-m)/y*(e-10))]:[this._location.x+1+Math.round((p-m)/y*(t-10)),this._location.y+x*(l-h-1)]);"horizontal"==this.zoomOption.orient?(_.push([this._location.x+t,this._location.y+e]),_.push([this._location.x,this._location.y+e])):(_.push([this._location.x,this._location.y]),_.push([this._location.x,this._location.y+e])),this.shapeList.push(new s({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:_,color:this.zoomOption.dataBackgroundColor},hoverable:!1}))},_buildFiller:function(){this._fillerShae={zlevel:this.getZlevelBase(),z:this.getZBase(),draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,_type:"filler"},this._fillerShae.style="horizontal"==this.zoomOption.orient?{x:this._location.x+Math.round(this._zoom.start/100*this._location.width)+this._handleSize,y:this._location.y,width:this._zoom.size-2*this._handleSize,height:this._location.height,color:this.zoomOption.fillerColor,text:":::",textPosition:"inside"}:{x:this._location.x,y:this._location.y+Math.round(this._zoom.start/100*this._location.height)+this._handleSize,width:this._location.width,height:this._zoom.size-2*this._handleSize,color:this.zoomOption.fillerColor,text:"::",textPosition:"inside"},this._fillerShae.highlightStyle={brushType:"fill",color:"rgba(0,0,0,0)"},this._fillerShae=new o(this._fillerShae),this.shapeList.push(this._fillerShae)},_buildHandle:function(){var t=this.zoomOption.showDetail?this._getDetail():{start:"",end:""};this._startShape={zlevel:this.getZlevelBase(),z:this.getZBase(),draggable:!0,style:{iconType:"rectangle",x:this._location.x,y:this._location.y,width:this._handleSize,height:this._handleSize,color:this.zoomOption.handleColor,text:"=",textPosition:"inside"},highlightStyle:{text:t.start,brushType:"fill",textPosition:"left"},ondrift:this._ondrift,ondragend:this._ondragend},"horizontal"==this.zoomOption.orient?(this._startShape.style.height=this._location.height,this._endShape=h.clone(this._startShape),this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endShape.highlightStyle.text=t.end,this._endShape.highlightStyle.textPosition="right"):(this._startShape.style.width=this._location.width,this._endShape=h.clone(this._startShape),this._startShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._startShape.highlightStyle.textPosition="bottom",this._endShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.highlightStyle.text=t.end,this._endShape.highlightStyle.textPosition="top"),this._startShape=new n(this._startShape),this._endShape=new n(this._endShape),this.shapeList.push(this._startShape),this.shapeList.push(this._endShape)},_buildFrame:function(){var t=this.subPixelOptimize(this._location.x,1),e=this.subPixelOptimize(this._location.y,1);this._startFrameShape={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:t,y:e,width:this._location.width-(t>this._location.x?1:0),height:this._location.height-(e>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=h.clone(this._startFrameShape),this._startFrameShape=new o(this._startFrameShape),this._endFrameShape=new o(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape)},_syncHandleShape:function(){"horizontal"==this.zoomOption.orient?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=(this._startShape.style.x-this._location.x)/this._location.width*100,this._zoom.end=(this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100):(this._startShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endShape.style.y=this._fillerShae.style.y-this._handleSize,this._zoom.start=(this._location.y+this._location.height-this._startShape.style.y)/this._location.height*100,this._zoom.end=(this._location.y+this._location.height-this._endShape.style.y-this._handleSize)/this._location.height*100),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refreshNextFrame()},_syncFillerShape:function(){var t,e;"horizontal"==this.zoomOption.orient?(t=this._startShape.style.x,e=this._endShape.style.x,this._fillerShae.style.x=Math.min(t,e)+this._handleSize,this._fillerShae.style.width=Math.abs(t-e)-this._handleSize,this._zoom.start=(Math.min(t,e)-this._location.x)/this._location.width*100,this._zoom.end=(Math.max(t,e)+this._handleSize-this._location.x)/this._location.width*100):(t=this._startShape.style.y,e=this._endShape.style.y,this._fillerShae.style.y=Math.min(t,e)+this._handleSize,this._fillerShae.style.height=Math.abs(t-e)-this._handleSize,this._zoom.start=(this._location.y+this._location.height-Math.max(t,e))/this._location.height*100,this._zoom.end=(this._location.y+this._location.height-Math.min(t,e)-this._handleSize)/this._location.height*100),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refreshNextFrame()},_syncFrameShape:function(){"horizontal"==this.zoomOption.orient?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._startFrameShape.style.height=this._location.y+this._location.height-this._startFrameShape.style.y,this._endFrameShape.style.height=this._fillerShae.style.y-this._location.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){this.zoomOption.show&&("horizontal"==this.zoomOption.orient?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._location.height-this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._location.height-this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._endShape.style.y+this._handleSize,this._fillerShae.style.height=this._startShape.style.y-this._endShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh())
},_syncData:function(t){var e,i,o,s,n;for(var a in this._originalData){e=this._originalData[a];for(var h in e)n=e[h],null!=n&&(s=n.length,i=Math.floor(this._zoom.start/100*s),o=Math.ceil(this._zoom.end/100*s),this.getDataFromOption(n[0])instanceof Array&&this.option[a][h].type!=r.CHART_TYPE_K?(this._setScale(),this.option[a][h].data=this._synScatterData(h,n)):this.option[a][h].data=n.slice(i,o))}this._isSilence||!this.zoomOption.realtime&&!t||this.messageCenter.dispatch(r.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(t,e){if(0===this._zoom.start&&100==this._zoom.end&&0===this._zoom.start2&&100==this._zoom.end2)return e;var i,o,s,n,r,a=[],h=this._zoom.scatterMap[t];"horizontal"==this.zoomOption.orient?(i=h.x.max-h.x.min,o=this._zoom.start/100*i+h.x.min,s=this._zoom.end/100*i+h.x.min,i=h.y.max-h.y.min,n=this._zoom.start2/100*i+h.y.min,r=this._zoom.end2/100*i+h.y.min):(i=h.x.max-h.x.min,o=this._zoom.start2/100*i+h.x.min,s=this._zoom.end2/100*i+h.x.min,i=h.y.max-h.y.min,n=this._zoom.start/100*i+h.y.min,r=this._zoom.end/100*i+h.y.min);for(var l,d=0,c=e.length;c>d;d++)l=e[d].value||e[d],l[0]>=o&&l[0]<=s&&l[1]>=n&&l[1]<=r&&a.push(e[d]);return a},_setScale:function(){var t=0!==this._zoom.start||100!==this._zoom.end||0!==this._zoom.start2||100!==this._zoom.end2,e={xAxis:this.option.xAxis,yAxis:this.option.yAxis};for(var i in e)for(var o=0,s=e[i].length;s>o;o++)e[i][o].scale=t||e[i][o]._scale},_backupScale:function(){var t={xAxis:this.option.xAxis,yAxis:this.option.yAxis};for(var e in t)for(var i=0,o=t[e].length;o>i;i++)t[e][i]._scale=t[e][i].scale},_getDetail:function(){var t="horizontal"==this.zoomOption.orient?"xAxis":"yAxis",e=this._originalData[t];for(var i in e){var o=e[i];if(null!=o){var s=o.length,n=Math.floor(this._zoom.start/100*s),r=Math.ceil(this._zoom.end/100*s);return r-=r>0?1:0,{start:this.getDataFromOption(o[n]),end:this.getDataFromOption(o[r])}}}var h=this._zoom.seriesIndex[0],l=this.option.series[h][t+"Index"]||0,d=this.option[t][l].type,c=this._zoom.scatterMap[h][t.charAt(0)].min,p=this._zoom.scatterMap[h][t.charAt(0)].max,u=p-c;if("value"==d)return{start:c+u*this._zoom.start/100,end:c+u*this._zoom.end/100};if("time"==d){p=c+u*this._zoom.end/100,c+=u*this._zoom.start/100;var g=a.getAutoFormatter(c,p).formatter;return{start:a.format(g,c),end:a.format(g,p)}}return{start:"",end:""}},__ondrift:function(t,e,i){this.zoomOption.zoomLock&&(t=this._fillerShae);var o="filler"==t._type?this._handleSize:0;if("horizontal"==this.zoomOption.orient?t.style.x+e-o<=this._location.x?t.style.x=this._location.x+o:t.style.x+e+t.style.width+o>=this._location.x+this._location.width?t.style.x=this._location.x+this._location.width-t.style.width-o:t.style.x+=e:t.style.y+i-o<=this._location.y?t.style.y=this._location.y+o:t.style.y+i+t.style.height+o>=this._location.y+this._location.height?t.style.y=this._location.y+this._location.height-t.style.height-o:t.style.y+=i,"filler"==t._type?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),this.zoomOption.showDetail){var s=this._getDetail();this._startShape.style.text=this._startShape.highlightStyle.text=s.start,this._endShape.style.text=this._endShape.highlightStyle.text=s.end,this._startShape.style.textPosition=this._startShape.highlightStyle.textPosition,this._endShape.style.textPosition=this._endShape.highlightStyle.textPosition}return!0},__ondragend:function(){this.zoomOption.showDetail&&(this._startShape.style.text=this._endShape.style.text="=",this._startShape.style.textPosition=this._endShape.style.textPosition="inside",this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.refreshNextFrame()),this.isDragend=!0},ondragend:function(t,e){this.isDragend&&t.target&&(!this.zoomOption.realtime&&this._syncData(),e.dragOut=!0,e.dragIn=!0,this._isSilence||this.zoomOption.realtime||this.messageCenter.dispatch(r.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),e.needRefresh=!1,this.isDragend=!1)},ondataZoom:function(t,e){e.needRefresh=!0},absoluteZoom:function(t){this._zoom.start=t.start,this._zoom.end=t.end,this._zoom.start2=t.start2,this._zoom.end2=t.end2,this._syncShape(),this._syncData(!0)},rectZoom:function(t){if(!t)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var e=this.component.grid.getArea(),i={x:t.x,y:t.y,width:t.width,height:t.height};if(i.width<0&&(i.x+=i.width,i.width=-i.width),i.height<0&&(i.y+=i.height,i.height=-i.height),i.x>e.x+e.width||i.y>e.y+e.height)return!1;i.x