1 |
- define("echarts/chart/bar","require ./base zrender/shape/Rectangle ../component/axis ../component/grid ../component/dataZoom ../config ../util/ecData zrender/tool/util zrender/tool/color ../chart".split(" "),function(g){function q(f,a,c,b,d){y.call(this,f,a,c,b,d);this.refresh(b)}var y=g("./base"),B=g("zrender/shape/Rectangle");g("../component/axis");g("../component/grid");g("../component/dataZoom");var l=g("../config");l.bar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}},emphasis:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}}}};var A=g("../util/ecData"),k=g("zrender/tool/util"),p=g("zrender/tool/color");return q.prototype={type:l.CHART_TYPE_BAR,_buildShape:function(){this._buildPosition()},_buildNormal:function(f,a,c,b,d){var e,m,h,u,n,r,F,k,g,D,C,x;f=this.series;var t=c[0][0],v=f[t];d="horizontal"==d;for(var p=this.component.xAxis,z=this.component.yAxis,w=d?p.getAxis(v.xAxisIndex):z.getAxis(v.yAxisIndex),q=this._mapSize(w,c),A=q.gap,y=q.barGap,O=q.barWidthMap,P=q.barMaxWidthMap,Q=q.barWidth,M=q.barMinHeightMap,q=q.interval,N=this.deepQuery([this.ecTheme,l],"island.r"),E=0;a>E&&null!=w.getNameByIndex(E);E++){d?u=w.getCoordByIndex(E)-A/2:n=w.getCoordByIndex(E)+A/2;for(var I=0,R=c.length;R>I;I++){t=f[c[I][0]].yAxisIndex||0;v=f[c[I][0]].xAxisIndex||0;e=d?z.getAxis(t):p.getAxis(v);F=r=g=k=e.getCoord(0);for(var H=0,L=c[I].length;L>H;H++)t=c[I][H],v=f[t],C=v.data[E],x=this.getDataFromOption(C,"-"),b[t]=b[t]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},h=Math.min(P[t]||Number.MAX_VALUE,O[t]||Q),"-"!==x&&(0<x?(m=0<H?e.getCoordSize(x):d?F-e.getCoord(x):e.getCoord(x)-F,1===L&&M[t]>m&&(m=M[t]),d?(r-=m,n=r):(u=r,r+=m)):0>x?(m=0<H?e.getCoordSize(x):d?e.getCoord(x)-g:g-e.getCoord(x),1===L&&M[t]>m&&(m=M[t]),d?(n=k,k+=m):(k-=m,u=k)):(m=0,d?(r-=m,n=r):(u=r,r+=m)),b[t][E]=d?u+h/2:n-h/2,b[t].min>x&&(b[t].min=x,d?(b[t].minY=n,b[t].minX=b[t][E]):(b[t].minX=u+m,b[t].minY=b[t][E])),b[t].max<x&&(b[t].max=x,d?(b[t].maxY=n,b[t].maxX=b[t][E]):(b[t].maxX=u+m,b[t].maxY=b[t][E])),b[t].sum+=x,b[t].counter++,0===E%q&&(D=this._getBarItem(t,E,w.getNameByIndex(E),u,n-(d?0:h),d?h:m,d?m:h,d?"vertical":"horizontal"),this.shapeList.push(new B(D))));H=0;for(L=c[I].length;L>H;H++)t=c[I][H],v=f[t],C=v.data[E],x=this.getDataFromOption(C,"-"),h=Math.min(P[t]||Number.MAX_VALUE,O[t]||Q),"-"==x&&this.deepQuery([C,v,this.option],"calculable")&&(d?(r-=N,n=r):(u=r,r+=N),D=this._getBarItem(t,E,w.getNameByIndex(E),u,n-(d?0:h),d?h:N,d?N:h,d?"vertical":"horizontal"),D.hoverable=!1,D.draggable=!1,D.style.lineWidth=1,D.style.brushType="stroke",D.style.strokeColor=v.calculableHolderColor||this.ecTheme.calculableHolderColor||l.calculableHolderColor,this.shapeList.push(new B(D)));d?u+=h+y:n-=h+y}}this._calculMarkMapXY(b,c,d?"y":"x")},_buildHorizontal:function(f,a,c,b){return this._buildNormal(f,a,c,b,"horizontal")},_buildVertical:function(f,a,c,b){return this._buildNormal(f,a,c,b,"vertical")},_buildOther:function(f,a,c,b){f=this.series;a=0;for(var d=c.length;d>a;a++)for(var e=0,m=c[a].length;m>e;e++){var h=c[a][e],u=f[h],n=this.component.xAxis.getAxis(u.xAxisIndex||0),r=n.getCoord(0),l=this.component.yAxis.getAxis(u.yAxisIndex||0),k=l.getCoord(0);b[h]=b[h]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var g=0,D=u.data.length;D>g;g++){var C=u.data[g],x=this.getDataFromOption(C,"-");if(x instanceof Array){var t,v,p=n.getCoord(x[0]),z=l.getCoord(x[1]),w=[C,u],C=this.deepQuery(w,"barWidth")||10,w=this.deepQuery(w,"barHeight");null!=w?(t="horizontal",0<x[0]?(C=p-r,p-=C):C=0>x[0]?r-p:0,v=this._getBarItem(h,g,x[0],p,z-w/2,C,w,t)):(t="vertical",0<x[1]?w=k-z:0>x[1]?(w=z-k,z-=w):w=0,v=this._getBarItem(h,g,x[0],p-C/2,z,C,w,t));this.shapeList.push(new B(v));p=n.getCoord(x[0]);z=l.getCoord(x[1]);b[h].min0>x[0]&&(b[h].min0=x[0],b[h].minY0=z,b[h].minX0=p);b[h].max0<x[0]&&(b[h].max0=x[0],b[h].maxY0=z,b[h].maxX0=p);b[h].sum0+=x[0];b[h].counter0++;b[h].min1>x[1]&&(b[h].min1=x[1],b[h].minY1=z,b[h].minX1=p);b[h].max1<x[1]&&(b[h].max1=x[1],b[h].maxY1=z,b[h].maxX1=p);b[h].sum1+=x[1];b[h].counter1++}}}this._calculMarkMapXY(b,c,"xy")},_mapSize:function(f,a,c){var b,d,e=this._findSpecialBarSzie(a,c),m=e.barWidthMap,h=e.barMaxWidthMap,u=e.barMinHeightMap,n=e.sBarWidthCounter,r=e.sBarWidthTotal,l=e.barGap,e=e.barCategoryGap,k=1;if(a.length!=n)if(c)b=f.getGap(),l=0,d=+(b/a.length).toFixed(2),0>=d&&(k=Math.floor(a.length/b),d=1);else{if(b="string"==typeof e&&e.match(/%$/)?(f.getGap()*(100-parseFloat(e))/100).toFixed(2)-0:f.getGap()-e,"string"==typeof l&&l.match(/%$/)?(l=parseFloat(l)/100,d=+((b-r)/((a.length-1)*l+a.length-n)).toFixed(2),l*=d):(l=parseFloat(l),d=+((b-r-l*(a.length-1))/(a.length-n)).toFixed(2)),0>=d)return this._mapSize(f,a,!0)}else if(b=1<n?"string"==typeof e&&e.match(/%$/)?+(f.getGap()*(100-parseFloat(e))/100).toFixed(2):f.getGap()-e:r,d=0,l=1<n?+((b-r)/(n-1)).toFixed(2):0,0>l)return this._mapSize(f,a,!0);return this._recheckBarMaxWidth(a,m,h,u,b,d,l,k)},_findSpecialBarSzie:function(f,a){for(var c,b,d,e,m=this.series,h={},u={},n={},r=0,l=0,k=0,g=f.length;g>k;k++)for(var D=!1,C=!1,x=0,t=f[k].length;t>x;x++){var v=f[k][x],p=m[v];if(!a){if(D)h[v]=c;else if(c=this.query(p,"barWidth"),null!=c){h[v]=c;l+=c;r++;for(var D=!0,z=0,w=x;w>z;z++){var q=f[k][z];h[q]=c}}if(C)u[v]=b;else if(b=this.query(p,"barMaxWidth"),null!=b)for(u[v]=b,C=!0,z=0,w=x;w>z;z++)q=f[k][z],u[q]=b}n[v]=this.query(p,"barMinHeight");d=null!=d?d:this.query(p,"barGap");e=null!=e?e:this.query(p,"barCategoryGap")}return{barWidthMap:h,barMaxWidthMap:u,barMinHeightMap:n,sBarWidth:c,sBarMaxWidth:b,sBarWidthCounter:r,sBarWidthTotal:l,barGap:d,barCategoryGap:e}},_recheckBarMaxWidth:function(f,a,c,b,d,e,m,h){for(var u=0,n=f.length;n>u;u++){var r=f[u][0];c[r]&&c[r]<e&&(d-=e-c[r])}return{barWidthMap:a,barMaxWidthMap:c,barMinHeightMap:b,gap:d,barWidth:e,barGap:m,interval:h}},_getBarItem:function(f,a,c,b,d,e,m,h){var u=this.series,n=u[f],r=n.data[a],l=this._sIndex2ColorMap[f],k=[r,n],g=this.deepMerge(k,"itemStyle.normal"),D=this.deepMerge(k,"itemStyle.emphasis"),C=g.barBorderWidth;b={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(k,"clickable"),style:{x:b,y:d,width:e,height:m,brushType:"both",color:this.getItemStyleColor(this.deepQuery(k,"itemStyle.normal.color")||l,f,a,r),radius:g.barBorderRadius,lineWidth:C,strokeColor:g.barBorderColor},highlightStyle:{color:this.getItemStyleColor(this.deepQuery(k,"itemStyle.emphasis.color"),f,a,r),radius:D.barBorderRadius,lineWidth:D.barBorderWidth,strokeColor:D.barBorderColor},_orient:h};d=b.style;b.highlightStyle.color=b.highlightStyle.color||("string"==typeof d.color?p.lift(d.color,-.3):d.color);d.x=Math.floor(d.x);d.y=Math.floor(d.y);d.height=Math.ceil(d.height);d.width=Math.ceil(d.width);0<C&&d.height>C&&d.width>C?(d.y+=C/2,d.height-=C,d.x+=C/2,d.width-=C):d.brushType="fill";b.highlightStyle.textColor=b.highlightStyle.color;b=this.addLabel(b,n,r,c,h);h=d.textPosition;if("insideLeft"===h||"insideRight"===h||"insideTop"===h||"insideBottom"===h){switch(h){case "insideLeft":d.textX=d.x+5;d.textY=d.y+d.height/2;d.textAlign="left";d.textBaseline="middle";break;case "insideRight":d.textX=d.x+d.width-5;d.textY=d.y+d.height/2;d.textAlign="right";d.textBaseline="middle";break;case "insideTop":d.textX=d.x+d.width/2;d.textY=d.y+2.5;d.textAlign="center";d.textBaseline="top";break;case "insideBottom":d.textX=d.x+d.width/2,d.textY=d.y+d.height-2.5,d.textAlign="center",d.textBaseline="bottom"}d.textPosition="specific";d.textColor=d.textColor||"#fff"}return this.deepQuery([r,n,this.option],"calculable")&&(this.setCalculable(b),b.draggable=!0),A.pack(b,u[f],f,u[f].data[a],a,c),b},getMarkCoord:function(f,a){var c,b,d=this.series[f],e=this.xMarkMap[f];b=this.component.xAxis.getAxis(d.xAxisIndex);d=this.component.yAxis.getAxis(d.yAxisIndex);!a.type||"max"!==a.type&&"min"!==a.type&&"average"!==a.type?e.isHorizontal?(c="string"==typeof a.xAxis&&b.getIndexByName?b.getIndexByName(a.xAxis):a.xAxis||0,e=e[c],e=null!=e?e:"string"!=typeof a.xAxis&&b.getCoordByIndex?b.getCoordByIndex(a.xAxis||0):b.getCoord(a.xAxis||0),b=[e,d.getCoord(a.yAxis||0)]):(c="string"==typeof a.yAxis&&d.getIndexByName?d.getIndexByName(a.yAxis):a.yAxis||0,e=e[c],e=null!=e?e:"string"!=typeof a.yAxis&&d.getCoordByIndex?d.getCoordByIndex(a.yAxis||0):d.getCoord(a.yAxis||0),b=[b.getCoord(a.xAxis||0),e]):(b=null!=a.valueIndex?a.valueIndex:null!=e.maxX0?"1":"",b=[e[a.type+"X"+b],e[a.type+"Y"+b],e[a.type+"Line"+b],e[a.type+b]]);return b},refresh:function(f){f&&(this.option=f,this.series=f.series);this.backupShapeList();this._buildShape()},addDataAnimation:function(f){for(var a=this.series,c={},b=0,d=f.length;d>b;b++)c[f[b][0]]=f[b];for(var e,m,h,u,n,r,l,b=this.shapeList.length-1;0<=b;b--)if(r=A.get(this.shapeList[b],"seriesIndex"),c[r]&&!c[r][3]&&"rectangle"===this.shapeList[b].type)(l=A.get(this.shapeList[b],"dataIndex"),n=a[r],c[r][2]&&l===n.data.length-1)?this.zr.delShape(this.shapeList[b].id):c[r][2]||0!==l?("horizontal"===this.shapeList[b]._orient?(u=this.component.yAxis.getAxis(n.yAxisIndex||0).getGap(),h=c[r][2]?-u:u,e=0):(m=this.component.xAxis.getAxis(n.xAxisIndex||0).getGap(),e=c[r][2]?m:-m,h=0),this.shapeList[b].position=[0,0],this.zr.animate(this.shapeList[b].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[e,h]}).start()):this.zr.delShape(this.shapeList[b].id)}},k.inherits(q,y),g("../chart").define("bar",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(g){function q(f,a,c,b,d,e){y.call(this,f,a,c,b,d);this.axisType=e;this._axisList=[];this.refresh(b)}var y=g("./base"),B=g("zrender/shape/Line"),l=g("../config"),A=g("../util/ecData"),k=g("zrender/tool/util"),p=g("zrender/tool/color");return q.prototype={type:l.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var f=this.option.axisLine.lineStyle.width,a=f/2,c={_axisShape:"axisLine",zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1},b=this.grid;switch(this.option.position){case "left":c.style={xStart:b.getX()-a,yStart:b.getYend(),xEnd:b.getX()-a,yEnd:b.getY(),lineCap:"round"};break;case "right":c.style={xStart:b.getXend()+a,yStart:b.getYend(),xEnd:b.getXend()+a,yEnd:b.getY(),lineCap:"round"};break;case "bottom":c.style={xStart:b.getX(),yStart:b.getYend()+a,xEnd:b.getXend(),yEnd:b.getYend()+a,lineCap:"round"};break;case "top":c.style={xStart:b.getX(),yStart:b.getY()-a,xEnd:b.getXend(),yEnd:b.getY()-a,lineCap:"round"}}a=c.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;c=new B(c);this.shapeList.push(c)},_axisLabelClickable:function(f,a){return f?(A.pack(a,void 0,-1,void 0,-1,a.style.text),a.hoverable=!0,a.clickable=!0,a.highlightStyle={color:p.lift(a.style.color,1),brushType:"fill"},a):a},refixAxisShape:function(f,a){if(this.option.axisLine.onZero){var c;if(this.isHorizontal()&&null!=a)for(var b=0,d=this.shapeList.length;d>b;b++)"axisLine"===this.shapeList[b]._axisShape?(this.shapeList[b].style.yStart=this.shapeList[b].style.yEnd=this.subPixelOptimize(a,this.shapeList[b].stylelineWidth),this.zr.modShape(this.shapeList[b].id)):"axisTick"===this.shapeList[b]._axisShape&&(c=this.shapeList[b].style.yEnd-this.shapeList[b].style.yStart,this.shapeList[b].style.yStart=a-c,this.shapeList[b].style.yEnd=a,this.zr.modShape(this.shapeList[b].id));if(!this.isHorizontal()&&null!=f)for(b=0,d=this.shapeList.length;d>b;b++)"axisLine"===this.shapeList[b]._axisShape?(this.shapeList[b].style.xStart=this.shapeList[b].style.xEnd=this.subPixelOptimize(f,this.shapeList[b].stylelineWidth),this.zr.modShape(this.shapeList[b].id)):"axisTick"===this.shapeList[b]._axisShape&&(c=this.shapeList[b].style.xEnd-this.shapeList[b].style.xStart,this.shapeList[b].style.xStart=f,this.shapeList[b].style.xEnd=f+c,this.zr.modShape(this.shapeList[b].id))}},getPosition:function(){return this.option.position},isHorizontal:function(){return"bottom"===this.option.position||"top"===this.option.position}},reformOption:function(f){if(!f||f instanceof Array&&0===f.length?f=[{type:l.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,c=f.length;c>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,c=f.length;c>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 c=g("./categoryAxis"),b=g("./valueAxis"),d=Math.max(a&&a.length||0,this._axisList.length),e=0;d>e;e++)!this._axisList[e]||!f||a[e]&&this._axisList[e].type==a[e].type||(this._axisList[e].dispose&&this._axisList[e].dispose(),this._axisList[e]=!1),this._axisList[e]?this._axisList[e].refresh&&this._axisList[e].refresh(a?a[e]:!1,this.series):a&&a[e]&&(this._axisList[e]="category"===a[e].type?new c(this.ecTheme,this.messageCenter,this.zr,a[e],this.myChart,this.axisBase):new b(this.ecTheme,this.messageCenter,this.zr,a[e],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=[]}},k.inherits(q,y),g("../component").define("axis",q),q});define("echarts/component/grid","require ./base zrender/shape/Rectangle ../config zrender/tool/util ../component".split(" "),function(g){function q(l,g,f,a,c){y.call(this,l,g,f,a,c);this.refresh(a)}var y=g("./base"),B=g("zrender/shape/Rectangle"),l=g("../config");l.grid={zlevel:0,z:0,x:12,y:60,x2:12,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc"};var A=g("zrender/tool/util");return q.prototype={type:l.COMPONENT_TYPE_GRID,getX:function(){return this._x},getY:function(){return this._y},getWidth:function(){return this._width},getHeight:function(){return this._height},getXend:function(){return this._x+this._width},getYend:function(){return this._y+this._height},getArea:function(){return{x:this._x,y:this._y,width:this._width,height:this._height}},getBbox:function(){return[[this._x,this._y],[this.getXend(),this.getYend()]]},refixAxisShape:function(k){for(var g,f,a=k.xAxis._axisList.concat(k.yAxis?k.yAxis._axisList:[]),c=a.length;c--;)k=a[c],k.type==l.COMPONENT_TYPE_AXIS_VALUE&&0>k._min&&0<=k._max&&(k.isHorizontal()?g=k.getCoord(0):f=k.getCoord(0));if("undefined"!=typeof g||"undefined"!=typeof f)for(c=a.length;c--;)a[c].refixAxisShape(g,f)},refresh:function(l){if(l||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear();this.option=l||this.option;this.option.grid=this.reformOption(this.option.grid);l=this.option.grid;this._zrWidth=this.zr.getWidth();this._zrHeight=this.zr.getHeight();this._x=this.parsePercent(l.x,this._zrWidth);this._y=this.parsePercent(l.y,this._zrHeight);var g=this.parsePercent(l.x2,this._zrWidth),f=this.parsePercent(l.y2,this._zrHeight);this._width="undefined"==typeof l.width?this._zrWidth-this._x-g:this.parsePercent(l.width,this._zrWidth);this._width=0>=this._width?10:this._width;this._height="undefined"==typeof l.height?this._zrHeight-this._y-f:this.parsePercent(l.height,this._zrHeight);this._height=0>=this._height?10:this._height;this._x=this.subPixelOptimize(this._x,l.borderWidth);this._y=this.subPixelOptimize(this._y,l.borderWidth);this.shapeList.push(new B({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:0<l.borderWidth?"both":"fill",color:l.backgroundColor,strokeColor:l.borderColor,lineWidth:l.borderWidth}}));this.zr.addShape(this.shapeList[0])}}},A.inherits(q,y),g("../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(g){function q(a,c,b,d,e){y.call(this,a,c,b,d,e);var m=this;m._ondrift=function(a,b){return m.__ondrift(this,a,b)};m._ondragend=function(){return m.__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 y=g("./base"),B=g("zrender/shape/Rectangle"),l=g("zrender/shape/Polygon"),A=g("../util/shape/Icon"),k=g("../config");k.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 p=g("../util/date"),f=g("zrender/tool/util");return q.prototype={type:k.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground();this._buildFiller();this._buildHandle();this._buildFrame();for(var a=0,c=this.shapeList.length;c>a;a++)this.zr.addShape(this.shapeList[a]);this._syncFrameShape()},_getLocation:function(){var a,c,b,d,e=this.component.grid;return"horizontal"==this.zoomOption.orient?(b=this.zoomOption.width||e.getWidth(),d=this.zoomOption.height||this._fillerSize,a=null!=this.zoomOption.x?this.zoomOption.x:e.getX(),c=null!=this.zoomOption.y?this.zoomOption.y:this.zr.getHeight()-d-2):(b=this.zoomOption.width||this._fillerSize,d=this.zoomOption.height||e.getHeight(),a=null!=this.zoomOption.x?this.zoomOption.x:2,c=null!=this.zoomOption.y?this.zoomOption.y:e.getY()),{x:a,y:c,width:b,height:d}},_getZoom:function(){var a=this.option.series,c=this.option.xAxis;!c||c instanceof Array||(c=[c],this.option.xAxis=c);var b=this.option.yAxis;!b||b instanceof Array||(b=[b],this.option.yAxis=b);var d,e=[],m=this.zoomOption.xAxisIndex;if(c&&null==m){d=[];for(var h=0,f=c.length;f>h;h++)"category"!=c[h].type&&null!=c[h].type||d.push(h)}else d=m instanceof Array?m:null!=m?[m]:[];if(m=this.zoomOption.yAxisIndex,b&&null==m)for(c=[],h=0,f=b.length;f>h;h++)"category"==b[h].type&&c.push(h);else c=m instanceof Array?m:null!=m?[m]:[];for(var n,h=0,f=a.length;f>h;h++)if(n=a[h],n.type==k.CHART_TYPE_LINE||n.type==k.CHART_TYPE_BAR||n.type==k.CHART_TYPE_SCATTER||n.type==k.CHART_TYPE_K){b=0;for(m=d.length;m>b;b++)if(d[b]==(n.xAxisIndex||0)){e.push(h);break}b=0;for(m=c.length;m>b;b++)if(c[b]==(n.yAxisIndex||0)){e.push(h);break}null==this.zoomOption.xAxisIndex&&null==this.zoomOption.yAxisIndex&&n.data&&this.getDataFromOption(n.data[0])instanceof Array&&(n.type==k.CHART_TYPE_SCATTER||n.type==k.CHART_TYPE_LINE||n.type==k.CHART_TYPE_BAR)&&e.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:c,seriesIndex:e,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};for(var a=this.option.xAxis,c=this._zoom.xAxisIndex,b=0,d=c.length;d>b;b++)this._originalData.xAxis[c[b]]=a[c[b]].data;a=this.option.yAxis;c=this._zoom.yAxisIndex;b=0;for(d=c.length;d>b;b++)this._originalData.yAxis[c[b]]=a[c[b]].data;for(var c=this.option.series,e=this._zoom.seriesIndex,b=0,d=e.length;d>b;b++)a=c[e[b]],(this._originalData.series[e[b]]=a.data)&&this.getDataFromOption(a.data[0])instanceof Array&&(a.type==k.CHART_TYPE_SCATTER||a.type==k.CHART_TYPE_LINE||a.type==k.CHART_TYPE_BAR)&&(this._backupScale(),this._calculScatterMap(e[b]))},_calculScatterMap:function(a){this._zoom.scatterMap=this._zoom.scatterMap||{};this._zoom.scatterMap[a]=this._zoom.scatterMap[a]||{};var c=g("../component").get("axis"),b=f.clone(this.option.xAxis);"category"==b[0].type&&(b[0].type="value");b[1]&&"category"==b[1].type&&(b[1].type="value");var b=new c(this.ecTheme,null,!1,{xAxis:b,series:this.option.series},this,"xAxis"),d=this.option.series[a].xAxisIndex||0;this._zoom.scatterMap[a].x=b.getAxis(d).getExtremum();b.dispose();b=f.clone(this.option.yAxis);"category"==b[0].type&&(b[0].type="value");b[1]&&"category"==b[1].type&&(b[1].type="value");b=new c(this.ecTheme,null,!1,{yAxis:b,series:this.option.series},this,"yAxis");d=this.option.series[a].yAxisIndex||0;this._zoom.scatterMap[a].y=b.getAxis(d).getExtremum();b.dispose()},_buildBackground:function(){var a=this._location.width,c=this._location.height;this.shapeList.push(new B({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._location.x,y:this._location.y,width:a,height:c,color:this.zoomOption.backgroundColor}}));for(var b=0,d=this._originalData.xAxis,e=this._zoom.xAxisIndex,m=0,h=e.length;h>m;m++)b=Math.max(b,d[e[m]].length);d=this._originalData.yAxis;e=this._zoom.yAxisIndex;m=0;for(h=e.length;h>m;m++)b=Math.max(b,d[e[m]].length);for(var e=this._zoom.seriesIndex[0],f=this._originalData.series[e],n=Number.MIN_VALUE,r=Number.MAX_VALUE,m=0,h=f.length;h>m;m++)d=this.getDataFromOption(f[m],0),this.option.series[e].type==k.CHART_TYPE_K&&(d=d[1]),isNaN(d)&&(d=0),n=Math.max(n,d),r=Math.min(r,d);var n=n-r,g=[],p=a/(b-(1<b?1:0)),q=c/(b-(1<b?1:0)),D=1;"horizontal"==this.zoomOption.orient&&1>p?D=Math.floor(3*b/a):"vertical"==this.zoomOption.orient&&1>q&&(D=Math.floor(3*b/c));m=0;for(h=b;h>m;m+=D)d=this.getDataFromOption(f[m],0),this.option.series[e].type==k.CHART_TYPE_K&&(d=d[1]),isNaN(d)&&(d=0),g.push("horizontal"==this.zoomOption.orient?[this._location.x+p*m,this._location.y+c-1-Math.round((d-r)/n*(c-10))]:[this._location.x+1+Math.round((d-r)/n*(a-10)),this._location.y+q*(h-m-1)]);"horizontal"==this.zoomOption.orient?(g.push([this._location.x+a,this._location.y+c]),g.push([this._location.x,this._location.y+c])):(g.push([this._location.x,this._location.y]),g.push([this._location.x,this._location.y+c]));this.shapeList.push(new l({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:g,color:this.zoomOption.dataBackgroundColor},hoverable:!1}))},_buildFiller:function(){this._fillerShae={zlevel:this.getZlevelBase(),z:this.getZBase(),draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,_type:"filler"};this._fillerShae.style="horizontal"==this.zoomOption.orient?{x:this._location.x+Math.round(this._zoom.start/100*this._location.width)+this._handleSize,y:this._location.y,width:this._zoom.size-2*this._handleSize,height:this._location.height,color:this.zoomOption.fillerColor,text:":::",textPosition:"inside"}:{x:this._location.x,y:this._location.y+Math.round(this._zoom.start/100*this._location.height)+this._handleSize,width:this._location.width,height:this._zoom.size-2*this._handleSize,color:this.zoomOption.fillerColor,text:"::",textPosition:"inside"};this._fillerShae.highlightStyle={brushType:"fill",color:"rgba(0,0,0,0)"};this._fillerShae=new B(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 A(this._startShape);this._endShape=new A(this._endShape);this.shapeList.push(this._startShape);this.shapeList.push(this._endShape)},_buildFrame:function(){var a=this.subPixelOptimize(this._location.x,1),c=this.subPixelOptimize(this._location.y,1);this._startFrameShape={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:a,y:c,width:this._location.width-(a>this._location.x?1:0),height:this._location.height-(c>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}};this._endFrameShape=f.clone(this._startFrameShape);this._startFrameShape=new B(this._startFrameShape);this._endFrameShape=new B(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,c;"horizontal"==this.zoomOption.orient?(a=this._startShape.style.x,c=this._endShape.style.x,this._fillerShae.style.x=Math.min(a,c)+this._handleSize,this._fillerShae.style.width=Math.abs(a-c)-this._handleSize,this._zoom.start=(Math.min(a,c)-this._location.x)/this._location.width*100,this._zoom.end=(Math.max(a,c)+this._handleSize-this._location.x)/this._location.width*100):(a=this._startShape.style.y,c=this._endShape.style.y,this._fillerShae.style.y=Math.min(a,c)+this._handleSize,this._fillerShae.style.height=Math.abs(a-c)-this._handleSize,this._zoom.start=(this._location.y+this._location.height-Math.max(a,c))/this._location.height*100,this._zoom.end=(this._location.y+this._location.height-Math.min(a,c)-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 c,b,d,e,m,h;for(h in this._originalData){c=this._originalData[h];for(var f in c)m=c[f],null!=m&&(e=m.length,b=Math.floor(this._zoom.start/100*e),d=Math.ceil(this._zoom.end/100*e),this.getDataFromOption(m[0])instanceof Array&&this.option[h][f].type!=k.CHART_TYPE_K?(this._setScale(),this.option[h][f].data=this._synScatterData(f,m)):this.option[h][f].data=m.slice(b,d))}this._isSilence||!this.zoomOption.realtime&&!a||this.messageCenter.dispatch(k.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(a,c){if(0===this._zoom.start&&100==this._zoom.end&&0===this._zoom.start2&&100==this._zoom.end2)return c;var b,d,e,m,h,f=[],n=this._zoom.scatterMap[a];"horizontal"==this.zoomOption.orient?(b=n.x.max-n.x.min,d=this._zoom.start/100*b+n.x.min,e=this._zoom.end/100*b+n.x.min,b=n.y.max-n.y.min,m=this._zoom.start2/100*b+n.y.min,h=this._zoom.end2/100*b+n.y.min):(b=n.x.max-n.x.min,d=this._zoom.start2/100*b+n.x.min,e=this._zoom.end2/100*b+n.x.min,b=n.y.max-n.y.min,m=this._zoom.start/100*b+n.y.min,h=this._zoom.end/100*b+n.y.min);for(var n=0,l=c.length;l>n;n++)b=c[n].value||c[n],b[0]>=d&&b[0]<=e&&b[1]>=m&&b[1]<=h&&f.push(c[n]);return f},_setScale:function(){var a=0!==this._zoom.start||100!==this._zoom.end||0!==this._zoom.start2||100!==this._zoom.end2,c={xAxis:this.option.xAxis,yAxis:this.option.yAxis},b;for(b in c)for(var d=0,e=c[b].length;e>d;d++)c[b][d].scale=a||c[b][d]._scale},_backupScale:function(){var a={xAxis:this.option.xAxis,yAxis:this.option.yAxis},c;for(c in a)for(var b=0,d=a[c].length;d>b;b++)a[c][b]._scale=a[c][b].scale},_getDetail:function(){var a="horizontal"==this.zoomOption.orient?"xAxis":"yAxis",c=this._originalData[a],b;for(b in c){var d=c[b];if(null!=d)return c=d.length,a=Math.floor(this._zoom.start/100*c),c=Math.ceil(this._zoom.end/100*c),c-=0<c?1:0,{start:this.getDataFromOption(d[a]),end:this.getDataFromOption(d[c])}}b=this._zoom.seriesIndex[0];c=this.option[a][this.option.series[b][a+"Index"]||0].type;d=this._zoom.scatterMap[b][a.charAt(0)].min;a=this._zoom.scatterMap[b][a.charAt(0)].max;b=a-d;return"value"==c?{start:d+b*this._zoom.start/100,end:d+b*this._zoom.end/100}:"time"==c?(a=d+b*this._zoom.end/100,d+=b*this._zoom.start/100,c=p.getAutoFormatter(d,a).formatter,{start:p.format(c,d),end:p.format(c,a)}):{start:"",end:""}},__ondrift:function(a,c,b){this.zoomOption.zoomLock&&(a=this._fillerShae);var d="filler"==a._type?this._handleSize:0;if("horizontal"==this.zoomOption.orient?a.style.x+c-d<=this._location.x?a.style.x=this._location.x+d:a.style.x+c+a.style.width+d>=this._location.x+this._location.width?a.style.x=this._location.x+this._location.width-a.style.width-d:a.style.x+=c:a.style.y+b-d<=this._location.y?a.style.y=this._location.y+d:a.style.y+b+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+=b,"filler"==a._type?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),this.zoomOption.showDetail)a=this._getDetail(),this._startShape.style.text=this._startShape.highlightStyle.text=a.start,this._endShape.style.text=this._endShape.highlightStyle.text=a.end,this._startShape.style.textPosition=this._startShape.highlightStyle.textPosition,this._endShape.style.textPosition=this._endShape.highlightStyle.textPosition;return!0},__ondragend:function(){this.zoomOption.showDetail&&(this._startShape.style.text=this._endShape.style.text="\x3d",this._startShape.style.textPosition=this._endShape.style.textPosition="inside",this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.refreshNextFrame());this.isDragend=!0},ondragend:function(a,c){this.isDragend&&a.target&&(!this.zoomOption.realtime&&this._syncData(),c.dragOut=!0,c.dragIn=!0,this._isSilence||this.zoomOption.realtime||this.messageCenter.dispatch(k.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),c.needRefresh=!1,this.isDragend=!1)},ondataZoom:function(a,c){c.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 c=this.component.grid.getArea(),b=a.x,d=a.y,e=a.width,m=a.height;if(0>e&&(b+=e,e=-e),0>m&&(d+=m,m=-m),b>c.x+c.width||d>c.y+c.height)return!1;b<c.x&&(b=c.x);b+e>c.x+c.width&&(e=c.x+c.width-b);d+m>c.y+c.height&&(m=c.y+c.height-d);var h;a=(b-c.x)/c.width;b=1-(b+e-c.x)/c.width;e=1-(d+m-c.y)/c.height;c=(d-c.y)/c.height;return"horizontal"==this.zoomOption.orient?(h=this._zoom.end-this._zoom.start,this._zoom.start+=h*a,this._zoom.end-=h*b,h=this._zoom.end2-this._zoom.start2,this._zoom.start2+=h*e,this._zoom.end2-=h*c):(h=this._zoom.end-this._zoom.start,this._zoom.start+=h*e,this._zoom.end-=h*c,h=this._zoom.end2-this._zoom.start2,this._zoom.start2+=h*a,this._zoom.end2-=h*b),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(a){for(var c,b=this._originalData.series,d=a.series,e=0,m=d.length;m>e;e++){c=d[e].data||d[e].eventList;a=b[e]?Math.floor(this._zoom.start/100*b[e].length):0;for(var h=0,f=c.length;f>h;h++)b[e]&&(b[e][h+a]=c[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,c){if(!this._originalData||0===this._zoom.start&&100==this._zoom.end)return c;var b=this._originalData.series;return b[a]?Math.floor(this._zoom.start/100*b[a].length)+c:-1},resize:function(){this.clear();this._location=this._getLocation();this._zoom=this._getZoom();this.option.dataZoom.show&&this._buildShape()}},f.inherits(q,y),g("../component").define("dataZoom",q),q});define("echarts/component/categoryAxis","require ./base zrender/shape/Text zrender/shape/Line zrender/shape/Rectangle ../config zrender/tool/util zrender/tool/area ../component".split(" "),function(g){function q(a,c,b,d,e,m){if(1>d.data.length)return void console.error("option.data.length \x3c 1.");y.call(this,a,c,b,d,e);this.grid=this.component.grid;for(var h in m)this[h]=m[h];this.refresh(d)}var y=g("./base"),B=g("zrender/shape/Text"),l=g("zrender/shape/Line"),A=g("zrender/shape/Rectangle"),k=g("../config");k.categoryAxis={zlevel:0,z:0,show:!0,position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!1,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}};var p=g("zrender/tool/util"),f=g("zrender/tool/area");return q.prototype={type:k.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(a){var c=this.getDataFromOption(this.option.data[a]);a=this.option.data[a].formatter||this.option.axisLabel.formatter;return a&&("function"==typeof a?c=a.call(this.myChart,c):"string"==typeof a&&(c=a.replace("{value}",c))),c},_getInterval:function(){var a=this.option.axisLabel.interval;if("auto"==a){var c=this.option.axisLabel.textStyle.fontSize,b=this.option.data,d=this.option.data.length;if(this.isHorizontal())if(3<d)for(var e,m,h=this.getGap(),l=!1,n=Math.floor(.5/h),n=1>n?1:n,a=Math.floor(15/h);!l&&d>a;){a+=n;l=!0;e=Math.floor(h*a);for(var r=Math.floor((d-1)/a)*a;0<=r;r-=a){if(0!==this.option.axisLabel.rotate)m=c;else if(b[r].textStyle)m=f.getTextWidth(this._getReformedLabel(r),this.getFont(p.merge(b[r].textStyle,this.option.axisLabel.textStyle)));else{m=this._getReformedLabel(r)+"";var g=(m.match(/\w/g)||"").length;m=g*c*2/3+(m.length-g)*c}if(m>e){l=!1;break}}}else a=1;else if(3<d)for(h=this.getGap(),a=Math.floor(11/h);c>h*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,c=this.shapeList.length;c>a;a++)this.zr.addShape(this.shapeList[a])}},_buildAxisTick:function(){var a,c=this.option.data,b=this.option.data.length,d=this.option.axisTick,e=d.length,m=d.lineStyle.color,h=d.lineStyle.width,f="function"==typeof d.interval?d.interval:"auto"==d.interval&&"function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,n=f?1:"auto"==d.interval?this._interval:d.interval-0+1,r=d.onGap,r=r?this.getGap()/2:"undefined"==typeof r&&this.option.boundaryGap?this.getGap()/2:0,g=0<r?-n:0;if(this.isHorizontal())for(var k,p="bottom"==this.option.position?d.inside?this.grid.getYend()-e-1:this.grid.getYend()+1:d.inside?this.grid.getY()+1:this.grid.getY()-e-1;b>g;g+=n)f&&!f(g,c[g])||(k=this.subPixelOptimize(this.getCoordByIndex(g)+(0<=g?r:0),h),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:k,yStart:p,xEnd:k,yEnd:p+e,strokeColor:m,lineWidth:h}},this.shapeList.push(new l(a)));else for(k="left"==this.option.position?d.inside?this.grid.getX()+1:this.grid.getX()-e-1:d.inside?this.grid.getXend()-e-1:this.grid.getXend()+1;b>g;g+=n)f&&!f(g,c[g])||(p=this.subPixelOptimize(this.getCoordByIndex(g)-(0<=g?r:0),h),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:k,yStart:p,xEnd:k+e,yEnd:p,strokeColor:m,lineWidth:h}},this.shapeList.push(new l(a)))},_buildAxisLabel:function(){var a,c,b=this.option.data,d=this.option.data.length,e=this.option.axisLabel,m=e.rotate,h=e.margin,f=e.clickable,n=e.textStyle,e="function"==typeof e.interval?e.interval:!1;if(this.isHorizontal()){var l,g;"bottom"==this.option.position?(l=this.grid.getYend()+h,g="top"):(l=this.grid.getY()-h,g="bottom");for(h=0;d>h;h+=this._interval)e&&!e(h,b[h])||""===this._getReformedLabel(h)||(c=p.merge(b[h].textStyle||{},n),a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoordByIndex(h),y:l,color:c.color,text:this._getReformedLabel(h),textFont:this.getFont(c),textAlign:c.align||"center",textBaseline:c.baseline||g}},m&&(a.style.textAlign=0<m?"bottom"==this.option.position?"right":"left":"bottom"==this.option.position?"left":"right",a.rotation=[m*Math.PI/180,a.style.x,a.style.y]),this.shapeList.push(new B(this._axisLabelClickable(f,a))))}else{var k,q;"left"==this.option.position?(k=this.grid.getX()-h,q="right"):(k=this.grid.getXend()+h,q="left");for(h=0;d>h;h+=this._interval)e&&!e(h,b[h])||""===this._getReformedLabel(h)||(c=p.merge(b[h].textStyle||{},n),a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:k,y:this.getCoordByIndex(h),color:c.color,text:this._getReformedLabel(h),textFont:this.getFont(c),textAlign:c.align||q,textBaseline:c.baseline||0===h&&""!==this.option.name?"bottom":h==d-1&&""!==this.option.name?"top":"middle"}},m&&(a.rotation=[m*Math.PI/180,a.style.x,a.style.y]),this.shapeList.push(new B(this._axisLabelClickable(f,a))))}},_buildSplitLine:function(){var a,c=this.option.data,b=this.option.data.length,d=this.option.splitLine,e=d.lineStyle.type,m=d.lineStyle.width,h=d.lineStyle.color,h=h instanceof Array?h:[h],f=h.length,n="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,g=d.onGap,d=g?this.getGap()/2:"undefined"==typeof g&&this.option.boundaryGap?this.getGap()/2:0;if(b-=g||"undefined"==typeof g&&this.option.boundaryGap?1:0,this.isHorizontal())for(var k,p=this.grid.getY(),q=this.grid.getYend(),g=0;b>g;g+=this._interval)n&&!n(g,c[g])||(k=this.subPixelOptimize(this.getCoordByIndex(g)+d,m),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:k,yStart:p,xEnd:k,yEnd:q,strokeColor:h[g/this._interval%f],lineType:e,lineWidth:m}},this.shapeList.push(new l(a)));else for(k=this.grid.getX(),q=this.grid.getXend(),g=0;b>g;g+=this._interval)n&&!n(g,c[g])||(p=this.subPixelOptimize(this.getCoordByIndex(g)-d,m),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:k,yStart:p,xEnd:q,yEnd:p,strokeColor:h[g/this._interval%f],lineType:e,lineWidth:m}},this.shapeList.push(new l(a)))},_buildSplitArea:function(){var a,c=this.option.data,b=this.option.splitArea,d=b.areaStyle.color;if(d instanceof Array){var e=d.length,m=this.option.data.length,h="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,b=(b=b.onGap)?this.getGap()/2:"undefined"==typeof b&&this.option.boundaryGap?this.getGap()/2:0;if(this.isHorizontal())for(var f,n=this.grid.getY(),l=this.grid.getHeight(),g=this.grid.getX(),k=0;m>=k;k+=this._interval)h&&!h(k,c[k])&&m>k||(f=m>k?this.getCoordByIndex(k)+b:this.grid.getXend(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:g,y:n,width:f-g,height:l,color:d[k/this._interval%e]}},this.shapeList.push(new A(a)),g=f);else for(f=this.grid.getX(),l=this.grid.getWidth(),g=this.grid.getYend(),k=0;m>=k;k+=this._interval)h&&!h(k,c[k])&&m>k||(n=m>k?this.getCoordByIndex(k)-b:this.grid.getY(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:f,y:n,width:l,height:g-n,color:d[k/this._interval%e]}},this.shapeList.push(new A(a)),g=n)}else a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:d}},this.shapeList.push(new A(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,c=this.isHorizontal()?this.grid.getWidth():this.grid.getHeight();return this.option.boundaryGap?c/a:c/(1<a?a-1:1)},getCoord:function(a){for(var c=this.option.data,b=c.length,d=this.getGap(),e=this.option.boundaryGap?d/2:0,f=0;b>f;f++){if(this.getDataFromOption(c[f])==a)return this.isHorizontal()?this.grid.getX()+e:this.grid.getYend()-e;e+=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 c=this.getGap(),b=this.option.boundaryGap?c/2:0;return b+=a*c,this.isHorizontal()?this.grid.getX()+b:this.grid.getYend()-b},getNameByIndex:function(a){return this.getDataFromOption(this.option.data[a])},getIndexByName:function(a){for(var c=this.option.data,b=c.length,d=0;b>d;d++)if(this.getDataFromOption(c[d])==a)return d;return-1},getValueFromCoord:function(){return""},isMainAxis:function(a){return 0===a%this._interval}},p.inherits(q,y),g("../component").define("categoryAxis",q),q});define("echarts/component/valueAxis","require ./base zrender/shape/Text zrender/shape/Line zrender/shape/Rectangle ../config ../util/date zrender/tool/util ../util/smartSteps ../util/accMath ../component".split(" "),function(g){function q(a,c,b,d,e,f,h){if(!h||0===h.length)return void console.err("option.series.length \x3d\x3d 0.");y.call(this,a,c,b,d,e);this.series=h;this.grid=this.component.grid;for(var l in f)this[l]=f[l];this.refresh(d,h)}var y=g("./base"),B=g("zrender/shape/Text"),l=g("zrender/shape/Line"),A=g("zrender/shape/Rectangle"),k=g("../config");k.valueAxis={zlevel:0,z:0,show:!0,position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],axisLine:{show:!1,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:-1,textStyle:{align:"left",baseline:"bottom",color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}};var p=g("../util/date"),f=g("zrender/tool/util");return q.prototype={type:k.COMPONENT_TYPE_AXIS_VALUE,_buildShape:function(){if(this._hasData=!1,this._calculateValue(),this._hasData&&this.option.show){this.option.splitArea.show&&this._buildSplitArea();this.option.splitLine.show&&this._buildSplitLine();this.option.axisLine.show&&this._buildAxisLine();this.option.axisTick.show&&this._buildAxisTick();this.option.axisLabel.show&&this._buildAxisLabel();for(var a=0,c=this.shapeList.length;c>a;a++)this.zr.addShape(this.shapeList[a])}},_buildAxisTick:function(){var a,c=this._valueList,b=this._valueList.length,d=this.option.axisTick,e=d.length,f=d.lineStyle.color,h=d.lineStyle.width;if(this.isHorizontal())for(var g="bottom"===this.option.position?d.inside?this.grid.getYend()-e-1:this.grid.getYend()+1:d.inside?this.grid.getY()+1:this.grid.getY()-e-1,d=0;b>d;d++)a=this.subPixelOptimize(this.getCoord(c[d]),h),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:a,yStart:g,xEnd:a,yEnd:g+e,strokeColor:f,lineWidth:h}},this.shapeList.push(new l(a));else for(g="left"===this.option.position?d.inside?this.grid.getX()+1:this.grid.getX()-e-1:d.inside?this.grid.getXend()-e-1:this.grid.getXend()+1,d=0;b>d;d++)a=this.subPixelOptimize(this.getCoord(c[d]),h),a={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:g,yStart:a,xEnd:g+e,yEnd:a,strokeColor:f,lineWidth:h}},this.shapeList.push(new l(a))},_buildAxisLabel:function(){var a,c=this._valueList,b=this._valueList.length,d=this.option.axisLabel.rotate;a=this.option.axisLabel.margin;var e=this.option.axisLabel.clickable,f=this.option.axisLabel.textStyle;if(this.isHorizontal()){var h,l;"bottom"===this.option.position?(h=this.grid.getYend()+a,l="top"):(h=this.grid.getY()-a,l="bottom");for(var n=0;b>n;n++)a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoord(c[n]),y:h,color:"function"==typeof f.color?f.color(c[n]):f.color,text:this._valueLabel[n],textFont:this.getFont(f),textAlign:f.align||"center",textBaseline:f.baseline||l}},d&&(a.style.textAlign=0<d?"bottom"===this.option.position?"right":"left":"bottom"===this.option.position?"left":"right",a.rotation=[d*Math.PI/180,a.style.x,a.style.y]),this.shapeList.push(new B(this._axisLabelClickable(e,a)))}else{var g,k;"left"===this.option.position?(g=this.grid.getX()-a,k="right"):(g=this.grid.getXend()+a,k="left");for(n=0;b>n;n++)a={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:g,y:this.getCoord(c[n]),color:"function"==typeof f.color?f.color(c[n]):f.color,text:this._valueLabel[n],textFont:this.getFont(f),textAlign:f.align||k,textBaseline:f.baseline||(0===n&&""!==this.option.name?"bottom":n===b-1&&""!==this.option.name?"top":"middle")}},d&&(a.rotation=[d*Math.PI/180,a.style.x,a.style.y]),this.shapeList.push(new B(this._axisLabelClickable(e,a)))}},_buildSplitLine:function(){var a,c=this._valueList,b=this._valueList.length,d=this.option.splitLine,e=d.lineStyle.type,f=d.lineStyle.width,d=d.lineStyle.color,d=d instanceof Array?d:[d],h=d.length;if(this.isHorizontal())for(var g=this.grid.getY(),n=this.grid.getYend(),k=0;b>k;k++)a=this.subPixelOptimize(this.getCoord(c[k]),f),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:a,yStart:g,xEnd:a,yEnd:n,strokeColor:d[k%h],lineType:e,lineWidth:f}},this.shapeList.push(new l(a));else for(g=this.grid.getX(),n=this.grid.getXend(),k=0;b>k;k++)a=this.subPixelOptimize(this.getCoord(c[k]),f),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:g,yStart:a,xEnd:n,yEnd:a,strokeColor:d[k%h],lineType:e,lineWidth:f}},this.shapeList.push(new l(a))},_buildSplitArea:function(){var a,c=this.option.splitArea.areaStyle.color;if(c instanceof Array){var b=c.length,d=this._valueList,e=this._valueList.length;if(this.isHorizontal()){var f,h=this.grid.getY(),l=this.grid.getHeight();a=this.grid.getX();for(var g=0;e>=g;g++)f=e>g?this.getCoord(d[g]):this.grid.getXend(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:a,y:h,width:f-a,height:l,color:c[g%b]}},this.shapeList.push(new A(a)),a=f}else for(h=this.grid.getX(),l=this.grid.getWidth(),a=this.grid.getYend(),g=0;e>=g;g++)f=e>g?this.getCoord(d[g]):this.grid.getY(),a={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:h,y:f,width:l,height:a-f,color:c[g%b]}},this.shapeList.push(new A(a)),a=f}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:c}},this.shapeList.push(new A(a))},_calculateValue:function(){if(isNaN(this.option.min-0)||isNaN(this.option.max-0)){for(var a,c,b={},d=this.component.legend,e=0,f=this.series.length;f>e;e++)!(this.series[e].type!=k.CHART_TYPE_LINE&&this.series[e].type!=k.CHART_TYPE_BAR&&this.series[e].type!=k.CHART_TYPE_SCATTER&&this.series[e].type!=k.CHART_TYPE_K&&this.series[e].type!=k.CHART_TYPE_EVENTRIVER||d&&!d.isSelected(this.series[e].name)||(a=this.series[e].xAxisIndex||0,c=this.series[e].yAxisIndex||0,this.option.xAxisIndex!=a&&this.option.yAxisIndex!=c||!this._calculSum(b,e)));for(e in b){a=b[e];c=0;for(d=a.length;d>c;c++)if(!isNaN(a[c])){this._hasData=!0;this._min=a[c];this._max=a[c];break}if(this._hasData)break}for(e in b)for(a=b[e],c=0,d=a.length;d>c;c++)isNaN(a[c])||(this._min=Math.min(this._min,a[c]),this._max=Math.max(this._max,a[c]));b=Math.abs(this._max-this._min);this._min=isNaN(this.option.min-0)?this._min-Math.abs(b*this.option.boundaryGap[0]):this.option.min-0;this._max=isNaN(this.option.max-0)?this._max+Math.abs(b*this.option.boundaryGap[1]):this.option.max-0;this._min===this._max&&(0===this._max?this._max=1: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,c){var b,d,e=this.series[c].name||"kener";if(this.series[c].stack){var f="__Magic_Key_Positive__"+this.series[c].stack,h="__Magic_Key_Negative__"+this.series[c].stack;a[f]=a[f]||[];a[h]=a[h]||[];a[e]=a[e]||[];d=this.series[c].data;for(var g=0,l=d.length;l>g;g++)b=this.getDataFromOption(d[g]),"-"!==b&&(b-=0,0<=b?null!=a[f][g]?a[f][g]+=b:a[f][g]=b:null!=a[h][g]?a[h][g]+=b:a[h][g]=b,this.option.scale&&a[e].push(b))}else if(a[e]=a[e]||[],this.series[c].type!=k.CHART_TYPE_EVENTRIVER)for(d=this.series[c].data,g=0,l=d.length;l>g;g++)b=this.getDataFromOption(d[g]),this.series[c].type===k.CHART_TYPE_K?(a[e].push(b[0]),a[e].push(b[1]),a[e].push(b[2]),a[e].push(b[3])):b instanceof Array?(-1!=this.option.xAxisIndex&&a[e].push("time"!=this.option.type?b[0]:p.getNewDate(b[0])),-1!=this.option.yAxisIndex&&a[e].push("time"!=this.option.type?b[1]:p.getNewDate(b[1]))):a[e].push(b);else for(d=this.series[c].eventList,g=0,l=d.length;l>g;g++)for(b=d[g].evolution,f=0,h=b.length;h>f;f++)a[e].push(p.getNewDate(b[f].time))},_reformValue:function(a){var c=g("../util/smartSteps"),b=this.option.splitNumber;!a&&0<=this._min&&0<=this._max&&(this._min=0);!a&&0>=this._min&&0>=this._max&&(this._max=0);a=c(this._min,this._max,b);this._min=a.min;this._max=a.max;this._valueList=a.pnts;this._reformLabelData()},_reformTimeValue:function(){var a=null!=this.option.splitNumber?this.option.splitNumber:5,c=p.getAutoFormatter(this._min,this._max,a),b=c.formatter,d=c.gapValue;this._valueList=[p.getNewDate(this._min)];var e;switch(b){case "week":e=p.nextMonday(this._min);break;case "month":e=p.nextNthOnMonth(this._min,1);break;case "quarter":e=p.nextNthOnQuarterYear(this._min,1);break;case "half-year":e=p.nextNthOnHalfYear(this._min,1);break;case "year":e=p.nextNthOnYear(this._min,1);break;default:72E5>=d?e=(Math.floor(this._min/d)+1)*d:(e=p.getNewDate(this._min- -d),e.setHours(6*Math.round(e.getHours()/6)),e.setMinutes(0),e.setSeconds(0))}e-this._min<d/2&&(e-=-d);c=p.getNewDate(e);for(a*=1.5;0<=a--&&(("month"==b||"quarter"==b||"half-year"==b||"year"==b)&&c.setDate(1),!(this._max-c<d/2));)this._valueList.push(c),c=p.getNewDate(c- -d);this._valueList.push(p.getNewDate(this._max));this._reformLabelData(b)},_customerValue:function(){var a=g("../util/accMath"),c=null!=this.option.splitNumber?this.option.splitNumber:5,b=(this._max-this._min)/c;this._valueList=[];for(var d=0;c>=d;d++)this._valueList.push(a.accAdd(this._min,a.accMul(b,d)));this._reformLabelData()},_reformLabelData:function(a){this._valueLabel=[];var c=this.option.axisLabel.formatter;if(c)for(var b=0,d=this._valueList.length;d>b;b++)"function"==typeof c?this._valueLabel.push(a?c.call(this.myChart,this._valueList[b],a):c.call(this.myChart,this._valueList[b])):"string"==typeof c&&this._valueLabel.push(a?p.format(c,this._valueList[b]):c.replace("{value}",this._valueList[b]));else if(a)for(b=0,d=this._valueList.length;d>b;b++)this._valueLabel.push(p.format(a,this._valueList[b]));else for(b=0,d=this._valueList.length;d>b;b++)this._valueLabel.push(this.numAddCommas(this._valueList[b]))},getExtremum:function(){return this._calculateValue(),{min:this._min,max:this._max}},refresh:function(a,c){a&&(this.option=this.reformOption(a),this.option.axisLabel.textStyle=f.merge(this.option.axisLabel.textStyle||{},this.ecTheme.textStyle),this.series=c);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 c;return this.isHorizontal()?(a=a<this.grid.getX()?this.grid.getX():a,a=a>this.grid.getXend()?this.grid.getXend():a,c=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,c=this._max-(a-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),c.toFixed(2)-0},isMaindAxis:function(a){for(var c=0,b=this._valueList.length;b>c;c++)if(this._valueList[c]===a)return!0;return!1}},f.inherits(q,y),g("../component").define("valueAxis",q),q});define("echarts/util/date",[],function(){function g(g){return 10>g?"0"+g:g}function q(g,q,k){return g=y(g),g.setMonth(Math.ceil((g.getMonth()+1)/k)*k),g.setDate(q),g}function y(g){return g instanceof Date?g:new Date("string"==typeof g?g.replace(/-/g,"/"):g)}var B=[{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,q,k){k=1<k?k:2;for(var p,f,a,c,b=0,d=B.length;d>b;b++)if(p=B[b].value,f=Math.ceil(q/p)*p-Math.floor(g/p)*p,Math.round(f/p)<=1.2*k){a=B[b].formatter;c=B[b].value;break}return null==a&&(a="year",p=317088E5,f=Math.ceil(q/p)*p-Math.floor(g/p)*p,c=Math.round(f/(k-1)/p)*p),{formatter:a,gapValue:c}},getNewDate:y,format:function(l,q){"week"!=l&&"month"!=l&&"quarter"!=l&&"half-year"!=l&&"year"!=l||(l="MM - dd\nyyyy");var k=y(q),p=k.getFullYear(),f=k.getMonth()+1,a=k.getDate(),c=k.getHours(),b=k.getMinutes(),k=k.getSeconds();return l=l.replace("MM",g(f)),l=l.toLowerCase(),l=l.replace("yyyy",p),l=l.replace("yy",p%100),l=l.replace("dd",g(a)),l=l.replace("d",a),l=l.replace("hh",g(c)),l=l.replace("h",c),l=l.replace("mm",g(b)),l=l.replace("m",b),l=l.replace("ss",g(k)),l.replace("s",k)},nextMonday:function(g){return g=y(g),g.setDate(g.getDate()+8-g.getDay()),g},nextNthPerNmonth:q,nextNthOnMonth:function(g,y){return q(g,y,1)},nextNthOnQuarterYear:function(g,y){return q(g,y,3)},nextNthOnHalfYear:function(g,y){return q(g,y,6)},nextNthOnYear:function(g,y){return q(g,y,12)}}});define("echarts/util/smartSteps",[],function(){function g(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=n.min(h.e,a.e,e.e);0===a.c?k=n.min(h.e,e.e):0===e.c&&(k=n.min(h.e,a.e));y(h,{c:0,e:k});y(a,h,1);y(e,h);g+=k;a=a.c;e=e.c;for(var h=(e-a)/f,k=n.pow(10,g),l=0,m=[],p=f+1;p--;)m[p]=(a+h*p)*k;if(0>g)for(p=k,l=(p=(+p).toFixed(15).split("."),p.pop().replace(/0+$/,"").length),h=+(h*k).toFixed(l),a=+(a*k).toFixed(l),e=+(e*k).toFixed(l),p=m.length;p--;)m[p]=m[p].toFixed(l),0===+m[p]&&(m[p]="0");else a*=k,e*=k,h*=k;return d=0,b=0,c=0,{min:a,max:e,secs:f,step:h,fix:l,exp:g,pnts:m}}function q(a,b,c){b=r(b%10)||2;0>b&&(a===F(a)?b=(""+J(a)).replace(/0+$/,"").length||1:(a=a.toFixed(15).replace(/0+$/,""),b=a.replace(".","").replace(/^[-0]+/,"").length,a=+a));var d=F(n.log(J(a))/n.LN10)-b+1;a=+(a*n.pow(10,-d)).toFixed(15)||0;return a=c?F(a):K(a),!a&&(d=0),(""+J(a)).length>b&&(d+=1,a/=10),{c:a,e:d}}function y(a,b,c){(b=b.e-a.e)&&(a.e+=b,a.c*=n.pow(10,-b),a.c=c?F(a.c):K(a.c))}function B(a,b,c){a.e<b.e?y(b,a,c):y(a,b,c)}function l(a,b){b=b||h;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 A(a,c,h){var t=h||+d.slice(-1),v=l((c-a)/t,b),u=q(c-a),z=q(a,-1,1),w=q(c,-1);y(u,v);y(z,v,1);y(w,v);if(h){var u=t,A,G;A=w.c;for(v=(w.c-z.c)/u-1;A>z.c;)v=l(v+1,b),v=v.c*n.pow(10,v.e),A=v*u,G=K(w.c/v)*v,A=G-A;u=z.c-A-(G-w.c);u>1.1*v&&(u=r(u/v/2)*v,A+=u,G+=u);z.c=A;w.c=G}else t=k(z,w);if(a===F(a)&&c===F(c)&&0<=a*c){if(t>c-a)return p(a,c,t);G=w.c-z.c;v=G/t*n.pow(10,w.e);v!==F(v)&&(v=F(v),G=v*t,c-a>G&&(v+=1,G=v*t,!h&&v*(t-1)>=c-a&&(--t,G=v*t)),G>=c-a)&&(h=G-(c-a),z.c=r(a-h/2),w.c=r(c+h/2),z.e=0,w.e=0)}h=f(a,c,z.c,w.c);z.c=h[0];w.c=h[1];if(e||m)e?(a=q(a,4,1),6<z.e-a.e&&(a={c:0,e:z.e}),B(z,a),B(w,a),w.c+=a.c-z.c,z.c=a.c):m&&(a=q(c,4),6<w.e-a.e&&(a={c:0,e:w.e}),B(z,a),B(w,a),z.c+=a.c-w.c,w.c=a.c);return g(z.c,w.c,t,w.e)}function k(a,c){for(var e,f,h,g,k=[],m=d.length;m--;)e=d[m],f=l((c.c-a.c)/e,b),f=f.c*n.pow(10,f.e),h=F(a.c/f)*f,g=K(c.c/f)*f,k[m]={min:h,max:g,step:f,span:g-h};return k.sort(function(a,b){var c=a.span-b.span;return 0===c&&(c=a.step-b.step),c}),k=k[0],e=k.span/k.step,a.c=k.min,c.c=k.max,3>e?2*e:e}function p(a,b,c){if(c=c||5,e)b=a+c;else if(m)a=b-c;else{var d=c-(b-a),h=r(a-d/2),d=r(b+d/2);b=f(a,b,h,d);a=b[0];b=b[1]}return g(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 e=c?[c]:d,f=b-a;if(0===f)return b=q(b,3),c=e[0],b.c=r(b.c+c/2),g(b.c-c,b.c,c,b.e);1E-6>J(b/f)&&(b=0);1E-6>J(a/f)&&(a=0);var h,k,l=[[5,10],[10,2],[50,10],[100,2]],m=[],n=q(b-a,3);a=q(a,-1,1);var p=q(b,-1);y(a,n,1);y(p,n);f=p.c-a.c;n.c=f;for(var u=e.length;u--;){c=e[u];b=K(f/c);h=b*c-f;k=3*(h+3);k+=2*(c-e[0]+2);0===c%5&&(k-=10);for(var A=l.length;A--;)0===b%l[A][0]&&(k/=l[A][1]);[c,b,h,k].join();m[u]={secs:c,step:b,delta:h,score:k}}return m.sort(function(a,b){return a.score-b.score}),m=m[0],a.c=r(a.c-m.delta/2),p.c=r(p.c+m.delta/2),g(a.c,p.c,m.secs,n.e)}var c,b,d,e,m,h=[10,20,25,50],u=[4,5,6],n=Math,r=n.round,F=n.floor,K=n.ceil,J=n.abs;return function(f,g,k,l){c=l||{};b=c.steps||h;d=c.secs||u;k=r(+k||0)%99;f=+f||0;g=+g||0;e=m=0;"min"in c&&(f=+c.min||0,e=1);"max"in c&&(g=+c.max||0,m=1);f>g&&(g=[f,f=g][0]);l=g-f;if(e&&m)return a(f,g,k);if((k||5)>l){if(f===F(f)&&g===F(g))return p(f,g,k);if(0===l)return k=k||5,l=n.min(J(g/k),k)/2.1,e?g=f+l:m?f=g-l:(f-=l,g+=l),A(f,g,k)}return A(f,g,k)}});
|