scatter.js 79 KB

1
  1. define("echarts/chart/scatter","require ./base ../util/shape/Symbol ../component/axis ../component/grid ../component/dataZoom ../component/dataRange ../config zrender/tool/util zrender/tool/color ../chart".split(" "),function(h){function q(d,f,a,b,c){v.call(this,d,f,a,b,c);this.refresh(b)}var v=h("./base"),y=h("../util/shape/Symbol");h("../component/axis");h("../component/grid");h("../component/dataZoom");h("../component/dataRange");var d=h("../config");d.scatter={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2E3,itemStyle:{normal:{label:{show:!1}},emphasis:{label:{show:!1}}}};var x=h("zrender/tool/util"),l=h("zrender/tool/color");return q.prototype={type:d.CHART_TYPE_SCATTER,_buildShape:function(){var u=this.series;this._sIndex2ColorMap={};this._symbol=this.option.symbolList;this._sIndex2ShapeMap={};this.selectedMap={};this.xMarkMap={};for(var f,a,b,c,e=this.component.legend,k=[],g=0,m=u.length;m>g;g++)if(f=u[g],a=f.name,f.type===d.CHART_TYPE_SCATTER){if(u[g]=this.reformOption(u[g]),this.legendHoverLink=u[g].legendHoverLink||this.legendHoverLink,this._sIndex2ShapeMap[g]=this.query(f,"symbol")||this._symbol[g%this._symbol.length],e){if(this.selectedMap[a]=e.isSelected(a),this._sIndex2ColorMap[g]=l.alpha(e.getColor(a),.5),b=e.getItemShape(a))c=this._sIndex2ShapeMap[g],b.style.brushType=c.match("empty")?"stroke":"both",c=c.replace("empty","").toLowerCase(),c.match("rectangle")&&(b.style.x+=Math.round((b.style.width-b.style.height)/2),b.style.width=b.style.height),c.match("star")&&(b.style.n=c.replace("star","")-0||5,c="star"),c.match("image")&&(b.style.image=c.replace(/^image:\/\//,""),b.style.x+=Math.round((b.style.width-b.style.height)/2),b.style.width=b.style.height,c="image"),b.style.iconType=c,e.setItemShape(a,b)}else this.selectedMap[a]=!0,this._sIndex2ColorMap[g]=l.alpha(this.zr.getColor(g),.5);this.selectedMap[a]&&k.push(g)}this._buildSeries(k);this.addShapeList()},_buildSeries:function(d){if(0!==d.length){for(var f,a,b,c,e,k,g,m,I=this.series,p={},z=0,n=d.length;n>z;z++)if(f=d[z],a=I[f],0!==a.data.length){e=this.component.xAxis.getAxis(a.xAxisIndex||0);k=this.component.yAxis.getAxis(a.yAxisIndex||0);p[f]=[];for(var r=0,l=a.data.length;l>r;r++)b=a.data[r],c=this.getDataFromOption(b,"-"),"-"===c||2>c.length||(g=e.getCoord(c[0]),m=k.getCoord(c[1]),p[f].push([g,m,r,b.name||""]));this.xMarkMap[f]=this._markMap(e,k,a.data,p[f]);this.buildMark(f)}this._buildPointList(p)}},_markMap:function(d,f,a,b){for(var c,e={min0:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,sum0:0,counter0:0,average0:0,min1:Number.POSITIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum1:0,counter1:0,average1:0},k=0,g=b.length;g>k;k++)c=a[b[k][2]].value||a[b[k][2]],e.min0>c[0]&&(e.min0=c[0],e.minY0=b[k][1],e.minX0=b[k][0]),e.max0<c[0]&&(e.max0=c[0],e.maxY0=b[k][1],e.maxX0=b[k][0]),e.sum0+=c[0],e.counter0++,e.min1>c[1]&&(e.min1=c[1],e.minY1=b[k][1],e.minX1=b[k][0]),e.max1<c[1]&&(e.max1=c[1],e.maxY1=b[k][1],e.maxX1=b[k][0]),e.sum1+=c[1],e.counter1++;a=this.component.grid.getX();b=this.component.grid.getXend();c=this.component.grid.getY();k=this.component.grid.getYend();e.average0=e.sum0/e.counter0;d=d.getCoord(e.average0);e.averageLine0=[[d,k],[d,c]];e.minLine0=[[e.minX0,k],[e.minX0,c]];e.maxLine0=[[e.maxX0,k],[e.maxX0,c]];e.average1=e.sum1/e.counter1;f=f.getCoord(e.average1);return e.averageLine1=[[a,f],[b,f]],e.minLine1=[[a,e.minY1],[b,e.minY1]],e.maxLine1=[[a,e.maxY1],[b,e.maxY1]],e},_buildPointList:function(d){var f,a,b,c=this.series,e;for(e in d)if(f=c[e],a=d[e],f.large&&f.data.length>f.largeThreshold)this.shapeList.push(this._getLargeSymbol(a,this.getItemStyleColor(this.query(f,"itemStyle.normal.color"),e,-1)||this._sIndex2ColorMap[e]));else for(var k=0,g=a.length;g>k;k++)b=a[k],(b=this._getSymbol(e,b[2],b[3],b[0],b[1]))&&this.shapeList.push(b)},_getSymbol:function(d,f,a,b,c){var e,k=this.series[d],g=k.data[f],m=this.component.dataRange;if(m){if(e=isNaN(g[2])?this._sIndex2ColorMap[d]:m.getColor(g[2]),!e)return null}else e=this._sIndex2ColorMap[d];d=this.getSymbolShape(k,d,g,f,a,b,c,this._sIndex2ShapeMap[d],e,"rgba(0,0,0,0)","vertical");return d.zlevel=this.getZlevelBase(),d.z=this.getZBase(),d._main=!0,d},_getLargeSymbol:function(d,f){return new y({zlevel:this.getZlevelBase(),z:this.getZBase(),_main:!0,hoverable:!1,style:{pointList:d,color:f,strokeColor:f},highlightStyle:{pointList:[]}})},getMarkCoord:function(d,f){var a,b=this.series[d];a=this.xMarkMap[d];var c=this.component.xAxis.getAxis(b.xAxisIndex),b=this.component.yAxis.getAxis(b.yAxisIndex);!f.type||"max"!==f.type&&"min"!==f.type&&"average"!==f.type?a=["string"!=typeof f.xAxis&&c.getCoordByIndex?c.getCoordByIndex(f.xAxis||0):c.getCoord(f.xAxis||0),"string"!=typeof f.yAxis&&b.getCoordByIndex?b.getCoordByIndex(f.yAxis||0):b.getCoord(f.yAxis||0)]:(c=null!=f.valueIndex?f.valueIndex:1,a=[a[f.type+"X"+c],a[f.type+"Y"+c],a[f.type+"Line"+c],a[f.type+c]]);return a},refresh:function(d){d&&(this.option=d,this.series=d.series);this.backupShapeList();this._buildShape()},ondataRange:function(d,f){this.component.dataRange&&(this.refresh(),f.needRefresh=!0)}},x.inherits(q,v),h("../chart").define("scatter",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(h){function q(f,a,b,c,e,k){v.call(this,f,a,b,c,e);this.axisType=k;this._axisList=[];this.refresh(c)}var v=h("./base"),y=h("zrender/shape/Line"),d=h("../config"),x=h("../util/ecData"),l=h("zrender/tool/util"),u=h("zrender/tool/color");return q.prototype={type:d.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var f=this.option.axisLine.lineStyle.width,a=f/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=f;this.isHorizontal()?a.yStart=a.yEnd=this.subPixelOptimize(a.yEnd,f):a.xStart=a.xEnd=this.subPixelOptimize(a.xEnd,f);a.lineType=this.option.axisLine.lineStyle.type;b=new y(b);this.shapeList.push(b)},_axisLabelClickable:function(f,a){return f?(x.pack(a,void 0,-1,void 0,-1,a.style.text),a.hoverable=!0,a.clickable=!0,a.highlightStyle={color:u.lift(a.style.color,1),brushType:"fill"},a):a},refixAxisShape:function(f,a){if(this.option.axisLine.onZero){var b;if(this.isHorizontal()&&null!=a)for(var c=0,e=this.shapeList.length;e>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!=f)for(c=0,e=this.shapeList.length;e>c;c++)"axisLine"===this.shapeList[c]._axisShape?(this.shapeList[c].style.xStart=this.shapeList[c].style.xEnd=this.subPixelOptimize(f,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=f,this.shapeList[c].style.xEnd=f+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(f){if(!f||f instanceof Array&&0===f.length?f=[{type:d.COMPONENT_TYPE_AXIS_VALUE}]:f instanceof Array||(f=[f]),2<f.length&&(f=[f[0],f[1]]),"xAxis"===this.axisType){(!f[0].position||"bottom"!=f[0].position&&"top"!=f[0].position)&&(f[0].position="bottom");1<f.length&&(f[1].position="bottom"===f[0].position?"top":"bottom");for(var a=0,b=f.length;b>a;a++)f[a].type=f[a].type||"category",f[a].xAxisIndex=a,f[a].yAxisIndex=-1}else for((!f[0].position||"left"!=f[0].position&&"right"!=f[0].position)&&(f[0].position="left"),1<f.length&&(f[1].position="left"===f[0].position?"right":"left"),a=0,b=f.length;b>a;a++)f[a].type=f[a].type||"value",f[a].xAxisIndex=-1,f[a].yAxisIndex=a;return f},refresh:function(f){var a;f&&(this.option=f,"xAxis"===this.axisType?(this.option.xAxis=this.reformOption(f.xAxis),a=this.option.xAxis):(this.option.yAxis=this.reformOption(f.yAxis),a=this.option.yAxis),this.series=f.series);for(var b=h("./categoryAxis"),c=h("./valueAxis"),e=Math.max(a&&a.length||0,this._axisList.length),k=0;e>k;k++)!this._axisList[k]||!f||a[k]&&this._axisList[k].type==a[k].type||(this._axisList[k].dispose&&this._axisList[k].dispose(),this._axisList[k]=!1),this._axisList[k]?this._axisList[k].refresh&&this._axisList[k].refresh(a?a[k]:!1,this.series):a&&a[k]&&(this._axisList[k]="category"===a[k].type?new b(this.ecTheme,this.messageCenter,this.zr,a[k],this.myChart,this.axisBase):new c(this.ecTheme,this.messageCenter,this.zr,a[k],this.myChart,this.axisBase,this.series))},getAxis:function(f){return this._axisList[f]},clear:function(){for(var f=0,a=this._axisList.length;a>f;f++)this._axisList[f].dispose&&this._axisList[f].dispose();this._axisList=[]}},l.inherits(q,v),h("../component").define("axis",q),q});define("echarts/component/grid","require ./base zrender/shape/Rectangle ../config zrender/tool/util ../component".split(" "),function(h){function q(d,h,f,a,b){v.call(this,d,h,f,a,b);this.refresh(a)}var v=h("./base"),y=h("zrender/shape/Rectangle"),d=h("../config");d.grid={zlevel:0,z:0,x:12,y:60,x2:12,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc"};var x=h("zrender/tool/util");return q.prototype={type:d.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(l){for(var h,f,a=l.xAxis._axisList.concat(l.yAxis?l.yAxis._axisList:[]),b=a.length;b--;)l=a[b],l.type==d.COMPONENT_TYPE_AXIS_VALUE&&0>l._min&&0<=l._max&&(l.isHorizontal()?h=l.getCoord(0):f=l.getCoord(0));if("undefined"!=typeof h||"undefined"!=typeof f)for(b=a.length;b--;)a[b].refixAxisShape(h,f)},refresh:function(d){if(d||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear();this.option=d||this.option;this.option.grid=this.reformOption(this.option.grid);d=this.option.grid;this._zrWidth=this.zr.getWidth();this._zrHeight=this.zr.getHeight();this._x=this.parsePercent(d.x,this._zrWidth);this._y=this.parsePercent(d.y,this._zrHeight);var h=this.parsePercent(d.x2,this._zrWidth),f=this.parsePercent(d.y2,this._zrHeight);this._width="undefined"==typeof d.width?this._zrWidth-this._x-h:this.parsePercent(d.width,this._zrWidth);this._width=0>=this._width?10:this._width;this._height="undefined"==typeof d.height?this._zrHeight-this._y-f:this.parsePercent(d.height,this._zrHeight);this._height=0>=this._height?10:this._height;this._x=this.subPixelOptimize(this._x,d.borderWidth);this._y=this.subPixelOptimize(this._y,d.borderWidth);this.shapeList.push(new y({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:0<d.borderWidth?"both":"fill",color:d.backgroundColor,strokeColor:d.borderColor,lineWidth:d.borderWidth}}));this.zr.addShape(this.shapeList[0])}}},x.inherits(q,v),h("../component").define("grid",q),q});define("echarts/component/dataZoom","require ./base zrender/shape/Rectangle zrender/shape/Polygon ../util/shape/Icon ../config ../util/date zrender/tool/util ../component".split(" "),function(h){function q(a,b,c,e,k){v.call(this,a,b,c,e,k);var g=this;g._ondrift=function(c,a){return g.__ondrift(this,c,a)};g._ondragend=function(){return g.__ondragend()};this._fillerSize=30;this._isSilence=!1;this._zoom={};this.option.dataZoom=this.reformOption(this.option.dataZoom);this.zoomOption=this.option.dataZoom;this._handleSize=this.zoomOption.handleSize;this._location=this._getLocation();this._zoom=this._getZoom();this._backupData();this.option.dataZoom.show&&this._buildShape();this._syncData()}var v=h("./base"),y=h("zrender/shape/Rectangle"),d=h("zrender/shape/Polygon"),x=h("../util/shape/Icon"),l=h("../config");l.dataZoom={zlevel:0,z:4,show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",handleSize:20,showDetail:!0,realtime:!1};var u=h("../util/date"),f=h("zrender/tool/util");return q.prototype={type:l.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground();this._buildFiller();this._buildHandle();this._buildFrame();for(var a=0,b=this.shapeList.length;b>a;a++)this.zr.addShape(this.shapeList[a]);this._syncFrameShape()},_getLocation:function(){var a,b,c,e,k=this.component.grid;return"horizontal"==this.zoomOption.orient?(c=this.zoomOption.width||k.getWidth(),e=this.zoomOption.height||this._fillerSize,a=null!=this.zoomOption.x?this.zoomOption.x:k.getX(),b=null!=this.zoomOption.y?this.zoomOption.y:this.zr.getHeight()-e-2):(c=this.zoomOption.width||this._fillerSize,e=this.zoomOption.height||k.getHeight(),a=null!=this.zoomOption.x?this.zoomOption.x:2,b=null!=this.zoomOption.y?this.zoomOption.y:k.getY()),{x:a,y:b,width:c,height:e}},_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 e,k=[],g=this.zoomOption.xAxisIndex;if(b&&null==g){e=[];for(var m=0,d=b.length;d>m;m++)"category"!=b[m].type&&null!=b[m].type||e.push(m)}else e=g instanceof Array?g:null!=g?[g]:[];if(g=this.zoomOption.yAxisIndex,c&&null==g)for(b=[],m=0,d=c.length;d>m;m++)"category"==c[m].type&&b.push(m);else b=g instanceof Array?g:null!=g?[g]:[];for(var p,m=0,d=a.length;d>m;m++)if(p=a[m],p.type==l.CHART_TYPE_LINE||p.type==l.CHART_TYPE_BAR||p.type==l.CHART_TYPE_SCATTER||p.type==l.CHART_TYPE_K){c=0;for(g=e.length;g>c;c++)if(e[c]==(p.xAxisIndex||0)){k.push(m);break}c=0;for(g=b.length;g>c;c++)if(b[c]==(p.yAxisIndex||0)){k.push(m);break}null==this.zoomOption.xAxisIndex&&null==this.zoomOption.yAxisIndex&&p.data&&this.getDataFromOption(p.data[0])instanceof Array&&(p.type==l.CHART_TYPE_SCATTER||p.type==l.CHART_TYPE_LINE||p.type==l.CHART_TYPE_BAR)&&k.push(m)}a=null!=this._zoom.start?this._zoom.start:null!=this.zoomOption.start?this.zoomOption.start:0;m=null!=this._zoom.end?this._zoom.end:null!=this.zoomOption.end?this.zoomOption.end:100;a>m&&(a+=m,m=a-m,a-=m);return{start:a,end:m,start2:0,end2:100,size:Math.round((m-a)/100*("horizontal"==this.zoomOption.orient?this._location.width:this._location.height)),xAxisIndex:e,yAxisIndex:b,seriesIndex:k,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};for(var a=this.option.xAxis,b=this._zoom.xAxisIndex,c=0,e=b.length;e>c;c++)this._originalData.xAxis[b[c]]=a[b[c]].data;a=this.option.yAxis;b=this._zoom.yAxisIndex;c=0;for(e=b.length;e>c;c++)this._originalData.yAxis[b[c]]=a[b[c]].data;for(var b=this.option.series,k=this._zoom.seriesIndex,c=0,e=k.length;e>c;c++)a=b[k[c]],(this._originalData.series[k[c]]=a.data)&&this.getDataFromOption(a.data[0])instanceof Array&&(a.type==l.CHART_TYPE_SCATTER||a.type==l.CHART_TYPE_LINE||a.type==l.CHART_TYPE_BAR)&&(this._backupScale(),this._calculScatterMap(k[c]))},_calculScatterMap:function(a){this._zoom.scatterMap=this._zoom.scatterMap||{};this._zoom.scatterMap[a]=this._zoom.scatterMap[a]||{};var b=h("../component").get("axis"),c=f.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"),e=this.option.series[a].xAxisIndex||0;this._zoom.scatterMap[a].x=c.getAxis(e).getExtremum();c.dispose();c=f.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");e=this.option.series[a].yAxisIndex||0;this._zoom.scatterMap[a].y=c.getAxis(e).getExtremum();c.dispose()},_buildBackground:function(){var a=this._location.width,b=this._location.height;this.shapeList.push(new y({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,e=this._originalData.xAxis,k=this._zoom.xAxisIndex,g=0,m=k.length;m>g;g++)c=Math.max(c,e[k[g]].length);e=this._originalData.yAxis;k=this._zoom.yAxisIndex;g=0;for(m=k.length;m>g;g++)c=Math.max(c,e[k[g]].length);for(var k=this._zoom.seriesIndex[0],f=this._originalData.series[k],p=Number.MIN_VALUE,z=Number.MAX_VALUE,g=0,m=f.length;m>g;g++)e=this.getDataFromOption(f[g],0),this.option.series[k].type==l.CHART_TYPE_K&&(e=e[1]),isNaN(e)&&(e=0),p=Math.max(p,e),z=Math.min(z,e);var p=p-z,n=[],r=a/(c-(1<c?1:0)),h=b/(c-(1<c?1:0)),w=1;"horizontal"==this.zoomOption.orient&&1>r?w=Math.floor(3*c/a):"vertical"==this.zoomOption.orient&&1>h&&(w=Math.floor(3*c/b));g=0;for(m=c;m>g;g+=w)e=this.getDataFromOption(f[g],0),this.option.series[k].type==l.CHART_TYPE_K&&(e=e[1]),isNaN(e)&&(e=0),n.push("horizontal"==this.zoomOption.orient?[this._location.x+r*g,this._location.y+b-1-Math.round((e-z)/p*(b-10))]:[this._location.x+1+Math.round((e-z)/p*(a-10)),this._location.y+h*(m-g-1)]);"horizontal"==this.zoomOption.orient?(n.push([this._location.x+a,this._location.y+b]),n.push([this._location.x,this._location.y+b])):(n.push([this._location.x,this._location.y]),n.push([this._location.x,this._location.y+b]));this.shapeList.push(new d({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:n,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 y(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=f.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=f.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 x(this._startShape);this._endShape=new x(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=f.clone(this._startFrameShape);this._startFrameShape=new y(this._startFrameShape);this._endFrameShape=new y(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,e,k,g,m;for(m in this._originalData){b=this._originalData[m];for(var d in b)g=b[d],null!=g&&(k=g.length,c=Math.floor(this._zoom.start/100*k),e=Math.ceil(this._zoom.end/100*k),this.getDataFromOption(g[0])instanceof Array&&this.option[m][d].type!=l.CHART_TYPE_K?(this._setScale(),this.option[m][d].data=this._synScatterData(d,g)):this.option[m][d].data=g.slice(c,e))}this._isSilence||!this.zoomOption.realtime&&!a||this.messageCenter.dispatch(l.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,e,k,g,m,d=[],p=this._zoom.scatterMap[a];"horizontal"==this.zoomOption.orient?(c=p.x.max-p.x.min,e=this._zoom.start/100*c+p.x.min,k=this._zoom.end/100*c+p.x.min,c=p.y.max-p.y.min,g=this._zoom.start2/100*c+p.y.min,m=this._zoom.end2/100*c+p.y.min):(c=p.x.max-p.x.min,e=this._zoom.start2/100*c+p.x.min,k=this._zoom.end2/100*c+p.x.min,c=p.y.max-p.y.min,g=this._zoom.start/100*c+p.y.min,m=this._zoom.end/100*c+p.y.min);for(var p=0,f=b.length;f>p;p++)c=b[p].value||b[p],c[0]>=e&&c[0]<=k&&c[1]>=g&&c[1]<=m&&d.push(b[p]);return d},_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 e=0,k=b[c].length;k>e;e++)b[c][e].scale=a||b[c][e]._scale},_backupScale:function(){var a={xAxis:this.option.xAxis,yAxis:this.option.yAxis},b;for(b in a)for(var c=0,e=a[b].length;e>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 e=b[c];if(null!=e)return b=e.length,a=Math.floor(this._zoom.start/100*b),b=Math.ceil(this._zoom.end/100*b),b-=0<b?1:0,{start:this.getDataFromOption(e[a]),end:this.getDataFromOption(e[b])}}c=this._zoom.seriesIndex[0];b=this.option[a][this.option.series[c][a+"Index"]||0].type;e=this._zoom.scatterMap[c][a.charAt(0)].min;a=this._zoom.scatterMap[c][a.charAt(0)].max;c=a-e;return"value"==b?{start:e+c*this._zoom.start/100,end:e+c*this._zoom.end/100}:"time"==b?(a=e+c*this._zoom.end/100,e+=c*this._zoom.start/100,b=u.getAutoFormatter(e,a).formatter,{start:u.format(b,e),end:u.format(b,a)}):{start:"",end:""}},__ondrift:function(a,b,c){this.zoomOption.zoomLock&&(a=this._fillerShae);var e="filler"==a._type?this._handleSize:0;if("horizontal"==this.zoomOption.orient?a.style.x+b-e<=this._location.x?a.style.x=this._location.x+e:a.style.x+b+a.style.width+e>=this._location.x+this._location.width?a.style.x=this._location.x+this._location.width-a.style.width-e:a.style.x+=b:a.style.y+c-e<=this._location.y?a.style.y=this._location.y+e:a.style.y+c+a.style.height+e>=this._location.y+this._location.height?a.style.y=this._location.y+this._location.height-a.style.height-e: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(l.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,e=a.y,k=a.width,g=a.height;if(0>k&&(c+=k,k=-k),0>g&&(e+=g,g=-g),c>b.x+b.width||e>b.y+b.height)return!1;c<b.x&&(c=b.x);c+k>b.x+b.width&&(k=b.x+b.width-c);e+g>b.y+b.height&&(g=b.y+b.height-e);var m;a=(c-b.x)/b.width;c=1-(c+k-b.x)/b.width;k=1-(e+g-b.y)/b.height;b=(e-b.y)/b.height;return"horizontal"==this.zoomOption.orient?(m=this._zoom.end-this._zoom.start,this._zoom.start+=m*a,this._zoom.end-=m*c,m=this._zoom.end2-this._zoom.start2,this._zoom.start2+=m*k,this._zoom.end2-=m*b):(m=this._zoom.end-this._zoom.start,this._zoom.start+=m*k,this._zoom.end-=m*b,m=this._zoom.end2-this._zoom.start2,this._zoom.start2+=m*a,this._zoom.end2-=m*c),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(a){for(var b,c=this._originalData.series,e=a.series,k=0,g=e.length;g>k;k++){b=e[k].data||e[k].eventList;a=c[k]?Math.floor(this._zoom.start/100*c[k].length):0;for(var m=0,d=b.length;d>m;m++)c[k]&&(c[k][m+a]=b[m])}},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()}},f.inherits(q,v),h("../component").define("dataZoom",q),q});define("echarts/component/dataRange","require ./base zrender/shape/Text zrender/shape/Rectangle ../util/shape/HandlePolygon ../config zrender/tool/util zrender/tool/event zrender/tool/area zrender/tool/color ../component".split(" "),function(h){function q(c,a,b,g,m){if("undefined"==typeof this.query(g,"dataRange.min")||"undefined"==typeof this.query(g,"dataRange.max"))return void console.error("option.dataRange.min or option.dataRange.max has not been defined.");v.call(this,c,a,b,g,m);var d=this;d._ondrift=function(c,a){return d.__ondrift(this,c,a)};d._ondragend=function(){return d.__ondragend()};d._dataRangeSelected=function(c){return d.__dataRangeSelected(c)};d._dispatchHoverLink=function(c){return d.__dispatchHoverLink(c)};d._onhoverlink=function(c){return d.__onhoverlink(c)};this._selectedMap={};this._range={};this.refresh(g);a.bind(l.EVENT.HOVER,this._onhoverlink)}var v=h("./base"),y=h("zrender/shape/Text"),d=h("zrender/shape/Rectangle"),x=h("../util/shape/HandlePolygon"),l=h("../config");l.dataRange={zlevel:0,z:4,show:!0,orient:"vertical",x:"left",y:"bottom",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:1,itemGap:15,itemWidth:25,itemHeight:25,precision:0,splitNumber:5,calculable:!1,selectedMode:!0,hoverLink:!0,realtime:!0,color:["#006edd","#e0ffff"],textStyle:{fontSize:18,color:"#333"}};var u=h("zrender/tool/util"),f=h("zrender/tool/event"),a=h("zrender/tool/area"),b=h("zrender/tool/color");return q.prototype={type:l.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){if(this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),0>=this.dataRangeOption.splitNumber||this.dataRangeOption.calculable?this._buildGradient():this._buildItem(),this.dataRangeOption.show)for(var c=0,a=this.shapeList.length;a>c;c++)this.zr.addShape(this.shapeList[c]);this._syncShapeFromRange()},_buildItem:function(){var c,e,b,g=this._valueTextList,m=g.length,f=this.getFont(this.dataRangeOption.textStyle),p=this._itemGroupLocation.x,z=this._itemGroupLocation.y,n=this.dataRangeOption.itemWidth,r=this.dataRangeOption.itemHeight,h=this.dataRangeOption.itemGap;c=a.getTextHeight("\u56fd",f);"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(p=this._itemGroupLocation.x+this._itemGroupLocation.width-n);var w=!0;this.dataRangeOption.text&&(w=!1,this.dataRangeOption.text[0]&&(b=this._getTextShape(p,z,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?p+=a.getTextWidth(this.dataRangeOption.text[0],f)+this._textGap:(z+=c+this._textGap,b.style.y+=c/2+this._textGap,b.style.textBaseline="bottom"),this.shapeList.push(new y(b))));for(var D=0;m>D;D++)c=g[D],e=this.getColorByIndex(D),e=this._getItemShape(p,z,n,r,this._selectedMap[D]?e:"#ccc"),e._idx=D,e.onmousemove=this._dispatchHoverLink,this.dataRangeOption.selectedMode&&(e.clickable=!0,e.onclick=this._dataRangeSelected),this.shapeList.push(new d(e)),w&&(b={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:p+n+5,y:z,color:this._selectedMap[D]?this.dataRangeOption.textStyle.color:"#ccc",text:g[D],textFont:f,textBaseline:"top"},highlightStyle:{brushType:"fill"}},"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(b.style.x-=n+10,b.style.textAlign="right"),b._idx=D,b.onmousemove=this._dispatchHoverLink,this.dataRangeOption.selectedMode&&(b.clickable=!0,b.onclick=this._dataRangeSelected),this.shapeList.push(new y(b))),"horizontal"==this.dataRangeOption.orient?p+=n+(w?5:0)+(w?a.getTextWidth(c,f):0)+h:z+=r+h;!w&&this.dataRangeOption.text[1]&&("horizontal"==this.dataRangeOption.orient?p=p-h+this._textGap:z=z-h+this._textGap,b=this._getTextShape(p,z,this.dataRangeOption.text[1]),"horizontal"!=this.dataRangeOption.orient&&(b.style.y-=5,b.style.textBaseline="top"),this.shapeList.push(new y(b)))},_buildGradient:function(){var c,e,b=this.getFont(this.dataRangeOption.textStyle),g=this._itemGroupLocation.x,m=this._itemGroupLocation.y,f=this.dataRangeOption.itemWidth,p=this.dataRangeOption.itemHeight,z=a.getTextHeight("\u56fd",b),n=!0;this.dataRangeOption.text&&(n=!1,this.dataRangeOption.text[0]&&(e=this._getTextShape(g,m,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?g+=a.getTextWidth(this.dataRangeOption.text[0],b)+this._textGap:(m+=z+this._textGap,e.style.y+=z/2+this._textGap,e.style.textBaseline="bottom"),this.shapeList.push(new y(e))));for(var b=h("zrender/tool/color"),z=1/(this.dataRangeOption.color.length-1),r=[],l=0,w=this.dataRangeOption.color.length;w>l;l++)r.push([l*z,this.dataRangeOption.color[l]]);"horizontal"==this.dataRangeOption.orient?(c={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:g,y:m,width:6*f,height:p,color:b.getLinearGradient(g,m,g+6*f,m,r)},hoverable:!1},g+=6*f+this._textGap):(c={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:g,y:m,width:f,height:6*p,color:b.getLinearGradient(g,m,g,m+6*p,r)},hoverable:!1},m+=6*p+this._textGap);this.shapeList.push(new d(c));this._calculableLocation=c.style;this.dataRangeOption.calculable&&(this._buildFiller(),this._bulidMask(),this._bulidHandle());this._buildIndicator();!n&&this.dataRangeOption.text[1]&&(e=this._getTextShape(g,m,this.dataRangeOption.text[1]),this.shapeList.push(new y(e)))},_buildIndicator:function(){var c,a,b=this._calculableLocation.x,g=this._calculableLocation.y,m=this._calculableLocation.width,d=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(c=[[b,g+d],[b-5,g+d+5],[b+5,g+d+5]],a="bottom"):(c=[[b,g],[b-5,g-5],[b+5,g-5]],a="top"):"right"!=this.dataRangeOption.x?(c=[[b+m,g],[b+m+5,g-5],[b+m+5,g+5]],a="right"):(c=[[b,g],[b-5,g-5],[b-5,g+5]],a="left");this._indicatorShape={style:{pointList:c,color:"#fff",__rect:{x:Math.min(c[0][0],c[1][0]),y:Math.min(c[0][1],c[1][1]),width:5*("horizontal"==this.dataRangeOption.orient?2:1),height:5*("horizontal"==this.dataRangeOption.orient?1:2)}},highlightStyle:{brushType:"fill",textPosition:a,textColor:this.dataRangeOption.textStyle.color},hoverable:!1};this._indicatorShape=new x(this._indicatorShape)},_buildFiller:function(){this._fillerShape={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:this._calculableLocation.x,y:this._calculableLocation.y,width:this._calculableLocation.width,height:this._calculableLocation.height,color:"rgba(255,255,255,0)"},highlightStyle:{strokeColor:"rgba(255,255,255,0.5)",lineWidth:1},draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,onmousemove:this._dispatchHoverLink,_type:"filler"};this._fillerShape=new d(this._fillerShape);this.shapeList.push(this._fillerShape)},_bulidHandle:function(){var c,e,b,g,m,d,p,f,n=this._calculableLocation.x,r=this._calculableLocation.y,h=this._calculableLocation.width,w=this._calculableLocation.height,D=this.getFont(this.dataRangeOption.textStyle),t=a.getTextHeight("\u56fd",D),l=Math.max(a.getTextWidth(this._textFormat(this.dataRangeOption.max),D),a.getTextWidth(this._textFormat(this.dataRangeOption.min),D))+2;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(c=[[n,r],[n,r+w+t],[n-t,r+w+t],[n-1,r+w],[n-1,r]],e=n-l/2-t,b=r+w+t/2+2,g={x:n-l-t,y:r+w,width:l+t,height:t},m=[[n+h,r],[n+h,r+w+t],[n+h+t,r+w+t],[n+h+1,r+w],[n+h+1,r]],d=n+h+l/2+t,p=b,f={x:n+h,y:r+w,width:l+t,height:t}):(c=[[n,r+w],[n,r-t],[n-t,r-t],[n-1,r],[n-1,r+w]],e=n-l/2-t,b=r-t/2-2,g={x:n-l-t,y:r-t,width:l+t,height:t},m=[[n+h,r+w],[n+h,r-t],[n+h+t,r-t],[n+h+1,r],[n+h+1,r+w]],d=n+h+l/2+t,p=b,f={x:n+h,y:r-t,width:l+t,height:t}):(l+=t,"right"!=this.dataRangeOption.x?(c=[[n,r],[n+h+t,r],[n+h+t,r-t],[n+h,r-1],[n,r-1]],e=n+h+l/2+t/2,b=r-t/2,g={x:n+h,y:r-t,width:l+t,height:t},m=[[n,r+w],[n+h+t,r+w],[n+h+t,r+t+w],[n+h,r+1+w],[n,r+w+1]],d=e,p=r+w+t/2,f={x:n+h,y:r+w,width:l+t,height:t}):(c=[[n+h,r],[n-t,r],[n-t,r-t],[n,r-1],[n+h,r-1]],e=n-l/2-t/2,b=r-t/2,g={x:n-l-t,y:r-t,width:l+t,height:t},m=[[n+h,r+w],[n-t,r+w],[n-t,r+t+w],[n,r+1+w],[n+h,r+w+1]],d=e,p=r+w+t/2,f={x:n-l-t,y:r+w,width:l+t,height:t}));this._startShape={style:{pointList:c,text:this._textFormat(this.dataRangeOption.max),textX:e,textY:b,textFont:D,color:this.getColor(this.dataRangeOption.max),rect:g,x:c[0][0],y:c[0][1],_x:c[0][0],_y:c[0][1]}};this._startShape.highlightStyle={strokeColor:this._startShape.style.color,lineWidth:1};this._endShape={style:{pointList:m,text:this._textFormat(this.dataRangeOption.min),textX:d,textY:p,textFont:D,color:this.getColor(this.dataRangeOption.min),rect:f,x:m[0][0],y:m[0][1],_x:m[0][0],_y:m[0][1]}};this._endShape.highlightStyle={strokeColor:this._endShape.style.color,lineWidth:1};this._startShape.zlevel=this._endShape.zlevel=this.getZlevelBase();this._startShape.z=this._endShape.z=this.getZBase()+1;this._startShape.draggable=this._endShape.draggable=!0;this._startShape.ondrift=this._endShape.ondrift=this._ondrift;this._startShape.ondragend=this._endShape.ondragend=this._ondragend;this._startShape.style.textColor=this._endShape.style.textColor=this.dataRangeOption.textStyle.color;this._startShape.style.textAlign=this._endShape.style.textAlign="center";this._startShape.style.textPosition=this._endShape.style.textPosition="specific";this._startShape.style.textBaseline=this._endShape.style.textBaseline="middle";this._startShape.style.width=this._endShape.style.width=0;this._startShape.style.height=this._endShape.style.height=0;this._startShape.style.textPosition=this._endShape.style.textPosition="specific";this._startShape=new x(this._startShape);this._endShape=new x(this._endShape);this.shapeList.push(this._startShape);this.shapeList.push(this._endShape)},_bulidMask:function(){var a=this._calculableLocation.x,b=this._calculableLocation.y,k=this._calculableLocation.width,g=this._calculableLocation.height;this._startMask={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:a,y:b,width:"horizontal"==this.dataRangeOption.orient?0:k,height:"horizontal"==this.dataRangeOption.orient?g:0,color:"#ccc"},hoverable:!1};this._endMask={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:"horizontal"==this.dataRangeOption.orient?a+k:a,y:"horizontal"==this.dataRangeOption.orient?b:b+g,width:"horizontal"==this.dataRangeOption.orient?0:k,height:"horizontal"==this.dataRangeOption.orient?g:0,color:"#ccc"},hoverable:!1};this._startMask=new d(this._startMask);this._endMask=new d(this._endMask);this.shapeList.push(this._startMask);this.shapeList.push(this._endMask)},_buildBackground:function(){var a=this.reformCssArray(this.dataRangeOption.padding);this.shapeList.push(new d({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-a[3],y:this._itemGroupLocation.y-a[0],width:this._itemGroupLocation.width+a[3]+a[1],height:this._itemGroupLocation.height+a[0]+a[2],brushType:0===this.dataRangeOption.borderWidth?"fill":"both",color:this.dataRangeOption.backgroundColor,strokeColor:this.dataRangeOption.borderColor,lineWidth:this.dataRangeOption.borderWidth}}))},_getItemGroupLocation:function(){var c=this._valueTextList,b=c.length,k=this.dataRangeOption.itemGap,g=this.dataRangeOption.itemWidth,m=this.dataRangeOption.itemHeight,d=0,f=this.getFont(this.dataRangeOption.textStyle),h=a.getTextHeight("\u56fd",f);if("horizontal"==this.dataRangeOption.orient){if(this.dataRangeOption.text||0>=this.dataRangeOption.splitNumber||this.dataRangeOption.calculable)d=(0>=this.dataRangeOption.splitNumber||this.dataRangeOption.calculable?6*g+k:b*(g+k))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?a.getTextWidth(this.dataRangeOption.text[0],f)+this._textGap:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?a.getTextWidth(this.dataRangeOption.text[1],f)+this._textGap:0);else for(var g=g+5,n=0;b>n;n++)d+=g+a.getTextWidth(c[n],f)+k;d-=k;m=Math.max(h,m)}else{if(this.dataRangeOption.text||0>=this.dataRangeOption.splitNumber||this.dataRangeOption.calculable)m=(0>=this.dataRangeOption.splitNumber||this.dataRangeOption.calculable?6*m+k:b*(m+k))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?this._textGap+h:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?this._textGap+h:0),d=Math.max(a.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[0]||"",f),a.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[1]||"",f)),d=Math.max(g,d);else{m=(m+k)*b;g+=5;for(n=d=0;b>n;n++)d=Math.max(d,a.getTextWidth(c[n],f));d=g+d}m-=k}g=this.reformCssArray(this.dataRangeOption.padding);b=this.zr.getWidth();switch(this.dataRangeOption.x){case "center":c=Math.floor((b-d)/2);break;case "left":c=g[3]+this.dataRangeOption.borderWidth;break;case "right":c=b-d-g[1]-this.dataRangeOption.borderWidth;break;default:c=this.parsePercent(this.dataRangeOption.x,b),c=isNaN(c)?0:c}k=this.zr.getHeight();switch(this.dataRangeOption.y){case "top":g=g[0]+this.dataRangeOption.borderWidth;break;case "bottom":g=k-m-g[2]-this.dataRangeOption.borderWidth;break;case "center":g=Math.floor((k-m)/2);break;default:g=this.parsePercent(this.dataRangeOption.y,k),g=isNaN(g)?0:g}this.dataRangeOption.calculable&&(f=Math.max(a.getTextWidth(this.dataRangeOption.max,f),a.getTextWidth(this.dataRangeOption.min,f))+h,"horizontal"==this.dataRangeOption.orient?(f>c&&(c=f),c+d+f>b&&(c-=f)):(h>g&&(g=h),g+m+h>k&&(g-=h)));return{x:c,y:g,width:d,height:m}},_getTextShape:function(a,b,k){return{zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:"horizontal"==this.dataRangeOption.orient?a:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:"horizontal"==this.dataRangeOption.orient?this._itemGroupLocation.y+this._itemGroupLocation.height/2:b,color:this.dataRangeOption.textStyle.color,text:k,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:"horizontal"==this.dataRangeOption.orient?"middle":"top",textAlign:"horizontal"==this.dataRangeOption.orient?"left":"center"},hoverable:!1}},_getItemShape:function(a,b,k,g,m){return{zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:a,y:b+1,width:k,height:g-2,color:m},highlightStyle:{strokeColor:m,lineWidth:1}}},__ondrift:function(a,b,k){var g=this._calculableLocation.x,m=this._calculableLocation.y,d=this._calculableLocation.width,f=this._calculableLocation.height;return"horizontal"==this.dataRangeOption.orient?a.style.x+b<=g?a.style.x=g:a.style.x+b+a.style.width>=g+d?a.style.x=g+d-a.style.width:a.style.x+=b:a.style.y+k<=m?a.style.y=m:a.style.y+k+a.style.height>=m+f?a.style.y=m+f-a.style.height:a.style.y+=k,"filler"==a._type?this._syncHandleShape():this._syncFillerShape(a),this.dataRangeOption.realtime&&this._dispatchDataRange(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(a,b){this.isDragend&&a.target&&(b.dragOut=!0,b.dragIn=!0,this.dataRangeOption.realtime||this._dispatchDataRange(),b.needRefresh=!1,this.isDragend=!1)},_syncShapeFromRange:function(){var a=this.dataRangeOption.range||{};if(this._range.end="undefined"!=typeof this._range.end?this._range.end:"undefined"!=typeof a.start?a.start:0,this._range.start="undefined"!=typeof this._range.start?this._range.start:"undefined"!=typeof a.end?a.end:100,100!=this._range.start||0!==this._range.end)"horizontal"==this.dataRangeOption.orient?(a=this._fillerShape.style.width,this._fillerShape.style.x+=a*(100-this._range.start)/100,this._fillerShape.style.width=a*(this._range.start-this._range.end)/100):(a=this._fillerShape.style.height,this._fillerShape.style.y+=a*(100-this._range.start)/100,this._fillerShape.style.height=a*(this._range.start-this._range.end)/100),this.zr.modShape(this._fillerShape.id),this._syncHandleShape()},_syncHandleShape:function(){var a=this._calculableLocation.x,b=this._calculableLocation.y,k=this._calculableLocation.width,g=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(this._startShape.style.x=this._fillerShape.style.x,this._startMask.style.width=this._startShape.style.x-a,this._endShape.style.x=this._fillerShape.style.x+this._fillerShape.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=a+k-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-a)/k*100),this._range.end=Math.floor(100-(this._endShape.style.x-a)/k*100)):(this._startShape.style.y=this._fillerShape.style.y,this._startMask.style.height=this._startShape.style.y-b,this._endShape.style.y=this._fillerShape.style.y+this._fillerShape.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=b+g-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-b)/g*100),this._range.end=Math.floor(100-(this._endShape.style.y-b)/g*100));this._syncShape()},_syncFillerShape:function(a){var b,k,g=this._calculableLocation.x,m=this._calculableLocation.y,d=this._calculableLocation.width,f=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(b=this._startShape.style.x,k=this._endShape.style.x,a.id==this._startShape.id&&b>=k?(k=b,this._endShape.style.x=b):a.id==this._endShape.id&&b>=k&&(b=k,this._startShape.style.x=b),this._fillerShape.style.x=b,this._fillerShape.style.width=k-b,this._startMask.style.width=b-g,this._endMask.style.x=k,this._endMask.style.width=g+d-k,this._range.start=Math.ceil(100-(b-g)/d*100),this._range.end=Math.floor(100-(k-g)/d*100)):(b=this._startShape.style.y,k=this._endShape.style.y,a.id==this._startShape.id&&b>=k?(k=b,this._endShape.style.y=b):a.id==this._endShape.id&&b>=k&&(b=k,this._startShape.style.y=b),this._fillerShape.style.y=b,this._fillerShape.style.height=k-b,this._startMask.style.height=b-m,this._endMask.style.y=k,this._endMask.style.height=m+f-k,this._range.start=Math.ceil(100-(b-m)/f*100),this._range.end=Math.floor(100-(k-m)/f*100));this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y];this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min);this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min);this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y];this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min);this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min);this.zr.modShape(this._startShape.id);this.zr.modShape(this._endShape.id);this.zr.modShape(this._startMask.id);this.zr.modShape(this._endMask.id);this.zr.modShape(this._fillerShape.id);this.zr.refreshNextFrame()},_dispatchDataRange:function(){this.messageCenter.dispatch(l.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(a){if("single"===this.dataRangeOption.selectedMode)for(var b in this._selectedMap)this._selectedMap[b]=!1;b=a.target._idx;this._selectedMap[b]=!this._selectedMap[b];var k=(this._colorList.length-b)*this._gap+this.dataRangeOption.min;this.messageCenter.dispatch(l.EVENT.DATA_RANGE_SELECTED,a.event,{selected:this._selectedMap,target:b,valueMax:k,valueMin:k-this._gap},this.myChart);this.messageCenter.dispatch(l.EVENT.REFRESH,null,null,this.myChart)},__dispatchHoverLink:function(a){var b,k;if(this.dataRangeOption.calculable){var g=this.dataRangeOption.max-this.dataRangeOption.min;k="horizontal"==this.dataRangeOption.orient?(1-(f.getX(a.event)-this._calculableLocation.x)/this._calculableLocation.width)*g:(1-(f.getY(a.event)-this._calculableLocation.y)/this._calculableLocation.height)*g;b=k-.05*g;k+=.05*g}else k=(this._colorList.length-a.target._idx)*this._gap+this.dataRangeOption.min,b=k-this._gap;this.messageCenter.dispatch(l.EVENT.DATA_RANGE_HOVERLINK,a.event,{valueMin:b,valueMax:k},this.myChart)},__onhoverlink:function(a){if(this.dataRangeOption.show&&this.dataRangeOption.hoverLink&&this._indicatorShape&&a&&null!=a.seriesIndex&&null!=a.dataIndex){var b=a.value;""===b||isNaN(b)||(b<this.dataRangeOption.min?b=this.dataRangeOption.min:b>this.dataRangeOption.max&&(b=this.dataRangeOption.max),this._indicatorShape.position="horizontal"==this.dataRangeOption.orient?[(this.dataRangeOption.max-b)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.width,0]:[0,(this.dataRangeOption.max-b)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.height],this._indicatorShape.style.text=this._textFormat(a.value),this._indicatorShape.style.color=this.getColor(b),this.zr.addHoverShape(this._indicatorShape))}},_textFormat:function(a,b){if(a=a.toFixed(this.dataRangeOption.precision),b=null!=b?b.toFixed(this.dataRangeOption.precision):"",this.dataRangeOption.formatter){if("string"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.replace("{value}",a).replace("{value2}",b);if("function"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.call(this.myChart,a,b)}return""!==b?a+" - "+b:a},refresh:function(a){if(a){this.option=a;this.option.dataRange=this.reformOption(this.option.dataRange);this.dataRangeOption=this.option.dataRange;a=0>=this.dataRangeOption.splitNumber||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;if(this._colorList=b.getGradientColors(this.dataRangeOption.color,Math.max((a-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1),this._colorList.length>a){for(var e=this._colorList.length,k=[this._colorList[0]],g=e/(a-1),d=1;a-1>d;d++)k.push(this._colorList[Math.floor(d*g)]);k.push(this._colorList[e-1]);this._colorList=k}e=this.dataRangeOption.precision;for(this._gap=(this.dataRangeOption.max-this.dataRangeOption.min)/a;this._gap.toFixed(e)-0!=this._gap&&5>e;)e++;this.dataRangeOption.precision=e;this._gap=((this.dataRangeOption.max-this.dataRangeOption.min)/a).toFixed(e)-0;this._valueTextList=[];for(d=0;a>d;d++)this._selectedMap[d]=!0,this._valueTextList.unshift(this._textFormat(d*this._gap+this.dataRangeOption.min,(d+1)*this._gap+this.dataRangeOption.min))}this.clear();this._buildShape()},getColor:function(a){if(isNaN(a))return null;if(this.dataRangeOption.min==this.dataRangeOption.max)return this._colorList[0];if(a<this.dataRangeOption.min?a=this.dataRangeOption.min:a>this.dataRangeOption.max&&(a=this.dataRangeOption.max),this.dataRangeOption.calculable&&(5E-5<a-(this._gap*this._range.start+this.dataRangeOption.min)||-5E-5>a-(this._gap*this._range.end+this.dataRangeOption.min)))return null;a=this._colorList.length-Math.ceil((a-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return a==this._colorList.length&&a--,this._selectedMap[a]?this._colorList[a]:null},getColorByIndex:function(a){return a>=this._colorList.length?a=this._colorList.length-1:0>a&&(a=0),this._colorList[a]},onbeforDispose:function(){this.messageCenter.unbind(l.EVENT.HOVER,this._onhoverlink)}},u.inherits(q,v),h("../component").define("dataRange",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(h){function q(a,b,c,e,k,g){if(1>e.data.length)return void console.error("option.data.length \x3c 1.");v.call(this,a,b,c,e,k);this.grid=this.component.grid;for(var d in g)this[d]=g[d];this.refresh(e)}var v=h("./base"),y=h("zrender/shape/Text"),d=h("zrender/shape/Line"),x=h("zrender/shape/Rectangle"),l=h("../config");l.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 u=h("zrender/tool/util"),f=h("zrender/tool/area");return q.prototype={type:l.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,e=this.option.data.length;if(this.isHorizontal())if(3<e)for(var k,g,d=this.getGap(),h=!1,p=Math.floor(.5/d),p=1>p?1:p,a=Math.floor(15/d);!h&&e>a;){a+=p;h=!0;k=Math.floor(d*a);for(var l=Math.floor((e-1)/a)*a;0<=l;l-=a){if(0!==this.option.axisLabel.rotate)g=b;else if(c[l].textStyle)g=f.getTextWidth(this._getReformedLabel(l),this.getFont(u.merge(c[l].textStyle,this.option.axisLabel.textStyle)));else{g=this._getReformedLabel(l)+"";var n=(g.match(/\w/g)||"").length;g=n*b*2/3+(g.length-n)*b}if(g>k){h=!1;break}}}else a=1;else if(3<e)for(d=this.getGap(),a=Math.floor(11/d);b>d*a-6&&e>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,e=this.option.axisTick,k=e.length,g=e.lineStyle.color,m=e.lineStyle.width,f="function"==typeof e.interval?e.interval:"auto"==e.interval&&"function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,p=f?1:"auto"==e.interval?this._interval:e.interval-0+1,h=e.onGap,h=h?this.getGap()/2:"undefined"==typeof h&&this.option.boundaryGap?this.getGap()/2:0,n=0<h?-p:0;if(this.isHorizontal())for(var l,q="bottom"==this.option.position?e.inside?this.grid.getYend()-k-1:this.grid.getYend()+1:e.inside?this.grid.getY()+1:this.grid.getY()-k-1;c>n;n+=p)f&&!f(n,b[n])||(l=this.subPixelOptimize(this.getCoordByIndex(n)+(0<=n?h:0),m),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:l,yStart:q,xEnd:l,yEnd:q+k,strokeColor:g,lineWidth:m}},this.shapeList.push(new d(a)));else for(l="left"==this.option.position?e.inside?this.grid.getX()+1:this.grid.getX()-k-1:e.inside?this.grid.getXend()-k-1:this.grid.getXend()+1;c>n;n+=p)f&&!f(n,b[n])||(q=this.subPixelOptimize(this.getCoordByIndex(n)-(0<=n?h:0),m),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:l,yStart:q,xEnd:l+k,yEnd:q,strokeColor:g,lineWidth:m}},this.shapeList.push(new d(a)))},_buildAxisLabel:function(){var a,b,c=this.option.data,e=this.option.data.length,k=this.option.axisLabel,g=k.rotate,d=k.margin,f=k.clickable,h=k.textStyle,k="function"==typeof k.interval?k.interval:!1;if(this.isHorizontal()){var l,n;"bottom"==this.option.position?(l=this.grid.getYend()+d,n="top"):(l=this.grid.getY()-d,n="bottom");for(d=0;e>d;d+=this._interval)k&&!k(d,c[d])||""===this._getReformedLabel(d)||(b=u.merge(c[d].textStyle||{},h),a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoordByIndex(d),y:l,color:b.color,text:this._getReformedLabel(d),textFont:this.getFont(b),textAlign:b.align||"center",textBaseline:b.baseline||n}},g&&(a.style.textAlign=0<g?"bottom"==this.option.position?"right":"left":"bottom"==this.option.position?"left":"right",a.rotation=[g*Math.PI/180,a.style.x,a.style.y]),this.shapeList.push(new y(this._axisLabelClickable(f,a))))}else{var r,q;"left"==this.option.position?(r=this.grid.getX()-d,q="right"):(r=this.grid.getXend()+d,q="left");for(d=0;e>d;d+=this._interval)k&&!k(d,c[d])||""===this._getReformedLabel(d)||(b=u.merge(c[d].textStyle||{},h),a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:r,y:this.getCoordByIndex(d),color:b.color,text:this._getReformedLabel(d),textFont:this.getFont(b),textAlign:b.align||q,textBaseline:b.baseline||0===d&&""!==this.option.name?"bottom":d==e-1&&""!==this.option.name?"top":"middle"}},g&&(a.rotation=[g*Math.PI/180,a.style.x,a.style.y]),this.shapeList.push(new y(this._axisLabelClickable(f,a))))}},_buildSplitLine:function(){var a,b=this.option.data,c=this.option.data.length,e=this.option.splitLine,k=e.lineStyle.type,g=e.lineStyle.width,f=e.lineStyle.color,f=f instanceof Array?f:[f],h=f.length,p="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,l=e.onGap,e=l?this.getGap()/2:"undefined"==typeof l&&this.option.boundaryGap?this.getGap()/2:0;if(c-=l||"undefined"==typeof l&&this.option.boundaryGap?1:0,this.isHorizontal())for(var n,r=this.grid.getY(),q=this.grid.getYend(),l=0;c>l;l+=this._interval)p&&!p(l,b[l])||(n=this.subPixelOptimize(this.getCoordByIndex(l)+e,g),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:n,yStart:r,xEnd:n,yEnd:q,strokeColor:f[l/this._interval%h],lineType:k,lineWidth:g}},this.shapeList.push(new d(a)));else for(n=this.grid.getX(),q=this.grid.getXend(),l=0;c>l;l+=this._interval)p&&!p(l,b[l])||(r=this.subPixelOptimize(this.getCoordByIndex(l)-e,g),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:n,yStart:r,xEnd:q,yEnd:r,strokeColor:f[l/this._interval%h],lineType:k,lineWidth:g}},this.shapeList.push(new d(a)))},_buildSplitArea:function(){var a,b=this.option.data,c=this.option.splitArea,e=c.areaStyle.color;if(e instanceof Array){var k=e.length,d=this.option.data.length,f="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 h,l=this.grid.getY(),q=this.grid.getHeight(),n=this.grid.getX(),r=0;d>=r;r+=this._interval)f&&!f(r,b[r])&&d>r||(h=d>r?this.getCoordByIndex(r)+c:this.grid.getXend(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:n,y:l,width:h-n,height:q,color:e[r/this._interval%k]}},this.shapeList.push(new x(a)),n=h);else for(h=this.grid.getX(),q=this.grid.getWidth(),n=this.grid.getYend(),r=0;d>=r;r+=this._interval)f&&!f(r,b[r])&&d>r||(l=d>r?this.getCoordByIndex(r)-c:this.grid.getY(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:h,y:l,width:q,height:n-l,color:e[r/this._interval%k]}},this.shapeList.push(new x(a)),n=l)}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 x(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/(1<a?a-1:1)},getCoord:function(a){for(var b=this.option.data,c=b.length,e=this.getGap(),k=this.option.boundaryGap?e/2:0,d=0;c>d;d++){if(this.getDataFromOption(b[d])==a)return this.isHorizontal()?this.grid.getX()+k:this.grid.getYend()-k;k+=e}},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,e=0;c>e;e++)if(this.getDataFromOption(b[e])==a)return e;return-1},getValueFromCoord:function(){return""},isMainAxis:function(a){return 0===a%this._interval}},u.inherits(q,v),h("../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(h){function q(a,b,c,e,d,g,f){if(!f||0===f.length)return void console.err("option.series.length \x3d\x3d 0.");v.call(this,a,b,c,e,d);this.series=f;this.grid=this.component.grid;for(var h in g)this[h]=g[h];this.refresh(e,f)}var v=h("./base"),y=h("zrender/shape/Text"),d=h("zrender/shape/Line"),x=h("zrender/shape/Rectangle"),l=h("../config");l.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 u=h("../util/date"),f=h("zrender/tool/util");return q.prototype={type:l.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,e=this.option.axisTick,k=e.length,g=e.lineStyle.color,f=e.lineStyle.width;if(this.isHorizontal())for(var h="bottom"===this.option.position?e.inside?this.grid.getYend()-k-1:this.grid.getYend()+1:e.inside?this.grid.getY()+1:this.grid.getY()-k-1,e=0;c>e;e++)a=this.subPixelOptimize(this.getCoord(b[e]),f),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:a,yStart:h,xEnd:a,yEnd:h+k,strokeColor:g,lineWidth:f}},this.shapeList.push(new d(a));else for(h="left"===this.option.position?e.inside?this.grid.getX()+1:this.grid.getX()-k-1:e.inside?this.grid.getXend()-k-1:this.grid.getXend()+1,e=0;c>e;e++)a=this.subPixelOptimize(this.getCoord(b[e]),f),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:h,yStart:a,xEnd:h+k,yEnd:a,strokeColor:g,lineWidth:f}},this.shapeList.push(new d(a))},_buildAxisLabel:function(){var a,b=this._valueList,c=this._valueList.length,e=this.option.axisLabel.rotate;a=this.option.axisLabel.margin;var d=this.option.axisLabel.clickable,g=this.option.axisLabel.textStyle;if(this.isHorizontal()){var f,h;"bottom"===this.option.position?(f=this.grid.getYend()+a,h="top"):(f=this.grid.getY()-a,h="bottom");for(var l=0;c>l;l++)a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoord(b[l]),y:f,color:"function"==typeof g.color?g.color(b[l]):g.color,text:this._valueLabel[l],textFont:this.getFont(g),textAlign:g.align||"center",textBaseline:g.baseline||h}},e&&(a.style.textAlign=0<e?"bottom"===this.option.position?"right":"left":"bottom"===this.option.position?"left":"right",a.rotation=[e*Math.PI/180,a.style.x,a.style.y]),this.shapeList.push(new y(this._axisLabelClickable(d,a)))}else{var q,n;"left"===this.option.position?(q=this.grid.getX()-a,n="right"):(q=this.grid.getXend()+a,n="left");for(l=0;c>l;l++)a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:q,y:this.getCoord(b[l]),color:"function"==typeof g.color?g.color(b[l]):g.color,text:this._valueLabel[l],textFont:this.getFont(g),textAlign:g.align||n,textBaseline:g.baseline||(0===l&&""!==this.option.name?"bottom":l===c-1&&""!==this.option.name?"top":"middle")}},e&&(a.rotation=[e*Math.PI/180,a.style.x,a.style.y]),this.shapeList.push(new y(this._axisLabelClickable(d,a)))}},_buildSplitLine:function(){var a,b=this._valueList,c=this._valueList.length,e=this.option.splitLine,k=e.lineStyle.type,g=e.lineStyle.width,e=e.lineStyle.color,e=e instanceof Array?e:[e],f=e.length;if(this.isHorizontal())for(var h=this.grid.getY(),l=this.grid.getYend(),q=0;c>q;q++)a=this.subPixelOptimize(this.getCoord(b[q]),g),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:a,yStart:h,xEnd:a,yEnd:l,strokeColor:e[q%f],lineType:k,lineWidth:g}},this.shapeList.push(new d(a));else for(h=this.grid.getX(),l=this.grid.getXend(),q=0;c>q;q++)a=this.subPixelOptimize(this.getCoord(b[q]),g),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:h,yStart:a,xEnd:l,yEnd:a,strokeColor:e[q%f],lineType:k,lineWidth:g}},this.shapeList.push(new d(a))},_buildSplitArea:function(){var a,b=this.option.splitArea.areaStyle.color;if(b instanceof Array){var c=b.length,e=this._valueList,d=this._valueList.length;if(this.isHorizontal()){var g,f=this.grid.getY(),h=this.grid.getHeight();a=this.grid.getX();for(var l=0;d>=l;l++)g=d>l?this.getCoord(e[l]):this.grid.getXend(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:a,y:f,width:g-a,height:h,color:b[l%c]}},this.shapeList.push(new x(a)),a=g}else for(f=this.grid.getX(),h=this.grid.getWidth(),a=this.grid.getYend(),l=0;d>=l;l++)g=d>l?this.getCoord(e[l]):this.grid.getY(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:f,y:g,width:h,height:a-g,color:b[l%c]}},this.shapeList.push(new x(a)),a=g}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 x(a))},_calculateValue:function(){if(isNaN(this.option.min-0)||isNaN(this.option.max-0)){for(var a,b,c={},e=this.component.legend,d=0,g=this.series.length;g>d;d++)!(this.series[d].type!=l.CHART_TYPE_LINE&&this.series[d].type!=l.CHART_TYPE_BAR&&this.series[d].type!=l.CHART_TYPE_SCATTER&&this.series[d].type!=l.CHART_TYPE_K&&this.series[d].type!=l.CHART_TYPE_EVENTRIVER||e&&!e.isSelected(this.series[d].name)||(a=this.series[d].xAxisIndex||0,b=this.series[d].yAxisIndex||0,this.option.xAxisIndex!=a&&this.option.yAxisIndex!=b||!this._calculSum(c,d)));for(d in c){a=c[d];b=0;for(e=a.length;e>b;b++)if(!isNaN(a[b])){this._hasData=!0;this._min=a[b];this._max=a[b];break}if(this._hasData)break}for(d in c)for(a=c[d],b=0,e=a.length;e>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:0<this._max?this._min=this.option.splitNumber:this._max=this.option.splitNumber);"time"!=this.option.type?this._reformValue(this.option.scale):this._reformTimeValue()}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,"time"!=this.option.type?this._customerValue():this._reformTimeValue()},_calculSum:function(a,b){var c,e,d=this.series[b].name||"kener";if(this.series[b].stack){var g="__Magic_Key_Positive__"+this.series[b].stack,f="__Magic_Key_Negative__"+this.series[b].stack;a[g]=a[g]||[];a[f]=a[f]||[];a[d]=a[d]||[];e=this.series[b].data;for(var h=0,p=e.length;p>h;h++)c=this.getDataFromOption(e[h]),"-"!==c&&(c-=0,0<=c?null!=a[g][h]?a[g][h]+=c:a[g][h]=c:null!=a[f][h]?a[f][h]+=c:a[f][h]=c,this.option.scale&&a[d].push(c))}else if(a[d]=a[d]||[],this.series[b].type!=l.CHART_TYPE_EVENTRIVER)for(e=this.series[b].data,h=0,p=e.length;p>h;h++)c=this.getDataFromOption(e[h]),this.series[b].type===l.CHART_TYPE_K?(a[d].push(c[0]),a[d].push(c[1]),a[d].push(c[2]),a[d].push(c[3])):c instanceof Array?(-1!=this.option.xAxisIndex&&a[d].push("time"!=this.option.type?c[0]:u.getNewDate(c[0])),-1!=this.option.yAxisIndex&&a[d].push("time"!=this.option.type?c[1]:u.getNewDate(c[1]))):a[d].push(c);else for(e=this.series[b].eventList,h=0,p=e.length;p>h;h++)for(c=e[h].evolution,g=0,f=c.length;f>g;g++)a[d].push(u.getNewDate(c[g].time))},_reformValue:function(a){var b=h("../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=u.getAutoFormatter(this._min,this._max,a),c=b.formatter,e=b.gapValue;this._valueList=[u.getNewDate(this._min)];var d;switch(c){case "week":d=u.nextMonday(this._min);break;case "month":d=u.nextNthOnMonth(this._min,1);break;case "quarter":d=u.nextNthOnQuarterYear(this._min,1);break;case "half-year":d=u.nextNthOnHalfYear(this._min,1);break;case "year":d=u.nextNthOnYear(this._min,1);break;default:72E5>=e?d=(Math.floor(this._min/e)+1)*e:(d=u.getNewDate(this._min- -e),d.setHours(6*Math.round(d.getHours()/6)),d.setMinutes(0),d.setSeconds(0))}d-this._min<e/2&&(d-=-e);b=u.getNewDate(d);for(a*=1.5;0<=a--&&(("month"==c||"quarter"==c||"half-year"==c||"year"==c)&&b.setDate(1),!(this._max-b<e/2));)this._valueList.push(b),b=u.getNewDate(b- -e);this._valueList.push(u.getNewDate(this._max));this._reformLabelData(c)},_customerValue:function(){var a=h("../util/accMath"),b=null!=this.option.splitNumber?this.option.splitNumber:5,c=(this._max-this._min)/b;this._valueList=[];for(var d=0;b>=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?u.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(u.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=f.merge(this.option.axisLabel.textStyle||{},this.ecTheme.textStyle),this.series=b);this.zr&&(this.clear(),this._buildShape())},getCoord:function(a){a=a<this._min?this._min:a;a=a>this._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=a<this.grid.getX()?this.grid.getX():a,a=a>this.grid.getXend()?this.grid.getXend():a,b=this._min+(a-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(a=a<this.grid.getY()?this.grid.getY():a,a=a>this.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}},f.inherits(q,v),h("../component").define("valueAxis",q),q});define("echarts/util/date",[],function(){function h(d){return 10>d?"0"+d:d}function q(d,h,l){return d=v(d),d.setMonth(Math.ceil((d.getMonth()+1)/l)*l),d.setDate(h),d}function v(d){return d instanceof Date?d:new Date("string"==typeof d?d.replace(/-/g,"/"):d)}var y=[{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(d,h,l){l=1<l?l:2;for(var q,f,a,b,c=0,e=y.length;e>c;c++)if(q=y[c].value,f=Math.ceil(h/q)*q-Math.floor(d/q)*q,Math.round(f/q)<=1.2*l){a=y[c].formatter;b=y[c].value;break}return null==a&&(a="year",q=317088E5,f=Math.ceil(h/q)*q-Math.floor(d/q)*q,b=Math.round(f/(l-1)/q)*q),{formatter:a,gapValue:b}},getNewDate:v,format:function(d,q){"week"!=d&&"month"!=d&&"quarter"!=d&&"half-year"!=d&&"year"!=d||(d="MM - dd\nyyyy");var l=v(q),u=l.getFullYear(),f=l.getMonth()+1,a=l.getDate(),b=l.getHours(),c=l.getMinutes(),l=l.getSeconds();return d=d.replace("MM",h(f)),d=d.toLowerCase(),d=d.replace("yyyy",u),d=d.replace("yy",u%100),d=d.replace("dd",h(a)),d=d.replace("d",a),d=d.replace("hh",h(b)),d=d.replace("h",b),d=d.replace("mm",h(c)),d=d.replace("m",c),d=d.replace("ss",h(l)),d.replace("s",l)},nextMonday:function(d){return d=v(d),d.setDate(d.getDate()+8-d.getDay()),d},nextNthPerNmonth:q,nextNthOnMonth:function(d,h){return q(d,h,1)},nextNthOnQuarterYear:function(d,h){return q(d,h,3)},nextNthOnHalfYear:function(d,h){return q(d,h,6)},nextNthOnYear:function(d,h){return q(d,h,12)}}});define("echarts/util/smartSteps",[],function(){function h(a,d,g,f){f=f||0;var k=q((d-a)/g,-1);a=q(a,-1,1);d=q(d,-1);var h=p.min(k.e,a.e,d.e);0===a.c?h=p.min(k.e,d.e):0===d.c&&(h=p.min(k.e,a.e));v(k,{c:0,e:h});v(a,k,1);v(d,k);f+=h;a=a.c;d=d.c;for(var k=(d-a)/g,h=p.pow(10,f),l=0,m=[],n=g+1;n--;)m[n]=(a+k*n)*h;if(0>f)for(n=h,l=(n=(+n).toFixed(15).split("."),n.pop().replace(/0+$/,"").length),k=+(k*h).toFixed(l),a=+(a*h).toFixed(l),d=+(d*h).toFixed(l),n=m.length;n--;)m[n]=m[n].toFixed(l),0===+m[n]&&(m[n]="0");else a*=h,d*=h,k*=h;return e=0,c=0,b=0,{min:a,max:d,secs:g,step:k,fix:l,exp:f,pnts:m}}function q(a,b,c){b=z(b%10)||2;0>b&&(a===n(a)?b=(""+H(a)).replace(/0+$/,"").length||1:(a=a.toFixed(15).replace(/0+$/,""),b=a.replace(".","").replace(/^[-0]+/,"").length,a=+a));var d=n(p.log(H(a))/p.LN10)-b+1;a=+(a*p.pow(10,-d)).toFixed(15)||0;return a=c?n(a):r(a),!a&&(d=0),(""+H(a)).length>b&&(d+=1,a/=10),{c:a,e:d}}function v(a,b,c){(b=b.e-a.e)&&(a.e+=b,a.c*=p.pow(10,-b),a.c=c?n(a.c):r(a.c))}function y(a,b,c){a.e<b.e?v(b,a,c):v(a,b,c)}function d(a,b){b=b||m;a=q(a);for(var c=a.c,d=0;c>b[d];)d++;if(!b[d])for(c/=10,a.e+=1,d=0;c>b[d];)d++;return a.c=b[d],a}function x(a,b,m){var F=m||+e.slice(-1),A=d((b-a)/F,c),x=q(b-a),C=q(a,-1,1),B=q(b,-1);v(x,A);v(C,A,1);v(B,A);if(m){var x=F,G,E;G=B.c;for(A=(B.c-C.c)/x-1;G>C.c;)A=d(A+1,c),A=A.c*p.pow(10,A.e),G=A*x,E=r(B.c/A)*A,G=E-G;x=C.c-G-(E-B.c);x>1.1*A&&(x=z(x/A/2)*A,G+=x,E+=x);C.c=G;B.c=E}else F=l(C,B);if(a===n(a)&&b===n(b)&&0<=a*b){if(F>b-a)return u(a,b,F);E=B.c-C.c;A=E/F*p.pow(10,B.e);A!==n(A)&&(A=n(A),E=A*F,b-a>E&&(A+=1,E=A*F,!m&&A*(F-1)>=b-a&&(--F,E=A*F)),E>=b-a)&&(m=E-(b-a),C.c=z(a-m/2),B.c=z(b+m/2),C.e=0,B.e=0)}m=f(a,b,C.c,B.c);C.c=m[0];B.c=m[1];if(k||g)k?(a=q(a,4,1),6<C.e-a.e&&(a={c:0,e:C.e}),y(C,a),y(B,a),B.c+=a.c-C.c,C.c=a.c):g&&(a=q(b,4),6<B.e-a.e&&(a={c:0,e:B.e}),y(C,a),y(B,a),C.c+=a.c-B.c,B.c=a.c);return h(C.c,B.c,F,B.e)}function l(a,b){for(var g,f,k,h,l=[],m=e.length;m--;)g=e[m],f=d((b.c-a.c)/g,c),f=f.c*p.pow(10,f.e),k=n(a.c/f)*f,h=r(b.c/f)*f,l[m]={min:k,max:h,step:f,span:h-k};return l.sort(function(a,b){var c=a.span-b.span;return 0===c&&(c=a.step-b.step),c}),l=l[0],g=l.span/l.step,a.c=l.min,b.c=l.max,3>g?2*g:g}function u(a,b,c){if(c=c||5,k)b=a+c;else if(g)a=b-c;else{var d=c-(b-a),e=z(a-d/2),d=z(b+d/2);b=f(a,b,e,d);a=b[0];b=b[1]}return h(a,b,c)}function f(a,b,c,d){return 0<=a&&0>c?(d-=c,c=0):0>=b&&0<d&&(c-=d,d=0),[c,d]}function a(a,b,c){var d=c?[c]:e,g=b-a;if(0===g)return b=q(b,3),c=d[0],b.c=z(b.c+c/2),h(b.c-c,b.c,c,b.e);1E-6>H(b/g)&&(b=0);1E-6>H(a/g)&&(a=0);var f,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);v(a,n,1);v(p,n);g=p.c-a.c;n.c=g;for(var u=d.length;u--;){c=d[u];b=r(g/c);f=b*c-g;k=3*(f+3);k+=2*(c-d[0]+2);0===c%5&&(k-=10);for(var x=l.length;x--;)0===b%l[x][0]&&(k/=l[x][1]);[c,b,f,k].join();m[u]={secs:c,step:b,delta:f,score:k}}return m.sort(function(a,b){return a.score-b.score}),m=m[0],a.c=z(a.c-m.delta/2),p.c=z(p.c+m.delta/2),h(a.c,p.c,m.secs,n.e)}var b,c,e,k,g,m=[10,20,25,50],I=[4,5,6],p=Math,z=p.round,n=p.floor,r=p.ceil,H=p.abs;return function(d,f,h,l){b=l||{};c=b.steps||m;e=b.secs||I;h=z(+h||0)%99;d=+d||0;f=+f||0;k=g=0;"min"in b&&(d=+b.min||0,k=1);"max"in b&&(f=+b.max||0,g=1);d>f&&(f=[d,d=f][0]);l=f-d;if(k&&g)return a(d,f,h);if((h||5)>l){if(d===n(d)&&f===n(f))return u(d,f,h);if(0===l)return h=h||5,l=p.min(H(f/h),h)/2.1,k?f=d+l:g?d=f-l:(d-=l,f+=l),x(d,f,h)}return x(d,f,h)}});define("echarts/util/shape/HandlePolygon",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util"],function(h){function q(d){v.call(this,d)}var v=h("zrender/shape/Base"),y=h("zrender/shape/Polygon");h=h("zrender/tool/util");return q.prototype={type:"handle-polygon",buildPath:function(d,h){y.prototype.buildPath(d,h)},isCover:function(d,h){var l=this.getTansform(d,h);d=l[0];h=l[1];l=this.style.rect;return d>=l.x&&d<=l.x+l.width&&h>=l.y&&h<=l.y+l.height?!0:!1}},h.inherits(q,v),q});