define("echarts/chart/k","require ./base ../util/shape/Candle ../component/axis ../component/grid ../component/dataZoom ../config ../util/ecData zrender/tool/util ../chart".split(" "),function(l){function q(k,e,a,b,c){u.call(this,k,e,a,b,c);this.refresh(b)}var u=l("./base"),v=l("../util/shape/Candle");l("../component/axis");l("../component/grid");l("../component/dataZoom");var g=l("../config");g.k={zlevel:0,z:2,clickable:!0,hoverable:!0,legendHoverLink:!1,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}};var t=l("../util/ecData"),m=l("zrender/tool/util");return q.prototype={type:g.CHART_TYPE_K,_buildShape:function(){var k=this.series;this.selectedMap={};for(var e,a={top:[],bottom:[]},b=0,c=k.length;c>b;b++)k[b].type===g.CHART_TYPE_K&&(k[b]=this.reformOption(k[b]),this.legendHoverLink=k[b].legendHoverLink||this.legendHoverLink,e=this.component.xAxis.getAxis(k[b].xAxisIndex),e.type===g.COMPONENT_TYPE_AXIS_CATEGORY&&a[e.getPosition()].push(b));for(var d in a)0b;b++)this.buildMark(e[b])},_mapData:function(k){for(var e,a,b=this.series,c=this.component.legend,d=[],f=0,n=0,h=k.length;h>n;n++)e=b[k[n]],a=e.name,this.selectedMap[a]=c?c.isSelected(a):!0,this.selectedMap[a]&&d.push(k[n]),f=Math.max(f,e.data.length);return{locationMap:d,maxDataLength:f}},_buildHorizontal:function(k,e,a){for(var b,c,d,f,n,h,F=this.series,p={},g=0,m=a.length;m>g;g++){b=a[g];c=F[b];d=c.xAxisIndex||0;d=this.component.xAxis.getAxis(d);n=c.barWidth||Math.floor(d.getGap()/2);(f=c.barMaxWidth)&&n>f&&(n=f);f=c.yAxisIndex||0;f=this.component.yAxis.getAxis(f);p[b]=[];for(var r=0,l=e;l>r&&null!=d.getNameByIndex(r);r++)h=c.data[r],h=this.getDataFromOption(h,"-"),"-"!==h&&4==h.length&&p[b].push([d.getCoordByIndex(r),n,f.getCoord(h[0]),f.getCoord(h[1]),f.getCoord(h[2]),f.getCoord(h[3]),r,d.getNameByIndex(r)])}this._buildKLine(k,p)},_buildKLine:function(k,e){for(var a,b,c,d,f,n,h,F,p,m,l,r,q,z,H,I,A=this.series,w=0,t=k.length;t>w;w++)if(I=k[w],l=A[I],q=e[I],this._isLarge(q)&&(q=this._getLargePointList(q)),l.type===g.CHART_TYPE_K&&null!=q){r=l;a=this.query(r,"itemStyle.normal.lineStyle.width");b=this.query(r,"itemStyle.normal.lineStyle.color");c=this.query(r,"itemStyle.normal.lineStyle.color0");d=this.query(r,"itemStyle.normal.color");f=this.query(r,"itemStyle.normal.color0");n=this.query(r,"itemStyle.emphasis.lineStyle.width");h=this.query(r,"itemStyle.emphasis.lineStyle.color");F=this.query(r,"itemStyle.emphasis.lineStyle.color0");p=this.query(r,"itemStyle.emphasis.color");m=this.query(r,"itemStyle.emphasis.color0");for(var y=0,x=q.length;x>y;y++)z=q[y],r=l.data[z[6]],H=z[3]k[0][1]},_getLargePointList:function(k){for(var e=this.component.grid.getWidth(),a=k.length,b=[],c=0;e>c;c++)b[c]=k[Math.floor(a/e*c)];return b},_getCandle:function(k,e,a,b,c,d,f,n,h,g,p,m,l,r,q){var z=this.series;b={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery([z[k].data[e],z[k]],"clickable"),hoverable:this.deepQuery([z[k].data[e],z[k]],"hoverable"),style:{x:b,y:[d,f,n,h],width:c,color:g,strokeColor:m,lineWidth:p,brushType:"both"},highlightStyle:{color:l,strokeColor:q,lineWidth:r},_seriesIndex:k};return t.pack(b,z[k],k,z[k].data[e],e,a),new v(b)},getMarkCoord:function(k,e){var a=this.series[k],b=this.component.xAxis.getAxis(a.xAxisIndex),a=this.component.yAxis.getAxis(a.yAxisIndex);return["string"!=typeof e.xAxis&&b.getCoordByIndex?b.getCoordByIndex(e.xAxis||0):b.getCoord(e.xAxis||0),"string"!=typeof e.yAxis&&a.getCoordByIndex?a.getCoordByIndex(e.yAxis||0):a.getCoord(e.yAxis||0)]},refresh:function(k){k&&(this.option=k,this.series=k.series);this.backupShapeList();this._buildShape()},addDataAnimation:function(k){for(var e=this.series,a={},b=0,c=k.length;c>b;b++)a[k[b][0]]=k[b];for(var d,f,n,b=0,c=this.shapeList.length;c>b;b++)if(f=this.shapeList[b]._seriesIndex,a[f]&&!a[f][3]&&"candle"===this.shapeList[b].type)(n=t.get(this.shapeList[b],"dataIndex"),d=e[f],a[f][2]&&n===d.data.length-1)?this.zr.delShape(this.shapeList[b].id):a[f][2]||0!==n?(k=this.component.xAxis.getAxis(d.xAxisIndex||0).getGap(),k=a[f][2]?k:-k,this.zr.animate(this.shapeList[b].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[k,0]}).start()):this.zr.delShape(this.shapeList[b].id)}},m.inherits(q,u),l("../chart").define("k",q),q});define("echarts/component/axis","require ./base zrender/shape/Line ../config ../util/ecData zrender/tool/util zrender/tool/color ./categoryAxis ./valueAxis ../component".split(" "),function(l){function q(e,a,b,c,d,f){u.call(this,e,a,b,c,d);this.axisType=f;this._axisList=[];this.refresh(c)}var u=l("./base"),v=l("zrender/shape/Line"),g=l("../config"),t=l("../util/ecData"),m=l("zrender/tool/util"),k=l("zrender/tool/color");return q.prototype={type:g.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,a=e/2,b={_axisShape:"axisLine",zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1},c=this.grid;switch(this.option.position){case "left":b.style={xStart:c.getX()-a,yStart:c.getYend(),xEnd:c.getX()-a,yEnd:c.getY(),lineCap:"round"};break;case "right":b.style={xStart:c.getXend()+a,yStart:c.getYend(),xEnd:c.getXend()+a,yEnd:c.getY(),lineCap:"round"};break;case "bottom":b.style={xStart:c.getX(),yStart:c.getYend()+a,xEnd:c.getXend(),yEnd:c.getYend()+a,lineCap:"round"};break;case "top":b.style={xStart:c.getX(),yStart:c.getY()-a,xEnd:c.getXend(),yEnd:c.getY()-a,lineCap:"round"}}a=b.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=e;this.isHorizontal()?a.yStart=a.yEnd=this.subPixelOptimize(a.yEnd,e):a.xStart=a.xEnd=this.subPixelOptimize(a.xEnd,e);a.lineType=this.option.axisLine.lineStyle.type;b=new v(b);this.shapeList.push(b)},_axisLabelClickable:function(e,a){return e?(t.pack(a,void 0,-1,void 0,-1,a.style.text),a.hoverable=!0,a.clickable=!0,a.highlightStyle={color:k.lift(a.style.color,1),brushType:"fill"},a):a},refixAxisShape:function(e,a){if(this.option.axisLine.onZero){var b;if(this.isHorizontal()&&null!=a)for(var c=0,d=this.shapeList.length;d>c;c++)"axisLine"===this.shapeList[c]._axisShape?(this.shapeList[c].style.yStart=this.shapeList[c].style.yEnd=this.subPixelOptimize(a,this.shapeList[c].stylelineWidth),this.zr.modShape(this.shapeList[c].id)):"axisTick"===this.shapeList[c]._axisShape&&(b=this.shapeList[c].style.yEnd-this.shapeList[c].style.yStart,this.shapeList[c].style.yStart=a-b,this.shapeList[c].style.yEnd=a,this.zr.modShape(this.shapeList[c].id));if(!this.isHorizontal()&&null!=e)for(c=0,d=this.shapeList.length;d>c;c++)"axisLine"===this.shapeList[c]._axisShape?(this.shapeList[c].style.xStart=this.shapeList[c].style.xEnd=this.subPixelOptimize(e,this.shapeList[c].stylelineWidth),this.zr.modShape(this.shapeList[c].id)):"axisTick"===this.shapeList[c]._axisShape&&(b=this.shapeList[c].style.xEnd-this.shapeList[c].style.xStart,this.shapeList[c].style.xStart=e,this.shapeList[c].style.xEnd=e+b,this.zr.modShape(this.shapeList[c].id))}},getPosition:function(){return this.option.position},isHorizontal:function(){return"bottom"===this.option.position||"top"===this.option.position}},reformOption:function(e){if(!e||e instanceof Array&&0===e.length?e=[{type:g.COMPONENT_TYPE_AXIS_VALUE}]:e instanceof Array||(e=[e]),2a;a++)e[a].type=e[a].type||"category",e[a].xAxisIndex=a,e[a].yAxisIndex=-1}else for((!e[0].position||"left"!=e[0].position&&"right"!=e[0].position)&&(e[0].position="left"),1a;a++)e[a].type=e[a].type||"value",e[a].xAxisIndex=-1,e[a].yAxisIndex=a;return e},refresh:function(e){var a;e&&(this.option=e,"xAxis"===this.axisType?(this.option.xAxis=this.reformOption(e.xAxis),a=this.option.xAxis):(this.option.yAxis=this.reformOption(e.yAxis),a=this.option.yAxis),this.series=e.series);for(var b=l("./categoryAxis"),c=l("./valueAxis"),d=Math.max(a&&a.length||0,this._axisList.length),f=0;d>f;f++)!this._axisList[f]||!e||a[f]&&this._axisList[f].type==a[f].type||(this._axisList[f].dispose&&this._axisList[f].dispose(),this._axisList[f]=!1),this._axisList[f]?this._axisList[f].refresh&&this._axisList[f].refresh(a?a[f]:!1,this.series):a&&a[f]&&(this._axisList[f]="category"===a[f].type?new b(this.ecTheme,this.messageCenter,this.zr,a[f],this.myChart,this.axisBase):new c(this.ecTheme,this.messageCenter,this.zr,a[f],this.myChart,this.axisBase,this.series))},getAxis:function(e){return this._axisList[e]},clear:function(){for(var e=0,a=this._axisList.length;a>e;e++)this._axisList[e].dispose&&this._axisList[e].dispose();this._axisList=[]}},m.inherits(q,u),l("../component").define("axis",q),q});define("echarts/component/grid","require ./base zrender/shape/Rectangle ../config zrender/tool/util ../component".split(" "),function(l){function q(g,k,e,a,b){u.call(this,g,k,e,a,b);this.refresh(a)}var u=l("./base"),v=l("zrender/shape/Rectangle"),g=l("../config");g.grid={zlevel:0,z:0,x:12,y:60,x2:12,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc"};var t=l("zrender/tool/util");return q.prototype={type:g.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(m){for(var k,e,a=m.xAxis._axisList.concat(m.yAxis?m.yAxis._axisList:[]),b=a.length;b--;)m=a[b],m.type==g.COMPONENT_TYPE_AXIS_VALUE&&0>m._min&&0<=m._max&&(m.isHorizontal()?k=m.getCoord(0):e=m.getCoord(0));if("undefined"!=typeof k||"undefined"!=typeof e)for(b=a.length;b--;)a[b].refixAxisShape(k,e)},refresh:function(g){if(g||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear();this.option=g||this.option;this.option.grid=this.reformOption(this.option.grid);g=this.option.grid;this._zrWidth=this.zr.getWidth();this._zrHeight=this.zr.getHeight();this._x=this.parsePercent(g.x,this._zrWidth);this._y=this.parsePercent(g.y,this._zrHeight);var k=this.parsePercent(g.x2,this._zrWidth),e=this.parsePercent(g.y2,this._zrHeight);this._width="undefined"==typeof g.width?this._zrWidth-this._x-k:this.parsePercent(g.width,this._zrWidth);this._width=0>=this._width?10:this._width;this._height="undefined"==typeof g.height?this._zrHeight-this._y-e:this.parsePercent(g.height,this._zrHeight);this._height=0>=this._height?10:this._height;this._x=this.subPixelOptimize(this._x,g.borderWidth);this._y=this.subPixelOptimize(this._y,g.borderWidth);this.shapeList.push(new v({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,b,c,d,f=this.component.grid;return"horizontal"==this.zoomOption.orient?(c=this.zoomOption.width||f.getWidth(),d=this.zoomOption.height||this._fillerSize,a=null!=this.zoomOption.x?this.zoomOption.x:f.getX(),b=null!=this.zoomOption.y?this.zoomOption.y:this.zr.getHeight()-d-2):(c=this.zoomOption.width||this._fillerSize,d=this.zoomOption.height||f.getHeight(),a=null!=this.zoomOption.x?this.zoomOption.x:2,b=null!=this.zoomOption.y?this.zoomOption.y:f.getY()),{x:a,y:b,width:c,height:d}},_getZoom:function(){var a=this.option.series,b=this.option.xAxis;!b||b instanceof Array||(b=[b],this.option.xAxis=b);var c=this.option.yAxis;!c||c instanceof Array||(c=[c],this.option.yAxis=c);var d,f=[],n=this.zoomOption.xAxisIndex;if(b&&null==n){d=[];for(var h=0,e=b.length;e>h;h++)"category"!=b[h].type&&null!=b[h].type||d.push(h)}else d=n instanceof Array?n:null!=n?[n]:[];if(n=this.zoomOption.yAxisIndex,c&&null==n)for(b=[],h=0,e=c.length;e>h;h++)"category"==c[h].type&&b.push(h);else b=n instanceof Array?n:null!=n?[n]:[];for(var p,h=0,e=a.length;e>h;h++)if(p=a[h],p.type==m.CHART_TYPE_LINE||p.type==m.CHART_TYPE_BAR||p.type==m.CHART_TYPE_SCATTER||p.type==m.CHART_TYPE_K){c=0;for(n=d.length;n>c;c++)if(d[c]==(p.xAxisIndex||0)){f.push(h);break}c=0;for(n=b.length;n>c;c++)if(b[c]==(p.yAxisIndex||0)){f.push(h);break}null==this.zoomOption.xAxisIndex&&null==this.zoomOption.yAxisIndex&&p.data&&this.getDataFromOption(p.data[0])instanceof Array&&(p.type==m.CHART_TYPE_SCATTER||p.type==m.CHART_TYPE_LINE||p.type==m.CHART_TYPE_BAR)&&f.push(h)}a=null!=this._zoom.start?this._zoom.start:null!=this.zoomOption.start?this.zoomOption.start:0;h=null!=this._zoom.end?this._zoom.end:null!=this.zoomOption.end?this.zoomOption.end:100;a>h&&(a+=h,h=a-h,a-=h);return{start:a,end:h,start2:0,end2:100,size:Math.round((h-a)/100*("horizontal"==this.zoomOption.orient?this._location.width:this._location.height)),xAxisIndex:d,yAxisIndex:b,seriesIndex:f,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};for(var a=this.option.xAxis,b=this._zoom.xAxisIndex,c=0,d=b.length;d>c;c++)this._originalData.xAxis[b[c]]=a[b[c]].data;a=this.option.yAxis;b=this._zoom.yAxisIndex;c=0;for(d=b.length;d>c;c++)this._originalData.yAxis[b[c]]=a[b[c]].data;for(var b=this.option.series,f=this._zoom.seriesIndex,c=0,d=f.length;d>c;c++)a=b[f[c]],(this._originalData.series[f[c]]=a.data)&&this.getDataFromOption(a.data[0])instanceof Array&&(a.type==m.CHART_TYPE_SCATTER||a.type==m.CHART_TYPE_LINE||a.type==m.CHART_TYPE_BAR)&&(this._backupScale(),this._calculScatterMap(f[c]))},_calculScatterMap:function(a){this._zoom.scatterMap=this._zoom.scatterMap||{};this._zoom.scatterMap[a]=this._zoom.scatterMap[a]||{};var b=l("../component").get("axis"),c=e.clone(this.option.xAxis);"category"==c[0].type&&(c[0].type="value");c[1]&&"category"==c[1].type&&(c[1].type="value");var c=new b(this.ecTheme,null,!1,{xAxis:c,series:this.option.series},this,"xAxis"),d=this.option.series[a].xAxisIndex||0;this._zoom.scatterMap[a].x=c.getAxis(d).getExtremum();c.dispose();c=e.clone(this.option.yAxis);"category"==c[0].type&&(c[0].type="value");c[1]&&"category"==c[1].type&&(c[1].type="value");c=new b(this.ecTheme,null,!1,{yAxis:c,series:this.option.series},this,"yAxis");d=this.option.series[a].yAxisIndex||0;this._zoom.scatterMap[a].y=c.getAxis(d).getExtremum();c.dispose()},_buildBackground:function(){var a=this._location.width,b=this._location.height;this.shapeList.push(new v({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._location.x,y:this._location.y,width:a,height:b,color:this.zoomOption.backgroundColor}}));for(var c=0,d=this._originalData.xAxis,f=this._zoom.xAxisIndex,n=0,h=f.length;h>n;n++)c=Math.max(c,d[f[n]].length);d=this._originalData.yAxis;f=this._zoom.yAxisIndex;n=0;for(h=f.length;h>n;n++)c=Math.max(c,d[f[n]].length);for(var f=this._zoom.seriesIndex[0],e=this._originalData.series[f],p=Number.MIN_VALUE,k=Number.MAX_VALUE,n=0,h=e.length;h>n;n++)d=this.getDataFromOption(e[n],0),this.option.series[f].type==m.CHART_TYPE_K&&(d=d[1]),isNaN(d)&&(d=0),p=Math.max(p,d),k=Math.min(k,d);var p=p-k,l=[],r=a/(c-(1r?z=Math.floor(3*c/a):"vertical"==this.zoomOption.orient&&1>q&&(z=Math.floor(3*c/b));n=0;for(h=c;h>n;n+=z)d=this.getDataFromOption(e[n],0),this.option.series[f].type==m.CHART_TYPE_K&&(d=d[1]),isNaN(d)&&(d=0),l.push("horizontal"==this.zoomOption.orient?[this._location.x+r*n,this._location.y+b-1-Math.round((d-k)/p*(b-10))]:[this._location.x+1+Math.round((d-k)/p*(a-10)),this._location.y+q*(h-n-1)]);"horizontal"==this.zoomOption.orient?(l.push([this._location.x+a,this._location.y+b]),l.push([this._location.x,this._location.y+b])):(l.push([this._location.x,this._location.y]),l.push([this._location.x,this._location.y+b]));this.shapeList.push(new g({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:l,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 v(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=e.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=e.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 t(this._startShape);this._endShape=new t(this._endShape);this.shapeList.push(this._startShape);this.shapeList.push(this._endShape)},_buildFrame:function(){var a=this.subPixelOptimize(this._location.x,1),b=this.subPixelOptimize(this._location.y,1);this._startFrameShape={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:a,y:b,width:this._location.width-(a>this._location.x?1:0),height:this._location.height-(b>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}};this._endFrameShape=e.clone(this._startFrameShape);this._startFrameShape=new v(this._startFrameShape);this._endFrameShape=new v(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,b;"horizontal"==this.zoomOption.orient?(a=this._startShape.style.x,b=this._endShape.style.x,this._fillerShae.style.x=Math.min(a,b)+this._handleSize,this._fillerShae.style.width=Math.abs(a-b)-this._handleSize,this._zoom.start=(Math.min(a,b)-this._location.x)/this._location.width*100,this._zoom.end=(Math.max(a,b)+this._handleSize-this._location.x)/this._location.width*100):(a=this._startShape.style.y,b=this._endShape.style.y,this._fillerShae.style.y=Math.min(a,b)+this._handleSize,this._fillerShae.style.height=Math.abs(a-b)-this._handleSize,this._zoom.start=(this._location.y+this._location.height-Math.max(a,b))/this._location.height*100,this._zoom.end=(this._location.y+this._location.height-Math.min(a,b)-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 b,c,d,f,n,h;for(h in this._originalData){b=this._originalData[h];for(var e in b)n=b[e],null!=n&&(f=n.length,c=Math.floor(this._zoom.start/100*f),d=Math.ceil(this._zoom.end/100*f),this.getDataFromOption(n[0])instanceof Array&&this.option[h][e].type!=m.CHART_TYPE_K?(this._setScale(),this.option[h][e].data=this._synScatterData(e,n)):this.option[h][e].data=n.slice(c,d))}this._isSilence||!this.zoomOption.realtime&&!a||this.messageCenter.dispatch(m.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(a,b){if(0===this._zoom.start&&100==this._zoom.end&&0===this._zoom.start2&&100==this._zoom.end2)return b;var c,d,f,n,h,e=[],p=this._zoom.scatterMap[a];"horizontal"==this.zoomOption.orient?(c=p.x.max-p.x.min,d=this._zoom.start/100*c+p.x.min,f=this._zoom.end/100*c+p.x.min,c=p.y.max-p.y.min,n=this._zoom.start2/100*c+p.y.min,h=this._zoom.end2/100*c+p.y.min):(c=p.x.max-p.x.min,d=this._zoom.start2/100*c+p.x.min,f=this._zoom.end2/100*c+p.x.min,c=p.y.max-p.y.min,n=this._zoom.start/100*c+p.y.min,h=this._zoom.end/100*c+p.y.min);for(var p=0,g=b.length;g>p;p++)c=b[p].value||b[p],c[0]>=d&&c[0]<=f&&c[1]>=n&&c[1]<=h&&e.push(b[p]);return e},_setScale:function(){var a=0!==this._zoom.start||100!==this._zoom.end||0!==this._zoom.start2||100!==this._zoom.end2,b={xAxis:this.option.xAxis,yAxis:this.option.yAxis},c;for(c in b)for(var d=0,f=b[c].length;f>d;d++)b[c][d].scale=a||b[c][d]._scale},_backupScale:function(){var a={xAxis:this.option.xAxis,yAxis:this.option.yAxis},b;for(b in a)for(var c=0,d=a[b].length;d>c;c++)a[b][c]._scale=a[b][c].scale},_getDetail:function(){var a="horizontal"==this.zoomOption.orient?"xAxis":"yAxis",b=this._originalData[a],c;for(c in b){var d=b[c];if(null!=d)return b=d.length,a=Math.floor(this._zoom.start/100*b),b=Math.ceil(this._zoom.end/100*b),b-=0=this._location.x+this._location.width?a.style.x=this._location.x+this._location.width-a.style.width-d:a.style.x+=b:a.style.y+c-d<=this._location.y?a.style.y=this._location.y+d:a.style.y+c+a.style.height+d>=this._location.y+this._location.height?a.style.y=this._location.y+this._location.height-a.style.height-d:a.style.y+=c,"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,b){this.isDragend&&a.target&&(!this.zoomOption.realtime&&this._syncData(),b.dragOut=!0,b.dragIn=!0,this._isSilence||this.zoomOption.realtime||this.messageCenter.dispatch(m.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),b.needRefresh=!1,this.isDragend=!1)},ondataZoom:function(a,b){b.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 b=this.component.grid.getArea(),c=a.x,d=a.y,f=a.width,n=a.height;if(0>f&&(c+=f,f=-f),0>n&&(d+=n,n=-n),c>b.x+b.width||d>b.y+b.height)return!1;cb.x+b.width&&(f=b.x+b.width-c);d+n>b.y+b.height&&(n=b.y+b.height-d);var h;a=(c-b.x)/b.width;c=1-(c+f-b.x)/b.width;f=1-(d+n-b.y)/b.height;b=(d-b.y)/b.height;return"horizontal"==this.zoomOption.orient?(h=this._zoom.end-this._zoom.start,this._zoom.start+=h*a,this._zoom.end-=h*c,h=this._zoom.end2-this._zoom.start2,this._zoom.start2+=h*f,this._zoom.end2-=h*b):(h=this._zoom.end-this._zoom.start,this._zoom.start+=h*f,this._zoom.end-=h*b,h=this._zoom.end2-this._zoom.start2,this._zoom.start2+=h*a,this._zoom.end2-=h*c),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(a){for(var b,c=this._originalData.series,d=a.series,f=0,n=d.length;n>f;f++){b=d[f].data||d[f].eventList;a=c[f]?Math.floor(this._zoom.start/100*c[f].length):0;for(var h=0,e=b.length;e>h;h++)c[f]&&(c[f][h+a]=b[h])}},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,b){if(!this._originalData||0===this._zoom.start&&100==this._zoom.end)return b;var c=this._originalData.series;return c[a]?Math.floor(this._zoom.start/100*c[a].length)+b:-1},resize:function(){this.clear();this._location=this._getLocation();this._zoom=this._getZoom();this.option.dataZoom.show&&this._buildShape()}},e.inherits(q,u),l("../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(l){function q(a,b,c,d,f,n){if(1>d.data.length)return void console.error("option.data.length \x3c 1.");u.call(this,a,b,c,d,f);this.grid=this.component.grid;for(var h in n)this[h]=n[h];this.refresh(d)}var u=l("./base"),v=l("zrender/shape/Text"),g=l("zrender/shape/Line"),t=l("zrender/shape/Rectangle"),m=l("../config");m.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 k=l("zrender/tool/util"),e=l("zrender/tool/area");return q.prototype={type:m.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(a){var b=this.getDataFromOption(this.option.data[a]);a=this.option.data[a].formatter||this.option.axisLabel.formatter;return a&&("function"==typeof a?b=a.call(this.myChart,b):"string"==typeof a&&(b=a.replace("{value}",b))),b},_getInterval:function(){var a=this.option.axisLabel.interval;if("auto"==a){var b=this.option.axisLabel.textStyle.fontSize,c=this.option.data,d=this.option.data.length;if(this.isHorizontal())if(3p?1:p,a=Math.floor(15/h);!g&&d>a;){a+=p;g=!0;f=Math.floor(h*a);for(var l=Math.floor((d-1)/a)*a;0<=l;l-=a){if(0!==this.option.axisLabel.rotate)n=b;else if(c[l].textStyle)n=e.getTextWidth(this._getReformedLabel(l),this.getFont(k.merge(c[l].textStyle,this.option.axisLabel.textStyle)));else{n=this._getReformedLabel(l)+"";var m=(n.match(/\w/g)||"").length;n=m*b*2/3+(n.length-m)*b}if(n>f){g=!1;break}}}else a=1;else if(3h*a-6&&d>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,b=this.shapeList.length;b>a;a++)this.zr.addShape(this.shapeList[a])}},_buildAxisTick:function(){var a,b=this.option.data,c=this.option.data.length,d=this.option.axisTick,f=d.length,n=d.lineStyle.color,h=d.lineStyle.width,e="function"==typeof d.interval?d.interval:"auto"==d.interval&&"function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,p=e?1:"auto"==d.interval?this._interval:d.interval-0+1,k=d.onGap,k=k?this.getGap()/2:"undefined"==typeof k&&this.option.boundaryGap?this.getGap()/2:0,l=0l;l+=p)e&&!e(l,b[l])||(m=this.subPixelOptimize(this.getCoordByIndex(l)+(0<=l?k:0),h),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:m,yStart:q,xEnd:m,yEnd:q+f,strokeColor:n,lineWidth:h}},this.shapeList.push(new g(a)));else for(m="left"==this.option.position?d.inside?this.grid.getX()+1:this.grid.getX()-f-1:d.inside?this.grid.getXend()-f-1:this.grid.getXend()+1;c>l;l+=p)e&&!e(l,b[l])||(q=this.subPixelOptimize(this.getCoordByIndex(l)-(0<=l?k:0),h),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:m,yStart:q,xEnd:m+f,yEnd:q,strokeColor:n,lineWidth:h}},this.shapeList.push(new g(a)))},_buildAxisLabel:function(){var a,b,c=this.option.data,d=this.option.data.length,f=this.option.axisLabel,n=f.rotate,h=f.margin,e=f.clickable,p=f.textStyle,f="function"==typeof f.interval?f.interval:!1;if(this.isHorizontal()){var g,l;"bottom"==this.option.position?(g=this.grid.getYend()+h,l="top"):(g=this.grid.getY()-h,l="bottom");for(h=0;d>h;h+=this._interval)f&&!f(h,c[h])||""===this._getReformedLabel(h)||(b=k.merge(c[h].textStyle||{},p),a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoordByIndex(h),y:g,color:b.color,text:this._getReformedLabel(h),textFont:this.getFont(b),textAlign:b.align||"center",textBaseline:b.baseline||l}},n&&(a.style.textAlign=0h;h+=this._interval)f&&!f(h,c[h])||""===this._getReformedLabel(h)||(b=k.merge(c[h].textStyle||{},p),a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:m,y:this.getCoordByIndex(h),color:b.color,text:this._getReformedLabel(h),textFont:this.getFont(b),textAlign:b.align||q,textBaseline:b.baseline||0===h&&""!==this.option.name?"bottom":h==d-1&&""!==this.option.name?"top":"middle"}},n&&(a.rotation=[n*Math.PI/180,a.style.x,a.style.y]),this.shapeList.push(new v(this._axisLabelClickable(e,a))))}},_buildSplitLine:function(){var a,b=this.option.data,c=this.option.data.length,d=this.option.splitLine,f=d.lineStyle.type,n=d.lineStyle.width,h=d.lineStyle.color,h=h instanceof Array?h:[h],e=h.length,p="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,k=d.onGap,d=k?this.getGap()/2:"undefined"==typeof k&&this.option.boundaryGap?this.getGap()/2:0;if(c-=k||"undefined"==typeof k&&this.option.boundaryGap?1:0,this.isHorizontal())for(var l,m=this.grid.getY(),q=this.grid.getYend(),k=0;c>k;k+=this._interval)p&&!p(k,b[k])||(l=this.subPixelOptimize(this.getCoordByIndex(k)+d,n),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:l,yStart:m,xEnd:l,yEnd:q,strokeColor:h[k/this._interval%e],lineType:f,lineWidth:n}},this.shapeList.push(new g(a)));else for(l=this.grid.getX(),q=this.grid.getXend(),k=0;c>k;k+=this._interval)p&&!p(k,b[k])||(m=this.subPixelOptimize(this.getCoordByIndex(k)-d,n),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:l,yStart:m,xEnd:q,yEnd:m,strokeColor:h[k/this._interval%e],lineType:f,lineWidth:n}},this.shapeList.push(new g(a)))},_buildSplitArea:function(){var a,b=this.option.data,c=this.option.splitArea,d=c.areaStyle.color;if(d instanceof Array){var f=d.length,n=this.option.data.length,h="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,c=(c=c.onGap)?this.getGap()/2:"undefined"==typeof c&&this.option.boundaryGap?this.getGap()/2:0;if(this.isHorizontal())for(var e,k=this.grid.getY(),g=this.grid.getHeight(),l=this.grid.getX(),m=0;n>=m;m+=this._interval)h&&!h(m,b[m])&&n>m||(e=n>m?this.getCoordByIndex(m)+c:this.grid.getXend(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:l,y:k,width:e-l,height:g,color:d[m/this._interval%f]}},this.shapeList.push(new t(a)),l=e);else for(e=this.grid.getX(),g=this.grid.getWidth(),l=this.grid.getYend(),m=0;n>=m;m+=this._interval)h&&!h(m,b[m])&&n>m||(k=n>m?this.getCoordByIndex(m)-c:this.grid.getY(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:e,y:k,width:g,height:l-k,color:d[m/this._interval%f]}},this.shapeList.push(new t(a)),l=k)}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:d}},this.shapeList.push(new t(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,b=this.isHorizontal()?this.grid.getWidth():this.grid.getHeight();return this.option.boundaryGap?b/a:b/(1e;e++){if(this.getDataFromOption(b[e])==a)return this.isHorizontal()?this.grid.getX()+f:this.grid.getYend()-f;f+=d}},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 b=this.getGap(),c=this.option.boundaryGap?b/2:0;return c+=a*b,this.isHorizontal()?this.grid.getX()+c:this.grid.getYend()-c},getNameByIndex:function(a){return this.getDataFromOption(this.option.data[a])},getIndexByName:function(a){for(var b=this.option.data,c=b.length,d=0;c>d;d++)if(this.getDataFromOption(b[d])==a)return d;return-1},getValueFromCoord:function(){return""},isMainAxis:function(a){return 0===a%this._interval}},k.inherits(q,u),l("../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(l){function q(a,b,c,d,f,e,h){if(!h||0===h.length)return void console.err("option.series.length \x3d\x3d 0.");u.call(this,a,b,c,d,f);this.series=h;this.grid=this.component.grid;for(var k in e)this[k]=e[k];this.refresh(d,h)}var u=l("./base"),v=l("zrender/shape/Text"),g=l("zrender/shape/Line"),t=l("zrender/shape/Rectangle"),m=l("../config");m.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 k=l("../util/date"),e=l("zrender/tool/util");return q.prototype={type:m.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,b=this.shapeList.length;b>a;a++)this.zr.addShape(this.shapeList[a])}},_buildAxisTick:function(){var a,b=this._valueList,c=this._valueList.length,d=this.option.axisTick,f=d.length,e=d.lineStyle.color,h=d.lineStyle.width;if(this.isHorizontal())for(var k="bottom"===this.option.position?d.inside?this.grid.getYend()-f-1:this.grid.getYend()+1:d.inside?this.grid.getY()+1:this.grid.getY()-f-1,d=0;c>d;d++)a=this.subPixelOptimize(this.getCoord(b[d]),h),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:a,yStart:k,xEnd:a,yEnd:k+f,strokeColor:e,lineWidth:h}},this.shapeList.push(new g(a));else for(k="left"===this.option.position?d.inside?this.grid.getX()+1:this.grid.getX()-f-1:d.inside?this.grid.getXend()-f-1:this.grid.getXend()+1,d=0;c>d;d++)a=this.subPixelOptimize(this.getCoord(b[d]),h),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:k,yStart:a,xEnd:k+f,yEnd:a,strokeColor:e,lineWidth:h}},this.shapeList.push(new g(a))},_buildAxisLabel:function(){var a,b=this._valueList,c=this._valueList.length,d=this.option.axisLabel.rotate;a=this.option.axisLabel.margin;var f=this.option.axisLabel.clickable,e=this.option.axisLabel.textStyle;if(this.isHorizontal()){var h,k;"bottom"===this.option.position?(h=this.grid.getYend()+a,k="top"):(h=this.grid.getY()-a,k="bottom");for(var g=0;c>g;g++)a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoord(b[g]),y:h,color:"function"==typeof e.color?e.color(b[g]):e.color,text:this._valueLabel[g],textFont:this.getFont(e),textAlign:e.align||"center",textBaseline:e.baseline||k}},d&&(a.style.textAlign=0g;g++)a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:l,y:this.getCoord(b[g]),color:"function"==typeof e.color?e.color(b[g]):e.color,text:this._valueLabel[g],textFont:this.getFont(e),textAlign:e.align||m,textBaseline:e.baseline||(0===g&&""!==this.option.name?"bottom":g===c-1&&""!==this.option.name?"top":"middle")}},d&&(a.rotation=[d*Math.PI/180,a.style.x,a.style.y]),this.shapeList.push(new v(this._axisLabelClickable(f,a)))}},_buildSplitLine:function(){var a,b=this._valueList,c=this._valueList.length,d=this.option.splitLine,f=d.lineStyle.type,e=d.lineStyle.width,d=d.lineStyle.color,d=d instanceof Array?d:[d],h=d.length;if(this.isHorizontal())for(var k=this.grid.getY(),l=this.grid.getYend(),m=0;c>m;m++)a=this.subPixelOptimize(this.getCoord(b[m]),e),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:a,yStart:k,xEnd:a,yEnd:l,strokeColor:d[m%h],lineType:f,lineWidth:e}},this.shapeList.push(new g(a));else for(k=this.grid.getX(),l=this.grid.getXend(),m=0;c>m;m++)a=this.subPixelOptimize(this.getCoord(b[m]),e),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:k,yStart:a,xEnd:l,yEnd:a,strokeColor:d[m%h],lineType:f,lineWidth:e}},this.shapeList.push(new g(a))},_buildSplitArea:function(){var a,b=this.option.splitArea.areaStyle.color;if(b instanceof Array){var c=b.length,d=this._valueList,f=this._valueList.length;if(this.isHorizontal()){var e,h=this.grid.getY(),k=this.grid.getHeight();a=this.grid.getX();for(var g=0;f>=g;g++)e=f>g?this.getCoord(d[g]):this.grid.getXend(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:a,y:h,width:e-a,height:k,color:b[g%c]}},this.shapeList.push(new t(a)),a=e}else for(h=this.grid.getX(),k=this.grid.getWidth(),a=this.grid.getYend(),g=0;f>=g;g++)e=f>g?this.getCoord(d[g]):this.grid.getY(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:h,y:e,width:k,height:a-e,color:b[g%c]}},this.shapeList.push(new t(a)),a=e}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:b}},this.shapeList.push(new t(a))},_calculateValue:function(){if(isNaN(this.option.min-0)||isNaN(this.option.max-0)){for(var a,b,c={},d=this.component.legend,f=0,e=this.series.length;e>f;f++)!(this.series[f].type!=m.CHART_TYPE_LINE&&this.series[f].type!=m.CHART_TYPE_BAR&&this.series[f].type!=m.CHART_TYPE_SCATTER&&this.series[f].type!=m.CHART_TYPE_K&&this.series[f].type!=m.CHART_TYPE_EVENTRIVER||d&&!d.isSelected(this.series[f].name)||(a=this.series[f].xAxisIndex||0,b=this.series[f].yAxisIndex||0,this.option.xAxisIndex!=a&&this.option.yAxisIndex!=b||!this._calculSum(c,f)));for(f in c){a=c[f];b=0;for(d=a.length;d>b;b++)if(!isNaN(a[b])){this._hasData=!0;this._min=a[b];this._max=a[b];break}if(this._hasData)break}for(f in c)for(a=c[f],b=0,d=a.length;d>b;b++)isNaN(a[b])||(this._min=Math.min(this._min,a[b]),this._max=Math.max(this._max,a[b]));c=Math.abs(this._max-this._min);this._min=isNaN(this.option.min-0)?this._min-Math.abs(c*this.option.boundaryGap[0]):this.option.min-0;this._max=isNaN(this.option.max-0)?this._max+Math.abs(c*this.option.boundaryGap[1]):this.option.max-0;this._min===this._max&&(0===this._max?this._max=1:0g;g++)c=this.getDataFromOption(d[g]),"-"!==c&&(c-=0,0<=c?null!=a[e][g]?a[e][g]+=c:a[e][g]=c:null!=a[h][g]?a[h][g]+=c:a[h][g]=c,this.option.scale&&a[f].push(c))}else if(a[f]=a[f]||[],this.series[b].type!=m.CHART_TYPE_EVENTRIVER)for(d=this.series[b].data,g=0,l=d.length;l>g;g++)c=this.getDataFromOption(d[g]),this.series[b].type===m.CHART_TYPE_K?(a[f].push(c[0]),a[f].push(c[1]),a[f].push(c[2]),a[f].push(c[3])):c instanceof Array?(-1!=this.option.xAxisIndex&&a[f].push("time"!=this.option.type?c[0]:k.getNewDate(c[0])),-1!=this.option.yAxisIndex&&a[f].push("time"!=this.option.type?c[1]:k.getNewDate(c[1]))):a[f].push(c);else for(d=this.series[b].eventList,g=0,l=d.length;l>g;g++)for(c=d[g].evolution,e=0,h=c.length;h>e;e++)a[f].push(k.getNewDate(c[e].time))},_reformValue:function(a){var b=l("../util/smartSteps"),c=this.option.splitNumber;!a&&0<=this._min&&0<=this._max&&(this._min=0);!a&&0>=this._min&&0>=this._max&&(this._max=0);a=b(this._min,this._max,c);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,b=k.getAutoFormatter(this._min,this._max,a),c=b.formatter,d=b.gapValue;this._valueList=[k.getNewDate(this._min)];var e;switch(c){case "week":e=k.nextMonday(this._min);break;case "month":e=k.nextNthOnMonth(this._min,1);break;case "quarter":e=k.nextNthOnQuarterYear(this._min,1);break;case "half-year":e=k.nextNthOnHalfYear(this._min,1);break;case "year":e=k.nextNthOnYear(this._min,1);break;default:72E5>=d?e=(Math.floor(this._min/d)+1)*d:(e=k.getNewDate(this._min- -d),e.setHours(6*Math.round(e.getHours()/6)),e.setMinutes(0),e.setSeconds(0))}e-this._min=d;d++)this._valueList.push(a.accAdd(this._min,a.accMul(c,d)));this._reformLabelData()},_reformLabelData:function(a){this._valueLabel=[];var b=this.option.axisLabel.formatter;if(b)for(var c=0,d=this._valueList.length;d>c;c++)"function"==typeof b?this._valueLabel.push(a?b.call(this.myChart,this._valueList[c],a):b.call(this.myChart,this._valueList[c])):"string"==typeof b&&this._valueLabel.push(a?k.format(b,this._valueList[c]):b.replace("{value}",this._valueList[c]));else if(a)for(c=0,d=this._valueList.length;d>c;c++)this._valueLabel.push(k.format(a,this._valueList[c]));else for(c=0,d=this._valueList.length;d>c;c++)this._valueLabel.push(this.numAddCommas(this._valueList[c]))},getExtremum:function(){return this._calculateValue(),{min:this._min,max:this._max}},refresh:function(a,b){a&&(this.option=this.reformOption(a),this.option.axisLabel.textStyle=e.merge(this.option.axisLabel.textStyle||{},this.ecTheme.textStyle),this.series=b);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 b;return this.isHorizontal()?(a=athis.grid.getXend()?this.grid.getXend():a,b=this._min+(a-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(a=athis.grid.getYend()?this.grid.getYend():a,b=this._max-(a-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),b.toFixed(2)-0},isMaindAxis:function(a){for(var b=0,c=this._valueList.length;c>b;b++)if(this._valueList[b]===a)return!0;return!1}},e.inherits(q,u),l("../component").define("valueAxis",q),q});define("echarts/util/date",[],function(){function l(g){return 10>g?"0"+g:g}function q(g,l,m){return g=u(g),g.setMonth(Math.ceil((g.getMonth()+1)/m)*m),g.setDate(l),g}function u(g){return g instanceof Date?g:new Date("string"==typeof g?g.replace(/-/g,"/"):g)}var v=[{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(g,l,m){m=1c;c++)if(k=v[c].value,e=Math.ceil(l/k)*k-Math.floor(g/k)*k,Math.round(e/k)<=1.2*m){a=v[c].formatter;b=v[c].value;break}return null==a&&(a="year",k=317088E5,e=Math.ceil(l/k)*k-Math.floor(g/k)*k,b=Math.round(e/(m-1)/k)*k),{formatter:a,gapValue:b}},getNewDate:u,format:function(g,q){"week"!=g&&"month"!=g&&"quarter"!=g&&"half-year"!=g&&"year"!=g||(g="MM - dd\nyyyy");var m=u(q),k=m.getFullYear(),e=m.getMonth()+1,a=m.getDate(),b=m.getHours(),c=m.getMinutes(),m=m.getSeconds();return g=g.replace("MM",l(e)),g=g.toLowerCase(),g=g.replace("yyyy",k),g=g.replace("yy",k%100),g=g.replace("dd",l(a)),g=g.replace("d",a),g=g.replace("hh",l(b)),g=g.replace("h",b),g=g.replace("mm",l(c)),g=g.replace("m",c),g=g.replace("ss",l(m)),g.replace("s",m)},nextMonday:function(g){return g=u(g),g.setDate(g.getDate()+8-g.getDay()),g},nextNthPerNmonth:q,nextNthOnMonth:function(g,l){return q(g,l,1)},nextNthOnQuarterYear:function(g,l){return q(g,l,3)},nextNthOnHalfYear:function(g,l){return q(g,l,6)},nextNthOnYear:function(g,l){return q(g,l,12)}}});define("echarts/util/smartSteps",[],function(){function l(a,e,f,g){g=g||0;var h=q((e-a)/f,-1);a=q(a,-1,1);e=q(e,-1);var k=p.min(h.e,a.e,e.e);0===a.c?k=p.min(h.e,e.e):0===e.c&&(k=p.min(h.e,a.e));u(h,{c:0,e:k});u(a,h,1);u(e,h);g+=k;a=a.c;e=e.c;for(var h=(e-a)/f,k=p.pow(10,g),l=0,m=[],n=f+1;n--;)m[n]=(a+h*n)*k;if(0>g)for(n=k,l=(n=(+n).toFixed(15).split("."),n.pop().replace(/0+$/,"").length),h=+(h*k).toFixed(l),a=+(a*k).toFixed(l),e=+(e*k).toFixed(l),n=m.length;n--;)m[n]=m[n].toFixed(l),0===+m[n]&&(m[n]="0");else a*=k,e*=k,h*=k;return d=0,c=0,b=0,{min:a,max:e,secs:f,step:h,fix:l,exp:g,pnts:m}}function q(a,b,c){b=D(b%10)||2;0>b&&(a===C(a)?b=(""+G(a)).replace(/0+$/,"").length||1:(a=a.toFixed(15).replace(/0+$/,""),b=a.replace(".","").replace(/^[-0]+/,"").length,a=+a));var d=C(p.log(G(a))/p.LN10)-b+1;a=+(a*p.pow(10,-d)).toFixed(15)||0;return a=c?C(a):r(a),!a&&(d=0),(""+G(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*=p.pow(10,-b),a.c=c?C(a.c):r(a.c))}function v(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 t(a,b,h){var A=h||+d.slice(-1),w=g((b-a)/A,c),t=q(b-a),y=q(a,-1,1),x=q(b,-1);u(t,w);u(y,w,1);u(x,w);if(h){var t=A,E,B;E=x.c;for(w=(x.c-y.c)/t-1;E>y.c;)w=g(w+1,c),w=w.c*p.pow(10,w.e),E=w*t,B=r(x.c/w)*w,E=B-E;t=y.c-E-(B-x.c);t>1.1*w&&(t=D(t/w/2)*w,E+=t,B+=t);y.c=E;x.c=B}else A=m(y,x);if(a===C(a)&&b===C(b)&&0<=a*b){if(A>b-a)return k(a,b,A);B=x.c-y.c;w=B/A*p.pow(10,x.e);w!==C(w)&&(w=C(w),B=w*A,b-a>B&&(w+=1,B=w*A,!h&&w*(A-1)>=b-a&&(--A,B=w*A)),B>=b-a)&&(h=B-(b-a),y.c=D(a-h/2),x.c=D(b+h/2),y.e=0,x.e=0)}h=e(a,b,y.c,x.c);y.c=h[0];x.c=h[1];if(f||n)f?(a=q(a,4,1),6e?2*e:e}function k(a,b,c){if(c=c||5,f)b=a+c;else if(n)a=b-c;else{var d=c-(b-a),h=D(a-d/2),d=D(b+d/2);b=e(a,b,h,d);a=b[0];b=b[1]}return l(a,b,c)}function e(a,b,c,d){return 0<=a&&0>c?(d-=c,c=0):0>=b&&0G(b/f)&&(b=0);1E-6>G(a/f)&&(a=0);var h,g,k=[[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);f=p.c-a.c;n.c=f;for(var t=e.length;t--;){c=e[t];b=r(f/c);h=b*c-f;g=3*(h+3);g+=2*(c-e[0]+2);0===c%5&&(g-=10);for(var v=k.length;v--;)0===b%k[v][0]&&(g/=k[v][1]);[c,b,h,g].join();m[t]={secs:c,step:b,delta:h,score:g}}return m.sort(function(a,b){return a.score-b.score}),m=m[0],a.c=D(a.c-m.delta/2),p.c=D(p.c+m.delta/2),l(a.c,p.c,m.secs,n.e)}var b,c,d,f,n,h=[10,20,25,50],F=[4,5,6],p=Math,D=p.round,C=p.floor,r=p.ceil,G=p.abs;return function(e,g,l,m){b=m||{};c=b.steps||h;d=b.secs||F;l=D(+l||0)%99;e=+e||0;g=+g||0;f=n=0;"min"in b&&(e=+b.min||0,f=1);"max"in b&&(g=+b.max||0,n=1);e>g&&(g=[e,e=g][0]);m=g-e;if(f&&n)return a(e,g,l);if((l||5)>m){if(e===C(e)&&g===C(g))return k(e,g,l);if(0===m)return l=l||5,m=p.min(G(g/l),l)/2.1,f?g=e+m:n?e=g-m:(e-=m,g+=m),t(e,g,l)}return t(e,g,l)}});