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".split(" "),function(g){function q(a,b,f,d,p){u.call(this,a,b,f,d,p);this.refresh(d)}var u=g("./base"),z=g("zrender/shape/Polyline"),c=g("../util/shape/Icon"),C=g("../util/shape/HalfSmoothPolygon");g("../component/axis");g("../component/grid");g("../component/dataZoom");var k=g("../config");k.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 m=g("../util/ecData"),h=g("zrender/tool/util"),a=g("zrender/tool/color");return q.prototype={type:k.CHART_TYPE_LINE,_buildShape:function(){this.finalPLMap={};this._buildPosition()},_buildHorizontal:function(a,b,f,d){for(var p,l,w,n,A,D,h,k,y,E=this.series,r=f[0][0],c=E[r],B=this.component.xAxis.getAxis(c.xAxisIndex||0),g={},x=0;b>x&&null!=B.getNameByIndex(x);x++){l=B.getCoordByIndex(x);for(var t=0,m=f.length;m>t;t++){p=this.component.yAxis.getAxis(E[f[t][0]].yAxisIndex||0);A=n=h=D=p.getCoord(0);for(var v=0,q=f[t].length;q>v;v++)r=f[t][v],c=E[r],k=c.data[x],y=this.getDataFromOption(k,"-"),g[r]=g[r]||[],d[r]=d[r]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==y?(0<=y?(n-=0y&&(D+=0y&&(d[r].min=y,d[r].minY=w,d[r].minX=l),d[r].maxt;t++)for(v=0,q=f[t].length;q>v;v++)r=f[t][v],c=E[r],k=c.data[x],y=this.getDataFromOption(k,"-"),"-"==y&&this.deepQuery([k,c,this.option],"calculable")&&(C=this.deepQuery([k,c],"symbolSize"),n+=2*C+5,w=n,this.shapeList.push(this._getCalculableItem(r,x,B.getNameByIndex(x),l,w,"horizontal")))}for(var u in g)0x&&null!=B.getNameByIndex(x);x++){w=B.getCoordByIndex(x);for(var t=0,q=f.length;q>t;t++){p=this.component.xAxis.getAxis(E[f[t][0]].xAxisIndex||0);A=n=k=h=p.getCoord(0);for(var v=0,C=f[t].length;C>v;v++)r=f[t][v],g=E[r],c=g.data[x],y=this.getDataFromOption(c,"-"),m[r]=m[r]||[],d[r]=d[r]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==y?(0<=y?(n+=0y&&(h-=0y&&(d[r].min=y,d[r].minX=l,d[r].minY=w),d[r].maxt;t++)for(v=0,C=f[t].length;C>v;v++)r=f[t][v],g=E[r],c=g.data[x],y=this.getDataFromOption(c,"-"),"-"==y&&this.deepQuery([c,g,this.option],"calculable")&&(u=this.deepQuery([c,g],"symbolSize"),n-=2*u+5,l=n,this.shapeList.push(this._getCalculableItem(r,x,B.getNameByIndex(x),l,w,"vertical")))}for(var z in m)0w;w++)for(var A=0,c=f[w].length;c>A;A++){var h=f[w][A],k=b[h];p=this.component.xAxis.getAxis(k.xAxisIndex||0);var y=this.component.yAxis.getAxis(k.yAxisIndex||0),E=y.getCoord(0);l[h]=l[h]||[];d[h]=d[h]||{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 r=0,g=k.data.length;g>r;r++){var m=this.getDataFromOption(k.data[r],"-");if(m instanceof Array){var q=p.getCoord(m[0]),x=y.getCoord(m[1]);l[h].push([q,x,r,m[0],q,E]);d[h].min0>m[0]&&(d[h].min0=m[0],d[h].minY0=x,d[h].minX0=q);d[h].max0m[1]&&(d[h].min1=m[1],d[h].minY1=x,d[h].minX1=q);d[h].max1t;t++){var v=k[t];if("other"!=d&&this._isLarge(l,v))v=this._getLargePointList(l,v);else for(var G=0,K=v.length;K>G;G++)p=c.data[v[G][2]],(this.deepQuery([p,c,this.option],"calculable")||this.deepQuery([p,c],"showAllSymbol")||"categoryAxis"===f.type&&f.isMainAxis(v[G][2])&&"none"!=this.deepQuery([p,c],"symbol"))&&this.shapeList.push(this._getSymbol(A,v[G][2],v[G][3],v[G][0],v[G][1],l));p=new z({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:E,pointList:v,strokeColor:F||q||y,lineWidth:E,lineType:r,smooth:this._getSmooth(c.smooth),smoothConstraint:g,shadowColor:this.query(c,"itemStyle.normal.lineStyle.shadowColor"),shadowBlur:this.query(c,"itemStyle.normal.lineStyle.shadowBlur"),shadowOffsetX:this.query(c,"itemStyle.normal.lineStyle.shadowOffsetX"),shadowOffsetY:this.query(c,"itemStyle.normal.lineStyle.shadowOffsetY")},hoverable:!1,_main:!0,_seriesIndex:A,_orient:l});if(m.pack(p,w[A],A,0,t,w[A].name),this.shapeList.push(p),u)v=new C({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:E,pointList:h.clone(v).concat([[v[v.length-1][4],v[v.length-1][5]],[v[0][4],v[0][5]]]),brushType:"fill",smooth:this._getSmooth(c.smooth),smoothConstraint:g,color:x?x:a.alpha(y,.5)},highlightStyle:{brushType:"fill"},hoverable:!1,_main:!0,_seriesIndex:A,_orient:l}),m.pack(v,w[A],A,0,t,w[A].name),this.shapeList.push(v)}}},_getBbox:function(a,b){var f=this.component.grid.getBbox(),d=this.xMarkMap[a];return null!=d.minX0?[[Math.min(d.minX0,d.maxX0,d.minX1,d.maxX1),Math.min(d.minY0,d.maxY0,d.minY1,d.maxY1)],[Math.max(d.minX0,d.maxX0,d.minX1,d.maxX1),Math.max(d.minY0,d.maxY0,d.minY1,d.maxY1)]]:("horizontal"===b?(f[0][1]=Math.min(d.minY,d.maxY),f[1][1]=Math.max(d.minY,d.maxY)):(f[0][0]=Math.min(d.minX,d.maxX),f[1][0]=Math.max(d.minX,d.maxX)),f)},_isLarge:function(a,b){return 2>b.length?!1:"horizontal"===a?.5>Math.abs(b[0][0]-b[1][0]):.5>Math.abs(b[0][1]-b[1][1])},_getLargePointList:function(a,b){var f;f="horizontal"===a?this.component.grid.getWidth():this.component.grid.getHeight();for(var d=b.length,p=[],l=0;f>l;l++)p[l]=b[Math.floor(d/f*l)];return p},_getSmooth:function(a){return a?.3:0},_getCalculableItem:function(a,b,f,d,p,l){var w=this.series[a].calculableHolderColor||this.ecTheme.calculableHolderColor||k.calculableHolderColor;a=this._getSymbol(a,b,f,d,p,l);return a.style.color=w,a.style.strokeColor=w,a.rotation=[0,0],a.hoverable=!1,a.draggable=!1,a.style.text=void 0,a},_getSymbol:function(a,b,f,d,p,l){var w=this.series[a],n=w.data[b];a=this.getSymbolShape(w,a,n,b,f,d,p,this._sIndex2ShapeMap[a],this._sIndex2ColorMap[a],"#fff","vertical"===l?"horizontal":"vertical");return a.zlevel=this.getZlevelBase(),a.z=this.getZBase()+1,this.deepQuery([n,w,this.option],"calculable")&&(this.setCalculable(a),a.draggable=!0),a},getMarkCoord:function(a,b){var f=this.series[a],d=this.xMarkMap[a],p=this.component.xAxis.getAxis(f.xAxisIndex),f=this.component.yAxis.getAxis(f.yAxisIndex);return!b.type||"max"!==b.type&&"min"!==b.type&&"average"!==b.type?["string"!=typeof b.xAxis&&p.getCoordByIndex?p.getCoordByIndex(b.xAxis||0):p.getCoord(b.xAxis||0),"string"!=typeof b.yAxis&&f.getCoordByIndex?f.getCoordByIndex(b.yAxis||0):f.getCoord(b.yAxis||0)]:(p=null!=b.valueIndex?b.valueIndex:null!=d.maxX0?"1":"",[d[b.type+"X"+p],d[b.type+"Y"+p],d[b.type+"Line"+p],d[b.type+p]])},refresh:function(a){a&&(this.option=a,this.series=a.series);this.backupShapeList();this._buildShape()},ontooltipHover:function(a,b){for(var f,d,p=a.seriesIndex,l=a.dataIndex,w=p.length;w--;)if(f=this.finalPLMap[p[w]])for(var n=0,h=f.length;h>n;n++){d=f[n];for(var c=0,k=d.length;k>c;c++)l===d[c][2]&&b.push(this._getSymbol(p[w],d[c][2],d[c][3],d[c][0],d[c][1],"horizontal"))}},addDataAnimation:function(a){for(var b=this.series,f={},d=0,p=a.length;p>d;d++)f[a[d][0]]=a[d];for(var l,h,n,c,k,d=this.shapeList.length-1;0<=d;d--)if(n=this.shapeList[d]._seriesIndex,f[n]&&!f[n][3]){if(this.shapeList[d]._main&&1m.length))if(k.smooth){var h=z(m.slice(0,-2),k.smooth,!1,k.smoothConstraint);c.moveTo(m[0][0],m[0][1]);for(var a,e,b,f=m.length,d=0;f-3>d;d++)a=h[2*d],e=h[2*d+1],b=m[d+1],c.bezierCurveTo(a[0],a[1],e[0],e[1],b[0],b[1]);c.lineTo(m[f-2][0],m[f-2][1]);c.lineTo(m[f-1][0],m[f-1][1]);c.lineTo(m[0][0],m[0][1])}else g("zrender/shape/Polygon").prototype.buildPath(c,k)}},c.inherits(q,u),q});define("echarts/component/axis","require ./base zrender/shape/Line ../config ../util/ecData zrender/tool/util zrender/tool/color ./categoryAxis ./valueAxis ../component".split(" "),function(g){function q(c,a,e,b,f,d){u.call(this,c,a,e,b,f);this.axisType=d;this._axisList=[];this.refresh(b)}var u=g("./base"),z=g("zrender/shape/Line"),c=g("../config"),C=g("../util/ecData"),k=g("zrender/tool/util"),m=g("zrender/tool/color");return q.prototype={type:c.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var c=this.option.axisLine.lineStyle.width,a=c/2,e={_axisShape:"axisLine",zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1},b=this.grid;switch(this.option.position){case "left":e.style={xStart:b.getX()-a,yStart:b.getYend(),xEnd:b.getX()-a,yEnd:b.getY(),lineCap:"round"};break;case "right":e.style={xStart:b.getXend()+a,yStart:b.getYend(),xEnd:b.getXend()+a,yEnd:b.getY(),lineCap:"round"};break;case "bottom":e.style={xStart:b.getX(),yStart:b.getYend()+a,xEnd:b.getXend(),yEnd:b.getYend()+a,lineCap:"round"};break;case "top":e.style={xStart:b.getX(),yStart:b.getY()-a,xEnd:b.getXend(),yEnd:b.getY()-a,lineCap:"round"}}a=e.style;""!==this.option.name&&(a.text=this.option.name,a.textPosition=this.option.nameLocation,a.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(a.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(a.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(a.textColor=this.option.nameTextStyle.color));a.strokeColor=this.option.axisLine.lineStyle.color;a.lineWidth=c;this.isHorizontal()?a.yStart=a.yEnd=this.subPixelOptimize(a.yEnd,c):a.xStart=a.xEnd=this.subPixelOptimize(a.xEnd,c);a.lineType=this.option.axisLine.lineStyle.type;e=new z(e);this.shapeList.push(e)},_axisLabelClickable:function(c,a){return c?(C.pack(a,void 0,-1,void 0,-1,a.style.text),a.hoverable=!0,a.clickable=!0,a.highlightStyle={color:m.lift(a.style.color,1),brushType:"fill"},a):a},refixAxisShape:function(c,a){if(this.option.axisLine.onZero){var e;if(this.isHorizontal()&&null!=a)for(var b=0,f=this.shapeList.length;f>b;b++)"axisLine"===this.shapeList[b]._axisShape?(this.shapeList[b].style.yStart=this.shapeList[b].style.yEnd=this.subPixelOptimize(a,this.shapeList[b].stylelineWidth),this.zr.modShape(this.shapeList[b].id)):"axisTick"===this.shapeList[b]._axisShape&&(e=this.shapeList[b].style.yEnd-this.shapeList[b].style.yStart,this.shapeList[b].style.yStart=a-e,this.shapeList[b].style.yEnd=a,this.zr.modShape(this.shapeList[b].id));if(!this.isHorizontal()&&null!=c)for(b=0,f=this.shapeList.length;f>b;b++)"axisLine"===this.shapeList[b]._axisShape?(this.shapeList[b].style.xStart=this.shapeList[b].style.xEnd=this.subPixelOptimize(c,this.shapeList[b].stylelineWidth),this.zr.modShape(this.shapeList[b].id)):"axisTick"===this.shapeList[b]._axisShape&&(e=this.shapeList[b].style.xEnd-this.shapeList[b].style.xStart,this.shapeList[b].style.xStart=c,this.shapeList[b].style.xEnd=c+e,this.zr.modShape(this.shapeList[b].id))}},getPosition:function(){return this.option.position},isHorizontal:function(){return"bottom"===this.option.position||"top"===this.option.position}},reformOption:function(h){if(!h||h instanceof Array&&0===h.length?h=[{type:c.COMPONENT_TYPE_AXIS_VALUE}]:h instanceof Array||(h=[h]),2a;a++)h[a].type=h[a].type||"category",h[a].xAxisIndex=a,h[a].yAxisIndex=-1}else for((!h[0].position||"left"!=h[0].position&&"right"!=h[0].position)&&(h[0].position="left"),1a;a++)h[a].type=h[a].type||"value",h[a].xAxisIndex=-1,h[a].yAxisIndex=a;return h},refresh:function(c){var a;c&&(this.option=c,"xAxis"===this.axisType?(this.option.xAxis=this.reformOption(c.xAxis),a=this.option.xAxis):(this.option.yAxis=this.reformOption(c.yAxis),a=this.option.yAxis),this.series=c.series);for(var e=g("./categoryAxis"),b=g("./valueAxis"),f=Math.max(a&&a.length||0,this._axisList.length),d=0;f>d;d++)!this._axisList[d]||!c||a[d]&&this._axisList[d].type==a[d].type||(this._axisList[d].dispose&&this._axisList[d].dispose(),this._axisList[d]=!1),this._axisList[d]?this._axisList[d].refresh&&this._axisList[d].refresh(a?a[d]:!1,this.series):a&&a[d]&&(this._axisList[d]="category"===a[d].type?new e(this.ecTheme,this.messageCenter,this.zr,a[d],this.myChart,this.axisBase):new b(this.ecTheme,this.messageCenter,this.zr,a[d],this.myChart,this.axisBase,this.series))},getAxis:function(c){return this._axisList[c]},clear:function(){for(var c=0,a=this._axisList.length;a>c;c++)this._axisList[c].dispose&&this._axisList[c].dispose();this._axisList=[]}},k.inherits(q,u),g("../component").define("axis",q),q});define("echarts/component/grid","require ./base zrender/shape/Rectangle ../config zrender/tool/util ../component".split(" "),function(g){function q(c,m,h,a,e){u.call(this,c,m,h,a,e);this.refresh(a)}var u=g("./base"),z=g("zrender/shape/Rectangle"),c=g("../config");c.grid={zlevel:0,z:0,x:12,y:60,x2:12,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc"};var C=g("zrender/tool/util");return q.prototype={type:c.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(k){for(var m,h,a=k.xAxis._axisList.concat(k.yAxis?k.yAxis._axisList:[]),e=a.length;e--;)k=a[e],k.type==c.COMPONENT_TYPE_AXIS_VALUE&&0>k._min&&0<=k._max&&(k.isHorizontal()?m=k.getCoord(0):h=k.getCoord(0));if("undefined"!=typeof m||"undefined"!=typeof h)for(e=a.length;e--;)a[e].refixAxisShape(m,h)},refresh:function(c){if(c||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear();this.option=c||this.option;this.option.grid=this.reformOption(this.option.grid);c=this.option.grid;this._zrWidth=this.zr.getWidth();this._zrHeight=this.zr.getHeight();this._x=this.parsePercent(c.x,this._zrWidth);this._y=this.parsePercent(c.y,this._zrHeight);var m=this.parsePercent(c.x2,this._zrWidth),h=this.parsePercent(c.y2,this._zrHeight);this._width="undefined"==typeof c.width?this._zrWidth-this._x-m:this.parsePercent(c.width,this._zrWidth);this._width=0>=this._width?10:this._width;this._height="undefined"==typeof c.height?this._zrHeight-this._y-h:this.parsePercent(c.height,this._zrHeight);this._height=0>=this._height?10:this._height;this._x=this.subPixelOptimize(this._x,c.borderWidth);this._y=this.subPixelOptimize(this._y,c.borderWidth);this.shapeList.push(new z({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:0a;a++)this.zr.addShape(this.shapeList[a]);this._syncFrameShape()},_getLocation:function(){var a,e,b,f,d=this.component.grid;return"horizontal"==this.zoomOption.orient?(b=this.zoomOption.width||d.getWidth(),f=this.zoomOption.height||this._fillerSize,a=null!=this.zoomOption.x?this.zoomOption.x:d.getX(),e=null!=this.zoomOption.y?this.zoomOption.y:this.zr.getHeight()-f-2):(b=this.zoomOption.width||this._fillerSize,f=this.zoomOption.height||d.getHeight(),a=null!=this.zoomOption.x?this.zoomOption.x:2,e=null!=this.zoomOption.y?this.zoomOption.y:d.getY()),{x:a,y:e,width:b,height:f}},_getZoom:function(){var a=this.option.series,e=this.option.xAxis;!e||e instanceof Array||(e=[e],this.option.xAxis=e);var b=this.option.yAxis;!b||b instanceof Array||(b=[b],this.option.yAxis=b);var f,d=[],p=this.zoomOption.xAxisIndex;if(e&&null==p){f=[];for(var c=0,h=e.length;h>c;c++)"category"!=e[c].type&&null!=e[c].type||f.push(c)}else f=p instanceof Array?p:null!=p?[p]:[];if(p=this.zoomOption.yAxisIndex,b&&null==p)for(e=[],c=0,h=b.length;h>c;c++)"category"==b[c].type&&e.push(c);else e=p instanceof Array?p:null!=p?[p]:[];for(var n,c=0,h=a.length;h>c;c++)if(n=a[c],n.type==k.CHART_TYPE_LINE||n.type==k.CHART_TYPE_BAR||n.type==k.CHART_TYPE_SCATTER||n.type==k.CHART_TYPE_K){b=0;for(p=f.length;p>b;b++)if(f[b]==(n.xAxisIndex||0)){d.push(c);break}b=0;for(p=e.length;p>b;b++)if(e[b]==(n.yAxisIndex||0)){d.push(c);break}null==this.zoomOption.xAxisIndex&&null==this.zoomOption.yAxisIndex&&n.data&&this.getDataFromOption(n.data[0])instanceof Array&&(n.type==k.CHART_TYPE_SCATTER||n.type==k.CHART_TYPE_LINE||n.type==k.CHART_TYPE_BAR)&&d.push(c)}a=null!=this._zoom.start?this._zoom.start:null!=this.zoomOption.start?this.zoomOption.start:0;c=null!=this._zoom.end?this._zoom.end:null!=this.zoomOption.end?this.zoomOption.end:100;a>c&&(a+=c,c=a-c,a-=c);return{start:a,end:c,start2:0,end2:100,size:Math.round((c-a)/100*("horizontal"==this.zoomOption.orient?this._location.width:this._location.height)),xAxisIndex:f,yAxisIndex:e,seriesIndex:d,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};for(var a=this.option.xAxis,e=this._zoom.xAxisIndex,b=0,f=e.length;f>b;b++)this._originalData.xAxis[e[b]]=a[e[b]].data;a=this.option.yAxis;e=this._zoom.yAxisIndex;b=0;for(f=e.length;f>b;b++)this._originalData.yAxis[e[b]]=a[e[b]].data;for(var e=this.option.series,d=this._zoom.seriesIndex,b=0,f=d.length;f>b;b++)a=e[d[b]],(this._originalData.series[d[b]]=a.data)&&this.getDataFromOption(a.data[0])instanceof Array&&(a.type==k.CHART_TYPE_SCATTER||a.type==k.CHART_TYPE_LINE||a.type==k.CHART_TYPE_BAR)&&(this._backupScale(),this._calculScatterMap(d[b]))},_calculScatterMap:function(a){this._zoom.scatterMap=this._zoom.scatterMap||{};this._zoom.scatterMap[a]=this._zoom.scatterMap[a]||{};var e=g("../component").get("axis"),b=h.clone(this.option.xAxis);"category"==b[0].type&&(b[0].type="value");b[1]&&"category"==b[1].type&&(b[1].type="value");var b=new e(this.ecTheme,null,!1,{xAxis:b,series:this.option.series},this,"xAxis"),f=this.option.series[a].xAxisIndex||0;this._zoom.scatterMap[a].x=b.getAxis(f).getExtremum();b.dispose();b=h.clone(this.option.yAxis);"category"==b[0].type&&(b[0].type="value");b[1]&&"category"==b[1].type&&(b[1].type="value");b=new e(this.ecTheme,null,!1,{yAxis:b,series:this.option.series},this,"yAxis");f=this.option.series[a].yAxisIndex||0;this._zoom.scatterMap[a].y=b.getAxis(f).getExtremum();b.dispose()},_buildBackground:function(){var a=this._location.width,e=this._location.height;this.shapeList.push(new z({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._location.x,y:this._location.y,width:a,height:e,color:this.zoomOption.backgroundColor}}));for(var b=0,f=this._originalData.xAxis,d=this._zoom.xAxisIndex,p=0,l=d.length;l>p;p++)b=Math.max(b,f[d[p]].length);f=this._originalData.yAxis;d=this._zoom.yAxisIndex;p=0;for(l=d.length;l>p;p++)b=Math.max(b,f[d[p]].length);for(var d=this._zoom.seriesIndex[0],h=this._originalData.series[d],n=Number.MIN_VALUE,m=Number.MAX_VALUE,p=0,l=h.length;l>p;p++)f=this.getDataFromOption(h[p],0),this.option.series[d].type==k.CHART_TYPE_K&&(f=f[1]),isNaN(f)&&(f=0),n=Math.max(n,f),m=Math.min(m,f);var n=n-m,g=[],q=a/(b-(1q?y=Math.floor(3*b/a):"vertical"==this.zoomOption.orient&&1>u&&(y=Math.floor(3*b/e));p=0;for(l=b;l>p;p+=y)f=this.getDataFromOption(h[p],0),this.option.series[d].type==k.CHART_TYPE_K&&(f=f[1]),isNaN(f)&&(f=0),g.push("horizontal"==this.zoomOption.orient?[this._location.x+q*p,this._location.y+e-1-Math.round((f-m)/n*(e-10))]:[this._location.x+1+Math.round((f-m)/n*(a-10)),this._location.y+u*(l-p-1)]);"horizontal"==this.zoomOption.orient?(g.push([this._location.x+a,this._location.y+e]),g.push([this._location.x,this._location.y+e])):(g.push([this._location.x,this._location.y]),g.push([this._location.x,this._location.y+e]));this.shapeList.push(new c({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:g,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 z(this._fillerShae);this.shapeList.push(this._fillerShae)},_buildHandle:function(){var a=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:"\x3d",textPosition:"inside"},highlightStyle:{text:a.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=a.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=a.end,this._endShape.highlightStyle.textPosition="top");this._startShape=new C(this._startShape);this._endShape=new C(this._endShape);this.shapeList.push(this._startShape);this.shapeList.push(this._endShape)},_buildFrame:function(){var a=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:a,y:e,width:this._location.width-(a>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 z(this._startFrameShape);this._endFrameShape=new z(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 a,e;"horizontal"==this.zoomOption.orient?(a=this._startShape.style.x,e=this._endShape.style.x,this._fillerShae.style.x=Math.min(a,e)+this._handleSize,this._fillerShae.style.width=Math.abs(a-e)-this._handleSize,this._zoom.start=(Math.min(a,e)-this._location.x)/this._location.width*100,this._zoom.end=(Math.max(a,e)+this._handleSize-this._location.x)/this._location.width*100):(a=this._startShape.style.y,e=this._endShape.style.y,this._fillerShae.style.y=Math.min(a,e)+this._handleSize,this._fillerShae.style.height=Math.abs(a-e)-this._handleSize,this._zoom.start=(this._location.y+this._location.height-Math.max(a,e))/this._location.height*100,this._zoom.end=(this._location.y+this._location.height-Math.min(a,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(a){var e,b,f,d,c,l;for(l in this._originalData){e=this._originalData[l];for(var h in e)c=e[h],null!=c&&(d=c.length,b=Math.floor(this._zoom.start/100*d),f=Math.ceil(this._zoom.end/100*d),this.getDataFromOption(c[0])instanceof Array&&this.option[l][h].type!=k.CHART_TYPE_K?(this._setScale(),this.option[l][h].data=this._synScatterData(h,c)):this.option[l][h].data=c.slice(b,f))}this._isSilence||!this.zoomOption.realtime&&!a||this.messageCenter.dispatch(k.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(a,e){if(0===this._zoom.start&&100==this._zoom.end&&0===this._zoom.start2&&100==this._zoom.end2)return e;var b,f,d,c,l,h=[],n=this._zoom.scatterMap[a];"horizontal"==this.zoomOption.orient?(b=n.x.max-n.x.min,f=this._zoom.start/100*b+n.x.min,d=this._zoom.end/100*b+n.x.min,b=n.y.max-n.y.min,c=this._zoom.start2/100*b+n.y.min,l=this._zoom.end2/100*b+n.y.min):(b=n.x.max-n.x.min,f=this._zoom.start2/100*b+n.x.min,d=this._zoom.end2/100*b+n.x.min,b=n.y.max-n.y.min,c=this._zoom.start/100*b+n.y.min,l=this._zoom.end/100*b+n.y.min);for(var n=0,m=e.length;m>n;n++)b=e[n].value||e[n],b[0]>=f&&b[0]<=d&&b[1]>=c&&b[1]<=l&&h.push(e[n]);return h},_setScale:function(){var a=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},b;for(b in e)for(var f=0,d=e[b].length;d>f;f++)e[b][f].scale=a||e[b][f]._scale},_backupScale:function(){var a={xAxis:this.option.xAxis,yAxis:this.option.yAxis},e;for(e in a)for(var b=0,f=a[e].length;f>b;b++)a[e][b]._scale=a[e][b].scale},_getDetail:function(){var a="horizontal"==this.zoomOption.orient?"xAxis":"yAxis",e=this._originalData[a],b;for(b in e){var f=e[b];if(null!=f)return e=f.length,a=Math.floor(this._zoom.start/100*e),e=Math.ceil(this._zoom.end/100*e),e-=0=this._location.x+this._location.width?a.style.x=this._location.x+this._location.width-a.style.width-f:a.style.x+=e:a.style.y+b-f<=this._location.y?a.style.y=this._location.y+f:a.style.y+b+a.style.height+f>=this._location.y+this._location.height?a.style.y=this._location.y+this._location.height-a.style.height-f:a.style.y+=b,"filler"==a._type?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),this.zoomOption.showDetail)a=this._getDetail(),this._startShape.style.text=this._startShape.highlightStyle.text=a.start,this._endShape.style.text=this._endShape.highlightStyle.text=a.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="\x3d",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(a,e){this.isDragend&&a.target&&(!this.zoomOption.realtime&&this._syncData(),e.dragOut=!0,e.dragIn=!0,this._isSilence||this.zoomOption.realtime||this.messageCenter.dispatch(k.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),e.needRefresh=!1,this.isDragend=!1)},ondataZoom:function(a,e){e.needRefresh=!0},absoluteZoom:function(a){this._zoom.start=a.start;this._zoom.end=a.end;this._zoom.start2=a.start2;this._zoom.end2=a.end2;this._syncShape();this._syncData(!0)},rectZoom:function(a){if(!a)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(),b=a.x,f=a.y,d=a.width,c=a.height;if(0>d&&(b+=d,d=-d),0>c&&(f+=c,c=-c),b>e.x+e.width||f>e.y+e.height)return!1;be.x+e.width&&(d=e.x+e.width-b);f+c>e.y+e.height&&(c=e.y+e.height-f);var l;a=(b-e.x)/e.width;b=1-(b+d-e.x)/e.width;d=1-(f+c-e.y)/e.height;e=(f-e.y)/e.height;return"horizontal"==this.zoomOption.orient?(l=this._zoom.end-this._zoom.start,this._zoom.start+=l*a,this._zoom.end-=l*b,l=this._zoom.end2-this._zoom.start2,this._zoom.start2+=l*d,this._zoom.end2-=l*e):(l=this._zoom.end-this._zoom.start,this._zoom.start+=l*d,this._zoom.end-=l*e,l=this._zoom.end2-this._zoom.start2,this._zoom.start2+=l*a,this._zoom.end2-=l*b),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(a){for(var e,b=this._originalData.series,f=a.series,d=0,c=f.length;c>d;d++){e=f[d].data||f[d].eventList;a=b[d]?Math.floor(this._zoom.start/100*b[d].length):0;for(var l=0,h=e.length;h>l;l++)b[d]&&(b[d][l+a]=e[l])}},syncOption:function(a){this.silence(!0);this.option=a;this.option.dataZoom=this.reformOption(this.option.dataZoom);this.zoomOption=this.option.dataZoom;this.clear();this._location=this._getLocation();this._zoom=this._getZoom();this._backupData();this.option.dataZoom&&this.option.dataZoom.show&&this._buildShape();this._syncData();this.silence(!1)},silence:function(a){this._isSilence=a},getRealDataIndex:function(a,e){if(!this._originalData||0===this._zoom.start&&100==this._zoom.end)return e;var b=this._originalData.series;return b[a]?Math.floor(this._zoom.start/100*b[a].length)+e:-1},resize:function(){this.clear();this._location=this._getLocation();this._zoom=this._getZoom();this.option.dataZoom.show&&this._buildShape()}},h.inherits(q,u),g("../component").define("dataZoom",q),q});define("echarts/component/categoryAxis","require ./base zrender/shape/Text zrender/shape/Line zrender/shape/Rectangle ../config zrender/tool/util zrender/tool/area ../component".split(" "),function(g){function q(a,e,b,f,d,c){if(1>f.data.length)return void console.error("option.data.length \x3c 1.");u.call(this,a,e,b,f,d);this.grid=this.component.grid;for(var l in c)this[l]=c[l];this.refresh(f)}var u=g("./base"),z=g("zrender/shape/Text"),c=g("zrender/shape/Line"),C=g("zrender/shape/Rectangle"),k=g("../config");k.categoryAxis={zlevel:0,z:0,show:!0,position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!1,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}};var m=g("zrender/tool/util"),h=g("zrender/tool/area");return q.prototype={type:k.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(a){var e=this.getDataFromOption(this.option.data[a]);a=this.option.data[a].formatter||this.option.axisLabel.formatter;return a&&("function"==typeof a?e=a.call(this.myChart,e):"string"==typeof a&&(e=a.replace("{value}",e))),e},_getInterval:function(){var a=this.option.axisLabel.interval;if("auto"==a){var e=this.option.axisLabel.textStyle.fontSize,b=this.option.data,f=this.option.data.length;if(this.isHorizontal())if(3n?1:n,a=Math.floor(15/l);!k&&f>a;){a+=n;k=!0;d=Math.floor(l*a);for(var g=Math.floor((f-1)/a)*a;0<=g;g-=a){if(0!==this.option.axisLabel.rotate)c=e;else if(b[g].textStyle)c=h.getTextWidth(this._getReformedLabel(g),this.getFont(m.merge(b[g].textStyle,this.option.axisLabel.textStyle)));else{c=this._getReformedLabel(g)+"";var q=(c.match(/\w/g)||"").length;c=q*e*2/3+(c.length-q)*e}if(c>d){k=!1;break}}}else a=1;else if(3l*a-6&&f>a;)a++;else a=1}else a="function"==typeof a?1:a-0+1;return a},_buildShape:function(){if(this._interval=this._getInterval(),this.option.show){this.option.splitArea.show&&this._buildSplitArea();this.option.splitLine.show&&this._buildSplitLine();this.option.axisLine.show&&this._buildAxisLine();this.option.axisTick.show&&this._buildAxisTick();this.option.axisLabel.show&&this._buildAxisLabel();for(var a=0,e=this.shapeList.length;e>a;a++)this.zr.addShape(this.shapeList[a])}},_buildAxisTick:function(){var a,e=this.option.data,b=this.option.data.length,f=this.option.axisTick,d=f.length,p=f.lineStyle.color,l=f.lineStyle.width,h="function"==typeof f.interval?f.interval:"auto"==f.interval&&"function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,n=h?1:"auto"==f.interval?this._interval:f.interval-0+1,m=f.onGap,m=m?this.getGap()/2:"undefined"==typeof m&&this.option.boundaryGap?this.getGap()/2:0,k=0k;k+=n)h&&!h(k,e[k])||(g=this.subPixelOptimize(this.getCoordByIndex(k)+(0<=k?m:0),l),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:g,yStart:q,xEnd:g,yEnd:q+d,strokeColor:p,lineWidth:l}},this.shapeList.push(new c(a)));else for(g="left"==this.option.position?f.inside?this.grid.getX()+1:this.grid.getX()-d-1:f.inside?this.grid.getXend()-d-1:this.grid.getXend()+1;b>k;k+=n)h&&!h(k,e[k])||(q=this.subPixelOptimize(this.getCoordByIndex(k)-(0<=k?m:0),l),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:g,yStart:q,xEnd:g+d,yEnd:q,strokeColor:p,lineWidth:l}},this.shapeList.push(new c(a)))},_buildAxisLabel:function(){var a,e,b=this.option.data,f=this.option.data.length,d=this.option.axisLabel,c=d.rotate,l=d.margin,h=d.clickable,n=d.textStyle,d="function"==typeof d.interval?d.interval:!1;if(this.isHorizontal()){var k,g;"bottom"==this.option.position?(k=this.grid.getYend()+l,g="top"):(k=this.grid.getY()-l,g="bottom");for(l=0;f>l;l+=this._interval)d&&!d(l,b[l])||""===this._getReformedLabel(l)||(e=m.merge(b[l].textStyle||{},n),a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoordByIndex(l),y:k,color:e.color,text:this._getReformedLabel(l),textFont:this.getFont(e),textAlign:e.align||"center",textBaseline:e.baseline||g}},c&&(a.style.textAlign=0l;l+=this._interval)d&&!d(l,b[l])||""===this._getReformedLabel(l)||(e=m.merge(b[l].textStyle||{},n),a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:q,y:this.getCoordByIndex(l),color:e.color,text:this._getReformedLabel(l),textFont:this.getFont(e),textAlign:e.align||u,textBaseline:e.baseline||0===l&&""!==this.option.name?"bottom":l==f-1&&""!==this.option.name?"top":"middle"}},c&&(a.rotation=[c*Math.PI/180,a.style.x,a.style.y]),this.shapeList.push(new z(this._axisLabelClickable(h,a))))}},_buildSplitLine:function(){var a,e=this.option.data,b=this.option.data.length,f=this.option.splitLine,d=f.lineStyle.type,p=f.lineStyle.width,l=f.lineStyle.color,l=l instanceof Array?l:[l],h=l.length,n="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,k=f.onGap,f=k?this.getGap()/2:"undefined"==typeof k&&this.option.boundaryGap?this.getGap()/2:0;if(b-=k||"undefined"==typeof k&&this.option.boundaryGap?1:0,this.isHorizontal())for(var m,g=this.grid.getY(),q=this.grid.getYend(),k=0;b>k;k+=this._interval)n&&!n(k,e[k])||(m=this.subPixelOptimize(this.getCoordByIndex(k)+f,p),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:m,yStart:g,xEnd:m,yEnd:q,strokeColor:l[k/this._interval%h],lineType:d,lineWidth:p}},this.shapeList.push(new c(a)));else for(m=this.grid.getX(),q=this.grid.getXend(),k=0;b>k;k+=this._interval)n&&!n(k,e[k])||(g=this.subPixelOptimize(this.getCoordByIndex(k)-f,p),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:m,yStart:g,xEnd:q,yEnd:g,strokeColor:l[k/this._interval%h],lineType:d,lineWidth:p}},this.shapeList.push(new c(a)))},_buildSplitArea:function(){var a,e=this.option.data,b=this.option.splitArea,f=b.areaStyle.color;if(f instanceof Array){var d=f.length,c=this.option.data.length,l="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,b=(b=b.onGap)?this.getGap()/2:"undefined"==typeof b&&this.option.boundaryGap?this.getGap()/2:0;if(this.isHorizontal())for(var h,n=this.grid.getY(),k=this.grid.getHeight(),m=this.grid.getX(),g=0;c>=g;g+=this._interval)l&&!l(g,e[g])&&c>g||(h=c>g?this.getCoordByIndex(g)+b:this.grid.getXend(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:m,y:n,width:h-m,height:k,color:f[g/this._interval%d]}},this.shapeList.push(new C(a)),m=h);else for(h=this.grid.getX(),k=this.grid.getWidth(),m=this.grid.getYend(),g=0;c>=g;g+=this._interval)l&&!l(g,e[g])&&c>g||(n=c>g?this.getCoordByIndex(g)-b:this.grid.getY(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:h,y:n,width:k,height:m-n,color:f[g/this._interval%d]}},this.shapeList.push(new C(a)),m=n)}else a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:f}},this.shapeList.push(new C(a))},refresh:function(a){a&&(this.option=this.reformOption(a),this.option.axisLabel.textStyle=this.getTextStyle(this.option.axisLabel.textStyle));this.clear();this._buildShape()},getGap:function(){var a=this.option.data.length,e=this.isHorizontal()?this.grid.getWidth():this.grid.getHeight();return this.option.boundaryGap?e/a:e/(1c;c++){if(this.getDataFromOption(e[c])==a)return this.isHorizontal()?this.grid.getX()+d:this.grid.getYend()-d;d+=f}},getCoordByIndex:function(a){if(0>a)return this.isHorizontal()?this.grid.getX():this.grid.getYend();if(a>this.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var e=this.getGap(),b=this.option.boundaryGap?e/2:0;return b+=a*e,this.isHorizontal()?this.grid.getX()+b:this.grid.getYend()-b},getNameByIndex:function(a){return this.getDataFromOption(this.option.data[a])},getIndexByName:function(a){for(var e=this.option.data,b=e.length,f=0;b>f;f++)if(this.getDataFromOption(e[f])==a)return f;return-1},getValueFromCoord:function(){return""},isMainAxis:function(a){return 0===a%this._interval}},m.inherits(q,u),g("../component").define("categoryAxis",q),q});define("echarts/component/valueAxis","require ./base zrender/shape/Text zrender/shape/Line zrender/shape/Rectangle ../config ../util/date zrender/tool/util ../util/smartSteps ../util/accMath ../component".split(" "),function(g){function q(a,e,b,f,d,c,l){if(!l||0===l.length)return void console.err("option.series.length \x3d\x3d 0.");u.call(this,a,e,b,f,d);this.series=l;this.grid=this.component.grid;for(var h in c)this[h]=c[h];this.refresh(f,l)}var u=g("./base"),z=g("zrender/shape/Text"),c=g("zrender/shape/Line"),C=g("zrender/shape/Rectangle"),k=g("../config");k.valueAxis={zlevel:0,z:0,show:!0,position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],axisLine:{show:!1,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:-1,textStyle:{align:"left",baseline:"bottom",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)"]}}};var m=g("../util/date"),h=g("zrender/tool/util");return q.prototype={type:k.COMPONENT_TYPE_AXIS_VALUE,_buildShape:function(){if(this._hasData=!1,this._calculateValue(),this._hasData&&this.option.show){this.option.splitArea.show&&this._buildSplitArea();this.option.splitLine.show&&this._buildSplitLine();this.option.axisLine.show&&this._buildAxisLine();this.option.axisTick.show&&this._buildAxisTick();this.option.axisLabel.show&&this._buildAxisLabel();for(var a=0,e=this.shapeList.length;e>a;a++)this.zr.addShape(this.shapeList[a])}},_buildAxisTick:function(){var a,e=this._valueList,b=this._valueList.length,f=this.option.axisTick,d=f.length,h=f.lineStyle.color,l=f.lineStyle.width;if(this.isHorizontal())for(var k="bottom"===this.option.position?f.inside?this.grid.getYend()-d-1:this.grid.getYend()+1:f.inside?this.grid.getY()+1:this.grid.getY()-d-1,f=0;b>f;f++)a=this.subPixelOptimize(this.getCoord(e[f]),l),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:a,yStart:k,xEnd:a,yEnd:k+d,strokeColor:h,lineWidth:l}},this.shapeList.push(new c(a));else for(k="left"===this.option.position?f.inside?this.grid.getX()+1:this.grid.getX()-d-1:f.inside?this.grid.getXend()-d-1:this.grid.getXend()+1,f=0;b>f;f++)a=this.subPixelOptimize(this.getCoord(e[f]),l),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:k,yStart:a,xEnd:k+d,yEnd:a,strokeColor:h,lineWidth:l}},this.shapeList.push(new c(a))},_buildAxisLabel:function(){var a,e=this._valueList,b=this._valueList.length,f=this.option.axisLabel.rotate;a=this.option.axisLabel.margin;var d=this.option.axisLabel.clickable,c=this.option.axisLabel.textStyle;if(this.isHorizontal()){var l,h;"bottom"===this.option.position?(l=this.grid.getYend()+a,h="top"):(l=this.grid.getY()-a,h="bottom");for(var k=0;b>k;k++)a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoord(e[k]),y:l,color:"function"==typeof c.color?c.color(e[k]):c.color,text:this._valueLabel[k],textFont:this.getFont(c),textAlign:c.align||"center",textBaseline:c.baseline||h}},f&&(a.style.textAlign=0k;k++)a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:g,y:this.getCoord(e[k]),color:"function"==typeof c.color?c.color(e[k]):c.color,text:this._valueLabel[k],textFont:this.getFont(c),textAlign:c.align||m,textBaseline:c.baseline||(0===k&&""!==this.option.name?"bottom":k===b-1&&""!==this.option.name?"top":"middle")}},f&&(a.rotation=[f*Math.PI/180,a.style.x,a.style.y]),this.shapeList.push(new z(this._axisLabelClickable(d,a)))}},_buildSplitLine:function(){var a,e=this._valueList,b=this._valueList.length,f=this.option.splitLine,d=f.lineStyle.type,k=f.lineStyle.width,f=f.lineStyle.color,f=f instanceof Array?f:[f],l=f.length;if(this.isHorizontal())for(var h=this.grid.getY(),g=this.grid.getYend(),m=0;b>m;m++)a=this.subPixelOptimize(this.getCoord(e[m]),k),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:a,yStart:h,xEnd:a,yEnd:g,strokeColor:f[m%l],lineType:d,lineWidth:k}},this.shapeList.push(new c(a));else for(h=this.grid.getX(),g=this.grid.getXend(),m=0;b>m;m++)a=this.subPixelOptimize(this.getCoord(e[m]),k),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:h,yStart:a,xEnd:g,yEnd:a,strokeColor:f[m%l],lineType:d,lineWidth:k}},this.shapeList.push(new c(a))},_buildSplitArea:function(){var a,e=this.option.splitArea.areaStyle.color;if(e instanceof Array){var b=e.length,f=this._valueList,d=this._valueList.length;if(this.isHorizontal()){var c,k=this.grid.getY(),h=this.grid.getHeight();a=this.grid.getX();for(var g=0;d>=g;g++)c=d>g?this.getCoord(f[g]):this.grid.getXend(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:a,y:k,width:c-a,height:h,color:e[g%b]}},this.shapeList.push(new C(a)),a=c}else for(k=this.grid.getX(),h=this.grid.getWidth(),a=this.grid.getYend(),g=0;d>=g;g++)c=d>g?this.getCoord(f[g]):this.grid.getY(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:k,y:c,width:h,height:a-c,color:e[g%b]}},this.shapeList.push(new C(a)),a=c}else a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:e}},this.shapeList.push(new C(a))},_calculateValue:function(){if(isNaN(this.option.min-0)||isNaN(this.option.max-0)){for(var a,e,b={},c=this.component.legend,d=0,h=this.series.length;h>d;d++)!(this.series[d].type!=k.CHART_TYPE_LINE&&this.series[d].type!=k.CHART_TYPE_BAR&&this.series[d].type!=k.CHART_TYPE_SCATTER&&this.series[d].type!=k.CHART_TYPE_K&&this.series[d].type!=k.CHART_TYPE_EVENTRIVER||c&&!c.isSelected(this.series[d].name)||(a=this.series[d].xAxisIndex||0,e=this.series[d].yAxisIndex||0,this.option.xAxisIndex!=a&&this.option.yAxisIndex!=e||!this._calculSum(b,d)));for(d in b){a=b[d];e=0;for(c=a.length;c>e;e++)if(!isNaN(a[e])){this._hasData=!0;this._min=a[e];this._max=a[e];break}if(this._hasData)break}for(d in b)for(a=b[d],e=0,c=a.length;c>e;e++)isNaN(a[e])||(this._min=Math.min(this._min,a[e]),this._max=Math.max(this._max,a[e]));b=Math.abs(this._max-this._min);this._min=isNaN(this.option.min-0)?this._min-Math.abs(b*this.option.boundaryGap[0]):this.option.min-0;this._max=isNaN(this.option.max-0)?this._max+Math.abs(b*this.option.boundaryGap[1]):this.option.max-0;this._min===this._max&&(0===this._max?this._max=1:0g;g++)b=this.getDataFromOption(c[g]),"-"!==b&&(b-=0,0<=b?null!=a[h][g]?a[h][g]+=b:a[h][g]=b:null!=a[l][g]?a[l][g]+=b:a[l][g]=b,this.option.scale&&a[d].push(b))}else if(a[d]=a[d]||[],this.series[e].type!=k.CHART_TYPE_EVENTRIVER)for(c=this.series[e].data,g=0,n=c.length;n>g;g++)b=this.getDataFromOption(c[g]),this.series[e].type===k.CHART_TYPE_K?(a[d].push(b[0]),a[d].push(b[1]),a[d].push(b[2]),a[d].push(b[3])):b instanceof Array?(-1!=this.option.xAxisIndex&&a[d].push("time"!=this.option.type?b[0]:m.getNewDate(b[0])),-1!=this.option.yAxisIndex&&a[d].push("time"!=this.option.type?b[1]:m.getNewDate(b[1]))):a[d].push(b);else for(c=this.series[e].eventList,g=0,n=c.length;n>g;g++)for(b=c[g].evolution,h=0,l=b.length;l>h;h++)a[d].push(m.getNewDate(b[h].time))},_reformValue:function(a){var c=g("../util/smartSteps"),b=this.option.splitNumber;!a&&0<=this._min&&0<=this._max&&(this._min=0);!a&&0>=this._min&&0>=this._max&&(this._max=0);a=c(this._min,this._max,b);this._min=a.min;this._max=a.max;this._valueList=a.pnts;this._reformLabelData()},_reformTimeValue:function(){var a=null!=this.option.splitNumber?this.option.splitNumber:5,c=m.getAutoFormatter(this._min,this._max,a),b=c.formatter,f=c.gapValue;this._valueList=[m.getNewDate(this._min)];var d;switch(b){case "week":d=m.nextMonday(this._min);break;case "month":d=m.nextNthOnMonth(this._min,1);break;case "quarter":d=m.nextNthOnQuarterYear(this._min,1);break;case "half-year":d=m.nextNthOnHalfYear(this._min,1);break;case "year":d=m.nextNthOnYear(this._min,1);break;default:72E5>=f?d=(Math.floor(this._min/f)+1)*f:(d=m.getNewDate(this._min- -f),d.setHours(6*Math.round(d.getHours()/6)),d.setMinutes(0),d.setSeconds(0))}d-this._min=f;f++)this._valueList.push(a.accAdd(this._min,a.accMul(b,f)));this._reformLabelData()},_reformLabelData:function(a){this._valueLabel=[];var c=this.option.axisLabel.formatter;if(c)for(var b=0,f=this._valueList.length;f>b;b++)"function"==typeof c?this._valueLabel.push(a?c.call(this.myChart,this._valueList[b],a):c.call(this.myChart,this._valueList[b])):"string"==typeof c&&this._valueLabel.push(a?m.format(c,this._valueList[b]):c.replace("{value}",this._valueList[b]));else if(a)for(b=0,f=this._valueList.length;f>b;b++)this._valueLabel.push(m.format(a,this._valueList[b]));else for(b=0,f=this._valueList.length;f>b;b++)this._valueLabel.push(this.numAddCommas(this._valueList[b]))},getExtremum:function(){return this._calculateValue(),{min:this._min,max:this._max}},refresh:function(a,c){a&&(this.option=this.reformOption(a),this.option.axisLabel.textStyle=h.merge(this.option.axisLabel.textStyle||{},this.ecTheme.textStyle),this.series=c);this.zr&&(this.clear(),this._buildShape())},getCoord:function(a){a=athis._max?this._max:a;return this.isHorizontal()?this.grid.getX()+(a-this._min)/(this._max-this._min)*this.grid.getWidth():this.grid.getYend()-(a-this._min)/(this._max-this._min)*this.grid.getHeight()},getCoordSize:function(a){return Math.abs(this.isHorizontal()?a/(this._max-this._min)*this.grid.getWidth():a/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(a){var c;return this.isHorizontal()?(a=athis.grid.getXend()?this.grid.getXend():a,c=this._min+(a-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(a=athis.grid.getYend()?this.grid.getYend():a,c=this._max-(a-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),c.toFixed(2)-0},isMaindAxis:function(a){for(var c=0,b=this._valueList.length;b>c;c++)if(this._valueList[c]===a)return!0;return!1}},h.inherits(q,u),g("../component").define("valueAxis",q),q});define("echarts/util/date",[],function(){function g(c){return 10>c?"0"+c:c}function q(c,g,k){return c=u(c),c.setMonth(Math.ceil((c.getMonth()+1)/k)*k),c.setDate(g),c}function u(c){return c instanceof Date?c:new Date("string"==typeof c?c.replace(/-/g,"/"):c)}var z=[{formatter:"hh : mm : ss",value:1E3},{formatter:"hh : mm : ss",value:5E3},{formatter:"hh : mm : ss",value:1E4},{formatter:"hh : mm : ss",value:15E3},{formatter:"hh : mm : ss",value:3E4},{formatter:"hh : mm\nMM - dd",value:6E4},{formatter:"hh : mm\nMM - dd",value:3E5},{formatter:"hh : mm\nMM - dd",value:6E5},{formatter:"hh : mm\nMM - dd",value:9E5},{formatter:"hh : mm\nMM - dd",value:18E5},{formatter:"hh : mm\nMM - dd",value:36E5},{formatter:"hh : mm\nMM - dd",value:72E5},{formatter:"hh : mm\nMM - dd",value:216E5},{formatter:"hh : mm\nMM - dd",value:432E5},{formatter:"MM - dd\nyyyy",value:864E5},{formatter:"week",value:6048E5},{formatter:"month",value:26784E5},{formatter:"quarter",value:8208E6},{formatter:"half-year",value:16416E6},{formatter:"year",value:32832E6}];return{getAutoFormatter:function(c,g,k){k=1b;b++)if(m=z[b].value,h=Math.ceil(g/m)*m-Math.floor(c/m)*m,Math.round(h/m)<=1.2*k){a=z[b].formatter;e=z[b].value;break}return null==a&&(a="year",m=317088E5,h=Math.ceil(g/m)*m-Math.floor(c/m)*m,e=Math.round(h/(k-1)/m)*m),{formatter:a,gapValue:e}},getNewDate:u,format:function(c,q){"week"!=c&&"month"!=c&&"quarter"!=c&&"half-year"!=c&&"year"!=c||(c="MM - dd\nyyyy");var k=u(q),m=k.getFullYear(),h=k.getMonth()+1,a=k.getDate(),e=k.getHours(),b=k.getMinutes(),k=k.getSeconds();return c=c.replace("MM",g(h)),c=c.toLowerCase(),c=c.replace("yyyy",m),c=c.replace("yy",m%100),c=c.replace("dd",g(a)),c=c.replace("d",a),c=c.replace("hh",g(e)),c=c.replace("h",e),c=c.replace("mm",g(b)),c=c.replace("m",b),c=c.replace("ss",g(k)),c.replace("s",k)},nextMonday:function(c){return c=u(c),c.setDate(c.getDate()+8-c.getDay()),c},nextNthPerNmonth:q,nextNthOnMonth:function(c,g){return q(c,g,1)},nextNthOnQuarterYear:function(c,g){return q(c,g,3)},nextNthOnHalfYear:function(c,g){return q(c,g,6)},nextNthOnYear:function(c,g){return q(c,g,12)}}});define("echarts/util/smartSteps",[],function(){function g(a,c,d,g){g=g||0;var h=q((c-a)/d,-1);a=q(a,-1,1);c=q(c,-1);var k=n.min(h.e,a.e,c.e);0===a.c?k=n.min(h.e,c.e):0===c.c&&(k=n.min(h.e,a.e));u(h,{c:0,e:k});u(a,h,1);u(c,h);g+=k;a=a.c;c=c.c;for(var h=(c-a)/d,k=n.pow(10,g),l=0,m=[],p=d+1;p--;)m[p]=(a+h*p)*k;if(0>g)for(p=k,l=(p=(+p).toFixed(15).split("."),p.pop().replace(/0+$/,"").length),h=+(h*k).toFixed(l),a=+(a*k).toFixed(l),c=+(c*k).toFixed(l),p=m.length;p--;)m[p]=m[p].toFixed(l),0===+m[p]&&(m[p]="0");else a*=k,c*=k,h*=k;return f=0,b=0,e=0,{min:a,max:c,secs:d,step:h,fix:l,exp:g,pnts:m}}function q(a,b,c){b=A(b%10)||2;0>b&&(a===D(a)?b=(""+H(a)).replace(/0+$/,"").length||1:(a=a.toFixed(15).replace(/0+$/,""),b=a.replace(".","").replace(/^[-0]+/,"").length,a=+a));var d=D(n.log(H(a))/n.LN10)-b+1;a=+(a*n.pow(10,-d)).toFixed(15)||0;return a=c?D(a):I(a),!a&&(d=0),(""+H(a)).length>b&&(d+=1,a/=10),{c:a,e:d}}function u(a,b,c){(b=b.e-a.e)&&(a.e+=b,a.c*=n.pow(10,-b),a.c=c?D(a.c):I(a.c))}function z(a,b,c){a.eb[d];)d++;if(!b[d])for(c/=10,a.e+=1,d=0;c>b[d];)d++;return a.c=b[d],a}function C(a,e,l){var F=l||+f.slice(-1),B=c((e-a)/F,b),w=q(e-a),x=q(a,-1,1),t=q(e,-1);u(w,B);u(x,B,1);u(t,B);if(l){var w=F,C,v;C=t.c;for(B=(t.c-x.c)/w-1;C>x.c;)B=c(B+1,b),B=B.c*n.pow(10,B.e),C=B*w,v=I(t.c/B)*B,C=v-C;w=x.c-C-(v-t.c);w>1.1*B&&(w=A(w/B/2)*B,C+=w,v+=w);x.c=C;t.c=v}else F=k(x,t);if(a===D(a)&&e===D(e)&&0<=a*e){if(F>e-a)return m(a,e,F);v=t.c-x.c;B=v/F*n.pow(10,t.e);B!==D(B)&&(B=D(B),v=B*F,e-a>v&&(B+=1,v=B*F,!l&&B*(F-1)>=e-a&&(--F,v=B*F)),v>=e-a)&&(l=v-(e-a),x.c=A(a-l/2),t.c=A(e+l/2),x.e=0,t.e=0)}l=h(a,e,x.c,t.c);x.c=l[0];t.c=l[1];if(d||p)d?(a=q(a,4,1),6e?2*e:e}function m(a,b,c){if(c=c||5,d)b=a+c;else if(p)a=b-c;else{var e=c-(b-a),f=A(a-e/2),e=A(b+e/2);b=h(a,b,f,e);a=b[0];b=b[1]}return g(a,b,c)}function h(a,b,c,d){return 0<=a&&0>c?(d-=c,c=0):0>=b&&0H(b/e)&&(b=0);1E-6>H(a/e)&&(a=0);var h,k,l=[[5,10],[10,2],[50,10],[100,2]],m=[],n=q(b-a,3);a=q(a,-1,1);var p=q(b,-1);u(a,n,1);u(p,n);e=p.c-a.c;n.c=e;for(var w=d.length;w--;){c=d[w];b=I(e/c);h=b*c-e;k=3*(h+3);k+=2*(c-d[0]+2);0===c%5&&(k-=10);for(var z=l.length;z--;)0===b%l[z][0]&&(k/=l[z][1]);[c,b,h,k].join();m[w]={secs:c,step:b,delta:h,score:k}}return m.sort(function(a,b){return a.score-b.score}),m=m[0],a.c=A(a.c-m.delta/2),p.c=A(p.c+m.delta/2),g(a.c,p.c,m.secs,n.e)}var e,b,f,d,p,l=[10,20,25,50],w=[4,5,6],n=Math,A=n.round,D=n.floor,I=n.ceil,H=n.abs;return function(c,g,h,k){e=k||{};b=e.steps||l;f=e.secs||w;h=A(+h||0)%99;c=+c||0;g=+g||0;d=p=0;"min"in e&&(c=+e.min||0,d=1);"max"in e&&(g=+e.max||0,p=1);c>g&&(g=[c,c=g][0]);k=g-c;if(d&&p)return a(c,g,h);if((h||5)>k){if(c===D(c)&&g===D(g))return m(c,g,h);if(0===k)return h=h||5,k=n.min(H(g/h),h)/2.1,d?g=c+k:p?c=g-k:(c-=k,g+=k),C(c,g,h)}return C(c,g,h)}});