r&&(r=n),r!==h&&(t.width=r,c-=r+l*r,u--)}})),h=(c-s)/(u+(u-1)*l),h=Math.max(h,0);var f,d=0;Object(wt["each"])(r,(function(t,e){t.width||(t.width=h),f=t,d+=t.width*(1+l)})),f&&(d-=f.width*l);var p=-d/2;Object(wt["each"])(r,(function(t,r){n[e][r]=n[e][r]||{bandWidth:i,offset:p,width:t.width},p+=t.width*(1+l)}))})),n}function Pw(t,e,n){if(t&&e){var r=t[Mw(e)];return null!=r&&null!=n?r[Tw(n)]:r}}function Lw(t,e){var n=kw(t,e),r=Dw(n);Object(wt["each"])(n,(function(t){var e=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),o=Tw(t),a=r[Mw(i)][o],s=a.offset,l=a.width;e.setLayout({bandWidth:a.bandWidth,offset:s,size:l})}))}function Nw(t){return{seriesType:t,plan:zg(),reset:function(t){if(Ew(t)){var e=t.getData(),n=t.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),o=e.getDimensionIndex(e.mapDimension(i.dim)),a=e.getDimensionIndex(e.mapDimension(r.dim)),s=t.get("showBackground",!0),l=e.mapDimension(i.dim),c=e.getCalculationInfo("stackResultDimension"),u=ZO(e,l)&&!!e.getCalculationInfo("stackedOnSeries"),h=i.isHorizontal(),f=Bw(r,i),d=Rw(t),p=t.get("barMinHeight")||0,g=c&&e.getDimensionIndex(c),v=e.getLayout("size"),y=e.getLayout("offset");return{progress:function(t,e){var r,i=t.count,l=d&&jw(3*i),c=d&&s&&jw(3*i),m=d&&jw(i),b=n.master.getRect(),_=h?b.width:b.height,x=e.getStore(),O=0;while(null!=(r=t.next())){var w=x.get(u?g:o,r),S=x.get(a,r),j=f,C=void 0;u&&(C=+w-x.get(o,r));var T=void 0,M=void 0,k=void 0,I=void 0;if(h){var D=n.dataToPoint([w,S]);if(u){var A=n.dataToPoint([C,S]);j=A[0]}T=j,M=D[1]+y,k=D[0]-j,I=v,Math.abs(k)>>1;t[i][1]n&&(this._approxInterval=n);var o=Vw.length,a=Math.min(zw(Vw,this._approxInterval,0,o),o-1);this._interval=Vw[a][1],this._minLevelUnit=Vw[Math.max(a-1,0)][0]},e.prototype.parse=function(t){return Object(wt["isNumber"])(t)?t:+go(t)},e.prototype.contain=function(t){return gw(this.parse(t),this._extent)},e.prototype.normalize=function(t){return vw(this.parse(t),this._extent)},e.prototype.scale=function(t){return yw(t,this._extent)},e.type="time",e}(Ow),Vw=[["second",ah],["minute",sh],["hour",lh],["quarter-day",6*lh],["half-day",12*lh],["day",1.2*ch],["half-week",3.5*ch],["week",7*ch],["month",31*ch],["quarter",95*ch],["half-year",uh/2],["year",uh]];function Hw(t,e,n,r){var i=go(e),o=go(n),a=function(t){return wh(i,t,r)===wh(o,t,r)},s=function(){return a("year")},l=function(){return s()&&a("month")},c=function(){return l()&&a("day")},u=function(){return c()&&a("hour")},h=function(){return u()&&a("minute")},f=function(){return h()&&a("second")},d=function(){return f()&&a("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return c();case"hour":return u();case"minute":return h();case"second":return f();case"millisecond":return d()}}function Gw(t,e){return t/=ch,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function Ww(t){var e=30*ch;return t/=e,t>6?6:t>3?3:t>2?2:1}function Uw(t){return t/=lh,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function Yw(t,e){return t/=e?sh:ah,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function Xw(t){return mo(t,!0)}function qw(t,e,n){var r=new Date(t);switch(yh(e)){case"year":case"month":r[Ah(n)](0);case"day":r[Ph(n)](1);case"hour":r[Lh(n)](0);case"minute":r[Nh(n)](0);case"second":r[Eh(n)](0),r[Rh(n)](0)}return r.getTime()}function Zw(t,e,n,r){var i=1e4,o=gh,a=0;function s(t,e,n,i,o,a,s){var l=new Date(e),c=e,u=l[i]();while(c1&&0===c&&o.unshift({value:o[0].value-f})}}for(c=0;c=r[0]&&m<=r[1]&&h++)}var b=(r[1]-r[0])/e;if(h>1.5*b&&f>b/1.5)break;if(c.push(v),h>b||t===o[d])break}u=[]}}}var _=Object(wt["filter"])(Object(wt["map"])(c,(function(t){return Object(wt["filter"])(t,(function(t){return t.value>=r[0]&&t.value<=r[1]&&!t.notAdd}))})),(function(t){return t.length>0})),x=[],O=_.length-1;for(d=0;d<_.length;++d)for(var w=_[d],S=0;S0)r*=10;var o=[ro(eS(e[0]/r)*r),ro(tS(e[1]/r)*r)];this._interval=r,this._niceExtent=o}},e.prototype.calcNiceExtent=function(t){Qw.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return t=rS(t)/rS(this.base),gw(t,this._extent)},e.prototype.normalize=function(t){return t=rS(t)/rS(this.base),vw(t,this._extent)},e.prototype.scale=function(t){return t=yw(t,this._extent),nS(this.base,t)},e.type="log",e}(iw),oS=iS.prototype;function aS(t,e){return Jw(t,oo(e))}oS.getMinorTicks=Qw.getMinorTicks,oS.getLabel=Qw.getLabel,iw.registerClass(iS);var sS=iS,lS=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]0&&s>0&&!l&&(a=0),a<0&&s<0&&!c&&(s=0));var h=this._determinedMin,f=this._determinedMax;return null!=h&&(a=h,l=!0),null!=f&&(s=f,c=!0),{min:a,max:s,minFixed:l,maxFixed:c,isBlank:u}},t.prototype.modifyDataMinMax=function(t,e){this[uS[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){var n=cS[t];this[n]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),cS={min:"_determinedMin",max:"_determinedMax"},uS={min:"_dataMin",max:"_dataMax"};function hS(t,e,n){var r=t.rawExtentInfo;return r||(r=new lS(t,e,n),t.rawExtentInfo=r,r)}function fS(t,e){return null==e?null:Object(wt["eqNaN"])(e)?NaN:t.parse(e)}function dS(t,e){var n=t.type,r=hS(t,e,t.getExtent()).calculate();t.setBlank(r.isBlank);var i=r.min,o=r.max,a=e.ecModel;if(a&&"time"===n){var s=kw("bar",a),l=!1;if(wt["each"](s,(function(t){l=l||t.getBaseAxis()===e.axis})),l){var c=Dw(s),u=pS(i,o,e,c);i=u.min,o=u.max}}return{extent:[i,o],fixMin:r.minFixed,fixMax:r.maxFixed}}function pS(t,e,n,r){var i=n.axis.getExtent(),o=i[1]-i[0],a=Pw(r,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;wt["each"](a,(function(t){s=Math.min(t.offset,s)}));var l=-1/0;wt["each"](a,(function(t){l=Math.max(t.offset+t.width,l)})),s=Math.abs(s),l=Math.abs(l);var c=s+l,u=e-t,h=1-(s+l)/o,f=u/h-u;return e+=f*(l/c),t-=f*(s/c),{min:t,max:e}}function gS(t,e){var n=e,r=dS(t,n),i=r.extent,o=n.get("splitNumber");t instanceof sS&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setExtent(i[0],i[1]),t.calcNiceExtent({splitNumber:o,fixMin:r.fixMin,fixMax:r.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&t.setInterval&&t.setInterval(s)}function vS(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new bw({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new Kw({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(iw.getClass(e)||Ow)}}function yS(t){var e=t.scale.getExtent(),n=e[0],r=e[1];return!(n>0&&r>0||n<0&&r<0)}function mS(t){var e=t.getLabelModel().get("formatter"),n="category"===t.type?t.scale.getExtent()[0]:null;return"time"===t.scale.type?function(e){return function(n,r){return t.scale.getFormattedLabel(n,r,e)}}(e):wt["isString"](e)?function(e){return function(n){var r=t.scale.getLabel(n),i=e.replace("{value}",null!=r?r:"");return i}}(e):wt["isFunction"](e)?function(e){return function(r,i){return null!=n&&(i=r.value-n),e(bS(t,r),i,null!=r.level?{level:r.level}:null)}}(e):function(e){return t.scale.getLabel(e)}}function bS(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function _S(t){var e=t.model,n=t.scale;if(e.get(["axisLabel","show"])&&!n.isBlank()){var r,i,o=n.getExtent();n instanceof bw?i=n.count():(r=n.getTicks(),i=r.length);var a,s=t.getLabelModel(),l=mS(t),c=1;i>40&&(c=Math.ceil(i/40));for(var u=0;un&&(t=i,n=a)}if(t)return RS(t.exterior);var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},e.prototype.getBoundingRect=function(t){var e=this._rect;if(e&&!t)return e;var n=[1/0,1/0],r=[-1/0,-1/0],i=this.geometries;return Object(wt["each"])(i,(function(e){"polygon"===e.type?ES(e.exterior,n,r,t):Object(wt["each"])(e.points,(function(e){ES(e,n,r,t)}))})),isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])||(n[0]=n[1]=r[0]=r[1]=0),e=new di(n[0],n[1],r[0]-n[0],r[1]-n[1]),t||(this._rect=e),e},e.prototype.contain=function(t){var e=this.getBoundingRect(),n=this.geometries;if(!e.contain(t[0],t[1]))return!1;t:for(var r=0,i=n.length;r>1^-(1&s),l=l>>1^-(1&l),s+=i,l+=o,i=s,o=l,r.push([s/n,l/n])}return r}function US(t,e){return t=HS(t),wt["map"](wt["filter"](t.features,(function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0})),(function(t){var n=t.properties,r=t.geometry,i=[];switch(r.type){case"Polygon":var o=r.coordinates;i.push(new zS(o[0],o.slice(1)));break;case"MultiPolygon":wt["each"](r.coordinates,(function(t){t[0]&&i.push(new zS(t[0],t.slice(1)))}));break;case"LineString":i.push(new FS([r.coordinates]));break;case"MultiLineString":i.push(new FS(r.coordinates))}var a=new VS(n[e||"name"],i,n.cp);return a.properties=n,a}))}function YS(t,e,n,r,i,o,a,s){var l=new Fl({style:{text:t,font:e,align:n,verticalAlign:r,padding:i,rich:o,overflow:a?"truncate":null,lineHeight:s}});return l.getBoundingRect()}var XS=Zo();function qS(t){return"category"===t.type?KS(t):JS(t)}function ZS(t,e){return"category"===t.type?QS(t,e):{ticks:wt["map"](t.scale.getTicks(),(function(t){return t.value}))}}function KS(t){var e=t.getLabelModel(),n=$S(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}function $S(t,e){var n,r,i=tj(t,"labels"),o=OS(e),a=ej(i,o);return a||(wt["isFunction"](o)?n=sj(t,o):(r="auto"===o?rj(t):o,n=aj(t,r)),nj(i,o,{labels:n,labelCategoryInterval:r}))}function QS(t,e){var n,r,i=tj(t,"ticks"),o=OS(e),a=ej(i,o);if(a)return a;if(e.get("show")&&!t.scale.isBlank()||(n=[]),wt["isFunction"](o))n=sj(t,o,!0);else if("auto"===o){var s=$S(t,t.getLabelModel());r=s.labelCategoryInterval,n=wt["map"](s.labels,(function(t){return t.tickValue}))}else r=o,n=aj(t,r,!0);return nj(i,o,{ticks:n,tickCategoryInterval:r})}function JS(t){var e=t.scale.getTicks(),n=mS(t);return{labels:wt["map"](e,(function(e,r){return{level:e.level,formattedLabel:n(e,r),rawLabel:t.scale.getLabel(e),tickValue:e.value}}))}}function tj(t,e){return XS(t)[e]||(XS(t)[e]=[])}function ej(t,e){for(var n=0;n40&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],c=t.dataToCoord(l+1)-t.dataToCoord(l),u=Math.abs(c*Math.cos(r)),h=Math.abs(c*Math.sin(r)),f=0,d=0;l<=o[1];l+=s){var p=0,g=0,v=bi(n({value:l}),e.font,"center","top");p=1.3*v.width,g=1.3*v.height,f=Math.max(f,p,7),d=Math.max(d,g,7)}var y=f/u,m=d/h;isNaN(y)&&(y=1/0),isNaN(m)&&(m=1/0);var b=Math.max(0,Math.floor(Math.min(y,m))),_=XS(t.model),x=t.getExtent(),O=_.lastAutoInterval,w=_.lastTickCount;return null!=O&&null!=w&&Math.abs(O-b)<=1&&Math.abs(w-a)<=1&&O>b&&_.axisExtent0===x[0]&&_.axisExtent1===x[1]?b=O:(_.lastTickCount=a,_.lastAutoInterval=b,_.axisExtent0=x[0],_.axisExtent1=x[1]),b}function oj(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function aj(t,e,n){var r=mS(t),i=t.scale,o=i.getExtent(),a=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),c=o[0],u=i.count();0!==c&&l>1&&u/l>2&&(c=Math.round(Math.ceil(c/l)*l));var h=wS(t),f=a.get("showMinLabel")||h,d=a.get("showMaxLabel")||h;f&&c!==o[0]&&g(o[0]);for(var p=c;p<=o[1];p+=l)g(p);function g(t){var e={value:t};s.push(n?t:{formattedLabel:r(e),rawLabel:i.getLabel(e),tickValue:t})}return d&&p-l!==o[1]&&g(o[1]),s}function sj(t,e,n){var r=t.scale,i=mS(t),o=[];return wt["each"](r.getTicks(),(function(t){var a=r.getLabel(t),s=t.value;e(t.value,a)&&o.push(n?s:{formattedLabel:i(t),rawLabel:a,tickValue:s})})),o}var lj=[0,1],cj=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),r=Math.max(e[0],e[1]);return t>=n&&t<=r},t.prototype.containData=function(t){return this.scale.contain(t)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return so(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,r=this.scale;return t=r.normalize(t),this.onBand&&"ordinal"===r.type&&(n=n.slice(),uj(n,r.count())),eo(t,lj,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,r=this.scale;this.onBand&&"ordinal"===r.type&&(n=n.slice(),uj(n,r.count()));var i=eo(t,n,lj,e);return this.scale.scale(i)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){t=t||{};var e=t.tickModel||this.getTickModel(),n=ZS(this,e),r=n.ticks,i=Object(wt["map"])(r,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this),o=e.get("alignWithLabel");return hj(this,i,o,t.clamp),i},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick"),e=t.get("splitNumber");e>0&&e<100||(e=5);var n=this.scale.getMinorTicks(e),r=Object(wt["map"])(n,(function(t){return Object(wt["map"])(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this);return r},t.prototype.getViewLabels=function(){return qS(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var r=Math.abs(t[1]-t[0]);return Math.abs(r)/n},t.prototype.calculateCategoryInterval=function(){return ij(this)},t}();function uj(t,e){var n=t[1]-t[0],r=e,i=n/r/2;t[0]+=i,t[1]-=i}function hj(t,e,n,r){var i=e.length;if(t.onBand&&!n&&i){var o,a,s=t.getExtent();if(1===i)e[0].coord=s[0],o=e[1]={coord:s[0]};else{var l=e[i-1].tickValue-e[0].tickValue,c=(e[i-1].coord-e[0].coord)/l;Object(wt["each"])(e,(function(t){t.coord-=c/2}));var u=t.scale.getExtent();a=1+u[1]-e[i-1].tickValue,o={coord:e[i-1].coord+c*a},e.push(o)}var h=s[0]>s[1];f(e[0].coord,s[0])&&(r?e[0].coord=s[0]:e.shift()),r&&f(s[0],e[0].coord)&&e.unshift({coord:s[0]}),f(s[1],o.coord)&&(r?o.coord=s[1]:e.pop()),r&&f(o.coord,s[1])&&e.push({coord:s[1]})}function f(t,e){return t=ro(t),e=ro(e),h?t>e:ti&&(i+=yj);var d=Math.atan2(s,a);if(d<0&&(d+=yj),d>=r&&d<=i||d+yj>=r&&d+yj<=i)return l[0]=u,l[1]=h,c-n;var p=n*Math.cos(r)+t,g=n*Math.sin(r)+e,v=n*Math.cos(i)+t,y=n*Math.sin(i)+e,m=(p-a)*(p-a)+(g-s)*(g-s),b=(v-a)*(v-a)+(y-s)*(y-s);return m0){e=e/180*Math.PI,Tj.fromArray(t[0]),Mj.fromArray(t[1]),kj.fromArray(t[2]),ri.sub(Ij,Tj,Mj),ri.sub(Dj,kj,Mj);var n=Ij.len(),r=Dj.len();if(!(n<.001||r<.001)){Ij.scale(1/n),Dj.scale(1/r);var i=Ij.dot(Dj),o=Math.cos(e);if(o1&&ri.copy(Lj,kj),Lj.toArray(t[1])}}}}function Ej(t,e,n,r){var i="normal"===n,o=i?t:t.ensureState(n);o.ignore=e;var a=r.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=r.getModel("lineStyle").getLineStyle();i?t.useStyle(s):o.style=s}function Rj(t,e){var n=e.smooth,r=e.points;if(r)if(t.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=Gt(r[0],r[1]),o=Gt(r[1],r[2]);if(!i||!o)return t.lineTo(r[1][0],r[1][1]),void t.lineTo(r[2][0],r[2][1]);var a=Math.min(i,o)*n,s=Xt([],r[1],r[0],a/i),l=Xt([],r[1],r[2],a/o),c=Xt([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],c[0],c[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],r[2][0],r[2][1])}else for(var u=1;u0&&o&&O(-h/a,0,a);var v,y,m=t[0],b=t[a-1];return _(),v<0&&w(-v,.8),y<0&&w(y,.8),_(),x(v,y,1),x(y,v,-1),_(),v<0&&S(-v),y<0&&S(y),c}function _(){v=m.rect[e]-r,y=i-b.rect[e]-b.rect[n]}function x(t,e,n){if(t<0){var r=Math.min(e,-t);if(r>0){O(r*n,0,a);var i=r+t;i<0&&w(-i*n,1)}else w(-t*n,1)}}function O(n,r,i){0!==n&&(c=!0);for(var o=r;o0)for(l=0;l0;l--){f=o[l-1]*h;O(-f,l,a)}}}function S(t){var e=t<0?-1:1;t=Math.abs(t);for(var n=Math.ceil(t/(a-1)),r=0;r0?O(n,0,r+1):O(-n,a-r-1,a),t-=n,t<=0)return}}function Hj(t,e,n,r){return Vj(t,"x","width",e,n,r)}function Gj(t,e,n,r){return Vj(t,"y","height",e,n,r)}function Wj(t){var e=[];t.sort((function(t,e){return e.priority-t.priority}));var n=new di(0,0,0,0);function r(t){if(!t.ignore){var e=t.ensureState("emphasis");null==e.ignore&&(e.ignore=!1)}t.ignore=!0}for(var i=0;i=0&&n.attr(i.oldLayoutSelect),Object(wt["indexOf"])(u,"emphasis")>=0&&n.attr(i.oldLayoutEmphasis)),ou(n,l,e,s)}else if(n.attr(l),!Tu(n).valueAnimation){var h=Object(wt["retrieve2"])(n.style.opacity,1);n.style.opacity=0,au(n,{style:{opacity:h}},e,s)}if(i.oldLayout=l,n.states.select){var f=i.oldLayoutSelect={};$j(f,l,Qj),$j(f,n.states.select,Qj)}if(n.states.emphasis){var d=i.oldLayoutEmphasis={};$j(d,l,Qj),$j(d,n.states.emphasis,Qj)}ku(n,s,c,e,e)}if(r&&!r.ignore&&!r.invisible){i=Kj(r),o=i.oldLayout;var p={points:r.shape.points};o?(r.attr({shape:o}),ou(r,{shape:p},e)):(r.setShape(p),r.style.strokePercent=0,au(r,{style:{strokePercent:1}},e)),i.oldLayout=p}},t}(),tC=Jj,eC=Zo();function nC(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,n){var r=eC(e).labelManager;r||(r=eC(e).labelManager=new tC),r.clearLabels()})),t.registerUpdateLifecycle("series:layoutlabels",(function(t,e,n){var r=eC(e).labelManager;n.updatedSeries.forEach((function(t){r.addLabelsOfSeries(e.getViewOfSeriesModel(t))})),r.updateLayoutConfig(e),r.layout(e),r.processLabelsOverall()}))}rO(nC);var rC=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return xt(e,t),e.prototype.getInitialData=function(t){return nw(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(t){var e=new Fi,n=vb("line",0,t.itemHeight/2,t.itemWidth,0,t.lineStyle.stroke,!1);e.add(n),n.setStyle(t.lineStyle);var r=this.getData().getVisual("symbol"),i=this.getData().getVisual("symbolRotate"),o="none"===r?"circle":r,a=.8*t.itemHeight,s=vb(o,(t.itemWidth-a)/2,(t.itemHeight-a)/2,a,a,t.itemStyle.fill);e.add(s),s.setStyle(t.itemStyle);var l="inherit"===t.iconRotate?i:t.iconRotate||0;return s.rotation=l*Math.PI/180,s.setOrigin([t.itemWidth/2,t.itemHeight/2]),o.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),e},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(Eg),iC=rC;function oC(t,e){var n=t.mapDimensionsAll("defaultedLabel"),r=n.length;if(1===r){var i=dp(t,e,n[0]);return null!=i?i+"":null}if(r){for(var o=[],a=0;a=0&&r.push(e[o])}return r.join(" ")}var sC=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.updateData(e,n,r,i),o}return xt(e,t),e.prototype._createSymbol=function(t,e,n,r,i){this.removeAll();var o=vb(t,-1,-1,2,2,null,i);o.attr({z2:100,culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),o.drift=lC,this._symbolType=t,this.add(o)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Cc(this.childAt(0))},e.prototype.downplay=function(){Tc(this.childAt(0))},e.prototype.setZ=function(t,e){var n=this.childAt(0);n.zlevel=t,n.z=e},e.prototype.setDraggable=function(t){var e=this.childAt(0);e.draggable=t,e.cursor=t?"move":e.cursor},e.prototype.updateData=function(t,n,r,i){this.silent=!1;var o=t.getItemVisual(n,"symbol")||"circle",a=t.hostModel,s=e.getSymbolSize(t,n),l=o!==this._symbolType,c=i&&i.disableAnimation;if(l){var u=t.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,t,n,s,u)}else{var h=this.childAt(0);h.silent=!1;var f={scaleX:s[0]/2,scaleY:s[1]/2};c?h.attr(f):ou(h,f,a,n),hu(h)}if(this._updateCommon(t,n,s,r,i),l){h=this.childAt(0);if(!c){f={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,au(h,f,a,n)}}c&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,e,n,r,i){var o,a,s,l,c,u,h,f,d,p=this.childAt(0),g=t.hostModel;if(r&&(o=r.emphasisItemStyle,a=r.blurItemStyle,s=r.selectItemStyle,l=r.focus,c=r.blurScope,h=r.labelStatesModels,f=r.hoverScale,d=r.cursorStyle,u=r.emphasisDisabled),!r||t.hasItemOption){var v=r&&r.itemModel?r.itemModel:t.getItemModel(e),y=v.getModel("emphasis");o=y.getModel("itemStyle").getItemStyle(),s=v.getModel(["select","itemStyle"]).getItemStyle(),a=v.getModel(["blur","itemStyle"]).getItemStyle(),l=y.get("focus"),c=y.get("blurScope"),u=y.get("disabled"),h=yu(v),f=y.getShallow("scale"),d=v.getShallow("cursor")}var m=t.getItemVisual(e,"symbolRotate");p.attr("rotation",(m||0)*Math.PI/180||0);var b=mb(t.getItemVisual(e,"symbolOffset"),n);b&&(p.x=b[0],p.y=b[1]),d&&p.attr("cursor",d);var _=t.getItemVisual(e,"style"),x=_.fill;if(p instanceof dl){var O=p.style;p.useStyle(Object(wt["extend"])({image:O.image,x:O.x,y:O.y,width:O.width,height:O.height},_))}else p.__isEmptyBrush?p.useStyle(Object(wt["extend"])({},_)):p.useStyle(_),p.style.decal=null,p.setColor(x,i&&i.symbolInnerColor),p.style.strokeNoScale=!0;var w=t.getItemVisual(e,"liftZ"),S=this._z2;null!=w?null==S&&(this._z2=p.z2,p.z2+=w):null!=S&&(p.z2=S,this._z2=null);var j=i&&i.useNameLabel;function C(e){return j?t.getName(e):oC(t,e)}vu(p,h,{labelFetcher:g,labelDataIndex:e,defaultText:C,inheritColor:x,defaultOpacity:_.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var T=p.ensureState("emphasis");if(T.style=o,p.ensureState("select").style=s,p.ensureState("blur").style=a,f){var M=Math.max(Object(wt["isNumber"])(f)?f:1.1,3/this._sizeY);T.scaleX=this._sizeX*M,T.scaleY=this._sizeY*M}this.setSymbolScale(1),Uc(this,l,c,u)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,e,n){var r=this.childAt(0),i=Vl(this).dataIndex,o=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var a=r.getTextContent();a&&lu(a,{style:{opacity:0}},e,{dataIndex:i,removeOpt:o,cb:function(){r.removeTextContent()}})}else r.removeTextContent();lu(r,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:i,cb:t,removeOpt:o})},e.getSymbolSize=function(t,e){return yb(t.getItemVisual(e,"symbolSize"))},e}(Fi);function lC(t,e){this.parent.drift(t,e)}var cC=sC;function uC(t,e,n,r){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(r.isIgnore&&r.isIgnore(n))&&!(r.clipShape&&!r.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(n,"symbol")}function hC(t){return null==t||Object(wt["isObject"])(t)||(t={isIgnore:t}),t||{}}function fC(t){var e=t.hostModel,n=e.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:yu(e),cursorStyle:e.get("cursor")}}var dC=function(){function t(t){this.group=new Fi,this._SymbolCtor=t||cC}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=hC(e);var n=this.group,r=t.hostModel,i=this._data,o=this._SymbolCtor,a=e.disableAnimation,s=fC(t),l={disableAnimation:a},c=e.getSymbolPoint||function(e){return t.getItemLayout(e)};i||n.removeAll(),t.diff(i).add((function(r){var i=c(r);if(uC(t,i,r,e)){var a=new o(t,r,s,l);a.setPosition(i),t.setItemGraphicEl(r,a),n.add(a)}})).update((function(u,h){var f=i.getItemGraphicEl(h),d=c(u);if(uC(t,d,u,e)){var p=t.getItemVisual(u,"symbol")||"circle",g=f&&f.getSymbolType&&f.getSymbolType();if(!f||g&&g!==p)n.remove(f),f=new o(t,u,s,l),f.setPosition(d);else{f.updateData(t,u,s,l);var v={x:d[0],y:d[1]};a?f.attr(v):ou(f,v,r)}n.add(f),t.setItemGraphicEl(u,f)}else n.remove(f)})).remove((function(t){var e=i.getItemGraphicEl(t);e&&e.fadeOut((function(){n.remove(e)}),r)})).execute(),this._getSymbolPoint=c,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl((function(e,n){var r=t._getSymbolPoint(n);e.setPosition(r),e.markRedraw()}))},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=fC(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function r(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=hC(n);for(var i=t.start;i0?n=r[0]:r[1]<0&&(n=r[1]),n}function yC(t,e,n,r){var i=NaN;t.stacked&&(i=n.get(n.getCalculationInfo("stackedOverDimension"),r)),isNaN(i)&&(i=t.valueStart);var o=t.baseDataOffset,a=[];return a[o]=n.get(t.baseDim,r),a[1-o]=i,e.dataToPoint(a)}function mC(t,e){var n=[];return e.diff(t).add((function(t){n.push({cmd:"+",idx:t})})).update((function(t,e){n.push({cmd:"=",idx:e,idx1:t})})).remove((function(t){n.push({cmd:"-",idx:t})})).execute(),n}function bC(t,e,n,r,i,o,a,s){for(var l=mC(t,e),c=[],u=[],h=[],f=[],d=[],p=[],g=[],v=gC(i,e,a),y=t.getLayout("points")||[],m=e.getLayout("points")||[],b=0;b=i||g<0)break;if(OC(y,m)){if(l){g+=o;continue}break}if(g===n)t[o>0?"moveTo":"lineTo"](y,m),h=y,f=m;else{var b=y-c,_=m-u;if(b*b+_*_<.5){g+=o;continue}if(a>0){var x=g+o,O=e[2*x],w=e[2*x+1];while(O===y&&w===m&&v=r||OC(O,w))d=y,p=m;else{C=O-c,T=w-u;var I=y-c,D=O-y,A=m-u,P=w-m,L=void 0,N=void 0;if("x"===s){L=Math.abs(I),N=Math.abs(D);var E=C>0?1:-1;d=y-E*L*a,p=m,M=y+E*N*a,k=m}else if("y"===s){L=Math.abs(A),N=Math.abs(P);var R=T>0?1:-1;d=y,p=m-R*L*a,M=y,k=m+R*N*a}else L=Math.sqrt(I*I+A*A),N=Math.sqrt(D*D+P*P),j=N/(N+L),d=y-C*a*(1-j),p=m-T*a*(1-j),M=y+C*a*j,k=m+T*a*j,M=_C(M,xC(O,y)),k=_C(k,xC(w,m)),M=xC(M,_C(O,y)),k=xC(k,_C(w,m)),C=M-y,T=k-m,d=y-C*L/N,p=m-T*L/N,d=_C(d,xC(c,y)),p=_C(p,xC(u,m)),d=xC(d,_C(c,y)),p=xC(p,_C(u,m)),C=y-d,T=m-p,M=y+C*N/L,k=m+T*N/L}t.bezierCurveTo(h,f,d,p,y,m),h=M,f=k}else t.lineTo(y,m)}c=y,u=m,g+=o}return v}var SC=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),jC=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polyline",n}return xt(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new SC},e.prototype.buildPath=function(t,e){var n=e.points,r=0,i=n.length/2;if(e.connectNulls){for(;i>0;i--)if(!OC(n[2*i-2],n[2*i-1]))break;for(;r=0){var m=s?(f-r)*y+r:(h-n)*y+n;return s?[t,m]:[m,t]}n=h,r=f;break;case a.C:h=o[c++],f=o[c++],d=o[c++],p=o[c++],g=o[c++],v=o[c++];var b=s?bn(n,h,d,g,t,l):bn(r,f,p,v,t,l);if(b>0)for(var _=0;_=0){m=s?yn(r,f,p,v,x):yn(n,h,d,g,x);return s?[t,m]:[m,t]}}n=g,r=v;break}}},e}(ol),CC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xt(e,t),e}(SC),TC=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polygon",n}return xt(e,t),e.prototype.getDefaultShape=function(){return new CC},e.prototype.buildPath=function(t,e){var n=e.points,r=e.stackedOnPoints,i=0,o=n.length/2,a=e.smoothMonotone;if(e.connectNulls){for(;o>0;o--)if(!OC(n[2*o-2],n[2*o-1]))break;for(;ie){r?i.push(a(r,l,e)):n&&i.push(a(n,l,0),a(n,l,e));break}n&&(i.push(a(n,l,0)),n=null),i.push(l),r=l}}return i}function zC(t,e,n){var r=t.getVisual("visualMeta");if(r&&r.length&&t.count()&&"cartesian2d"===e.type){for(var i,o,a=r.length-1;a>=0;a--){var s=t.getDimensionInfo(r[a].dimension);if(i=s&&s.coordDim,"x"===i||"y"===i){o=r[a];break}}if(o){var l=e.getAxis(i),c=wt["map"](o.stops,(function(t){return{coord:l.toGlobalCoord(l.dataToCoord(t.value)),color:t.color}})),u=c.length,h=o.outerColors.slice();u&&c[0].coord>c[u-1].coord&&(c.reverse(),h.reverse());var f=BC(c,"x"===i?n.getWidth():n.getHeight()),d=f.length;if(!d&&u)return c[0].coord<0?h[1]?h[1]:c[u-1].color:h[0]?h[0]:c[0].color;var p=10,g=f[0].coord-p,v=f[d-1].coord+p,y=v-g;if(y<.001)return"transparent";wt["each"](f,(function(t){t.offset=(t.coord-g)/y})),f.push({offset:d?f[d-1].offset:.5,color:h[1]||"transparent"}),f.unshift({offset:d?f[0].offset:.5,color:h[0]||"transparent"});var m=new sy(0,0,0,0,f,!0);return m[i]=g,m[i+"2"]=v,m}}}function FC(t,e,n){var r=t.get("showAllSymbol"),i="auto"===r;if(!r||i){var o=n.getAxesByScale("ordinal")[0];if(o&&(!i||!VC(o,e))){var a=e.mapDimension(o.dim),s={};return wt["each"](o.getViewLabels(),(function(t){var e=o.scale.getRawOrdinalNumber(t.tickValue);s[e]=1})),function(t){return!s.hasOwnProperty(e.get(a,t))}}}}function VC(t,e){var n=t.getExtent(),r=Math.abs(n[1]-n[0])/t.scale.count();isNaN(r)&&(r=0);for(var i=e.count(),o=Math.max(1,Math.round(i/5)),a=0;ar)return!1;return!0}function HC(t,e){return isNaN(t)||isNaN(e)}function GC(t){for(var e=t.length/2;e>0;e--)if(!HC(t[2*e-2],t[2*e-1]))break;return e-1}function WC(t,e){return[t[2*e],t[2*e+1]]}function UC(t,e,n){for(var r,i,o=t.length/2,a="x"===n?0:1,s=0,l=-1,c=0;c=e||r>=e&&i<=e){l=c;break}s=c,r=i}else r=i;return{range:[s,l],t:(e-r)/(i-r)}}function YC(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e0&&"bolder"===t.get(["emphasis","lineStyle","width"])){var L=d.getState("emphasis").style;L.lineWidth=+d.style.lineWidth+1}Vl(d).seriesIndex=t.seriesIndex,Uc(d,D,A,P);var N=NC(t.get("smooth")),E=t.get("smoothMonotone");if(d.setShape({smooth:N,smoothMonotone:E,connectNulls:O}),p){var R=a.getCalculationInfo("stackedOnSeries"),B=0;p.useStyle(wt["defaults"](l.getAreaStyle(),{fill:T,opacity:.7,lineJoin:"bevel",decal:a.getVisual("style").decal})),R&&(B=NC(R.get("smooth"))),p.setShape({smooth:N,stackedOnSmooth:B,smoothMonotone:E,connectNulls:O}),Zc(p,t,"areaStyle"),Vl(p).seriesIndex=t.seriesIndex,Uc(p,D,A,P)}var z=function(t){r._changePolyState(t)};a.eachItemGraphicEl((function(t){t&&(t.onHoverStateChange=z)})),this._polyline.onHoverStateChange=z,this._data=a,this._coordSys=i,this._stackedOnPoints=_,this._points=c,this._step=C,this._valueOrigin=m,t.get("triggerLineEvent")&&(this.packEventData(t,d),p&&this.packEventData(t,p))},e.prototype.packEventData=function(t,e){Vl(e).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,e,n,r){var i=t.getData(),o=qo(i,r);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var a=i.getLayout("points"),s=i.getItemGraphicEl(o);if(!s){var l=a[2*o],c=a[2*o+1];if(isNaN(l)||isNaN(c))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,c))return;var u=t.get("zlevel"),h=t.get("z");s=new cC(i,o),s.x=l,s.y=c,s.setZ(u,h);var f=s.getSymbolPath().getTextContent();f&&(f.zlevel=u,f.z=h,f.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else om.prototype.highlight.call(this,t,e,n,r)},e.prototype.downplay=function(t,e,n,r){var i=t.getData(),o=qo(i,r);if(this._changePolyState("normal"),null!=o&&o>=0){var a=i.getItemGraphicEl(o);a&&(a.__temp?(i.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else om.prototype.downplay.call(this,t,e,n,r)},e.prototype._changePolyState=function(t){var e=this._polygon;yc(this._polyline,t),e&&yc(e,t)},e.prototype._newPolyline=function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new jC({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},e.prototype._newPolygon=function(t,e){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new TC({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,e,n){var r,i,o=e.getBaseAxis(),a=o.inverse;"cartesian2d"===e.type?(r=o.isHorizontal(),i=!1):"polar"===e.type&&(r="angle"===o.dim,i=!0);var s=t.hostModel,l=s.get("animationDuration");wt["isFunction"](l)&&(l=l(null));var c=s.get("animationDelay")||0,u=wt["isFunction"](c)?c(null):c;t.eachItemGraphicEl((function(t,o){var s=t;if(s){var h=[t.x,t.y],f=void 0,d=void 0,p=void 0;if(n)if(i){var g=n,v=e.pointToCoord(h);r?(f=g.startAngle,d=g.endAngle,p=-v[1]/180*Math.PI):(f=g.r0,d=g.r,p=v[0])}else{var y=n;r?(f=y.x,d=y.x+y.width,p=t.x):(f=y.y+y.height,d=y.y,p=t.y)}var m=d===f?0:(p-f)/(d-f);a&&(m=1-m);var b=wt["isFunction"](c)?c(o):l*m+u,_=s.getSymbolPath(),x=_.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:b}),x&&x.animateFrom({style:{opacity:0}},{duration:300,delay:b}),_.disableLabelAnimation=!0}}))},e.prototype._initOrUpdateEndLabel=function(t,e,n){var r=t.getModel("endLabel");if(YC(t)){var i=t.getData(),o=this._polyline,a=i.getLayout("points");if(!a)return o.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||(s=this._endLabel=new Fl({z2:200}),s.ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var l=GC(a);l>=0&&(vu(o,yu(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:l,defaultText:function(t,e,n){return null!=n?aC(i,n):oC(i,t)},enableTextSetter:!0},qC(r,e)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,e,n,r,i,o,a){var s=this._endLabel,l=this._polyline;if(s){t<1&&null==r.originalX&&(r.originalX=s.x,r.originalY=s.y);var c=n.getLayout("points"),u=n.hostModel,h=u.get("connectNulls"),f=o.get("precision"),d=o.get("distance")||0,p=a.getBaseAxis(),g=p.isHorizontal(),v=p.inverse,y=e.shape,m=v?g?y.x:y.y+y.height:g?y.x+y.width:y.y,b=(g?d:0)*(v?-1:1),_=(g?0:-d)*(v?-1:1),x=g?"x":"y",O=UC(c,m,x),w=O.range,S=w[1]-w[0],j=void 0;if(S>=1){if(S>1&&!h){var C=WC(c,w[0]);s.attr({x:C[0]+b,y:C[1]+_}),i&&(j=u.getRawValue(w[0]))}else{C=l.getPointOn(m,x);C&&s.attr({x:C[0]+b,y:C[1]+_});var T=u.getRawValue(w[0]),M=u.getRawValue(w[1]);i&&(j=ia(n,f,T,M,O.t))}r.lastFrameIndex=w[0]}else{var k=1===t||r.lastFrameIndex>0?w[0]:0;C=WC(c,k);i&&(j=u.getRawValue(k)),s.attr({x:C[0]+b,y:C[1]+_})}i&&Tu(s).setLabelText(j)}},e.prototype._doUpdateAnimation=function(t,e,n,r,i,o,a){var s=this._polyline,l=this._polygon,c=t.hostModel,u=bC(this._data,t,this._stackedOnPoints,e,this._coordSys,n,this._valueOrigin,o),h=u.current,f=u.stackedOnCurrent,d=u.next,p=u.stackedOnNext;if(i&&(h=RC(u.current,n,i,a),f=RC(u.stackedOnCurrent,n,i,a),d=RC(u.next,n,i,a),p=RC(u.stackedOnNext,n,i,a)),LC(h,d)>3e3||l&&LC(f,p)>3e3)return s.stopAnimation(),s.setShape({points:d}),void(l&&(l.stopAnimation(),l.setShape({points:d,stackedOnPoints:p})));s.shape.__points=u.current,s.shape.points=h;var g={shape:{points:d}};u.current!==h&&(g.shape.__points=u.next),s.stopAnimation(),ou(s,g,c),l&&(l.setShape({points:h,stackedOnPoints:f}),l.stopAnimation(),ou(l,{shape:{stackedOnPoints:p}},c),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var v=[],y=u.status,m=0;me&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;n10&&"cartesian2d"===o.type&&i){var s=o.getBaseAxis(),l=o.getOtherAxis(s),c=s.getExtent(),u=n.getDevicePixelRatio(),h=Math.abs(c[1]-c[0])*(u||1),f=Math.round(a/h);if(isFinite(f)&&f>1){"lttb"===i&&t.setData(r.lttbDownSample(r.mapDimension(l.dim),1/f));var d=void 0;Object(wt["isString"])(i)?d=QC[i]:Object(wt["isFunction"])(i)&&(d=i),d&&t.setData(r.downSample(r.mapDimension(l.dim),1/f,d,JC))}}}}}function eT(t){t.registerChartView(KC),t.registerSeriesModel(iC),t.registerLayout($C("line",!0)),t.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),n=t.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,tT("line"))}var nT=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return xt(e,t),e.prototype.getInitialData=function(t,e){return nw(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t){var e=this.coordinateSystem;if(e&&e.clampData){var n=e.dataToPoint(e.clampData(t)),r=this.getData(),i=r.getLayout("offset"),o=r.getLayout("size"),a=e.getBaseAxis().isHorizontal()?0:1;return n[a]+=i+o/2,n}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(Eg);Eg.registerClass(nT);var rT=nT,iT=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return xt(e,t),e.prototype.getInitialData=function(){return nw(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t},e.prototype.brushSelector=function(t,e,n){return n.rect(e.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=Xu(rT.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(rT),oT=iT,aT=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0}return t}(),sT=function(t){function e(e){var n=t.call(this,e)||this;return n.type="sausage",n}return xt(e,t),e.prototype.getDefaultShape=function(){return new aT},e.prototype.buildPath=function(t,e){var n=e.cx,r=e.cy,i=Math.max(e.r0||0,0),o=Math.max(e.r,0),a=.5*(o-i),s=i+a,l=e.startAngle,c=e.endAngle,u=e.clockwise,h=2*Math.PI,f=u?c-lMath.PI/2&&u<1.5*Math.PI&&(u-=Math.PI),t.setTextConfig({rotation:u})}}function hT(t,e,n){return e*Math.sin(t)*(n?-1:1)}function fT(t,e,n){return e*Math.cos(t)*(n?1:-1)}var dT=Math.max,pT=Math.min;function gT(t,e){var n=t.getArea&&t.getArea();if(DC(t,"cartesian2d")){var r=t.getBaseAxis();if("category"!==r.type||!r.onBand){var i=e.getLayout("bandWidth");r.isHorizontal()?(n.x-=i,n.width+=2*i):(n.y-=i,n.height+=2*i)}}return n}var vT=function(t){function e(){var n=t.call(this)||this;return n.type=e.type,n._isFirstFrame=!0,n}return xt(e,t),e.prototype.render=function(t,e,n,r){this._model=t,this._removeOnRenderedListener(n),this._updateDrawMode(t);var i=t.get("coordinateSystem");("cartesian2d"===i||"polar"===i)&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,e,n):this._renderNormal(t,e,n,r))},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,e){this._progressiveEls=[],this._incrementalRenderLarge(t,e)},e.prototype.eachRendered=function(t){Ky(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t,e,n,r){var i,o=this.group,a=t.getData(),s=this._data,l=t.coordinateSystem,c=l.getBaseAxis();"cartesian2d"===l.type?i=c.isHorizontal():"polar"===l.type&&(i="angle"===c.dim);var u=t.isAnimationEnabled()?t:null,h=bT(t,l);h&&this._enableRealtimeSort(h,a,n);var f=t.get("clip",!0)||h,d=gT(l,a);o.removeClipPath();var p=t.get("roundCap",!0),g=t.get("showBackground",!0),v=t.getModel("backgroundStyle"),y=v.get("borderRadius")||0,m=[],b=this._backgroundEls,_=r&&r.isInitSort,x=r&&"changeAxisOrder"===r.type;function O(t){var e=jT[l.type](a,t),n=ET(l,i,e);return n.useStyle(v.getItemStyle()),"cartesian2d"===l.type&&n.setShape("r",y),m[t]=n,n}a.diff(s).add((function(e){var n=a.getItemModel(e),r=jT[l.type](a,e,n);if(g&&O(e),a.hasValue(e)&&ST[l.type](r)){var s=!1;f&&(s=yT[l.type](d,r));var v=mT[l.type](t,a,e,r,i,u,c.model,!1,p);h&&(v.forceLabelAnimation=!0),MT(v,a,e,n,r,t,i,"polar"===l.type),_?v.attr({shape:r}):h?_T(h,u,v,r,e,i,!1,!1):au(v,{shape:r},t,e),a.setItemGraphicEl(e,v),o.add(v),v.ignore=s}})).update((function(e,n){var r=a.getItemModel(e),w=jT[l.type](a,e,r);if(g){var S=void 0;0===b.length?S=O(n):(S=b[n],S.useStyle(v.getItemStyle()),"cartesian2d"===l.type&&S.setShape("r",y),m[e]=S);var j=jT[l.type](a,e),C=NT(i,j,l);ou(S,{shape:C},u,e)}var T=s.getItemGraphicEl(n);if(a.hasValue(e)&&ST[l.type](w)){var M=!1;if(f&&(M=yT[l.type](d,w),M&&o.remove(T)),T?hu(T):T=mT[l.type](t,a,e,w,i,u,c.model,!!T,p),h&&(T.forceLabelAnimation=!0),x){var k=T.getTextContent();if(k){var I=Tu(k);null!=I.prevValue&&(I.prevValue=I.value)}}else MT(T,a,e,r,w,t,i,"polar"===l.type);_?T.attr({shape:w}):h?_T(h,u,T,w,e,i,!0,x):ou(T,{shape:w},t,e,null),a.setItemGraphicEl(e,T),T.ignore=M,o.add(T)}else o.remove(T)})).remove((function(e){var n=s.getItemGraphicEl(e);n&&uu(n,t,e)})).execute();var w=this._backgroundGroup||(this._backgroundGroup=new Fi);w.removeAll();for(var S=0;So)return!0;o=c}return!1},e.prototype._isOrderDifferentInView=function(t,e){for(var n=e.scale,r=n.getExtent(),i=Math.max(0,r[0]),o=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=o;++i)if(t.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},e.prototype._updateSortWithinSameData=function(t,e,n,r){if(this._isOrderChangedWithinSameData(t,e,n)){var i=this._dataSort(t,n,e);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:i}))}},e.prototype._dispatchInitSort=function(t,e,n){var r=e.baseAxis,i=this._dataSort(t,r,(function(n){return t.get(t.mapDimension(e.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:r.dim+"Axis",isInitSort:!0,axisId:r.index,sortInfo:i})},e.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},e.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var e=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(e){uu(e,t,Vl(e).dataIndex)}))):e.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(om),yT={cartesian2d:function(t,e){var n=e.width<0?-1:1,r=e.height<0?-1:1;n<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height);var i=t.x+t.width,o=t.y+t.height,a=dT(e.x,t.x),s=pT(e.x+e.width,i),l=dT(e.y,t.y),c=pT(e.y+e.height,o),u=si?s:a,e.y=h&&l>o?c:l,e.width=u?0:s-a,e.height=h?0:c-l,n<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height),u||h},polar:function(t,e){var n=e.r0<=e.r?1:-1;if(n<0){var r=e.r;e.r=e.r0,e.r0=r}var i=pT(e.r,t.r),o=dT(e.r0,t.r0);e.r=i,e.r0=o;var a=i-o<0;if(n<0){r=e.r;e.r=e.r0,e.r0=r}return a}},mT={cartesian2d:function(t,e,n,r,i,o,a,s,l){var c=new Ol({shape:Object(wt["extend"])({},r),z2:1});if(c.__dataIndex=n,c.name="item",o){var u=c.shape,h=i?"height":"width";u[h]=0}return c},polar:function(t,e,n,r,i,o,a,s,l){var c=!i&&l?lT:Av,u=new c({shape:r,z2:1});u.name="item";var h=TT(i);if(u.calculateTextPosition=cT(h,{isRoundCap:c===lT}),o){var f=u.shape,d=i?"r":"endAngle",p={};f[d]=i?0:r.startAngle,p[d]=r[d],(s?ou:au)(u,{shape:p},o)}return u}};function bT(t,e){var n=t.get("realtimeSort",!0),r=e.getBaseAxis();if(n&&"category"===r.type&&"cartesian2d"===e.type)return{baseAxis:r,otherAxis:e.getOtherAxis(r)}}function _T(t,e,n,r,i,o,a,s){var l,c;o?(c={x:r.x,width:r.width},l={y:r.y,height:r.height}):(c={y:r.y,height:r.height},l={x:r.x,width:r.width}),s||(a?ou:au)(n,{shape:l},e,i,null);var u=e?t.baseAxis.model:null;(a?ou:au)(n,{shape:c},u,i)}function xT(t,e){for(var n=0;n0?1:-1,a=r.height>0?1:-1;return{x:r.x+o*i/2,y:r.y+a*i/2,width:r.width-o*i,height:r.height-a*i}},polar:function(t,e,n){var r=t.getItemLayout(e);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function CT(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}function TT(t){return function(t){var e=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}}(t)}function MT(t,e,n,r,i,o,a,s){var l=e.getItemVisual(n,"style");s||t.setShape("r",r.get(["itemStyle","borderRadius"])||0),t.useStyle(l);var c=r.getShallow("cursor");c&&t.attr("cursor",c);var u=s?a?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":a?i.height>=0?"bottom":"top":i.width>=0?"right":"left",h=yu(r);vu(t,h,{labelFetcher:o,labelDataIndex:n,defaultText:oC(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:u});var f=t.getTextContent();if(s&&f){var d=r.get(["label","position"]);t.textConfig.inside="middle"===d||null,uT(t,"outside"===d?u:d,TT(a),r.get(["label","rotate"]))}Mu(f,h,o.getRawValue(n),(function(t){return aC(e,t)}));var p=r.getModel(["emphasis"]);Uc(t,p.get("focus"),p.get("blurScope"),p.get("disabled")),Zc(t,r),CT(i)&&(t.style.fill="none",t.style.stroke="none",Object(wt["each"])(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}function kT(t,e){var n=t.get(["itemStyle","borderColor"]);if(!n||"none"===n)return 0;var r=t.get(["itemStyle","borderWidth"])||0,i=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),o=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(r,i,o)}var IT=function(){function t(){}return t}(),DT=function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeBar",n}return xt(e,t),e.prototype.getDefaultShape=function(){return new IT},e.prototype.buildPath=function(t,e){for(var n=e.points,r=this.baseDimIdx,i=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l=0?n:null}),30,!1);function LT(t,e,n){for(var r=t.baseDimIdx,i=1-r,o=t.shape.points,a=t.largeDataIndices,s=[],l=[],c=t.barWidth,u=0,h=o.length/3;u=s[0]&&e<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[u]}return-1}function NT(t,e,n){if(DC(n,"cartesian2d")){var r=e,i=n.getArea();return{x:t?r.x:i.x,y:t?i.y:r.y,width:t?r.width:i.width,height:t?i.height:r.height}}i=n.getArea();var o=e;return{cx:i.cx,cy:i.cy,r0:t?i.r0:o.r0,r:t?i.r:o.r,startAngle:t?o.startAngle:0,endAngle:t?o.endAngle:2*Math.PI}}function ET(t,e,n){var r="polar"===t.type?Av:Ol;return new r({shape:NT(e,n,t),silent:!0,z2:0})}var RT=vT;function BT(t){t.registerChartView(RT),t.registerSeriesModel(oT),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,wt["curry"](Lw,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Nw("bar")),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,tT("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(t,e){var n=t.componentType||"series";e.eachComponent({mainType:n,query:t},(function(e){t.sortInfo&&e.axis.setCategorySortInfo(t.sortInfo)}))}))}var zT=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return xt(e,t),e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(df),FT=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return xt(e,t),e.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var r=this.group,i=t.getModel("textStyle"),o=t.getModel("subtextStyle"),a=t.get("textAlign"),s=wt["retrieve2"](t.get("textBaseline"),t.get("textVerticalAlign")),l=new Fl({style:mu(i,{text:t.get("text"),fill:i.getTextColor()},{disableBox:!0}),z2:10}),c=l.getBoundingRect(),u=t.get("subtext"),h=new Fl({style:mu(o,{text:u,fill:o.getTextColor(),y:c.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),f=t.get("link"),d=t.get("sublink"),p=t.get("triggerEvent",!0);l.silent=!f&&!p,h.silent=!d&&!p,f&&l.on("click",(function(){Qh(f,"_"+t.get("target"))})),d&&h.on("click",(function(){Qh(d,"_"+t.get("subtarget"))})),Vl(l).eventData=Vl(h).eventData=p?{componentType:"title",componentIndex:t.componentIndex}:null,r.add(l),u&&r.add(h);var g=r.getBoundingRect(),v=t.getBoxLayoutParams();v.width=g.width,v.height=g.height;var y=of(v,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));a||(a=t.get("left")||t.get("right"),"middle"===a&&(a="center"),"right"===a?y.x+=y.width:"center"===a&&(y.x+=y.width/2)),s||(s=t.get("top")||t.get("bottom"),"center"===s&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),r.x=y.x,r.y=y.y,r.markRedraw();var m={align:a,verticalAlign:s};l.setStyle(m),h.setStyle(m),g=r.getBoundingRect();var b=y.margin,_=t.getItemStyle(["color","opacity"]);_.fill=t.get("backgroundColor");var x=new Ol({shape:{x:g.x-b[3],y:g.y-b[0],width:g.width+b[1]+b[3],height:g.height+b[0]+b[2],r:t.get("borderRadius")},style:_,subPixelOptimize:!0,silent:!0});r.add(x)}},e.type="title",e}(Bg);function VT(t){t.registerComponentModel(zT),t.registerComponentView(FT)}function HT(t,e){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return GT(n,t,e),n.seriesInvolved&&UT(n,t),n}function GT(t,e,n){var r=e.getComponent("tooltip"),i=e.getComponent("axisPointer"),o=i.get("link",!0)||[],a=[];Object(wt["each"])(n.getCoordinateSystems(),(function(n){if(n.axisPointerEnabled){var s=QT(n.model),l=t.coordSysAxesInfo[s]={};t.coordSysMap[s]=n;var c=n.model,u=c.getModel("tooltip",r);if(Object(wt["each"])(n.getAxes(),Object(wt["curry"])(p,!1,null)),n.getTooltipAxes&&r&&u.get("show")){var h="axis"===u.get("trigger"),f="cross"===u.get(["axisPointer","type"]),d=n.getTooltipAxes(u.get(["axisPointer","axis"]));(h||f)&&Object(wt["each"])(d.baseAxes,Object(wt["curry"])(p,!f||"cross",h)),f&&Object(wt["each"])(d.otherAxes,Object(wt["curry"])(p,"cross",!1))}}function p(r,s,c){var h=c.model.getModel("axisPointer",i),f=h.get("show");if(f&&("auto"!==f||r||$T(h))){null==s&&(s=h.get("triggerTooltip")),h=r?WT(c,u,i,e,r,s):h;var d=h.get("snap"),p=QT(c.model),g=s||d||"category"===c.type,v=t.axesInfo[p]={key:p,axis:c,coordSys:n,axisPointerModel:h,triggerTooltip:s,involveSeries:g,snap:d,useHandle:$T(h),seriesModels:[],linkGroup:null};l[p]=v,t.seriesInvolved=t.seriesInvolved||g;var y=YT(o,c);if(null!=y){var m=a[y]||(a[y]={axesInfo:{}});m.axesInfo[p]=v,m.mapper=o[y].mapper,v.linkGroup=m}}}}))}function WT(t,e,n,r,i,o){var a=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};Object(wt["each"])(s,(function(t){l[t]=Object(wt["clone"])(a.get(t))})),l.snap="category"!==t.type&&!!o,"cross"===a.get("type")&&(l.type="line");var c=l.label||(l.label={});if(null==c.show&&(c.show=!1),"cross"===i){var u=a.get(["label","show"]);if(c.show=null==u||u,!o){var h=l.lineStyle=a.get("crossStyle");h&&Object(wt["defaults"])(c,h.textStyle)}}return t.model.getModel("axisPointer",new Hu(l,n,r))}function UT(t,e){e.eachSeries((function(e){var n=e.coordinateSystem,r=e.get(["tooltip","trigger"],!0),i=e.get(["tooltip","show"],!0);n&&"none"!==r&&!1!==r&&"item"!==r&&!1!==i&&!1!==e.get(["axisPointer","show"],!0)&&Object(wt["each"])(t.coordSysAxesInfo[QT(n.model)],(function(t){var r=t.axis;n.getAxis(r.dim)===r&&(t.seriesModels.push(e),null==t.seriesDataCount&&(t.seriesDataCount=0),t.seriesDataCount+=e.getData().count())}))}))}function YT(t,e){for(var n=e.model,r=e.dim,i=0;i=0||t===e}function qT(t){var e=ZT(t);if(e){var n=e.axisPointerModel,r=e.axis.scale,i=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=r.parse(a));var s=$T(n);null==o&&(i.status=s?"show":"hide");var l=r.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),aa)return!0;if(o){var s=ZT(t).seriesDataCount,l=r.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,r,i){},t.prototype.createPointerEl=function(t,e,n,r){var i=e.pointer;if(i){var o=nM(t).pointerEl=new a[i.type](rM(e.pointer));t.add(o)}},t.prototype.createLabelEl=function(t,e,n,r){if(e.label){var i=nM(t).labelEl=new Fl(rM(e.label));t.add(i),lM(i,r)}},t.prototype.updatePointerEl=function(t,e,n){var r=nM(t).pointerEl;r&&e.pointer&&(r.setStyle(e.pointer.style),n(r,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,r){var i=nM(t).labelEl;i&&(i.setStyle(e.label.style),n(i,{x:e.label.x,y:e.label.y}),lM(i,r))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,r=this._api.getZr(),i=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return i&&r.remove(i),void(this._handle=null);this._handle||(e=!0,i=this._handle=Gy(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Oe(t.event)},onmousedown:iM(this._onHandleDragMove,this,0,0),drift:iM(this._onHandleDragMove,this),ondragend:iM(this._onHandleDragEnd,this)}),r.add(i)),uM(i,n,!1),i.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");wt["isArray"](s)||(s=[s,s]),i.scaleX=s[0]/2,i.scaleY=s[1]/2,um(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){aM(this._axisPointerModel,!e&&this._moveAnimation,this._handle,cM(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(cM(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(cM(r)),nM(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var e=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,r=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),r&&e.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),hm(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return n=n||0,{x:t[n],y:t[1-n],width:e[n],height:e[1-n]}},t}();function aM(t,e,n,r){sM(nM(n).lastProp,r)||(nM(n).lastProp=r,e?ou(n,r,t):(n.stopAnimation(),n.attr(r)))}function sM(t,e){if(wt["isObject"](t)&&wt["isObject"](e)){var n=!0;return wt["each"](e,(function(e,r){n=n&&sM(t[r],e)})),!!n}return t===e}function lM(t,e){t[e.get(["label","show"])?"show":"hide"]()}function cM(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function uM(t,e,n){var r=e.get("z"),i=e.get("zlevel");t&&t.traverse((function(t){"group"!==t.type&&(null!=r&&(t.z=r),null!=i&&(t.zlevel=i),t.silent=n)}))}var hM=oM,fM=Math.PI,dM=function(){function t(t,e){this.group=new Fi,this.opt=e,this.axisModel=t,Object(wt["defaults"])(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new Fi({x:e.position[0],y:e.position[1],rotation:e.rotation});n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(t){return!!pM[t]},t.prototype.add=function(t){pM[t](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(t,e,n){var r,i,o=ho(e-t);return fo(o)?(i=n>0?"top":"bottom",r="center"):fo(o-fM)?(i=n>0?"bottom":"top",r="center"):(i="middle",r=o>0&&o0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:r,textVerticalAlign:i}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),pM={axisLine:function(t,e,n,r){var i=e.get(["axisLine","show"]);if("auto"===i&&t.handleAutoShown&&(i=t.handleAutoShown("axisLine")),i){var o=e.axis.getExtent(),a=r.transform,s=[o[0],0],l=[o[1],0];a&&(qt(s,s,a),qt(l,l,a));var c=Object(wt["extend"])({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),u=new Xv({subPixelOptimize:!0,shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});u.anid="line",n.add(u);var h=e.get(["axisLine","symbol"]);if(null!=h){var f=e.get(["axisLine","symbolSize"]);Object(wt["isString"])(h)&&(h=[h,h]),(Object(wt["isString"])(f)||Object(wt["isNumber"])(f))&&(f=[f,f]);var d=mb(e.get(["axisLine","symbolOffset"])||0,f),p=f[0],g=f[1];Object(wt["each"])([{rotate:t.rotation+Math.PI/2,offset:d[0],r:0},{rotate:t.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(e,r){if("none"!==h[r]&&null!=h[r]){var i=vb(h[r],-p/2,-g/2,p,g,c.stroke,!0),o=e.r+e.offset;i.attr({rotation:e.rotate,x:s[0]+o*Math.cos(t.rotation),y:s[1]-o*Math.sin(t.rotation),silent:!0,z2:11}),n.add(i)}}))}}},axisTickLabel:function(t,e,n,r){var i=xM(n,r,e,t),o=wM(n,r,e,t);if(vM(e,o,i),OM(n,r,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var a=Fj(Object(wt["map"])(o,(function(t){return{label:t,priority:t.z2,defaultAttr:{ignore:t.ignore}}})));Wj(a)}},axisName:function(t,e,n,r){var i=Object(wt["retrieve"])(t.axisName,e.get("name"));if(i){var o,a,s=e.get("nameLocation"),l=t.nameDirection,c=e.getModel("nameTextStyle"),u=e.get("nameGap")||0,h=e.axis.getExtent(),f=h[0]>h[1]?-1:1,d=["start"===s?h[0]-f*u:"end"===s?h[1]+f*u:(h[0]+h[1])/2,bM(s)?t.labelOffset+l*u:0],p=e.get("nameRotate");null!=p&&(p=p*fM/180),bM(s)?o=dM.innerTextLayout(t.rotation,null!=p?p:t.rotation,l):(o=gM(t.rotation,s,p||0,h),a=t.axisNameAvailableWidth,null!=a&&(a=Math.abs(a/Math.sin(o.rotation)),!isFinite(a)&&(a=null)));var g=c.getFont(),v=e.get("nameTruncate",!0)||{},y=v.ellipsis,m=Object(wt["retrieve"])(t.nameTruncateMaxWidth,v.maxWidth,a),b=new Fl({x:d[0],y:d[1],rotation:o.rotation,silent:dM.isLabelSilent(e),style:mu(c,{text:i,font:g,overflow:"truncate",width:m,ellipsis:y,fill:c.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:c.get("align")||o.textAlign,verticalAlign:c.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(qy({el:b,componentModel:e,itemName:i}),b.__fullText=i,b.anid="name",e.get("triggerEvent")){var _=dM.makeAxisEventDataBase(e);_.targetType="axisName",_.name=i,Vl(b).eventData=_}r.add(b),b.updateTransform(),n.add(b),b.decomposeTransform()}}};function gM(t,e,n,r){var i,o,a=ho(n-t),s=r[0]>r[1],l="start"===e&&!s||"start"!==e&&s;return fo(a-fM/2)?(o=l?"bottom":"top",i="center"):fo(a-1.5*fM)?(o=l?"top":"bottom",i="center"):(o="middle",i=a<1.5*fM&&a>fM/2?l?"left":"right":l?"right":"left"),{rotation:a,textAlign:i,textVerticalAlign:o}}function vM(t,e,n){if(!wS(t.axis)){var r=t.get(["axisLabel","showMinLabel"]),i=t.get(["axisLabel","showMaxLabel"]);e=e||[],n=n||[];var o=e[0],a=e[1],s=e[e.length-1],l=e[e.length-2],c=n[0],u=n[1],h=n[n.length-1],f=n[n.length-2];!1===r?(yM(o),yM(c)):mM(o,a)&&(r?(yM(a),yM(u)):(yM(o),yM(c))),!1===i?(yM(s),yM(h)):mM(l,s)&&(i?(yM(l),yM(f)):(yM(s),yM(h)))}}function yM(t){t&&(t.ignore=!0)}function mM(t,e){var n=t&&t.getBoundingRect().clone(),r=e&&e.getBoundingRect().clone();if(n&&r){var i=Rr([]);return Vr(i,i,-t.rotation),n.applyTransform(zr([],i,t.getLocalTransform())),r.applyTransform(zr([],i,e.getLocalTransform())),n.intersect(r)}}function bM(t){return"middle"===t||"center"===t}function _M(t,e,n,r,i){for(var o=[],a=[],s=[],l=0;l=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})}))},e.prototype.remove=function(t,e){$M("axisPointer",e)},e.prototype.dispose=function(t,e){$M("axisPointer",e)},e.type="axisPointer",e}(Bg),JM=QM;function tk(t,e){var n,r=[],i=t.seriesIndex;if(null==i||!(n=e.getSeriesByIndex(i)))return{point:[]};var o=n.getData(),a=qo(o,t);if(null==a||a<0||wt["isArray"](a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)r=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var c=l.getBaseAxis(),u=l.getOtherAxis(c),h=u.dim,f=c.dim,d="x"===h||"radius"===h?1:0,p=o.mapDimension(f),g=[];g[d]=o.get(p,a),g[1-d]=o.get(o.getCalculationInfo("stackResultDimension"),a),r=l.dataToPoint(g)||[]}else r=l.dataToPoint(o.getValues(wt["map"](l.dimensions,(function(t){return o.mapDimension(t)})),a))||[];else if(s){var v=s.getBoundingRect().clone();v.applyTransform(s.transform),r=[v.x+v.width/2,v.y+v.height/2]}return{point:r,el:s}}var ek=Zo();function nk(t,e,n){var r=t.currTrigger,i=[t.x,t.y],o=t,a=t.dispatchAction||Object(wt["bind"])(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){fk(i)&&(i=tk({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=fk(i),c=o.axesInfo,u=s.axesInfo,h="leave"===r||fk(i),f={},d={},p={list:[],map:{}},g={showPointer:Object(wt["curry"])(ok,d),showTooltip:Object(wt["curry"])(ak,p)};Object(wt["each"])(s.coordSysMap,(function(t,e){var n=l||t.containPoint(i);Object(wt["each"])(s.coordSysAxesInfo[e],(function(t,e){var r=t.axis,o=uk(c,t);if(!h&&n&&(!c||o)){var a=o&&o.value;null!=a||l||(a=r.pointToData(i)),null!=a&&rk(t,a,g,!1,f)}}))}));var v={};return Object(wt["each"])(u,(function(t,e){var n=t.linkGroup;n&&!d[e]&&Object(wt["each"])(n.axesInfo,(function(e,r){var i=d[r];if(e!==t&&i){var o=i.value;n.mapper&&(o=t.axis.scale.parse(n.mapper(o,hk(e),hk(t)))),v[t.key]=o}}))})),Object(wt["each"])(v,(function(t,e){rk(u[e],t,g,!0,f)})),sk(d,u,f),lk(p,i,t,a),ck(u,a,n),f}}function rk(t,e,n,r,i){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var a=ik(e,t),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==i.seriesIndex&&Object(wt["extend"])(i,s[0]),!r&&t.snap&&o.containData(l)&&null!=l&&(e=l),n.showPointer(t,e,s),n.showTooltip(t,a,l)}else n.showPointer(t,e)}function ik(t,e){var n=e.axis,r=n.dim,i=t,o=[],a=Number.MAX_VALUE,s=-1;return Object(wt["each"])(e.seriesModels,(function(e,l){var c,u,h=e.getData().mapDimensionsAll(r);if(e.getAxisTooltipData){var f=e.getAxisTooltipData(h,t,n);u=f.dataIndices,c=f.nestestValue}else{if(u=e.getData().indicesOfNearest(h[0],t,"category"===n.type?.5:null),!u.length)return;c=e.getData().get(h[0],u[0])}if(null!=c&&isFinite(c)){var d=t-c,p=Math.abs(d);p<=a&&((p=0&&s<0)&&(a=p,s=d,i=c,o.length=0),Object(wt["each"])(u,(function(t){o.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})})))}})),{payloadBatch:o,snapToValue:i}}function ok(t,e,n,r){t[e.key]={value:n,payloadBatch:r}}function ak(t,e,n,r){var i=n.payloadBatch,o=e.axis,a=o.model,s=e.axisPointerModel;if(e.triggerTooltip&&i.length){var l=e.coordSys.model,c=QT(l),u=t.map[c];u||(u=t.map[c]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(u)),u.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:r,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function sk(t,e,n){var r=n.axesInfo=[];Object(wt["each"])(e,(function(e,n){var i=e.axisPointerModel.option,o=t[n];o?(!e.useHandle&&(i.status="show"),i.value=o.value,i.seriesDataIndices=(o.payloadBatch||[]).slice()):!e.useHandle&&(i.status="hide"),"show"===i.status&&r.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:i.value})}))}function lk(t,e,n,r){if(!fk(e)&&t.list.length){var i=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:t.list})}else r({type:"hideTip"})}function ck(t,e,n){var r=n.getZr(),i="axisPointerLastHighlights",o=ek(r)[i]||{},a=ek(r)[i]={};Object(wt["each"])(t,(function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&Object(wt["each"])(n.seriesDataIndices,(function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t}))}));var s=[],l=[];Object(wt["each"])(o,(function(t,e){!a[e]&&l.push(t)})),Object(wt["each"])(a,(function(t,e){!o[e]&&s.push(t)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function uk(t,e){for(var n=0;n<(t||[]).length;n++){var r=t[n];if(e.axis.dim===r.axisDim&&e.axis.model.componentIndex===r.axisIndex)return r}}function hk(t){var e=t.axis.model,n={},r=n.axisDim=t.axis.dim;return n.axisIndex=n[r+"AxisIndex"]=e.componentIndex,n.axisName=n[r+"AxisName"]=e.name,n.axisId=n[r+"AxisId"]=e.id,n}function fk(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function dk(t){eM.registerAxisPointerClass("CartesianAxisPointer",FM),t.registerComponentModel(HM),t.registerComponentView(JM),t.registerPreprocessor((function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!Object(wt["isArray"])(e)&&(t.axisPointer.link=[e])}})),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,(function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=HT(t,e)})),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},nk)}var pk=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return xt(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(df),gk=pk;function vk(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function yk(t){if(Ot["a"].domSupported)for(var e=document.documentElement.style,n=0,r=t.length;n-1?(l+="top:50%",c+="translateY(-50%) rotate("+(o="left"===a?-225:-45)+"deg)"):(l+="left:50%",c+="translateX(-50%) rotate("+(o="top"===a?225:45)+"deg)");var u=o*Math.PI/180,h=s+i,f=h*Math.abs(Math.cos(u))+h*Math.abs(Math.sin(u)),d=Math.round(100*((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-h)/2))/100;l+=";"+a+":-"+d+"px";var p=e+" solid "+i+"px;",g=["position:absolute;width:"+s+"px;height:"+s+"px;",l+";"+c+";","border-bottom:"+p,"border-right:"+p,"background-color:"+r+";"];return''}function Tk(t,e){var n="cubic-bezier(0.23,1,0.32,1)",r=" "+t/2+"s "+n,i="opacity"+r+",visibility"+r;return e||(r=" "+t+"s "+n,i+=Ot["a"].transformSupported?","+wk+r:",left"+r+",top"+r),Ok+":"+i}function Mk(t,e,n){var r=t.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!Ot["a"].transformSupported)return n?"top:"+i+";left:"+r+";":[["top",i],["left",r]];var o=Ot["a"].transform3dSupported,a="translate"+(o?"3d":"")+"("+r+","+i+(o?",0":"")+")";return n?"top:0;left:0;"+wk+":"+a+";":[["top",0],["left",0],[mk,a]]}function kk(t){var e=[],n=t.get("fontSize"),r=t.getTextColor();r&&e.push("color:"+r),e.push("font:"+t.getFont()),n&&e.push("line-height:"+Math.round(3*n/2)+"px");var i=t.get("textShadowColor"),o=t.get("textShadowBlur")||0,a=t.get("textShadowOffsetX")||0,s=t.get("textShadowOffsetY")||0;return i&&o&&e.push("text-shadow:"+a+"px "+s+"px "+o+"px "+i),Object(wt["each"])(["decoration","align"],(function(n){var r=t.get(n);r&&e.push("text-"+n+":"+r)})),e.join(";")}function Ik(t,e,n){var r=[],i=t.get("transitionDuration"),o=t.get("backgroundColor"),a=t.get("shadowBlur"),s=t.get("shadowColor"),l=t.get("shadowOffsetX"),c=t.get("shadowOffsetY"),u=t.getModel("textStyle"),h=_g(t,"html"),f=l+"px "+c+"px "+a+"px "+s;return r.push("box-shadow:"+f),e&&i&&r.push(Tk(i,n)),o&&r.push("background-color:"+o),Object(wt["each"])(["width","color","radius"],(function(e){var n="border-"+e,i=zh(n),o=t.get(i);null!=o&&r.push(n+":"+o+("color"===e?"":"px"))})),r.push(kk(u)),null!=h&&r.push("padding:"+Fh(h).join("px ")+"px"),r.join(";")+";"}function Dk(t,e,n,r,i){var o=e&&e.painter;if(n){var a=o&&o.getViewportRoot();a&&se(t,a,document.body,r,i)}else{t[0]=r,t[1]=i;var s=o&&o.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var Ak=function(){function t(t,e,n){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._firstShow=!0,this._longHide=!0,Ot["a"].wxa)return null;var r=document.createElement("div");r.domBelongToZr=!0,this.el=r;var i=this._zr=e.getZr(),o=this._appendToBody=n&&n.appendToBody;Dk(this._styleCoord,i,o,e.getWidth()/2,e.getHeight()/2),o?document.body.appendChild(r):t.appendChild(r),this._container=t;var a=this;r.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},r.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=i.handler,n=i.painter.getViewportRoot();me(n,t,!0),e.dispatch("mousemove",t)}},r.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return t.prototype.update=function(t){var e=this._container,n=xk(e,"position"),r=e.style;"absolute"!==r.position&&"absolute"!==n&&(r.position="relative");var i=t.get("alwaysShowContent");i&&this._moveIfResized(),this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=Sk+Ik(t,!this._firstShow,this._longHide)+Mk(i[0],i[1],!0)+"border-color:"+$h(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):r.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,n,r,i){var o=this.el;if(null!=t){var a="";if(Object(wt["isString"])(i)&&"item"===n.get("trigger")&&!vk(n)&&(a=Ck(n,r,i)),Object(wt["isString"])(t))o.innerHTML=t+a;else if(t){o.innerHTML="",Object(wt["isArray"])(t)||(t=[t]);for(var s=0;s=0?this._tryShow(n,r):"leave"===t&&this._hide(r))}),this))},e.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var r=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&r.manuallyShowTip(t,e,n,{x:r._lastX,y:r._lastY,dataByCoordSys:r._lastDataByCoordSys})}))}},e.prototype.manuallyShowTip=function(t,e,n,r){if(r.from!==this.uid&&!Ot["a"].node&&n.getDom()){var i=Hk(r,n);this._ticket="";var o=r.dataByCoordSys,a=Xk(r,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:r.position,positionDefault:"bottom"},i)}else if(r.tooltip&&null!=r.x&&null!=r.y){var l=zk;l.x=r.x,l.y=r.y,l.update(),Vl(l).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:l},i)}else if(o)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:o,tooltipOption:r.tooltipOption},i);else if(null!=r.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,r))return;var c=tk(r,e),u=c.point[0],h=c.point[1];null!=u&&null!=h&&this._tryShow({offsetX:u,offsetY:h,target:c.el,position:r.position,positionDefault:"bottom"},i)}else null!=r.x&&null!=r.y&&(n.dispatchAction({type:"updateAxisPointer",x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},e.prototype.manuallyHideTip=function(t,e,n,r){var i=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&i.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,r.from!==this.uid&&this._hide(Hk(r,n))},e.prototype._manuallyAxisShowTip=function(t,e,n,r){var i=r.seriesIndex,o=r.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=i&&null!=o&&null!=a){var s=e.getSeriesByIndex(i);if(s){var l=s.getData(),c=Vk([l.getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel);if("axis"===c.get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:i,dataIndex:o,position:r.position}),!0}}},e.prototype._tryShow=function(t,e){var n=t.target,r=this._tooltipModel;if(r){this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var o,a;this._lastDataByCoordSys=null,nb(n,(function(t){return null!=Vl(t).dataIndex?(o=t,!0):null!=Vl(t).tooltipConfig?(a=t,!0):void 0}),!0),o?this._showSeriesItemTooltip(t,o,e):a?this._showComponentItemTooltip(t,a,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},e.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=Object(wt["bind"])(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},e.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,r=this._tooltipModel,i=[e.offsetX,e.offsetY],o=Vk([e.tooltipOption],r),a=this._renderMode,s=[],l=ag("section",{blocks:[],noHeader:!0}),c=[],u=new xg;Object(wt["each"])(t,(function(t){Object(wt["each"])(t.dataByAxis,(function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),i=t.value;if(e&&null!=i){var o=MM(i,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),h=ag("section",{header:o,noHeader:!Object(wt["trim"])(o),sortBlocks:!0,blocks:[]});l.blocks.push(h),Object(wt["each"])(t.seriesDataIndices,(function(l){var f=n.getSeriesByIndex(l.seriesIndex),d=l.dataIndexInside,p=f.getDataParams(d);if(!(p.dataIndex<0)){p.axisDim=t.axisDim,p.axisIndex=t.axisIndex,p.axisType=t.axisType,p.axisId=t.axisId,p.axisValue=bS(e.axis,{value:i}),p.axisValueLabel=o,p.marker=u.makeTooltipMarker("item",$h(p.color),a);var g=vp(f.formatTooltip(d,!0,null)),v=g.frag;if(v){var y=Vk([f],r).get("valueFormatter");h.blocks.push(y?Object(wt["extend"])({valueFormatter:y},v):v)}g.text&&c.push(g.text),s.push(p)}}))}}))})),l.blocks.reverse(),c.reverse();var h=e.position,f=o.get("order"),d=fg(l,u,a,f,n.get("useUTC"),o.get("textStyle"));d&&c.unshift(d);var p="richText"===a?"\n\n":"
",g=c.join(p);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(t,s)?this._updatePosition(o,h,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",i[0],i[1],h,null,u)}))},e.prototype._showSeriesItemTooltip=function(t,e,n){var r=this._ecModel,i=Vl(e),o=i.seriesIndex,a=r.getSeriesByIndex(o),s=i.dataModel||a,l=i.dataIndex,c=i.dataType,u=s.getData(c),h=this._renderMode,f=t.positionDefault,d=Vk([u.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,f?{position:f}:null),p=d.get("trigger");if(null==p||"item"===p){var g=s.getDataParams(l,c),v=new xg;g.marker=v.makeTooltipMarker("item",$h(g.color),h);var y=vp(s.formatTooltip(l,!1,c)),m=d.get("order"),b=d.get("valueFormatter"),_=y.frag,x=_?fg(b?Object(wt["extend"])({valueFormatter:b},_):_,v,h,m,r.get("useUTC"),d.get("textStyle")):y.text,O="item_"+s.name+"_"+l;this._showOrMove(d,(function(){this._showTooltipContent(d,x,g,O,t.offsetX,t.offsetY,t.position,t.target,v)})),n({type:"showTip",dataIndexInside:l,dataIndex:u.getRawIndex(l),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,e,n){var r=Vl(e),i=r.tooltipConfig,o=i.option||{};if(Object(wt["isString"])(o)){var a=o;o={content:a,formatter:a}}var s=[o],l=this._ecModel.getComponent(r.componentMainType,r.componentIndex);l&&s.push(l),s.push({formatter:o.content});var c=t.positionDefault,u=Vk(s,this._tooltipModel,c?{position:c}:null),h=u.get("content"),f=Math.random()+"",d=new xg;this._showOrMove(u,(function(){var n=Object(wt["clone"])(u.get("formatterParams")||{});this._showTooltipContent(u,h,n,f,t.offsetX,t.offsetY,t.position,e,d)})),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,e,n,r,i,o,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var c=this._tooltipContent;c.setEnterable(t.get("enterable"));var u=t.get("formatter");a=a||t.get("position");var h=e,f=this._getNearestPoint([i,o],n,t.get("trigger"),t.get("borderColor")),d=f.color;if(u)if(Object(wt["isString"])(u)){var p=t.ecModel.get("useUTC"),g=Object(wt["isArray"])(n)?n[0]:n,v=g&&g.axisType&&g.axisType.indexOf("time")>=0;h=u,v&&(h=_h(g.axisValue,h,p)),h=Xh(h,n,!0)}else if(Object(wt["isFunction"])(u)){var y=Object(wt["bind"])((function(e,r){e===this._ticket&&(c.setContent(r,l,t,d,a),this._updatePosition(t,a,i,o,c,n,s))}),this);this._ticket=r,h=u(n,r,y)}else h=u;c.setContent(h,l,t,d,a),c.show(t,d),this._updatePosition(t,a,i,o,c,n,s)}},e.prototype._getNearestPoint=function(t,e,n,r){return"axis"===n||Object(wt["isArray"])(e)?{color:r||("html"===this._renderMode?"#fff":"none")}:Object(wt["isArray"])(e)?void 0:{color:r||e.color||e.borderColor}},e.prototype._updatePosition=function(t,e,n,r,i,o,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var c=i.getSize(),u=t.get("align"),h=t.get("verticalAlign"),f=a&&a.getBoundingRect().clone();if(a&&f.applyTransform(a.transform),Object(wt["isFunction"])(e)&&(e=e([n,r],o,i.el,f,{viewSize:[s,l],contentSize:c.slice()})),Object(wt["isArray"])(e))n=no(e[0],s),r=no(e[1],l);else if(Object(wt["isObject"])(e)){var d=e;d.width=c[0],d.height=c[1];var p=of(d,{width:s,height:l});n=p.x,r=p.y,u=null,h=null}else if(Object(wt["isString"])(e)&&a){var g=Uk(e,f,c,t.get("borderWidth"));n=g[0],r=g[1]}else{g=Gk(n,r,i,s,l,u?null:20,h?null:20);n=g[0],r=g[1]}if(u&&(n-=Yk(u)?c[0]/2:"right"===u?c[0]:0),h&&(r-=Yk(h)?c[1]/2:"bottom"===h?c[1]:0),vk(t)){g=Wk(n,r,i,s,l);n=g[0],r=g[1]}i.moveTo(n,r)},e.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===t.length;return i&&Object(wt["each"])(n,(function(n,o){var a=n.dataByAxis||[],s=t[o]||{},l=s.dataByAxis||[];i=i&&a.length===l.length,i&&Object(wt["each"])(a,(function(t,n){var o=l[n]||{},a=t.seriesDataIndices||[],s=o.seriesDataIndices||[];i=i&&t.value===o.value&&t.axisType===o.axisType&&t.axisId===o.axisId&&a.length===s.length,i&&Object(wt["each"])(a,(function(t,e){var n=s[e];i=i&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})),r&&Object(wt["each"])(t.seriesDataIndices,(function(t){var n=t.seriesIndex,o=e[n],a=r[n];o&&a&&a.data!==o.data&&(i=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!i},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,e){!Ot["a"].node&&e.getDom()&&(hm(this,"_updatePosition"),this._tooltipContent.dispose(),$M("itemTooltip",e))},e.type="tooltip",e}(Bg);function Vk(t,e,n){var r,i=e.ecModel;n?(r=new Hu(n,i,i),r=new Hu(e.option,r,i)):r=e;for(var o=t.length-1;o>=0;o--){var a=t[o];a&&(a instanceof Hu&&(a=a.get("tooltip",!0)),Object(wt["isString"])(a)&&(a={formatter:a}),a&&(r=new Hu(a,r,i)))}return r}function Hk(t,e){return t.dispatchAction||Object(wt["bind"])(e.dispatchAction,e)}function Gk(t,e,n,r,i,o,a){var s=n.getSize(),l=s[0],c=s[1];return null!=o&&(t+l+o+2>r?t-=l+o:t+=o),null!=a&&(e+c+a>i?e-=c+a:e+=a),[t,e]}function Wk(t,e,n,r,i){var o=n.getSize(),a=o[0],s=o[1];return t=Math.min(t+a,r)-a,e=Math.min(e+s,i)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function Uk(t,e,n,r){var i=n[0],o=n[1],a=Math.ceil(Math.SQRT2*r)+8,s=0,l=0,c=e.width,u=e.height;switch(t){case"inside":s=e.x+c/2-i/2,l=e.y+u/2-o/2;break;case"top":s=e.x+c/2-i/2,l=e.y-o-a;break;case"bottom":s=e.x+c/2-i/2,l=e.y+u+a;break;case"left":s=e.x-i-a,l=e.y+u/2-o/2;break;case"right":s=e.x+c+a,l=e.y+u/2-o/2}return[s,l]}function Yk(t){return"center"===t||"middle"===t}function Xk(t,e,n){var r=Qo(t).queryOptionMap,i=r.keys()[0];if(i&&"series"!==i){var o=ta(e,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),a=o.models[0];if(a){var s,l=n.getViewOfComponentModel(a);return l.group.traverse((function(e){var n=Vl(e).tooltipConfig;if(n&&n.name===t.name)return s=e,!0})),s?{componentMainType:i,componentIndex:a.componentIndex,el:s}:void 0}}}var qk=Fk;function Zk(t){rO(dk),t.registerComponentModel(gk),t.registerComponentView(qk),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},wt["noop"]),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},wt["noop"])}var Kk=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xt(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(df),$k=Kk,Qk=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xt(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Jo).models[0]},e.type="cartesian2dAxis",e}(df);wt["mixin"](Qk,jS);var Jk={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},tI=wt["merge"]({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},Jk),eI=wt["merge"]({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},Jk),nI=wt["merge"]({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},eI),rI=wt["defaults"]({logBase:10},eI),iI={category:tI,value:eI,time:nI,log:rI},oI={value:1,category:1,time:1,log:1};function aI(t,e,n,r){Object(wt["each"])(oI,(function(i,o){var a=Object(wt["merge"])(Object(wt["merge"])({},iI[o],!0),r,!0),s=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e+"Axis."+o,n}return xt(n,t),n.prototype.mergeDefaultAndTheme=function(t,e){var n=af(this),r=n?lf(t):{},i=e.getTheme();Object(wt["merge"])(t,i.get(o+"Axis")),Object(wt["merge"])(t,this.getDefaultOption()),t.type=sI(t),n&&sf(t,r,n)},n.prototype.optionUpdated=function(){var t=this.option;"category"===t.type&&(this.__ordinalMeta=lw.createByAxisModel(this))},n.prototype.getCategories=function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=e+"Axis."+o,n.defaultOption=a,n}(n);t.registerComponentModel(s)})),t.registerSubTypeDefaulter(e+"Axis",sI)}function sI(t){return t.type||(t.data?"category":"value")}var lI=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return wt["map"](this._dimList,(function(t){return this._axes[t]}),this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),wt["filter"](this.getAxes(),(function(e){return e.scale.type===t}))},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),cI=lI,uI=["x","y"];function hI(t){return"interval"===t.type||"time"===t.type}var fI=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=uI,e}return xt(e,t),e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(hI(t)&&hI(e)){var n=t.getExtent(),r=e.getExtent(),i=this.dataToPoint([n[0],r[0]]),o=this.dataToPoint([n[1],r[1]]),a=n[1]-n[0],s=r[1]-r[0];if(a&&s){var l=(o[0]-i[0])/a,c=(o[1]-i[1])/s,u=i[0]-n[0]*l,h=i[1]-r[0]*c,f=this._transform=[l,0,0,c,u,h];this._invTransform=Gr([],f)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.dataToPoint=function(t,e,n){n=n||[];var r=t[0],i=t[1];if(this._transform&&null!=r&&isFinite(r)&&null!=i&&isFinite(i))return qt(n,t,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(r,e)),n[1]=a.toGlobalCoord(a.dataToCoord(i,e)),n},e.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,r=this.getAxis("y").scale,i=n.getExtent(),o=r.getExtent(),a=n.parse(t[0]),s=r.parse(t[1]);return e=e||[],e[0]=Math.min(Math.max(Math.min(i[0],i[1]),a),Math.max(i[0],i[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),e},e.prototype.pointToData=function(t,e){var n=[];if(this._invTransform)return qt(n,t,this._invTransform);var r=this.getAxis("x"),i=this.getAxis("y");return n[0]=r.coordToData(r.toLocalCoord(t[0]),e),n[1]=i.coordToData(i.toLocalCoord(t[1]),e),n},e.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},e.prototype.getArea=function(){var t=this.getAxis("x").getGlobalExtent(),e=this.getAxis("y").getGlobalExtent(),n=Math.min(t[0],t[1]),r=Math.min(e[0],e[1]),i=Math.max(t[0],t[1])-n,o=Math.max(e[0],e[1])-r;return new di(n,r,i,o)},e}(cI),dI=fI,pI=function(t){function e(e,n,r,i,o){var a=t.call(this,e,n,r)||this;return a.index=0,a.type=i||"value",a.position=o||"bottom",a}return xt(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},e.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(fj),gI=pI,vI=Math.log;function yI(t,e,n){var r=Ow.prototype,i=r.getTicks.call(n),o=r.getTicks.call(n,!0),a=i.length-1,s=r.getInterval.call(n),l=dS(t,e),c=l.extent,u=l.fixMin,h=l.fixMax;if("log"===t.type){var f=vI(t.base);c=[vI(c[0])/f,vI(c[1])/f]}t.setExtent(c[0],c[1]),t.calcNiceExtent({splitNumber:a,fixMin:u,fixMax:h});var d=r.getExtent.call(t);u&&(c[0]=d[0]),h&&(c[1]=d[1]);var p=r.getInterval.call(t),g=c[0],v=c[1];if(u&&h)p=(v-g)/a;else if(u){v=c[0]+p*a;while(vc[0]&&isFinite(g)&&isFinite(c[0]))p=hw(p),g=c[1]-p*a}else{var y=t.getTicks().length-1;y>a&&(p=hw(p));var m=p*a;v=Math.ceil(c[1]/p)*p,g=ro(v-m),g<0&&c[0]>=0?(g=0,v=ro(m)):v>0&&c[1]<=0&&(v=0,g=-ro(m))}var b=(i[0].value-o[0].value)/s,_=(i[a].value-o[a].value)/s;r.setExtent.call(t,g+p*b,v+p*_),r.setInterval.call(t,p),(b||_)&&r.setNiceExtent.call(t,g+p,v-p)}var mI=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=uI,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;function r(t){var e,n=Object(wt["keys"])(t),r=n.length;if(r){for(var i=[],o=r-1;o>=0;o--){var a=+n[o],s=t[a],l=s.model,c=s.scale;cw(c)&&l.get("alignTicks")&&null==l.get("interval")?i.push(s):(gS(c,l),cw(c)&&(e=s))}i.length&&(e||(e=i.pop(),gS(e.scale,e.model)),Object(wt["each"])(i,(function(t){yI(t.scale,t.model,e.scale)})))}}this._updateScale(t,this.model),r(n.x),r(n.y);var i={};Object(wt["each"])(n.x,(function(t){_I(n,"y",t,i)})),Object(wt["each"])(n.y,(function(t){_I(n,"x",t,i)})),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var r=t.getBoxLayoutParams(),i=!n&&t.get("containLabel"),o=of(r,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;function s(){Object(wt["each"])(a,(function(t){var e=t.isHorizontal(),n=e?[0,o.width]:[0,o.height],r=t.inverse?1:0;t.setExtent(n[r],n[1-r]),OI(t,e?o.x:o.y)}))}s(),i&&(Object(wt["each"])(a,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=_S(t);if(e){var n=t.isHorizontal()?"height":"width",r=t.model.get(["axisLabel","margin"]);o[n]-=e[n]+r,"top"===t.position?o.y+=e.height+r:"left"===t.position&&(o.x+=e.width+r)}}})),s()),Object(wt["each"])(this._coordsList,(function(t){t.calcAffineTransform()}))},t.prototype.getAxis=function(t,e){var n=this._axesMap[t];if(null!=n)return n[e||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}Object(wt["isObject"])(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var r=0,i=this._coordsList;r":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},VI=function(){function t(t){var e=this._condVal=Object(wt["isString"])(t)?new RegExp(t):Object(wt["isRegExp"])(t)?t:null;if(null==e){var n="";0,Uf(n)}}return t.prototype.evaluate=function(t){var e=typeof t;return Object(wt["isString"])(e)?this._condVal.test(t):!!Object(wt["isNumber"])(e)&&this._condVal.test(t+"")},t}(),HI=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),GI=function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(df),oD=iD;function aD(t,e){var n=Fh(e.get("padding")),r=e.getItemStyle(["color","opacity"]);return r.fill=e.get("backgroundColor"),t=new Ol({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:r,silent:!0,z2:-1}),t}var sD=wt["curry"],lD=wt["each"],cD=Fi,uD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.newlineDisabled=!1,n}return xt(e,t),e.prototype.init=function(){this.group.add(this._contentGroup=new cD),this.group.add(this._selectorGroup=new cD),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,e,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var i=t.get("align"),o=t.get("orient");i&&"auto"!==i||(i="right"===t.get("left")&&"vertical"===o?"right":"left");var a=t.get("selector",!0),s=t.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(i,t,e,n,a,o,s);var l=t.getBoxLayoutParams(),c={width:n.getWidth(),height:n.getHeight()},u=t.get("padding"),h=of(l,c,u),f=this.layoutInner(t,i,h,r,a,s),d=of(wt["defaults"]({width:f.width,height:f.height},l),c,u);this.group.x=d.x-f.x,this.group.y=d.y-f.y,this.group.markRedraw(),this.group.add(this._backgroundEl=aD(f,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,e,n,r,i,o,a){var s=this.getContentGroup(),l=wt["createHashMap"](),c=e.get("selectedMode"),u=[];n.eachRawSeries((function(t){!t.get("legendHoverLink")&&u.push(t.id)})),lD(e.getData(),(function(i,o){var a=i.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var h=new cD;return h.newline=!0,void s.add(h)}var f=n.getSeriesByName(a)[0];if(!l.get(a)){if(f){var d=f.getData(),p=d.getVisual("legendLineStyle")||{},g=d.getVisual("legendIcon"),v=d.getVisual("style"),y=this._createItem(f,a,o,i,e,t,p,v,g,c);y.on("click",sD(dD,a,null,r,u)).on("mouseover",sD(gD,f.name,null,r,u)).on("mouseout",sD(vD,f.name,null,r,u)),l.set(a,!0)}else n.eachRawSeries((function(n){if(!l.get(a)&&n.legendVisualProvider){var s=n.legendVisualProvider;if(!s.containName(a))return;var h=s.indexOfName(a),f=s.getItemVisual(h,"style"),d=s.getItemVisual(h,"legendIcon"),p=Object(Nn["parse"])(f.fill);p&&0===p[3]&&(p[3]=.2,f=wt["extend"](wt["extend"]({},f),{fill:Object(Nn["stringify"])(p,"rgba")}));var g=this._createItem(n,a,o,i,e,t,{},f,d,c);g.on("click",sD(dD,null,a,r,u)).on("mouseover",sD(gD,null,a,r,u)).on("mouseout",sD(vD,null,a,r,u)),l.set(a,!0)}}),this);0}}),this),i&&this._createSelector(i,e,r,o,a)},e.prototype._createSelector=function(t,e,n,r,i){var o=this.getSelectorGroup();lD(t,(function(t){var r=t.type,i=new Fl({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===r?"legendAllSelect":"legendInverseSelect"})}});o.add(i);var a=e.getModel("selectorLabel"),s=e.getModel(["emphasis","selectorLabel"]);vu(i,{normal:a,emphasis:s},{defaultText:t.title}),Gc(i)}))},e.prototype._createItem=function(t,e,n,r,i,o,a,s,l,c){var u=t.visualDrawType,h=i.get("itemWidth"),f=i.get("itemHeight"),d=i.isSelected(e),p=r.get("symbolRotate"),g=r.get("symbolKeepAspect"),v=r.get("icon");l=v||l||"roundRect";var y=hD(l,r,a,s,u,d),m=new cD,b=r.getModel("textStyle");if(!wt["isFunction"](t.getLegendIcon)||v&&"inherit"!==v){var _="inherit"===v&&t.getData().getVisual("symbol")?"inherit"===p?t.getData().getVisual("symbolRotate"):p:0;m.add(fD({itemWidth:h,itemHeight:f,icon:l,iconRotate:_,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:g}))}else m.add(t.getLegendIcon({itemWidth:h,itemHeight:f,icon:l,iconRotate:p,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:g}));var x="left"===o?h+5:-5,O=o,w=i.get("formatter"),S=e;wt["isString"](w)&&w?S=w.replace("{name}",null!=e?e:""):wt["isFunction"](w)&&(S=w(e));var j=r.get("inactiveColor");m.add(new Fl({style:mu(b,{text:S,x:x,y:f/2,fill:d?b.getTextColor():j,align:O,verticalAlign:"middle"})}));var C=new Ol({shape:m.getBoundingRect(),invisible:!0}),T=r.getModel("tooltip");return T.get("show")&&qy({el:C,componentModel:i,itemName:e,itemTooltipOption:T.option}),m.add(C),m.eachChild((function(t){t.silent=!0})),C.silent=!c,this.getContentGroup().add(m),Gc(m),m.__legendDataIndex=n,m},e.prototype.layoutInner=function(t,e,n,r,i,o){var a=this.getContentGroup(),s=this.getSelectorGroup();rf(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),c=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),i){rf("horizontal",s,t.get("selectorItemGap",!0));var u=s.getBoundingRect(),h=[-u.x,-u.y],f=t.get("selectorButtonGap",!0),d=t.getOrient().index,p=0===d?"width":"height",g=0===d?"height":"width",v=0===d?"y":"x";"end"===o?h[d]+=l[p]+f:c[d]+=u[p]+f,h[1-d]+=l[g]/2-u[g]/2,s.x=h[0],s.y=h[1],a.x=c[0],a.y=c[1];var y={x:0,y:0};return y[p]=l[p]+f+u[p],y[g]=Math.max(l[g],u[g]),y[v]=Math.min(0,u[v]+h[1-d]),y}return a.x=c[0],a.y=c[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(Bg);function hD(t,e,n,r,i,o){function a(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),lD(t,(function(n,r){"inherit"===t[r]&&(t[r]=e[r])}))}var s=e.getModel("itemStyle"),l=s.getItemStyle(),c=0===t.lastIndexOf("empty",0)?"fill":"stroke";l.decal=r.decal,"inherit"===l.fill&&(l.fill=r[i]),"inherit"===l.stroke&&(l.stroke=r[c]),"inherit"===l.opacity&&(l.opacity=("fill"===i?r:n).opacity),a(l,r);var u=e.getModel("lineStyle"),h=u.getLineStyle();if(a(h,n),"auto"===l.fill&&(l.fill=r.fill),"auto"===l.stroke&&(l.stroke=r.fill),"auto"===h.stroke&&(h.stroke=r.fill),!o){var f=e.get("inactiveBorderWidth"),d=l[c];l.lineWidth="auto"===f?r.lineWidth>0&&d?2:0:l.lineWidth,l.fill=e.get("inactiveColor"),l.stroke=e.get("inactiveBorderColor"),h.stroke=u.get("inactiveColor"),h.lineWidth=u.get("inactiveWidth")}return{itemStyle:l,lineStyle:h}}function fD(t){var e=t.icon||"roundRect",n=vb(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);return n.setStyle(t.itemStyle),n.rotation=(t.iconRotate||0)*Math.PI/180,n.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n}function dD(t,e,n,r){vD(t,e,n,r),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),gD(t,e,n,r)}function pD(t){var e,n=t.getZr().storage.getDisplayList(),r=0,i=n.length;while(rn[i],p=[-h.x,-h.y];e||(p[r]=l[s]);var g=[0,0],v=[-f.x,-f.y],y=wt["retrieve2"](t.get("pageButtonGap",!0),t.get("itemGap",!0));if(d){var m=t.get("pageButtonPosition",!0);"end"===m?v[r]+=n[i]-f[i]:g[r]+=f[i]+y}v[1-r]+=h[o]/2-f[o]/2,l.setPosition(p),c.setPosition(g),u.setPosition(v);var b={x:0,y:0};if(b[i]=d?n[i]:h[i],b[o]=Math.max(h[o],f[o]),b[a]=Math.min(0,f[a]+v[1-r]),c.__rectSize=n[i],d){var _={x:0,y:0};_[i]=Math.max(n[i]-f[i]-y,0),_[o]=b[o],c.setClipPath(new Ol({shape:_})),c.__rectSize=_[i]}else u.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));var x=this._getPageInfo(t);return null!=x.pageIndex&&ou(l,{x:x.contentPosition[0],y:x.contentPosition[1]},d?t:null),this._updatePageInfoView(t,x),b},e.prototype._pageGo=function(t,e,n){var r=this._getPageInfo(e)[t];null!=r&&n.dispatchAction({type:"legendScroll",scrollDataIndex:r,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;wt["each"](["pagePrev","pageNext"],(function(r){var i=r+"DataIndex",o=null!=e[i],a=n.childOfName(r);a&&(a.setStyle("fill",o?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),a.cursor=o?"pointer":"default")}));var r=n.childOfName("pageText"),i=t.get("pageFormatter"),o=e.pageIndex,a=null!=o?o+1:0,s=e.pageCount;r&&i&&r.setStyle("text",wt["isString"](i)?i.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):i({current:a,total:s}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=t.getOrient().index,o=CD[i],a=TD[i],s=this._findTargetItemIndex(e),l=n.children(),c=l[s],u=l.length,h=u?1:0,f={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return f;var d=m(c);f.contentPosition[i]=-d.s;for(var p=s+1,g=d,v=d,y=null;p<=u;++p)y=m(l[p]),(!y&&v.e>g.s+r||y&&!b(y,g.s))&&(g=v.i>g.i?v:y,g&&(null==f.pageNextDataIndex&&(f.pageNextDataIndex=g.i),++f.pageCount)),v=y;for(p=s-1,g=d,v=d,y=null;p>=-1;--p)y=m(l[p]),y&&b(v,y.s)||!(g.i=e&&t.s<=e+r}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var e,n,r=this.getContentGroup();return r.eachChild((function(r,i){var o=r.__legendDataIndex;null==n&&null!=o&&(n=i),o===t&&(e=i)})),null!=e?e:n},e.type="legend.scroll",e}(yD),kD=MD;function ID(t){t.registerAction("legendScroll","legendscroll",(function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(n)}))}))}function DD(t){rO(xD),t.registerComponentModel(SD),t.registerComponentView(kD),ID(t)}function AD(t){rO(xD),rO(DD)}var PD=Ps.CMD;function LD(t,e){return Math.abs(t-e)<1e-5}function ND(t){var e,n,r,i,o,a=t.data,s=t.len(),l=[],c=0,u=0,h=0,f=0;function d(t,n){e&&e.length>2&&l.push(e),e=[t,n]}function p(t,n,r,i){LD(t,r)&&LD(n,i)||e.push(t,n,r,i,r,i)}function g(t,n,r,i,o,a){var s=Math.abs(n-t),l=4*Math.tan(s/4)/3,c=nS:T2&&l.push(e),l}function ED(t,e,n,r,i,o,a,s,l,c){if(LD(t,n)&&LD(e,r)&&LD(i,a)&&LD(o,s))l.push(a,s);else{var u=2/c,h=u*u,f=a-t,d=s-e,p=Math.sqrt(f*f+d*d);f/=p,d/=p;var g=n-t,v=r-e,y=i-a,m=o-s,b=g*g+v*v,_=y*y+m*m;if(b=0&&S=0)l.push(a,s);else{var j=[],C=[];xn(t,n,i,a,.5,j),xn(e,r,o,s,.5,C),ED(j[0],C[0],j[1],C[1],j[2],C[2],j[3],C[3],l,c),ED(j[4],C[4],j[5],C[5],j[6],C[6],j[7],C[7],l,c)}}}}function RD(t,e){var n=ND(t),r=[];e=e||1;for(var i=0;i0)for(c=0;cMath.abs(c),h=BD([l,c],u?0:1,e),f=(u?s:c)/h.length,d=0;di,a=BD([r,i],o?0:1,e),s=o?"width":"height",l=o?"height":"width",c=o?"x":"y",u=o?"y":"x",h=t[s]/a.length,f=0;f1?null:new ri(g*l+t,g*c+e)}function GD(t,e,n){var r=new ri;ri.sub(r,n,e),r.normalize();var i=new ri;ri.sub(i,t,e);var o=i.dot(r);return o}function WD(t,e){var n=t[t.length-1];n&&n[0]===e[0]&&n[1]===e[1]||t.push(e)}function UD(t,e,n){for(var r=t.length,i=[],o=0;o