@@ 9-9 (lines=1) @@ | ||
6 | },touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&s.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment<V.touchClickDelay&&(this._mobildFindFixed(e),this._clickHandler(e),t-this._lastClickMoment<V.touchClickDelay/2&&(this._dblclickHandler(e),this._lastHover&&this._lastHover.clickable&&s.stop(e)),this._lastClickMoment=t),this.painter.clearHover()}},c=function(e,t,o){U.call(this),this.root=e,this.storage=t,this.painter=o,this._lastX=this._lastY=this._mouseX=this._mouseY=0,this._findHover=n(a,this),this._domHover=o.getDomHover(),i(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),r.os.tablet||r.os.phone?(e.addEventListener("touchstart",this._touchstartHandler),e.addEventListener("touchmove",this._touchmoveHandler),e.addEventListener("touchend",this._touchendHandler)):(e.addEventListener("click",this._clickHandler),e.addEventListener("dblclick",this._dblclickHandler),e.addEventListener("mousewheel",this._mousewheelHandler),e.addEventListener("mousemove",this._mousemoveHandler),e.addEventListener("mousedown",this._mousedownHandler),e.addEventListener("mouseup",this._mouseupHandler)),e.addEventListener("DOMMouseScroll",this._mousewheelHandler),e.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),e.attachEvent("onclick",this._clickHandler),e.ondblclick=this._dblclickHandler,e.attachEvent("onmousewheel",this._mousewheelHandler),e.attachEvent("onmousemove",this._mousemoveHandler),e.attachEvent("onmouseout",this._mouseoutHandler),e.attachEvent("onmousedown",this._mousedownHandler),e.attachEvent("onmouseup",this._mouseupHandler))};c.prototype.on=function(e,t){return this.bind(e,t),this},c.prototype.un=function(e,t){return this.unbind(e,t),this},c.prototype.trigger=function(e,t){switch(e){case V.RESIZE:case V.CLICK:case V.DBLCLICK:case V.MOUSEWHEEL:case V.MOUSEMOVE:case V.MOUSEDOWN:case V.MOUSEUP:case V.MOUSEOUT:this["_"+e+"Handler"](t)}},c.prototype.dispose=function(){var e=this.root;window.removeEventListener?(window.removeEventListener("resize",this._resizeHandler),r.os.tablet||r.os.phone?(e.removeEventListener("touchstart",this._touchstartHandler),e.removeEventListener("touchmove",this._touchmoveHandler),e.removeEventListener("touchend",this._touchendHandler)):(e.removeEventListener("click",this._clickHandler),e.removeEventListener("dblclick",this._dblclickHandler),e.removeEventListener("mousewheel",this._mousewheelHandler),e.removeEventListener("mousemove",this._mousemoveHandler),e.removeEventListener("mousedown",this._mousedownHandler),e.removeEventListener("mouseup",this._mouseupHandler)),e.removeEventListener("DOMMouseScroll",this._mousewheelHandler),e.removeEventListener("mouseout",this._mouseoutHandler)):(window.detachEvent("onresize",this._resizeHandler),e.detachEvent("onclick",this._clickHandler),e.detachEvent("dblclick",this._dblclickHandler),e.detachEvent("onmousewheel",this._mousewheelHandler),e.detachEvent("onmousemove",this._mousemoveHandler),e.detachEvent("onmouseout",this._mouseoutHandler),e.detachEvent("onmousedown",this._mousedownHandler),e.detachEvent("onmouseup",this._mouseupHandler)),this.root=this._domHover=this.storage=this.painter=null,this.un()},c.prototype._processDragStart=function(e){var t=this._lastHover;if(this._isMouseDown&&t&&t.draggable&&!this._draggingTarget&&this._mouseDownTarget==t){if(t.dragEnableTime&&new Date-this._lastMouseDownMoment<t.dragEnableTime)return;var n=t;this._draggingTarget=n,this._isDragging=1,n.invisible=!0,this.storage.mod(n.id),this._dispatchAgency(n,V.DRAGSTART,e),this.painter.refresh()}},c.prototype._processDragEnter=function(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,V.DRAGENTER,e,this._draggingTarget)},c.prototype._processDragOver=function(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,V.DRAGOVER,e,this._draggingTarget)},c.prototype._processDragLeave=function(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,V.DRAGLEAVE,e,this._draggingTarget)},c.prototype._processDrop=function(e){this._draggingTarget&&(this._draggingTarget.invisible=!1,this.storage.mod(this._draggingTarget.id),this.painter.refresh(),this._dispatchAgency(this._lastHover,V.DROP,e,this._draggingTarget))},c.prototype._processDragEnd=function(e){this._draggingTarget&&(this._dispatchAgency(this._draggingTarget,V.DRAGEND,e),this._lastHover=null),this._isDragging=0,this._draggingTarget=null},c.prototype._processOverShape=function(e){this._dispatchAgency(this._lastHover,V.MOUSEOVER,e)},c.prototype._processOutShape=function(e){this._dispatchAgency(this._lastHover,V.MOUSEOUT,e)},c.prototype._dispatchAgency=function(e,t,n,i){var a="on"+t,o={type:t,event:n,target:e,cancelBubble:!1},r=e;for(i&&(o.dragged=i);r&&(r[a]&&(o.cancelBubble=r[a](o)),r.dispatch(t,o),r=r.parent,!o.cancelBubble););e?o.cancelBubble||this.dispatch(t,o):i||this.dispatch(t,{type:t,event:n})},c.prototype._iterateAndFindHover=function(){var e=m.create();return function(){for(var t,n,i=this.storage.getShapeList(),a=[0,0],o=i.length-1;o>=0;o--){var r=i[o];if(t!==r.zlevel&&(n=this.painter.getLayer(r.zlevel,n),a[0]=this._mouseX,a[1]=this._mouseY,n.needTransform&&(m.invert(e,n.transform),h.applyTransform(a,a,e))),this._findHover(r,a[0],a[1]))break}}}();var u=[{x:10},{x:-20},{x:10,y:10},{y:-20}];return c.prototype._mobildFindFixed=function(e){this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var t=0;!this._lastHover&&t<u.length;t++){var n=u[t];n.x&&(this._mouseX+=n.x),n.y&&(this._mouseX+=n.y),this._iterateAndFindHover()}this._lastHover&&(e.zrenderX=this._mouseX,e.zrenderY=this._mouseY)},c.prototype._zrenderEventFixed=function(e,t){if(e.zrenderFixed)return e;if(t){var n="touchend"!=e.type?e.targetTouches[0]:e.changedTouches[0];if(n){var i=this.root.getBoundingClientRect();e.zrenderX=n.clientX-i.left,e.zrenderY=n.clientY-i.top}}else{e=e||window.event;var a=e.toElement||e.relatedTarget||e.srcElement||e.target;a&&a!=this._domHover&&(e.zrenderX=("undefined"!=typeof e.offsetX?e.offsetX:e.layerX)+a.offsetLeft,e.zrenderY=("undefined"!=typeof e.offsetY?e.offsetY:e.layerY)+a.offsetTop)}return e.zrenderFixed=1,e},l.merge(c.prototype,U.prototype,!0),c}),n("zrender/Painter",["require","./config","./tool/util","./tool/log","./tool/matrix","./loadingEffect/Base","./mixin/Transformable","./shape/Image"],function(e){"use strict";function t(){return!1}function n(){}function i(e,t,n){var i=document.createElement(t),a=n._width,o=n._height;return i.style.position="absolute",i.style.left=0,i.style.top=0,i.style.width=a+"px",i.style.height=o+"px",i.setAttribute("width",a*m),i.setAttribute("height",o*m),i.setAttribute("data-zr-dom-id",e),i}var a=e("./config"),o=e("./tool/util"),r=e("./tool/log"),s=e("./tool/matrix"),l=e("./loadingEffect/Base"),h=e("./mixin/Transformable"),m=window.devicePixelRatio||1;m=Math.max(m,1);var V=window.G_vmlCanvasManager,U=function(e,n){this.root=e,this.storage=n,e.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var a=document.createElement("div");this._domRoot=a,a.style.position="relative",a.style.overflow="hidden",a.style.width=this._width+"px",a.style.height=this._height+"px",e.appendChild(a),this._layers={},this._zlevelList=[],this._layerConfig={},this._loadingEffect=new l({}),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=i("bg","div",this),a.appendChild(this._bgDom),this._bgDom.onselectstart=t,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none",this._bgDom.style["-webkit-touch-callout"]="none";var o=new d("_zrender_hover_",this);this._layers.hover=o,a.appendChild(o.dom),o.initContext(),o.dom.onselectstart=t,o.dom.style["-webkit-user-select"]="none",o.dom.style["user-select"]="none",o.dom.style["-webkit-touch-callout"]="none",this.refreshNextFrame=null};U.prototype.render=function(e){return this.isLoading()&&this.hideLoading(),this.refresh(e,!0),this},U.prototype.refresh=function(e,t){var n=this.storage.getShapeList(!0);return this._paintList(n,t),"function"==typeof e&&e(),this},U.prototype._paintList=function(e,t){"undefined"==typeof t&&(t=!1),this._updateLayerStatus(e);var n,i,o;for(var l in this._layers)"hover"!==l&&(this._layers[l].unusedCount++,this._layers[l].updateTransform());for(var h=[],m=0,U=e.length;U>m;m++){var d=e[m];if(i!==d.zlevel&&(n&&(n.needTransform&&o.restore(),o.flush&&o.flush()),n=this.getLayer(d.zlevel),o=n.ctx,i=d.zlevel,n.unusedCount=0,(n.dirty||t)&&n.clear(),n.needTransform&&(o.save(),n.setTransform(o))),d.__startClip&&!V){var p=d.__startClip;if(o.save(),p.needTransform){var c=p.transform;s.invert(h,c),o.transform(c[0],c[1],c[2],c[3],c[4],c[5])}if(o.beginPath(),p.buildPath(o,p.style),o.clip(),p.needTransform){var c=h;o.transform(c[0],c[1],c[2],c[3],c[4],c[5])}}if((n.dirty||t)&&!d.invisible&&(!d.onbrush||d.onbrush&&!d.onbrush(o,!1)))if(a.catchBrushException)try{d.brush(o,!1,this.refreshNextFrame)}catch(u){r(u,"brush error of "+d.type,d)}else d.brush(o,!1,this.refreshNextFrame);d.__stopClip&&!V&&o.restore(),d.__dirty=!1}n&&(n.needTransform&&o.restore(),o.flush&&o.flush());for(var l in this._layers)if("hover"!==l){var y=this._layers[l];y.dirty=!1,1==y.unusedCount&&y.clear()}},U.prototype.getLayer=function(e){var t=this._layers[e];if(!t){var n=this._zlevelList.length,i=null,a=-1;if(n>0&&e>this._zlevelList[0]){for(a=0;n-1>a&&!(this._zlevelList[a]<e&&this._zlevelList[a+1]>e);a++);i=this._layers[this._zlevelList[a]]}this._zlevelList.splice(a+1,0,e),t=new d(e,this);var r=i?i.dom:this._bgDom;r.nextSibling?r.parentNode.insertBefore(t.dom,r.nextSibling):r.parentNode.appendChild(t.dom),t.initContext(),this._layers[e]=t,this._layerConfig[e]&&o.merge(t,this._layerConfig[e],!0),t.updateTransform()}return t},U.prototype.getLayers=function(){return this._layers},U.prototype._updateLayerStatus=function(e){var t=this._layers,n={};for(var i in t)"hover"!==i&&(n[i]=t[i].elCount,t[i].elCount=0);for(var a=0,o=e.length;o>a;a++){var r=e[a],s=r.zlevel,l=t[s];if(l){if(l.elCount++,l.dirty)continue;l.dirty=r.__dirty}}for(var i in t)"hover"!==i&&n[i]!==t[i].elCount&&(t[i].dirty=!0)},U.prototype.refreshShapes=function(e,t){for(var n=0,i=e.length;i>n;n++){var a=e[n];a.modSelf()}return this.refresh(t),this},U.prototype.setLoadingEffect=function(e){return this._loadingEffect=e,this},U.prototype.clear=function(){for(var e in this._layers)"hover"!=e&&this._layers[e].clear();return this},U.prototype.modLayer=function(e,t){if(t){this._layerConfig[e]?o.merge(this._layerConfig[e],t,!0):this._layerConfig[e]=t;var n=this._layers[e];n&&o.merge(n,this._layerConfig[e],!0)}},U.prototype.delLayer=function(e){var t=this._layers[e];t&&(this.modLayer(e,{position:t.position,rotation:t.rotation,scale:t.scale}),t.dom.parentNode.removeChild(t.dom),delete this._layers[e],this._zlevelList.splice(o.indexOf(this._zlevelList,e),1))},U.prototype.refreshHover=function(){this.clearHover();for(var e=this.storage.getHoverShapes(!0),t=0,n=e.length;n>t;t++)this._brushHover(e[t]);var i=this._layers.hover.ctx;return i.flush&&i.flush(),this.storage.delHover(),this},U.prototype.clearHover=function(){var e=this._layers.hover;return e&&e.clear(),this},U.prototype.showLoading=function(e){return this._loadingEffect&&this._loadingEffect.stop(),e&&this.setLoadingEffect(e),this._loadingEffect.start(this),this.loading=!0,this},U.prototype.hideLoading=function(){return this._loadingEffect.stop(),this.clearHover(),this.loading=!1,this},U.prototype.isLoading=function(){return this.loading},U.prototype.resize=function(){var e=this._domRoot;e.style.display="none";var t=this._getWidth(),n=this._getHeight();if(e.style.display="",this._width!=t||n!=this._height){this._width=t,this._height=n,e.style.width=t+"px",e.style.height=n+"px";for(var i in this._layers)this._layers[i].resize(t,n);this.refresh(null,!0)}return this},U.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},U.prototype.dispose=function(){this.isLoading()&&this.hideLoading(),this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},U.prototype.getDomHover=function(){return this._layers.hover.dom},U.prototype.toDataURL=function(e,t,n){if(V)return null;var o=i("image","canvas",this);this._bgDom.appendChild(o);var s=o.getContext("2d");1!=m&&s.scale(m,m),s.fillStyle=t||"#fff",s.rect(0,0,this._width*m,this._height*m),s.fill();var l=this;this.storage.iterShape(function(e){if(!e.invisible&&(!e.onbrush||e.onbrush&&!e.onbrush(s,!1)))if(a.catchBrushException)try{e.brush(s,!1,l.refreshNextFrame)}catch(t){r(t,"brush error of "+e.type,e)}else e.brush(s,!1,l.refreshNextFrame)},{normal:"up",update:!0});var h=o.toDataURL(e,n);return s=null,this._bgDom.removeChild(o),h},U.prototype.getWidth=function(){return this._width},U.prototype.getHeight=function(){return this._height},U.prototype._getWidth=function(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientWidth||parseInt(t.width,10))-parseInt(t.paddingLeft,10)-parseInt(t.paddingRight,10)).toFixed(0)-0},U.prototype._getHeight=function(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientHeight||parseInt(t.height,10))-parseInt(t.paddingTop,10)-parseInt(t.paddingBottom,10)).toFixed(0)-0},U.prototype._brushHover=function(e){var t=this._layers.hover.ctx;if(!e.onbrush||e.onbrush&&!e.onbrush(t,!0)){var n=this.getLayer(e.zlevel);if(n.needTransform&&(t.save(),n.setTransform(t)),a.catchBrushException)try{e.brush(t,!0,this.refreshNextFrame)}catch(i){r(i,"hoverBrush error of "+e.type,e)}else e.brush(t,!0,this.refreshNextFrame);n.needTransform&&t.restore()}},U.prototype._shapeToImage=function(t,n,i,a,o){var r=document.createElement("canvas"),s=r.getContext("2d"),o=window.devicePixelRatio||1;r.style.width=i+"px",r.style.height=a+"px",r.setAttribute("width",i*o),r.setAttribute("height",a*o),s.clearRect(0,0,i*o,a*o);var l={position:n.position,rotation:n.rotation,scale:n.scale};n.position=[0,0,0],n.rotation=0,n.scale=[1,1],n&&n.brush(s,!1);var h=e("./shape/Image"),m=new h({id:t,style:{x:0,y:0,image:r}});return null!=l.position&&(m.position=n.position=l.position),null!=l.rotation&&(m.rotation=n.rotation=l.rotation),null!=l.scale&&(m.scale=n.scale=l.scale),m},U.prototype._createShapeToImageProcessor=function(){if(V)return n;var e=this;return function(t,n,i,a){return e._shapeToImage(t,n,i,a,m)}};var d=function(e,n){this.dom=i(e,"canvas",n),this.dom.onselectstart=t,this.dom.style["-webkit-user-select"]="none",this.dom.style["user-select"]="none",this.dom.style["-webkit-touch-callout"]="none",V&&V.initElement(this.dom),this.domBack=null,this.ctxBack=null,this.painter=n,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.zoomable=!1,this.panable=!1,this.maxZoom=1/0,this.minZoom=0,h.call(this)};return d.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),1!=m&&this.ctx.scale(m,m)},d.prototype.createBackBuffer=function(){V||(this.domBack=i("back-"+this.id,"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d"),1!=m&&this.ctxBack.scale(m,m))},d.prototype.resize=function(e,t){this.dom.style.width=e+"px",this.dom.style.height=t+"px",this.dom.setAttribute("width",e*m),this.dom.setAttribute("height",t*m),1!=m&&this.ctx.scale(m,m),this.domBack&&(this.domBack.setAttribute("width",e*m),this.domBack.setAttribute("height",t*m),1!=m&&this.ctxBack.scale(m,m))},d.prototype.clear=function(){var e=this.dom,t=this.ctx,n=e.width,i=e.height,a=this.clearColor&&!V,o=this.motionBlur&&!V,r=this.lastFrameAlpha;if(o&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(e,0,0,n/m,i/m)),a?(t.save(),t.fillStyle=this.config.clearColor,t.fillRect(0,0,n/m,i/m),t.restore()):t.clearRect(0,0,n/m,i/m),o){var s=this.domBack;t.save(),t.globalAlpha=r,t.drawImage(s,0,0,n/m,i/m),t.restore()}},o.merge(d.prototype,h.prototype),U}),n("zrender/Storage",["require","./tool/util","./Group"],function(e){"use strict";function t(e,t){return e.zlevel==t.zlevel?e.z==t.z?e.__renderidx-t.__renderidx:e.z-t.z:e.zlevel-t.zlevel}var n=e("./tool/util"),i=e("./Group"),a={hover:!1,normal:"down",update:!1},o=function(){this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],this._shapeListOffset=0};return o.prototype.iterShape=function(e,t){if(t||(t=a),t.hover)for(var n=0,i=this._hoverElements.length;i>n;n++){var o=this._hoverElements[n];if(o.updateTransform(),e(o))return this}switch(t.update&&this.updateShapeList(),t.normal){case"down":for(var i=this._shapeList.length;i--;)if(e(this._shapeList[i]))return this;break;default:for(var n=0,i=this._shapeList.length;i>n;n++)if(e(this._shapeList[n]))return this}return this},o.prototype.getHoverShapes=function(e){for(var n=[],i=0,a=this._hoverElements.length;a>i;i++){n.push(this._hoverElements[i]);var o=this._hoverElements[i].hoverConnect;if(o){var r;o=o instanceof Array?o:[o];for(var s=0,l=o.length;l>s;s++)r=o[s].id?o[s]:this.get(o[s]),r&&n.push(r)}}if(n.sort(t),e)for(var i=0,a=n.length;a>i;i++)n[i].updateTransform();return n},o.prototype.getShapeList=function(e){return e&&this.updateShapeList(),this._shapeList},o.prototype.updateShapeList=function(){this._shapeListOffset=0;for(var e=0,n=this._roots.length;n>e;e++){var i=this._roots[e];this._updateAndAddShape(i)}this._shapeList.length=this._shapeListOffset;for(var e=0,n=this._shapeList.length;n>e;e++)this._shapeList[e].__renderidx=e;this._shapeList.sort(t)},o.prototype._updateAndAddShape=function(e,t){if(!e.ignore)if(e.updateTransform(),"group"==e.type){e.clipShape&&(e.clipShape.parent=e,e.clipShape.updateTransform(),t?(t=t.slice(),t.push(e.clipShape)):t=[e.clipShape]);for(var n=0;n<e._children.length;n++){var i=e._children[n];i.__dirty=e.__dirty||i.__dirty,this._updateAndAddShape(i,t)}e.__dirty=!1}else e.__clipShapes=t,this._shapeList[this._shapeListOffset++]=e},o.prototype.mod=function(e,t){var i=this._elements[e];if(i&&(i.modSelf(),t))if(t.parent||t._storage||t.__startClip){var a={};for(var o in t)"parent"!=o&&"_storage"!=o&&"__startClip"!=o&&t.hasOwnProperty(o)&&(a[o]=t[o]);n.merge(i,a,!0)}else n.merge(i,t,!0);return this},o.prototype.drift=function(e,t,n){var i=this._elements[e];return i&&(i.needTransform=!0,"horizontal"===i.draggable?n=0:"vertical"===i.draggable&&(t=0),(!i.ondrift||i.ondrift&&!i.ondrift(t,n))&&i.drift(t,n)),this},o.prototype.addHover=function(e){return e.updateNeedTransform(),this._hoverElements.push(e),this},o.prototype.delHover=function(){return this._hoverElements=[],this},o.prototype.hasHoverShape=function(){return this._hoverElements.length>0},o.prototype.addRoot=function(e){e instanceof i&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},o.prototype.delRoot=function(e){if("undefined"==typeof e){for(var t=0;t<this._roots.length;t++){var a=this._roots[t];a instanceof i&&a.delChildrenFromStorage(this)}return this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],void(this._shapeListOffset=0)}if(e instanceof Array)for(var t=0,o=e.length;o>t;t++)this.delRoot(e[t]);else{var r;r="string"==typeof e?this._elements[e]:e;var s=n.indexOf(this._roots,r);s>=0&&(this.delFromMap(r.id),this._roots.splice(s,1),r instanceof i&&r.delChildrenFromStorage(this))}},o.prototype.addToMap=function(e){return e instanceof i&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this},o.prototype.get=function(e){return this._elements[e]},o.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof i&&(t._storage=null)),this},o.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},o}),n("zrender/animation/Animation",["require","./Clip","../tool/color","../tool/util","../tool/event"],function(e){"use strict";function t(e,t){return e[t]}function n(e,t,n){e[t]=n}function i(e,t,n){return(t-e)*n+e}function a(e,t,n,a,o){var r=e.length;if(1==o)for(var s=0;r>s;s++)a[s]=i(e[s],t[s],n);else for(var l=e[0].length,s=0;r>s;s++)for(var h=0;l>h;h++)a[s][h]=i(e[s][h],t[s][h],n)}function o(e){switch(typeof e){case"undefined":case"string":return!1}return"undefined"!=typeof e.length}function r(e,t,n,i,a,o,r,l,h){var m=e.length;if(1==h)for(var V=0;m>V;V++)l[V]=s(e[V],t[V],n[V],i[V],a,o,r);else for(var U=e[0].length,V=0;m>V;V++)for(var d=0;U>d;d++)l[V][d]=s(e[V][d],t[V][d],n[V][d],i[V][d],a,o,r)}function s(e,t,n,i,a,o,r){var s=.5*(n-e),l=.5*(i-t);return(2*(t-n)+s+l)*r+(-3*(t-n)-2*s-l)*o+s*a+t}function l(e){if(o(e)){var t=e.length;if(o(e[0])){for(var n=[],i=0;t>i;i++)n.push(c.call(e[i]));return n}return c.call(e)}return e}function h(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}var m=e("./Clip"),V=e("../tool/color"),U=e("../tool/util"),d=e("../tool/event").Dispatcher,p=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},c=Array.prototype.slice,u=function(e){e=e||{},this.stage=e.stage||{},this.onframe=e.onframe||function(){},this._clips=[],this._running=!1,this._time=0,d.call(this)};u.prototype={add:function(e){this._clips.push(e)},remove:function(e){var t=U.indexOf(this._clips,e);t>=0&&this._clips.splice(t,1)},_update:function(){for(var e=(new Date).getTime(),t=e-this._time,n=this._clips,i=n.length,a=[],o=[],r=0;i>r;r++){var s=n[r],l=s.step(e);l&&(a.push(l),o.push(s))}this.stage.update&&this.stage.update();for(var r=0;i>r;)n[r]._needsRemove?(n[r]=n[i-1],n.pop(),i--):r++;i=a.length;for(var r=0;i>r;r++)o[r].fire(a[r]);this._time=e,this.onframe(t),this.dispatch("frame",t)},start:function(){function e(){t._running&&(t._update(),p(e))}var t=this;this._running=!0,this._time=(new Date).getTime(),p(e)},stop:function(){this._running=!1},clear:function(){this._clips=[]},animate:function(e,t){t=t||{};var n=new y(e,t.loop,t.getter,t.setter);return n.animation=this,n},constructor:u},U.merge(u.prototype,d.prototype,!0);var y=function(e,i,a,o){this._tracks={},this._target=e,this._loop=i||!1,this._getter=a||t,this._setter=o||n,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};return y.prototype={when:function(e,t){for(var n in t)this._tracks[n]||(this._tracks[n]=[],0!==e&&this._tracks[n].push({time:0,value:l(this._getter(this._target,n))})),this._tracks[n].push({time:parseInt(e,10),value:t[n]});return this},during:function(e){return this._onframeList.push(e),this},start:function(e){var t=this,n=this._setter,l=this._getter,U="spline"===e,d=function(){if(t._clipCount--,0===t._clipCount){t._tracks={};for(var e=t._doneList.length,n=0;e>n;n++)t._doneList[n].call(t)}},p=function(p,c){var u=p.length;if(u){var y=p[0].value,b=o(y),g=!1,k=b&&o(y[0])?2:1;p.sort(function(e,t){return e.time-t.time});var f;if(u){f=p[u-1].time;for(var _=[],x=[],L=0;u>L;L++){_.push(p[L].time/f);var W=p[L].value;"string"==typeof W&&(W=V.toArray(W),0===W.length&&(W[0]=W[1]=W[2]=0,W[3]=1),g=!0),x.push(W)}var X,L,K,w,I,v,J,C=0,S=0;if(g)var E=[0,0,0,0];var T=function(e,o){if(S>o){for(X=Math.min(C+1,u-1),L=X;L>=0&&!(_[L]<=o);L--);L=Math.min(L,u-2)}else{for(L=C;u>L&&!(_[L]>o);L++);L=Math.min(L-1,u-2)}C=L,S=o;var m=_[L+1]-_[L];if(0!==m){if(K=(o-_[L])/m,U)if(I=x[L],w=x[0===L?L:L-1],v=x[L>u-2?u-1:L+1],J=x[L>u-3?u-1:L+2],b)r(w,I,v,J,K,K*K,K*K*K,l(e,c),k);else{var V;g?(V=r(w,I,v,J,K,K*K,K*K*K,E,1),V=h(E)):V=s(w,I,v,J,K,K*K,K*K*K),n(e,c,V)}else if(b)a(x[L],x[L+1],K,l(e,c),k);else{var V;g?(a(x[L],x[L+1],K,E,1),V=h(E)):V=i(x[L],x[L+1],K),n(e,c,V)}for(L=0;L<t._onframeList.length;L++)t._onframeList[L](e,o)}},F=new m({target:t._target,life:f,loop:t._loop,delay:t._delay,onframe:T,ondestroy:d});e&&"spline"!==e&&(F.easing=e),t._clipList.push(F),t._clipCount++,t.animation.add(F)}}};for(var c in this._tracks)p(this._tracks[c],c);return this},stop:function(){for(var e=0;e<this._clipList.length;e++){var t=this._clipList[e];this.animation.remove(t)}this._clipList=[]},delay:function(e){return this._delay=e,this},done:function(e){return e&&this._doneList.push(e),this}},u}),n("zrender/tool/vector",[],function(){var e="undefined"==typeof Float32Array?Array:Float32Array,t={create:function(t,n){var i=new e(2);return i[0]=t||0,i[1]=n||0,i},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,i){return e[0]=t[0]+n[0]*i,e[1]=t[1]+n[1]*i,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},len:function(e){return Math.sqrt(this.lenSquare(e))},lenSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},div:function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var i=t.len(n);return 0===i?(e[0]=0,e[1]=0):(e[0]=n[0]/i,e[1]=n[1]/i),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},distanceSquare:function(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},lerp:function(e,t,n,i){return e[0]=t[0]+i*(n[0]-t[0]),e[1]=t[1]+i*(n[1]-t[1]),e},applyTransform:function(e,t,n){var i=t[0],a=t[1];return e[0]=n[0]*i+n[2]*a+n[4],e[1]=n[1]*i+n[3]*a+n[5],e},min:function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},max:function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}};return t.length=t.len,t.lengthSquare=t.lenSquare,t.dist=t.distance,t.distSquare=t.distanceSquare,t}),n("zrender/tool/matrix",[],function(){var e="undefined"==typeof Float32Array?Array:Float32Array,t={create:function(){var n=new e(6);return t.identity(n),n},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},mul:function(e,t,n){return e[0]=t[0]*n[0]+t[2]*n[1],e[1]=t[1]*n[0]+t[3]*n[1],e[2]=t[0]*n[2]+t[2]*n[3],e[3]=t[1]*n[2]+t[3]*n[3],e[4]=t[0]*n[4]+t[2]*n[5]+t[4],e[5]=t[1]*n[4]+t[3]*n[5]+t[5],e},translate:function(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e},rotate:function(e,t,n){var i=t[0],a=t[2],o=t[4],r=t[1],s=t[3],l=t[5],h=Math.sin(n),m=Math.cos(n);return e[0]=i*m+r*h,e[1]=-i*h+r*m,e[2]=a*m+s*h,e[3]=-a*h+m*s,e[4]=m*o+h*l,e[5]=m*l-h*o,e},scale:function(e,t,n){var i=n[0],a=n[1];return e[0]=t[0]*i,e[1]=t[1]*a,e[2]=t[2]*i,e[3]=t[3]*a,e[4]=t[4]*i,e[5]=t[5]*a,e},invert:function(e,t){var n=t[0],i=t[2],a=t[4],o=t[1],r=t[3],s=t[5],l=n*r-o*i;return l?(l=1/l,e[0]=r*l,e[1]=-o*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-r*a)*l,e[5]=(o*a-n*s)*l,e):null},mulVector:function(e,t,n){var i=t[0],a=t[2],o=t[4],r=t[1],s=t[3],l=t[5];return e[0]=n[0]*i+n[1]*a+o,e[1]=n[0]*r+n[1]*s+l,e}};return t}),n("zrender/loadingEffect/Base",["require","../tool/util","../shape/Text","../shape/Rectangle"],function(e){function t(e){this.setOptions(e)}var n=e("../tool/util"),i=e("../shape/Text"),a=e("../shape/Rectangle"),o="Loading...",r="normal 16px Arial";return t.prototype.createTextShape=function(e){return new i({highlightStyle:n.merge({x:this.canvasWidth/2,y:this.canvasHeight/2,text:o,textAlign:"center",textBaseline:"middle",textFont:r,color:"#333",brushType:"fill"},e,!0)})},t.prototype.createBackgroundShape=function(e){return new a({highlightStyle:{x:0,y:0,width:this.canvasWidth,height:this.canvasHeight,brushType:"fill",color:e}})},t.prototype.start=function(e){function t(t){e.storage.addHover(t)}function n(){e.refreshHover()}this.canvasWidth=e._width,this.canvasHeight=e._height,this.loadingTimer=this._start(t,n)},t.prototype._start=function(){return setInterval(function(){},1e4)},t.prototype.stop=function(){clearInterval(this.loadingTimer)},t.prototype.setOptions=function(e){this.options=e||{}},t.prototype.adjust=function(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e},t.prototype.getLocation=function(e,t,n){var i=null!=e.x?e.x:"center";switch(i){case"center":i=Math.floor((this.canvasWidth-t)/2);break;case"left":i=0;break;case"right":i=this.canvasWidth-t}var a=null!=e.y?e.y:"center";switch(a){case"center":a=Math.floor((this.canvasHeight-n)/2);break;case"top":a=0;break;case"bottom":a=this.canvasHeight-n}return{x:i,y:a,width:t,height:n}},t}),n("zrender/mixin/Transformable",["require","../tool/matrix","../tool/vector"],function(e){"use strict";function t(e){return e>-r&&r>e}function n(e){return e>r||-r>e}var i=e("../tool/matrix"),a=e("../tool/vector"),o=[0,0],r=5e-5,s=function(){this.position||(this.position=[0,0]),"undefined"==typeof this.rotation&&(this.rotation=[0,0,0]),this.scale||(this.scale=[1,1,0,0]),this.needLocalTransform=!1,this.needTransform=!1};return s.prototype={constructor:s,updateNeedTransform:function(){this.needLocalTransform=n(this.rotation[0])||n(this.position[0])||n(this.position[1])||n(this.scale[0]-1)||n(this.scale[1]-1)},updateTransform:function(){if(this.updateNeedTransform(),this.needTransform=this.parent?this.needLocalTransform||this.parent.needTransform:this.needLocalTransform,this.needTransform){var e=this.transform||i.create();if(i.identity(e),this.needLocalTransform){if(n(this.scale[0])||n(this.scale[1])){o[0]=-this.scale[2]||0,o[1]=-this.scale[3]||0;var t=n(o[0])||n(o[1]);t&&i.translate(e,e,o),i.scale(e,e,this.scale),t&&(o[0]=-o[0],o[1]=-o[1],i.translate(e,e,o))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){o[0]=-this.rotation[1]||0,o[1]=-this.rotation[2]||0;var t=n(o[0])||n(o[1]);t&&i.translate(e,e,o),i.rotate(e,e,this.rotation[0]),t&&(o[0]=-o[0],o[1]=-o[1],i.translate(e,e,o))}}else 0!==this.rotation&&i.rotate(e,e,this.rotation);(n(this.position[0])||n(this.position[1]))&&i.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?i.mul(this.transform,this.parent.transform,this.transform):i.copy(this.transform,this.parent.transform))}},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}},lookAt:function(){var e=a.create();return function(n){this.transform||(this.transform=i.create());var o=this.transform;a.sub(e,n,this.position),t(e[0])&&t(e[1])||(a.normalize(e,e),o[2]=e[0]*this.scale[1],o[3]=e[1]*this.scale[1],o[0]=e[1]*this.scale[0],o[1]=-e[0]*this.scale[0],o[4]=this.position[0],o[5]=this.position[1],this.decomposeTransform())}}(),decomposeTransform:function(){if(this.transform){var e=this.transform,t=e[0]*e[0]+e[1]*e[1],i=this.position,a=this.scale,o=this.rotation;n(t-1)&&(t=Math.sqrt(t));var r=e[2]*e[2]+e[3]*e[3];n(r-1)&&(r=Math.sqrt(r)),i[0]=e[4],i[1]=e[5],a[0]=t,a[1]=r,a[2]=a[3]=0,o[0]=Math.atan2(-e[1]/r,e[0]/t),o[1]=o[2]=0}}},s}),n("zrender/shape/Text",["require","../tool/area","./Base","../tool/util"],function(e){var t=e("../tool/area"),n=e("./Base"),i=function(e){n.call(this,e)};return i.prototype={type:"text",brush:function(e,n){var i=this.style;if(n&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),"undefined"!=typeof i.text&&i.text!==!1){e.save(),this.doClip(e),this.setContext(e,i),this.setTransform(e),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var a,o=(i.text+"").split("\n"),r=t.getTextHeight("国",i.textFont),s=this.getRect(i),l=i.x;a="top"==i.textBaseline?s.y:"bottom"==i.textBaseline?s.y+r:s.y+r/2;for(var h=0,m=o.length;m>h;h++){if(i.maxWidth)switch(i.brushType){case"fill":e.fillText(o[h],l,a,i.maxWidth);break;case"stroke":e.strokeText(o[h],l,a,i.maxWidth);break;case"both":e.fillText(o[h],l,a,i.maxWidth),e.strokeText(o[h],l,a,i.maxWidth);break;default:e.fillText(o[h],l,a,i.maxWidth)}else switch(i.brushType){case"fill":e.fillText(o[h],l,a);break;case"stroke":e.strokeText(o[h],l,a);break; |
|
7 | case"both":e.fillText(o[h],l,a),e.strokeText(o[h],l,a);break;default:e.fillText(o[h],l,a)}a+=r}e.restore()}},getRect:function(e){if(e.__rect)return e.__rect;var n=t.getTextWidth(e.text,e.textFont),i=t.getTextHeight(e.text,e.textFont),a=e.x;"end"==e.textAlign||"right"==e.textAlign?a-=n:"center"==e.textAlign&&(a-=n/2);var o;return o="top"==e.textBaseline?e.y:"bottom"==e.textBaseline?e.y-i:e.y-i/2,e.__rect={x:a,y:o,width:n,height:i},e.__rect}},e("../tool/util").inherits(i,n),i}),n("zrender/shape/Rectangle",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"rectangle",_buildRadiusPath:function(e,t){var n,i,a,o,r=t.x,s=t.y,l=t.width,h=t.height,m=t.radius;"number"==typeof m?n=i=a=o=m:m instanceof Array?1===m.length?n=i=a=o=m[0]:2===m.length?(n=a=m[0],i=o=m[1]):3===m.length?(n=m[0],i=o=m[1],a=m[2]):(n=m[0],i=m[1],a=m[2],o=m[3]):n=i=a=o=0;var V;n+i>l&&(V=n+i,n*=l/V,i*=l/V),a+o>l&&(V=a+o,a*=l/V,o*=l/V),i+a>h&&(V=i+a,i*=h/V,a*=h/V),n+o>h&&(V=n+o,n*=h/V,o*=h/V),e.moveTo(r+n,s),e.lineTo(r+l-i,s),0!==i&&e.quadraticCurveTo(r+l,s,r+l,s+i),e.lineTo(r+l,s+h-a),0!==a&&e.quadraticCurveTo(r+l,s+h,r+l-a,s+h),e.lineTo(r+o,s+h),0!==o&&e.quadraticCurveTo(r,s+h,r,s+h-o),e.lineTo(r,s+n),0!==n&&e.quadraticCurveTo(r,s,r+n,s)},buildPath:function(e,t){t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y)),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-t/2),y:Math.round(e.y-t/2),width:e.width+t,height:e.height+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("zrender/tool/area",["require","./util","./curve"],function(e){"use strict";function t(e){return e%=C,0>e&&(e+=C),e}function n(e,t,n,o){if(!t||!e)return!1;var r=e.type;L=L||W.getContext();var s=i(e,t,n,o);if("undefined"!=typeof s)return s;if(e.buildPath&&L.isPointInPath)return a(e,L,t,n,o);switch(r){case"ellipse":return!0;case"trochoid":var l="out"==t.location?t.r1+t.r2+t.d:t.r1-t.r2+t.d;return d(t,n,o,l);case"rose":return d(t,n,o,t.maxr);default:return!1}}function i(e,t,n,i){var a=e.type;switch(a){case"bezier-curve":return"undefined"==typeof t.cpX2?l(t.xStart,t.yStart,t.cpX1,t.cpY1,t.xEnd,t.yEnd,t.lineWidth,n,i):s(t.xStart,t.yStart,t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd,t.lineWidth,n,i);case"line":return r(t.xStart,t.yStart,t.xEnd,t.yEnd,t.lineWidth,n,i);case"broken-line":return m(t.pointList,t.lineWidth,n,i);case"ring":return V(t.x,t.y,t.r0,t.r,n,i);case"circle":return d(t.x,t.y,t.r,n,i);case"sector":var o=t.startAngle*Math.PI/180,h=t.endAngle*Math.PI/180;return t.clockWise||(o=-o,h=-h),p(t.x,t.y,t.r0,t.r,o,h,!t.clockWise,n,i);case"path":return f(t.pathArray,Math.max(t.lineWidth,5),t.brushType,n,i);case"polygon":case"star":case"isogon":return c(t.pointList,n,i);case"text":var u=t.__rect||e.getRect(t);return U(u.x,u.y,u.width,u.height,n,i);case"rectangle":case"image":return U(t.x,t.y,t.width,t.height,n,i)}}function a(e,t,n,i,a){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(i,a)}function o(e,t,i,a){return!n(e,t,i,a)}function r(e,t,n,i,a,o,r){if(0===a)return!1;var s=Math.max(a,5),l=0,h=e;if(r>t+s&&r>i+s||t-s>r&&i-s>r||o>e+s&&o>n+s||e-s>o&&n-s>o)return!1;if(e===n)return Math.abs(o-e)<=s/2;l=(t-i)/(e-n),h=(e*i-n*t)/(e-n);var m=l*o-r+h,V=m*m/(l*l+1);return s/2*s/2>=V}function s(e,t,n,i,a,o,r,s,l,h,m){if(0===l)return!1;var V=Math.max(l,5);if(m>t+V&&m>i+V&&m>o+V&&m>s+V||t-V>m&&i-V>m&&o-V>m&&s-V>m||h>e+V&&h>n+V&&h>a+V&&h>r+V||e-V>h&&n-V>h&&a-V>h&&r-V>h)return!1;var U=X.cubicProjectPoint(e,t,n,i,a,o,r,s,h,m,null);return V/2>=U}function l(e,t,n,i,a,o,r,s,l){if(0===r)return!1;var h=Math.max(r,5);if(l>t+h&&l>i+h&&l>o+h||t-h>l&&i-h>l&&o-h>l||s>e+h&&s>n+h&&s>a+h||e-h>s&&n-h>s&&a-h>s)return!1;var m=X.quadraticProjectPoint(e,t,n,i,a,o,s,l,null);return h/2>=m}function h(e,n,i,a,o,r,s,l,h){if(0===s)return!1;var m=Math.max(s,5);l-=e,h-=n;var V=Math.sqrt(l*l+h*h);if(V-m>i||i>V+m)return!1;if(Math.abs(a-o)>=C)return!0;if(r){var U=a;a=t(o),o=t(U)}else a=t(a),o=t(o);a>o&&(o+=C);var d=Math.atan2(h,l);return 0>d&&(d+=C),d>=a&&o>=d||d+C>=a&&o>=d+C}function m(e,t,n,i){for(var t=Math.max(t,10),a=0,o=e.length-1;o>a;a++){var s=e[a][0],l=e[a][1],h=e[a+1][0],m=e[a+1][1];if(r(s,l,h,m,t,n,i))return!0}return!1}function V(e,t,n,i,a,o){var r=(a-e)*(a-e)+(o-t)*(o-t);return i*i>r&&r>n*n}function U(e,t,n,i,a,o){return a>=e&&e+n>=a&&o>=t&&t+i>=o}function d(e,t,n,i,a){return n*n>(i-e)*(i-e)+(a-t)*(a-t)}function p(e,t,n,i,a,o,r,s,l){return h(e,t,(n+i)/2,a,o,r,i-n,s,l)}function c(e,t,n){for(var i=e.length,a=0,o=0,r=i-1;i>o;o++){var s=e[r][0],l=e[r][1],h=e[o][0],m=e[o][1];a+=u(s,l,h,m,t,n),r=o}return 0!==a}function u(e,t,n,i,a,o){if(o>t&&o>i||t>o&&i>o)return 0;if(i==t)return 0;var r=t>i?1:-1,s=(o-t)/(i-t),l=s*(n-e)+e;return l>a?r:0}function y(){var e=E[0];E[0]=E[1],E[1]=e}function b(e,t,n,i,a,o,r,s,l,h){if(h>t&&h>i&&h>o&&h>s||t>h&&i>h&&o>h&&s>h)return 0;var m=X.cubicRootAt(t,i,o,s,h,S);if(0===m)return 0;for(var V,U,d=0,p=-1,c=0;m>c;c++){var u=S[c],b=X.cubicAt(e,n,a,r,u);l>b||(0>p&&(p=X.cubicExtrema(t,i,o,s,E),E[1]<E[0]&&p>1&&y(),V=X.cubicAt(t,i,o,s,E[0]),p>1&&(U=X.cubicAt(t,i,o,s,E[1]))),d+=2==p?u<E[0]?t>V?1:-1:u<E[1]?V>U?1:-1:U>s?1:-1:u<E[0]?t>V?1:-1:V>s?1:-1)}return d}function g(e,t,n,i,a,o,r,s){if(s>t&&s>i&&s>o||t>s&&i>s&&o>s)return 0;var l=X.quadraticRootAt(t,i,o,s,S);if(0===l)return 0;var h=X.quadraticExtremum(t,i,o);if(h>=0&&1>=h){for(var m=0,V=X.quadraticAt(t,i,o,h),U=0;l>U;U++){var d=X.quadraticAt(e,n,a,S[U]);d>r||(m+=S[U]<h?t>V?1:-1:V>o?1:-1)}return m}var d=X.quadraticAt(e,n,a,S[0]);return d>r?0:t>o?1:-1}function k(e,n,i,a,o,r,s,l){if(l-=n,l>i||-i>l)return 0;var h=Math.sqrt(i*i-l*l);if(S[0]=-h,S[1]=h,Math.abs(a-o)>=C){a=0,o=C;var m=r?1:-1;return s>=S[0]+e&&s<=S[1]+e?m:0}if(r){var h=a;a=t(o),o=t(h)}else a=t(a),o=t(o);a>o&&(o+=C);for(var V=0,U=0;2>U;U++){var d=S[U];if(d+e>s){var p=Math.atan2(l,d),m=r?1:-1;0>p&&(p=C+p),(p>=a&&o>=p||p+C>=a&&o>=p+C)&&(p>Math.PI/2&&p<1.5*Math.PI&&(m=-m),V+=m)}}return V}function f(e,t,n,i,a){var o=0,m=0,V=0,U=0,d=0,p=!0,c=!0;n=n||"fill";for(var y="stroke"===n||"both"===n,f="fill"===n||"both"===n,_=0;_<e.length;_++){var x=e[_],L=x.points;if(p||"M"===x.command){if(_>0&&(f&&(o+=u(m,V,U,d,i,a)),0!==o))return!0;U=L[L.length-2],d=L[L.length-1],p=!1,c&&"A"!==x.command&&(c=!1,m=U,V=d)}switch(x.command){case"M":m=L[0],V=L[1];break;case"L":if(y&&r(m,V,L[0],L[1],t,i,a))return!0;f&&(o+=u(m,V,L[0],L[1],i,a)),m=L[0],V=L[1];break;case"C":if(y&&s(m,V,L[0],L[1],L[2],L[3],L[4],L[5],t,i,a))return!0;f&&(o+=b(m,V,L[0],L[1],L[2],L[3],L[4],L[5],i,a)),m=L[4],V=L[5];break;case"Q":if(y&&l(m,V,L[0],L[1],L[2],L[3],t,i,a))return!0;f&&(o+=g(m,V,L[0],L[1],L[2],L[3],i,a)),m=L[2],V=L[3];break;case"A":var W=L[0],X=L[1],K=L[2],w=L[3],I=L[4],v=L[5],J=Math.cos(I)*K+W,C=Math.sin(I)*w+X;c?(c=!1,U=J,d=C):o+=u(m,V,J,C);var S=(i-W)*w/K+W;if(y&&h(W,X,w,I,I+v,1-L[7],t,S,a))return!0;f&&(o+=k(W,X,w,I,I+v,1-L[7],S,a)),m=Math.cos(I+v)*K+W,V=Math.sin(I+v)*w+X;break;case"z":if(y&&r(m,V,U,d,t,i,a))return!0;p=!0}}return f&&(o+=u(m,V,U,d,i,a)),0!==o}function _(e,t){var n=e+":"+t;if(K[n])return K[n];L=L||W.getContext(),L.save(),t&&(L.font=t),e=(e+"").split("\n");for(var i=0,a=0,o=e.length;o>a;a++)i=Math.max(L.measureText(e[a]).width,i);return L.restore(),K[n]=i,++I>J&&(I=0,K={}),i}function x(e,t){var n=e+":"+t;if(w[n])return w[n];L=L||W.getContext(),L.save(),t&&(L.font=t),e=(e+"").split("\n");var i=(L.measureText("国").width+2)*e.length;return L.restore(),w[n]=i,++v>J&&(v=0,w={}),i}var L,W=e("./util"),X=e("./curve"),K={},w={},I=0,v=0,J=5e3,C=2*Math.PI,S=[-1,-1,-1],E=[-1,-1];return{isInside:n,isOutside:o,getTextWidth:_,getTextHeight:x,isInsidePath:f,isInsidePolygon:c,isInsideSector:p,isInsideCircle:d,isInsideLine:r,isInsideRect:U,isInsideBrokenLine:m,isInsideCubicStroke:s,isInsideQuadraticStroke:l}}),n("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","../tool/log","../mixin/Transformable","../mixin/Eventful","../tool/area","../tool/color"],function(e){function t(t,i,a,o,r,s,l){r&&(t.font=r),t.textAlign=s,t.textBaseline=l;var h=n(i,a,o,r,s,l);i=(i+"").split("\n");var m=e("../tool/area").getTextHeight("国",r);switch(l){case"top":o=h.y;break;case"bottom":o=h.y+m;break;default:o=h.y+m/2}for(var V=0,U=i.length;U>V;V++)t.fillText(i[V],a,o),o+=m}function n(t,n,i,a,o,r){var s=e("../tool/area"),l=s.getTextWidth(t,a),h=s.getTextHeight("国",a);switch(t=(t+"").split("\n"),o){case"end":case"right":n-=l;break;case"center":n-=l/2}switch(r){case"top":break;case"bottom":i-=h*t.length;break;default:i-=h*t.length/2}return{x:n,y:i,width:l,height:h*t.length}}var i=window.G_vmlCanvasManager,a=e("../tool/matrix"),o=e("../tool/guid"),r=e("../tool/util"),s=e("../tool/log"),l=e("../mixin/Transformable"),h=e("../mixin/Eventful"),m=function(e){e=e||{},this.id=e.id||o();for(var t in e)this[t]=e[t];this.style=this.style||{},this.highlightStyle=this.highlightStyle||null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],l.call(this),h.call(this)};m.prototype.invisible=!1,m.prototype.ignore=!1,m.prototype.zlevel=0,m.prototype.draggable=!1,m.prototype.clickable=!1,m.prototype.hoverable=!0,m.prototype.z=0,m.prototype.brush=function(e,t){var n=this.beforeBrush(e,t);switch(e.beginPath(),this.buildPath(e,n),n.brushType){case"both":e.fill();case"stroke":n.lineWidth>0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),this.afterBrush(e)},m.prototype.beforeBrush=function(e,t){var n=this.style;return this.brushTypeOnly&&(n.brushType=this.brushTypeOnly),t&&(n=this.getHighlightStyle(n,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(n.strokeColor=n.strokeColor||n.color),e.save(),this.doClip(e),this.setContext(e,n),this.setTransform(e),n},m.prototype.afterBrush=function(e){e.restore()};var V=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];m.prototype.setContext=function(e,t){for(var n=0,i=V.length;i>n;n++){var a=V[n][0],o=t[a],r=V[n][1];"undefined"!=typeof o&&(e[r]=o)}};var U=a.create();return m.prototype.doClip=function(e){if(this.__clipShapes&&!i)for(var t=0;t<this.__clipShapes.length;t++){var n=this.__clipShapes[t];if(n.needTransform){var o=n.transform;a.invert(U,o),e.transform(o[0],o[1],o[2],o[3],o[4],o[5])}if(e.beginPath(),n.buildPath(e,n.style),e.clip(),n.needTransform){var o=U;e.transform(o[0],o[1],o[2],o[3],o[4],o[5])}}},m.prototype.getHighlightStyle=function(t,n,i){var a={};for(var o in t)a[o]=t[o];var r=e("../tool/color"),s=r.getHighlightColor();"stroke"!=t.brushType?(a.strokeColor=s,a.lineWidth=(t.lineWidth||1)+this.getHighlightZoom(),a.brushType="both"):"stroke"!=i?(a.strokeColor=s,a.lineWidth=(t.lineWidth||1)+this.getHighlightZoom()):a.strokeColor=n.strokeColor||r.mix(t.strokeColor,r.toRGB(s));for(var o in n)"undefined"!=typeof n[o]&&(a[o]=n[o]);return a},m.prototype.getHighlightZoom=function(){return"text"!=this.type?6:2},m.prototype.drift=function(e,t){this.position[0]+=e,this.position[1]+=t},m.prototype.getTansform=function(){var e=[];return function(t,n){var i=[t,n];return this.needTransform&&this.transform&&(a.invert(e,this.transform),a.mulVector(i,e,[t,n,1]),t==i[0]&&n==i[1]&&this.updateNeedTransform()),i}}(),m.prototype.buildPath=function(){s("buildPath not implemented in "+this.type)},m.prototype.getRect=function(){s("getRect not implemented in "+this.type)},m.prototype.isCover=function(t,n){var i=this.getTansform(t,n);t=i[0],n=i[1];var a=this.style.__rect;return a||(a=this.style.__rect=this.getRect(this.style)),t>=a.x&&t<=a.x+a.width&&n>=a.y&&n<=a.y+a.height?e("../tool/area").isInside(this,this.style,t,n):!1},m.prototype.drawText=function(e,n,i){if("undefined"!=typeof n.text&&n.text!==!1){var a=n.textColor||n.color||n.strokeColor;e.fillStyle=a;var o,r,s,l,h=10,m=n.textPosition||this.textPosition||"top";switch(m){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var V=(i||n).__rect||this.getRect(i||n);switch(m){case"inside":s=V.x+V.width/2,l=V.y+V.height/2,o="center",r="middle","stroke"!=n.brushType&&a==n.color&&(e.fillStyle="#fff");break;case"left":s=V.x-h,l=V.y+V.height/2,o="end",r="middle";break;case"right":s=V.x+V.width+h,l=V.y+V.height/2,o="start",r="middle";break;case"top":s=V.x+V.width/2,l=V.y-h,o="center",r="bottom";break;case"bottom":s=V.x+V.width/2,l=V.y+V.height+h,o="center",r="top"}}break;case"start":case"end":var U,d,p,c;if("undefined"!=typeof n.pointList){var u=n.pointList;if(u.length<2)return;var y=u.length;switch(m){case"start":U=u[0][0],d=u[1][0],p=u[0][1],c=u[1][1];break;case"end":U=u[y-2][0],d=u[y-1][0],p=u[y-2][1],c=u[y-1][1]}}else U=n.xStart||0,d=n.xEnd||0,p=n.yStart||0,c=n.yEnd||0;switch(m){case"start":o=d>U?"end":"start",r=c>p?"bottom":"top",s=U,l=p;break;case"end":o=d>U?"start":"end",r=c>p?"top":"bottom",s=d,l=c}h-=4,U!=d?s-="end"==o?h:-h:o="center",p!=c?l-="bottom"==r?h:-h:r="middle";break;case"specific":s=n.textX||0,l=n.textY||0,o="start",r="middle"}null!=s&&null!=l&&t(e,n.text,s,l,n.textFont,n.textAlign||o,n.textBaseline||r)}},m.prototype.modSelf=function(){this.__dirty=!0,this.style&&(this.style.__rect=null),this.highlightStyle&&(this.highlightStyle.__rect=null)},m.prototype.isSilent=function(){return!(this.hoverable||this.draggable||this.clickable||this.onmousemove||this.onmouseover||this.onmouseout||this.onmousedown||this.onmouseup||this.onclick||this.ondragenter||this.ondragover||this.ondragleave||this.ondrop)},r.merge(m.prototype,l.prototype,!0),r.merge(m.prototype,h.prototype,!0),m}),n("zrender/tool/curve",["require","./vector"],function(e){function t(e){return e>-c&&c>e}function n(e){return e>c||-c>e}function i(e,t,n,i,a){var o=1-a;return o*o*(o*e+3*a*t)+a*a*(a*i+3*o*n)}function a(e,t,n,i,a){var o=1-a;return 3*(((t-e)*o+2*(n-t)*a)*o+(i-n)*a*a)}function o(e,n,i,a,o,r){var s=a+3*(n-i)-e,l=3*(i-2*n+e),h=3*(n-e),m=e-o,V=l*l-3*s*h,U=l*h-9*s*m,d=h*h-3*l*m,p=0;if(t(V)&&t(U))if(t(l))r[0]=0;else{var c=-h/l;c>=0&&1>=c&&(r[p++]=c)}else{var b=U*U-4*V*d;if(t(b)){var g=U/V,c=-l/s+g,k=-g/2;c>=0&&1>=c&&(r[p++]=c),k>=0&&1>=k&&(r[p++]=k)}else if(b>0){var f=Math.sqrt(b),_=V*l+1.5*s*(-U+f),x=V*l+1.5*s*(-U-f);_=0>_?-Math.pow(-_,y):Math.pow(_,y),x=0>x?-Math.pow(-x,y):Math.pow(x,y);var c=(-l-(_+x))/(3*s);c>=0&&1>=c&&(r[p++]=c)}else{var L=(2*V*l-3*s*U)/(2*Math.sqrt(V*V*V)),W=Math.acos(L)/3,X=Math.sqrt(V),K=Math.cos(W),c=(-l-2*X*K)/(3*s),k=(-l+X*(K+u*Math.sin(W)))/(3*s),w=(-l+X*(K-u*Math.sin(W)))/(3*s);c>=0&&1>=c&&(r[p++]=c),k>=0&&1>=k&&(r[p++]=k),w>=0&&1>=w&&(r[p++]=w)}}return p}function r(e,i,a,o,r){var s=6*a-12*i+6*e,l=9*i+3*o-3*e-9*a,h=3*i-3*e,m=0;if(t(l)){if(n(s)){var V=-h/s;V>=0&&1>=V&&(r[m++]=V)}}else{var U=s*s-4*l*h;if(t(U))r[0]=-s/(2*l);else if(U>0){var d=Math.sqrt(U),V=(-s+d)/(2*l),p=(-s-d)/(2*l);V>=0&&1>=V&&(r[m++]=V),p>=0&&1>=p&&(r[m++]=p)}}return m}function s(e,t,n,i,a,o){var r=(t-e)*a+e,s=(n-t)*a+t,l=(i-n)*a+n,h=(s-r)*a+r,m=(l-s)*a+s,V=(m-h)*a+h;o[0]=e,o[1]=r,o[2]=h,o[3]=V,o[4]=V,o[5]=m,o[6]=l,o[7]=i}function l(e,t,n,a,o,r,s,l,h,m,V){var U,d=.005,u=1/0;b[0]=h,b[1]=m;for(var y=0;1>y;y+=.05){g[0]=i(e,n,o,s,y),g[1]=i(t,a,r,l,y);var f=p.distSquare(b,g);u>f&&(U=y,u=f)}u=1/0;for(var _=0;32>_&&!(c>d);_++){var x=U-d,L=U+d;g[0]=i(e,n,o,s,x),g[1]=i(t,a,r,l,x);var f=p.distSquare(g,b);if(x>=0&&u>f)U=x,u=f;else{k[0]=i(e,n,o,s,L),k[1]=i(t,a,r,l,L);var W=p.distSquare(k,b);1>=L&&u>W?(U=L,u=W):d*=.5}}return V&&(V[0]=i(e,n,o,s,U),V[1]=i(t,a,r,l,U)),Math.sqrt(u)}function h(e,t,n,i){var a=1-i;return a*(a*e+2*i*t)+i*i*n}function m(e,t,n,i){return 2*((1-i)*(t-e)+i*(n-t))}function V(e,i,a,o,r){var s=e-2*i+a,l=2*(i-e),h=e-o,m=0;if(t(s)){if(n(l)){var V=-h/l;V>=0&&1>=V&&(r[m++]=V)}}else{var U=l*l-4*s*h;if(t(U)){var V=-l/(2*s);V>=0&&1>=V&&(r[m++]=V)}else if(U>0){var d=Math.sqrt(U),V=(-l+d)/(2*s),p=(-l-d)/(2*s);V>=0&&1>=V&&(r[m++]=V),p>=0&&1>=p&&(r[m++]=p)}}return m}function U(e,t,n){var i=e+n-2*t;return 0===i?.5:(e-t)/i}function d(e,t,n,i,a,o,r,s,l){var m,V=.005,U=1/0;b[0]=r,b[1]=s;for(var d=0;1>d;d+=.05){g[0]=h(e,n,a,d),g[1]=h(t,i,o,d);var u=p.distSquare(b,g);U>u&&(m=d,U=u)}U=1/0;for(var y=0;32>y&&!(c>V);y++){var f=m-V,_=m+V;g[0]=h(e,n,a,f),g[1]=h(t,i,o,f);var u=p.distSquare(g,b);if(f>=0&&U>u)m=f,U=u;else{k[0]=h(e,n,a,_),k[1]=h(t,i,o,_);var x=p.distSquare(k,b);1>=_&&U>x?(m=_,U=x):V*=.5}}return l&&(l[0]=h(e,n,a,m),l[1]=h(t,i,o,m)),Math.sqrt(U)}var p=e("./vector"),c=1e-4,u=Math.sqrt(3),y=1/3,b=p.create(),g=p.create(),k=p.create();return{cubicAt:i,cubicDerivativeAt:a,cubicRootAt:o,cubicExtrema:r,cubicSubdivide:s,cubicProjectPoint:l,quadraticAt:h,quadraticDerivativeAt:m,quadraticRootAt:V,quadraticExtremum:U,quadraticProjectPoint:d}}),n("zrender/Group",["require","./tool/guid","./tool/util","./mixin/Transformable","./mixin/Eventful"],function(e){var t=e("./tool/guid"),n=e("./tool/util"),i=e("./mixin/Transformable"),a=e("./mixin/Eventful"),o=function(e){e=e||{},this.id=e.id||t();for(var n in e)this[n]=e[n];this.type="group",this.clipShape=null,this._children=[],this._storage=null,this.__dirty=!0,i.call(this),a.call(this)};return o.prototype.ignore=!1,o.prototype.children=function(){return this._children.slice()},o.prototype.childAt=function(e){return this._children[e]},o.prototype.addChild=function(e){e!=this&&e.parent!=this&&(e.parent&&e.parent.removeChild(e),this._children.push(e),e.parent=this,this._storage&&this._storage!==e._storage&&(this._storage.addToMap(e),e instanceof o&&e.addChildrenToStorage(this._storage)))},o.prototype.removeChild=function(e){var t=n.indexOf(this._children,e);this._children.splice(t,1),e.parent=null,this._storage&&(this._storage.delFromMap(e.id),e instanceof o&&e.delChildrenFromStorage(this._storage))},o.prototype.eachChild=function(e,t){for(var n=!!t,i=0;i<this._children.length;i++){var a=this._children[i];n?e.call(t,a):e(a)}},o.prototype.traverse=function(e,t){for(var n=!!t,i=0;i<this._children.length;i++){var a=this._children[i];n?e.call(t,a):e(a),"group"===a.type&&a.traverse(e,t)}},o.prototype.addChildrenToStorage=function(e){for(var t=0;t<this._children.length;t++){var n=this._children[t];e.addToMap(n),"group"===n.type&&n.addChildrenToStorage(e)}},o.prototype.delChildrenFromStorage=function(e){for(var t=0;t<this._children.length;t++){var n=this._children[t];e.delFromMap(n.id),"group"===n.type&&n.delChildrenFromStorage(e)}},o.prototype.modSelf=function(){this.__dirty=!0},n.merge(o.prototype,i.prototype,!0),n.merge(o.prototype,a.prototype,!0),o}),n("zrender/animation/Clip",["require","./easing"],function(e){function t(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+1e3*this._life,this.loop="undefined"==typeof e.loop?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}var n=e("./easing");return t.prototype={step:function(e){var t=(e-this._startTime)/this._life;if(!(0>t)){t=Math.min(t,1);var i="string"==typeof this.easing?n[this.easing]:this.easing,a="function"==typeof i?i(t):t;return this.fire("frame",a),1==t?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null}},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap,this._needsRemove=!1},fire:function(e,t){for(var n=0,i=this._targetPool.length;i>n;n++)this["on"+e]&&this["on"+e](this._targetPool[n],t)},constructor:t},t}),n("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||1>n?(n=1,t=i/4):t=i*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/i)))},ElasticOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||1>n?(n=1,t=i/4):t=i*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin(2*(e-t)*Math.PI/i)+1)},ElasticInOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||1>n?(n=1,t=i/4):t=i*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*n*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/i):n*Math.pow(2,-10*(e-=1))*Math.sin(2*(e-t)*Math.PI/i)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return.5>t?.5*e.BounceIn(2*t):.5*e.BounceOut(2*t-1)+.5}};return e}),n("echarts/component/base",["require","../config","../util/ecData","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function t(e,t,a,o,r){this.ecTheme=e,this.messageCenter=t,this.zr=a,this.option=o,this.series=o.series,this.myChart=r,this.component=r.component,this._zlevelBase=this.getZlevelBase(),this.shapeList=[],this.effectList=[];var s=this;s._onlegendhoverlink=function(e){if(s.legendHoverLink)for(var t,a=e.target,o=s.shapeList.length-1;o>=0;o--)t=s.type==n.CHART_TYPE_PIE||s.type==n.CHART_TYPE_FUNNEL?i.get(s.shapeList[o],"name"):(i.get(s.shapeList[o],"series")||{}).name,t!=a||s.shapeList[o].invisible||s.zr.addHoverShape(s.shapeList[o])},t&&t.bind(n.EVENT.LEGEND_HOVERLINK,this._onlegendhoverlink)}var n=e("../config"),i=e("../util/ecData"),a=e("../util/ecQuery"),o=e("../util/number"),r=e("zrender/tool/util");return t.prototype={canvasSupported:e("zrender/tool/env").canvasSupported,getZlevelBase:function(e){switch(e=e||this.type+""){case n.COMPONENT_TYPE_GRID:case n.COMPONENT_TYPE_AXIS_CATEGORY:case n.COMPONENT_TYPE_AXIS_VALUE:case n.COMPONENT_TYPE_POLAR:return 0;case n.CHART_TYPE_LINE:case n.CHART_TYPE_BAR:case n.CHART_TYPE_SCATTER:case n.CHART_TYPE_PIE:case n.CHART_TYPE_RADAR:case n.CHART_TYPE_MAP:case n.CHART_TYPE_K:case n.CHART_TYPE_CHORD:case n.CHART_TYPE_GUAGE:case n.CHART_TYPE_FUNNEL:case n.CHART_TYPE_EVENTRIVER:return 2;case n.COMPONENT_TYPE_LEGEND:case n.COMPONENT_TYPE_DATARANGE:case n.COMPONENT_TYPE_DATAZOOM:case n.COMPONENT_TYPE_TIMELINE:case n.COMPONENT_TYPE_ROAMCONTROLLER:return 4;case n.CHART_TYPE_ISLAND:return 5;case n.COMPONENT_TYPE_TOOLBOX:case n.COMPONENT_TYPE_TITLE:return 6;case n.COMPONENT_TYPE_TOOLTIP:return 8;default:return 0}},reformOption:function(e){return r.merge(e||{},r.clone(this.ecTheme[this.type]||{}))},reformCssArray:function(e){if(!(e instanceof Array))return[e,e,e,e];switch(e.length+""){case"4":return e;case"3":return[e[0],e[1],e[2],e[1]];case"2":return[e[0],e[1],e[0],e[1]];case"1":return[e[0],e[0],e[0],e[0]];case"0":return[0,0,0,0]}},getShapeById:function(e){for(var t=0,n=this.shapeList.length;n>t;t++)if(this.shapeList[t].id===e)return this.shapeList[t];return null},getFont:function(e){var t=r.merge(r.clone(e)||{},this.ecTheme.textStyle);return t.fontStyle+" "+t.fontWeight+" "+t.fontSize+"px "+t.fontFamily},getItemStyleColor:function(e,t,n,i){return"function"==typeof e?e.call(this.myChart,{seriesIndex:t,series:this.series[t],dataIndex:n,data:i}):e},subPixelOptimize:function(e,t){return e=t%2===1?Math.floor(e)+.5:Math.round(e)},resize:function(){this.refresh&&this.refresh(),this.clearEffectShape&&this.clearEffectShape(!0);var e=this;setTimeout(function(){e.animationEffect&&e.animationEffect()},200)},clear:function(){this.clearEffectShape&&this.clearEffectShape(),this.zr&&this.zr.delShape(this.shapeList),this.shapeList=[]},dispose:function(){this.onbeforDispose&&this.onbeforDispose(),this.clear(),this.shapeList=null,this.effectList=null,this.messageCenter&&this.messageCenter.unbind(n.EVENT.LEGEND_HOVERLINK,this._onlegendhoverlink),this.onafterDispose&&this.onafterDispose()},query:a.query,deepQuery:a.deepQuery,deepMerge:a.deepMerge,parsePercent:o.parsePercent,parseCenter:o.parseCenter,parseRadius:o.parseRadius,numAddCommas:o.addCommas},t}),n("echarts/chart/base",["require","zrender/shape/Image","../util/shape/Icon","../util/shape/MarkLine","../util/shape/Symbol","../config","../util/ecData","../util/ecAnimation","../util/ecEffect","../util/accMath","zrender/tool/util","zrender/tool/area"],function(e){function t(){var e=this;this.selectedMap={},this.lastShapeList=[],this.shapeHandler={onclick:function(){e.isClick=!0},ondragover:function(t){var n=t.target;n.highlightStyle=n.highlightStyle||{};var i=n.highlightStyle,a=i.brushTyep,o=i.strokeColor,r=i.lineWidth;i.brushType="stroke",i.strokeColor=e.ecTheme.calculableColor,i.lineWidth="icon"===n.type?30:10,e.zr.addHoverShape(n),setTimeout(function(){n.highlightStyle&&(n.highlightStyle.brushType=a,n.highlightStyle.strokeColor=o,n.highlightStyle.lineWidth=r)},20)},ondrop:function(t){null!=s.get(t.dragged,"data")&&(e.isDrop=!0)},ondragend:function(){e.isDragend=!0}}}var n=e("zrender/shape/Image"),i=e("../util/shape/Icon"),a=e("../util/shape/MarkLine"),o=e("../util/shape/Symbol"),r=e("../config"),s=e("../util/ecData"),l=e("../util/ecAnimation"),h=e("../util/ecEffect"),m=e("../util/accMath"),V=e("zrender/tool/util"),U=e("zrender/tool/area");return t.prototype={setCalculable:function(e){return e.dragEnableTime=this.ecTheme.DRAG_ENABLE_TIME,e.ondragover=this.shapeHandler.ondragover,e.ondragend=this.shapeHandler.ondragend,e.ondrop=this.shapeHandler.ondrop,e},ondrop:function(e,t){if(this.isDrop&&e.target&&!t.dragIn){var n,i=e.target,a=e.dragged,o=s.get(i,"seriesIndex"),l=s.get(i,"dataIndex"),h=this.series,V=this.component.legend;if(-1===l){if(s.get(a,"seriesIndex")==o)return t.dragOut=t.dragIn=t.needRefresh=!0,void(this.isDrop=!1);n={value:s.get(a,"value"),name:s.get(a,"name")},this.type===r.CHART_TYPE_PIE&&n.value<0&&(n.value=0);for(var U=!1,d=h[o].data,p=0,c=d.length;c>p;p++)d[p].name===n.name&&"-"===d[p].value&&(h[o].data[p].value=n.value,U=!0);!U&&h[o].data.push(n),V&&V.add(n.name,a.style.color||a.style.strokeColor)}else n=this.option.series[o].data[l]||"-",null!=n.value?(this.option.series[o].data[l].value="-"!=n.value?m.accAdd(this.option.series[o].data[l].value,s.get(a,"value")):s.get(a,"value"),(this.type===r.CHART_TYPE_FUNNEL||this.type===r.CHART_TYPE_PIE)&&(V&&1===V.getRelatedAmount(n.name)&&this.component.legend.del(n.name),n.name+=this.option.nameConnector+s.get(a,"name"),V&&V.add(n.name,a.style.color||a.style.strokeColor))):this.option.series[o].data[l]="-"!=n?m.accAdd(this.option.series[o].data[l],s.get(a,"value")):s.get(a,"value");t.dragIn=t.dragIn||!0,this.isDrop=!1;var u=this;setTimeout(function(){u.zr.trigger("mousemove",e.event)},300)}},ondragend:function(e,t){if(this.isDragend&&e.target&&!t.dragOut){var n=e.target,i=s.get(n,"seriesIndex"),a=s.get(n,"dataIndex"),o=this.series;if(null!=o[i].data[a].value){o[i].data[a].value="-";var r=o[i].data[a].name;this.component.legend&&0===this.component.legend.getRelatedAmount(r)&&this.component.legend.del(r)}else o[i].data[a]="-";t.dragOut=!0,t.needRefresh=!0,this.isDragend=!1}},onlegendSelected:function(e,t){var n=e.selected;for(var i in this.selectedMap)this.selectedMap[i]!=n[i]&&(t.needRefresh=!0),this.selectedMap[i]=n[i]},_bulidPosition:function(){this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this._sIndex2ColorMap={},this.selectedMap={},this.xMarkMap={};for(var e,t,n,i,a=this.series,o={top:[],bottom:[],left:[],right:[],other:[]},s=0,l=a.length;l>s;s++)a[s].type===this.type&&(a[s]=this.reformOption(a[s]),this.legendHoverLink=a[s].legendHoverLink||this.legendHoverLink,e=a[s].xAxisIndex,t=a[s].yAxisIndex,n=this.component.xAxis.getAxis(e),i=this.component.yAxis.getAxis(t),n.type===r.COMPONENT_TYPE_AXIS_CATEGORY?o[n.getPosition()].push(s):i.type===r.COMPONENT_TYPE_AXIS_CATEGORY?o[i.getPosition()].push(s):o.other.push(s));for(var h in o)o[h].length>0&&this._buildSinglePosition(h,o[h]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),i=n.locationMap,a=n.maxDataLength;if(0!==a&&0!==i.length){switch(e){case"bottom":case"top":this._buildHorizontal(t,a,i,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,a,i,this.xMarkMap);break;case"other":this._buildOther(t,a,i,this.xMarkMap)}for(var o=0,r=t.length;r>o;o++)this.buildMark(t[o])}},_mapData:function(e){for(var t,n,i,a,o=this.series,s=0,l={},h="__kener__stack__",m=this.component.legend,V=[],U=0,d=0,p=e.length;p>d;d++)t=o[e[d]],i=t.name,this._sIndex2ShapeMap[e[d]]=this._sIndex2ShapeMap[e[d]]||this.query(t,"symbol")||this._symbol[d%this._symbol.length],m?(this.selectedMap[i]=m.isSelected(i),this._sIndex2ColorMap[e[d]]=m.getColor(i),a=m.getItemShape(i),a&&(this.type==r.CHART_TYPE_LINE?(a.style.iconType="legendLineIcon",a.style.symbol=this._sIndex2ShapeMap[e[d]]):t.itemStyle.normal.barBorderWidth>0&&(a.style.x+=1,a.style.y+=1,a.style.width-=2,a.style.height-=2,a.style.strokeColor=a.highlightStyle.strokeColor=t.itemStyle.normal.barBorderColor,a.highlightStyle.lineWidth=3,a.style.brushType="both"),m.setItemShape(i,a))):(this.selectedMap[i]=!0,this._sIndex2ColorMap[e[d]]=this.zr.getColor(e[d])),this.selectedMap[i]&&(n=t.stack||h+e[d],null==l[n]?(l[n]=s,V[s]=[e[d]],s++):V[l[n]].push(e[d])),U=Math.max(U,t.data.length);return{locationMap:V,maxDataLength:U}},_calculMarkMapXY:function(e,t,n){for(var i=this.series,a=0,o=t.length;o>a;a++)for(var r=0,s=t[a].length;s>r;r++){var l=t[a][r],h="xy"==n?0:"";if("-1"!=n.indexOf("x")){e[l]["counter"+h]>0&&(e[l]["average"+h]=(e[l]["sum"+h]/e[l]["counter"+h]).toFixed(2)-0);var m=this.component.xAxis.getAxis(i[l].xAxisIndex||0).getCoord(e[l]["average"+h]);e[l]["averageLine"+h]=[[m,this.component.grid.getYend()],[m,this.component.grid.getY()]],e[l]["minLine"+h]=[[e[l]["minX"+h],this.component.grid.getYend()],[e[l]["minX"+h],this.component.grid.getY()]],e[l]["maxLine"+h]=[[e[l]["maxX"+h],this.component.grid.getYend()],[e[l]["maxX"+h],this.component.grid.getY()]],e[l].isHorizontal=!1}if(h="xy"==n?1:"","-1"!=n.indexOf("y")){e[l]["counter"+h]>0&&(e[l]["average"+h]=(e[l]["sum"+h]/e[l]["counter"+h]).toFixed(2)-0);var V=this.component.yAxis.getAxis(i[l].yAxisIndex||0).getCoord(e[l]["average"+h]);e[l]["averageLine"+h]=[[this.component.grid.getX(),V],[this.component.grid.getXend(),V]],e[l]["minLine"+h]=[[this.component.grid.getX(),e[l]["minY"+h]],[this.component.grid.getXend(),e[l]["minY"+h]]],e[l]["maxLine"+h]=[[this.component.grid.getX(),e[l]["maxY"+h]],[this.component.grid.getXend(),e[l]["maxY"+h]]],e[l].isHorizontal=!0}}},addLabel:function(e,t,n,i,a){var o=[n,t],r=this.deepMerge(o,"itemStyle.normal.label"),s=this.deepMerge(o,"itemStyle.emphasis.label"),l=r.textStyle||{},h=s.textStyle||{};return r.show&&(e.style.text=this._getLabelText(t,n,i,"normal"),e.style.textPosition=null==r.position?"horizontal"===a?"right":"top":r.position,e.style.textColor=l.color,e.style.textFont=this.getFont(l)),s.show&&(e.highlightStyle.text=this._getLabelText(t,n,i,"emphasis"),e.highlightStyle.textPosition=r.show?e.style.textPosition:null==s.position?"horizontal"===a?"right":"top":s.position,e.highlightStyle.textColor=h.color,e.highlightStyle.textFont=this.getFont(h)),e |
|
8 | },_getLabelText:function(e,t,n,i){var a=this.deepQuery([t,e],"itemStyle."+i+".label.formatter");a||"emphasis"!==i||(a=this.deepQuery([t,e],"itemStyle.normal.label.formatter"));var o=null!=t?null!=t.value?t.value:t:"-";return a?"function"==typeof a?a.call(this.myChart,e.name,n,o):"string"==typeof a?(a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),a=a.replace("{a0}",e.name).replace("{b0}",n).replace("{c0}",this.numAddCommas(o))):void 0:this.numAddCommas(o)},buildMark:function(e){var t=this.series[e];this.selectedMap[t.name]&&(t.markPoint&&this._buildMarkPoint(e),t.markLine&&this._buildMarkLine(e))},_buildMarkPoint:function(e){for(var t,n,i=(this.markAttachStyle||{})[e],a=this.series[e],o=this.getZlevelBase(),s=V.clone(a.markPoint),l=0,h=s.data.length;h>l;l++)t=s.data[l],n=this.getMarkCoord(e,t),s.data[l].x=null!=t.x?t.x:n[0],s.data[l].y=null!=t.y?t.y:n[1],!t.type||"max"!==t.type&&"min"!==t.type||(s.data[l].value=n[3],s.data[l].name=t.name||t.type,s.data[l].symbolSize=s.data[l].symbolSize||U.getTextWidth(n[3],this.getFont())/2+5);for(var m=this._markPoint(e,s),l=0,h=m.length;h>l;l++){m[l].zlevel=o+1;for(var d in i)m[l][d]=V.clone(i[d]);this.shapeList.push(m[l])}if(this.type===r.CHART_TYPE_FORCE||this.type===r.CHART_TYPE_CHORD)for(var l=0,h=m.length;h>l;l++)this.zr.addShape(m[l])},_buildMarkLine:function(e){for(var t,n,i=(this.markAttachStyle||{})[e],a=this.series[e],o=this.getZlevelBase(),s=V.clone(a.markLine),l=0,h=s.data.length;h>l;l++)t=s.data[l],!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type?n=[this.getMarkCoord(e,t[0]),this.getMarkCoord(e,t[1])]:(n=this.getMarkCoord(e,t),s.data[l]=[V.clone(t),{}],s.data[l][0].name=t.name||t.type,s.data[l][0].value=n[3],n=n[2],t=[{},{}]),null!=n&&null!=n[0]&&null!=n[1]&&(s.data[l][0].x=null!=t[0].x?t[0].x:n[0][0],s.data[l][0].y=null!=t[0].y?t[0].y:n[0][1],s.data[l][1].x=null!=t[1].x?t[1].x:n[1][0],s.data[l][1].y=null!=t[1].y?t[1].y:n[1][1]);for(var m=this._markLine(e,s),l=0,h=m.length;h>l;l++){m[l].zlevel=o+1;for(var U in i)m[l][U]=V.clone(i[U]);this.shapeList.push(m[l])}if(this.type===r.CHART_TYPE_FORCE||this.type===r.CHART_TYPE_CHORD)for(var l=0,h=m.length;h>l;l++)this.zr.addShape(m[l])},_markPoint:function(e,t){var n=this.series[e],i=this.component;V.merge(t,this.ecTheme.markPoint),t.name=n.name;var a,o,l,h,m,U,d,p=[],c=t.data,u=i.dataRange,y=i.legend,b=this.zr.getWidth(),g=this.zr.getHeight();if(t.large)a=this.getLargeMarkPoingShape(e,t),a._mark="largePoint",a&&p.push(a);else for(var k=0,f=c.length;f>k;k++)null!=c[k].x&&null!=c[k].y&&(l=null!=c[k]&&null!=c[k].value?c[k].value:"",y&&(o=y.getColor(n.name)),u&&(o=isNaN(l)?o:u.getColor(l),h=[c[k],t],m=this.deepQuery(h,"itemStyle.normal.color")||o,U=this.deepQuery(h,"itemStyle.emphasis.color")||m,null==m&&null==U)||(o=null==o?this.zr.getColor(e):o,c[k].tooltip=c[k].tooltip||t.tooltip||{trigger:"item"},c[k].name=null!=c[k].name?c[k].name:"",c[k].value=l,a=this.getSymbolShape(t,e,c[k],k,c[k].name,this.parsePercent(c[k].x,b),this.parsePercent(c[k].y,g),"pin",o,"rgba(0,0,0,0)","horizontal"),a._mark="point",d=this.deepMerge([c[k],t],"effect"),d.show&&(a.effect=d),n.type===r.CHART_TYPE_MAP&&(a._geo=this.getMarkGeo(c[k])),s.pack(a,n,e,c[k],k,c[k].name,l),p.push(a)));return p},_markLine:function(e,t){var n=this.series[e],i=this.component;V.merge(t,this.ecTheme.markLine),t.symbol=t.symbol instanceof Array?t.symbol.length>1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=n.name;for(var a,o,l,h,m,U,d,p,c=[],u=t.data,y=i.dataRange,b=i.legend,g=this.zr.getWidth(),k=this.zr.getHeight(),f=0,_=u.length;_>f;f++)null!=u[f][0].x&&null!=u[f][0].y&&null!=u[f][1].x&&null!=u[f][1].y&&(o=b?b.getColor(n.name):this.zr.getColor(e),p=this.deepMerge(u[f]),l=null!=p&&null!=p.value?p.value:"",y&&(o=isNaN(l)?o:y.getColor(l),h=[p,t],m=this.deepQuery(h,"itemStyle.normal.color")||o,U=this.deepQuery(h,"itemStyle.emphasis.color")||m,null==m&&null==U)||(u[f][0].tooltip=p.tooltip||{trigger:"item"},u[f][0].name=null!=u[f][0].name?u[f][0].name:"",u[f][1].name=null!=u[f][1].name?u[f][1].name:"",u[f][0].value=null!=u[f][0].value?u[f][0].value:"",a=this.getLineMarkShape(t,e,u[f],f,this.parsePercent(u[f][0].x,g),this.parsePercent(u[f][0].y,k),this.parsePercent(u[f][1].x,g),this.parsePercent(u[f][1].y,k),o),a._mark="line",d=this.deepMerge([p,t],"effect"),d.show&&(a.effect=d),n.type===r.CHART_TYPE_MAP&&(a._geo=[this.getMarkGeo(u[f][0]),this.getMarkGeo(u[f][1])]),s.pack(a,n,e,u[f][0],f,u[f][0].name+(""!==u[f][1].name?" > "+u[f][1].name:""),l),c.push(a)));return c},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,t,a,o,r,l,h,m,V,U,d){var p=[a,e],c=null!=a?null!=a.value?a.value:a:"-";m=this.deepQuery(p,"symbol")||m;var u=this.deepQuery(p,"symbolSize");u="function"==typeof u?u(c):u;var y=this.deepQuery(p,"symbolRotate"),b=this.deepMerge(p,"itemStyle.normal"),g=this.deepMerge(p,"itemStyle.emphasis"),k=null!=b.borderWidth?b.borderWidth:b.lineStyle&&b.lineStyle.width;null==k&&(k=m.match("empty")?2:0);var f=null!=g.borderWidth?g.borderWidth:g.lineStyle&&g.lineStyle.width;null==f&&(f=k+2);var _=new i({style:{iconType:m.replace("empty","").toLowerCase(),x:l-u,y:h-u,width:2*u,height:2*u,brushType:"both",color:m.match("empty")?U:this.getItemStyleColor(b.color,t,o,a)||V,strokeColor:b.borderColor||this.getItemStyleColor(b.color,t,o,a)||V,lineWidth:k},highlightStyle:{color:m.match("empty")?U:this.getItemStyleColor(g.color,t,o,a),strokeColor:g.borderColor||b.borderColor||this.getItemStyleColor(b.color,t,o,a)||V,lineWidth:f},clickable:this.deepQuery(p,"clickable")});return m.match("image")&&(_.style.image=m.replace(new RegExp("^image:\\/\\/"),""),_=new n({style:_.style,highlightStyle:_.highlightStyle,clickable:this.deepQuery(p,"clickable")})),null!=y&&(_.rotation=[y*Math.PI/180,l,h]),m.match("star")&&(_.style.iconType="star",_.style.n=m.replace("empty","").replace("star","")-0||5),"none"===m&&(_.invisible=!0,_.hoverable=!1),_=this.addLabel(_,e,a,r,d),m.match("empty")&&(null==_.style.textColor&&(_.style.textColor=_.style.strokeColor),null==_.highlightStyle.textColor&&(_.highlightStyle.textColor=_.highlightStyle.strokeColor)),s.pack(_,e,t,a,o,r),_._x=l,_._y=h,_._dataIndex=o,_._seriesIndex=t,_},getLineMarkShape:function(e,t,n,i,o,r,s,l,h){var m=null!=n[0]?null!=n[0].value?n[0].value:n[0]:"-",V=null!=n[1]?null!=n[1].value?n[1].value:n[1]:"-",U=[this.query(n[0],"symbol")||e.symbol[0],this.query(n[1],"symbol")||e.symbol[1]],d=[this.query(n[0],"symbolSize")||e.symbolSize[0],this.query(n[1],"symbolSize")||e.symbolSize[1]];d[0]="function"==typeof d[0]?d[0](m):d[0],d[1]="function"==typeof d[1]?d[1](V):d[1];var p=[this.query(n[0],"symbolRotate")||e.symbolRotate[0],this.query(n[1],"symbolRotate")||e.symbolRotate[1]],c=[n[0],e],u=this.deepMerge(c,"itemStyle.normal");u.color=this.getItemStyleColor(u.color,t,i,n);var y=this.deepMerge(c,"itemStyle.emphasis");y.color=this.getItemStyleColor(y.color,t,i,n);var b=u.lineStyle,g=y.lineStyle,k=b.width;null==k&&(k=u.borderWidth);var f=g.width;null==f&&(f=null!=y.borderWidth?y.borderWidth:k+2);var _=new a({style:{smooth:e.smooth?"spline":!1,symbol:U,symbolSize:d,symbolRotate:p,xStart:o,yStart:r,xEnd:s,yEnd:l,brushType:"both",lineType:b.type,shadowColor:b.shadowColor||b.color||u.borderColor||u.color||h,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,color:u.color||h,strokeColor:b.color||u.borderColor||u.color||h,lineWidth:k,symbolBorderColor:u.borderColor||u.color||h,symbolBorder:u.borderWidth},highlightStyle:{shadowColor:g.shadowColor,shadowBlur:g.shadowBlur,shadowOffsetX:g.shadowOffsetX,shadowOffsetY:g.shadowOffsetY,color:y.color||u.color||h,strokeColor:g.color||b.color||y.borderColor||u.borderColor||y.color||u.color||h,lineWidth:f,symbolBorderColor:y.borderColor||u.borderColor||y.color||u.color||h,symbolBorder:null==y.borderWidth?u.borderWidth+2:y.borderWidth},clickable:this.deepQuery(c,"clickable")});return _=this.addLabel(_,e,n[0],n[0].name+" : "+n[1].name),_._x=s,_._y=l,_},getLargeMarkPoingShape:function(e,t){var n,i,a,r,s,l,h=this.series[e],m=this.component,V=t.data,U=m.dataRange,d=m.legend,p=[V[0],t];if(d&&(i=d.getColor(h.name)),!U||(a=null!=V[0]?null!=V[0].value?V[0].value:V[0]:"-",i=isNaN(a)?i:U.getColor(a),r=this.deepQuery(p,"itemStyle.normal.color")||i,s=this.deepQuery(p,"itemStyle.emphasis.color")||r,null!=r||null!=s)){i=this.deepMerge(p,"itemStyle.normal").color||i;var c=this.deepQuery(p,"symbol")||"circle";c=c.replace("empty","").replace(/\d/g,""),l=this.deepMerge([V[0],t],"effect");var u=window.devicePixelRatio||1;return n=new o({style:{pointList:V,color:i,strokeColor:i,shadowColor:l.shadowColor||i,shadowBlur:(null!=l.shadowBlur?l.shadowBlur:8)*u,size:this.deepQuery(p,"symbolSize"),iconType:c,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),l.show&&(n.effect=l),n}},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e,t,n=this.option.animationThreshold/(this.canvasSupported?2:4),i=this.lastShapeList,a=this.shapeList,o=i.length>0?500:this.query(this.option,"animationDuration"),s=this.query(this.option,"animationEasing"),l={},h={};if(this.option.animation&&!this.option.renderAsImage&&a.length<n&&!this.motionlessOnce){for(var m=0,V=i.length;V>m;m++)t=this._getAnimationKey(i[m]),t.match("undefined")?this.zr.delShape(i[m].id):(t+=i[m].type,l[t]=i[m]);for(var m=0,V=a.length;V>m;m++)t=this._getAnimationKey(a[m]),t.match("undefined")?this.zr.addShape(a[m]):(t+=a[m].type,h[t]=a[m]);for(t in l)h[t]||this.zr.delShape(l[t].id);for(t in h)l[t]?(this.zr.delShape(l[t].id),this._animateMod(l[t],h[t],o,s)):(e=this.type!=r.CHART_TYPE_LINE&&this.type!=r.CHART_TYPE_RADAR||0===t.indexOf("icon")?0:o/2,this._animateMod(!1,h[t],o,s,e));this.zr.refresh(),this.animationEffect()}else{this.motionlessOnce=!1,this.zr.delShape(i);for(var m=0,V=a.length;V>m;m++)this.zr.addShape(a[m])}},_getAnimationKey:function(e){return this.type!=r.CHART_TYPE_MAP?s.get(e,"seriesIndex")+"_"+s.get(e,"dataIndex")+(e._mark?e._mark:"")+(this.type===r.CHART_TYPE_RADAR?s.get(e,"special"):""):s.get(e,"seriesIndex")+"_"+s.get(e,"dataIndex")+(e._mark?e._mark:"undefined")},_animateMod:function(e,t,n,i,a){switch(t.type){case"broken-line":case"half-smooth-polygon":l.pointList(this.zr,e,t,n,i);break;case"rectangle":l.rectangle(this.zr,e,t,n,i);break;case"icon":l.icon(this.zr,e,t,n,i,a);break;case"candle":n>500?l.candle(this.zr,e,t,n,i):this.zr.addShape(t);break;case"ring":case"sector":case"circle":n>500?l.ring(this.zr,e,t,n+(s.get(t,"dataIndex")||0)%20*100,i):"sector"===t.type?l.sector(this.zr,e,t,n,i):this.zr.addShape(t);break;case"text":l.text(this.zr,e,t,n,i);break;case"polygon":n>500?l.polygon(this.zr,e,t,n,i):l.pointList(this.zr,e,t,n,i);break;case"ribbon":l.ribbon(this.zr,e,t,n,i);break;case"gauge-pointer":l.gaugePointer(this.zr,e,t,n,i);break;case"mark-line":l.markline(this.zr,e,t,n,i);break;case"bezier-curve":case"line":l.line(this.zr,e,t,n,i);break;default:this.zr.addShape(t)}},animationMark:function(e,t,n){for(var i=n||this.shapeList,a=0,o=i.length;o>a;a++)i[a]._mark&&this._animateMod(!1,i[a],e,t);this.animationEffect(n)},animationEffect:function(e){!e&&this.clearEffectShape();var t=e||this.shapeList;if(null!=t){var n=r.EFFECT_ZLEVEL;this.canvasSupported&&this.zr.modLayer(n,{motionBlur:!0,lastFrameAlpha:.95});for(var i,a=0,o=t.length;o>a;a++)i=t[a],i._mark&&i.effect&&i.effect.show&&h[i._mark]&&(h[i._mark](this.zr,this.effectList,i,n),this.effectList[this.effectList.length-1]._mark=i._mark)}},clearEffectShape:function(e){this.zr&&this.effectList&&this.effectList.length>0&&(e&&this.zr.modLayer(r.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,n){var i=this.series[e];if(this.selectedMap[i.name]){var a=500,o=this.query(this.option,"animationEasing"),r=i[n].data,s=this.shapeList.length;if(i[n].data=t.data,this["_build"+n.replace("m","M")](e),this.option.animation&&!this.option.renderAsImage)this.animationMark(a,o,this.shapeList.slice(s));else{for(var l=s,h=this.shapeList.length;h>l;l++)this.zr.addShape(this.shapeList[l]);this.zr.refresh()}i[n].data=r}},delMark:function(e,t,n){n=n.replace("mark","").replace("large","").toLowerCase();var i=this.series[e];if(this.selectedMap[i.name]){for(var a=!1,o=[this.shapeList,this.effectList],r=2;r--;)for(var l=0,h=o[r].length;h>l;l++)if(o[r][l]._mark==n&&s.get(o[r][l],"seriesIndex")==e&&s.get(o[r][l],"name")==t){this.zr.delShape(o[r][l].id),o[r].splice(l,1),a=!0;break}a&&this.zr.refresh()}}},t}),n("zrender/shape/Circle",["require","./Base","../tool/util"],function(e){"use strict";var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"circle",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,2*Math.PI,!0)},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("echarts/util/accMath",[],function(){function e(e,t){var n=e.toString(),i=t.toString(),a=0;try{a=i.split(".")[1].length}catch(o){}try{a-=n.split(".")[1].length}catch(o){}return(n.replace(".","")-0)/(i.replace(".","")-0)*Math.pow(10,a)}function t(e,t){var n=e.toString(),i=t.toString(),a=0;try{a+=n.split(".")[1].length}catch(o){}try{a+=i.split(".")[1].length}catch(o){}return(n.replace(".","")-0)*(i.replace(".","")-0)/Math.pow(10,a)}function n(e,t){var n=0,i=0;try{n=e.toString().split(".")[1].length}catch(a){}try{i=t.toString().split(".")[1].length}catch(a){}var o=Math.pow(10,Math.max(n,i));return(Math.round(e*o)+Math.round(t*o))/o}function i(e,t){return n(e,-t)}return{accDiv:e,accMul:t,accAdd:n,accSub:i}}),n("echarts/util/ecQuery",["require","zrender/tool/util"],function(e){function t(e,t){if("undefined"!=typeof e){if(!t)return e;t=t.split(".");for(var n=t.length,i=0;n>i;){if(e=e[t[i]],"undefined"==typeof e)return;i++}return e}}function n(e,n){for(var i,a=0,o=e.length;o>a;a++)if(i=t(e[a],n),"undefined"!=typeof i)return i}function i(e,n){for(var i,o=e.length;o--;){var r=t(e[o],n);"undefined"!=typeof r&&("undefined"==typeof i?i=a.clone(r):a.merge(i,r,!0))}return i}var a=e("zrender/tool/util");return{query:t,deepQuery:n,deepMerge:i}}),n("echarts/util/number",[],function(){function e(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function t(t,n){return"string"==typeof t?e(t).match(/%$/)?parseFloat(t)/100*n:parseFloat(t):t}function n(e,n){return[t(n[0],e.getWidth()),t(n[1],e.getHeight())]}function i(e,n){n instanceof Array||(n=[0,n]);var i=Math.min(e.getWidth(),e.getHeight())/2;return[t(n[0],i),t(n[1],i)]}function a(e){return isNaN(e)?"-":(e=(e+"").split("."),e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:""))}return{parsePercent:t,parseCenter:n,parseRadius:i,addCommas:a}}),n("echarts/util/shape/Icon",["require","zrender/tool/util","zrender/shape/Star","zrender/shape/Heart","zrender/shape/Droplet","zrender/shape/Image","zrender/shape/Base"],function(e){function t(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i+t.height),e.lineTo(n+5*a,i+14*o),e.lineTo(n+t.width,i+3*o),e.lineTo(n+13*a,i),e.lineTo(n+2*a,i+11*o),e.lineTo(n,i+t.height),e.moveTo(n+6*a,i+10*o),e.lineTo(n+14*a,i+2*o),e.moveTo(n+10*a,i+13*o),e.lineTo(n+t.width,i+13*o),e.moveTo(n+13*a,i+10*o),e.lineTo(n+13*a,i+t.height)}function n(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i+t.height),e.lineTo(n+5*a,i+14*o),e.lineTo(n+t.width,i+3*o),e.lineTo(n+13*a,i),e.lineTo(n+2*a,i+11*o),e.lineTo(n,i+t.height),e.moveTo(n+6*a,i+10*o),e.lineTo(n+14*a,i+2*o),e.moveTo(n+10*a,i+13*o),e.lineTo(n+t.width,i+13*o)}function i(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n+4*a,i+15*o),e.lineTo(n+9*a,i+13*o),e.lineTo(n+14*a,i+8*o),e.lineTo(n+11*a,i+5*o),e.lineTo(n+6*a,i+10*o),e.lineTo(n+4*a,i+15*o),e.moveTo(n+5*a,i),e.lineTo(n+11*a,i),e.moveTo(n+5*a,i+o),e.lineTo(n+11*a,i+o),e.moveTo(n,i+2*o),e.lineTo(n+t.width,i+2*o),e.moveTo(n,i+5*o),e.lineTo(n+3*a,i+t.height),e.lineTo(n+13*a,i+t.height),e.lineTo(n+t.width,i+5*o)}function a(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i+3*o),e.lineTo(n+6*a,i+3*o),e.moveTo(n+3*a,i),e.lineTo(n+3*a,i+6*o),e.moveTo(n+3*a,i+8*o),e.lineTo(n+3*a,i+t.height),e.lineTo(n+t.width,i+t.height),e.lineTo(n+t.width,i+3*o),e.lineTo(n+8*a,i+3*o)}function o(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n+6*a,i),e.lineTo(n+2*a,i+3*o),e.lineTo(n+6*a,i+6*o),e.moveTo(n+2*a,i+3*o),e.lineTo(n+14*a,i+3*o),e.lineTo(n+14*a,i+11*o),e.moveTo(n+2*a,i+5*o),e.lineTo(n+2*a,i+13*o),e.lineTo(n+14*a,i+13*o),e.moveTo(n+10*a,i+10*o),e.lineTo(n+14*a,i+13*o),e.lineTo(n+10*a,i+t.height)}function r(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16,r=t.width/2;e.lineWidth=1.5,e.arc(n+r,i+r,r-a,0,2*Math.PI/3),e.moveTo(n+3*a,i+t.height),e.lineTo(n+0*a,i+12*o),e.lineTo(n+5*a,i+11*o),e.moveTo(n,i+8*o),e.arc(n+r,i+r,r-a,Math.PI,5*Math.PI/3),e.moveTo(n+13*a,i),e.lineTo(n+t.width,i+4*o),e.lineTo(n+11*a,i+5*o)}function s(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i),e.lineTo(n,i+t.height),e.lineTo(n+t.width,i+t.height),e.moveTo(n+2*a,i+14*o),e.lineTo(n+7*a,i+6*o),e.lineTo(n+11*a,i+11*o),e.lineTo(n+15*a,i+2*o)}function l(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i),e.lineTo(n,i+t.height),e.lineTo(n+t.width,i+t.height),e.moveTo(n+3*a,i+14*o),e.lineTo(n+3*a,i+6*o),e.lineTo(n+4*a,i+6*o),e.lineTo(n+4*a,i+14*o),e.moveTo(n+7*a,i+14*o),e.lineTo(n+7*a,i+2*o),e.lineTo(n+8*a,i+2*o),e.lineTo(n+8*a,i+14*o),e.moveTo(n+11*a,i+14*o),e.lineTo(n+11*a,i+9*o),e.lineTo(n+12*a,i+9*o),e.lineTo(n+12*a,i+14*o)}function h(e,t){var n=t.x,i=t.y,a=t.width-2,o=t.height-2,r=Math.min(a,o)/2;i+=2,e.moveTo(n+r+3,i+r-3),e.arc(n+r+3,i+r-3,r-1,0,-Math.PI/2,!0),e.lineTo(n+r+3,i+r-3),e.moveTo(n+r,i),e.lineTo(n+r,i+r),e.arc(n+r,i+r,r,-Math.PI/2,2*Math.PI,!0),e.lineTo(n+r,i+r),e.lineWidth=1.5}function m(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;i-=o,e.moveTo(n+1*a,i+2*o),e.lineTo(n+15*a,i+2*o),e.lineTo(n+14*a,i+3*o),e.lineTo(n+2*a,i+3*o),e.moveTo(n+3*a,i+6*o),e.lineTo(n+13*a,i+6*o),e.lineTo(n+12*a,i+7*o),e.lineTo(n+4*a,i+7*o),e.moveTo(n+5*a,i+10*o),e.lineTo(n+11*a,i+10*o),e.lineTo(n+10*a,i+11*o),e.lineTo(n+6*a,i+11*o),e.moveTo(n+7*a,i+14*o),e.lineTo(n+9*a,i+14*o),e.lineTo(n+8*a,i+15*o),e.lineTo(n+7*a,i+15*o)}function V(e,t){var n=t.x,i=t.y,a=t.width,o=t.height,r=a/16,s=o/16,l=2*Math.min(r,s);e.moveTo(n+r+l,i+s+l),e.arc(n+r,i+s,l,Math.PI/4,3*Math.PI),e.lineTo(n+7*r-l,i+6*s-l),e.arc(n+7*r,i+6*s,l,Math.PI/4*5,4*Math.PI),e.arc(n+7*r,i+6*s,l/2,Math.PI/4*5,4*Math.PI),e.moveTo(n+7*r-l/2,i+6*s+l),e.lineTo(n+r+l,i+14*s-l),e.arc(n+r,i+14*s,l,-Math.PI/4,2*Math.PI),e.moveTo(n+7*r+l/2,i+6*s),e.lineTo(n+14*r-l,i+10*s-l/2),e.moveTo(n+16*r,i+10*s),e.arc(n+14*r,i+10*s,l,0,3*Math.PI),e.lineWidth=1.5}function U(e,t){var n=t.x,i=t.y,a=t.width,o=t.height,r=Math.min(a,o)/2;e.moveTo(n+a,i+o/2),e.arc(n+r,i+r,r,0,2*Math.PI),e.arc(n+r,i,r,Math.PI/4,Math.PI/5*4),e.arc(n,i+r,r,-Math.PI/3,Math.PI/3),e.arc(n+a,i+o,r,Math.PI,Math.PI/2*3),e.lineWidth=1.5}function d(e,t){for(var n=t.x,i=t.y,a=t.width,o=t.height,r=Math.round(o/3),s=3;s--;)e.rect(n,i+r*s+2,a,2)}function p(e,t){for(var n=t.x,i=t.y,a=t.width,o=t.height,r=Math.round(a/3),s=3;s--;)e.rect(n+r*s,i,2,o)}function c(e,t){var n=t.x,i=t.y,a=t.width/16;e.moveTo(n+a,i),e.lineTo(n+a,i+t.height),e.lineTo(n+15*a,i+t.height),e.lineTo(n+15*a,i),e.lineTo(n+a,i),e.moveTo(n+3*a,i+3*a),e.lineTo(n+13*a,i+3*a),e.moveTo(n+3*a,i+6*a),e.lineTo(n+13*a,i+6*a),e.moveTo(n+3*a,i+9*a),e.lineTo(n+13*a,i+9*a),e.moveTo(n+3*a,i+12*a),e.lineTo(n+9*a,i+12*a)}function u(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i),e.lineTo(n,i+t.height),e.lineTo(n+t.width,i+t.height),e.lineTo(n+t.width,i),e.lineTo(n,i),e.moveTo(n+4*a,i),e.lineTo(n+4*a,i+8*o),e.lineTo(n+12*a,i+8*o),e.lineTo(n+12*a,i),e.moveTo(n+6*a,i+11*o),e.lineTo(n+6*a,i+13*o),e.lineTo(n+10*a,i+13*o),e.lineTo(n+10*a,i+11*o),e.lineTo(n+6*a,i+11*o)}function y(e,t){var n=t.x,i=t.y,a=t.width,o=t.height;e.moveTo(n,i+o/2),e.lineTo(n+a,i+o/2),e.moveTo(n+a/2,i),e.lineTo(n+a/2,i+o)}function b(e,t){var n=t.width/2,i=t.height/2,a=Math.min(n,i);e.moveTo(t.x+n+a,t.y+i),e.arc(t.x+n,t.y+i,a,0,2*Math.PI),e.closePath()}function g(e,t){e.rect(t.x,t.y,t.width,t.height),e.closePath()}function k(e,t){var n=t.width/2,i=t.height/2,a=t.x+n,o=t.y+i,r=Math.min(n,i);e.moveTo(a,o-r),e.lineTo(a+r,o+r),e.lineTo(a-r,o+r),e.lineTo(a,o-r),e.closePath()}function f(e,t){var n=t.width/2,i=t.height/2,a=t.x+n,o=t.y+i,r=Math.min(n,i);e.moveTo(a,o-r),e.lineTo(a+r,o),e.lineTo(a,o+r),e.lineTo(a-r,o),e.lineTo(a,o-r),e.closePath()}function _(e,t){var n=t.x,i=t.y,a=t.width/16;e.moveTo(n+8*a,i),e.lineTo(n+a,i+t.height),e.lineTo(n+8*a,i+t.height/4*3),e.lineTo(n+15*a,i+t.height),e.lineTo(n+8*a,i),e.closePath()}function x(t,n){var i=e("zrender/shape/Star"),a=n.width/2,o=n.height/2;i.prototype.buildPath(t,{x:n.x+a,y:n.y+o,r:Math.min(a,o),n:n.n||5})}function L(t,n){var i=e("zrender/shape/Heart");i.prototype.buildPath(t,{x:n.x+n.width/2,y:n.y+.2*n.height,a:n.width/2,b:.8*n.height})}function W(t,n){var i=e("zrender/shape/Droplet");i.prototype.buildPath(t,{x:n.x+.5*n.width,y:n.y+.5*n.height,a:.5*n.width,b:.8*n.height})}function X(e,t){var n=t.x,i=t.y-t.height/2*1.5,a=t.width/2,o=t.height/2,r=Math.min(a,o);e.arc(n+a,i+o,r,Math.PI/5*4,Math.PI/5),e.lineTo(n+a,i+o+1.5*r),e.closePath()}function K(t,n,i){var a=e("zrender/shape/Image");this._imageShape=this._imageShape||new a({style:{}});for(var o in n)this._imageShape.style[o]=n[o];this._imageShape.brush(t,!1,i)}function w(e){v.call(this,e)}var I=e("zrender/tool/util"),v=e("zrender/shape/Base");return w.prototype={type:"icon",iconLibrary:{mark:t,markUndo:n,markClear:i,dataZoom:a,dataZoomReset:o,restore:r,lineChart:s,barChart:l,pieChart:h,funnelChart:m,forceChart:V,chordChart:U,stackChart:d,tiledChart:p,dataView:c,saveAsImage:u,cross:y,circle:b,rectangle:g,triangle:k,diamond:f,arrow:_,star:x,heart:L,droplet:W,pin:X,image:K},brush:function(t,n,i){var a=n?this.highlightStyle:this.style;a=a||{};var o=a.iconType||this.style.iconType;if("image"===o){var r=e("zrender/shape/Image");r.prototype.brush.call(this,t,n,i)}else{var a=this.beforeBrush(t,n);switch(t.beginPath(),this.buildPath(t,a,i),a.brushType){case"both":t.fill();case"stroke":a.lineWidth>0&&t.stroke();break;default:t.fill()}this.drawText(t,a,this.style),this.afterBrush(t)}},buildPath:function(e,t,n){this.iconLibrary[t.iconType]?this.iconLibrary[t.iconType].call(this,e,t,n):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y),e.closePath())},getRect:function(e){return e.__rect?e.__rect:(e.__rect={x:Math.round(e.x),y:Math.round(e.y-("pin"==e.iconType?e.height/2*1.5:0)),width:e.width,height:e.height},e.__rect)},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.__rect;i||(i=this.style.__rect=this.getRect(this.style));var a=i.height<8||i.width<8?4:0;return e>=i.x-a&&e<=i.x+i.width+a&&t>=i.y-a&&t<=i.y+i.height+a?!0:!1}},I.inherits(w,v),w}),n("echarts/util/shape/MarkLine",["require","zrender/shape/Base","./Icon","zrender/shape/Line","zrender/shape/BrokenLine","zrender/tool/matrix","zrender/tool/area","zrender/shape/util/dashedLineTo","zrender/shape/util/smoothSpline","zrender/tool/util"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("./Icon"),a=e("zrender/shape/Line"),o=new a({}),r=e("zrender/shape/BrokenLine"),s=new r({}),l=e("zrender/tool/matrix"),h=e("zrender/tool/area"),m=e("zrender/shape/util/dashedLineTo"),V=e("zrender/shape/util/smoothSpline"),U=e("zrender/tool/util");return t.prototype={type:"mark-line",brush:function(e,t){var n=this.style;t&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),e.save(),this.setContext(e,n),this.setTransform(e),e.save(),e.beginPath(),this.buildLinePath(e,n,this.style.lineWidth||1),e.stroke(),e.restore(),this.brushSymbol(e,n,0),this.brushSymbol(e,n,1),this.drawText(e,n,this.style),e.restore()},buildLinePath:function(e,t,n){var i=t.pointList||this.getPointList(t);t.pointList=i;var a=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType)if("spline"!==t.smooth){var o=n*("dashed"==t.lineType?5:1);e.moveTo(i[0][0],i[0][1]);for(var r=1;a>r;r++)m(e,i[r-1][0],i[r-1][1],i[r][0],i[r][1],o)}else for(var r=1;a>r;r+=2)e.moveTo(i[r-1][0],i[r-1][1]),e.lineTo(i[r][0],i[r][1])}else{e.moveTo(i[0][0],i[0][1]);for(var r=1;a>r;r++)e.lineTo(i[r][0],i[r][1])}},brushSymbol:function(e,t,n){if("none"!=t.symbol[n]){e.save(),e.beginPath(),e.lineWidth=t.symbolBorder,e.strokeStyle=t.symbolBorderColor,t.iconType=t.symbol[n].replace("empty","").toLowerCase(),t.symbol[n].match("empty")&&(e.fillStyle="#fff");var a,o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length)),r=0===n?t.pointList[0][0]:t.pointList[o-1][0],s=0===n?t.pointList[0][1]:t.pointList[o-1][1],h="undefined"!=typeof t.symbolRotate[n]?t.symbolRotate[n]-0:0;if(0!==h&&(a=l.create(),l.identity(a),(r||s)&&l.translate(a,a,[-r,-s]),l.rotate(a,a,h*Math.PI/180),(r||s)&&l.translate(a,a,[r,s]),e.transform.apply(e,a)),"arrow"==t.iconType&&0===h)this.buildArrawPath(e,t,n);else{var m=t.symbolSize[n];t.x=r-m,t.y=s-m,t.width=2*m,t.height=2*m,i.prototype.buildPath(e,t)}e.closePath(),e.fill(),e.stroke(),e.restore()}},buildArrawPath:function(e,t,n){var i=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length)),a=2*t.symbolSize[n],o=t.pointList[0][0],r=t.pointList[i-1][0],s=t.pointList[0][1],l=t.pointList[i-1][1],h=0;"spline"===t.smooth&&(h=.2);var m=Math.atan(Math.abs((l-s)/(o-r)));0===n?r>o?l>s?m=2*Math.PI-m+h:m+=h:l>s?m+=Math.PI-h:m=Math.PI-m-h:o>r?s>l?m=2*Math.PI-m+h:m+=h:s>l?m+=Math.PI-h:m=Math.PI-m-h;var V=Math.PI/8,U=0===n?o:r,d=0===n?s:l,p=[[U+a*Math.cos(m-V),d-a*Math.sin(m-V)],[U+.6*a*Math.cos(m),d-.6*a*Math.sin(m)],[U+a*Math.cos(m+V),d-a*Math.sin(m+V)]];e.moveTo(U,d);for(var c=0,u=p.length;u>c;c++)e.lineTo(p[c][0],p[c][1]);e.lineTo(U,d)},getPointList:function(e){var t=[[e.xStart,e.yStart],[e.xEnd,e.yEnd]];if("spline"===e.smooth){var n=t[1][0],i=t[1][1];t[3]=[n,i],t[1]=this.getOffetPoint(t[0],t[3]),t[2]=this.getOffetPoint(t[3],t[0]),t=V(t,!1),t[t.length-1]=[n,i]}return t},getOffetPoint:function(e,t){var n,i=Math.sqrt(Math.round((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])))/3,a=[e[0],e[1]],o=.2;if(e[0]!=t[0]&&e[1]!=t[1]){var r=(t[1]-e[1])/(t[0]-e[0]);n=Math.atan(r)}else n=e[0]==t[0]?(e[1]<=t[1]?1:-1)*Math.PI/2:0;var s,l;return e[0]<=t[0]?(n-=o,s=Math.round(Math.cos(n)*i),l=Math.round(Math.sin(n)*i),a[0]+=s,a[1]+=l):(n+=o,s=Math.round(Math.cos(n)*i),l=Math.round(Math.sin(n)*i),a[0]-=s,a[1]-=l),a},getRect:function(e){if(e.__rect)return e.__rect;var t=e.lineWidth||1;return e.__rect={x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t},e.__rect},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.__rect;return i||(i=this.style.__rect=this.getRect(this.style)),e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?"spline"!==this.style.smooth?h.isInside(o,this.style,e,t):h.isInside(s,this.style,e,t):!1}},U.inherits(t,n),t}),n("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/Polygon"),a=new i({}),o=e("zrender/tool/util");return t.prototype={type:"symbol",buildPath:function(e,t){var n=t.pointList,i=n.length;if(0!==i)for(var a,o,r,s,l,h=1e4,m=Math.ceil(i/h),V=n[0]instanceof Array,U=t.size?t.size:2,d=U,p=U/2,c=2*Math.PI,u=0;m>u;u++){e.beginPath(),a=u*h,o=a+h,o=o>i?i:o;for(var y=a;o>y;y++)if(t.random&&(r=t["randomMap"+y%20]/100,d=U*r*r,p=d/2),V?(s=n[y][0],l=n[y][1]):(s=n[y].x,l=n[y].y),3>d)e.rect(s-p,l-p,d,d);else switch(t.iconType){case"circle":e.moveTo(s,l),e.arc(s,l,p,0,c,!0);break;case"diamond":e.moveTo(s,l-p),e.lineTo(s+p/3,l-p/3),e.lineTo(s+p,l),e.lineTo(s+p/3,l+p/3),e.lineTo(s,l+p),e.lineTo(s-p/3,l+p/3),e.lineTo(s-p,l),e.lineTo(s-p/3,l-p/3),e.lineTo(s,l-p);break;default:e.rect(s-p,l-p,d,d)}if(e.closePath(),m-1>u)switch(t.brushType){case"both":e.fill(),t.lineWidth>0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||a.getRect(e)},isCover:e("./normalIsCover")},o.inherits(t,n),t}),n("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e,t,n,i,a){var o,r=n.style.pointList,s=r.length;if(!t){if(o=[],"vertical"!=n._orient)for(var l=r[0][1],h=0;s>h;h++)o[h]=[r[h][0],l];else for(var m=r[0][0],h=0;s>h;h++)o[h]=[m,r[h][1]];"half-smooth-polygon"==n.type&&(o[s-1]=p.clone(r[s-1]),o[s-2]=p.clone(r[s-2])),t={style:{pointList:o}}}o=t.style.pointList;var V=o.length;n.style.pointList=V==s?o:s>V?o.concat(r.slice(V)):o.slice(0,s),e.addShape(n),e.animate(n.id,"style").when(i,{pointList:r}).start(a)}function n(e,t){for(var n=arguments.length,i=2;n>i;i++){var a=arguments[i];e.style[a]=t.style[a]}}function i(e,t,i,a,o){var r=i.style;t||(t={position:i.position,style:{x:r.x,y:"vertical"==i._orient?r.y+r.height:r.y,width:"vertical"==i._orient?r.width:0,height:"vertical"!=i._orient?r.height:0}});var s=r.x,l=r.y,h=r.width,m=r.height,V=[i.position[0],i.position[1]];n(i,t,"x","y","width","height"),i.position=t.position,e.addShape(i),(V[0]!=t.position[0]||V[1]!=t.position[1])&&e.animate(i.id,"").when(a,{position:V}).start(o),e.animate(i.id,"style").when(a,{x:s,y:l,width:h,height:m}).start(o)}function a(e,t,n,i,a){if(!t){var o=n.style.y;t={style:{y:[o[0],o[0],o[0],o[0]]}}}var r=n.style.y;n.style.y=t.style.y,e.addShape(n),e.animate(n.id,"style").when(i,{y:r}).start(a)}function o(e,t,n,i,a){var o=n.style.x,r=n.style.y,s=n.style.r0,l=n.style.r;"r"!=n._animationAdd?(n.style.r0=0,n.style.r=0,n.rotation=[2*Math.PI,o,r],e.addShape(n),e.animate(n.id,"style").when(i,{r0:s,r:l}).start(a),e.animate(n.id,"").when(Math.round(i/3*2),{rotation:[0,o,r]}).start(a)):(n.style.r0=n.style.r,e.addShape(n),e.animate(n.id,"style").when(i,{r0:s}).start(a))}function r(e,t,i,a,o){t||(t="r"!=i._animationAdd?{style:{startAngle:i.style.startAngle,endAngle:i.style.startAngle}}:{style:{r0:i.style.r}});var r=i.style.startAngle,s=i.style.endAngle;n(i,t,"startAngle","endAngle"),e.addShape(i),e.animate(i.id,"style").when(a,{startAngle:r,endAngle:s}).start(o)}function s(e,t,i,a,o){t||(t={style:{x:"left"==i.style.textAlign?i.style.x+100:i.style.x-100,y:i.style.y}});var r=i.style.x,s=i.style.y;n(i,t,"x","y"),e.addShape(i),e.animate(i.id,"style").when(a,{x:r,y:s}).start(o)}function l(t,n,i,a,o){var r=e("zrender/shape/Polygon").prototype.getRect(i.style),s=r.x+r.width/2,l=r.y+r.height/2;i.scale=[.1,.1,s,l],t.addShape(i),t.animate(i.id,"").when(a,{scale:[1,1,s,l]}).start(o)}function h(e,t,i,a,o){t||(t={style:{source0:0,source1:i.style.source1>0?360:-360,target0:0,target1:i.style.target1>0?360:-360}});var r=i.style.source0,s=i.style.source1,l=i.style.target0,h=i.style.target1;t.style&&n(i,t,"source0","source1","target0","target1"),e.addShape(i),e.animate(i.id,"style").when(a,{source0:r,source1:s,target0:l,target1:h}).start(o)}function m(e,t,n,i,a){t||(t={style:{angle:n.style.startAngle}});var o=n.style.angle;n.style.angle=t.style.angle,e.addShape(n),e.animate(n.id,"style").when(i,{angle:o}).start(a)}function V(e,t,n,a,o,r){if(n.style._x=n.style.x,n.style._y=n.style.y,n.style._width=n.style.width,n.style._height=n.style.height,t)i(e,t,n,a,o);else{var s=n._x||0,l=n._y||0;n.scale=[.01,.01,s,l],e.addShape(n),e.animate(n.id,"").delay(r).when(a,{scale:[1,1,s,l]}).start(o||"QuinticOut") |
|
9 | }}function U(e,t,i,a,o){t||(t={style:{xStart:i.style.xStart,yStart:i.style.yStart,xEnd:i.style.xStart,yEnd:i.style.yStart}});var r=i.style.xStart,s=i.style.xEnd,l=i.style.yStart,h=i.style.yEnd;n(i,t,"xStart","xEnd","yStart","yEnd"),e.addShape(i),e.animate(i.id,"style").when(a,{xStart:r,xEnd:s,yStart:l,yEnd:h}).start(o)}function d(e,t,n,i,a){n.style.smooth?t?e.addShape(n):(n.style.pointListLength=1,e.addShape(n),n.style.pointList=n.style.pointList||n.getPointList(n.style),e.animate(n.id,"style").when(i,{pointListLength:n.style.pointList.length}).start(a||"QuinticOut")):(n.style.pointList=t?t.style.pointList:[[n.style.xStart,n.style.yStart],[n.style.xStart,n.style.yStart]],e.addShape(n),e.animate(n.id,"style").when(i,{pointList:[[n.style.xStart,n.style.yStart],[n._x||0,n._y||0]]}).start(a||"QuinticOut"))}var p=e("zrender/tool/util");return{pointList:t,rectangle:i,candle:a,ring:o,sector:r,text:s,polygon:l,ribbon:h,gaugePointer:m,icon:V,line:U,markline:d}}),n("echarts/util/ecEffect",["require","../util/ecData","zrender/shape/Circle","zrender/shape/Image","../util/shape/Icon","../util/shape/Symbol","zrender/tool/env"],function(e){function t(e,t,n,i){var o=n.effect,l=o.color||n.style.strokeColor||n.style.color,m=o.shadowColor||l,V=o.scaleSize,U="undefined"!=typeof o.shadowBlur?o.shadowBlur:V,d=new s({zlevel:i,style:{brushType:"stroke",iconType:"pin"!=n.style.iconType&&"droplet"!=n.style.iconType?n.style.iconType:"circle",x:U+1,y:U+1,n:n.style.n,width:n.style._width*V,height:n.style._height*V,lineWidth:1,strokeColor:l,shadowColor:m,shadowBlur:U},draggable:!1,hoverable:!1});h&&(d.style.image=e.shapeToImage(d,d.style.width+2*U+2,d.style.height+2*U+2).style.image,d=new r({zlevel:d.zlevel,style:d.style,draggable:!1,hoverable:!1})),a.clone(n,d),d.position=n.position,t.push(d),e.addShape(d);var p=window.devicePixelRatio||1,c=(d.style.width/p-n.style._width)/2;d.style.x=n.style._x-c,d.style.y=n.style._y-c;var u=100*(o.period+10*Math.random());e.modShape(n.id,{invisible:!0});var y=d.style.x+d.style.width/2/p,b=d.style.y+d.style.height/2/p;e.modShape(d.id,{scale:[.1,.1,y,b]}),e.animate(d.id,"",o.loop).when(u,{scale:[1,1,y,b]}).done(function(){n.effect.show=!1,e.delShape(d.id)}).start()}function n(e,t,n,i){var a=n.effect,o=a.color||n.style.strokeColor||n.style.color,r=a.scaleSize,s=a.shadowColor||o,h="undefined"!=typeof a.shadowBlur?a.shadowBlur:2*r,m=window.devicePixelRatio||1,V=new l({zlevel:i,position:n.position,scale:n.scale,style:{pointList:n.style.pointList,iconType:n.style.iconType,color:o,strokeColor:o,shadowColor:s,shadowBlur:h*m,random:!0,brushType:"fill",lineWidth:1,size:n.style.size},draggable:!1,hoverable:!1});t.push(V),e.addShape(V),e.modShape(n.id,{invisible:!0});for(var U=Math.round(100*a.period),d={},p={},c=0;20>c;c++)V.style["randomMap"+c]=0,d={},d["randomMap"+c]=100,p={},p["randomMap"+c]=0,V.style["randomMap"+c]=100*Math.random(),e.animate(V.id,"style",!0).when(U,d).when(2*U,p).when(3*U,d).when(4*U,d).delay(Math.random()*U*c).start()}function i(e,t,n,i){var s,l=n.effect,m=l.color||n.style.strokeColor||n.style.color,V=l.shadowColor||n.style.strokeColor||m,U=n.style.lineWidth*l.scaleSize,d="undefined"!=typeof l.shadowBlur?l.shadowBlur:U,p=new o({zlevel:i,style:{x:d,y:d,r:U,color:m,shadowColor:V,shadowBlur:d},draggable:!1,hoverable:!1});h?(p.style.image=e.shapeToImage(p,2*(U+d),2*(U+d)).style.image,p=new r({zlevel:p.zlevel,style:p.style,draggable:!1,hoverable:!1}),s=d):s=0,a.clone(n,p),p.position=n.position,t.push(p),e.addShape(p),p.style.x=n.style.xStart-s,p.style.y=n.style.yStart-s;var c=(n.style.xStart-n.style.xEnd)*(n.style.xStart-n.style.xEnd)+(n.style.yStart-n.style.yEnd)*(n.style.yStart-n.style.yEnd),u=Math.round(Math.sqrt(Math.round(c*l.period*l.period)));if(n.style.smooth){var y=n.style.pointList||n.getPointList(n.style),b=y.length;u=Math.round(u/b);for(var g=e.animate(p.id,"style",l.loop),k=Math.ceil(b/8),f=0;b-k>f;f+=k)g.when(u*(f+1),{x:y[f][0]-s,y:y[f][1]-s});g.when(u*b,{x:y[b-1][0]-s,y:y[b-1][1]-s}),g.done(function(){n.effect.show=!1,e.delShape(p.id)}),g.start("spline")}else e.animate(p.id,"style",l.loop).when(u,{x:n._x-s,y:n._y-s}).done(function(){n.effect.show=!1,e.delShape(p.id)}).start()}var a=e("../util/ecData"),o=e("zrender/shape/Circle"),r=e("zrender/shape/Image"),s=e("../util/shape/Icon"),l=e("../util/shape/Symbol"),h=e("zrender/tool/env").canvasSupported;return{point:t,largePoint:n,line:i}}),n("zrender/shape/Star",["require","../tool/math","./Base","../tool/util"],function(e){var t=e("../tool/math"),n=t.sin,i=t.cos,a=Math.PI,o=e("./Base"),r=function(e){o.call(this,e)};return r.prototype={type:"star",buildPath:function(e,t){var o=t.n;if(o&&!(2>o)){var r=t.x,s=t.y,l=t.r,h=t.r0;null==h&&(h=o>4?l*i(2*a/o)/i(a/o):l/3);var m=a/o,V=-a/2,U=r+l*i(V),d=s+l*n(V);V+=m;var p=t.pointList=[];p.push([U,d]);for(var c,u=0,y=2*o-1;y>u;u++)c=u%2===0?h:l,p.push([r+c*i(V),s+c*n(V)]),V+=m;p.push([U,d]),e.moveTo(p[0][0],p[0][1]);for(var u=0;u<p.length;u++)e.lineTo(p[u][0],p[u][1]);e.closePath()}},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(r,o),r}),n("zrender/shape/Heart",["require","./Base","./util/PathProxy","zrender/tool/area","../tool/util"],function(e){"use strict";var t=e("./Base"),n=e("./util/PathProxy"),i=e("zrender/tool/area"),a=function(e){t.call(this,e),this._pathProxy=new n};return a.prototype={type:"heart",buildPath:function(e,t){var i=this._pathProxy||new n;i.begin(e),i.moveTo(t.x,t.y),i.bezierCurveTo(t.x+t.a/2,t.y-2*t.b/3,t.x+2*t.a,t.y+t.b/3,t.x,t.y+t.b),i.bezierCurveTo(t.x-2*t.a,t.y+t.b/3,t.x-t.a/2,t.y-2*t.b/3,t.x,t.y),i.closePath()},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var a=this.getRect(this.style);return e>=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height?i.isInsidePath(this._pathProxy.pathCommands,this.style.lineWidth,this.style.brushType,e,t):void 0}},e("../tool/util").inherits(a,t),a}),n("zrender/shape/Droplet",["require","./Base","./util/PathProxy","zrender/tool/area","../tool/util"],function(e){"use strict";var t=e("./Base"),n=e("./util/PathProxy"),i=e("zrender/tool/area"),a=function(e){t.call(this,e),this._pathProxy=new n};return a.prototype={type:"droplet",buildPath:function(e,t){var i=this._pathProxy||new n;i.begin(e),i.moveTo(t.x,t.y+t.a),i.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+3*t.a/2,t.y-t.a/3,t.x,t.y-t.b),i.bezierCurveTo(t.x-3*t.a/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a),i.closePath()},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var a=this.getRect(this.style);return e>=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height?i.isInsidePath(this._pathProxy.pathCommands,this.style.lineWidth,this.style.brushType,e,t):void 0}},e("../tool/util").inherits(a,t),a}),n("zrender/tool/math",[],function(){function e(e,t){return Math.sin(t?e*a:e)}function t(e,t){return Math.cos(t?e*a:e)}function n(e){return e*a}function i(e){return e/a}var a=Math.PI/180;return{sin:e,cos:t,degreeToRadian:n,radianToDegree:i}}),n("zrender/shape/util/PathProxy",["require","../../tool/vector"],function(e){var t=e("../../tool/vector"),n=function(e,t){this.command=e,this.points=t||null},i=function(){this.pathCommands=[],this._ctx=null,this._min=[],this._max=[]};return i.prototype.fastBoundingRect=function(){var e=this._min,n=this._max;e[0]=e[1]=1/0,n[0]=n[1]=-1/0;for(var i=0;i<this.pathCommands.length;i++){var a=this.pathCommands[i],o=a.points;switch(a.command){case"M":t.min(e,e,o),t.max(n,n,o);break;case"L":t.min(e,e,o),t.max(n,n,o);break;case"C":for(var r=0;6>r;r+=2)e[0]=Math.min(e[0],e[0],o[r]),e[1]=Math.min(e[1],e[1],o[r+1]),n[0]=Math.max(n[0],n[0],o[r]),n[1]=Math.max(n[1],n[1],o[r+1]);break;case"Q":for(var r=0;4>r;r+=2)e[0]=Math.min(e[0],e[0],o[r]),e[1]=Math.min(e[1],e[1],o[r+1]),n[0]=Math.max(n[0],n[0],o[r]),n[1]=Math.max(n[1],n[1],o[r+1]);break;case"A":var s=o[0],l=o[1],h=o[2],m=o[3];e[0]=Math.min(e[0],e[0],s-h),e[1]=Math.min(e[1],e[1],l-m),n[0]=Math.max(n[0],n[0],s+h),n[1]=Math.max(n[1],n[1],l+m)}}return{x:e[0],y:e[1],width:n[0]-e[0],height:n[1]-e[1]}},i.prototype.begin=function(e){return this._ctx=e||null,this.pathCommands.length=0,this},i.prototype.moveTo=function(e,t){return this.pathCommands.push(new n("M",[e,t])),this._ctx&&this._ctx.moveTo(e,t),this},i.prototype.lineTo=function(e,t){return this.pathCommands.push(new n("L",[e,t])),this._ctx&&this._ctx.lineTo(e,t),this},i.prototype.bezierCurveTo=function(e,t,i,a,o,r){return this.pathCommands.push(new n("C",[e,t,i,a,o,r])),this._ctx&&this._ctx.bezierCurveTo(e,t,i,a,o,r),this},i.prototype.quadraticCurveTo=function(e,t,i,a){return this.pathCommands.push(new n("Q",[e,t,i,a])),this._ctx&&this._ctx.quadraticCurveTo(e,t,i,a),this},i.prototype.arc=function(e,t,i,a,o,r){return this.pathCommands.push(new n("A",[e,t,i,i,a,o-a,0,r?0:1])),this._ctx&&this._ctx.arc(e,t,i,a,o,r),this},i.prototype.arcTo=function(e,t,n,i,a){return this._ctx&&this._ctx.arcTo(e,t,n,i,a),this},i.prototype.rect=function(e,t,n,i){return this._ctx&&this._ctx.rect(e,t,n,i),this},i.prototype.closePath=function(){return this.pathCommands.push(new n("z")),this._ctx&&this._ctx.closePath(),this},i.prototype.isEmpty=function(){return 0===this.pathCommands.length},i.PathSegment=n,i}),n("zrender/shape/Line",["require","./Base","./util/dashedLineTo","../tool/util"],function(e){var t=e("./Base"),n=e("./util/dashedLineTo"),i=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return i.prototype={type:"line",buildPath:function(e,t){if(t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var i=(t.lineWidth||1)*("dashed"==t.lineType?5:1);n(e,t.xStart,t.yStart,t.xEnd,t.yEnd,i)}}else e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd)},getRect:function(e){if(e.__rect)return e.__rect;var t=e.lineWidth||1;return e.__rect={x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t},e.__rect}},e("../tool/util").inherits(i,t),i}),n("zrender/shape/BrokenLine",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),i=e("./util/smoothBezier"),a=e("./util/dashedLineTo"),o=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return o.prototype={type:"broken-line",buildPath:function(e,t){var o=t.pointList;if(!(o.length<2)){var r=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&"spline"!==t.smooth){var s=i(o,t.smooth,!1,t.smoothConstraint);e.moveTo(o[0][0],o[0][1]);for(var l,h,m,V=0;r-1>V;V++)l=s[2*V],h=s[2*V+1],m=o[V+1],e.bezierCurveTo(l[0],l[1],h[0],h[1],m[0],m[1])}else if("spline"===t.smooth&&(o=n(o),r=o.length),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var U=(t.lineWidth||1)*("dashed"==t.lineType?5:1);e.moveTo(o[0][0],o[0][1]);for(var V=1;r>V;V++)a(e,o[V-1][0],o[V-1][1],o[V][0],o[V][1],U)}}else{e.moveTo(o[0][0],o[0][1]);for(var V=1;r>V;V++)e.lineTo(o[V][0],o[V][1])}}},getRect:function(t){return e("./Polygon").prototype.getRect(t)}},e("../tool/util").inherits(o,t),o}),n("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,n,i,a,o,r){if(t.setLineDash)return e[0]=e[1]=r,t.setLineDash(e),t.moveTo(n,i),void t.lineTo(a,o);r="number"!=typeof r?5:r;var s=a-n,l=o-i,h=Math.floor(Math.sqrt(s*s+l*l)/r);s/=h,l/=h;for(var m=!0,V=0;h>V;++V)m?t.moveTo(n,i):t.lineTo(n,i),m=!m,n+=s,i+=l;t.lineTo(a,o)}}),n("zrender/shape/util/smoothSpline",["require","../../tool/vector"],function(e){function t(e,t,n,i,a,o,r){var s=.5*(n-e),l=.5*(i-t);return(2*(t-n)+s+l)*r+(-3*(t-n)-2*s-l)*o+s*a+t}var n=e("../../tool/vector");return function(e,i){for(var a=e.length,o=[],r=0,s=1;a>s;s++)r+=n.distance(e[s-1],e[s]);var l=r/5;l=a>l?a:l;for(var s=0;l>s;s++){var h,m,V,U=s/(l-1)*(i?a:a-1),d=Math.floor(U),p=U-d,c=e[d%a];i?(h=e[(d-1+a)%a],m=e[(d+1)%a],V=e[(d+2)%a]):(h=e[0===d?d:d-1],m=e[d>a-2?a-1:d+1],V=e[d>a-3?a-1:d+2]);var u=p*p,y=p*u;o.push([t(h[0],c[0],m[0],V[0],p,u,y),t(h[1],c[1],m[1],V[1],p,u,y)])}return o}}),n("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,i,a){var o,r,s,l,h=[],m=[],V=[],U=[],d=!!a;if(d){s=[1/0,1/0],l=[-1/0,-1/0];for(var p=0,c=e.length;c>p;p++)t.min(s,s,e[p]),t.max(l,l,e[p]);t.min(s,s,a[0]),t.max(l,l,a[1])}for(var p=0,c=e.length;c>p;p++){var o,r,u=e[p];if(i)o=e[p?p-1:c-1],r=e[(p+1)%c];else{if(0===p||p===c-1){h.push(e[p]);continue}o=e[p-1],r=e[p+1]}t.sub(m,r,o),t.scale(m,m,n);var y=t.distance(u,o),b=t.distance(u,r),g=y+b;0!==g&&(y/=g,b/=g),t.scale(V,m,-y),t.scale(U,m,b);var k=t.add([],u,V),f=t.add([],u,U);d&&(t.max(k,k,s),t.min(k,k,l),t.max(f,f,s),t.min(f,f,l)),h.push(k),h.push(f)}return i&&h.push(h.shift()),h}}),n("zrender/shape/Polygon",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),i=e("./util/smoothBezier"),a=e("./util/dashedLineTo"),o=function(e){t.call(this,e)};return o.prototype={type:"polygon",brush:function(e,t){var n=this.style;t&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),e.save(),this.setContext(e,n),this.setTransform(e);var i=!1;("fill"==n.brushType||"both"==n.brushType||"undefined"==typeof n.brushType)&&(e.beginPath(),"dashed"==n.lineType||"dotted"==n.lineType?(this.buildPath(e,{lineType:"solid",lineWidth:n.lineWidth,pointList:n.pointList}),i=!1):(this.buildPath(e,n),i=!0),e.closePath(),e.fill()),n.lineWidth>0&&("stroke"==n.brushType||"both"==n.brushType)&&(i||(e.beginPath(),this.buildPath(e,n)),e.stroke()),this.drawText(e,n,this.style),e.restore()},buildPath:function(e,t){var o=t.pointList;if(!(o.length<2))if(t.smooth&&"spline"!==t.smooth){var r=i(o,t.smooth,!0,t.smoothConstraint);e.moveTo(o[0][0],o[0][1]);for(var s,l,h,m=o.length,V=0;m>V;V++)s=r[2*V],l=r[2*V+1],h=o[(V+1)%m],e.bezierCurveTo(s[0],s[1],l[0],l[1],h[0],h[1])}else if("spline"===t.smooth&&(o=n(o,!0)),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var U=t._dashLength||(t.lineWidth||1)*("dashed"==t.lineType?5:1);t._dashLength=U,e.moveTo(o[0][0],o[0][1]);for(var V=1,d=o.length;d>V;V++)a(e,o[V-1][0],o[V-1][1],o[V][0],o[V][1],U);a(e,o[o.length-1][0],o[o.length-1][1],o[0][0],o[0][1],U)}}else{e.moveTo(o[0][0],o[0][1]);for(var V=1,d=o.length;d>V;V++)e.lineTo(o[V][0],o[V][1]);e.lineTo(o[0][0],o[0][1])}},getRect:function(e){if(e.__rect)return e.__rect;for(var t=Number.MAX_VALUE,n=Number.MIN_VALUE,i=Number.MAX_VALUE,a=Number.MIN_VALUE,o=e.pointList,r=0,s=o.length;s>r;r++)o[r][0]<t&&(t=o[r][0]),o[r][0]>n&&(n=o[r][0]),o[r][1]<i&&(i=o[r][1]),o[r][1]>a&&(a=o[r][1]);var l;return l="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(t-l/2),y:Math.round(i-l/2),width:n-t+l,height:a-i+l},e.__rect}},e("../tool/util").inherits(o,t),o}),n("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.__rect;return i||(i=this.style.__rect=this.getRect(this.style)),e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height}}),n("echarts/component/dataView",["require","./base","../config","zrender/tool/util","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.dom=o.dom,this._tDom=document.createElement("div"),this._textArea=document.createElement("textArea"),this._buttonRefresh=document.createElement("button"),this._buttonClose=document.createElement("button"),this._hasShow=!1,this._zrHeight=i.getHeight(),this._zrWidth=i.getWidth(),this._tDom.className="echarts-dataview",this.hide(),this.dom.firstChild.appendChild(this._tDom),window.addEventListener?(this._tDom.addEventListener("click",this._stop),this._tDom.addEventListener("mousewheel",this._stop),this._tDom.addEventListener("mousemove",this._stop),this._tDom.addEventListener("mousedown",this._stop),this._tDom.addEventListener("mouseup",this._stop),this._tDom.addEventListener("touchstart",this._stop),this._tDom.addEventListener("touchmove",this._stop),this._tDom.addEventListener("touchend",this._stop)):(this._tDom.attachEvent("onclick",this._stop),this._tDom.attachEvent("onmousewheel",this._stop),this._tDom.attachEvent("onmousemove",this._stop),this._tDom.attachEvent("onmousedown",this._stop),this._tDom.attachEvent("onmouseup",this._stop))}var n=e("./base"),i=e("../config"),a=e("zrender/tool/util");return t.prototype={type:i.COMPONENT_TYPE_DATAVIEW,_lang:["Data View","close","refresh"],_gCssText:"position:absolute;display:block;overflow:hidden;transition:height 0.8s,background-color 1s;-moz-transition:height 0.8s,background-color 1s;-webkit-transition:height 0.8s,background-color 1s;-o-transition:height 0.8s,background-color 1s;z-index:1;left:0;top:0;",hide:function(){this._sizeCssText="width:"+this._zrWidth+"px;height:0px;background-color:#f0ffff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},show:function(e){this._hasShow=!0;var t=this.query(this.option,"toolbox.feature.dataView.lang")||this._lang;this.option=e,this._tDom.innerHTML='<p style="padding:8px 0;margin:0 0 10px 0;border-bottom:1px solid #eee">'+(t[0]||this._lang[0])+"</p>",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;height:"+(this._zrHeight-100)+"px;";var n=this.query(this.option,"toolbox.feature.dataView.optionToContent");this._textArea.value="function"!=typeof n?this._optionToContent():n(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var i=this;this._buttonClose.onclick=function(){i.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){i._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;height:"+this._zrHeight+"px;background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,n,a,o,r,s=[],l="";if(this.option.xAxis)for(s=this.option.xAxis instanceof Array?this.option.xAxis:[this.option.xAxis],e=0,a=s.length;a>e;e++)if("category"==(s[e].type||"category")){for(r=[],t=0,n=s[e].data.length;n>t;t++)o=s[e].data[t],r.push("undefined"!=typeof o.value?o.value:o);l+=r.join(", ")+"\n\n"}if(this.option.yAxis)for(s=this.option.yAxis instanceof Array?this.option.yAxis:[this.option.yAxis],e=0,a=s.length;a>e;e++)if("category"==s[e].type){for(r=[],t=0,n=s[e].data.length;n>t;t++)o=s[e].data[t],r.push("undefined"!=typeof o.value?o.value:o);l+=r.join(", ")+"\n\n"}var h,m=this.option.series;for(e=0,a=m.length;a>e;e++){for(r=[],t=0,n=m[e].data.length;n>t;t++)o=m[e].data[t],h=m[e].type==i.CHART_TYPE_PIE||m[e].type==i.CHART_TYPE_MAP?(o.name||"-")+":":"",m[e].type==i.CHART_TYPE_SCATTER&&(o="undefined"!=typeof o.value?o.value:o,o=o.join(", ")),r.push(h+("undefined"!=typeof o.value?o.value:o));l+=(m[e].name||"-")+" : \n",l+=r.join(m[e].type==i.CHART_TYPE_SCATTER?"\n":", "),l+="\n\n"}return l},_save:function(){var e=this._textArea.value,t=this.query(this.option,"toolbox.feature.dataView.contentToOption");if("function"!=typeof t){e=e.split("\n");for(var n=[],a=0,o=e.length;o>a;a++)e[a]=this._trim(e[a]),""!==e[a]&&n.push(e[a]);this._contentToOption(n)}else t(e,this.option);this.hide();var r=this;setTimeout(function(){r.messageCenter&&r.messageCenter.dispatch(i.EVENT.DATA_VIEW_CHANGED,null,{option:r.option},r.myChart)},r.canvasSupported?800:100)},_contentToOption:function(e){var t,n,a,o,r,s,l,h=[],m=0;if(this.option.xAxis)for(h=this.option.xAxis instanceof Array?this.option.xAxis:[this.option.xAxis],t=0,o=h.length;o>t;t++)if("category"==(h[t].type||"category")){for(s=e[m].split(","),n=0,a=h[t].data.length;a>n;n++)l=this._trim(s[n]||""),r=h[t].data[n],"undefined"!=typeof h[t].data[n].value?h[t].data[n].value=l:h[t].data[n]=l;m++}if(this.option.yAxis)for(h=this.option.yAxis instanceof Array?this.option.yAxis:[this.option.yAxis],t=0,o=h.length;o>t;t++)if("category"==h[t].type){for(s=e[m].split(","),n=0,a=h[t].data.length;a>n;n++)l=this._trim(s[n]||""),r=h[t].data[n],"undefined"!=typeof h[t].data[n].value?h[t].data[n].value=l:h[t].data[n]=l;m++}var V=this.option.series;for(t=0,o=V.length;o>t;t++)if(m++,V[t].type==i.CHART_TYPE_SCATTER)for(var n=0,a=V[t].data.length;a>n;n++)s=e[m],l=s.replace(" ","").split(","),"undefined"!=typeof V[t].data[n].value?V[t].data[n].value=l:V[t].data[n]=l,m++;else{s=e[m].split(",");for(var n=0,a=V[t].data.length;a>n;n++)l=(s[n]||"").replace(/.*:/,""),l=this._trim(l),l="-"!=l&&""!==l?l-0:"-","undefined"!=typeof V[t].data[n].value?V[t].data[n].value=l:V[t].data[n]=l;m++}},_trim:function(e){var t=new RegExp("(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+$)","g");return e.replace(t,"")},_stop:function(e){e=e||window.event,e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},resize:function(){this._zrHeight=this.zr.getHeight(),this._zrWidth=this.zr.getWidth(),this._tDom.offsetHeight>10&&(this._sizeCssText="width:"+this._zrWidth+"px;height:"+this._zrHeight+"px;background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;height:"+(this._zrHeight-100)+"px;")},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},a.inherits(t,n),e("../component").define("dataView",t),t}),n("echarts/util/shape/Cross",["require","zrender/shape/Base","zrender/shape/Line","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/Line"),a=e("zrender/tool/util");return t.prototype={type:"cross",buildPath:function(e,t){var n=t.rect;t.xStart=n.x,t.xEnd=n.x+n.width,t.yStart=t.yEnd=t.y,i.prototype.buildPath(e,t),t.xStart=t.xEnd=t.x,t.yStart=n.y,t.yEnd=n.y+n.height,i.prototype.buildPath(e,t)},getRect:function(e){return e.rect},isCover:e("./normalIsCover")},a.inherits(t,n),t}),n("zrender/shape/Sector",["require","../tool/math","../tool/computeBoundingBox","../tool/vector","./Base","../tool/util"],function(e){var t=e("../tool/math"),n=e("../tool/computeBoundingBox"),i=e("../tool/vector"),a=e("./Base"),o=i.create(),r=i.create(),s=i.create(),l=i.create(),h=function(e){a.call(this,e)};return h.prototype={type:"sector",buildPath:function(e,n){var i=n.x,a=n.y,o=n.r0||0,r=n.r,s=n.startAngle,l=n.endAngle,h=n.clockWise||!1;s=t.degreeToRadian(s),l=t.degreeToRadian(l),h||(s=-s,l=-l);var m=t.cos(s),V=t.sin(s);e.moveTo(m*o+i,V*o+a),e.lineTo(m*r+i,V*r+a),e.arc(i,a,r,s,l,!h),e.lineTo(t.cos(l)*o+i,t.sin(l)*o+a),0!==o&&e.arc(i,a,o,l,s,h),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var a=e.x,h=e.y,m=e.r0||0,V=e.r,U=t.degreeToRadian(e.startAngle),d=t.degreeToRadian(e.endAngle),p=e.clockWise;return p||(U=-U,d=-d),m>1?n.arc(a,h,m,U,d,!p,o,s):(o[0]=s[0]=a,o[1]=s[1]=h),n.arc(a,h,V,U,d,!p,r,l),i.min(o,o,r),i.max(s,s,l),e.__rect={x:o[0],y:o[1],width:s[0]-o[0],height:s[1]-o[1]},e.__rect}},e("../tool/util").inherits(h,a),h}),n("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/tool/util");return t.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var n=i.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,n[3]),e.lineTo(t.x,n[2]),e.moveTo(t.x-t.width/2,n[2]),e.rect(t.x-t.width/2,n[2],t.width,n[1]-n[2]),e.moveTo(t.x,n[1]),e.lineTo(t.x,n[0])},getRect:function(e){if(!e.__rect){var t=0;("stroke"==e.brushType||"fill"==e.brushType)&&(t=e.lineWidth||1);var n=i.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(n[3]-t/2),width:e.width+t,height:n[0]-n[3]+t}}return e.__rect},isCover:e("./normalIsCover")},i.inherits(t,n),t}),n("zrender/tool/computeBoundingBox",["require","./vector","./curve"],function(e){function t(e,t,n){if(0!==e.length){for(var i=e[0][0],a=e[0][0],o=e[0][1],r=e[0][1],s=1;s<e.length;s++){var l=e[s];l[0]<i&&(i=l[0]),l[0]>a&&(a=l[0]),l[1]<o&&(o=l[1]),l[1]>r&&(r=l[1])}t[0]=i,t[1]=o,n[0]=a,n[1]=r}}function n(e,t,n,i,a,r){var s=[];o.cubicExtrema(e[0],t[0],n[0],i[0],s);for(var l=0;l<s.length;l++)s[l]=o.cubicAt(e[0],t[0],n[0],i[0],s[l]);var h=[];o.cubicExtrema(e[1],t[1],n[1],i[1],h);for(var l=0;l<h.length;l++)h[l]=o.cubicAt(e[1],t[1],n[1],i[1],h[l]);s.push(e[0],i[0]),h.push(e[1],i[1]);var m=Math.min.apply(null,s),V=Math.max.apply(null,s),U=Math.min.apply(null,h),d=Math.max.apply(null,h);a[0]=m,a[1]=U,r[0]=V,r[1]=d}function i(e,t,n,i,a){var r=o.quadraticExtremum(e[0],t[0],n[0]),s=o.quadraticExtremum(e[1],t[1],n[1]);r=Math.max(Math.min(r,1),0),s=Math.max(Math.min(s,1),0);var l=1-r,h=1-s,m=l*l*e[0]+2*l*r*t[0]+r*r*n[0],V=l*l*e[1]+2*l*r*t[1]+r*r*n[1],U=h*h*e[0]+2*h*s*t[0]+s*s*n[0],d=h*h*e[1]+2*h*s*t[1]+s*s*n[1];i[0]=Math.min(e[0],n[0],m,U),i[1]=Math.min(e[1],n[1],V,d),a[0]=Math.max(e[0],n[0],m,U),a[1]=Math.max(e[1],n[1],V,d)}var a=e("./vector"),o=e("./curve"),r=a.create(),s=a.create(),l=a.create(),h=function(e,t,n,i,o,h,m,V){if(r[0]=Math.cos(i)*n+e,r[1]=Math.sin(i)*n+t,s[0]=Math.cos(o)*n+e,s[1]=Math.sin(o)*n+t,a.min(m,r,s),a.max(V,r,s),i%=2*Math.PI,0>i&&(i+=2*Math.PI),o%=2*Math.PI,0>o&&(o+=2*Math.PI),i>o&&!h?o+=2*Math.PI:o>i&&h&&(i+=2*Math.PI),h){var U=o;o=i,i=U}for(var d=0;o>d;d+=Math.PI/2)d>i&&(l[0]=Math.cos(d)*n+e,l[1]=Math.sin(d)*n+t,a.min(m,l,m),a.max(V,l,V))};return t.cubeBezier=n,t.quadraticBezier=i,t.arc=h,t}),n("echarts/util/shape/Chain",["require","zrender/shape/Base","./Icon","zrender/shape/util/dashedLineTo","zrender/tool/util","zrender/tool/matrix"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("./Icon"),a=e("zrender/shape/util/dashedLineTo"),o=e("zrender/tool/util"),r=e("zrender/tool/matrix");return t.prototype={type:"chain",brush:function(e,t){var n=this.style;t&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),e.save(),this.setContext(e,n),this.setTransform(e),e.save(),e.beginPath(),this.buildLinePath(e,n),e.stroke(),e.restore(),this.brushSymbol(e,n),e.restore()},buildLinePath:function(e,t){var n=t.x,i=t.y+5,o=t.width,r=t.height/2-10;if(e.moveTo(n,i),e.lineTo(n,i+r),e.moveTo(n+o,i),e.lineTo(n+o,i+r),e.moveTo(n,i+r/2),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var s=(t.lineWidth||1)*("dashed"==t.lineType?5:1);a(e,n,i+r/2,n+o,i+r/2,s)}}else e.lineTo(n+o,i+r/2)},brushSymbol:function(e,t){var n=t.y+t.height/4;e.save();for(var a,o=t.chainPoint,r=0,s=o.length;s>r;r++){if(a=o[r],"none"!=a.symbol){e.beginPath();var l=a.symbolSize;i.prototype.buildPath(e,{iconType:a.symbol,x:a.x-l,y:n-l,width:2*l,height:2*l,n:a.n}),e.fillStyle=a.isEmpty?"#fff":t.strokeColor,e.closePath(),e.fill(),e.stroke()}a.showLabel&&(e.font=a.textFont,e.fillStyle=a.textColor,e.textAlign=a.textAlign,e.textBaseline=a.textBaseline,a.rotation?(e.save(),this._updateTextTransform(e,a.rotation),e.fillText(a.name,a.textX,a.textY),e.restore()):e.fillText(a.name,a.textX,a.textY))}e.restore()},_updateTextTransform:function(e,t){var n=r.create();if(r.identity(n),0!==t[0]){var i=t[1]||0,a=t[2]||0;(i||a)&&r.translate(n,n,[-i,-a]),r.rotate(n,n,t[0]),(i||a)&&r.translate(n,n,[i,a])}e.transform.apply(e,n)},isCover:function(e,t){var n=this.style;return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},o.inherits(t,n),t}),n("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,2*Math.PI,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,2*Math.PI,!0)},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function t(e,t,i,a,o,r){n.call(this,e,t,i,a,o),this.axisType=r,this._axisList=[],this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Line"),a=e("../config"),o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,n={_axisShape:"axisLine",zlevel:this._zlevelBase+1,hoverable:!1};switch(this.option.position){case"left":n.style={xStart:this.grid.getX()-t,yStart:this.grid.getYend(),xEnd:this.grid.getX()-t,yEnd:this.grid.getY(),lineCap:"round"};break;case"right":n.style={xStart:this.grid.getXend()+t,yStart:this.grid.getYend(),xEnd:this.grid.getXend()+t,yEnd:this.grid.getY(),lineCap:"round"};break;case"bottom":n.style={xStart:this.grid.getX(),yStart:this.grid.getYend()+t,xEnd:this.grid.getXend(),yEnd:this.grid.getYend()+t,lineCap:"round"};break;case"top":n.style={xStart:this.grid.getX(),yStart:this.grid.getY()-t,xEnd:this.grid.getXend(),yEnd:this.grid.getY()-t,lineCap:"round"}}""!==this.option.name&&(n.style.text=this.option.name,n.style.textPosition=this.option.nameLocation,n.style.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(n.style.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(n.style.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(n.style.textColor=this.option.nameTextStyle.color)),n.style.strokeColor=this.option.axisLine.lineStyle.color,n.style.lineWidth=e,this.isHorizontal()?n.style.yStart=n.style.yEnd=this.subPixelOptimize(n.style.yEnd,e):n.style.xStart=n.style.xEnd=this.subPixelOptimize(n.style.xEnd,e),n.style.lineType=this.option.axisLine.lineStyle.type,n=new i(n),this.shapeList.push(n)},_axisLabelClickable:function(e,t){return e?(o.pack(t,void 0,-1,void 0,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:s.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(this.option.axisLine.onZero){var n;if(this.isHorizontal()&&null!=t)for(var i=0,a=this.shapeList.length;a>i;i++)"axisLine"===this.shapeList[i]._axisShape?(this.shapeList[i].style.yStart=this.shapeList[i].style.yEnd=this.subPixelOptimize(t,this.shapeList[i].stylelineWidth),this.zr.modShape(this.shapeList[i].id)):"axisTick"===this.shapeList[i]._axisShape&&(n=this.shapeList[i].style.yEnd-this.shapeList[i].style.yStart,this.shapeList[i].style.yStart=t-n,this.shapeList[i].style.yEnd=t,this.zr.modShape(this.shapeList[i].id)); |
|
10 | if(!this.isHorizontal()&&null!=e)for(var i=0,a=this.shapeList.length;a>i;i++)"axisLine"===this.shapeList[i]._axisShape?(this.shapeList[i].style.xStart=this.shapeList[i].style.xEnd=this.subPixelOptimize(e,this.shapeList[i].stylelineWidth),this.zr.modShape(this.shapeList[i].id)):"axisTick"===this.shapeList[i]._axisShape&&(n=this.shapeList[i].style.xEnd-this.shapeList[i].style.xStart,this.shapeList[i].style.xStart=e,this.shapeList[i].style.xEnd=e+n,this.zr.modShape(this.shapeList[i].id))}},getPosition:function(){return this.option.position},isHorizontal:function(){return"bottom"===this.option.position||"top"===this.option.position}},reformOption:function(e){if(!e||e instanceof Array&&0===e.length?e=[{type:a.COMPONENT_TYPE_AXIS_VALUE}]:e instanceof Array||(e=[e]),e.length>2&&(e=[e[0],e[1]]),"xAxis"===this.axisType){(!e[0].position||"bottom"!=e[0].position&&"top"!=e[0].position)&&(e[0].position="bottom"),e.length>1&&(e[1].position="bottom"===e[0].position?"top":"bottom");for(var t=0,n=e.length;n>t;t++)e[t].type=e[t].type||"category",e[t].xAxisIndex=t,e[t].yAxisIndex=-1}else{(!e[0].position||"left"!=e[0].position&&"right"!=e[0].position)&&(e[0].position="left"),e.length>1&&(e[1].position="left"===e[0].position?"right":"left");for(var t=0,n=e.length;n>t;t++)e[t].type=e[t].type||"value",e[t].xAxisIndex=-1,e[t].yAxisIndex=t}return e},refresh:function(t){var n;t&&(this.option=t,"xAxis"===this.axisType?(this.option.xAxis=this.reformOption(t.xAxis),n=this.option.xAxis):(this.option.yAxis=this.reformOption(t.yAxis),n=this.option.yAxis),this.series=t.series);for(var i=e("./categoryAxis"),a=e("./valueAxis"),o=Math.max(n&&n.length||0,this._axisList.length),r=0;o>r;r++)!this._axisList[r]||!t||n[r]&&this._axisList[r].type==n[r].type||(this._axisList[r].dispose&&this._axisList[r].dispose(),this._axisList[r]=!1),this._axisList[r]?this._axisList[r].refresh&&this._axisList[r].refresh(n?n[r]:!1,this.series):n&&n[r]&&(this._axisList[r]="category"===n[r].type?new i(this.ecTheme,this.messageCenter,this.zr,n[r],this.myChart,this.axisBase):new a(this.ecTheme,this.messageCenter,this.zr,n[r],this.myChart,this.axisBase,this.series))},getAxis:function(e){return this._axisList[e]},clear:function(){for(var e=0,t=this._axisList.length;t>e;e++)this._axisList[e].dispose&&this._axisList[e].dispose();this._axisList=[]}},r.inherits(t,n),e("../component").define("axis",t),t}),n("echarts/component/grid",["require","./base","zrender/shape/Rectangle","../config","zrender/tool/util","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Rectangle"),a=e("../config"),o=e("zrender/tool/util");return t.prototype={type:a.COMPONENT_TYPE_GRID,getX:function(){return this._x},getY:function(){return this._y},getWidth:function(){return this._width},getHeight:function(){return this._height},getXend:function(){return this._x+this._width},getYend:function(){return this._y+this._height},getArea:function(){return{x:this._x,y:this._y,width:this._width,height:this._height}},getBbox:function(){return[[this._x,this._y],[this.getXend(),this.getYend()]]},refixAxisShape:function(e){for(var t,n,i,o=e.xAxis._axisList.concat(e.yAxis?e.yAxis._axisList:[]),r=o.length;r--;)i=o[r],i.type==a.COMPONENT_TYPE_AXIS_VALUE&&i._min<0&&i._max>=0&&(i.isHorizontal()?t=i.getCoord(0):n=i.getCoord(0));if("undefined"!=typeof t||"undefined"!=typeof n)for(r=o.length;r--;)o[r].refixAxisShape(t,n)},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var n=this.parsePercent(t.x2,this._zrWidth),a=this.parsePercent(t.y2,this._zrHeight);this._width="undefined"==typeof t.width?this._zrWidth-this._x-n:this.parsePercent(t.width,this._zrWidth),this._width=this._width<=0?10:this._width,this._height="undefined"==typeof t.height?this._zrHeight-this._y-a:this.parsePercent(t.height,this._zrHeight),this._height=this._height<=0?10:this._height,this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new i({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},o.inherits(t,n),e("../component").define("grid",t),t}),n("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","../util/date","zrender/tool/util","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o);var r=this;r._ondrift=function(e,t){return r.__ondrift(this,e,t)},r._ondragend=function(){return r.__ondragend()},this._fillerSize=28,this._handleSize=8,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this.myChart.canvasSupported||(this.zoomOption.realtime=!1),this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var n=e("./base"),i=e("zrender/shape/Rectangle"),a=e("zrender/shape/Polygon"),o=e("../util/shape/Icon"),r=e("../config"),s=e("../util/date"),l=e("zrender/tool/util");return t.prototype={type:r.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e]);this._syncFrameShape()},_getLocation:function(){var e,t,n,i,a=this.component.grid;return"horizontal"==this.zoomOption.orient?(n=this.zoomOption.width||a.getWidth(),i=this.zoomOption.height||this._fillerSize,e=null!=this.zoomOption.x?this.zoomOption.x:a.getX(),t=null!=this.zoomOption.y?this.zoomOption.y:this.zr.getHeight()-i-2):(n=this.zoomOption.width||this._fillerSize,i=this.zoomOption.height||a.getHeight(),e=null!=this.zoomOption.x?this.zoomOption.x:2,t=null!=this.zoomOption.y?this.zoomOption.y:a.getY()),{x:e,y:t,width:n,height:i}},_getZoom:function(){var e=this.option.series,t=this.option.xAxis;!t||t instanceof Array||(t=[t],this.option.xAxis=t);var n=this.option.yAxis;!n||n instanceof Array||(n=[n],this.option.yAxis=n);var i,a,o=[],s=this.zoomOption.xAxisIndex;if(t&&null==s){i=[];for(var l=0,h=t.length;h>l;l++)("category"==t[l].type||null==t[l].type)&&i.push(l)}else i=s instanceof Array?s:null!=s?[s]:[];if(s=this.zoomOption.yAxisIndex,n&&null==s){a=[];for(var l=0,h=n.length;h>l;l++)"category"==n[l].type&&a.push(l)}else a=s instanceof Array?s:null!=s?[s]:[];for(var m,l=0,h=e.length;h>l;l++)if(m=e[l],m.type==r.CHART_TYPE_LINE||m.type==r.CHART_TYPE_BAR||m.type==r.CHART_TYPE_SCATTER||m.type==r.CHART_TYPE_K){for(var V=0,U=i.length;U>V;V++)if(i[V]==(m.xAxisIndex||0)){o.push(l);break}for(var V=0,U=a.length;U>V;V++)if(a[V]==(m.yAxisIndex||0)){o.push(l);break}null==this.zoomOption.xAxisIndex&&null==this.zoomOption.yAxisIndex&&m.data&&m.data[0]&&m.data[0]instanceof Array&&(m.type==r.CHART_TYPE_SCATTER||m.type==r.CHART_TYPE_LINE||m.type==r.CHART_TYPE_BAR)&&o.push(l)}var d=null!=this._zoom.start?this._zoom.start:null!=this.zoomOption.start?this.zoomOption.start:0,p=null!=this._zoom.end?this._zoom.end:null!=this.zoomOption.end?this.zoomOption.end:100;d>p&&(d+=p,p=d-p,d-=p);var c=Math.round((p-d)/100*("horizontal"==this.zoomOption.orient?this._location.width:this._location.height));return{start:d,end:p,start2:0,end2:100,size:c,xAxisIndex:i,yAxisIndex:a,seriesIndex:o,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};for(var e=this.option.xAxis,t=this._zoom.xAxisIndex,n=0,i=t.length;i>n;n++)this._originalData.xAxis[t[n]]=e[t[n]].data;for(var a=this.option.yAxis,o=this._zoom.yAxisIndex,n=0,i=o.length;i>n;n++)this._originalData.yAxis[o[n]]=a[o[n]].data;for(var s,l=this.option.series,h=this._zoom.seriesIndex,n=0,i=h.length;i>n;n++)s=l[h[n]],this._originalData.series[h[n]]=s.data,s.data&&s.data[0]&&s.data[0]instanceof Array&&(s.type==r.CHART_TYPE_SCATTER||s.type==r.CHART_TYPE_LINE||s.type==r.CHART_TYPE_BAR)&&(this._backupScale(),this._calculScatterMap(h[n]))},_calculScatterMap:function(t){this._zoom.scatterMap=this._zoom.scatterMap||{},this._zoom.scatterMap[t]=this._zoom.scatterMap[t]||{};var n=e("../component"),i=n.get("axis"),a=l.clone(this.option.xAxis);"category"==a[0].type&&(a[0].type="value"),a[1]&&"category"==a[1].type&&(a[1].type="value");var o=new i(this.ecTheme,null,!1,{xAxis:a,series:this.option.series},this,"xAxis"),r=this.option.series[t].xAxisIndex||0;this._zoom.scatterMap[t].x=o.getAxis(r).getExtremum(),o.dispose(),a=l.clone(this.option.yAxis),"category"==a[0].type&&(a[0].type="value"),a[1]&&"category"==a[1].type&&(a[1].type="value"),o=new i(this.ecTheme,null,!1,{yAxis:a,series:this.option.series},this,"yAxis"),r=this.option.series[t].yAxisIndex||0,this._zoom.scatterMap[t].y=o.getAxis(r).getExtremum(),o.dispose()},_buildBackground:function(){var e=this._location.width,t=this._location.height;this.shapeList.push(new i({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._location.x,y:this._location.y,width:e,height:t,color:this.zoomOption.backgroundColor}}));for(var n=0,o=this._originalData.xAxis,s=this._zoom.xAxisIndex,l=0,h=s.length;h>l;l++)n=Math.max(n,o[s[l]].length);for(var m=this._originalData.yAxis,V=this._zoom.yAxisIndex,l=0,h=V.length;h>l;l++)n=Math.max(n,m[V[l]].length);for(var U,d=this._zoom.seriesIndex[0],p=this._originalData.series[d],c=Number.MIN_VALUE,u=Number.MAX_VALUE,l=0,h=p.length;h>l;l++)U=null!=p[l]?null!=p[l].value?p[l].value:p[l]:0,this.option.series[d].type==r.CHART_TYPE_K&&(U=U[1]),isNaN(U)&&(U=0),c=Math.max(c,U),u=Math.min(u,U);var y=c-u,b=[],g=e/(n-(n>1?1:0)),k=t/(n-(n>1?1:0)),f=1;"horizontal"==this.zoomOption.orient&&1>g?f=Math.floor(3*n/e):"vertical"==this.zoomOption.orient&&1>k&&(f=Math.floor(3*n/t));for(var l=0,h=n;h>l;l+=f)U=null!=p[l]?null!=p[l].value?p[l].value:p[l]:0,this.option.series[d].type==r.CHART_TYPE_K&&(U=U[1]),isNaN(U)&&(U=0),b.push("horizontal"==this.zoomOption.orient?[this._location.x+g*l,this._location.y+t-1-Math.round((U-u)/y*(t-10))]:[this._location.x+1+Math.round((U-u)/y*(e-10)),this._location.y+k*l]);"horizontal"==this.zoomOption.orient?(b.push([this._location.x+e,this._location.y+t]),b.push([this._location.x,this._location.y+t])):(b.push([this._location.x,this._location.y+t]),b.push([this._location.x,this._location.y])),this.shapeList.push(new a({zlevel:this._zlevelBase,style:{pointList:b,color:this.zoomOption.dataBackgroundColor},hoverable:!1}))},_buildFiller:function(){this._fillerShae={zlevel:this._zlevelBase,draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,_type:"filler"},this._fillerShae.style="horizontal"==this.zoomOption.orient?{x:this._location.x+Math.round(this._zoom.start/100*this._location.width)+this._handleSize,y:this._location.y,width:this._zoom.size-2*this._handleSize,height:this._location.height,color:this.zoomOption.fillerColor,text:":::",textPosition:"inside"}:{x:this._location.x,y:this._location.y+Math.round(this._zoom.start/100*this._location.height)+this._handleSize,width:this._location.width,height:this._zoom.size-2*this._handleSize,color:this.zoomOption.fillerColor,text:"::",textPosition:"inside"},this._fillerShae.highlightStyle={brushType:"fill",color:"rgba(0,0,0,0)"},this._fillerShae=new i(this._fillerShae),this.shapeList.push(this._fillerShae)},_buildHandle:function(){this._startShape={zlevel:this._zlevelBase,draggable:!0,style:{iconType:"rectangle",x:this._location.x,y:this._location.y,width:this._handleSize,height:this._handleSize,color:this.zoomOption.handleColor,text:"=",textPosition:"inside"},highlightStyle:{text:"",brushType:"fill",textPosition:"left"},ondrift:this._ondrift,ondragend:this._ondragend},"horizontal"==this.zoomOption.orient?(this._startShape.style.height=this._location.height,this._endShape=l.clone(this._startShape),this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endShape.highlightStyle.textPosition="right"):(this._startShape.style.width=this._location.width,this._endShape=l.clone(this._startShape),this._startShape.style.y=this._fillerShae.style.y-this._handleSize,this._startShape.highlightStyle.textPosition="top",this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endShape.highlightStyle.textPosition="bottom"),this._startShape=new o(this._startShape),this._endShape=new o(this._endShape),this.shapeList.push(this._startShape),this.shapeList.push(this._endShape)},_buildFrame:function(){var e=this.subPixelOptimize(this._location.x,1),t=this.subPixelOptimize(this._location.y,1);this._startFrameShape={zlevel:this._zlevelBase,hoverable:!1,style:{x:e,y:t,width:this._location.width-(e>this._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=l.clone(this._startFrameShape),this._startFrameShape=new i(this._startFrameShape),this._endFrameShape=new i(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape)},_syncHandleShape:function(){"horizontal"==this.zoomOption.orient?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=Math.floor((this._startShape.style.x-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100)):(this._startShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._zoom.start=Math.floor((this._startShape.style.y-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((this._endShape.style.y+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refresh()},_syncFillerShape:function(){var e,t;"horizontal"==this.zoomOption.orient?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100)):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncFrameShape:function(){"horizontal"==this.zoomOption.orient?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.height=this._fillerShae.style.y-this._location.y,this._endFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endFrameShape.style.height=this._location.y+this._location.height-this._endFrameShape.style.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){this.zoomOption.show&&("horizontal"==this.zoomOption.orient?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._startShape.style.y+this._handleSize,this._fillerShae.style.height=this._endShape.style.y-this._startShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh())},_syncData:function(e){var t,n,i,a,o;for(var s in this._originalData){t=this._originalData[s];for(var l in t)o=t[l],null!=o&&(a=o.length,n=Math.floor(this._zoom.start/100*a),i=Math.ceil(this._zoom.end/100*a),this.option[s][l].data[0]instanceof Array&&this.option[s][l].type!=r.CHART_TYPE_K?(this._setScale(),this.option[s][l].data=this._synScatterData(l,o)):this.option[s][l].data=o.slice(n,i))}this._isSilence||!this.zoomOption.realtime&&!e||this.messageCenter.dispatch(r.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(0===this._zoom.start&&100==this._zoom.end&&0===this._zoom.start2&&100==this._zoom.end2)return t;var n,i,a,o,r,s=[],l=this._zoom.scatterMap[e];"horizontal"==this.zoomOption.orient?(n=l.x.max-l.x.min,i=this._zoom.start/100*n+l.x.min,a=this._zoom.end/100*n+l.x.min,n=l.y.max-l.y.min,o=this._zoom.start2/100*n+l.y.min,r=this._zoom.end2/100*n+l.y.min):(n=l.x.max-l.x.min,i=this._zoom.start2/100*n+l.x.min,a=this._zoom.end2/100*n+l.x.min,n=l.y.max-l.y.min,o=this._zoom.start/100*n+l.y.min,r=this._zoom.end/100*n+l.y.min);for(var h,m=0,V=t.length;V>m;m++)h=t[m].value||t[m],h[0]>=i&&h[0]<=a&&h[1]>=o&&h[1]<=r&&s.push(t[m]);return s},_setScale:function(){var e=0!==this._zoom.start||100!==this._zoom.end||0!==this._zoom.start2||100!==this._zoom.end2,t={xAxis:this.option.xAxis,yAxis:this.option.yAxis};for(var n in t)for(var i=0,a=t[n].length;a>i;i++)t[n][i].scale=e||t[n][i]._scale},_backupScale:function(){var e={xAxis:this.option.xAxis,yAxis:this.option.yAxis};for(var t in e)for(var n=0,i=e[t].length;i>n;n++)e[t][n]._scale=e[t][n].scale},_getDetail:function(){var e="horizontal"==this.zoomOption.orient?"xAxis":"yAxis",t=this._originalData[e];for(var n in t){var i=t[n];if(null!=i){var a=i.length,o=Math.floor(this._zoom.start/100*a),r=Math.ceil(this._zoom.end/100*a);return r-=r>=a?1:0,{start:null!=i[o].value?i[o].value:i[o],end:null!=i[r].value?i[r].value:i[r]}}}var l=this._zoom.seriesIndex[0],h=this.option.series[l][e+"Index"]||0,m=this.option[e][h].type,V=this._zoom.scatterMap[l][e.charAt(0)].min,U=this._zoom.scatterMap[l][e.charAt(0)].max,d=U-V;if("value"==m)return{start:V+d*this._zoom.start/100,end:V+d*this._zoom.end/100};if("time"==m){U=V+d*this._zoom.end/100,V+=d*this._zoom.start/100;var p=s.getAutoFormatter(V,U).formatter;return{start:s.format(p,V),end:s.format(p,U)}}return{start:"",end:""}},__ondrift:function(e,t,n){this.zoomOption.zoomLock&&(e=this._fillerShae);var i="filler"==e._type?this._handleSize:0;if("horizontal"==this.zoomOption.orient?e.style.x+t-i<=this._location.x?e.style.x=this._location.x+i:e.style.x+t+e.style.width+i>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-i:e.style.x+=t:e.style.y+n-i<=this._location.y?e.style.y=this._location.y+i:e.style.y+n+e.style.height+i>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-i:e.style.y+=n,"filler"==e._type?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),this.zoomOption.showDetail){var a=this._getDetail();this._startShape.style.text=this._startShape.highlightStyle.text=a.start,this._endShape.style.text=this._endShape.highlightStyle.text=a.end,this._startShape.style.textPosition=this._startShape.highlightStyle.textPosition,this._endShape.style.textPosition=this._endShape.highlightStyle.textPosition}return!0},__ondragend:function(){this.zoomOption.showDetail&&(this._startShape.style.text=this._endShape.style.text="=",this._startShape.style.textPosition=this._endShape.style.textPosition="inside",this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.refreshNextFrame()),this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,this._isSilence||this.zoomOption.realtime||this.messageCenter.dispatch(r.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1)},ondataZoom:function(e,t){t.needRefresh=!0},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0)},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var t=this.component.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};if(n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height),n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.x<t.x&&(n.x=t.x),n.x+n.width>t.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var i,a=(n.x-t.x)/t.width,o=1-(n.x+n.width-t.x)/t.width,r=1-(n.y+n.height-t.y)/t.height,s=(n.y-t.y)/t.height;return"horizontal"==this.zoomOption.orient?(i=this._zoom.end-this._zoom.start,this._zoom.start+=i*a,this._zoom.end-=i*o,i=this._zoom.end2-this._zoom.start2,this._zoom.start2+=i*r,this._zoom.end2-=i*s):(i=this._zoom.end-this._zoom.start,this._zoom.start+=i*r,this._zoom.end-=i*s,i=this._zoom.end2-this._zoom.start2,this._zoom.start2+=i*a,this._zoom.end2-=i*o),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){for(var t,n,i=this._originalData.series,a=e.series,o=0,r=a.length;r>o;o++){n=a[o].data||a[o].eventList,t=i[o]?Math.floor(this._zoom.start/100*i[o].length):0;for(var s=0,l=n.length;l>s;s++)i[o]&&(i[o][s+t]=n[s])}},syncOption:function(e){this.silence(!0),this.option=e,this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this.myChart.canvasSupported||(this.zoomOption.realtime=!1),this.clear(),this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom&&this.option.dataZoom.show&&this._buildShape(),this._syncData(),this.silence(!1)},silence:function(e){this._isSilence=e},getRealDataIndex:function(e,t){if(!this._originalData||0===this._zoom.start&&100==this._zoom.end)return t;var n=this._originalData.series;return n[e]?Math.floor(this._zoom.start/100*n[e].length)+t:-1},resize:function(){this.clear(),this._location=this._getLocation(),this._zoom=this._getZoom(),this.option.dataZoom.show&&this._buildShape()}},l.inherits(t,n),e("../component").define("dataZoom",t),t}),n("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function t(e,t,i,a,o,r){if(a.data.length<1)return void console.error("option.data.length < 1.");n.call(this,e,t,i,a,o),this.grid=this.component.grid;for(var s in r)this[s]=r[s];this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=e("../config"),s=e("zrender/tool/util"),l=e("zrender/tool/area");return t.prototype={type:r.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t="undefined"!=typeof this.option.data[e].value?this.option.data[e].value:this.option.data[e],n=this.option.data[e].formatter||this.option.axisLabel.formatter;return n&&("function"==typeof n?t=n.call(this.myChart,t):"string"==typeof n&&(t=n.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if("auto"==e){var t=this.option.axisLabel.textStyle.fontSize,n=this.option.data,i=this.option.data.length;if(this.isHorizontal())if(i>3){var a,o,r=this.getGap(),h=!1,m=Math.floor(.5/r);for(m=1>m?1:m,e=Math.floor(15/r);!h&&i>e;){e+=m,h=!0,a=Math.floor(r*e);for(var V=Math.floor((i-1)/e)*e;V>=0;V-=e){if(0!==this.option.axisLabel.rotate)o=t;else if(n[V].textStyle)o=l.getTextWidth(this._getReformedLabel(V),this.getFont(s.merge(n[V].textStyle,this.option.axisLabel.textStyle)));else{var U=this._getReformedLabel(V)+"",d=(U.match(/\w/g)||"").length,p=U.length-d;o=d*t*2/3+p*t}if(o>a){h=!1;break}}}}else e=1;else if(i>3){var r=this.getGap();for(e=Math.floor(11/r);t>r*e-6&&i>e;)e++}else e=1}else e=e-0+1;return e},_buildShape:function(){if(this._interval=this._getInterval(),this.option.show){this.option.splitArea.show&&this._buildSplitArea(),this.option.splitLine.show&&this._buildSplitLine(),this.option.axisLine.show&&this._buildAxisLine(),this.option.axisTick.show&&this._buildAxisTick(),this.option.axisLabel.show&&this._buildAxisLabel();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildAxisTick:function(){var e,t=this.option.data.length,n=this.option.axisTick,i=n.length,o=n.lineStyle.color,r=n.lineStyle.width,s="auto"==n.interval?this._interval:n.interval-0+1,l=n.onGap,h=l?this.getGap()/2:"undefined"==typeof l&&this.option.boundaryGap?this.getGap()/2:0,m=h>0?-s:0;if(this.isHorizontal())for(var V,U="bottom"==this.option.position?n.inside?this.grid.getYend()-i-1:this.grid.getYend()+1:n.inside?this.grid.getY()+1:this.grid.getY()-i-1,d=m;t>d;d+=s)V=this.subPixelOptimize(this.getCoordByIndex(d)+(d>=0?h:0),r),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:V,yStart:U,xEnd:V,yEnd:U+i,strokeColor:o,lineWidth:r}},this.shapeList.push(new a(e));else for(var p,c="left"==this.option.position?n.inside?this.grid.getX()+1:this.grid.getX()-i-1:n.inside?this.grid.getXend()-i-1:this.grid.getXend()+1,d=m;t>d;d+=s)p=this.subPixelOptimize(this.getCoordByIndex(d)-(d>=0?h:0),r),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:c,yStart:p,xEnd:c+i,yEnd:p,strokeColor:o,lineWidth:r}},this.shapeList.push(new a(e))},_buildAxisLabel:function(){var e,t,n=this.option.data,a=this.option.data.length,o=this.option.axisLabel.rotate,r=this.option.axisLabel.margin,l=this.option.axisLabel.clickable,h=this.option.axisLabel.textStyle;if(this.isHorizontal()){var m,V;"bottom"==this.option.position?(m=this.grid.getYend()+r,V="top"):(m=this.grid.getY()-r,V="bottom");for(var U=0;a>U;U+=this._interval)""!==this._getReformedLabel(U)&&(t=s.merge(n[U].textStyle||{},h),e={zlevel:this._zlevelBase,hoverable:!1,style:{x:this.getCoordByIndex(U),y:m,color:t.color,text:this._getReformedLabel(U),textFont:this.getFont(t),textAlign:t.align||"center",textBaseline:t.baseline||V}},o&&(e.style.textAlign=o>0?"bottom"==this.option.position?"right":"left":"bottom"==this.option.position?"left":"right",e.rotation=[o*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(l,e))))}else{var d,p;"left"==this.option.position?(d=this.grid.getX()-r,p="right"):(d=this.grid.getXend()+r,p="left");for(var U=0;a>U;U+=this._interval)""!==this._getReformedLabel(U)&&(t=s.merge(n[U].textStyle||{},h),e={zlevel:this._zlevelBase,hoverable:!1,style:{x:d,y:this.getCoordByIndex(U),color:t.color,text:this._getReformedLabel(U),textFont:this.getFont(t),textAlign:t.align||p,textBaseline:t.baseline||0===U&&""!==this.option.name?"bottom":U==a-1&&""!==this.option.name?"top":"middle"}},o&&(e.rotation=[o*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(l,e))))}},_buildSplitLine:function(){var e,t=this.option.data.length,n=this.option.splitLine,i=n.lineStyle.type,o=n.lineStyle.width,r=n.lineStyle.color;r=r instanceof Array?r:[r];var s=r.length,l=n.onGap,h=l?this.getGap()/2:"undefined"==typeof l&&this.option.boundaryGap?this.getGap()/2:0;if(t-=l||"undefined"==typeof l&&this.option.boundaryGap?1:0,this.isHorizontal())for(var m,V=this.grid.getY(),U=this.grid.getYend(),d=0;t>d;d+=this._interval)m=this.subPixelOptimize(this.getCoordByIndex(d)+h,o),e={zlevel:this._zlevelBase,hoverable:!1,style:{xStart:m,yStart:V,xEnd:m,yEnd:U,strokeColor:r[d/this._interval%s],lineType:i,lineWidth:o}},this.shapeList.push(new a(e));else for(var p,c=this.grid.getX(),u=this.grid.getXend(),d=0;t>d;d+=this._interval)p=this.subPixelOptimize(this.getCoordByIndex(d)-h,o),e={zlevel:this._zlevelBase,hoverable:!1,style:{xStart:c,yStart:p,xEnd:u,yEnd:p,strokeColor:r[d/this._interval%s],linetype:i,lineWidth:o}},this.shapeList.push(new a(e))},_buildSplitArea:function(){var e,t=this.option.splitArea,n=t.areaStyle.color;if(n instanceof Array){var i=n.length,a=this.option.data.length,r=t.onGap,s=r?this.getGap()/2:"undefined"==typeof r&&this.option.boundaryGap?this.getGap()/2:0;if(this.isHorizontal())for(var l,h=this.grid.getY(),m=this.grid.getHeight(),V=this.grid.getX(),U=0;a>=U;U+=this._interval)l=a>U?this.getCoordByIndex(U)+s:this.grid.getXend(),e={zlevel:this._zlevelBase,hoverable:!1,style:{x:V,y:h,width:l-V,height:m,color:n[U/this._interval%i]}},this.shapeList.push(new o(e)),V=l;else for(var d,p=this.grid.getX(),c=this.grid.getWidth(),u=this.grid.getYend(),U=0;a>=U;U+=this._interval)d=a>U?this.getCoordByIndex(U)-s:this.grid.getY(),e={zlevel:this._zlevelBase,hoverable:!1,style:{x:p,y:d,width:c,height:u-d,color:n[U/this._interval%i]}},this.shapeList.push(new o(e)),u=d}else e={zlevel:this._zlevelBase,hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:n}},this.shapeList.push(new o(e))},refresh:function(e){e&&(this.option=this.reformOption(e),this.option.axisLabel.textStyle=s.merge(this.option.axisLabel.textStyle||{},this.ecTheme.textStyle)),this.clear(),this._buildShape()},getGap:function(){var e=this.option.data.length,t=this.isHorizontal()?this.grid.getWidth():this.grid.getHeight();return this.option.boundaryGap?t/e:t/(e>1?e-1:1)},getCoord:function(e){for(var t=this.option.data,n=t.length,i=this.getGap(),a=this.option.boundaryGap?i/2:0,o=0;n>o;o++){if(t[o]==e||"undefined"!=typeof t[o].value&&t[o].value==e)return a=this.isHorizontal()?this.grid.getX()+a:this.grid.getYend()-a;a+=i}},getCoordByIndex:function(e){if(0>e)return this.isHorizontal()?this.grid.getX():this.grid.getYend();if(e>this.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),n=this.option.boundaryGap?t/2:0;return n+=e*t,n=this.isHorizontal()?this.grid.getX()+n:this.grid.getYend()-n},getNameByIndex:function(e){var t=this.option.data[e];return"undefined"!=typeof t&&"undefined"!=typeof t.value?t.value:t},getIndexByName:function(e){for(var t=this.option.data,n=t.length,i=0;n>i;i++)if(t[i]==e||"undefined"!=typeof t[i].value&&t[i].value==e)return i;return-1},getValueFromCoord:function(){return""},isMainAxis:function(e){return e%this._interval===0}},s.inherits(t,n),e("../component").define("categoryAxis",t),t}),n("echarts/component/valueAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","../util/date","zrender/tool/util","../util/smartSteps","../util/accMath","../component"],function(e){function t(e,t,i,a,o,r,s){if(!s||0===s.length)return void console.err("option.series.length == 0.");n.call(this,e,t,i,a,o),this.series=s,this.grid=this.component.grid;for(var l in r)this[l]=r[l];this.refresh(a,s)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=e("../config"),s=e("../util/date"),l=e("zrender/tool/util");return t.prototype={type:r.COMPONENT_TYPE_AXIS_VALUE,_buildShape:function(){if(this._hasData=!1,this._calculateValue(),this._hasData&&this.option.show){this.option.splitArea.show&&this._buildSplitArea(),this.option.splitLine.show&&this._buildSplitLine(),this.option.axisLine.show&&this._buildAxisLine(),this.option.axisTick.show&&this._buildAxisTick(),this.option.axisLabel.show&&this._buildAxisLabel(); |
|
11 | for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildAxisTick:function(){var e,t=this._valueList,n=this._valueList.length,i=this.option.axisTick,o=i.length,r=i.lineStyle.color,s=i.lineStyle.width;if(this.isHorizontal())for(var l,h="bottom"===this.option.position?i.inside?this.grid.getYend()-o-1:this.grid.getYend()+1:i.inside?this.grid.getY()+1:this.grid.getY()-o-1,m=0;n>m;m++)l=this.subPixelOptimize(this.getCoord(t[m]),s),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:l,yStart:h,xEnd:l,yEnd:h+o,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e));else for(var V,U="left"===this.option.position?i.inside?this.grid.getX()+1:this.grid.getX()-o-1:i.inside?this.grid.getXend()-o-1:this.grid.getXend()+1,m=0;n>m;m++)V=this.subPixelOptimize(this.getCoord(t[m]),s),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:U,yStart:V,xEnd:U+o,yEnd:V,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e))},_buildAxisLabel:function(){var e,t=this._valueList,n=this._valueList.length,a=this.option.axisLabel.rotate,o=this.option.axisLabel.margin,r=this.option.axisLabel.clickable,s=this.option.axisLabel.textStyle;if(this.isHorizontal()){var l,h;"bottom"===this.option.position?(l=this.grid.getYend()+o,h="top"):(l=this.grid.getY()-o,h="bottom");for(var m=0;n>m;m++)e={zlevel:this._zlevelBase,hoverable:!1,style:{x:this.getCoord(t[m]),y:l,color:"function"==typeof s.color?s.color(t[m]):s.color,text:this._valueLabel[m],textFont:this.getFont(s),textAlign:s.align||"center",textBaseline:s.baseline||h}},a&&(e.style.textAlign=a>0?"bottom"===this.option.position?"right":"left":"bottom"===this.option.position?"left":"right",e.rotation=[a*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(r,e)))}else{var V,U;"left"===this.option.position?(V=this.grid.getX()-o,U="right"):(V=this.grid.getXend()+o,U="left");for(var m=0;n>m;m++)e={zlevel:this._zlevelBase,hoverable:!1,style:{x:V,y:this.getCoord(t[m]),color:"function"==typeof s.color?s.color(t[m]):s.color,text:this._valueLabel[m],textFont:this.getFont(s),textAlign:s.align||U,textBaseline:s.baseline||0===m&&""!==this.option.name?"bottom":m===n-1&&""!==this.option.name?"top":"middle"}},a&&(e.rotation=[a*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(r,e)))}},_buildSplitLine:function(){var e,t=this._valueList,n=this._valueList.length,i=this.option.splitLine,o=i.lineStyle.type,r=i.lineStyle.width,s=i.lineStyle.color;s=s instanceof Array?s:[s];var l=s.length;if(this.isHorizontal())for(var h,m=this.grid.getY(),V=this.grid.getYend(),U=0;n>U;U++)h=this.subPixelOptimize(this.getCoord(t[U]),r),e={zlevel:this._zlevelBase,hoverable:!1,style:{xStart:h,yStart:m,xEnd:h,yEnd:V,strokeColor:s[U%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e));else for(var d,p=this.grid.getX(),c=this.grid.getXend(),U=0;n>U;U++)d=this.subPixelOptimize(this.getCoord(t[U]),r),e={zlevel:this._zlevelBase,hoverable:!1,style:{xStart:p,yStart:d,xEnd:c,yEnd:d,strokeColor:s[U%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e))},_buildSplitArea:function(){var e,t=this.option.splitArea.areaStyle.color;if(t instanceof Array){var n=t.length,i=this._valueList,a=this._valueList.length;if(this.isHorizontal())for(var r,s=this.grid.getY(),l=this.grid.getHeight(),h=this.grid.getX(),m=0;a>=m;m++)r=a>m?this.getCoord(i[m]):this.grid.getXend(),e={zlevel:this._zlevelBase,hoverable:!1,style:{x:h,y:s,width:r-h,height:l,color:t[m%n]}},this.shapeList.push(new o(e)),h=r;else for(var V,U=this.grid.getX(),d=this.grid.getWidth(),p=this.grid.getYend(),m=0;a>=m;m++)V=a>m?this.getCoord(i[m]):this.grid.getY(),e={zlevel:this._zlevelBase,hoverable:!1,style:{x:U,y:V,width:d,height:p-V,color:t[m%n]}},this.shapeList.push(new o(e)),p=V}else e={zlevel:this._zlevelBase,hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:t}},this.shapeList.push(new o(e))},_calculateValue:function(){if(isNaN(this.option.min-0)||isNaN(this.option.max-0)){for(var e,t,n={},i=this.component.legend,a=0,o=this.series.length;o>a;a++)!(this.series[a].type!=r.CHART_TYPE_LINE&&this.series[a].type!=r.CHART_TYPE_BAR&&this.series[a].type!=r.CHART_TYPE_SCATTER&&this.series[a].type!=r.CHART_TYPE_K&&this.series[a].type!=r.CHART_TYPE_EVENTRIVER||i&&!i.isSelected(this.series[a].name)||(e=this.series[a].xAxisIndex||0,t=this.series[a].yAxisIndex||0,this.option.xAxisIndex!=e&&this.option.yAxisIndex!=t||!this._calculSum(n,a)));var s;for(var a in n){s=n[a];for(var l=0,h=s.length;h>l;l++)if(!isNaN(s[l])){this._hasData=!0,this._min=s[l],this._max=s[l];break}if(this._hasData)break}for(var a in n){s=n[a];for(var l=0,h=s.length;h>l;l++)isNaN(s[l])||(this._min=Math.min(this._min,s[l]),this._max=Math.max(this._max,s[l]))}var m=Math.abs(this._max-this._min);this._min=isNaN(this.option.min-0)?this._min-Math.abs(m*this.option.boundaryGap[0]):this.option.min-0,this._max=isNaN(this.option.max-0)?this._max+Math.abs(m*this.option.boundaryGap[1]):this.option.max-0,this._min===this._max&&(0===this._max?this._max=1:this._max>0?this._min=this._max/this.option.splitNumber!=null?this.option.splitNumber:5:this._max=this._max/this.option.splitNumber!=null?this.option.splitNumber:5),"time"!=this.option.type?this._reformValue(this.option.scale):this._reformTimeValue()}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,"time"!=this.option.type?this._customerValue():this._reformTimeValue()},_calculSum:function(e,t){var n,i,a=this.series[t].name||"kener";if(this.series[t].stack){var o="__Magic_Key_Positive__"+this.series[t].stack,l="__Magic_Key_Negative__"+this.series[t].stack;e[o]=e[o]||[],e[l]=e[l]||[],e[a]=e[a]||[],i=this.series[t].data;for(var h=0,m=i.length;m>h;h++)n=null!=i[h].value?i[h].value:i[h],"-"!==n&&(n-=0,n>=0?null!=e[o][h]?e[o][h]+=n:e[o][h]=n:null!=e[l][h]?e[l][h]+=n:e[l][h]=n,this.option.scale&&e[a].push(n))}else if(e[a]=e[a]||[],this.series[t].type!=r.CHART_TYPE_EVENTRIVER){i=this.series[t].data;for(var h=0,m=i.length;m>h;h++)n=null!=i[h].value?i[h].value:i[h],this.series[t].type===r.CHART_TYPE_K?(e[a].push(n[0]),e[a].push(n[1]),e[a].push(n[2]),e[a].push(n[3])):n instanceof Array?(-1!=this.option.xAxisIndex&&e[a].push("time"!=this.option.type?n[0]:s.getNewDate(n[0])),-1!=this.option.yAxisIndex&&e[a].push("time"!=this.option.type?n[1]:s.getNewDate(n[1]))):e[a].push(n)}else{i=this.series[t].eventList;for(var h=0,m=i.length;m>h;h++)for(var V=i[h].evolution,U=0,d=V.length;d>U;U++)e[a].push(s.getNewDate(V[U].time))}},_reformValue:function(t){var n=e("../util/smartSteps"),i=this.option.splitNumber;!t&&this._min>=0&&this._max>=0&&(this._min=0),!t&&this._min<=0&&this._max<=0&&(this._max=0);var a=n(this._min,this._max,i);i=null!=i?i:a.secs,this.option.splitNumber=i,this._min=a.min,this._max=a.max,this._valueList=a.pnts,this._reformLabelData()},_reformTimeValue:function(){var e=null!=this.option.splitNumber?this.option.splitNumber:5,t=s.getAutoFormatter(this._min,this._max,e),n=t.formatter,i=t.gapValue;this._valueList=[s.getNewDate(this._min)];var a;switch(n){case"week":a=s.nextMonday(this._min);break;case"month":a=s.nextNthOnMonth(this._min,1);break;case"quarter":a=s.nextNthOnQuarterYear(this._min,1);break;case"half-year":a=s.nextNthOnHalfYear(this._min,1);break;case"year":a=s.nextNthOnYear(this._min,1);break;default:72e5>=i?a=(Math.floor(this._min/i)+1)*i:(a=s.getNewDate(this._min- -i),a.setHours(6*Math.round(a.getHours()/6)),a.setMinutes(0),a.setSeconds(0))}for(a-this._min<i/2&&(a-=-i),t=s.getNewDate(a),e*=1.5;e-->=0&&(("month"==n||"quarter"==n||"half-year"==n||"year"==n)&&t.setDate(1),!(this._max-t<i/2));)this._valueList.push(t),t=s.getNewDate(t- -i);this._valueList.push(s.getNewDate(this._max)),this._reformLabelData(n)},_customerValue:function(){var t=e("../util/accMath"),n=null!=this.option.splitNumber?this.option.splitNumber:5,i=(this._max-this._min)/n;this._valueList=[];for(var a=0;n>=a;a++)this._valueList.push(t.accAdd(this._min,t.accMul(i,a)));this._reformLabelData()},_reformLabelData:function(e){this._valueLabel=[];var t=this.option.axisLabel.formatter;if(t)for(var n=0,i=this._valueList.length;i>n;n++)"function"==typeof t?this._valueLabel.push(e?t.call(this.myChart,this._valueList[n],e):t.call(this.myChart,this._valueList[n])):"string"==typeof t&&this._valueLabel.push(e?s.format(t,this._valueList[n]):t.replace("{value}",this._valueList[n]));else if(e)for(var n=0,i=this._valueList.length;i>n;n++)this._valueLabel.push(s.format(e,this._valueList[n]));else for(var n=0,i=this._valueList.length;i>n;n++)this._valueLabel.push(this.numAddCommas(this._valueList[n]))},getExtremum:function(){return this._calculateValue(),{min:this._min,max:this._max}},refresh:function(e,t){e&&(this.option=this.reformOption(e),this.option.axisLabel.textStyle=l.merge(this.option.axisLabel.textStyle||{},this.ecTheme.textStyle),this.series=t),this.zr&&(this.clear(),this._buildShape())},getCoord:function(e){e=e<this._min?this._min:e,e=e>this._max?this._max:e;var t;return t=this.isHorizontal()?this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight()},getCoordSize:function(e){return Math.abs(this.isHorizontal()?e/(this._max-this._min)*this.grid.getWidth():e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=e<this.grid.getX()?this.grid.getX():e,e=e>this.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=e<this.grid.getY()?this.grid.getY():e,e=e>this.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0},isMaindAxis:function(e){for(var t=0,n=this._valueList.length;n>t;t++)if(this._valueList[t]===e)return!0;return!1}},l.inherits(t,n),e("../component").define("valueAxis",t),t}),n("echarts/util/date",[],function(){function e(e,t,n){n=n>1?n:2;for(var i,a,o,r,s=0,l=m.length;l>s;s++)if(i=m[s].value,a=Math.ceil(t/i)*i-Math.floor(e/i)*i,Math.round(a/i)<=1.2*n){o=m[s].formatter,r=m[s].value;break}return null==o&&(o="year",i=317088e5,a=Math.ceil(t/i)*i-Math.floor(e/i)*i,r=Math.round(a/(n-1)/i)*i),{formatter:o,gapValue:r}}function t(e){return 10>e?"0"+e:e}function n(e,n){("week"==e||"month"==e||"quarter"==e||"half-year"==e||"year"==e)&&(e="MM - dd\nyyyy");var i=h(n),a=i.getFullYear(),o=i.getMonth()+1,r=i.getDate(),s=i.getHours(),l=i.getMinutes(),m=i.getSeconds();return e=e.replace("MM",t(o)),e=e.toLowerCase(),e=e.replace("yyyy",a),e=e.replace("yy",a%100),e=e.replace("dd",t(r)),e=e.replace("d",r),e=e.replace("hh",t(s)),e=e.replace("h",s),e=e.replace("mm",t(l)),e=e.replace("m",l),e=e.replace("ss",t(m)),e=e.replace("s",m)}function i(e){return e=h(e),e.setDate(e.getDate()+8-e.getDay()),e}function a(e,t,n){return e=h(e),e.setMonth(Math.ceil((e.getMonth()+1)/n)*n),e.setDate(t),e}function o(e,t){return a(e,t,1)}function r(e,t){return a(e,t,3)}function s(e,t){return a(e,t,6)}function l(e,t){return a(e,t,12)}function h(e){return e instanceof Date?e:new Date("string"==typeof e?e.replace(/-/g,"/"):e)}var m=[{formatter:"hh : mm : ss",value:1e3},{formatter:"hh : mm : ss",value:5e3},{formatter:"hh : mm : ss",value:1e4},{formatter:"hh : mm : ss",value:15e3},{formatter:"hh : mm : ss",value:3e4},{formatter:"hh : mm\nMM - dd",value:6e4},{formatter:"hh : mm\nMM - dd",value:3e5},{formatter:"hh : mm\nMM - dd",value:6e5},{formatter:"hh : mm\nMM - dd",value:9e5},{formatter:"hh : mm\nMM - dd",value:18e5},{formatter:"hh : mm\nMM - dd",value:36e5},{formatter:"hh : mm\nMM - dd",value:72e5},{formatter:"hh : mm\nMM - dd",value:216e5},{formatter:"hh : mm\nMM - dd",value:432e5},{formatter:"MM - dd\nyyyy",value:864e5},{formatter:"week",value:6048e5},{formatter:"month",value:26784e5},{formatter:"quarter",value:8208e6},{formatter:"half-year",value:16416e6},{formatter:"year",value:32832e6}];return{getAutoFormatter:e,getNewDate:h,format:n,nextMonday:i,nextNthPerNmonth:a,nextNthOnMonth:o,nextNthOnQuarterYear:r,nextNthOnHalfYear:s,nextNthOnYear:l}}),n("echarts/util/smartSteps",[],function(){function e(e){return X.log(v(e))/X.LN10}function t(e){return X.pow(10,e)}function n(e){return e===w(e)}function i(e,t,i,a){g=a||{},k=g.steps||L,f=g.secs||W,i=K(+i||0)%99,e=+e||0,t=+t||0,_=x=0,"min"in g&&(e=+g.min||0,_=1),"max"in g&&(t=+g.max||0,x=1),e>t&&(t=[e,e=t][0]);var o=t-e;if(_&&x)return b(e,t,i);if((i||5)>o){if(n(e)&&n(t))return d(e,t,i);if(0===o)return p(e,t,i)}return h(e,t,i)}function a(e,n,i,a){a=a||0;var s=o((n-e)/i,-1),l=o(e,-1,1),h=o(n,-1),m=X.min(s.e,l.e,h.e);r(s,{c:0,e:m}),r(l,s,1),r(h,s),a+=m,e=l.c,n=h.c;for(var V=(n-e)/i,U=t(a),d=0,p=[],c=i+1;c--;)p[c]=(e+V*c)*U;if(0>a){d=u(U),V=+(V*U).toFixed(d),e=+(e*U).toFixed(d),n=+(n*U).toFixed(d);for(var c=p.length;c--;)p[c]=p[c].toFixed(d),0===+p[c]&&(p[c]="0")}else e*=U,n*=U,V*=U;return f=0,k=0,g=0,{min:e,max:n,secs:i,step:V,fix:d,exp:a,pnts:p}}function o(i,a,o){a=K(a%10)||2,0>a&&(n(i)?a=(""+v(i)).replace(/0+$/,"").length||1:(i=i.toFixed(15).replace(/0+$/,""),a=i.replace(".","").replace(/^[-0]+/,"").length,i=+i));var r=w(e(i))-a+1,s=+(i*t(-r)).toFixed(15)||0;return s=o?w(s):I(s),!s&&(r=0),(""+v(s)).length>a&&(r+=1,s/=10),{c:s,e:r}}function r(e,n,i){var a=n.e-e.e;a&&(e.e+=a,e.c*=t(-a),e.c=i?w(e.c):I(e.c))}function s(e,t,n){e.e<t.e?r(t,e,n):r(e,t,n)}function l(e,t){t=t||L,e=o(e);for(var n=e.c,i=0;n>t[i];)i++;if(!t[i])for(n/=10,e.e+=1,i=0;n>t[i];)i++;return e.c=t[i],e}function h(e,t,i){var s,h=i||+f.slice(-1),p=l((t-e)/h,k),u=o(t-e),b=o(e,-1,1),g=o(t,-1);if(r(u,p),r(b,p,1),r(g,p),i?s=V(b,g,h):h=m(b,g),n(e)&&n(t)&&e*t>=0){if(h>t-e)return d(e,t,h);h=U(e,t,i,b,g,h)}var L=c(e,t,b.c,g.c);return b.c=L[0],g.c=L[1],(_||x)&&y(e,t,b,g),a(b.c,g.c,h,g.e)}function m(e,n){for(var i,a,o,r,s=[],h=f.length;h--;)i=f[h],a=l((n.c-e.c)/i,k),a=a.c*t(a.e),o=w(e.c/a)*a,r=I(n.c/a)*a,s[h]={min:o,max:r,step:a,span:r-o};return s.sort(function(e,t){return e.span-t.span}),s=s[0],i=s.span/s.step,e.c=s.min,n.c=s.max,3>i?2*i:i}function V(e,n,i){for(var a,o,r=n.c,s=(n.c-e.c)/i-1;r>e.c;)s=l(s+1,k),s=s.c*t(s.e),a=s*i,o=I(n.c/s)*s,r=o-a;var h=e.c-r,m=o-n.c,V=h-m;return V>=2*s&&(V=w(V/s)*s,r+=V,o+=V),e.c=r,n.c=o,s}function U(e,i,a,o,r,s){var l=r.c-o.c,h=l/s*t(r.e);if(!n(h)&&(h=w(h),l=h*s,i-e>l&&(h+=1,l=h*s,!a&&h*(s-1)>=i-e&&(s-=1,l=h*s)),l>=i-e)){var m=l-(i-e);o.c=K(e-m/2),r.c=K(i+m/2),o.e=0,r.e=0}return s}function d(e,t,n){if(n=n||5,_)t=e+n;else if(x)e=t-n;else{var i=n-(t-e),o=K(e-i/2),r=K(t+i/2),s=c(e,t,o,r);e=s[0],t=s[1]}return a(e,t,n)}function p(e,t,n){n=n||5;var i=X.min(v(t/n),n)/2.1;return _?t=e+i:x?e=t-i:(e-=i,t+=i),h(e,t,n)}function c(e,t,n,i){return e>=0&&0>n?(i-=n,n=0):0>=t&&i>0&&(n-=i,i=0),[n,i]}function u(e){return e=(+e).toFixed(15).split("."),e.pop().replace(/0+$/,"").length}function y(e,t,n,i){if(_){var a=o(e,4,1);n.e-a.e>6&&(a={c:0,e:n.e}),s(n,a),s(i,a),i.c+=a.c-n.c,n.c=a.c}else if(x){var r=o(t,4);i.e-r.e>6&&(r={c:0,e:i.e}),s(n,r),s(i,r),n.c+=r.c-i.c,i.c=r.c}}function b(e,t,n){var i=n?[n]:f,s=t-e;if(0===s)return t=o(t,3),n=i[0],t.c=K(t.c+n/2),a(t.c-n,t.c,n,t.e);v(t/s)<1e-6&&(t=0),v(e/s)<1e-6&&(e=0);var l,h,m,V=[[5,10],[10,2],[50,10],[100,2]],U=[],d=[],p=o(t-e,3),c=o(e,-1,1),u=o(t,-1);r(c,p,1),r(u,p),s=u.c-c.c,p.c=s;for(var y=i.length;y--;){n=i[y],l=I(s/n),h=l*n-s,m=3*(h+3),m+=2*(n-i[0]+2),n%5===0&&(m-=10);for(var b=V.length;b--;)l%V[b][0]===0&&(m/=V[b][1]);d[y]=[n,l,h,m].join(),U[y]={secs:n,step:l,delta:h,score:m}}return U.sort(function(e,t){return e.score-t.score}),U=U[0],c.c=K(c.c-U.delta/2),u.c=K(u.c+U.delta/2),a(c.c,u.c,U.secs,p.e)}var g,k,f,_,x,L=[10,25,50],W=[4,5,6],X=Math,K=X.round,w=X.floor,I=X.ceil,v=X.abs;return i}),n("echarts/chart/line",["require","../component/base","./base","zrender/shape/BrokenLine","../util/shape/Icon","../util/shape/HalfSmoothPolygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,n,o,r){i.call(this,e,t,n,o,r),a.call(this),this.refresh(o)}function n(e,t,n){var i=t.x,a=t.y,o=t.width,s=t.height,l=s/2;t.symbol.match("empty")&&(e.fillStyle="#fff"),t.brushType="both";var h=t.symbol.replace("empty","").toLowerCase();h.match("star")?(l=h.replace("star","")-0||5,a-=1,h="star"):("rectangle"===h||"arrow"===h)&&(i+=(o-s)/2,o=s);var m="";if(h.match("image")&&(m=h.replace(new RegExp("^image:\\/\\/"),""),h="image",i+=Math.round((o-s)/2)-1,o=s+=2),h=r.prototype.iconLibrary[h]){var V=t.x,U=t.y;e.moveTo(V,U+l),e.lineTo(V+5,U+l),e.moveTo(V+t.width-5,U+l),e.lineTo(V+t.width,U+l);var d=this;h(e,{x:i+4,y:a+4,width:o-8,height:s-8,n:l,image:m},function(){d.modSelf(),n()})}else e.moveTo(i,a+l),e.lineTo(i+o,a+l)}var i=e("../component/base"),a=e("./base"),o=e("zrender/shape/BrokenLine"),r=e("../util/shape/Icon"),s=e("../util/shape/HalfSmoothPolygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var l=e("../config"),h=e("../util/ecData"),m=e("zrender/tool/util"),V=e("zrender/tool/color");return t.prototype={type:l.CHART_TYPE_LINE,_buildShape:function(){this.finalPLMap={},this._bulidPosition()},_buildHorizontal:function(e,t,n,i){for(var a,o,r,s,l,h,m,V,U,d,p=this.series,c=n[0][0],u=p[c],y=u.xAxisIndex,b=this.component.xAxis.getAxis(y),g={},k=0,f=t;f>k&&null!=b.getNameByIndex(k);k++){r=b.getCoordByIndex(k);for(var _=0,x=n.length;x>_;_++){a=p[n[_][0]].yAxisIndex||0,o=this.component.yAxis.getAxis(a),h=l=V=m=o.getCoord(0);for(var L=0,W=n[_].length;W>L;L++)c=n[_][L],u=p[c],U=u.data[k],d=null!=U?null!=U.value?U.value:U:"-",g[c]=g[c]||[],i[c]=i[c]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==d?(d>=0?(l-=L>0?o.getCoordSize(d):h-o.getCoord(d),s=l):0>d&&(m+=L>0?o.getCoordSize(d):o.getCoord(d)-V,s=m),g[c].push([r,s,k,b.getNameByIndex(k),r,h]),i[c].min>d&&(i[c].min=d,i[c].minY=s,i[c].minX=r),i[c].max<d&&(i[c].max=d,i[c].maxY=s,i[c].maxX=r),i[c].sum+=d,i[c].counter++):g[c].length>0&&(this.finalPLMap[c]=this.finalPLMap[c]||[],this.finalPLMap[c].push(g[c]),g[c]=[])}l=this.component.grid.getY();for(var X,_=0,x=n.length;x>_;_++)for(var L=0,W=n[_].length;W>L;L++)c=n[_][L],u=p[c],U=u.data[k],d=null!=U?null!=U.value?U.value:U:"-","-"==d&&this.deepQuery([U,u,this.option],"calculable")&&(X=this.deepQuery([U,u],"symbolSize"),l+=2*X+5,s=l,this.shapeList.push(this._getCalculableItem(c,k,b.getNameByIndex(k),r,s,"horizontal")))}for(var K in g)g[K].length>0&&(this.finalPLMap[K]=this.finalPLMap[K]||[],this.finalPLMap[K].push(g[K]),g[K]=[]);this._calculMarkMapXY(i,n,"y"),this._buildBorkenLine(e,this.finalPLMap,b,"horizontal")},_buildVertical:function(e,t,n,i){for(var a,o,r,s,l,h,m,V,U,d,p=this.series,c=n[0][0],u=p[c],y=u.yAxisIndex,b=this.component.yAxis.getAxis(y),g={},k=0,f=t;f>k&&null!=b.getNameByIndex(k);k++){s=b.getCoordByIndex(k);for(var _=0,x=n.length;x>_;_++){a=p[n[_][0]].xAxisIndex||0,o=this.component.xAxis.getAxis(a),h=l=V=m=o.getCoord(0);for(var L=0,W=n[_].length;W>L;L++)c=n[_][L],u=p[c],U=u.data[k],d=null!=U?null!=U.value?U.value:U:"-",g[c]=g[c]||[],i[c]=i[c]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==d?(d>=0?(l+=L>0?o.getCoordSize(d):o.getCoord(d)-h,r=l):0>d&&(m-=L>0?o.getCoordSize(d):V-o.getCoord(d),r=m),g[c].push([r,s,k,b.getNameByIndex(k),h,s]),i[c].min>d&&(i[c].min=d,i[c].minX=r,i[c].minY=s),i[c].max<d&&(i[c].max=d,i[c].maxX=r,i[c].maxY=s),i[c].sum+=d,i[c].counter++):g[c].length>0&&(this.finalPLMap[c]=this.finalPLMap[c]||[],this.finalPLMap[c].push(g[c]),g[c]=[])}l=this.component.grid.getXend();for(var X,_=0,x=n.length;x>_;_++)for(var L=0,W=n[_].length;W>L;L++)c=n[_][L],u=p[c],U=u.data[k],d=null!=U?null!=U.value?U.value:U:"-","-"==d&&this.deepQuery([U,u,this.option],"calculable")&&(X=this.deepQuery([U,u],"symbolSize"),l-=2*X+5,r=l,this.shapeList.push(this._getCalculableItem(c,k,b.getNameByIndex(k),r,s,"vertical")))}for(var K in g)g[K].length>0&&(this.finalPLMap[K]=this.finalPLMap[K]||[],this.finalPLMap[K].push(g[K]),g[K]=[]);this._calculMarkMapXY(i,n,"x"),this._buildBorkenLine(e,this.finalPLMap,b,"vertical")},_buildOther:function(e,t,n,i){for(var a,o,r=this.series,s={},l=0,h=n.length;h>l;l++)for(var m=0,V=n[l].length;V>m;m++){var U=n[l][m],d=r[U],p=d.xAxisIndex||0;a=this.component.xAxis.getAxis(p);var c=d.yAxisIndex||0;o=this.component.yAxis.getAxis(c);var u=o.getCoord(0);s[U]=s[U]||[],i[U]=i[U]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var y=0,b=d.data.length;b>y;y++){var g=d.data[y],k=null!=g?null!=g.value?g.value:g:"-";if(k instanceof Array){var f=a.getCoord(k[0]),_=o.getCoord(k[1]);s[U].push([f,_,y,k[0],f,u]),i[U].min0>k[0]&&(i[U].min0=k[0],i[U].minY0=_,i[U].minX0=f),i[U].max0<k[0]&&(i[U].max0=k[0],i[U].maxY0=_,i[U].maxX0=f),i[U].sum0+=k[0],i[U].counter0++,i[U].min1>k[1]&&(i[U].min1=k[1],i[U].minY1=_,i[U].minX1=f),i[U].max1<k[1]&&(i[U].max1=k[1],i[U].maxY1=_,i[U].maxX1=f),i[U].sum1+=k[1],i[U].counter1++}}}for(var x in s)s[x].length>0&&(this.finalPLMap[x]=this.finalPLMap[x]||[],this.finalPLMap[x].push(s[x]),s[x]=[]);this._calculMarkMapXY(i,n,"xy"),this._buildBorkenLine(e,this.finalPLMap,a,"other")},_buildBorkenLine:function(e,t,n,i){for(var a,r="other"==i?"horizontal":i,l=this.series,U=e.length-1;U>=0;U--){var d=e[U],p=l[d],c=t[d];if(p.type===this.type&&null!=c)for(var u=this._getBbox(d,r),y=this._sIndex2ColorMap[d],b=this.query(p,"itemStyle.normal.lineStyle.width"),g=this.query(p,"itemStyle.normal.lineStyle.type"),k=this.query(p,"itemStyle.normal.lineStyle.color"),f=this.getItemStyleColor(this.query(p,"itemStyle.normal.color"),d,-1),_=null!=this.query(p,"itemStyle.normal.areaStyle"),x=this.query(p,"itemStyle.normal.areaStyle.color"),L=0,W=c.length;W>L;L++){var X=c[L],K="other"!=i&&this._isLarge(r,X);if(K)X=this._getLargePointList(r,X);else for(var w=0,I=X.length;I>w;w++)a=p.data[X[w][2]],(this.deepQuery([a,p,this.option],"calculable")||this.deepQuery([a,p],"showAllSymbol")||"categoryAxis"===n.type&&n.isMainAxis(X[w][2])&&"none"!=this.deepQuery([a,p],"symbol"))&&this.shapeList.push(this._getSymbol(d,X[w][2],X[w][3],X[w][0],X[w][1],r));var v=new o({zlevel:this._zlevelBase,style:{miterLimit:b,pointList:X,strokeColor:k||f||y,lineWidth:b,lineType:g,smooth:this._getSmooth(p.smooth),smoothConstraint:u,shadowColor:this.query(p,"itemStyle.normal.lineStyle.shadowColor"),shadowBlur:this.query(p,"itemStyle.normal.lineStyle.shadowBlur"),shadowOffsetX:this.query(p,"itemStyle.normal.lineStyle.shadowOffsetX"),shadowOffsetY:this.query(p,"itemStyle.normal.lineStyle.shadowOffsetY")},hoverable:!1,_main:!0,_seriesIndex:d,_orient:r});if(h.pack(v,l[d],d,0,L,l[d].name),this.shapeList.push(v),_){var J=new s({zlevel:this._zlevelBase,style:{miterLimit:b,pointList:m.clone(X).concat([[X[X.length-1][4],X[X.length-1][5]],[X[0][4],X[0][5]]]),brushType:"fill",smooth:this._getSmooth(p.smooth),smoothConstraint:u,color:x?x:V.alpha(y,.5)},highlightStyle:{brushType:"fill"},hoverable:!1,_main:!0,_seriesIndex:d,_orient:r});h.pack(J,l[d],d,0,L,l[d].name),this.shapeList.push(J)}}}},_getBbox:function(e,t){var n=this.component.grid.getBbox(),i=this.xMarkMap[e];return null!=i.minX0?[[Math.min(i.minX0,i.maxX0,i.minX1,i.maxX1),Math.min(i.minY0,i.maxY0,i.minY1,i.maxY1)],[Math.max(i.minX0,i.maxX0,i.minX1,i.maxX1),Math.max(i.minY0,i.maxY0,i.minY1,i.maxY1)]]:("horizontal"===t?(n[0][1]=Math.min(i.minY,i.maxY),n[1][1]=Math.max(i.minY,i.maxY)):(n[0][0]=Math.min(i.minX,i.maxX),n[1][0]=Math.max(i.minX,i.maxX)),n)},_isLarge:function(e,t){return t.length<2?!1:"horizontal"===e?Math.abs(t[0][0]-t[1][0])<.5:Math.abs(t[0][1]-t[1][1])<.5},_getLargePointList:function(e,t){var n;n="horizontal"===e?this.component.grid.getWidth():this.component.grid.getHeight();for(var i=t.length,a=[],o=0;n>o;o++)a[o]=t[Math.floor(i/n*o)];return a},_getSmooth:function(e){return e?.3:0},_getCalculableItem:function(e,t,n,i,a,o){var r=this.series,s=r[e].calculableHolderColor||this.ecTheme.calculableHolderColor,l=this._getSymbol(e,t,n,i,a,o);return l.style.color=s,l.style.strokeColor=s,l.rotation=[0,0],l.hoverable=!1,l.draggable=!1,l.style.text=void 0,l},_getSymbol:function(e,t,n,i,a,o){var r=this.series,s=r[e],l=s.data[t],h=this.getSymbolShape(s,e,l,t,n,i,a,this._sIndex2ShapeMap[e],this._sIndex2ColorMap[e],"#fff","vertical"===o?"horizontal":"vertical");return h.zlevel=this._zlevelBase+1,this.deepQuery([l,s,this.option],"calculable")&&(this.setCalculable(h),h.draggable=!0),h},getMarkCoord:function(e,t){var n=this.series[e],i=this.xMarkMap[e],a=this.component.xAxis.getAxis(n.xAxisIndex),o=this.component.yAxis.getAxis(n.yAxisIndex);if(t.type&&("max"===t.type||"min"===t.type||"average"===t.type)){var r=null!=t.valueIndex?t.valueIndex:null!=i.maxX0?"1":"";return[i[t.type+"X"+r],i[t.type+"Y"+r],i[t.type+"Line"+r],i[t.type+r]]}return["string"!=typeof t.xAxis&&a.getCoordByIndex?a.getCoordByIndex(t.xAxis||0):a.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&o.getCoordByIndex?o.getCoordByIndex(t.yAxis||0):o.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ontooltipHover:function(e,t){for(var n,i,a=e.seriesIndex,o=e.dataIndex,r=a.length;r--;)if(n=this.finalPLMap[a[r]])for(var s=0,l=n.length;l>s;s++){i=n[s];for(var h=0,m=i.length;m>h;h++)o===i[h][2]&&t.push(this._getSymbol(a[r],i[h][2],i[h][3],i[h][0],i[h][1],"horizontal"))}},addDataAnimation:function(e){for(var t=this.series,n={},i=0,a=e.length;a>i;i++)n[e[i][0]]=e[i];for(var o,r,s,l,h,m,V,i=this.shapeList.length-1;i>=0;i--)if(h=this.shapeList[i]._seriesIndex,n[h]&&!n[h][3]){if(this.shapeList[i]._main&&this.shapeList[i].style.pointList.length>1){if(m=this.shapeList[i].style.pointList,r=Math.abs(m[0][0]-m[1][0]),l=Math.abs(m[0][1]-m[1][1]),V="horizontal"===this.shapeList[i]._orient,n[h][2]){if("half-smooth-polygon"===this.shapeList[i].type){var U=m.length;this.shapeList[i].style.pointList[U-3]=m[U-2],this.shapeList[i].style.pointList[U-3][V?0:1]=m[U-4][V?0:1],this.shapeList[i].style.pointList[U-2]=m[U-1]}this.shapeList[i].style.pointList.pop(),V?(o=r,s=0):(o=0,s=-l)}else{if(this.shapeList[i].style.pointList.shift(),"half-smooth-polygon"===this.shapeList[i].type){var d=this.shapeList[i].style.pointList.pop();V?d[0]=m[0][0]:d[1]=m[0][1],this.shapeList[i].style.pointList.push(d)}V?(o=-r,s=0):(o=0,s=l)}this.zr.modShape(this.shapeList[i].id,{style:{pointList:this.shapeList[i].style.pointList}},!0)}else{if(n[h][2]&&this.shapeList[i]._dataIndex===t[h].data.length-1){this.zr.delShape(this.shapeList[i].id);continue}if(!n[h][2]&&0===this.shapeList[i]._dataIndex){this.zr.delShape(this.shapeList[i].id);continue}}this.shapeList[i].position=[0,0],this.zr.animate(this.shapeList[i].id,"").when(500,{position:[o,s]}).start()}}},r.prototype.iconLibrary.legendLineIcon=n,m.inherits(t,a),m.inherits(t,i),e("../chart").define("line",t),t}),n("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/util/smoothBezier"),a=e("zrender/tool/util");return t.prototype={type:"half-smooth-polygon",buildPath:function(t,n){var a=n.pointList;if(!(a.length<2))if(n.smooth){var o=i(a.slice(0,-2),n.smooth,!1,n.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var r,s,l,h=a.length,m=0;h-3>m;m++)r=o[2*m],s=o[2*m+1],l=a[m+1],t.bezierCurveTo(r[0],r[1],s[0],s[1],l[0],l[1]);t.lineTo(a[h-2][0],a[h-2][1]),t.lineTo(a[h-1][0],a[h-1][1]),t.lineTo(a[0][0],a[0][1])}else e("zrender/shape/Polygon").prototype.buildPath(t,n)}},a.inherits(t,n),t}),n("echarts/chart/bar",["require","../component/base","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,a,o,r){n.call(this,e,t,a,o,r),i.call(this),this.refresh(o)}var n=e("../component/base"),i=e("./base"),a=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var o=e("../config"),r=e("../util/ecData"),s=e("zrender/tool/util"),l=e("zrender/tool/color");return t.prototype={type:o.CHART_TYPE_BAR,_buildShape:function(){this._bulidPosition()},_buildNormal:function(e,t,n,i,o){for(var r,s,l,h,m,V,U,d,p,c,u,y,b=this.series,g=n[0][0],k=b[g],f=k.xAxisIndex,_=k.yAxisIndex,x="horizontal"==o?this.component.xAxis.getAxis(f):this.component.yAxis.getAxis(_),L=this._mapSize(x,n),W=L.gap,X=L.barGap,K=L.barWidthMap,w=L.barMaxWidthMap,I=L.barWidth,v=L.barMinHeightMap,J=L.interval,C=0,S=t;S>C&&null!=x.getNameByIndex(C);C++){"horizontal"==o?h=x.getCoordByIndex(C)-W/2:m=x.getCoordByIndex(C)+W/2;for(var E=0,T=n.length;T>E;E++){_=b[n[E][0]].yAxisIndex||0,f=b[n[E][0]].xAxisIndex||0,r="horizontal"==o?this.component.yAxis.getAxis(_):this.component.xAxis.getAxis(f),U=V=p=d=r.getCoord(0);for(var F=0,A=n[E].length;A>F;F++)if(g=n[E][F],k=b[g],u=k.data[C],y=null!=u?null!=u.value?u.value:u:"-",i[g]=i[g]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==y){y>0?(s=F>0?r.getCoordSize(y):"horizontal"==o?U-r.getCoord(y):r.getCoord(y)-U,1===A&&v[g]>s&&(s=v[g]),"horizontal"==o?(V-=s,m=V):(h=V,V+=s)):0>y?(s=F>0?r.getCoordSize(y):"horizontal"==o?r.getCoord(y)-p:p-r.getCoord(y),1===A&&v[g]>s&&(s=v[g]),"horizontal"==o?(m=d,d+=s):(d-=s,h=d)):(s=0,"horizontal"==o?(V-=s,m=V):(h=V,V+=s));var l=Math.min(w[g]||Number.MAX_VALUE,K[g]||I);i[g][C]="horizontal"==o?h+l/2:m-l/2,i[g].min>y&&(i[g].min=y,"horizontal"==o?(i[g].minY=m,i[g].minX=i[g][C]):(i[g].minX=h+s,i[g].minY=i[g][C])),i[g].max<y&&(i[g].max=y,"horizontal"==o?(i[g].maxY=m,i[g].maxX=i[g][C]):(i[g].maxX=h+s,i[g].maxY=i[g][C])),i[g].sum+=y,i[g].counter++,C%J===0&&(c=this._getBarItem(g,C,x.getNameByIndex(C),h,m-("horizontal"==o?0:l),"horizontal"==o?l:s,"horizontal"==o?s:l,"horizontal"==o?"vertical":"horizontal"),this.shapeList.push(new a(c)))}for(var F=0,A=n[E].length;A>F;F++)g=n[E][F],k=b[g],u=k.data[C],y=null!=u?null!=u.value?u.value:u:"-","-"==y&&this.deepQuery([u,k,this.option],"calculable")&&("horizontal"==o?(V-=this.ecTheme.island.r,m=V):(h=V,V+=this.ecTheme.island.r),l=Math.min(w[g]||Number.MAX_VALUE,K[g]||I),c=this._getBarItem(g,C,x.getNameByIndex(C),h+.5,m+.5-("horizontal"==o?0:l),("horizontal"==o?l:this.ecTheme.island.r)-1,("horizontal"==o?this.ecTheme.island.r:l)-1,"horizontal"==o?"vertical":"horizontal"),c.hoverable=!1,c.draggable=!1,c.style.lineWidth=1,c.style.brushType="stroke",c.style.strokeColor=k.calculableHolderColor||this.ecTheme.calculableHolderColor,this.shapeList.push(new a(c)));"horizontal"==o?h+=l+X:m-=l+X}}this._calculMarkMapXY(i,n,"horizontal"==o?"y":"x")},_buildHorizontal:function(e,t,n,i){return this._buildNormal(e,t,n,i,"horizontal")},_buildVertical:function(e,t,n,i){return this._buildNormal(e,t,n,i,"vertical")},_buildOther:function(e,t,n,i){for(var o=this.series,r=0,s=n.length;s>r;r++)for(var l=0,h=n[r].length;h>l;l++){var m=n[r][l],V=o[m],U=V.xAxisIndex||0,d=this.component.xAxis.getAxis(U),p=d.getCoord(0),c=V.yAxisIndex||0,u=this.component.yAxis.getAxis(c),y=u.getCoord(0);i[m]=i[m]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var b=0,g=V.data.length;g>b;b++){var k=V.data[b],f=null!=k?null!=k.value?k.value:k:"-";if(f instanceof Array){var _,x,L=d.getCoord(f[0]),W=u.getCoord(f[1]),X=[k,V],K=this.deepQuery(X,"barWidth")||10,w=this.deepQuery(X,"barHeight");null!=w?(_="horizontal",f[0]>0?(K=L-p,L-=K):K=f[0]<0?p-L:0,x=this._getBarItem(m,b,f[0],L,W-w/2,K,w,_)):(_="vertical",f[1]>0?w=y-W:f[1]<0?(w=W-y,W-=w):w=0,x=this._getBarItem(m,b,f[0],L-K/2,W,K,w,_)),this.shapeList.push(new a(x)),L=d.getCoord(f[0]),W=u.getCoord(f[1]),i[m].min0>f[0]&&(i[m].min0=f[0],i[m].minY0=W,i[m].minX0=L),i[m].max0<f[0]&&(i[m].max0=f[0],i[m].maxY0=W,i[m].maxX0=L),i[m].sum0+=f[0],i[m].counter0++,i[m].min1>f[1]&&(i[m].min1=f[1],i[m].minY1=W,i[m].minX1=L),i[m].max1<f[1]&&(i[m].max1=f[1],i[m].maxY1=W,i[m].maxX1=L),i[m].sum1+=f[1],i[m].counter1++ |
|
12 | }}}this._calculMarkMapXY(i,n,"xy")},_mapSize:function(e,t,n){var i,a,o=this._findSpecialBarSzie(t,n),r=o.barWidthMap,s=o.barMaxWidthMap,l=o.barMinHeightMap,h=o.sBarWidthCounter,m=o.sBarWidthTotal,V=o.barGap,U=o.barCategoryGap,d=1;if(t.length!=h){if(n)i=e.getGap(),V=0,a=Math.floor(i/t.length),0>=a&&(d=Math.floor(t.length/i),a=1);else if(i="string"==typeof U&&U.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(U))/100):e.getGap()-U,"string"==typeof V&&V.match(/%$/)?(V=parseFloat(V)/100,a=Math.floor((i-m)/((t.length-1)*V+t.length-h)),V=Math.floor(a*V)):(V=parseFloat(V),a=Math.floor((i-m-V*(t.length-1))/(t.length-h))),0>=a)return this._mapSize(e,t,!0)}else if(i=h>1?"string"==typeof U&&U.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(U))/100):e.getGap()-U:m,a=0,V=h>1?Math.floor((i-m)/(h-1)):0,0>V)return this._mapSize(e,t,!0);return this._recheckBarMaxWidth(t,r,s,l,i,a,V,d)},_findSpecialBarSzie:function(e,t){for(var n,i,a,o,r=this.series,s={},l={},h={},m=0,V=0,U=0,d=e.length;d>U;U++)for(var p={barWidth:!1,barMaxWidth:!1},c=0,u=e[U].length;u>c;c++){var y=e[U][c],b=r[y];if(!t){if(p.barWidth)s[y]=n;else if(n=this.query(b,"barWidth"),null!=n){s[y]=n,V+=n,m++,p.barWidth=!0;for(var g=0,k=c;k>g;g++){var f=e[U][g];s[f]=n}}if(p.barMaxWidth)l[y]=i;else if(i=this.query(b,"barMaxWidth"),null!=i){l[y]=i,p.barMaxWidth=!0;for(var g=0,k=c;k>g;g++){var f=e[U][g];l[f]=i}}}h[y]=this.query(b,"barMinHeight"),a=null!=a?a:this.query(b,"barGap"),o=null!=o?o:this.query(b,"barCategoryGap")}return{barWidthMap:s,barMaxWidthMap:l,barMinHeightMap:h,sBarWidth:n,sBarMaxWidth:i,sBarWidthCounter:m,sBarWidthTotal:V,barGap:a,barCategoryGap:o}},_recheckBarMaxWidth:function(e,t,n,i,a,o,r,s){for(var l=0,h=e.length;h>l;l++){var m=e[l][0];n[m]&&n[m]<o&&(a-=o-n[m])}return{barWidthMap:t,barMaxWidthMap:n,barMinHeightMap:i,gap:a,barWidth:o,barGap:r,interval:s}},_getBarItem:function(e,t,n,i,a,o,s,h){var m,V=this.series,U=V[e],d=U.data[t],p=this._sIndex2ColorMap[e],c=[d,U],u=this.deepQuery(c,"itemStyle.normal.color")||p,y=this.deepQuery(c,"itemStyle.emphasis.color"),b=this.deepMerge(c,"itemStyle.normal"),g=b.barBorderWidth,k=this.deepMerge(c,"itemStyle.emphasis");if(m={zlevel:this._zlevelBase,clickable:this.deepQuery(c,"clickable"),style:{x:i,y:a,width:o,height:s,brushType:"both",color:this.getItemStyleColor(u,e,t,d),radius:b.barBorderRadius,lineWidth:g,strokeColor:b.barBorderColor},highlightStyle:{color:this.getItemStyleColor(y,e,t,d),radius:k.barBorderRadius,lineWidth:k.barBorderWidth,strokeColor:k.barBorderColor},_orient:h},m.highlightStyle.color=m.highlightStyle.color||("string"==typeof m.style.color?l.lift(m.style.color,-.3):m.style.color),g>0&&m.style.height>g&&m.style.width>g?(m.style.y+=g/2,m.style.height-=g,m.style.x+=g/2,m.style.width-=g):m.style.brushType="fill",m.highlightStyle.textColor=m.highlightStyle.color,m=this.addLabel(m,U,d,n,h),"insideLeft"===m.style.textPosition||"insideRight"===m.style.textPosition||"insideTop"===m.style.textPosition||"insideBottom"===m.style.textPosition){var f=5;switch(m.style.textPosition){case"insideLeft":m.style.textX=m.style.x+f,m.style.textY=m.style.y+m.style.height/2,m.style.textAlign="left",m.style.textBaseline="middle";break;case"insideRight":m.style.textX=m.style.x+m.style.width-f,m.style.textY=m.style.y+m.style.height/2,m.style.textAlign="right",m.style.textBaseline="middle";break;case"insideTop":m.style.textX=m.style.x+m.style.width/2,m.style.textY=m.style.y+f/2,m.style.textAlign="center",m.style.textBaseline="top";break;case"insideBottom":m.style.textX=m.style.x+m.style.width/2,m.style.textY=m.style.y+m.style.height-f/2,m.style.textAlign="center",m.style.textBaseline="bottom"}m.style.textPosition="specific",m.style.textColor=m.style.textColor||"#fff"}return this.deepQuery([d,U,this.option],"calculable")&&(this.setCalculable(m),m.draggable=!0),r.pack(m,V[e],e,V[e].data[t],t,n),m},getMarkCoord:function(e,t){var n,i,a=this.series[e],o=this.xMarkMap[e],r=this.component.xAxis.getAxis(a.xAxisIndex),s=this.component.yAxis.getAxis(a.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)if(o.isHorizontal){n="string"==typeof t.xAxis&&r.getIndexByName?r.getIndexByName(t.xAxis):t.xAxis||0;var l=o[n];l=null!=l?l:"string"!=typeof t.xAxis&&r.getCoordByIndex?r.getCoordByIndex(t.xAxis||0):r.getCoord(t.xAxis||0),i=[l,s.getCoord(t.yAxis||0)]}else{n="string"==typeof t.yAxis&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var h=o[n];h=null!=h?h:"string"!=typeof t.yAxis&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),i=[r.getCoord(t.xAxis||0),h]}else{var m=null!=t.valueIndex?t.valueIndex:null!=o.maxX0?"1":"";i=[o[t.type+"X"+m],o[t.type+"Y"+m],o[t.type+"Line"+m],o[t.type+m]]}return i},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,n={},i=0,a=e.length;a>i;i++)n[e[i][0]]=e[i];for(var o,s,l,h,m,V,U,i=this.shapeList.length-1;i>=0;i--)if(V=r.get(this.shapeList[i],"seriesIndex"),n[V]&&!n[V][3]&&"rectangle"===this.shapeList[i].type){if(U=r.get(this.shapeList[i],"dataIndex"),m=t[V],n[V][2]&&U===m.data.length-1){this.zr.delShape(this.shapeList[i].id);continue}if(!n[V][2]&&0===U){this.zr.delShape(this.shapeList[i].id);continue}"horizontal"===this.shapeList[i]._orient?(h=this.component.yAxis.getAxis(m.yAxisIndex||0).getGap(),l=n[V][2]?-h:h,o=0):(s=this.component.xAxis.getAxis(m.xAxisIndex||0).getGap(),o=n[V][2]?s:-s,l=0),this.shapeList[i].position=[0,0],this.zr.animate(this.shapeList[i].id,"").when(500,{position:[o,l]}).start()}}},s.inherits(t,i),s.inherits(t,n),e("../chart").define("bar",t),t}),n("echarts/chart/scatter",["require","../component/base","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,a,o,r){n.call(this,e,t,a,o,r),i.call(this),this.refresh(o)}var n=e("../component/base"),i=e("./base"),a=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var o=e("../config"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:o.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};for(var t,n,i,a,r=this.component.legend,l=[],h=0,m=e.length;m>h;h++)if(t=e[h],n=t.name,t.type===o.CHART_TYPE_SCATTER){if(e[h]=this.reformOption(e[h]),this.legendHoverLink=e[h].legendHoverLink||this.legendHoverLink,this._sIndex2ShapeMap[h]=this.query(t,"symbol")||this._symbol[h%this._symbol.length],r){if(this.selectedMap[n]=r.isSelected(n),this._sIndex2ColorMap[h]=s.alpha(r.getColor(n),.5),i=r.getItemShape(n)){var a=this._sIndex2ShapeMap[h];i.style.brushType=a.match("empty")?"stroke":"both",a=a.replace("empty","").toLowerCase(),a.match("rectangle")&&(i.style.x+=Math.round((i.style.width-i.style.height)/2),i.style.width=i.style.height),a.match("star")&&(i.style.n=a.replace("star","")-0||5,a="star"),a.match("image")&&(i.style.image=a.replace(new RegExp("^image:\\/\\/"),""),i.style.x+=Math.round((i.style.width-i.style.height)/2),i.style.width=i.style.height,a="image"),i.style.iconType=a,r.setItemShape(n,i)}}else this.selectedMap[n]=!0,this._sIndex2ColorMap[h]=s.alpha(this.zr.getColor(h),.5);this.selectedMap[n]&&l.push(h)}this._buildSeries(l),this.addShapeList()},_buildSeries:function(e){if(0!==e.length){for(var t,n,i,a,o,r,s,l,h=this.series,m={},V=0,U=e.length;U>V;V++)if(t=e[V],n=h[t],0!==n.data.length){o=this.component.xAxis.getAxis(n.xAxisIndex||0),r=this.component.yAxis.getAxis(n.yAxisIndex||0),m[t]=[];for(var d=0,p=n.data.length;p>d;d++)i=n.data[d],a=null!=i?null!=i.value?i.value:i:"-","-"===a||a.length<2||(s=o.getCoord(a[0]),l=r.getCoord(a[1]),m[t].push([s,l,d,i.name||""]));this.xMarkMap[t]=this._markMap(o,r,n.data,m[t]),this.buildMark(t)}this._buildPointList(m)}},_markMap:function(e,t,n,i){for(var a,o={min0:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,sum0:0,counter0:0,average0:0,min1:Number.POSITIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum1:0,counter1:0,average1:0},r=0,s=i.length;s>r;r++)a=n[i[r][2]].value||n[i[r][2]],o.min0>a[0]&&(o.min0=a[0],o.minY0=i[r][1],o.minX0=i[r][0]),o.max0<a[0]&&(o.max0=a[0],o.maxY0=i[r][1],o.maxX0=i[r][0]),o.sum0+=a[0],o.counter0++,o.min1>a[1]&&(o.min1=a[1],o.minY1=i[r][1],o.minX1=i[r][0]),o.max1<a[1]&&(o.max1=a[1],o.maxY1=i[r][1],o.maxX1=i[r][0]),o.sum1+=a[1],o.counter1++;var l=this.component.grid.getX(),h=this.component.grid.getXend(),m=this.component.grid.getY(),V=this.component.grid.getYend();o.average0=(o.sum0/o.counter0).toFixed(2)-0;var U=e.getCoord(o.average0);o.averageLine0=[[U,V],[U,m]],o.minLine0=[[o.minX0,V],[o.minX0,m]],o.maxLine0=[[o.maxX0,V],[o.maxX0,m]],o.average1=(o.sum1/o.counter1).toFixed(2)-0;var d=t.getCoord(o.average1);return o.averageLine1=[[l,d],[h,d]],o.minLine1=[[l,o.minY1],[h,o.minY1]],o.maxLine1=[[l,o.maxY1],[h,o.maxY1]],o},_buildPointList:function(e){var t,n,i,a,o=this.series;for(var r in e)if(t=o[r],n=e[r],t.large&&t.data.length>t.largeThreshold)this.shapeList.push(this._getLargeSymbol(n,this.getItemStyleColor(this.query(t,"itemStyle.normal.color"),r,-1)||this._sIndex2ColorMap[r]));else for(var s=0,l=n.length;l>s;s++)i=n[s],a=this._getSymbol(r,i[2],i[3],i[0],i[1]),a&&this.shapeList.push(a)},_getSymbol:function(e,t,n,i,a){var o,r=this.series,s=r[e],l=s.data[t],h=this.component.dataRange;if(h){if(o=isNaN(l[2])?this._sIndex2ColorMap[e]:h.getColor(l[2]),!o)return null}else o=this._sIndex2ColorMap[e];var m=this.getSymbolShape(s,e,l,t,n,i,a,this._sIndex2ShapeMap[e],o,"rgba(0,0,0,0)","vertical");return m.zlevel=this._zlevelBase,m._main=!0,m},_getLargeSymbol:function(e,t){return new a({zlevel:this._zlevelBase,_main:!0,hoverable:!1,style:{pointList:e,color:t,strokeColor:t},highlightStyle:{pointList:[]}})},getMarkCoord:function(e,t){var n,i=this.series[e],a=this.xMarkMap[e],o=this.component.xAxis.getAxis(i.xAxisIndex),r=this.component.yAxis.getAxis(i.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)n=["string"!=typeof t.xAxis&&o.getCoordByIndex?o.getCoordByIndex(t.xAxis||0):o.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&r.getCoordByIndex?r.getCoordByIndex(t.yAxis||0):r.getCoord(t.yAxis||0)];else{var s=null!=t.valueIndex?t.valueIndex:1;n=[a[t.type+"X"+s],a[t.type+"Y"+s],a[t.type+"Line"+s],a[t.type+s]]}return n},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ondataRange:function(e,t){this.component.dataRange&&(this.refresh(),t.needRefresh=!0)}},r.inherits(t,i),r.inherits(t,n),e("../chart").define("scatter",t),t}),n("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/event","zrender/tool/area","zrender/tool/color","../component"],function(e){function t(e,t,i,a,o){if("undefined"==typeof this.query(a,"dataRange.min")||"undefined"==typeof this.query(a,"dataRange.max"))return void console.error("option.dataRange.min or option.dataRange.max has not been defined.");n.call(this,e,t,i,a,o);var s=this;s._ondrift=function(e,t){return s.__ondrift(this,e,t)},s._ondragend=function(){return s.__ondragend()},s._dataRangeSelected=function(e){return s.__dataRangeSelected(e)},s._dispatchHoverLink=function(e){return s.__dispatchHoverLink(e)},s._onhoverlink=function(e){return s.__onhoverlink(e)},this._selectedMap={},this._range={},this.refresh(a),t.bind(r.EVENT.HOVER,this._onhoverlink)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Rectangle"),o=e("../util/shape/HandlePolygon"),r=e("../config"),s=e("zrender/tool/util"),l=e("zrender/tool/event"),h=e("zrender/tool/area"),m=e("zrender/tool/color");return t.prototype={type:r.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){if(this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem(),this.dataRangeOption.show)for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e]);this._syncShapeFromRange()},_buildItem:function(){var e,t,n,o,r=this._valueTextList,s=r.length,l=this.getFont(this.dataRangeOption.textStyle),m=this._itemGroupLocation.x,V=this._itemGroupLocation.y,U=this.dataRangeOption.itemWidth,d=this.dataRangeOption.itemHeight,p=this.dataRangeOption.itemGap,c=h.getTextHeight("国",l);"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(m=this._itemGroupLocation.x+this._itemGroupLocation.width-U);var u=!0;this.dataRangeOption.text&&(u=!1,this.dataRangeOption.text[0]&&(n=this._getTextShape(m,V,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?m+=h.getTextWidth(this.dataRangeOption.text[0],l)+this._textGap:(V+=c+this._textGap,n.style.y+=c/2+this._textGap,n.style.textBaseline="bottom"),this.shapeList.push(new i(n))));for(var y=0;s>y;y++)e=r[y],o=this.getColorByIndex(y),t=this._getItemShape(m,V,U,d,this._selectedMap[y]?o:"#ccc"),t._idx=y,t.onmousemove=this._dispatchHoverLink,t.onclick=this._dataRangeSelected,this.shapeList.push(new a(t)),u&&(n={zlevel:this._zlevelBase,style:{x:m+U+5,y:V,color:this._selectedMap[y]?this.dataRangeOption.textStyle.color:"#ccc",text:r[y],textFont:l,textBaseline:"top"},highlightStyle:{brushType:"fill"},clickable:!0},"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(n.style.x-=U+10,n.style.textAlign="right"),n._idx=y,n.onclick=this._dataRangeSelected,this.shapeList.push(new i(n))),"horizontal"==this.dataRangeOption.orient?m+=U+(u?5:0)+(u?h.getTextWidth(e,l):0)+p:V+=d+p;!u&&this.dataRangeOption.text[1]&&("horizontal"==this.dataRangeOption.orient?m=m-p+this._textGap:V=V-p+this._textGap,n=this._getTextShape(m,V,this.dataRangeOption.text[1]),"horizontal"!=this.dataRangeOption.orient&&(n.style.y-=5,n.style.textBaseline="top"),this.shapeList.push(new i(n)))},_buildGradient:function(){var t,n,o=this.getFont(this.dataRangeOption.textStyle),r=this._itemGroupLocation.x,s=this._itemGroupLocation.y,l=this.dataRangeOption.itemWidth,m=this.dataRangeOption.itemHeight,V=h.getTextHeight("国",o),U=!0;this.dataRangeOption.text&&(U=!1,this.dataRangeOption.text[0]&&(n=this._getTextShape(r,s,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?r+=h.getTextWidth(this.dataRangeOption.text[0],o)+this._textGap:(s+=V+this._textGap,n.style.y+=V/2+this._textGap,n.style.textBaseline="bottom"),this.shapeList.push(new i(n))));for(var d=e("zrender/tool/color"),p=1/(this.dataRangeOption.color.length-1),c=[],u=0,y=this.dataRangeOption.color.length;y>u;u++)c.push([u*p,this.dataRangeOption.color[u]]);"horizontal"==this.dataRangeOption.orient?(t={zlevel:this._zlevelBase,style:{x:r,y:s,width:10*l,height:m,color:d.getLinearGradient(r,s,r+10*l,s,c)},hoverable:!1},r+=10*l+this._textGap):(t={zlevel:this._zlevelBase,style:{x:r,y:s,width:l,height:10*m,color:d.getLinearGradient(r,s,r,s+10*m,c)},hoverable:!1},s+=10*m+this._textGap),this.shapeList.push(new a(t)),this._calculableLocation=t.style,this.dataRangeOption.calculable&&(this._buildFiller(),this._bulidMask(),this._bulidHandle()),this._buildIndicator(),!U&&this.dataRangeOption.text[1]&&(n=this._getTextShape(r,s,this.dataRangeOption.text[1]),this.shapeList.push(new i(n)))},_buildIndicator:function(){var e,t,n=this._calculableLocation.x,i=this._calculableLocation.y,a=this._calculableLocation.width,r=this._calculableLocation.height,s=5;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(e=[[n,i+r],[n-s,i+r+s],[n+s,i+r+s]],t="bottom"):(e=[[n,i],[n-s,i-s],[n+s,i-s]],t="top"):"right"!=this.dataRangeOption.x?(e=[[n+a,i],[n+a+s,i-s],[n+a+s,i+s]],t="right"):(e=[[n,i],[n-s,i-s],[n-s,i+s]],t="left"),this._indicatorShape={style:{pointList:e,color:"#fff",__rect:{x:Math.min(e[0][0],e[1][0]),y:Math.min(e[0][1],e[1][1]),width:s*("horizontal"==this.dataRangeOption.orient?2:1),height:s*("horizontal"==this.dataRangeOption.orient?1:2)}},highlightStyle:{brushType:"fill",textPosition:t,textColor:this.dataRangeOption.textStyle.color},hoverable:!1},this._indicatorShape=new o(this._indicatorShape)},_buildFiller:function(){this._fillerShape={zlevel:this._zlevelBase+1,style:{x:this._calculableLocation.x,y:this._calculableLocation.y,width:this._calculableLocation.width,height:this._calculableLocation.height,color:"rgba(255,255,255,0)"},highlightStyle:{strokeColor:"rgba(255,255,255,0.5)",lineWidth:1},draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,onmousemove:this._dispatchHoverLink,_type:"filler"},this._fillerShape=new a(this._fillerShape),this.shapeList.push(this._fillerShape)},_bulidHandle:function(){var e,t,n,i,a,r,s,l,m=this._calculableLocation.x,V=this._calculableLocation.y,U=this._calculableLocation.width,d=this._calculableLocation.height,p=this.getFont(this.dataRangeOption.textStyle),c=h.getTextHeight("国",p),u=Math.max(h.getTextWidth(this._textFormat(this.dataRangeOption.max),p),h.getTextWidth(this._textFormat(this.dataRangeOption.min),p))+2;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(e=[[m,V],[m,V+d+c],[m-c,V+d+c],[m-1,V+d],[m-1,V]],t=m-u/2-c,n=V+d+c/2+2,i={x:m-u-c,y:V+d,width:u+c,height:c},a=[[m+U,V],[m+U,V+d+c],[m+U+c,V+d+c],[m+U+1,V+d],[m+U+1,V]],r=m+U+u/2+c,s=n,l={x:m+U,y:V+d,width:u+c,height:c}):(e=[[m,V+d],[m,V-c],[m-c,V-c],[m-1,V],[m-1,V+d]],t=m-u/2-c,n=V-c/2-2,i={x:m-u-c,y:V-c,width:u+c,height:c},a=[[m+U,V+d],[m+U,V-c],[m+U+c,V-c],[m+U+1,V],[m+U+1,V+d]],r=m+U+u/2+c,s=n,l={x:m+U,y:V-c,width:u+c,height:c}):(u+=c,"right"!=this.dataRangeOption.x?(e=[[m,V],[m+U+c,V],[m+U+c,V-c],[m+U,V-1],[m,V-1]],t=m+U+u/2+c/2,n=V-c/2,i={x:m+U,y:V-c,width:u+c,height:c},a=[[m,V+d],[m+U+c,V+d],[m+U+c,V+c+d],[m+U,V+1+d],[m,V+d+1]],r=t,s=V+d+c/2,l={x:m+U,y:V+d,width:u+c,height:c}):(e=[[m+U,V],[m-c,V],[m-c,V-c],[m,V-1],[m+U,V-1]],t=m-u/2-c/2,n=V-c/2,i={x:m-u-c,y:V-c,width:u+c,height:c},a=[[m+U,V+d],[m-c,V+d],[m-c,V+c+d],[m,V+1+d],[m+U,V+d+1]],r=t,s=V+d+c/2,l={x:m-u-c,y:V+d,width:u+c,height:c})),this._startShape={style:{pointList:e,text:this._textFormat(this.dataRangeOption.max),textX:t,textY:n,color:this.getColor(this.dataRangeOption.max),rect:i,x:e[0][0],y:e[0][1],_x:e[0][0],_y:e[0][1]}},this._startShape.highlightStyle={strokeColor:this._startShape.style.color,lineWidth:1},this._endShape={style:{pointList:a,text:this._textFormat(this.dataRangeOption.min),textX:r,textY:s,color:this.getColor(this.dataRangeOption.min),rect:l,x:a[0][0],y:a[0][1],_x:a[0][0],_y:a[0][1]}},this._endShape.highlightStyle={strokeColor:this._endShape.style.color,lineWidth:1},this._startShape.zlevel=this._endShape.zlevel=this._zlevelBase+1,this._startShape.draggable=this._endShape.draggable=!0,this._startShape.ondrift=this._endShape.ondrift=this._ondrift,this._startShape.ondragend=this._endShape.ondragend=this._ondragend,this._startShape.style.textColor=this._endShape.style.textColor=this.dataRangeOption.textStyle.color,this._startShape.style.textAlign=this._endShape.style.textAlign="center",this._startShape.style.textPosition=this._endShape.style.textPosition="specific",this._startShape.style.textBaseline=this._endShape.style.textBaseline="middle",this._startShape.style.width=this._endShape.style.width=0,this._startShape.style.height=this._endShape.style.height=0,this._startShape.style.textPosition=this._endShape.style.textPosition="specific",this._startShape=new o(this._startShape),this._endShape=new o(this._endShape),this.shapeList.push(this._startShape),this.shapeList.push(this._endShape)},_bulidMask:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,i=this._calculableLocation.height;this._startMask={zlevel:this._zlevelBase+1,style:{x:e,y:t,width:"horizontal"==this.dataRangeOption.orient?0:n,height:"horizontal"==this.dataRangeOption.orient?i:0,color:"#ccc"},hoverable:!1},this._endMask={zlevel:this._zlevelBase+1,style:{x:"horizontal"==this.dataRangeOption.orient?e+n:e,y:"horizontal"==this.dataRangeOption.orient?t:t+i,width:"horizontal"==this.dataRangeOption.orient?0:n,height:"horizontal"==this.dataRangeOption.orient?i:0,color:"#ccc"},hoverable:!1},this._startMask=new a(this._startMask),this._endMask=new a(this._endMask),this.shapeList.push(this._startMask),this.shapeList.push(this._endMask)},_buildBackground:function(){var e=this.reformCssArray(this.dataRangeOption.padding);this.shapeList.push(new a({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.dataRangeOption.borderWidth?"fill":"both",color:this.dataRangeOption.backgroundColor,strokeColor:this.dataRangeOption.borderColor,lineWidth:this.dataRangeOption.borderWidth}}))},_getItemGroupLocation:function(){var e=this._valueTextList,t=e.length,n=this.dataRangeOption.itemGap,i=this.dataRangeOption.itemWidth,a=this.dataRangeOption.itemHeight,o=0,r=0,s=this.getFont(this.dataRangeOption.textStyle),l=h.getTextHeight("国",s);if("horizontal"==this.dataRangeOption.orient){if(this.dataRangeOption.text||this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable)o=(this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?10*i+n:t*(i+n))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?h.getTextWidth(this.dataRangeOption.text[0],s)+this._textGap:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?h.getTextWidth(this.dataRangeOption.text[1],s)+this._textGap:0);else{i+=5;for(var m=0;t>m;m++)o+=i+h.getTextWidth(e[m],s)+n}o-=n,r=Math.max(l,a)}else{var V;if(this.dataRangeOption.text||this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable)r=(this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?10*a+n:t*(a+n))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?this._textGap+l:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?this._textGap+l:0),V=Math.max(h.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[0]||"",s),h.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[1]||"",s)),o=Math.max(i,V);else{r=(a+n)*t,i+=5,V=0;for(var m=0;t>m;m++)V=Math.max(V,h.getTextWidth(e[m],s));o=i+V}r-=n}var U,d=this.reformCssArray(this.dataRangeOption.padding),p=this.zr.getWidth();switch(this.dataRangeOption.x){case"center":U=Math.floor((p-o)/2);break;case"left":U=d[3]+this.dataRangeOption.borderWidth;break;case"right":U=p-o-d[1]-this.dataRangeOption.borderWidth;break;default:U=this.parsePercent(this.dataRangeOption.x,p),U=isNaN(U)?0:U}var c,u=this.zr.getHeight();switch(this.dataRangeOption.y){case"top":c=d[0]+this.dataRangeOption.borderWidth;break;case"bottom":c=u-r-d[2]-this.dataRangeOption.borderWidth;break;case"center":c=Math.floor((u-r)/2);break;default:c=this.parsePercent(this.dataRangeOption.y,u),c=isNaN(c)?0:c}if(this.dataRangeOption.calculable){var y=Math.max(h.getTextWidth(this.dataRangeOption.max,s),h.getTextWidth(this.dataRangeOption.min,s))+l;"horizontal"==this.dataRangeOption.orient?(y>U&&(U=y),U+o+y>p&&(U-=y)):(l>c&&(c=l),c+r+l>u&&(c-=l))}return{x:U,y:c,width:o,height:r}},_getTextShape:function(e,t,n){return{zlevel:this._zlevelBase,style:{x:"horizontal"==this.dataRangeOption.orient?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:"horizontal"==this.dataRangeOption.orient?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:"horizontal"==this.dataRangeOption.orient?"middle":"top",textAlign:"horizontal"==this.dataRangeOption.orient?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,i,a){return{zlevel:this._zlevelBase,style:{x:e,y:t+1,width:n,height:i-2,color:a},highlightStyle:{strokeColor:a,lineWidth:1},clickable:!0}},__ondrift:function(e,t,n){var i=this._calculableLocation.x,a=this._calculableLocation.y,o=this._calculableLocation.width,r=this._calculableLocation.height;return"horizontal"==this.dataRangeOption.orient?e.style.x+t<=i?e.style.x=i:e.style.x+t+e.style.width>=i+o?e.style.x=i+o-e.style.width:e.style.x+=t:e.style.y+n<=a?e.style.y=a:e.style.y+n+e.style.height>=a+r?e.style.y=a+r-e.style.height:e.style.y+=n,"filler"==e._type?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(!this.dataRangeOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,this.dataRangeOption.realtime||this.messageCenter.dispatch(r.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart),t.needRefresh=!1,this.isDragend=!1)},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};if(this._range.end="undefined"!=typeof this._range.end?this._range.end:"undefined"!=typeof e.start?e.start:0,this._range.start="undefined"!=typeof this._range.start?this._range.start:"undefined"!=typeof e.end?e.end:100,100!=this._range.start||0!==this._range.end){if("horizontal"==this.dataRangeOption.orient){var t=this._fillerShape.style.width;this._fillerShape.style.x+=t*(100-this._range.start)/100,this._fillerShape.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShape.style.height;this._fillerShape.style.y+=n*(100-this._range.start)/100,this._fillerShape.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShape.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,i=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(this._startShape.style.x=this._fillerShape.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShape.style.x+this._fillerShape.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShape.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShape.style.y+this._fillerShape.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+i-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/i*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/i*100)),this._syncShape()},_syncFillerShape:function(e){var t,n,i=this._calculableLocation.x,a=this._calculableLocation.y,o=this._calculableLocation.width,r=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(t=this._startShape.style.x,n=this._endShape.style.x,e.id==this._startShape.id&&t>=n?(n=t,this._endShape.style.x=t):e.id==this._endShape.id&&t>=n&&(t=n,this._startShape.style.x=t),this._fillerShape.style.x=t,this._fillerShape.style.width=n-t,this._startMask.style.width=t-i,this._endMask.style.x=n,this._endMask.style.width=i+o-n,this._range.start=Math.ceil(100-(t-i)/o*100),this._range.end=Math.floor(100-(n-i)/o*100)):(t=this._startShape.style.y,n=this._endShape.style.y,e.id==this._startShape.id&&t>=n?(n=t,this._endShape.style.y=t):e.id==this._endShape.id&&t>=n&&(t=n,this._startShape.style.y=t),this._fillerShape.style.y=t,this._fillerShape.style.height=n-t,this._startMask.style.height=t-a,this._endMask.style.y=n,this._endMask.style.height=a+r-n,this._range.start=Math.ceil(100-(t-a)/r*100),this._range.end=Math.floor(100-(n-a)/r*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShape.id),this.zr.refresh()},_syncData:function(){this.dataRangeOption.realtime&&this.messageCenter.dispatch(r.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){var t=e.target._idx;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(r.EVENT.REFRESH,null,null,this.myChart)},__dispatchHoverLink:function(e){var t,n;if(this.dataRangeOption.calculable){var i,a=this.dataRangeOption.max-this.dataRangeOption.min;i="horizontal"==this.dataRangeOption.orient?(1-(l.getX(e.event)-this._calculableLocation.x)/this._calculableLocation.width)*a:(1-(l.getY(e.event)-this._calculableLocation.y)/this._calculableLocation.height)*a,t=i-.05*a,n=i+.05*a}else{var o=e.target._idx;n=(this._colorList.length-o)*this._gap+this.dataRangeOption.min,t=n-this._gap}this.messageCenter.dispatch(r.EVENT.DATA_RANGE_HOVERLINK,e.event,{valueMin:t,valueMax:n},this.myChart)},__onhoverlink:function(e){if(this.dataRangeOption.show&&this.dataRangeOption.hoverLink&&this._indicatorShape&&e&&null!=e.seriesIndex&&null!=e.dataIndex){var t=e.value;if(isNaN(t))return;t<this.dataRangeOption.min?t=this.dataRangeOption.min:t>this.dataRangeOption.max&&(t=this.dataRangeOption.max),this._indicatorShape.position="horizontal"==this.dataRangeOption.orient?[(this.dataRangeOption.max-t)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.width,0]:[0,(this.dataRangeOption.max-t)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.height],this._indicatorShape.style.text=e.value,this._indicatorShape.style.color=this.getColor(t),this.zr.addHoverShape(this._indicatorShape)}},_textFormat:function(e,t){if(e=e.toFixed(this.dataRangeOption.precision),t="undefined"!=typeof t?t.toFixed(this.dataRangeOption.precision):"",this.dataRangeOption.formatter){if("string"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if("function"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.call(this.myChart,e,t)}return""!==t?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.dataRangeOption=this.option.dataRange,this.myChart.canvasSupported||(this.dataRangeOption.realtime=!1);var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;if(this._colorList=m.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1),this._colorList.length>t){for(var n=this._colorList.length,i=[this._colorList[0]],a=n/(t-1),o=1;t-1>o;o++)i.push(this._colorList[Math.floor(o*a)]);i.push(this._colorList[n-1]),this._colorList=i}var r=this.dataRangeOption.precision;for(this._gap=(this.dataRangeOption.max-this.dataRangeOption.min)/t;this._gap.toFixed(r)-0!=this._gap&&5>r;)r++;this.dataRangeOption.precision=r,this._gap=((this.dataRangeOption.max-this.dataRangeOption.min)/t).toFixed(r)-0,this._valueTextList=[];for(var o=0;t>o;o++)this._selectedMap[o]=!0,this._valueTextList.unshift(this._textFormat(o*this._gap+this.dataRangeOption.min,(o+1)*this._gap+this.dataRangeOption.min))}this.clear(),this._buildShape() |
|
@@ 9-9 (lines=1) @@ | ||
6 | },touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&s.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment<V.touchClickDelay&&(this._mobildFindFixed(e),this._clickHandler(e),t-this._lastClickMoment<V.touchClickDelay/2&&(this._dblclickHandler(e),this._lastHover&&this._lastHover.clickable&&s.stop(e)),this._lastClickMoment=t),this.painter.clearHover()}},c=function(e,t,o){U.call(this),this.root=e,this.storage=t,this.painter=o,this._lastX=this._lastY=this._mouseX=this._mouseY=0,this._findHover=n(a,this),this._domHover=o.getDomHover(),i(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),r.os.tablet||r.os.phone?(e.addEventListener("touchstart",this._touchstartHandler),e.addEventListener("touchmove",this._touchmoveHandler),e.addEventListener("touchend",this._touchendHandler)):(e.addEventListener("click",this._clickHandler),e.addEventListener("dblclick",this._dblclickHandler),e.addEventListener("mousewheel",this._mousewheelHandler),e.addEventListener("mousemove",this._mousemoveHandler),e.addEventListener("mousedown",this._mousedownHandler),e.addEventListener("mouseup",this._mouseupHandler)),e.addEventListener("DOMMouseScroll",this._mousewheelHandler),e.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),e.attachEvent("onclick",this._clickHandler),e.ondblclick=this._dblclickHandler,e.attachEvent("onmousewheel",this._mousewheelHandler),e.attachEvent("onmousemove",this._mousemoveHandler),e.attachEvent("onmouseout",this._mouseoutHandler),e.attachEvent("onmousedown",this._mousedownHandler),e.attachEvent("onmouseup",this._mouseupHandler))};c.prototype.on=function(e,t){return this.bind(e,t),this},c.prototype.un=function(e,t){return this.unbind(e,t),this},c.prototype.trigger=function(e,t){switch(e){case V.RESIZE:case V.CLICK:case V.DBLCLICK:case V.MOUSEWHEEL:case V.MOUSEMOVE:case V.MOUSEDOWN:case V.MOUSEUP:case V.MOUSEOUT:this["_"+e+"Handler"](t)}},c.prototype.dispose=function(){var e=this.root;window.removeEventListener?(window.removeEventListener("resize",this._resizeHandler),r.os.tablet||r.os.phone?(e.removeEventListener("touchstart",this._touchstartHandler),e.removeEventListener("touchmove",this._touchmoveHandler),e.removeEventListener("touchend",this._touchendHandler)):(e.removeEventListener("click",this._clickHandler),e.removeEventListener("dblclick",this._dblclickHandler),e.removeEventListener("mousewheel",this._mousewheelHandler),e.removeEventListener("mousemove",this._mousemoveHandler),e.removeEventListener("mousedown",this._mousedownHandler),e.removeEventListener("mouseup",this._mouseupHandler)),e.removeEventListener("DOMMouseScroll",this._mousewheelHandler),e.removeEventListener("mouseout",this._mouseoutHandler)):(window.detachEvent("onresize",this._resizeHandler),e.detachEvent("onclick",this._clickHandler),e.detachEvent("dblclick",this._dblclickHandler),e.detachEvent("onmousewheel",this._mousewheelHandler),e.detachEvent("onmousemove",this._mousemoveHandler),e.detachEvent("onmouseout",this._mouseoutHandler),e.detachEvent("onmousedown",this._mousedownHandler),e.detachEvent("onmouseup",this._mouseupHandler)),this.root=this._domHover=this.storage=this.painter=null,this.un()},c.prototype._processDragStart=function(e){var t=this._lastHover;if(this._isMouseDown&&t&&t.draggable&&!this._draggingTarget&&this._mouseDownTarget==t){if(t.dragEnableTime&&new Date-this._lastMouseDownMoment<t.dragEnableTime)return;var n=t;this._draggingTarget=n,this._isDragging=1,n.invisible=!0,this.storage.mod(n.id),this._dispatchAgency(n,V.DRAGSTART,e),this.painter.refresh()}},c.prototype._processDragEnter=function(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,V.DRAGENTER,e,this._draggingTarget)},c.prototype._processDragOver=function(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,V.DRAGOVER,e,this._draggingTarget)},c.prototype._processDragLeave=function(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,V.DRAGLEAVE,e,this._draggingTarget)},c.prototype._processDrop=function(e){this._draggingTarget&&(this._draggingTarget.invisible=!1,this.storage.mod(this._draggingTarget.id),this.painter.refresh(),this._dispatchAgency(this._lastHover,V.DROP,e,this._draggingTarget))},c.prototype._processDragEnd=function(e){this._draggingTarget&&(this._dispatchAgency(this._draggingTarget,V.DRAGEND,e),this._lastHover=null),this._isDragging=0,this._draggingTarget=null},c.prototype._processOverShape=function(e){this._dispatchAgency(this._lastHover,V.MOUSEOVER,e)},c.prototype._processOutShape=function(e){this._dispatchAgency(this._lastHover,V.MOUSEOUT,e)},c.prototype._dispatchAgency=function(e,t,n,i){var a="on"+t,o={type:t,event:n,target:e,cancelBubble:!1},r=e;for(i&&(o.dragged=i);r&&(r[a]&&(o.cancelBubble=r[a](o)),r.dispatch(t,o),r=r.parent,!o.cancelBubble););e?o.cancelBubble||this.dispatch(t,o):i||this.dispatch(t,{type:t,event:n})},c.prototype._iterateAndFindHover=function(){var e=m.create();return function(){for(var t,n,i=this.storage.getShapeList(),a=[0,0],o=i.length-1;o>=0;o--){var r=i[o];if(t!==r.zlevel&&(n=this.painter.getLayer(r.zlevel,n),a[0]=this._mouseX,a[1]=this._mouseY,n.needTransform&&(m.invert(e,n.transform),h.applyTransform(a,a,e))),this._findHover(r,a[0],a[1]))break}}}();var u=[{x:10},{x:-20},{x:10,y:10},{y:-20}];return c.prototype._mobildFindFixed=function(e){this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var t=0;!this._lastHover&&t<u.length;t++){var n=u[t];n.x&&(this._mouseX+=n.x),n.y&&(this._mouseX+=n.y),this._iterateAndFindHover()}this._lastHover&&(e.zrenderX=this._mouseX,e.zrenderY=this._mouseY)},c.prototype._zrenderEventFixed=function(e,t){if(e.zrenderFixed)return e;if(t){var n="touchend"!=e.type?e.targetTouches[0]:e.changedTouches[0];if(n){var i=this.root.getBoundingClientRect();e.zrenderX=n.clientX-i.left,e.zrenderY=n.clientY-i.top}}else{e=e||window.event;var a=e.toElement||e.relatedTarget||e.srcElement||e.target;a&&a!=this._domHover&&(e.zrenderX=("undefined"!=typeof e.offsetX?e.offsetX:e.layerX)+a.offsetLeft,e.zrenderY=("undefined"!=typeof e.offsetY?e.offsetY:e.layerY)+a.offsetTop)}return e.zrenderFixed=1,e},l.merge(c.prototype,U.prototype,!0),c}),n("zrender/Painter",["require","./config","./tool/util","./tool/log","./tool/matrix","./loadingEffect/Base","./mixin/Transformable","./shape/Image"],function(e){"use strict";function t(){return!1}function n(){}function i(e,t,n){var i=document.createElement(t),a=n._width,o=n._height;return i.style.position="absolute",i.style.left=0,i.style.top=0,i.style.width=a+"px",i.style.height=o+"px",i.setAttribute("width",a*m),i.setAttribute("height",o*m),i.setAttribute("data-zr-dom-id",e),i}var a=e("./config"),o=e("./tool/util"),r=e("./tool/log"),s=e("./tool/matrix"),l=e("./loadingEffect/Base"),h=e("./mixin/Transformable"),m=window.devicePixelRatio||1;m=Math.max(m,1);var V=window.G_vmlCanvasManager,U=function(e,n){this.root=e,this.storage=n,e.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var a=document.createElement("div");this._domRoot=a,a.style.position="relative",a.style.overflow="hidden",a.style.width=this._width+"px",a.style.height=this._height+"px",e.appendChild(a),this._layers={},this._zlevelList=[],this._layerConfig={},this._loadingEffect=new l({}),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=i("bg","div",this),a.appendChild(this._bgDom),this._bgDom.onselectstart=t,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none",this._bgDom.style["-webkit-touch-callout"]="none";var o=new d("_zrender_hover_",this);this._layers.hover=o,a.appendChild(o.dom),o.initContext(),o.dom.onselectstart=t,o.dom.style["-webkit-user-select"]="none",o.dom.style["user-select"]="none",o.dom.style["-webkit-touch-callout"]="none",this.refreshNextFrame=null};U.prototype.render=function(e){return this.isLoading()&&this.hideLoading(),this.refresh(e,!0),this},U.prototype.refresh=function(e,t){var n=this.storage.getShapeList(!0);return this._paintList(n,t),"function"==typeof e&&e(),this},U.prototype._paintList=function(e,t){"undefined"==typeof t&&(t=!1),this._updateLayerStatus(e);var n,i,o;for(var l in this._layers)"hover"!==l&&(this._layers[l].unusedCount++,this._layers[l].updateTransform());for(var h=[],m=0,U=e.length;U>m;m++){var d=e[m];if(i!==d.zlevel&&(n&&(n.needTransform&&o.restore(),o.flush&&o.flush()),n=this.getLayer(d.zlevel),o=n.ctx,i=d.zlevel,n.unusedCount=0,(n.dirty||t)&&n.clear(),n.needTransform&&(o.save(),n.setTransform(o))),d.__startClip&&!V){var p=d.__startClip;if(o.save(),p.needTransform){var c=p.transform;s.invert(h,c),o.transform(c[0],c[1],c[2],c[3],c[4],c[5])}if(o.beginPath(),p.buildPath(o,p.style),o.clip(),p.needTransform){var c=h;o.transform(c[0],c[1],c[2],c[3],c[4],c[5])}}if((n.dirty||t)&&!d.invisible&&(!d.onbrush||d.onbrush&&!d.onbrush(o,!1)))if(a.catchBrushException)try{d.brush(o,!1,this.refreshNextFrame)}catch(u){r(u,"brush error of "+d.type,d)}else d.brush(o,!1,this.refreshNextFrame);d.__stopClip&&!V&&o.restore(),d.__dirty=!1}n&&(n.needTransform&&o.restore(),o.flush&&o.flush());for(var l in this._layers)if("hover"!==l){var y=this._layers[l];y.dirty=!1,1==y.unusedCount&&y.clear()}},U.prototype.getLayer=function(e){var t=this._layers[e];if(!t){var n=this._zlevelList.length,i=null,a=-1;if(n>0&&e>this._zlevelList[0]){for(a=0;n-1>a&&!(this._zlevelList[a]<e&&this._zlevelList[a+1]>e);a++);i=this._layers[this._zlevelList[a]]}this._zlevelList.splice(a+1,0,e),t=new d(e,this);var r=i?i.dom:this._bgDom;r.nextSibling?r.parentNode.insertBefore(t.dom,r.nextSibling):r.parentNode.appendChild(t.dom),t.initContext(),this._layers[e]=t,this._layerConfig[e]&&o.merge(t,this._layerConfig[e],!0),t.updateTransform()}return t},U.prototype.getLayers=function(){return this._layers},U.prototype._updateLayerStatus=function(e){var t=this._layers,n={};for(var i in t)"hover"!==i&&(n[i]=t[i].elCount,t[i].elCount=0);for(var a=0,o=e.length;o>a;a++){var r=e[a],s=r.zlevel,l=t[s];if(l){if(l.elCount++,l.dirty)continue;l.dirty=r.__dirty}}for(var i in t)"hover"!==i&&n[i]!==t[i].elCount&&(t[i].dirty=!0)},U.prototype.refreshShapes=function(e,t){for(var n=0,i=e.length;i>n;n++){var a=e[n];a.modSelf()}return this.refresh(t),this},U.prototype.setLoadingEffect=function(e){return this._loadingEffect=e,this},U.prototype.clear=function(){for(var e in this._layers)"hover"!=e&&this._layers[e].clear();return this},U.prototype.modLayer=function(e,t){if(t){this._layerConfig[e]?o.merge(this._layerConfig[e],t,!0):this._layerConfig[e]=t;var n=this._layers[e];n&&o.merge(n,this._layerConfig[e],!0)}},U.prototype.delLayer=function(e){var t=this._layers[e];t&&(this.modLayer(e,{position:t.position,rotation:t.rotation,scale:t.scale}),t.dom.parentNode.removeChild(t.dom),delete this._layers[e],this._zlevelList.splice(o.indexOf(this._zlevelList,e),1))},U.prototype.refreshHover=function(){this.clearHover();for(var e=this.storage.getHoverShapes(!0),t=0,n=e.length;n>t;t++)this._brushHover(e[t]);var i=this._layers.hover.ctx;return i.flush&&i.flush(),this.storage.delHover(),this},U.prototype.clearHover=function(){var e=this._layers.hover;return e&&e.clear(),this},U.prototype.showLoading=function(e){return this._loadingEffect&&this._loadingEffect.stop(),e&&this.setLoadingEffect(e),this._loadingEffect.start(this),this.loading=!0,this},U.prototype.hideLoading=function(){return this._loadingEffect.stop(),this.clearHover(),this.loading=!1,this},U.prototype.isLoading=function(){return this.loading},U.prototype.resize=function(){var e=this._domRoot;e.style.display="none";var t=this._getWidth(),n=this._getHeight();if(e.style.display="",this._width!=t||n!=this._height){this._width=t,this._height=n,e.style.width=t+"px",e.style.height=n+"px";for(var i in this._layers)this._layers[i].resize(t,n);this.refresh(null,!0)}return this},U.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},U.prototype.dispose=function(){this.isLoading()&&this.hideLoading(),this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},U.prototype.getDomHover=function(){return this._layers.hover.dom},U.prototype.toDataURL=function(e,t,n){if(V)return null;var o=i("image","canvas",this);this._bgDom.appendChild(o);var s=o.getContext("2d");1!=m&&s.scale(m,m),s.fillStyle=t||"#fff",s.rect(0,0,this._width*m,this._height*m),s.fill();var l=this;this.storage.iterShape(function(e){if(!e.invisible&&(!e.onbrush||e.onbrush&&!e.onbrush(s,!1)))if(a.catchBrushException)try{e.brush(s,!1,l.refreshNextFrame)}catch(t){r(t,"brush error of "+e.type,e)}else e.brush(s,!1,l.refreshNextFrame)},{normal:"up",update:!0});var h=o.toDataURL(e,n);return s=null,this._bgDom.removeChild(o),h},U.prototype.getWidth=function(){return this._width},U.prototype.getHeight=function(){return this._height},U.prototype._getWidth=function(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientWidth||parseInt(t.width,10))-parseInt(t.paddingLeft,10)-parseInt(t.paddingRight,10)).toFixed(0)-0},U.prototype._getHeight=function(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientHeight||parseInt(t.height,10))-parseInt(t.paddingTop,10)-parseInt(t.paddingBottom,10)).toFixed(0)-0},U.prototype._brushHover=function(e){var t=this._layers.hover.ctx;if(!e.onbrush||e.onbrush&&!e.onbrush(t,!0)){var n=this.getLayer(e.zlevel);if(n.needTransform&&(t.save(),n.setTransform(t)),a.catchBrushException)try{e.brush(t,!0,this.refreshNextFrame)}catch(i){r(i,"hoverBrush error of "+e.type,e)}else e.brush(t,!0,this.refreshNextFrame);n.needTransform&&t.restore()}},U.prototype._shapeToImage=function(t,n,i,a,o){var r=document.createElement("canvas"),s=r.getContext("2d"),o=window.devicePixelRatio||1;r.style.width=i+"px",r.style.height=a+"px",r.setAttribute("width",i*o),r.setAttribute("height",a*o),s.clearRect(0,0,i*o,a*o);var l={position:n.position,rotation:n.rotation,scale:n.scale};n.position=[0,0,0],n.rotation=0,n.scale=[1,1],n&&n.brush(s,!1);var h=e("./shape/Image"),m=new h({id:t,style:{x:0,y:0,image:r}});return null!=l.position&&(m.position=n.position=l.position),null!=l.rotation&&(m.rotation=n.rotation=l.rotation),null!=l.scale&&(m.scale=n.scale=l.scale),m},U.prototype._createShapeToImageProcessor=function(){if(V)return n;var e=this;return function(t,n,i,a){return e._shapeToImage(t,n,i,a,m)}};var d=function(e,n){this.dom=i(e,"canvas",n),this.dom.onselectstart=t,this.dom.style["-webkit-user-select"]="none",this.dom.style["user-select"]="none",this.dom.style["-webkit-touch-callout"]="none",V&&V.initElement(this.dom),this.domBack=null,this.ctxBack=null,this.painter=n,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.zoomable=!1,this.panable=!1,this.maxZoom=1/0,this.minZoom=0,h.call(this)};return d.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),1!=m&&this.ctx.scale(m,m)},d.prototype.createBackBuffer=function(){V||(this.domBack=i("back-"+this.id,"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d"),1!=m&&this.ctxBack.scale(m,m))},d.prototype.resize=function(e,t){this.dom.style.width=e+"px",this.dom.style.height=t+"px",this.dom.setAttribute("width",e*m),this.dom.setAttribute("height",t*m),1!=m&&this.ctx.scale(m,m),this.domBack&&(this.domBack.setAttribute("width",e*m),this.domBack.setAttribute("height",t*m),1!=m&&this.ctxBack.scale(m,m))},d.prototype.clear=function(){var e=this.dom,t=this.ctx,n=e.width,i=e.height,a=this.clearColor&&!V,o=this.motionBlur&&!V,r=this.lastFrameAlpha;if(o&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(e,0,0,n/m,i/m)),a?(t.save(),t.fillStyle=this.config.clearColor,t.fillRect(0,0,n/m,i/m),t.restore()):t.clearRect(0,0,n/m,i/m),o){var s=this.domBack;t.save(),t.globalAlpha=r,t.drawImage(s,0,0,n/m,i/m),t.restore()}},o.merge(d.prototype,h.prototype),U}),n("zrender/Storage",["require","./tool/util","./Group"],function(e){"use strict";function t(e,t){return e.zlevel==t.zlevel?e.z==t.z?e.__renderidx-t.__renderidx:e.z-t.z:e.zlevel-t.zlevel}var n=e("./tool/util"),i=e("./Group"),a={hover:!1,normal:"down",update:!1},o=function(){this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],this._shapeListOffset=0};return o.prototype.iterShape=function(e,t){if(t||(t=a),t.hover)for(var n=0,i=this._hoverElements.length;i>n;n++){var o=this._hoverElements[n];if(o.updateTransform(),e(o))return this}switch(t.update&&this.updateShapeList(),t.normal){case"down":for(var i=this._shapeList.length;i--;)if(e(this._shapeList[i]))return this;break;default:for(var n=0,i=this._shapeList.length;i>n;n++)if(e(this._shapeList[n]))return this}return this},o.prototype.getHoverShapes=function(e){for(var n=[],i=0,a=this._hoverElements.length;a>i;i++){n.push(this._hoverElements[i]);var o=this._hoverElements[i].hoverConnect;if(o){var r;o=o instanceof Array?o:[o];for(var s=0,l=o.length;l>s;s++)r=o[s].id?o[s]:this.get(o[s]),r&&n.push(r)}}if(n.sort(t),e)for(var i=0,a=n.length;a>i;i++)n[i].updateTransform();return n},o.prototype.getShapeList=function(e){return e&&this.updateShapeList(),this._shapeList},o.prototype.updateShapeList=function(){this._shapeListOffset=0;for(var e=0,n=this._roots.length;n>e;e++){var i=this._roots[e];this._updateAndAddShape(i)}this._shapeList.length=this._shapeListOffset;for(var e=0,n=this._shapeList.length;n>e;e++)this._shapeList[e].__renderidx=e;this._shapeList.sort(t)},o.prototype._updateAndAddShape=function(e,t){if(!e.ignore)if(e.updateTransform(),"group"==e.type){e.clipShape&&(e.clipShape.parent=e,e.clipShape.updateTransform(),t?(t=t.slice(),t.push(e.clipShape)):t=[e.clipShape]);for(var n=0;n<e._children.length;n++){var i=e._children[n];i.__dirty=e.__dirty||i.__dirty,this._updateAndAddShape(i,t)}e.__dirty=!1}else e.__clipShapes=t,this._shapeList[this._shapeListOffset++]=e},o.prototype.mod=function(e,t){var i=this._elements[e];if(i&&(i.modSelf(),t))if(t.parent||t._storage||t.__startClip){var a={};for(var o in t)"parent"!=o&&"_storage"!=o&&"__startClip"!=o&&t.hasOwnProperty(o)&&(a[o]=t[o]);n.merge(i,a,!0)}else n.merge(i,t,!0);return this},o.prototype.drift=function(e,t,n){var i=this._elements[e];return i&&(i.needTransform=!0,"horizontal"===i.draggable?n=0:"vertical"===i.draggable&&(t=0),(!i.ondrift||i.ondrift&&!i.ondrift(t,n))&&i.drift(t,n)),this},o.prototype.addHover=function(e){return e.updateNeedTransform(),this._hoverElements.push(e),this},o.prototype.delHover=function(){return this._hoverElements=[],this},o.prototype.hasHoverShape=function(){return this._hoverElements.length>0},o.prototype.addRoot=function(e){e instanceof i&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},o.prototype.delRoot=function(e){if("undefined"==typeof e){for(var t=0;t<this._roots.length;t++){var a=this._roots[t];a instanceof i&&a.delChildrenFromStorage(this)}return this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],void(this._shapeListOffset=0)}if(e instanceof Array)for(var t=0,o=e.length;o>t;t++)this.delRoot(e[t]);else{var r;r="string"==typeof e?this._elements[e]:e;var s=n.indexOf(this._roots,r);s>=0&&(this.delFromMap(r.id),this._roots.splice(s,1),r instanceof i&&r.delChildrenFromStorage(this))}},o.prototype.addToMap=function(e){return e instanceof i&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this},o.prototype.get=function(e){return this._elements[e]},o.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof i&&(t._storage=null)),this},o.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},o}),n("zrender/animation/Animation",["require","./Clip","../tool/color","../tool/util","../tool/event"],function(e){"use strict";function t(e,t){return e[t]}function n(e,t,n){e[t]=n}function i(e,t,n){return(t-e)*n+e}function a(e,t,n,a,o){var r=e.length;if(1==o)for(var s=0;r>s;s++)a[s]=i(e[s],t[s],n);else for(var l=e[0].length,s=0;r>s;s++)for(var h=0;l>h;h++)a[s][h]=i(e[s][h],t[s][h],n)}function o(e){switch(typeof e){case"undefined":case"string":return!1}return"undefined"!=typeof e.length}function r(e,t,n,i,a,o,r,l,h){var m=e.length;if(1==h)for(var V=0;m>V;V++)l[V]=s(e[V],t[V],n[V],i[V],a,o,r);else for(var U=e[0].length,V=0;m>V;V++)for(var d=0;U>d;d++)l[V][d]=s(e[V][d],t[V][d],n[V][d],i[V][d],a,o,r)}function s(e,t,n,i,a,o,r){var s=.5*(n-e),l=.5*(i-t);return(2*(t-n)+s+l)*r+(-3*(t-n)-2*s-l)*o+s*a+t}function l(e){if(o(e)){var t=e.length;if(o(e[0])){for(var n=[],i=0;t>i;i++)n.push(c.call(e[i]));return n}return c.call(e)}return e}function h(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}var m=e("./Clip"),V=e("../tool/color"),U=e("../tool/util"),d=e("../tool/event").Dispatcher,p=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},c=Array.prototype.slice,u=function(e){e=e||{},this.stage=e.stage||{},this.onframe=e.onframe||function(){},this._clips=[],this._running=!1,this._time=0,d.call(this)};u.prototype={add:function(e){this._clips.push(e)},remove:function(e){var t=U.indexOf(this._clips,e);t>=0&&this._clips.splice(t,1)},_update:function(){for(var e=(new Date).getTime(),t=e-this._time,n=this._clips,i=n.length,a=[],o=[],r=0;i>r;r++){var s=n[r],l=s.step(e);l&&(a.push(l),o.push(s))}this.stage.update&&this.stage.update();for(var r=0;i>r;)n[r]._needsRemove?(n[r]=n[i-1],n.pop(),i--):r++;i=a.length;for(var r=0;i>r;r++)o[r].fire(a[r]);this._time=e,this.onframe(t),this.dispatch("frame",t)},start:function(){function e(){t._running&&(t._update(),p(e))}var t=this;this._running=!0,this._time=(new Date).getTime(),p(e)},stop:function(){this._running=!1},clear:function(){this._clips=[]},animate:function(e,t){t=t||{};var n=new y(e,t.loop,t.getter,t.setter);return n.animation=this,n},constructor:u},U.merge(u.prototype,d.prototype,!0);var y=function(e,i,a,o){this._tracks={},this._target=e,this._loop=i||!1,this._getter=a||t,this._setter=o||n,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};return y.prototype={when:function(e,t){for(var n in t)this._tracks[n]||(this._tracks[n]=[],0!==e&&this._tracks[n].push({time:0,value:l(this._getter(this._target,n))})),this._tracks[n].push({time:parseInt(e,10),value:t[n]});return this},during:function(e){return this._onframeList.push(e),this},start:function(e){var t=this,n=this._setter,l=this._getter,U="spline"===e,d=function(){if(t._clipCount--,0===t._clipCount){t._tracks={};for(var e=t._doneList.length,n=0;e>n;n++)t._doneList[n].call(t)}},p=function(p,c){var u=p.length;if(u){var y=p[0].value,b=o(y),g=!1,k=b&&o(y[0])?2:1;p.sort(function(e,t){return e.time-t.time});var f;if(u){f=p[u-1].time;for(var _=[],x=[],L=0;u>L;L++){_.push(p[L].time/f);var W=p[L].value;"string"==typeof W&&(W=V.toArray(W),0===W.length&&(W[0]=W[1]=W[2]=0,W[3]=1),g=!0),x.push(W)}var X,L,K,w,I,v,J,C=0,S=0;if(g)var E=[0,0,0,0];var T=function(e,o){if(S>o){for(X=Math.min(C+1,u-1),L=X;L>=0&&!(_[L]<=o);L--);L=Math.min(L,u-2)}else{for(L=C;u>L&&!(_[L]>o);L++);L=Math.min(L-1,u-2)}C=L,S=o;var m=_[L+1]-_[L];if(0!==m){if(K=(o-_[L])/m,U)if(I=x[L],w=x[0===L?L:L-1],v=x[L>u-2?u-1:L+1],J=x[L>u-3?u-1:L+2],b)r(w,I,v,J,K,K*K,K*K*K,l(e,c),k);else{var V;g?(V=r(w,I,v,J,K,K*K,K*K*K,E,1),V=h(E)):V=s(w,I,v,J,K,K*K,K*K*K),n(e,c,V)}else if(b)a(x[L],x[L+1],K,l(e,c),k);else{var V;g?(a(x[L],x[L+1],K,E,1),V=h(E)):V=i(x[L],x[L+1],K),n(e,c,V)}for(L=0;L<t._onframeList.length;L++)t._onframeList[L](e,o)}},F=new m({target:t._target,life:f,loop:t._loop,delay:t._delay,onframe:T,ondestroy:d});e&&"spline"!==e&&(F.easing=e),t._clipList.push(F),t._clipCount++,t.animation.add(F)}}};for(var c in this._tracks)p(this._tracks[c],c);return this},stop:function(){for(var e=0;e<this._clipList.length;e++){var t=this._clipList[e];this.animation.remove(t)}this._clipList=[]},delay:function(e){return this._delay=e,this},done:function(e){return e&&this._doneList.push(e),this}},u}),n("zrender/tool/vector",[],function(){var e="undefined"==typeof Float32Array?Array:Float32Array,t={create:function(t,n){var i=new e(2);return i[0]=t||0,i[1]=n||0,i},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,i){return e[0]=t[0]+n[0]*i,e[1]=t[1]+n[1]*i,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},len:function(e){return Math.sqrt(this.lenSquare(e))},lenSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},div:function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var i=t.len(n);return 0===i?(e[0]=0,e[1]=0):(e[0]=n[0]/i,e[1]=n[1]/i),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},distanceSquare:function(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},lerp:function(e,t,n,i){return e[0]=t[0]+i*(n[0]-t[0]),e[1]=t[1]+i*(n[1]-t[1]),e},applyTransform:function(e,t,n){var i=t[0],a=t[1];return e[0]=n[0]*i+n[2]*a+n[4],e[1]=n[1]*i+n[3]*a+n[5],e},min:function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},max:function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}};return t.length=t.len,t.lengthSquare=t.lenSquare,t.dist=t.distance,t.distSquare=t.distanceSquare,t}),n("zrender/tool/matrix",[],function(){var e="undefined"==typeof Float32Array?Array:Float32Array,t={create:function(){var n=new e(6);return t.identity(n),n},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},mul:function(e,t,n){return e[0]=t[0]*n[0]+t[2]*n[1],e[1]=t[1]*n[0]+t[3]*n[1],e[2]=t[0]*n[2]+t[2]*n[3],e[3]=t[1]*n[2]+t[3]*n[3],e[4]=t[0]*n[4]+t[2]*n[5]+t[4],e[5]=t[1]*n[4]+t[3]*n[5]+t[5],e},translate:function(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e},rotate:function(e,t,n){var i=t[0],a=t[2],o=t[4],r=t[1],s=t[3],l=t[5],h=Math.sin(n),m=Math.cos(n);return e[0]=i*m+r*h,e[1]=-i*h+r*m,e[2]=a*m+s*h,e[3]=-a*h+m*s,e[4]=m*o+h*l,e[5]=m*l-h*o,e},scale:function(e,t,n){var i=n[0],a=n[1];return e[0]=t[0]*i,e[1]=t[1]*a,e[2]=t[2]*i,e[3]=t[3]*a,e[4]=t[4]*i,e[5]=t[5]*a,e},invert:function(e,t){var n=t[0],i=t[2],a=t[4],o=t[1],r=t[3],s=t[5],l=n*r-o*i;return l?(l=1/l,e[0]=r*l,e[1]=-o*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-r*a)*l,e[5]=(o*a-n*s)*l,e):null},mulVector:function(e,t,n){var i=t[0],a=t[2],o=t[4],r=t[1],s=t[3],l=t[5];return e[0]=n[0]*i+n[1]*a+o,e[1]=n[0]*r+n[1]*s+l,e}};return t}),n("zrender/loadingEffect/Base",["require","../tool/util","../shape/Text","../shape/Rectangle"],function(e){function t(e){this.setOptions(e)}var n=e("../tool/util"),i=e("../shape/Text"),a=e("../shape/Rectangle"),o="Loading...",r="normal 16px Arial";return t.prototype.createTextShape=function(e){return new i({highlightStyle:n.merge({x:this.canvasWidth/2,y:this.canvasHeight/2,text:o,textAlign:"center",textBaseline:"middle",textFont:r,color:"#333",brushType:"fill"},e,!0)})},t.prototype.createBackgroundShape=function(e){return new a({highlightStyle:{x:0,y:0,width:this.canvasWidth,height:this.canvasHeight,brushType:"fill",color:e}})},t.prototype.start=function(e){function t(t){e.storage.addHover(t)}function n(){e.refreshHover()}this.canvasWidth=e._width,this.canvasHeight=e._height,this.loadingTimer=this._start(t,n)},t.prototype._start=function(){return setInterval(function(){},1e4)},t.prototype.stop=function(){clearInterval(this.loadingTimer)},t.prototype.setOptions=function(e){this.options=e||{}},t.prototype.adjust=function(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e},t.prototype.getLocation=function(e,t,n){var i=null!=e.x?e.x:"center";switch(i){case"center":i=Math.floor((this.canvasWidth-t)/2);break;case"left":i=0;break;case"right":i=this.canvasWidth-t}var a=null!=e.y?e.y:"center";switch(a){case"center":a=Math.floor((this.canvasHeight-n)/2);break;case"top":a=0;break;case"bottom":a=this.canvasHeight-n}return{x:i,y:a,width:t,height:n}},t}),n("zrender/mixin/Transformable",["require","../tool/matrix","../tool/vector"],function(e){"use strict";function t(e){return e>-r&&r>e}function n(e){return e>r||-r>e}var i=e("../tool/matrix"),a=e("../tool/vector"),o=[0,0],r=5e-5,s=function(){this.position||(this.position=[0,0]),"undefined"==typeof this.rotation&&(this.rotation=[0,0,0]),this.scale||(this.scale=[1,1,0,0]),this.needLocalTransform=!1,this.needTransform=!1};return s.prototype={constructor:s,updateNeedTransform:function(){this.needLocalTransform=n(this.rotation[0])||n(this.position[0])||n(this.position[1])||n(this.scale[0]-1)||n(this.scale[1]-1)},updateTransform:function(){if(this.updateNeedTransform(),this.needTransform=this.parent?this.needLocalTransform||this.parent.needTransform:this.needLocalTransform,this.needTransform){var e=this.transform||i.create();if(i.identity(e),this.needLocalTransform){if(n(this.scale[0])||n(this.scale[1])){o[0]=-this.scale[2]||0,o[1]=-this.scale[3]||0;var t=n(o[0])||n(o[1]);t&&i.translate(e,e,o),i.scale(e,e,this.scale),t&&(o[0]=-o[0],o[1]=-o[1],i.translate(e,e,o))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){o[0]=-this.rotation[1]||0,o[1]=-this.rotation[2]||0;var t=n(o[0])||n(o[1]);t&&i.translate(e,e,o),i.rotate(e,e,this.rotation[0]),t&&(o[0]=-o[0],o[1]=-o[1],i.translate(e,e,o))}}else 0!==this.rotation&&i.rotate(e,e,this.rotation);(n(this.position[0])||n(this.position[1]))&&i.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?i.mul(this.transform,this.parent.transform,this.transform):i.copy(this.transform,this.parent.transform))}},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}},lookAt:function(){var e=a.create();return function(n){this.transform||(this.transform=i.create());var o=this.transform;a.sub(e,n,this.position),t(e[0])&&t(e[1])||(a.normalize(e,e),o[2]=e[0]*this.scale[1],o[3]=e[1]*this.scale[1],o[0]=e[1]*this.scale[0],o[1]=-e[0]*this.scale[0],o[4]=this.position[0],o[5]=this.position[1],this.decomposeTransform())}}(),decomposeTransform:function(){if(this.transform){var e=this.transform,t=e[0]*e[0]+e[1]*e[1],i=this.position,a=this.scale,o=this.rotation;n(t-1)&&(t=Math.sqrt(t));var r=e[2]*e[2]+e[3]*e[3];n(r-1)&&(r=Math.sqrt(r)),i[0]=e[4],i[1]=e[5],a[0]=t,a[1]=r,a[2]=a[3]=0,o[0]=Math.atan2(-e[1]/r,e[0]/t),o[1]=o[2]=0}}},s}),n("zrender/shape/Text",["require","../tool/area","./Base","../tool/util"],function(e){var t=e("../tool/area"),n=e("./Base"),i=function(e){n.call(this,e)};return i.prototype={type:"text",brush:function(e,n){var i=this.style;if(n&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),"undefined"!=typeof i.text&&i.text!==!1){e.save(),this.doClip(e),this.setContext(e,i),this.setTransform(e),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var a,o=(i.text+"").split("\n"),r=t.getTextHeight("国",i.textFont),s=this.getRect(i),l=i.x;a="top"==i.textBaseline?s.y:"bottom"==i.textBaseline?s.y+r:s.y+r/2;for(var h=0,m=o.length;m>h;h++){if(i.maxWidth)switch(i.brushType){case"fill":e.fillText(o[h],l,a,i.maxWidth);break;case"stroke":e.strokeText(o[h],l,a,i.maxWidth);break;case"both":e.fillText(o[h],l,a,i.maxWidth),e.strokeText(o[h],l,a,i.maxWidth);break;default:e.fillText(o[h],l,a,i.maxWidth)}else switch(i.brushType){case"fill":e.fillText(o[h],l,a);break;case"stroke":e.strokeText(o[h],l,a);break; |
|
7 | case"both":e.fillText(o[h],l,a),e.strokeText(o[h],l,a);break;default:e.fillText(o[h],l,a)}a+=r}e.restore()}},getRect:function(e){if(e.__rect)return e.__rect;var n=t.getTextWidth(e.text,e.textFont),i=t.getTextHeight(e.text,e.textFont),a=e.x;"end"==e.textAlign||"right"==e.textAlign?a-=n:"center"==e.textAlign&&(a-=n/2);var o;return o="top"==e.textBaseline?e.y:"bottom"==e.textBaseline?e.y-i:e.y-i/2,e.__rect={x:a,y:o,width:n,height:i},e.__rect}},e("../tool/util").inherits(i,n),i}),n("zrender/shape/Rectangle",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"rectangle",_buildRadiusPath:function(e,t){var n,i,a,o,r=t.x,s=t.y,l=t.width,h=t.height,m=t.radius;"number"==typeof m?n=i=a=o=m:m instanceof Array?1===m.length?n=i=a=o=m[0]:2===m.length?(n=a=m[0],i=o=m[1]):3===m.length?(n=m[0],i=o=m[1],a=m[2]):(n=m[0],i=m[1],a=m[2],o=m[3]):n=i=a=o=0;var V;n+i>l&&(V=n+i,n*=l/V,i*=l/V),a+o>l&&(V=a+o,a*=l/V,o*=l/V),i+a>h&&(V=i+a,i*=h/V,a*=h/V),n+o>h&&(V=n+o,n*=h/V,o*=h/V),e.moveTo(r+n,s),e.lineTo(r+l-i,s),0!==i&&e.quadraticCurveTo(r+l,s,r+l,s+i),e.lineTo(r+l,s+h-a),0!==a&&e.quadraticCurveTo(r+l,s+h,r+l-a,s+h),e.lineTo(r+o,s+h),0!==o&&e.quadraticCurveTo(r,s+h,r,s+h-o),e.lineTo(r,s+n),0!==n&&e.quadraticCurveTo(r,s,r+n,s)},buildPath:function(e,t){t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y)),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-t/2),y:Math.round(e.y-t/2),width:e.width+t,height:e.height+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("zrender/tool/area",["require","./util","./curve"],function(e){"use strict";function t(e){return e%=C,0>e&&(e+=C),e}function n(e,t,n,o){if(!t||!e)return!1;var r=e.type;L=L||W.getContext();var s=i(e,t,n,o);if("undefined"!=typeof s)return s;if(e.buildPath&&L.isPointInPath)return a(e,L,t,n,o);switch(r){case"ellipse":return!0;case"trochoid":var l="out"==t.location?t.r1+t.r2+t.d:t.r1-t.r2+t.d;return d(t,n,o,l);case"rose":return d(t,n,o,t.maxr);default:return!1}}function i(e,t,n,i){var a=e.type;switch(a){case"bezier-curve":return"undefined"==typeof t.cpX2?l(t.xStart,t.yStart,t.cpX1,t.cpY1,t.xEnd,t.yEnd,t.lineWidth,n,i):s(t.xStart,t.yStart,t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd,t.lineWidth,n,i);case"line":return r(t.xStart,t.yStart,t.xEnd,t.yEnd,t.lineWidth,n,i);case"broken-line":return m(t.pointList,t.lineWidth,n,i);case"ring":return V(t.x,t.y,t.r0,t.r,n,i);case"circle":return d(t.x,t.y,t.r,n,i);case"sector":var o=t.startAngle*Math.PI/180,h=t.endAngle*Math.PI/180;return t.clockWise||(o=-o,h=-h),p(t.x,t.y,t.r0,t.r,o,h,!t.clockWise,n,i);case"path":return f(t.pathArray,Math.max(t.lineWidth,5),t.brushType,n,i);case"polygon":case"star":case"isogon":return c(t.pointList,n,i);case"text":var u=t.__rect||e.getRect(t);return U(u.x,u.y,u.width,u.height,n,i);case"rectangle":case"image":return U(t.x,t.y,t.width,t.height,n,i)}}function a(e,t,n,i,a){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(i,a)}function o(e,t,i,a){return!n(e,t,i,a)}function r(e,t,n,i,a,o,r){if(0===a)return!1;var s=Math.max(a,5),l=0,h=e;if(r>t+s&&r>i+s||t-s>r&&i-s>r||o>e+s&&o>n+s||e-s>o&&n-s>o)return!1;if(e===n)return Math.abs(o-e)<=s/2;l=(t-i)/(e-n),h=(e*i-n*t)/(e-n);var m=l*o-r+h,V=m*m/(l*l+1);return s/2*s/2>=V}function s(e,t,n,i,a,o,r,s,l,h,m){if(0===l)return!1;var V=Math.max(l,5);if(m>t+V&&m>i+V&&m>o+V&&m>s+V||t-V>m&&i-V>m&&o-V>m&&s-V>m||h>e+V&&h>n+V&&h>a+V&&h>r+V||e-V>h&&n-V>h&&a-V>h&&r-V>h)return!1;var U=X.cubicProjectPoint(e,t,n,i,a,o,r,s,h,m,null);return V/2>=U}function l(e,t,n,i,a,o,r,s,l){if(0===r)return!1;var h=Math.max(r,5);if(l>t+h&&l>i+h&&l>o+h||t-h>l&&i-h>l&&o-h>l||s>e+h&&s>n+h&&s>a+h||e-h>s&&n-h>s&&a-h>s)return!1;var m=X.quadraticProjectPoint(e,t,n,i,a,o,s,l,null);return h/2>=m}function h(e,n,i,a,o,r,s,l,h){if(0===s)return!1;var m=Math.max(s,5);l-=e,h-=n;var V=Math.sqrt(l*l+h*h);if(V-m>i||i>V+m)return!1;if(Math.abs(a-o)>=C)return!0;if(r){var U=a;a=t(o),o=t(U)}else a=t(a),o=t(o);a>o&&(o+=C);var d=Math.atan2(h,l);return 0>d&&(d+=C),d>=a&&o>=d||d+C>=a&&o>=d+C}function m(e,t,n,i){for(var t=Math.max(t,10),a=0,o=e.length-1;o>a;a++){var s=e[a][0],l=e[a][1],h=e[a+1][0],m=e[a+1][1];if(r(s,l,h,m,t,n,i))return!0}return!1}function V(e,t,n,i,a,o){var r=(a-e)*(a-e)+(o-t)*(o-t);return i*i>r&&r>n*n}function U(e,t,n,i,a,o){return a>=e&&e+n>=a&&o>=t&&t+i>=o}function d(e,t,n,i,a){return n*n>(i-e)*(i-e)+(a-t)*(a-t)}function p(e,t,n,i,a,o,r,s,l){return h(e,t,(n+i)/2,a,o,r,i-n,s,l)}function c(e,t,n){for(var i=e.length,a=0,o=0,r=i-1;i>o;o++){var s=e[r][0],l=e[r][1],h=e[o][0],m=e[o][1];a+=u(s,l,h,m,t,n),r=o}return 0!==a}function u(e,t,n,i,a,o){if(o>t&&o>i||t>o&&i>o)return 0;if(i==t)return 0;var r=t>i?1:-1,s=(o-t)/(i-t),l=s*(n-e)+e;return l>a?r:0}function y(){var e=E[0];E[0]=E[1],E[1]=e}function b(e,t,n,i,a,o,r,s,l,h){if(h>t&&h>i&&h>o&&h>s||t>h&&i>h&&o>h&&s>h)return 0;var m=X.cubicRootAt(t,i,o,s,h,S);if(0===m)return 0;for(var V,U,d=0,p=-1,c=0;m>c;c++){var u=S[c],b=X.cubicAt(e,n,a,r,u);l>b||(0>p&&(p=X.cubicExtrema(t,i,o,s,E),E[1]<E[0]&&p>1&&y(),V=X.cubicAt(t,i,o,s,E[0]),p>1&&(U=X.cubicAt(t,i,o,s,E[1]))),d+=2==p?u<E[0]?t>V?1:-1:u<E[1]?V>U?1:-1:U>s?1:-1:u<E[0]?t>V?1:-1:V>s?1:-1)}return d}function g(e,t,n,i,a,o,r,s){if(s>t&&s>i&&s>o||t>s&&i>s&&o>s)return 0;var l=X.quadraticRootAt(t,i,o,s,S);if(0===l)return 0;var h=X.quadraticExtremum(t,i,o);if(h>=0&&1>=h){for(var m=0,V=X.quadraticAt(t,i,o,h),U=0;l>U;U++){var d=X.quadraticAt(e,n,a,S[U]);d>r||(m+=S[U]<h?t>V?1:-1:V>o?1:-1)}return m}var d=X.quadraticAt(e,n,a,S[0]);return d>r?0:t>o?1:-1}function k(e,n,i,a,o,r,s,l){if(l-=n,l>i||-i>l)return 0;var h=Math.sqrt(i*i-l*l);if(S[0]=-h,S[1]=h,Math.abs(a-o)>=C){a=0,o=C;var m=r?1:-1;return s>=S[0]+e&&s<=S[1]+e?m:0}if(r){var h=a;a=t(o),o=t(h)}else a=t(a),o=t(o);a>o&&(o+=C);for(var V=0,U=0;2>U;U++){var d=S[U];if(d+e>s){var p=Math.atan2(l,d),m=r?1:-1;0>p&&(p=C+p),(p>=a&&o>=p||p+C>=a&&o>=p+C)&&(p>Math.PI/2&&p<1.5*Math.PI&&(m=-m),V+=m)}}return V}function f(e,t,n,i,a){var o=0,m=0,V=0,U=0,d=0,p=!0,c=!0;n=n||"fill";for(var y="stroke"===n||"both"===n,f="fill"===n||"both"===n,_=0;_<e.length;_++){var x=e[_],L=x.points;if(p||"M"===x.command){if(_>0&&(f&&(o+=u(m,V,U,d,i,a)),0!==o))return!0;U=L[L.length-2],d=L[L.length-1],p=!1,c&&"A"!==x.command&&(c=!1,m=U,V=d)}switch(x.command){case"M":m=L[0],V=L[1];break;case"L":if(y&&r(m,V,L[0],L[1],t,i,a))return!0;f&&(o+=u(m,V,L[0],L[1],i,a)),m=L[0],V=L[1];break;case"C":if(y&&s(m,V,L[0],L[1],L[2],L[3],L[4],L[5],t,i,a))return!0;f&&(o+=b(m,V,L[0],L[1],L[2],L[3],L[4],L[5],i,a)),m=L[4],V=L[5];break;case"Q":if(y&&l(m,V,L[0],L[1],L[2],L[3],t,i,a))return!0;f&&(o+=g(m,V,L[0],L[1],L[2],L[3],i,a)),m=L[2],V=L[3];break;case"A":var W=L[0],X=L[1],K=L[2],w=L[3],I=L[4],v=L[5],J=Math.cos(I)*K+W,C=Math.sin(I)*w+X;c?(c=!1,U=J,d=C):o+=u(m,V,J,C);var S=(i-W)*w/K+W;if(y&&h(W,X,w,I,I+v,1-L[7],t,S,a))return!0;f&&(o+=k(W,X,w,I,I+v,1-L[7],S,a)),m=Math.cos(I+v)*K+W,V=Math.sin(I+v)*w+X;break;case"z":if(y&&r(m,V,U,d,t,i,a))return!0;p=!0}}return f&&(o+=u(m,V,U,d,i,a)),0!==o}function _(e,t){var n=e+":"+t;if(K[n])return K[n];L=L||W.getContext(),L.save(),t&&(L.font=t),e=(e+"").split("\n");for(var i=0,a=0,o=e.length;o>a;a++)i=Math.max(L.measureText(e[a]).width,i);return L.restore(),K[n]=i,++I>J&&(I=0,K={}),i}function x(e,t){var n=e+":"+t;if(w[n])return w[n];L=L||W.getContext(),L.save(),t&&(L.font=t),e=(e+"").split("\n");var i=(L.measureText("国").width+2)*e.length;return L.restore(),w[n]=i,++v>J&&(v=0,w={}),i}var L,W=e("./util"),X=e("./curve"),K={},w={},I=0,v=0,J=5e3,C=2*Math.PI,S=[-1,-1,-1],E=[-1,-1];return{isInside:n,isOutside:o,getTextWidth:_,getTextHeight:x,isInsidePath:f,isInsidePolygon:c,isInsideSector:p,isInsideCircle:d,isInsideLine:r,isInsideRect:U,isInsideBrokenLine:m,isInsideCubicStroke:s,isInsideQuadraticStroke:l}}),n("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","../tool/log","../mixin/Transformable","../mixin/Eventful","../tool/area","../tool/color"],function(e){function t(t,i,a,o,r,s,l){r&&(t.font=r),t.textAlign=s,t.textBaseline=l;var h=n(i,a,o,r,s,l);i=(i+"").split("\n");var m=e("../tool/area").getTextHeight("国",r);switch(l){case"top":o=h.y;break;case"bottom":o=h.y+m;break;default:o=h.y+m/2}for(var V=0,U=i.length;U>V;V++)t.fillText(i[V],a,o),o+=m}function n(t,n,i,a,o,r){var s=e("../tool/area"),l=s.getTextWidth(t,a),h=s.getTextHeight("国",a);switch(t=(t+"").split("\n"),o){case"end":case"right":n-=l;break;case"center":n-=l/2}switch(r){case"top":break;case"bottom":i-=h*t.length;break;default:i-=h*t.length/2}return{x:n,y:i,width:l,height:h*t.length}}var i=window.G_vmlCanvasManager,a=e("../tool/matrix"),o=e("../tool/guid"),r=e("../tool/util"),s=e("../tool/log"),l=e("../mixin/Transformable"),h=e("../mixin/Eventful"),m=function(e){e=e||{},this.id=e.id||o();for(var t in e)this[t]=e[t];this.style=this.style||{},this.highlightStyle=this.highlightStyle||null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],l.call(this),h.call(this)};m.prototype.invisible=!1,m.prototype.ignore=!1,m.prototype.zlevel=0,m.prototype.draggable=!1,m.prototype.clickable=!1,m.prototype.hoverable=!0,m.prototype.z=0,m.prototype.brush=function(e,t){var n=this.beforeBrush(e,t);switch(e.beginPath(),this.buildPath(e,n),n.brushType){case"both":e.fill();case"stroke":n.lineWidth>0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),this.afterBrush(e)},m.prototype.beforeBrush=function(e,t){var n=this.style;return this.brushTypeOnly&&(n.brushType=this.brushTypeOnly),t&&(n=this.getHighlightStyle(n,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(n.strokeColor=n.strokeColor||n.color),e.save(),this.doClip(e),this.setContext(e,n),this.setTransform(e),n},m.prototype.afterBrush=function(e){e.restore()};var V=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];m.prototype.setContext=function(e,t){for(var n=0,i=V.length;i>n;n++){var a=V[n][0],o=t[a],r=V[n][1];"undefined"!=typeof o&&(e[r]=o)}};var U=a.create();return m.prototype.doClip=function(e){if(this.__clipShapes&&!i)for(var t=0;t<this.__clipShapes.length;t++){var n=this.__clipShapes[t];if(n.needTransform){var o=n.transform;a.invert(U,o),e.transform(o[0],o[1],o[2],o[3],o[4],o[5])}if(e.beginPath(),n.buildPath(e,n.style),e.clip(),n.needTransform){var o=U;e.transform(o[0],o[1],o[2],o[3],o[4],o[5])}}},m.prototype.getHighlightStyle=function(t,n,i){var a={};for(var o in t)a[o]=t[o];var r=e("../tool/color"),s=r.getHighlightColor();"stroke"!=t.brushType?(a.strokeColor=s,a.lineWidth=(t.lineWidth||1)+this.getHighlightZoom(),a.brushType="both"):"stroke"!=i?(a.strokeColor=s,a.lineWidth=(t.lineWidth||1)+this.getHighlightZoom()):a.strokeColor=n.strokeColor||r.mix(t.strokeColor,r.toRGB(s));for(var o in n)"undefined"!=typeof n[o]&&(a[o]=n[o]);return a},m.prototype.getHighlightZoom=function(){return"text"!=this.type?6:2},m.prototype.drift=function(e,t){this.position[0]+=e,this.position[1]+=t},m.prototype.getTansform=function(){var e=[];return function(t,n){var i=[t,n];return this.needTransform&&this.transform&&(a.invert(e,this.transform),a.mulVector(i,e,[t,n,1]),t==i[0]&&n==i[1]&&this.updateNeedTransform()),i}}(),m.prototype.buildPath=function(){s("buildPath not implemented in "+this.type)},m.prototype.getRect=function(){s("getRect not implemented in "+this.type)},m.prototype.isCover=function(t,n){var i=this.getTansform(t,n);t=i[0],n=i[1];var a=this.style.__rect;return a||(a=this.style.__rect=this.getRect(this.style)),t>=a.x&&t<=a.x+a.width&&n>=a.y&&n<=a.y+a.height?e("../tool/area").isInside(this,this.style,t,n):!1},m.prototype.drawText=function(e,n,i){if("undefined"!=typeof n.text&&n.text!==!1){var a=n.textColor||n.color||n.strokeColor;e.fillStyle=a;var o,r,s,l,h=10,m=n.textPosition||this.textPosition||"top";switch(m){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var V=(i||n).__rect||this.getRect(i||n);switch(m){case"inside":s=V.x+V.width/2,l=V.y+V.height/2,o="center",r="middle","stroke"!=n.brushType&&a==n.color&&(e.fillStyle="#fff");break;case"left":s=V.x-h,l=V.y+V.height/2,o="end",r="middle";break;case"right":s=V.x+V.width+h,l=V.y+V.height/2,o="start",r="middle";break;case"top":s=V.x+V.width/2,l=V.y-h,o="center",r="bottom";break;case"bottom":s=V.x+V.width/2,l=V.y+V.height+h,o="center",r="top"}}break;case"start":case"end":var U,d,p,c;if("undefined"!=typeof n.pointList){var u=n.pointList;if(u.length<2)return;var y=u.length;switch(m){case"start":U=u[0][0],d=u[1][0],p=u[0][1],c=u[1][1];break;case"end":U=u[y-2][0],d=u[y-1][0],p=u[y-2][1],c=u[y-1][1]}}else U=n.xStart||0,d=n.xEnd||0,p=n.yStart||0,c=n.yEnd||0;switch(m){case"start":o=d>U?"end":"start",r=c>p?"bottom":"top",s=U,l=p;break;case"end":o=d>U?"start":"end",r=c>p?"top":"bottom",s=d,l=c}h-=4,U!=d?s-="end"==o?h:-h:o="center",p!=c?l-="bottom"==r?h:-h:r="middle";break;case"specific":s=n.textX||0,l=n.textY||0,o="start",r="middle"}null!=s&&null!=l&&t(e,n.text,s,l,n.textFont,n.textAlign||o,n.textBaseline||r)}},m.prototype.modSelf=function(){this.__dirty=!0,this.style&&(this.style.__rect=null),this.highlightStyle&&(this.highlightStyle.__rect=null)},m.prototype.isSilent=function(){return!(this.hoverable||this.draggable||this.clickable||this.onmousemove||this.onmouseover||this.onmouseout||this.onmousedown||this.onmouseup||this.onclick||this.ondragenter||this.ondragover||this.ondragleave||this.ondrop)},r.merge(m.prototype,l.prototype,!0),r.merge(m.prototype,h.prototype,!0),m}),n("zrender/tool/curve",["require","./vector"],function(e){function t(e){return e>-c&&c>e}function n(e){return e>c||-c>e}function i(e,t,n,i,a){var o=1-a;return o*o*(o*e+3*a*t)+a*a*(a*i+3*o*n)}function a(e,t,n,i,a){var o=1-a;return 3*(((t-e)*o+2*(n-t)*a)*o+(i-n)*a*a)}function o(e,n,i,a,o,r){var s=a+3*(n-i)-e,l=3*(i-2*n+e),h=3*(n-e),m=e-o,V=l*l-3*s*h,U=l*h-9*s*m,d=h*h-3*l*m,p=0;if(t(V)&&t(U))if(t(l))r[0]=0;else{var c=-h/l;c>=0&&1>=c&&(r[p++]=c)}else{var b=U*U-4*V*d;if(t(b)){var g=U/V,c=-l/s+g,k=-g/2;c>=0&&1>=c&&(r[p++]=c),k>=0&&1>=k&&(r[p++]=k)}else if(b>0){var f=Math.sqrt(b),_=V*l+1.5*s*(-U+f),x=V*l+1.5*s*(-U-f);_=0>_?-Math.pow(-_,y):Math.pow(_,y),x=0>x?-Math.pow(-x,y):Math.pow(x,y);var c=(-l-(_+x))/(3*s);c>=0&&1>=c&&(r[p++]=c)}else{var L=(2*V*l-3*s*U)/(2*Math.sqrt(V*V*V)),W=Math.acos(L)/3,X=Math.sqrt(V),K=Math.cos(W),c=(-l-2*X*K)/(3*s),k=(-l+X*(K+u*Math.sin(W)))/(3*s),w=(-l+X*(K-u*Math.sin(W)))/(3*s);c>=0&&1>=c&&(r[p++]=c),k>=0&&1>=k&&(r[p++]=k),w>=0&&1>=w&&(r[p++]=w)}}return p}function r(e,i,a,o,r){var s=6*a-12*i+6*e,l=9*i+3*o-3*e-9*a,h=3*i-3*e,m=0;if(t(l)){if(n(s)){var V=-h/s;V>=0&&1>=V&&(r[m++]=V)}}else{var U=s*s-4*l*h;if(t(U))r[0]=-s/(2*l);else if(U>0){var d=Math.sqrt(U),V=(-s+d)/(2*l),p=(-s-d)/(2*l);V>=0&&1>=V&&(r[m++]=V),p>=0&&1>=p&&(r[m++]=p)}}return m}function s(e,t,n,i,a,o){var r=(t-e)*a+e,s=(n-t)*a+t,l=(i-n)*a+n,h=(s-r)*a+r,m=(l-s)*a+s,V=(m-h)*a+h;o[0]=e,o[1]=r,o[2]=h,o[3]=V,o[4]=V,o[5]=m,o[6]=l,o[7]=i}function l(e,t,n,a,o,r,s,l,h,m,V){var U,d=.005,u=1/0;b[0]=h,b[1]=m;for(var y=0;1>y;y+=.05){g[0]=i(e,n,o,s,y),g[1]=i(t,a,r,l,y);var f=p.distSquare(b,g);u>f&&(U=y,u=f)}u=1/0;for(var _=0;32>_&&!(c>d);_++){var x=U-d,L=U+d;g[0]=i(e,n,o,s,x),g[1]=i(t,a,r,l,x);var f=p.distSquare(g,b);if(x>=0&&u>f)U=x,u=f;else{k[0]=i(e,n,o,s,L),k[1]=i(t,a,r,l,L);var W=p.distSquare(k,b);1>=L&&u>W?(U=L,u=W):d*=.5}}return V&&(V[0]=i(e,n,o,s,U),V[1]=i(t,a,r,l,U)),Math.sqrt(u)}function h(e,t,n,i){var a=1-i;return a*(a*e+2*i*t)+i*i*n}function m(e,t,n,i){return 2*((1-i)*(t-e)+i*(n-t))}function V(e,i,a,o,r){var s=e-2*i+a,l=2*(i-e),h=e-o,m=0;if(t(s)){if(n(l)){var V=-h/l;V>=0&&1>=V&&(r[m++]=V)}}else{var U=l*l-4*s*h;if(t(U)){var V=-l/(2*s);V>=0&&1>=V&&(r[m++]=V)}else if(U>0){var d=Math.sqrt(U),V=(-l+d)/(2*s),p=(-l-d)/(2*s);V>=0&&1>=V&&(r[m++]=V),p>=0&&1>=p&&(r[m++]=p)}}return m}function U(e,t,n){var i=e+n-2*t;return 0===i?.5:(e-t)/i}function d(e,t,n,i,a,o,r,s,l){var m,V=.005,U=1/0;b[0]=r,b[1]=s;for(var d=0;1>d;d+=.05){g[0]=h(e,n,a,d),g[1]=h(t,i,o,d);var u=p.distSquare(b,g);U>u&&(m=d,U=u)}U=1/0;for(var y=0;32>y&&!(c>V);y++){var f=m-V,_=m+V;g[0]=h(e,n,a,f),g[1]=h(t,i,o,f);var u=p.distSquare(g,b);if(f>=0&&U>u)m=f,U=u;else{k[0]=h(e,n,a,_),k[1]=h(t,i,o,_);var x=p.distSquare(k,b);1>=_&&U>x?(m=_,U=x):V*=.5}}return l&&(l[0]=h(e,n,a,m),l[1]=h(t,i,o,m)),Math.sqrt(U)}var p=e("./vector"),c=1e-4,u=Math.sqrt(3),y=1/3,b=p.create(),g=p.create(),k=p.create();return{cubicAt:i,cubicDerivativeAt:a,cubicRootAt:o,cubicExtrema:r,cubicSubdivide:s,cubicProjectPoint:l,quadraticAt:h,quadraticDerivativeAt:m,quadraticRootAt:V,quadraticExtremum:U,quadraticProjectPoint:d}}),n("zrender/Group",["require","./tool/guid","./tool/util","./mixin/Transformable","./mixin/Eventful"],function(e){var t=e("./tool/guid"),n=e("./tool/util"),i=e("./mixin/Transformable"),a=e("./mixin/Eventful"),o=function(e){e=e||{},this.id=e.id||t();for(var n in e)this[n]=e[n];this.type="group",this.clipShape=null,this._children=[],this._storage=null,this.__dirty=!0,i.call(this),a.call(this)};return o.prototype.ignore=!1,o.prototype.children=function(){return this._children.slice()},o.prototype.childAt=function(e){return this._children[e]},o.prototype.addChild=function(e){e!=this&&e.parent!=this&&(e.parent&&e.parent.removeChild(e),this._children.push(e),e.parent=this,this._storage&&this._storage!==e._storage&&(this._storage.addToMap(e),e instanceof o&&e.addChildrenToStorage(this._storage)))},o.prototype.removeChild=function(e){var t=n.indexOf(this._children,e);this._children.splice(t,1),e.parent=null,this._storage&&(this._storage.delFromMap(e.id),e instanceof o&&e.delChildrenFromStorage(this._storage))},o.prototype.eachChild=function(e,t){for(var n=!!t,i=0;i<this._children.length;i++){var a=this._children[i];n?e.call(t,a):e(a)}},o.prototype.traverse=function(e,t){for(var n=!!t,i=0;i<this._children.length;i++){var a=this._children[i];n?e.call(t,a):e(a),"group"===a.type&&a.traverse(e,t)}},o.prototype.addChildrenToStorage=function(e){for(var t=0;t<this._children.length;t++){var n=this._children[t];e.addToMap(n),"group"===n.type&&n.addChildrenToStorage(e)}},o.prototype.delChildrenFromStorage=function(e){for(var t=0;t<this._children.length;t++){var n=this._children[t];e.delFromMap(n.id),"group"===n.type&&n.delChildrenFromStorage(e)}},o.prototype.modSelf=function(){this.__dirty=!0},n.merge(o.prototype,i.prototype,!0),n.merge(o.prototype,a.prototype,!0),o}),n("zrender/animation/Clip",["require","./easing"],function(e){function t(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+1e3*this._life,this.loop="undefined"==typeof e.loop?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}var n=e("./easing");return t.prototype={step:function(e){var t=(e-this._startTime)/this._life;if(!(0>t)){t=Math.min(t,1);var i="string"==typeof this.easing?n[this.easing]:this.easing,a="function"==typeof i?i(t):t;return this.fire("frame",a),1==t?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null}},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap,this._needsRemove=!1},fire:function(e,t){for(var n=0,i=this._targetPool.length;i>n;n++)this["on"+e]&&this["on"+e](this._targetPool[n],t)},constructor:t},t}),n("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||1>n?(n=1,t=i/4):t=i*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/i)))},ElasticOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||1>n?(n=1,t=i/4):t=i*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin(2*(e-t)*Math.PI/i)+1)},ElasticInOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||1>n?(n=1,t=i/4):t=i*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*n*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/i):n*Math.pow(2,-10*(e-=1))*Math.sin(2*(e-t)*Math.PI/i)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return.5>t?.5*e.BounceIn(2*t):.5*e.BounceOut(2*t-1)+.5}};return e}),n("echarts/component/base",["require","../config","../util/ecData","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function t(e,t,a,o,r){this.ecTheme=e,this.messageCenter=t,this.zr=a,this.option=o,this.series=o.series,this.myChart=r,this.component=r.component,this._zlevelBase=this.getZlevelBase(),this.shapeList=[],this.effectList=[];var s=this;s._onlegendhoverlink=function(e){if(s.legendHoverLink)for(var t,a=e.target,o=s.shapeList.length-1;o>=0;o--)t=s.type==n.CHART_TYPE_PIE||s.type==n.CHART_TYPE_FUNNEL?i.get(s.shapeList[o],"name"):(i.get(s.shapeList[o],"series")||{}).name,t!=a||s.shapeList[o].invisible||s.zr.addHoverShape(s.shapeList[o])},t&&t.bind(n.EVENT.LEGEND_HOVERLINK,this._onlegendhoverlink)}var n=e("../config"),i=e("../util/ecData"),a=e("../util/ecQuery"),o=e("../util/number"),r=e("zrender/tool/util");return t.prototype={canvasSupported:e("zrender/tool/env").canvasSupported,getZlevelBase:function(e){switch(e=e||this.type+""){case n.COMPONENT_TYPE_GRID:case n.COMPONENT_TYPE_AXIS_CATEGORY:case n.COMPONENT_TYPE_AXIS_VALUE:case n.COMPONENT_TYPE_POLAR:return 0;case n.CHART_TYPE_LINE:case n.CHART_TYPE_BAR:case n.CHART_TYPE_SCATTER:case n.CHART_TYPE_PIE:case n.CHART_TYPE_RADAR:case n.CHART_TYPE_MAP:case n.CHART_TYPE_K:case n.CHART_TYPE_CHORD:case n.CHART_TYPE_GUAGE:case n.CHART_TYPE_FUNNEL:case n.CHART_TYPE_EVENTRIVER:return 2;case n.COMPONENT_TYPE_LEGEND:case n.COMPONENT_TYPE_DATARANGE:case n.COMPONENT_TYPE_DATAZOOM:case n.COMPONENT_TYPE_TIMELINE:case n.COMPONENT_TYPE_ROAMCONTROLLER:return 4;case n.CHART_TYPE_ISLAND:return 5;case n.COMPONENT_TYPE_TOOLBOX:case n.COMPONENT_TYPE_TITLE:return 6;case n.COMPONENT_TYPE_TOOLTIP:return 8;default:return 0}},reformOption:function(e){return r.merge(e||{},r.clone(this.ecTheme[this.type]||{}))},reformCssArray:function(e){if(!(e instanceof Array))return[e,e,e,e];switch(e.length+""){case"4":return e;case"3":return[e[0],e[1],e[2],e[1]];case"2":return[e[0],e[1],e[0],e[1]];case"1":return[e[0],e[0],e[0],e[0]];case"0":return[0,0,0,0]}},getShapeById:function(e){for(var t=0,n=this.shapeList.length;n>t;t++)if(this.shapeList[t].id===e)return this.shapeList[t];return null},getFont:function(e){var t=r.merge(r.clone(e)||{},this.ecTheme.textStyle);return t.fontStyle+" "+t.fontWeight+" "+t.fontSize+"px "+t.fontFamily},getItemStyleColor:function(e,t,n,i){return"function"==typeof e?e.call(this.myChart,{seriesIndex:t,series:this.series[t],dataIndex:n,data:i}):e},subPixelOptimize:function(e,t){return e=t%2===1?Math.floor(e)+.5:Math.round(e)},resize:function(){this.refresh&&this.refresh(),this.clearEffectShape&&this.clearEffectShape(!0);var e=this;setTimeout(function(){e.animationEffect&&e.animationEffect()},200)},clear:function(){this.clearEffectShape&&this.clearEffectShape(),this.zr&&this.zr.delShape(this.shapeList),this.shapeList=[]},dispose:function(){this.onbeforDispose&&this.onbeforDispose(),this.clear(),this.shapeList=null,this.effectList=null,this.messageCenter&&this.messageCenter.unbind(n.EVENT.LEGEND_HOVERLINK,this._onlegendhoverlink),this.onafterDispose&&this.onafterDispose()},query:a.query,deepQuery:a.deepQuery,deepMerge:a.deepMerge,parsePercent:o.parsePercent,parseCenter:o.parseCenter,parseRadius:o.parseRadius,numAddCommas:o.addCommas},t}),n("echarts/chart/base",["require","zrender/shape/Image","../util/shape/Icon","../util/shape/MarkLine","../util/shape/Symbol","../config","../util/ecData","../util/ecAnimation","../util/ecEffect","../util/accMath","zrender/tool/util","zrender/tool/area"],function(e){function t(){var e=this;this.selectedMap={},this.lastShapeList=[],this.shapeHandler={onclick:function(){e.isClick=!0},ondragover:function(t){var n=t.target;n.highlightStyle=n.highlightStyle||{};var i=n.highlightStyle,a=i.brushTyep,o=i.strokeColor,r=i.lineWidth;i.brushType="stroke",i.strokeColor=e.ecTheme.calculableColor,i.lineWidth="icon"===n.type?30:10,e.zr.addHoverShape(n),setTimeout(function(){n.highlightStyle&&(n.highlightStyle.brushType=a,n.highlightStyle.strokeColor=o,n.highlightStyle.lineWidth=r)},20)},ondrop:function(t){null!=s.get(t.dragged,"data")&&(e.isDrop=!0)},ondragend:function(){e.isDragend=!0}}}var n=e("zrender/shape/Image"),i=e("../util/shape/Icon"),a=e("../util/shape/MarkLine"),o=e("../util/shape/Symbol"),r=e("../config"),s=e("../util/ecData"),l=e("../util/ecAnimation"),h=e("../util/ecEffect"),m=e("../util/accMath"),V=e("zrender/tool/util"),U=e("zrender/tool/area");return t.prototype={setCalculable:function(e){return e.dragEnableTime=this.ecTheme.DRAG_ENABLE_TIME,e.ondragover=this.shapeHandler.ondragover,e.ondragend=this.shapeHandler.ondragend,e.ondrop=this.shapeHandler.ondrop,e},ondrop:function(e,t){if(this.isDrop&&e.target&&!t.dragIn){var n,i=e.target,a=e.dragged,o=s.get(i,"seriesIndex"),l=s.get(i,"dataIndex"),h=this.series,V=this.component.legend;if(-1===l){if(s.get(a,"seriesIndex")==o)return t.dragOut=t.dragIn=t.needRefresh=!0,void(this.isDrop=!1);n={value:s.get(a,"value"),name:s.get(a,"name")},this.type===r.CHART_TYPE_PIE&&n.value<0&&(n.value=0);for(var U=!1,d=h[o].data,p=0,c=d.length;c>p;p++)d[p].name===n.name&&"-"===d[p].value&&(h[o].data[p].value=n.value,U=!0);!U&&h[o].data.push(n),V&&V.add(n.name,a.style.color||a.style.strokeColor)}else n=this.option.series[o].data[l]||"-",null!=n.value?(this.option.series[o].data[l].value="-"!=n.value?m.accAdd(this.option.series[o].data[l].value,s.get(a,"value")):s.get(a,"value"),(this.type===r.CHART_TYPE_FUNNEL||this.type===r.CHART_TYPE_PIE)&&(V&&1===V.getRelatedAmount(n.name)&&this.component.legend.del(n.name),n.name+=this.option.nameConnector+s.get(a,"name"),V&&V.add(n.name,a.style.color||a.style.strokeColor))):this.option.series[o].data[l]="-"!=n?m.accAdd(this.option.series[o].data[l],s.get(a,"value")):s.get(a,"value");t.dragIn=t.dragIn||!0,this.isDrop=!1;var u=this;setTimeout(function(){u.zr.trigger("mousemove",e.event)},300)}},ondragend:function(e,t){if(this.isDragend&&e.target&&!t.dragOut){var n=e.target,i=s.get(n,"seriesIndex"),a=s.get(n,"dataIndex"),o=this.series;if(null!=o[i].data[a].value){o[i].data[a].value="-";var r=o[i].data[a].name;this.component.legend&&0===this.component.legend.getRelatedAmount(r)&&this.component.legend.del(r)}else o[i].data[a]="-";t.dragOut=!0,t.needRefresh=!0,this.isDragend=!1}},onlegendSelected:function(e,t){var n=e.selected;for(var i in this.selectedMap)this.selectedMap[i]!=n[i]&&(t.needRefresh=!0),this.selectedMap[i]=n[i]},_bulidPosition:function(){this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this._sIndex2ColorMap={},this.selectedMap={},this.xMarkMap={};for(var e,t,n,i,a=this.series,o={top:[],bottom:[],left:[],right:[],other:[]},s=0,l=a.length;l>s;s++)a[s].type===this.type&&(a[s]=this.reformOption(a[s]),this.legendHoverLink=a[s].legendHoverLink||this.legendHoverLink,e=a[s].xAxisIndex,t=a[s].yAxisIndex,n=this.component.xAxis.getAxis(e),i=this.component.yAxis.getAxis(t),n.type===r.COMPONENT_TYPE_AXIS_CATEGORY?o[n.getPosition()].push(s):i.type===r.COMPONENT_TYPE_AXIS_CATEGORY?o[i.getPosition()].push(s):o.other.push(s));for(var h in o)o[h].length>0&&this._buildSinglePosition(h,o[h]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),i=n.locationMap,a=n.maxDataLength;if(0!==a&&0!==i.length){switch(e){case"bottom":case"top":this._buildHorizontal(t,a,i,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,a,i,this.xMarkMap);break;case"other":this._buildOther(t,a,i,this.xMarkMap)}for(var o=0,r=t.length;r>o;o++)this.buildMark(t[o])}},_mapData:function(e){for(var t,n,i,a,o=this.series,s=0,l={},h="__kener__stack__",m=this.component.legend,V=[],U=0,d=0,p=e.length;p>d;d++)t=o[e[d]],i=t.name,this._sIndex2ShapeMap[e[d]]=this._sIndex2ShapeMap[e[d]]||this.query(t,"symbol")||this._symbol[d%this._symbol.length],m?(this.selectedMap[i]=m.isSelected(i),this._sIndex2ColorMap[e[d]]=m.getColor(i),a=m.getItemShape(i),a&&(this.type==r.CHART_TYPE_LINE?(a.style.iconType="legendLineIcon",a.style.symbol=this._sIndex2ShapeMap[e[d]]):t.itemStyle.normal.barBorderWidth>0&&(a.style.x+=1,a.style.y+=1,a.style.width-=2,a.style.height-=2,a.style.strokeColor=a.highlightStyle.strokeColor=t.itemStyle.normal.barBorderColor,a.highlightStyle.lineWidth=3,a.style.brushType="both"),m.setItemShape(i,a))):(this.selectedMap[i]=!0,this._sIndex2ColorMap[e[d]]=this.zr.getColor(e[d])),this.selectedMap[i]&&(n=t.stack||h+e[d],null==l[n]?(l[n]=s,V[s]=[e[d]],s++):V[l[n]].push(e[d])),U=Math.max(U,t.data.length);return{locationMap:V,maxDataLength:U}},_calculMarkMapXY:function(e,t,n){for(var i=this.series,a=0,o=t.length;o>a;a++)for(var r=0,s=t[a].length;s>r;r++){var l=t[a][r],h="xy"==n?0:"";if("-1"!=n.indexOf("x")){e[l]["counter"+h]>0&&(e[l]["average"+h]=(e[l]["sum"+h]/e[l]["counter"+h]).toFixed(2)-0);var m=this.component.xAxis.getAxis(i[l].xAxisIndex||0).getCoord(e[l]["average"+h]);e[l]["averageLine"+h]=[[m,this.component.grid.getYend()],[m,this.component.grid.getY()]],e[l]["minLine"+h]=[[e[l]["minX"+h],this.component.grid.getYend()],[e[l]["minX"+h],this.component.grid.getY()]],e[l]["maxLine"+h]=[[e[l]["maxX"+h],this.component.grid.getYend()],[e[l]["maxX"+h],this.component.grid.getY()]],e[l].isHorizontal=!1}if(h="xy"==n?1:"","-1"!=n.indexOf("y")){e[l]["counter"+h]>0&&(e[l]["average"+h]=(e[l]["sum"+h]/e[l]["counter"+h]).toFixed(2)-0);var V=this.component.yAxis.getAxis(i[l].yAxisIndex||0).getCoord(e[l]["average"+h]);e[l]["averageLine"+h]=[[this.component.grid.getX(),V],[this.component.grid.getXend(),V]],e[l]["minLine"+h]=[[this.component.grid.getX(),e[l]["minY"+h]],[this.component.grid.getXend(),e[l]["minY"+h]]],e[l]["maxLine"+h]=[[this.component.grid.getX(),e[l]["maxY"+h]],[this.component.grid.getXend(),e[l]["maxY"+h]]],e[l].isHorizontal=!0}}},addLabel:function(e,t,n,i,a){var o=[n,t],r=this.deepMerge(o,"itemStyle.normal.label"),s=this.deepMerge(o,"itemStyle.emphasis.label"),l=r.textStyle||{},h=s.textStyle||{};return r.show&&(e.style.text=this._getLabelText(t,n,i,"normal"),e.style.textPosition=null==r.position?"horizontal"===a?"right":"top":r.position,e.style.textColor=l.color,e.style.textFont=this.getFont(l)),s.show&&(e.highlightStyle.text=this._getLabelText(t,n,i,"emphasis"),e.highlightStyle.textPosition=r.show?e.style.textPosition:null==s.position?"horizontal"===a?"right":"top":s.position,e.highlightStyle.textColor=h.color,e.highlightStyle.textFont=this.getFont(h)),e |
|
8 | },_getLabelText:function(e,t,n,i){var a=this.deepQuery([t,e],"itemStyle."+i+".label.formatter");a||"emphasis"!==i||(a=this.deepQuery([t,e],"itemStyle.normal.label.formatter"));var o=null!=t?null!=t.value?t.value:t:"-";return a?"function"==typeof a?a.call(this.myChart,e.name,n,o):"string"==typeof a?(a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),a=a.replace("{a0}",e.name).replace("{b0}",n).replace("{c0}",this.numAddCommas(o))):void 0:this.numAddCommas(o)},buildMark:function(e){var t=this.series[e];this.selectedMap[t.name]&&(t.markPoint&&this._buildMarkPoint(e),t.markLine&&this._buildMarkLine(e))},_buildMarkPoint:function(e){for(var t,n,i=(this.markAttachStyle||{})[e],a=this.series[e],o=this.getZlevelBase(),s=V.clone(a.markPoint),l=0,h=s.data.length;h>l;l++)t=s.data[l],n=this.getMarkCoord(e,t),s.data[l].x=null!=t.x?t.x:n[0],s.data[l].y=null!=t.y?t.y:n[1],!t.type||"max"!==t.type&&"min"!==t.type||(s.data[l].value=n[3],s.data[l].name=t.name||t.type,s.data[l].symbolSize=s.data[l].symbolSize||U.getTextWidth(n[3],this.getFont())/2+5);for(var m=this._markPoint(e,s),l=0,h=m.length;h>l;l++){m[l].zlevel=o+1;for(var d in i)m[l][d]=V.clone(i[d]);this.shapeList.push(m[l])}if(this.type===r.CHART_TYPE_FORCE||this.type===r.CHART_TYPE_CHORD)for(var l=0,h=m.length;h>l;l++)this.zr.addShape(m[l])},_buildMarkLine:function(e){for(var t,n,i=(this.markAttachStyle||{})[e],a=this.series[e],o=this.getZlevelBase(),s=V.clone(a.markLine),l=0,h=s.data.length;h>l;l++)t=s.data[l],!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type?n=[this.getMarkCoord(e,t[0]),this.getMarkCoord(e,t[1])]:(n=this.getMarkCoord(e,t),s.data[l]=[V.clone(t),{}],s.data[l][0].name=t.name||t.type,s.data[l][0].value=n[3],n=n[2],t=[{},{}]),null!=n&&null!=n[0]&&null!=n[1]&&(s.data[l][0].x=null!=t[0].x?t[0].x:n[0][0],s.data[l][0].y=null!=t[0].y?t[0].y:n[0][1],s.data[l][1].x=null!=t[1].x?t[1].x:n[1][0],s.data[l][1].y=null!=t[1].y?t[1].y:n[1][1]);for(var m=this._markLine(e,s),l=0,h=m.length;h>l;l++){m[l].zlevel=o+1;for(var U in i)m[l][U]=V.clone(i[U]);this.shapeList.push(m[l])}if(this.type===r.CHART_TYPE_FORCE||this.type===r.CHART_TYPE_CHORD)for(var l=0,h=m.length;h>l;l++)this.zr.addShape(m[l])},_markPoint:function(e,t){var n=this.series[e],i=this.component;V.merge(t,this.ecTheme.markPoint),t.name=n.name;var a,o,l,h,m,U,d,p=[],c=t.data,u=i.dataRange,y=i.legend,b=this.zr.getWidth(),g=this.zr.getHeight();if(t.large)a=this.getLargeMarkPoingShape(e,t),a._mark="largePoint",a&&p.push(a);else for(var k=0,f=c.length;f>k;k++)null!=c[k].x&&null!=c[k].y&&(l=null!=c[k]&&null!=c[k].value?c[k].value:"",y&&(o=y.getColor(n.name)),u&&(o=isNaN(l)?o:u.getColor(l),h=[c[k],t],m=this.deepQuery(h,"itemStyle.normal.color")||o,U=this.deepQuery(h,"itemStyle.emphasis.color")||m,null==m&&null==U)||(o=null==o?this.zr.getColor(e):o,c[k].tooltip=c[k].tooltip||t.tooltip||{trigger:"item"},c[k].name=null!=c[k].name?c[k].name:"",c[k].value=l,a=this.getSymbolShape(t,e,c[k],k,c[k].name,this.parsePercent(c[k].x,b),this.parsePercent(c[k].y,g),"pin",o,"rgba(0,0,0,0)","horizontal"),a._mark="point",d=this.deepMerge([c[k],t],"effect"),d.show&&(a.effect=d),n.type===r.CHART_TYPE_MAP&&(a._geo=this.getMarkGeo(c[k])),s.pack(a,n,e,c[k],k,c[k].name,l),p.push(a)));return p},_markLine:function(e,t){var n=this.series[e],i=this.component;V.merge(t,this.ecTheme.markLine),t.symbol=t.symbol instanceof Array?t.symbol.length>1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=n.name;for(var a,o,l,h,m,U,d,p,c=[],u=t.data,y=i.dataRange,b=i.legend,g=this.zr.getWidth(),k=this.zr.getHeight(),f=0,_=u.length;_>f;f++)null!=u[f][0].x&&null!=u[f][0].y&&null!=u[f][1].x&&null!=u[f][1].y&&(o=b?b.getColor(n.name):this.zr.getColor(e),p=this.deepMerge(u[f]),l=null!=p&&null!=p.value?p.value:"",y&&(o=isNaN(l)?o:y.getColor(l),h=[p,t],m=this.deepQuery(h,"itemStyle.normal.color")||o,U=this.deepQuery(h,"itemStyle.emphasis.color")||m,null==m&&null==U)||(u[f][0].tooltip=p.tooltip||{trigger:"item"},u[f][0].name=null!=u[f][0].name?u[f][0].name:"",u[f][1].name=null!=u[f][1].name?u[f][1].name:"",u[f][0].value=null!=u[f][0].value?u[f][0].value:"",a=this.getLineMarkShape(t,e,u[f],f,this.parsePercent(u[f][0].x,g),this.parsePercent(u[f][0].y,k),this.parsePercent(u[f][1].x,g),this.parsePercent(u[f][1].y,k),o),a._mark="line",d=this.deepMerge([p,t],"effect"),d.show&&(a.effect=d),n.type===r.CHART_TYPE_MAP&&(a._geo=[this.getMarkGeo(u[f][0]),this.getMarkGeo(u[f][1])]),s.pack(a,n,e,u[f][0],f,u[f][0].name+(""!==u[f][1].name?" > "+u[f][1].name:""),l),c.push(a)));return c},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,t,a,o,r,l,h,m,V,U,d){var p=[a,e],c=null!=a?null!=a.value?a.value:a:"-";m=this.deepQuery(p,"symbol")||m;var u=this.deepQuery(p,"symbolSize");u="function"==typeof u?u(c):u;var y=this.deepQuery(p,"symbolRotate"),b=this.deepMerge(p,"itemStyle.normal"),g=this.deepMerge(p,"itemStyle.emphasis"),k=null!=b.borderWidth?b.borderWidth:b.lineStyle&&b.lineStyle.width;null==k&&(k=m.match("empty")?2:0);var f=null!=g.borderWidth?g.borderWidth:g.lineStyle&&g.lineStyle.width;null==f&&(f=k+2);var _=new i({style:{iconType:m.replace("empty","").toLowerCase(),x:l-u,y:h-u,width:2*u,height:2*u,brushType:"both",color:m.match("empty")?U:this.getItemStyleColor(b.color,t,o,a)||V,strokeColor:b.borderColor||this.getItemStyleColor(b.color,t,o,a)||V,lineWidth:k},highlightStyle:{color:m.match("empty")?U:this.getItemStyleColor(g.color,t,o,a),strokeColor:g.borderColor||b.borderColor||this.getItemStyleColor(b.color,t,o,a)||V,lineWidth:f},clickable:this.deepQuery(p,"clickable")});return m.match("image")&&(_.style.image=m.replace(new RegExp("^image:\\/\\/"),""),_=new n({style:_.style,highlightStyle:_.highlightStyle,clickable:this.deepQuery(p,"clickable")})),null!=y&&(_.rotation=[y*Math.PI/180,l,h]),m.match("star")&&(_.style.iconType="star",_.style.n=m.replace("empty","").replace("star","")-0||5),"none"===m&&(_.invisible=!0,_.hoverable=!1),_=this.addLabel(_,e,a,r,d),m.match("empty")&&(null==_.style.textColor&&(_.style.textColor=_.style.strokeColor),null==_.highlightStyle.textColor&&(_.highlightStyle.textColor=_.highlightStyle.strokeColor)),s.pack(_,e,t,a,o,r),_._x=l,_._y=h,_._dataIndex=o,_._seriesIndex=t,_},getLineMarkShape:function(e,t,n,i,o,r,s,l,h){var m=null!=n[0]?null!=n[0].value?n[0].value:n[0]:"-",V=null!=n[1]?null!=n[1].value?n[1].value:n[1]:"-",U=[this.query(n[0],"symbol")||e.symbol[0],this.query(n[1],"symbol")||e.symbol[1]],d=[this.query(n[0],"symbolSize")||e.symbolSize[0],this.query(n[1],"symbolSize")||e.symbolSize[1]];d[0]="function"==typeof d[0]?d[0](m):d[0],d[1]="function"==typeof d[1]?d[1](V):d[1];var p=[this.query(n[0],"symbolRotate")||e.symbolRotate[0],this.query(n[1],"symbolRotate")||e.symbolRotate[1]],c=[n[0],e],u=this.deepMerge(c,"itemStyle.normal");u.color=this.getItemStyleColor(u.color,t,i,n);var y=this.deepMerge(c,"itemStyle.emphasis");y.color=this.getItemStyleColor(y.color,t,i,n);var b=u.lineStyle,g=y.lineStyle,k=b.width;null==k&&(k=u.borderWidth);var f=g.width;null==f&&(f=null!=y.borderWidth?y.borderWidth:k+2);var _=new a({style:{smooth:e.smooth?"spline":!1,symbol:U,symbolSize:d,symbolRotate:p,xStart:o,yStart:r,xEnd:s,yEnd:l,brushType:"both",lineType:b.type,shadowColor:b.shadowColor||b.color||u.borderColor||u.color||h,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,color:u.color||h,strokeColor:b.color||u.borderColor||u.color||h,lineWidth:k,symbolBorderColor:u.borderColor||u.color||h,symbolBorder:u.borderWidth},highlightStyle:{shadowColor:g.shadowColor,shadowBlur:g.shadowBlur,shadowOffsetX:g.shadowOffsetX,shadowOffsetY:g.shadowOffsetY,color:y.color||u.color||h,strokeColor:g.color||b.color||y.borderColor||u.borderColor||y.color||u.color||h,lineWidth:f,symbolBorderColor:y.borderColor||u.borderColor||y.color||u.color||h,symbolBorder:null==y.borderWidth?u.borderWidth+2:y.borderWidth},clickable:this.deepQuery(c,"clickable")});return _=this.addLabel(_,e,n[0],n[0].name+" : "+n[1].name),_._x=s,_._y=l,_},getLargeMarkPoingShape:function(e,t){var n,i,a,r,s,l,h=this.series[e],m=this.component,V=t.data,U=m.dataRange,d=m.legend,p=[V[0],t];if(d&&(i=d.getColor(h.name)),!U||(a=null!=V[0]?null!=V[0].value?V[0].value:V[0]:"-",i=isNaN(a)?i:U.getColor(a),r=this.deepQuery(p,"itemStyle.normal.color")||i,s=this.deepQuery(p,"itemStyle.emphasis.color")||r,null!=r||null!=s)){i=this.deepMerge(p,"itemStyle.normal").color||i;var c=this.deepQuery(p,"symbol")||"circle";c=c.replace("empty","").replace(/\d/g,""),l=this.deepMerge([V[0],t],"effect");var u=window.devicePixelRatio||1;return n=new o({style:{pointList:V,color:i,strokeColor:i,shadowColor:l.shadowColor||i,shadowBlur:(null!=l.shadowBlur?l.shadowBlur:8)*u,size:this.deepQuery(p,"symbolSize"),iconType:c,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),l.show&&(n.effect=l),n}},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e,t,n=this.option.animationThreshold/(this.canvasSupported?2:4),i=this.lastShapeList,a=this.shapeList,o=i.length>0?500:this.query(this.option,"animationDuration"),s=this.query(this.option,"animationEasing"),l={},h={};if(this.option.animation&&!this.option.renderAsImage&&a.length<n&&!this.motionlessOnce){for(var m=0,V=i.length;V>m;m++)t=this._getAnimationKey(i[m]),t.match("undefined")?this.zr.delShape(i[m].id):(t+=i[m].type,l[t]=i[m]);for(var m=0,V=a.length;V>m;m++)t=this._getAnimationKey(a[m]),t.match("undefined")?this.zr.addShape(a[m]):(t+=a[m].type,h[t]=a[m]);for(t in l)h[t]||this.zr.delShape(l[t].id);for(t in h)l[t]?(this.zr.delShape(l[t].id),this._animateMod(l[t],h[t],o,s)):(e=this.type!=r.CHART_TYPE_LINE&&this.type!=r.CHART_TYPE_RADAR||0===t.indexOf("icon")?0:o/2,this._animateMod(!1,h[t],o,s,e));this.zr.refresh(),this.animationEffect()}else{this.motionlessOnce=!1,this.zr.delShape(i);for(var m=0,V=a.length;V>m;m++)this.zr.addShape(a[m])}},_getAnimationKey:function(e){return this.type!=r.CHART_TYPE_MAP?s.get(e,"seriesIndex")+"_"+s.get(e,"dataIndex")+(e._mark?e._mark:"")+(this.type===r.CHART_TYPE_RADAR?s.get(e,"special"):""):s.get(e,"seriesIndex")+"_"+s.get(e,"dataIndex")+(e._mark?e._mark:"undefined")},_animateMod:function(e,t,n,i,a){switch(t.type){case"broken-line":case"half-smooth-polygon":l.pointList(this.zr,e,t,n,i);break;case"rectangle":l.rectangle(this.zr,e,t,n,i);break;case"icon":l.icon(this.zr,e,t,n,i,a);break;case"candle":n>500?l.candle(this.zr,e,t,n,i):this.zr.addShape(t);break;case"ring":case"sector":case"circle":n>500?l.ring(this.zr,e,t,n+(s.get(t,"dataIndex")||0)%20*100,i):"sector"===t.type?l.sector(this.zr,e,t,n,i):this.zr.addShape(t);break;case"text":l.text(this.zr,e,t,n,i);break;case"polygon":n>500?l.polygon(this.zr,e,t,n,i):l.pointList(this.zr,e,t,n,i);break;case"ribbon":l.ribbon(this.zr,e,t,n,i);break;case"gauge-pointer":l.gaugePointer(this.zr,e,t,n,i);break;case"mark-line":l.markline(this.zr,e,t,n,i);break;case"bezier-curve":case"line":l.line(this.zr,e,t,n,i);break;default:this.zr.addShape(t)}},animationMark:function(e,t,n){for(var i=n||this.shapeList,a=0,o=i.length;o>a;a++)i[a]._mark&&this._animateMod(!1,i[a],e,t);this.animationEffect(n)},animationEffect:function(e){!e&&this.clearEffectShape();var t=e||this.shapeList;if(null!=t){var n=r.EFFECT_ZLEVEL;this.canvasSupported&&this.zr.modLayer(n,{motionBlur:!0,lastFrameAlpha:.95});for(var i,a=0,o=t.length;o>a;a++)i=t[a],i._mark&&i.effect&&i.effect.show&&h[i._mark]&&(h[i._mark](this.zr,this.effectList,i,n),this.effectList[this.effectList.length-1]._mark=i._mark)}},clearEffectShape:function(e){this.zr&&this.effectList&&this.effectList.length>0&&(e&&this.zr.modLayer(r.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,n){var i=this.series[e];if(this.selectedMap[i.name]){var a=500,o=this.query(this.option,"animationEasing"),r=i[n].data,s=this.shapeList.length;if(i[n].data=t.data,this["_build"+n.replace("m","M")](e),this.option.animation&&!this.option.renderAsImage)this.animationMark(a,o,this.shapeList.slice(s));else{for(var l=s,h=this.shapeList.length;h>l;l++)this.zr.addShape(this.shapeList[l]);this.zr.refresh()}i[n].data=r}},delMark:function(e,t,n){n=n.replace("mark","").replace("large","").toLowerCase();var i=this.series[e];if(this.selectedMap[i.name]){for(var a=!1,o=[this.shapeList,this.effectList],r=2;r--;)for(var l=0,h=o[r].length;h>l;l++)if(o[r][l]._mark==n&&s.get(o[r][l],"seriesIndex")==e&&s.get(o[r][l],"name")==t){this.zr.delShape(o[r][l].id),o[r].splice(l,1),a=!0;break}a&&this.zr.refresh()}}},t}),n("zrender/shape/Circle",["require","./Base","../tool/util"],function(e){"use strict";var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"circle",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,2*Math.PI,!0)},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("echarts/util/accMath",[],function(){function e(e,t){var n=e.toString(),i=t.toString(),a=0;try{a=i.split(".")[1].length}catch(o){}try{a-=n.split(".")[1].length}catch(o){}return(n.replace(".","")-0)/(i.replace(".","")-0)*Math.pow(10,a)}function t(e,t){var n=e.toString(),i=t.toString(),a=0;try{a+=n.split(".")[1].length}catch(o){}try{a+=i.split(".")[1].length}catch(o){}return(n.replace(".","")-0)*(i.replace(".","")-0)/Math.pow(10,a)}function n(e,t){var n=0,i=0;try{n=e.toString().split(".")[1].length}catch(a){}try{i=t.toString().split(".")[1].length}catch(a){}var o=Math.pow(10,Math.max(n,i));return(Math.round(e*o)+Math.round(t*o))/o}function i(e,t){return n(e,-t)}return{accDiv:e,accMul:t,accAdd:n,accSub:i}}),n("echarts/util/ecQuery",["require","zrender/tool/util"],function(e){function t(e,t){if("undefined"!=typeof e){if(!t)return e;t=t.split(".");for(var n=t.length,i=0;n>i;){if(e=e[t[i]],"undefined"==typeof e)return;i++}return e}}function n(e,n){for(var i,a=0,o=e.length;o>a;a++)if(i=t(e[a],n),"undefined"!=typeof i)return i}function i(e,n){for(var i,o=e.length;o--;){var r=t(e[o],n);"undefined"!=typeof r&&("undefined"==typeof i?i=a.clone(r):a.merge(i,r,!0))}return i}var a=e("zrender/tool/util");return{query:t,deepQuery:n,deepMerge:i}}),n("echarts/util/number",[],function(){function e(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function t(t,n){return"string"==typeof t?e(t).match(/%$/)?parseFloat(t)/100*n:parseFloat(t):t}function n(e,n){return[t(n[0],e.getWidth()),t(n[1],e.getHeight())]}function i(e,n){n instanceof Array||(n=[0,n]);var i=Math.min(e.getWidth(),e.getHeight())/2;return[t(n[0],i),t(n[1],i)]}function a(e){return isNaN(e)?"-":(e=(e+"").split("."),e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:""))}return{parsePercent:t,parseCenter:n,parseRadius:i,addCommas:a}}),n("echarts/util/shape/Icon",["require","zrender/tool/util","zrender/shape/Star","zrender/shape/Heart","zrender/shape/Droplet","zrender/shape/Image","zrender/shape/Base"],function(e){function t(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i+t.height),e.lineTo(n+5*a,i+14*o),e.lineTo(n+t.width,i+3*o),e.lineTo(n+13*a,i),e.lineTo(n+2*a,i+11*o),e.lineTo(n,i+t.height),e.moveTo(n+6*a,i+10*o),e.lineTo(n+14*a,i+2*o),e.moveTo(n+10*a,i+13*o),e.lineTo(n+t.width,i+13*o),e.moveTo(n+13*a,i+10*o),e.lineTo(n+13*a,i+t.height)}function n(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i+t.height),e.lineTo(n+5*a,i+14*o),e.lineTo(n+t.width,i+3*o),e.lineTo(n+13*a,i),e.lineTo(n+2*a,i+11*o),e.lineTo(n,i+t.height),e.moveTo(n+6*a,i+10*o),e.lineTo(n+14*a,i+2*o),e.moveTo(n+10*a,i+13*o),e.lineTo(n+t.width,i+13*o)}function i(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n+4*a,i+15*o),e.lineTo(n+9*a,i+13*o),e.lineTo(n+14*a,i+8*o),e.lineTo(n+11*a,i+5*o),e.lineTo(n+6*a,i+10*o),e.lineTo(n+4*a,i+15*o),e.moveTo(n+5*a,i),e.lineTo(n+11*a,i),e.moveTo(n+5*a,i+o),e.lineTo(n+11*a,i+o),e.moveTo(n,i+2*o),e.lineTo(n+t.width,i+2*o),e.moveTo(n,i+5*o),e.lineTo(n+3*a,i+t.height),e.lineTo(n+13*a,i+t.height),e.lineTo(n+t.width,i+5*o)}function a(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i+3*o),e.lineTo(n+6*a,i+3*o),e.moveTo(n+3*a,i),e.lineTo(n+3*a,i+6*o),e.moveTo(n+3*a,i+8*o),e.lineTo(n+3*a,i+t.height),e.lineTo(n+t.width,i+t.height),e.lineTo(n+t.width,i+3*o),e.lineTo(n+8*a,i+3*o)}function o(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n+6*a,i),e.lineTo(n+2*a,i+3*o),e.lineTo(n+6*a,i+6*o),e.moveTo(n+2*a,i+3*o),e.lineTo(n+14*a,i+3*o),e.lineTo(n+14*a,i+11*o),e.moveTo(n+2*a,i+5*o),e.lineTo(n+2*a,i+13*o),e.lineTo(n+14*a,i+13*o),e.moveTo(n+10*a,i+10*o),e.lineTo(n+14*a,i+13*o),e.lineTo(n+10*a,i+t.height)}function r(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16,r=t.width/2;e.lineWidth=1.5,e.arc(n+r,i+r,r-a,0,2*Math.PI/3),e.moveTo(n+3*a,i+t.height),e.lineTo(n+0*a,i+12*o),e.lineTo(n+5*a,i+11*o),e.moveTo(n,i+8*o),e.arc(n+r,i+r,r-a,Math.PI,5*Math.PI/3),e.moveTo(n+13*a,i),e.lineTo(n+t.width,i+4*o),e.lineTo(n+11*a,i+5*o)}function s(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i),e.lineTo(n,i+t.height),e.lineTo(n+t.width,i+t.height),e.moveTo(n+2*a,i+14*o),e.lineTo(n+7*a,i+6*o),e.lineTo(n+11*a,i+11*o),e.lineTo(n+15*a,i+2*o)}function l(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i),e.lineTo(n,i+t.height),e.lineTo(n+t.width,i+t.height),e.moveTo(n+3*a,i+14*o),e.lineTo(n+3*a,i+6*o),e.lineTo(n+4*a,i+6*o),e.lineTo(n+4*a,i+14*o),e.moveTo(n+7*a,i+14*o),e.lineTo(n+7*a,i+2*o),e.lineTo(n+8*a,i+2*o),e.lineTo(n+8*a,i+14*o),e.moveTo(n+11*a,i+14*o),e.lineTo(n+11*a,i+9*o),e.lineTo(n+12*a,i+9*o),e.lineTo(n+12*a,i+14*o)}function h(e,t){var n=t.x,i=t.y,a=t.width-2,o=t.height-2,r=Math.min(a,o)/2;i+=2,e.moveTo(n+r+3,i+r-3),e.arc(n+r+3,i+r-3,r-1,0,-Math.PI/2,!0),e.lineTo(n+r+3,i+r-3),e.moveTo(n+r,i),e.lineTo(n+r,i+r),e.arc(n+r,i+r,r,-Math.PI/2,2*Math.PI,!0),e.lineTo(n+r,i+r),e.lineWidth=1.5}function m(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;i-=o,e.moveTo(n+1*a,i+2*o),e.lineTo(n+15*a,i+2*o),e.lineTo(n+14*a,i+3*o),e.lineTo(n+2*a,i+3*o),e.moveTo(n+3*a,i+6*o),e.lineTo(n+13*a,i+6*o),e.lineTo(n+12*a,i+7*o),e.lineTo(n+4*a,i+7*o),e.moveTo(n+5*a,i+10*o),e.lineTo(n+11*a,i+10*o),e.lineTo(n+10*a,i+11*o),e.lineTo(n+6*a,i+11*o),e.moveTo(n+7*a,i+14*o),e.lineTo(n+9*a,i+14*o),e.lineTo(n+8*a,i+15*o),e.lineTo(n+7*a,i+15*o)}function V(e,t){var n=t.x,i=t.y,a=t.width,o=t.height,r=a/16,s=o/16,l=2*Math.min(r,s);e.moveTo(n+r+l,i+s+l),e.arc(n+r,i+s,l,Math.PI/4,3*Math.PI),e.lineTo(n+7*r-l,i+6*s-l),e.arc(n+7*r,i+6*s,l,Math.PI/4*5,4*Math.PI),e.arc(n+7*r,i+6*s,l/2,Math.PI/4*5,4*Math.PI),e.moveTo(n+7*r-l/2,i+6*s+l),e.lineTo(n+r+l,i+14*s-l),e.arc(n+r,i+14*s,l,-Math.PI/4,2*Math.PI),e.moveTo(n+7*r+l/2,i+6*s),e.lineTo(n+14*r-l,i+10*s-l/2),e.moveTo(n+16*r,i+10*s),e.arc(n+14*r,i+10*s,l,0,3*Math.PI),e.lineWidth=1.5}function U(e,t){var n=t.x,i=t.y,a=t.width,o=t.height,r=Math.min(a,o)/2;e.moveTo(n+a,i+o/2),e.arc(n+r,i+r,r,0,2*Math.PI),e.arc(n+r,i,r,Math.PI/4,Math.PI/5*4),e.arc(n,i+r,r,-Math.PI/3,Math.PI/3),e.arc(n+a,i+o,r,Math.PI,Math.PI/2*3),e.lineWidth=1.5}function d(e,t){for(var n=t.x,i=t.y,a=t.width,o=t.height,r=Math.round(o/3),s=3;s--;)e.rect(n,i+r*s+2,a,2)}function p(e,t){for(var n=t.x,i=t.y,a=t.width,o=t.height,r=Math.round(a/3),s=3;s--;)e.rect(n+r*s,i,2,o)}function c(e,t){var n=t.x,i=t.y,a=t.width/16;e.moveTo(n+a,i),e.lineTo(n+a,i+t.height),e.lineTo(n+15*a,i+t.height),e.lineTo(n+15*a,i),e.lineTo(n+a,i),e.moveTo(n+3*a,i+3*a),e.lineTo(n+13*a,i+3*a),e.moveTo(n+3*a,i+6*a),e.lineTo(n+13*a,i+6*a),e.moveTo(n+3*a,i+9*a),e.lineTo(n+13*a,i+9*a),e.moveTo(n+3*a,i+12*a),e.lineTo(n+9*a,i+12*a)}function u(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i),e.lineTo(n,i+t.height),e.lineTo(n+t.width,i+t.height),e.lineTo(n+t.width,i),e.lineTo(n,i),e.moveTo(n+4*a,i),e.lineTo(n+4*a,i+8*o),e.lineTo(n+12*a,i+8*o),e.lineTo(n+12*a,i),e.moveTo(n+6*a,i+11*o),e.lineTo(n+6*a,i+13*o),e.lineTo(n+10*a,i+13*o),e.lineTo(n+10*a,i+11*o),e.lineTo(n+6*a,i+11*o)}function y(e,t){var n=t.x,i=t.y,a=t.width,o=t.height;e.moveTo(n,i+o/2),e.lineTo(n+a,i+o/2),e.moveTo(n+a/2,i),e.lineTo(n+a/2,i+o)}function b(e,t){var n=t.width/2,i=t.height/2,a=Math.min(n,i);e.moveTo(t.x+n+a,t.y+i),e.arc(t.x+n,t.y+i,a,0,2*Math.PI),e.closePath()}function g(e,t){e.rect(t.x,t.y,t.width,t.height),e.closePath()}function k(e,t){var n=t.width/2,i=t.height/2,a=t.x+n,o=t.y+i,r=Math.min(n,i);e.moveTo(a,o-r),e.lineTo(a+r,o+r),e.lineTo(a-r,o+r),e.lineTo(a,o-r),e.closePath()}function f(e,t){var n=t.width/2,i=t.height/2,a=t.x+n,o=t.y+i,r=Math.min(n,i);e.moveTo(a,o-r),e.lineTo(a+r,o),e.lineTo(a,o+r),e.lineTo(a-r,o),e.lineTo(a,o-r),e.closePath()}function _(e,t){var n=t.x,i=t.y,a=t.width/16;e.moveTo(n+8*a,i),e.lineTo(n+a,i+t.height),e.lineTo(n+8*a,i+t.height/4*3),e.lineTo(n+15*a,i+t.height),e.lineTo(n+8*a,i),e.closePath()}function x(t,n){var i=e("zrender/shape/Star"),a=n.width/2,o=n.height/2;i.prototype.buildPath(t,{x:n.x+a,y:n.y+o,r:Math.min(a,o),n:n.n||5})}function L(t,n){var i=e("zrender/shape/Heart");i.prototype.buildPath(t,{x:n.x+n.width/2,y:n.y+.2*n.height,a:n.width/2,b:.8*n.height})}function W(t,n){var i=e("zrender/shape/Droplet");i.prototype.buildPath(t,{x:n.x+.5*n.width,y:n.y+.5*n.height,a:.5*n.width,b:.8*n.height})}function X(e,t){var n=t.x,i=t.y-t.height/2*1.5,a=t.width/2,o=t.height/2,r=Math.min(a,o);e.arc(n+a,i+o,r,Math.PI/5*4,Math.PI/5),e.lineTo(n+a,i+o+1.5*r),e.closePath()}function K(t,n,i){var a=e("zrender/shape/Image");this._imageShape=this._imageShape||new a({style:{}});for(var o in n)this._imageShape.style[o]=n[o];this._imageShape.brush(t,!1,i)}function w(e){v.call(this,e)}var I=e("zrender/tool/util"),v=e("zrender/shape/Base");return w.prototype={type:"icon",iconLibrary:{mark:t,markUndo:n,markClear:i,dataZoom:a,dataZoomReset:o,restore:r,lineChart:s,barChart:l,pieChart:h,funnelChart:m,forceChart:V,chordChart:U,stackChart:d,tiledChart:p,dataView:c,saveAsImage:u,cross:y,circle:b,rectangle:g,triangle:k,diamond:f,arrow:_,star:x,heart:L,droplet:W,pin:X,image:K},brush:function(t,n,i){var a=n?this.highlightStyle:this.style;a=a||{};var o=a.iconType||this.style.iconType;if("image"===o){var r=e("zrender/shape/Image");r.prototype.brush.call(this,t,n,i)}else{var a=this.beforeBrush(t,n);switch(t.beginPath(),this.buildPath(t,a,i),a.brushType){case"both":t.fill();case"stroke":a.lineWidth>0&&t.stroke();break;default:t.fill()}this.drawText(t,a,this.style),this.afterBrush(t)}},buildPath:function(e,t,n){this.iconLibrary[t.iconType]?this.iconLibrary[t.iconType].call(this,e,t,n):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y),e.closePath())},getRect:function(e){return e.__rect?e.__rect:(e.__rect={x:Math.round(e.x),y:Math.round(e.y-("pin"==e.iconType?e.height/2*1.5:0)),width:e.width,height:e.height},e.__rect)},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.__rect;i||(i=this.style.__rect=this.getRect(this.style));var a=i.height<8||i.width<8?4:0;return e>=i.x-a&&e<=i.x+i.width+a&&t>=i.y-a&&t<=i.y+i.height+a?!0:!1}},I.inherits(w,v),w}),n("echarts/util/shape/MarkLine",["require","zrender/shape/Base","./Icon","zrender/shape/Line","zrender/shape/BrokenLine","zrender/tool/matrix","zrender/tool/area","zrender/shape/util/dashedLineTo","zrender/shape/util/smoothSpline","zrender/tool/util"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("./Icon"),a=e("zrender/shape/Line"),o=new a({}),r=e("zrender/shape/BrokenLine"),s=new r({}),l=e("zrender/tool/matrix"),h=e("zrender/tool/area"),m=e("zrender/shape/util/dashedLineTo"),V=e("zrender/shape/util/smoothSpline"),U=e("zrender/tool/util");return t.prototype={type:"mark-line",brush:function(e,t){var n=this.style;t&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),e.save(),this.setContext(e,n),this.setTransform(e),e.save(),e.beginPath(),this.buildLinePath(e,n,this.style.lineWidth||1),e.stroke(),e.restore(),this.brushSymbol(e,n,0),this.brushSymbol(e,n,1),this.drawText(e,n,this.style),e.restore()},buildLinePath:function(e,t,n){var i=t.pointList||this.getPointList(t);t.pointList=i;var a=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType)if("spline"!==t.smooth){var o=n*("dashed"==t.lineType?5:1);e.moveTo(i[0][0],i[0][1]);for(var r=1;a>r;r++)m(e,i[r-1][0],i[r-1][1],i[r][0],i[r][1],o)}else for(var r=1;a>r;r+=2)e.moveTo(i[r-1][0],i[r-1][1]),e.lineTo(i[r][0],i[r][1])}else{e.moveTo(i[0][0],i[0][1]);for(var r=1;a>r;r++)e.lineTo(i[r][0],i[r][1])}},brushSymbol:function(e,t,n){if("none"!=t.symbol[n]){e.save(),e.beginPath(),e.lineWidth=t.symbolBorder,e.strokeStyle=t.symbolBorderColor,t.iconType=t.symbol[n].replace("empty","").toLowerCase(),t.symbol[n].match("empty")&&(e.fillStyle="#fff");var a,o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length)),r=0===n?t.pointList[0][0]:t.pointList[o-1][0],s=0===n?t.pointList[0][1]:t.pointList[o-1][1],h="undefined"!=typeof t.symbolRotate[n]?t.symbolRotate[n]-0:0;if(0!==h&&(a=l.create(),l.identity(a),(r||s)&&l.translate(a,a,[-r,-s]),l.rotate(a,a,h*Math.PI/180),(r||s)&&l.translate(a,a,[r,s]),e.transform.apply(e,a)),"arrow"==t.iconType&&0===h)this.buildArrawPath(e,t,n);else{var m=t.symbolSize[n];t.x=r-m,t.y=s-m,t.width=2*m,t.height=2*m,i.prototype.buildPath(e,t)}e.closePath(),e.fill(),e.stroke(),e.restore()}},buildArrawPath:function(e,t,n){var i=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length)),a=2*t.symbolSize[n],o=t.pointList[0][0],r=t.pointList[i-1][0],s=t.pointList[0][1],l=t.pointList[i-1][1],h=0;"spline"===t.smooth&&(h=.2);var m=Math.atan(Math.abs((l-s)/(o-r)));0===n?r>o?l>s?m=2*Math.PI-m+h:m+=h:l>s?m+=Math.PI-h:m=Math.PI-m-h:o>r?s>l?m=2*Math.PI-m+h:m+=h:s>l?m+=Math.PI-h:m=Math.PI-m-h;var V=Math.PI/8,U=0===n?o:r,d=0===n?s:l,p=[[U+a*Math.cos(m-V),d-a*Math.sin(m-V)],[U+.6*a*Math.cos(m),d-.6*a*Math.sin(m)],[U+a*Math.cos(m+V),d-a*Math.sin(m+V)]];e.moveTo(U,d);for(var c=0,u=p.length;u>c;c++)e.lineTo(p[c][0],p[c][1]);e.lineTo(U,d)},getPointList:function(e){var t=[[e.xStart,e.yStart],[e.xEnd,e.yEnd]];if("spline"===e.smooth){var n=t[1][0],i=t[1][1];t[3]=[n,i],t[1]=this.getOffetPoint(t[0],t[3]),t[2]=this.getOffetPoint(t[3],t[0]),t=V(t,!1),t[t.length-1]=[n,i]}return t},getOffetPoint:function(e,t){var n,i=Math.sqrt(Math.round((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])))/3,a=[e[0],e[1]],o=.2;if(e[0]!=t[0]&&e[1]!=t[1]){var r=(t[1]-e[1])/(t[0]-e[0]);n=Math.atan(r)}else n=e[0]==t[0]?(e[1]<=t[1]?1:-1)*Math.PI/2:0;var s,l;return e[0]<=t[0]?(n-=o,s=Math.round(Math.cos(n)*i),l=Math.round(Math.sin(n)*i),a[0]+=s,a[1]+=l):(n+=o,s=Math.round(Math.cos(n)*i),l=Math.round(Math.sin(n)*i),a[0]-=s,a[1]-=l),a},getRect:function(e){if(e.__rect)return e.__rect;var t=e.lineWidth||1;return e.__rect={x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t},e.__rect},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.__rect;return i||(i=this.style.__rect=this.getRect(this.style)),e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?"spline"!==this.style.smooth?h.isInside(o,this.style,e,t):h.isInside(s,this.style,e,t):!1}},U.inherits(t,n),t}),n("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/Polygon"),a=new i({}),o=e("zrender/tool/util");return t.prototype={type:"symbol",buildPath:function(e,t){var n=t.pointList,i=n.length;if(0!==i)for(var a,o,r,s,l,h=1e4,m=Math.ceil(i/h),V=n[0]instanceof Array,U=t.size?t.size:2,d=U,p=U/2,c=2*Math.PI,u=0;m>u;u++){e.beginPath(),a=u*h,o=a+h,o=o>i?i:o;for(var y=a;o>y;y++)if(t.random&&(r=t["randomMap"+y%20]/100,d=U*r*r,p=d/2),V?(s=n[y][0],l=n[y][1]):(s=n[y].x,l=n[y].y),3>d)e.rect(s-p,l-p,d,d);else switch(t.iconType){case"circle":e.moveTo(s,l),e.arc(s,l,p,0,c,!0);break;case"diamond":e.moveTo(s,l-p),e.lineTo(s+p/3,l-p/3),e.lineTo(s+p,l),e.lineTo(s+p/3,l+p/3),e.lineTo(s,l+p),e.lineTo(s-p/3,l+p/3),e.lineTo(s-p,l),e.lineTo(s-p/3,l-p/3),e.lineTo(s,l-p);break;default:e.rect(s-p,l-p,d,d)}if(e.closePath(),m-1>u)switch(t.brushType){case"both":e.fill(),t.lineWidth>0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||a.getRect(e)},isCover:e("./normalIsCover")},o.inherits(t,n),t}),n("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e,t,n,i,a){var o,r=n.style.pointList,s=r.length;if(!t){if(o=[],"vertical"!=n._orient)for(var l=r[0][1],h=0;s>h;h++)o[h]=[r[h][0],l];else for(var m=r[0][0],h=0;s>h;h++)o[h]=[m,r[h][1]];"half-smooth-polygon"==n.type&&(o[s-1]=p.clone(r[s-1]),o[s-2]=p.clone(r[s-2])),t={style:{pointList:o}}}o=t.style.pointList;var V=o.length;n.style.pointList=V==s?o:s>V?o.concat(r.slice(V)):o.slice(0,s),e.addShape(n),e.animate(n.id,"style").when(i,{pointList:r}).start(a)}function n(e,t){for(var n=arguments.length,i=2;n>i;i++){var a=arguments[i];e.style[a]=t.style[a]}}function i(e,t,i,a,o){var r=i.style;t||(t={position:i.position,style:{x:r.x,y:"vertical"==i._orient?r.y+r.height:r.y,width:"vertical"==i._orient?r.width:0,height:"vertical"!=i._orient?r.height:0}});var s=r.x,l=r.y,h=r.width,m=r.height,V=[i.position[0],i.position[1]];n(i,t,"x","y","width","height"),i.position=t.position,e.addShape(i),(V[0]!=t.position[0]||V[1]!=t.position[1])&&e.animate(i.id,"").when(a,{position:V}).start(o),e.animate(i.id,"style").when(a,{x:s,y:l,width:h,height:m}).start(o)}function a(e,t,n,i,a){if(!t){var o=n.style.y;t={style:{y:[o[0],o[0],o[0],o[0]]}}}var r=n.style.y;n.style.y=t.style.y,e.addShape(n),e.animate(n.id,"style").when(i,{y:r}).start(a)}function o(e,t,n,i,a){var o=n.style.x,r=n.style.y,s=n.style.r0,l=n.style.r;"r"!=n._animationAdd?(n.style.r0=0,n.style.r=0,n.rotation=[2*Math.PI,o,r],e.addShape(n),e.animate(n.id,"style").when(i,{r0:s,r:l}).start(a),e.animate(n.id,"").when(Math.round(i/3*2),{rotation:[0,o,r]}).start(a)):(n.style.r0=n.style.r,e.addShape(n),e.animate(n.id,"style").when(i,{r0:s}).start(a))}function r(e,t,i,a,o){t||(t="r"!=i._animationAdd?{style:{startAngle:i.style.startAngle,endAngle:i.style.startAngle}}:{style:{r0:i.style.r}});var r=i.style.startAngle,s=i.style.endAngle;n(i,t,"startAngle","endAngle"),e.addShape(i),e.animate(i.id,"style").when(a,{startAngle:r,endAngle:s}).start(o)}function s(e,t,i,a,o){t||(t={style:{x:"left"==i.style.textAlign?i.style.x+100:i.style.x-100,y:i.style.y}});var r=i.style.x,s=i.style.y;n(i,t,"x","y"),e.addShape(i),e.animate(i.id,"style").when(a,{x:r,y:s}).start(o)}function l(t,n,i,a,o){var r=e("zrender/shape/Polygon").prototype.getRect(i.style),s=r.x+r.width/2,l=r.y+r.height/2;i.scale=[.1,.1,s,l],t.addShape(i),t.animate(i.id,"").when(a,{scale:[1,1,s,l]}).start(o)}function h(e,t,i,a,o){t||(t={style:{source0:0,source1:i.style.source1>0?360:-360,target0:0,target1:i.style.target1>0?360:-360}});var r=i.style.source0,s=i.style.source1,l=i.style.target0,h=i.style.target1;t.style&&n(i,t,"source0","source1","target0","target1"),e.addShape(i),e.animate(i.id,"style").when(a,{source0:r,source1:s,target0:l,target1:h}).start(o)}function m(e,t,n,i,a){t||(t={style:{angle:n.style.startAngle}});var o=n.style.angle;n.style.angle=t.style.angle,e.addShape(n),e.animate(n.id,"style").when(i,{angle:o}).start(a)}function V(e,t,n,a,o,r){if(n.style._x=n.style.x,n.style._y=n.style.y,n.style._width=n.style.width,n.style._height=n.style.height,t)i(e,t,n,a,o);else{var s=n._x||0,l=n._y||0;n.scale=[.01,.01,s,l],e.addShape(n),e.animate(n.id,"").delay(r).when(a,{scale:[1,1,s,l]}).start(o||"QuinticOut") |
|
9 | }}function U(e,t,i,a,o){t||(t={style:{xStart:i.style.xStart,yStart:i.style.yStart,xEnd:i.style.xStart,yEnd:i.style.yStart}});var r=i.style.xStart,s=i.style.xEnd,l=i.style.yStart,h=i.style.yEnd;n(i,t,"xStart","xEnd","yStart","yEnd"),e.addShape(i),e.animate(i.id,"style").when(a,{xStart:r,xEnd:s,yStart:l,yEnd:h}).start(o)}function d(e,t,n,i,a){n.style.smooth?t?e.addShape(n):(n.style.pointListLength=1,e.addShape(n),n.style.pointList=n.style.pointList||n.getPointList(n.style),e.animate(n.id,"style").when(i,{pointListLength:n.style.pointList.length}).start(a||"QuinticOut")):(n.style.pointList=t?t.style.pointList:[[n.style.xStart,n.style.yStart],[n.style.xStart,n.style.yStart]],e.addShape(n),e.animate(n.id,"style").when(i,{pointList:[[n.style.xStart,n.style.yStart],[n._x||0,n._y||0]]}).start(a||"QuinticOut"))}var p=e("zrender/tool/util");return{pointList:t,rectangle:i,candle:a,ring:o,sector:r,text:s,polygon:l,ribbon:h,gaugePointer:m,icon:V,line:U,markline:d}}),n("echarts/util/ecEffect",["require","../util/ecData","zrender/shape/Circle","zrender/shape/Image","../util/shape/Icon","../util/shape/Symbol","zrender/tool/env"],function(e){function t(e,t,n,i){var o=n.effect,l=o.color||n.style.strokeColor||n.style.color,m=o.shadowColor||l,V=o.scaleSize,U="undefined"!=typeof o.shadowBlur?o.shadowBlur:V,d=new s({zlevel:i,style:{brushType:"stroke",iconType:"pin"!=n.style.iconType&&"droplet"!=n.style.iconType?n.style.iconType:"circle",x:U+1,y:U+1,n:n.style.n,width:n.style._width*V,height:n.style._height*V,lineWidth:1,strokeColor:l,shadowColor:m,shadowBlur:U},draggable:!1,hoverable:!1});h&&(d.style.image=e.shapeToImage(d,d.style.width+2*U+2,d.style.height+2*U+2).style.image,d=new r({zlevel:d.zlevel,style:d.style,draggable:!1,hoverable:!1})),a.clone(n,d),d.position=n.position,t.push(d),e.addShape(d);var p=window.devicePixelRatio||1,c=(d.style.width/p-n.style._width)/2;d.style.x=n.style._x-c,d.style.y=n.style._y-c;var u=100*(o.period+10*Math.random());e.modShape(n.id,{invisible:!0});var y=d.style.x+d.style.width/2/p,b=d.style.y+d.style.height/2/p;e.modShape(d.id,{scale:[.1,.1,y,b]}),e.animate(d.id,"",o.loop).when(u,{scale:[1,1,y,b]}).done(function(){n.effect.show=!1,e.delShape(d.id)}).start()}function n(e,t,n,i){var a=n.effect,o=a.color||n.style.strokeColor||n.style.color,r=a.scaleSize,s=a.shadowColor||o,h="undefined"!=typeof a.shadowBlur?a.shadowBlur:2*r,m=window.devicePixelRatio||1,V=new l({zlevel:i,position:n.position,scale:n.scale,style:{pointList:n.style.pointList,iconType:n.style.iconType,color:o,strokeColor:o,shadowColor:s,shadowBlur:h*m,random:!0,brushType:"fill",lineWidth:1,size:n.style.size},draggable:!1,hoverable:!1});t.push(V),e.addShape(V),e.modShape(n.id,{invisible:!0});for(var U=Math.round(100*a.period),d={},p={},c=0;20>c;c++)V.style["randomMap"+c]=0,d={},d["randomMap"+c]=100,p={},p["randomMap"+c]=0,V.style["randomMap"+c]=100*Math.random(),e.animate(V.id,"style",!0).when(U,d).when(2*U,p).when(3*U,d).when(4*U,d).delay(Math.random()*U*c).start()}function i(e,t,n,i){var s,l=n.effect,m=l.color||n.style.strokeColor||n.style.color,V=l.shadowColor||n.style.strokeColor||m,U=n.style.lineWidth*l.scaleSize,d="undefined"!=typeof l.shadowBlur?l.shadowBlur:U,p=new o({zlevel:i,style:{x:d,y:d,r:U,color:m,shadowColor:V,shadowBlur:d},draggable:!1,hoverable:!1});h?(p.style.image=e.shapeToImage(p,2*(U+d),2*(U+d)).style.image,p=new r({zlevel:p.zlevel,style:p.style,draggable:!1,hoverable:!1}),s=d):s=0,a.clone(n,p),p.position=n.position,t.push(p),e.addShape(p),p.style.x=n.style.xStart-s,p.style.y=n.style.yStart-s;var c=(n.style.xStart-n.style.xEnd)*(n.style.xStart-n.style.xEnd)+(n.style.yStart-n.style.yEnd)*(n.style.yStart-n.style.yEnd),u=Math.round(Math.sqrt(Math.round(c*l.period*l.period)));if(n.style.smooth){var y=n.style.pointList||n.getPointList(n.style),b=y.length;u=Math.round(u/b);for(var g=e.animate(p.id,"style",l.loop),k=Math.ceil(b/8),f=0;b-k>f;f+=k)g.when(u*(f+1),{x:y[f][0]-s,y:y[f][1]-s});g.when(u*b,{x:y[b-1][0]-s,y:y[b-1][1]-s}),g.done(function(){n.effect.show=!1,e.delShape(p.id)}),g.start("spline")}else e.animate(p.id,"style",l.loop).when(u,{x:n._x-s,y:n._y-s}).done(function(){n.effect.show=!1,e.delShape(p.id)}).start()}var a=e("../util/ecData"),o=e("zrender/shape/Circle"),r=e("zrender/shape/Image"),s=e("../util/shape/Icon"),l=e("../util/shape/Symbol"),h=e("zrender/tool/env").canvasSupported;return{point:t,largePoint:n,line:i}}),n("zrender/shape/Star",["require","../tool/math","./Base","../tool/util"],function(e){var t=e("../tool/math"),n=t.sin,i=t.cos,a=Math.PI,o=e("./Base"),r=function(e){o.call(this,e)};return r.prototype={type:"star",buildPath:function(e,t){var o=t.n;if(o&&!(2>o)){var r=t.x,s=t.y,l=t.r,h=t.r0;null==h&&(h=o>4?l*i(2*a/o)/i(a/o):l/3);var m=a/o,V=-a/2,U=r+l*i(V),d=s+l*n(V);V+=m;var p=t.pointList=[];p.push([U,d]);for(var c,u=0,y=2*o-1;y>u;u++)c=u%2===0?h:l,p.push([r+c*i(V),s+c*n(V)]),V+=m;p.push([U,d]),e.moveTo(p[0][0],p[0][1]);for(var u=0;u<p.length;u++)e.lineTo(p[u][0],p[u][1]);e.closePath()}},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(r,o),r}),n("zrender/shape/Heart",["require","./Base","./util/PathProxy","zrender/tool/area","../tool/util"],function(e){"use strict";var t=e("./Base"),n=e("./util/PathProxy"),i=e("zrender/tool/area"),a=function(e){t.call(this,e),this._pathProxy=new n};return a.prototype={type:"heart",buildPath:function(e,t){var i=this._pathProxy||new n;i.begin(e),i.moveTo(t.x,t.y),i.bezierCurveTo(t.x+t.a/2,t.y-2*t.b/3,t.x+2*t.a,t.y+t.b/3,t.x,t.y+t.b),i.bezierCurveTo(t.x-2*t.a,t.y+t.b/3,t.x-t.a/2,t.y-2*t.b/3,t.x,t.y),i.closePath()},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var a=this.getRect(this.style);return e>=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height?i.isInsidePath(this._pathProxy.pathCommands,this.style.lineWidth,this.style.brushType,e,t):void 0}},e("../tool/util").inherits(a,t),a}),n("zrender/shape/Droplet",["require","./Base","./util/PathProxy","zrender/tool/area","../tool/util"],function(e){"use strict";var t=e("./Base"),n=e("./util/PathProxy"),i=e("zrender/tool/area"),a=function(e){t.call(this,e),this._pathProxy=new n};return a.prototype={type:"droplet",buildPath:function(e,t){var i=this._pathProxy||new n;i.begin(e),i.moveTo(t.x,t.y+t.a),i.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+3*t.a/2,t.y-t.a/3,t.x,t.y-t.b),i.bezierCurveTo(t.x-3*t.a/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a),i.closePath()},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var a=this.getRect(this.style);return e>=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height?i.isInsidePath(this._pathProxy.pathCommands,this.style.lineWidth,this.style.brushType,e,t):void 0}},e("../tool/util").inherits(a,t),a}),n("zrender/tool/math",[],function(){function e(e,t){return Math.sin(t?e*a:e)}function t(e,t){return Math.cos(t?e*a:e)}function n(e){return e*a}function i(e){return e/a}var a=Math.PI/180;return{sin:e,cos:t,degreeToRadian:n,radianToDegree:i}}),n("zrender/shape/util/PathProxy",["require","../../tool/vector"],function(e){var t=e("../../tool/vector"),n=function(e,t){this.command=e,this.points=t||null},i=function(){this.pathCommands=[],this._ctx=null,this._min=[],this._max=[]};return i.prototype.fastBoundingRect=function(){var e=this._min,n=this._max;e[0]=e[1]=1/0,n[0]=n[1]=-1/0;for(var i=0;i<this.pathCommands.length;i++){var a=this.pathCommands[i],o=a.points;switch(a.command){case"M":t.min(e,e,o),t.max(n,n,o);break;case"L":t.min(e,e,o),t.max(n,n,o);break;case"C":for(var r=0;6>r;r+=2)e[0]=Math.min(e[0],e[0],o[r]),e[1]=Math.min(e[1],e[1],o[r+1]),n[0]=Math.max(n[0],n[0],o[r]),n[1]=Math.max(n[1],n[1],o[r+1]);break;case"Q":for(var r=0;4>r;r+=2)e[0]=Math.min(e[0],e[0],o[r]),e[1]=Math.min(e[1],e[1],o[r+1]),n[0]=Math.max(n[0],n[0],o[r]),n[1]=Math.max(n[1],n[1],o[r+1]);break;case"A":var s=o[0],l=o[1],h=o[2],m=o[3];e[0]=Math.min(e[0],e[0],s-h),e[1]=Math.min(e[1],e[1],l-m),n[0]=Math.max(n[0],n[0],s+h),n[1]=Math.max(n[1],n[1],l+m)}}return{x:e[0],y:e[1],width:n[0]-e[0],height:n[1]-e[1]}},i.prototype.begin=function(e){return this._ctx=e||null,this.pathCommands.length=0,this},i.prototype.moveTo=function(e,t){return this.pathCommands.push(new n("M",[e,t])),this._ctx&&this._ctx.moveTo(e,t),this},i.prototype.lineTo=function(e,t){return this.pathCommands.push(new n("L",[e,t])),this._ctx&&this._ctx.lineTo(e,t),this},i.prototype.bezierCurveTo=function(e,t,i,a,o,r){return this.pathCommands.push(new n("C",[e,t,i,a,o,r])),this._ctx&&this._ctx.bezierCurveTo(e,t,i,a,o,r),this},i.prototype.quadraticCurveTo=function(e,t,i,a){return this.pathCommands.push(new n("Q",[e,t,i,a])),this._ctx&&this._ctx.quadraticCurveTo(e,t,i,a),this},i.prototype.arc=function(e,t,i,a,o,r){return this.pathCommands.push(new n("A",[e,t,i,i,a,o-a,0,r?0:1])),this._ctx&&this._ctx.arc(e,t,i,a,o,r),this},i.prototype.arcTo=function(e,t,n,i,a){return this._ctx&&this._ctx.arcTo(e,t,n,i,a),this},i.prototype.rect=function(e,t,n,i){return this._ctx&&this._ctx.rect(e,t,n,i),this},i.prototype.closePath=function(){return this.pathCommands.push(new n("z")),this._ctx&&this._ctx.closePath(),this},i.prototype.isEmpty=function(){return 0===this.pathCommands.length},i.PathSegment=n,i}),n("zrender/shape/Line",["require","./Base","./util/dashedLineTo","../tool/util"],function(e){var t=e("./Base"),n=e("./util/dashedLineTo"),i=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return i.prototype={type:"line",buildPath:function(e,t){if(t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var i=(t.lineWidth||1)*("dashed"==t.lineType?5:1);n(e,t.xStart,t.yStart,t.xEnd,t.yEnd,i)}}else e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd)},getRect:function(e){if(e.__rect)return e.__rect;var t=e.lineWidth||1;return e.__rect={x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t},e.__rect}},e("../tool/util").inherits(i,t),i}),n("zrender/shape/BrokenLine",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),i=e("./util/smoothBezier"),a=e("./util/dashedLineTo"),o=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return o.prototype={type:"broken-line",buildPath:function(e,t){var o=t.pointList;if(!(o.length<2)){var r=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&"spline"!==t.smooth){var s=i(o,t.smooth,!1,t.smoothConstraint);e.moveTo(o[0][0],o[0][1]);for(var l,h,m,V=0;r-1>V;V++)l=s[2*V],h=s[2*V+1],m=o[V+1],e.bezierCurveTo(l[0],l[1],h[0],h[1],m[0],m[1])}else if("spline"===t.smooth&&(o=n(o),r=o.length),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var U=(t.lineWidth||1)*("dashed"==t.lineType?5:1);e.moveTo(o[0][0],o[0][1]);for(var V=1;r>V;V++)a(e,o[V-1][0],o[V-1][1],o[V][0],o[V][1],U)}}else{e.moveTo(o[0][0],o[0][1]);for(var V=1;r>V;V++)e.lineTo(o[V][0],o[V][1])}}},getRect:function(t){return e("./Polygon").prototype.getRect(t)}},e("../tool/util").inherits(o,t),o}),n("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,n,i,a,o,r){if(t.setLineDash)return e[0]=e[1]=r,t.setLineDash(e),t.moveTo(n,i),void t.lineTo(a,o);r="number"!=typeof r?5:r;var s=a-n,l=o-i,h=Math.floor(Math.sqrt(s*s+l*l)/r);s/=h,l/=h;for(var m=!0,V=0;h>V;++V)m?t.moveTo(n,i):t.lineTo(n,i),m=!m,n+=s,i+=l;t.lineTo(a,o)}}),n("zrender/shape/util/smoothSpline",["require","../../tool/vector"],function(e){function t(e,t,n,i,a,o,r){var s=.5*(n-e),l=.5*(i-t);return(2*(t-n)+s+l)*r+(-3*(t-n)-2*s-l)*o+s*a+t}var n=e("../../tool/vector");return function(e,i){for(var a=e.length,o=[],r=0,s=1;a>s;s++)r+=n.distance(e[s-1],e[s]);var l=r/5;l=a>l?a:l;for(var s=0;l>s;s++){var h,m,V,U=s/(l-1)*(i?a:a-1),d=Math.floor(U),p=U-d,c=e[d%a];i?(h=e[(d-1+a)%a],m=e[(d+1)%a],V=e[(d+2)%a]):(h=e[0===d?d:d-1],m=e[d>a-2?a-1:d+1],V=e[d>a-3?a-1:d+2]);var u=p*p,y=p*u;o.push([t(h[0],c[0],m[0],V[0],p,u,y),t(h[1],c[1],m[1],V[1],p,u,y)])}return o}}),n("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,i,a){var o,r,s,l,h=[],m=[],V=[],U=[],d=!!a;if(d){s=[1/0,1/0],l=[-1/0,-1/0];for(var p=0,c=e.length;c>p;p++)t.min(s,s,e[p]),t.max(l,l,e[p]);t.min(s,s,a[0]),t.max(l,l,a[1])}for(var p=0,c=e.length;c>p;p++){var o,r,u=e[p];if(i)o=e[p?p-1:c-1],r=e[(p+1)%c];else{if(0===p||p===c-1){h.push(e[p]);continue}o=e[p-1],r=e[p+1]}t.sub(m,r,o),t.scale(m,m,n);var y=t.distance(u,o),b=t.distance(u,r),g=y+b;0!==g&&(y/=g,b/=g),t.scale(V,m,-y),t.scale(U,m,b);var k=t.add([],u,V),f=t.add([],u,U);d&&(t.max(k,k,s),t.min(k,k,l),t.max(f,f,s),t.min(f,f,l)),h.push(k),h.push(f)}return i&&h.push(h.shift()),h}}),n("zrender/shape/Polygon",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),i=e("./util/smoothBezier"),a=e("./util/dashedLineTo"),o=function(e){t.call(this,e)};return o.prototype={type:"polygon",brush:function(e,t){var n=this.style;t&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),e.save(),this.setContext(e,n),this.setTransform(e);var i=!1;("fill"==n.brushType||"both"==n.brushType||"undefined"==typeof n.brushType)&&(e.beginPath(),"dashed"==n.lineType||"dotted"==n.lineType?(this.buildPath(e,{lineType:"solid",lineWidth:n.lineWidth,pointList:n.pointList}),i=!1):(this.buildPath(e,n),i=!0),e.closePath(),e.fill()),n.lineWidth>0&&("stroke"==n.brushType||"both"==n.brushType)&&(i||(e.beginPath(),this.buildPath(e,n)),e.stroke()),this.drawText(e,n,this.style),e.restore()},buildPath:function(e,t){var o=t.pointList;if(!(o.length<2))if(t.smooth&&"spline"!==t.smooth){var r=i(o,t.smooth,!0,t.smoothConstraint);e.moveTo(o[0][0],o[0][1]);for(var s,l,h,m=o.length,V=0;m>V;V++)s=r[2*V],l=r[2*V+1],h=o[(V+1)%m],e.bezierCurveTo(s[0],s[1],l[0],l[1],h[0],h[1])}else if("spline"===t.smooth&&(o=n(o,!0)),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var U=t._dashLength||(t.lineWidth||1)*("dashed"==t.lineType?5:1);t._dashLength=U,e.moveTo(o[0][0],o[0][1]);for(var V=1,d=o.length;d>V;V++)a(e,o[V-1][0],o[V-1][1],o[V][0],o[V][1],U);a(e,o[o.length-1][0],o[o.length-1][1],o[0][0],o[0][1],U)}}else{e.moveTo(o[0][0],o[0][1]);for(var V=1,d=o.length;d>V;V++)e.lineTo(o[V][0],o[V][1]);e.lineTo(o[0][0],o[0][1])}},getRect:function(e){if(e.__rect)return e.__rect;for(var t=Number.MAX_VALUE,n=Number.MIN_VALUE,i=Number.MAX_VALUE,a=Number.MIN_VALUE,o=e.pointList,r=0,s=o.length;s>r;r++)o[r][0]<t&&(t=o[r][0]),o[r][0]>n&&(n=o[r][0]),o[r][1]<i&&(i=o[r][1]),o[r][1]>a&&(a=o[r][1]);var l;return l="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(t-l/2),y:Math.round(i-l/2),width:n-t+l,height:a-i+l},e.__rect}},e("../tool/util").inherits(o,t),o}),n("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.__rect;return i||(i=this.style.__rect=this.getRect(this.style)),e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height}}),n("echarts/component/dataView",["require","./base","../config","zrender/tool/util","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.dom=o.dom,this._tDom=document.createElement("div"),this._textArea=document.createElement("textArea"),this._buttonRefresh=document.createElement("button"),this._buttonClose=document.createElement("button"),this._hasShow=!1,this._zrHeight=i.getHeight(),this._zrWidth=i.getWidth(),this._tDom.className="echarts-dataview",this.hide(),this.dom.firstChild.appendChild(this._tDom),window.addEventListener?(this._tDom.addEventListener("click",this._stop),this._tDom.addEventListener("mousewheel",this._stop),this._tDom.addEventListener("mousemove",this._stop),this._tDom.addEventListener("mousedown",this._stop),this._tDom.addEventListener("mouseup",this._stop),this._tDom.addEventListener("touchstart",this._stop),this._tDom.addEventListener("touchmove",this._stop),this._tDom.addEventListener("touchend",this._stop)):(this._tDom.attachEvent("onclick",this._stop),this._tDom.attachEvent("onmousewheel",this._stop),this._tDom.attachEvent("onmousemove",this._stop),this._tDom.attachEvent("onmousedown",this._stop),this._tDom.attachEvent("onmouseup",this._stop))}var n=e("./base"),i=e("../config"),a=e("zrender/tool/util");return t.prototype={type:i.COMPONENT_TYPE_DATAVIEW,_lang:["Data View","close","refresh"],_gCssText:"position:absolute;display:block;overflow:hidden;transition:height 0.8s,background-color 1s;-moz-transition:height 0.8s,background-color 1s;-webkit-transition:height 0.8s,background-color 1s;-o-transition:height 0.8s,background-color 1s;z-index:1;left:0;top:0;",hide:function(){this._sizeCssText="width:"+this._zrWidth+"px;height:0px;background-color:#f0ffff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},show:function(e){this._hasShow=!0;var t=this.query(this.option,"toolbox.feature.dataView.lang")||this._lang;this.option=e,this._tDom.innerHTML='<p style="padding:8px 0;margin:0 0 10px 0;border-bottom:1px solid #eee">'+(t[0]||this._lang[0])+"</p>",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;height:"+(this._zrHeight-100)+"px;";var n=this.query(this.option,"toolbox.feature.dataView.optionToContent");this._textArea.value="function"!=typeof n?this._optionToContent():n(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var i=this;this._buttonClose.onclick=function(){i.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){i._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;height:"+this._zrHeight+"px;background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,n,a,o,r,s=[],l="";if(this.option.xAxis)for(s=this.option.xAxis instanceof Array?this.option.xAxis:[this.option.xAxis],e=0,a=s.length;a>e;e++)if("category"==(s[e].type||"category")){for(r=[],t=0,n=s[e].data.length;n>t;t++)o=s[e].data[t],r.push("undefined"!=typeof o.value?o.value:o);l+=r.join(", ")+"\n\n"}if(this.option.yAxis)for(s=this.option.yAxis instanceof Array?this.option.yAxis:[this.option.yAxis],e=0,a=s.length;a>e;e++)if("category"==s[e].type){for(r=[],t=0,n=s[e].data.length;n>t;t++)o=s[e].data[t],r.push("undefined"!=typeof o.value?o.value:o);l+=r.join(", ")+"\n\n"}var h,m=this.option.series;for(e=0,a=m.length;a>e;e++){for(r=[],t=0,n=m[e].data.length;n>t;t++)o=m[e].data[t],h=m[e].type==i.CHART_TYPE_PIE||m[e].type==i.CHART_TYPE_MAP?(o.name||"-")+":":"",m[e].type==i.CHART_TYPE_SCATTER&&(o="undefined"!=typeof o.value?o.value:o,o=o.join(", ")),r.push(h+("undefined"!=typeof o.value?o.value:o));l+=(m[e].name||"-")+" : \n",l+=r.join(m[e].type==i.CHART_TYPE_SCATTER?"\n":", "),l+="\n\n"}return l},_save:function(){var e=this._textArea.value,t=this.query(this.option,"toolbox.feature.dataView.contentToOption");if("function"!=typeof t){e=e.split("\n");for(var n=[],a=0,o=e.length;o>a;a++)e[a]=this._trim(e[a]),""!==e[a]&&n.push(e[a]);this._contentToOption(n)}else t(e,this.option);this.hide();var r=this;setTimeout(function(){r.messageCenter&&r.messageCenter.dispatch(i.EVENT.DATA_VIEW_CHANGED,null,{option:r.option},r.myChart)},r.canvasSupported?800:100)},_contentToOption:function(e){var t,n,a,o,r,s,l,h=[],m=0;if(this.option.xAxis)for(h=this.option.xAxis instanceof Array?this.option.xAxis:[this.option.xAxis],t=0,o=h.length;o>t;t++)if("category"==(h[t].type||"category")){for(s=e[m].split(","),n=0,a=h[t].data.length;a>n;n++)l=this._trim(s[n]||""),r=h[t].data[n],"undefined"!=typeof h[t].data[n].value?h[t].data[n].value=l:h[t].data[n]=l;m++}if(this.option.yAxis)for(h=this.option.yAxis instanceof Array?this.option.yAxis:[this.option.yAxis],t=0,o=h.length;o>t;t++)if("category"==h[t].type){for(s=e[m].split(","),n=0,a=h[t].data.length;a>n;n++)l=this._trim(s[n]||""),r=h[t].data[n],"undefined"!=typeof h[t].data[n].value?h[t].data[n].value=l:h[t].data[n]=l;m++}var V=this.option.series;for(t=0,o=V.length;o>t;t++)if(m++,V[t].type==i.CHART_TYPE_SCATTER)for(var n=0,a=V[t].data.length;a>n;n++)s=e[m],l=s.replace(" ","").split(","),"undefined"!=typeof V[t].data[n].value?V[t].data[n].value=l:V[t].data[n]=l,m++;else{s=e[m].split(",");for(var n=0,a=V[t].data.length;a>n;n++)l=(s[n]||"").replace(/.*:/,""),l=this._trim(l),l="-"!=l&&""!==l?l-0:"-","undefined"!=typeof V[t].data[n].value?V[t].data[n].value=l:V[t].data[n]=l;m++}},_trim:function(e){var t=new RegExp("(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+$)","g");return e.replace(t,"")},_stop:function(e){e=e||window.event,e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},resize:function(){this._zrHeight=this.zr.getHeight(),this._zrWidth=this.zr.getWidth(),this._tDom.offsetHeight>10&&(this._sizeCssText="width:"+this._zrWidth+"px;height:"+this._zrHeight+"px;background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;height:"+(this._zrHeight-100)+"px;")},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},a.inherits(t,n),e("../component").define("dataView",t),t}),n("echarts/util/shape/Cross",["require","zrender/shape/Base","zrender/shape/Line","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/Line"),a=e("zrender/tool/util");return t.prototype={type:"cross",buildPath:function(e,t){var n=t.rect;t.xStart=n.x,t.xEnd=n.x+n.width,t.yStart=t.yEnd=t.y,i.prototype.buildPath(e,t),t.xStart=t.xEnd=t.x,t.yStart=n.y,t.yEnd=n.y+n.height,i.prototype.buildPath(e,t)},getRect:function(e){return e.rect},isCover:e("./normalIsCover")},a.inherits(t,n),t}),n("zrender/shape/Sector",["require","../tool/math","../tool/computeBoundingBox","../tool/vector","./Base","../tool/util"],function(e){var t=e("../tool/math"),n=e("../tool/computeBoundingBox"),i=e("../tool/vector"),a=e("./Base"),o=i.create(),r=i.create(),s=i.create(),l=i.create(),h=function(e){a.call(this,e)};return h.prototype={type:"sector",buildPath:function(e,n){var i=n.x,a=n.y,o=n.r0||0,r=n.r,s=n.startAngle,l=n.endAngle,h=n.clockWise||!1;s=t.degreeToRadian(s),l=t.degreeToRadian(l),h||(s=-s,l=-l);var m=t.cos(s),V=t.sin(s);e.moveTo(m*o+i,V*o+a),e.lineTo(m*r+i,V*r+a),e.arc(i,a,r,s,l,!h),e.lineTo(t.cos(l)*o+i,t.sin(l)*o+a),0!==o&&e.arc(i,a,o,l,s,h),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var a=e.x,h=e.y,m=e.r0||0,V=e.r,U=t.degreeToRadian(e.startAngle),d=t.degreeToRadian(e.endAngle),p=e.clockWise;return p||(U=-U,d=-d),m>1?n.arc(a,h,m,U,d,!p,o,s):(o[0]=s[0]=a,o[1]=s[1]=h),n.arc(a,h,V,U,d,!p,r,l),i.min(o,o,r),i.max(s,s,l),e.__rect={x:o[0],y:o[1],width:s[0]-o[0],height:s[1]-o[1]},e.__rect}},e("../tool/util").inherits(h,a),h}),n("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/tool/util");return t.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var n=i.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,n[3]),e.lineTo(t.x,n[2]),e.moveTo(t.x-t.width/2,n[2]),e.rect(t.x-t.width/2,n[2],t.width,n[1]-n[2]),e.moveTo(t.x,n[1]),e.lineTo(t.x,n[0])},getRect:function(e){if(!e.__rect){var t=0;("stroke"==e.brushType||"fill"==e.brushType)&&(t=e.lineWidth||1);var n=i.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(n[3]-t/2),width:e.width+t,height:n[0]-n[3]+t}}return e.__rect},isCover:e("./normalIsCover")},i.inherits(t,n),t}),n("zrender/tool/computeBoundingBox",["require","./vector","./curve"],function(e){function t(e,t,n){if(0!==e.length){for(var i=e[0][0],a=e[0][0],o=e[0][1],r=e[0][1],s=1;s<e.length;s++){var l=e[s];l[0]<i&&(i=l[0]),l[0]>a&&(a=l[0]),l[1]<o&&(o=l[1]),l[1]>r&&(r=l[1])}t[0]=i,t[1]=o,n[0]=a,n[1]=r}}function n(e,t,n,i,a,r){var s=[];o.cubicExtrema(e[0],t[0],n[0],i[0],s);for(var l=0;l<s.length;l++)s[l]=o.cubicAt(e[0],t[0],n[0],i[0],s[l]);var h=[];o.cubicExtrema(e[1],t[1],n[1],i[1],h);for(var l=0;l<h.length;l++)h[l]=o.cubicAt(e[1],t[1],n[1],i[1],h[l]);s.push(e[0],i[0]),h.push(e[1],i[1]);var m=Math.min.apply(null,s),V=Math.max.apply(null,s),U=Math.min.apply(null,h),d=Math.max.apply(null,h);a[0]=m,a[1]=U,r[0]=V,r[1]=d}function i(e,t,n,i,a){var r=o.quadraticExtremum(e[0],t[0],n[0]),s=o.quadraticExtremum(e[1],t[1],n[1]);r=Math.max(Math.min(r,1),0),s=Math.max(Math.min(s,1),0);var l=1-r,h=1-s,m=l*l*e[0]+2*l*r*t[0]+r*r*n[0],V=l*l*e[1]+2*l*r*t[1]+r*r*n[1],U=h*h*e[0]+2*h*s*t[0]+s*s*n[0],d=h*h*e[1]+2*h*s*t[1]+s*s*n[1];i[0]=Math.min(e[0],n[0],m,U),i[1]=Math.min(e[1],n[1],V,d),a[0]=Math.max(e[0],n[0],m,U),a[1]=Math.max(e[1],n[1],V,d)}var a=e("./vector"),o=e("./curve"),r=a.create(),s=a.create(),l=a.create(),h=function(e,t,n,i,o,h,m,V){if(r[0]=Math.cos(i)*n+e,r[1]=Math.sin(i)*n+t,s[0]=Math.cos(o)*n+e,s[1]=Math.sin(o)*n+t,a.min(m,r,s),a.max(V,r,s),i%=2*Math.PI,0>i&&(i+=2*Math.PI),o%=2*Math.PI,0>o&&(o+=2*Math.PI),i>o&&!h?o+=2*Math.PI:o>i&&h&&(i+=2*Math.PI),h){var U=o;o=i,i=U}for(var d=0;o>d;d+=Math.PI/2)d>i&&(l[0]=Math.cos(d)*n+e,l[1]=Math.sin(d)*n+t,a.min(m,l,m),a.max(V,l,V))};return t.cubeBezier=n,t.quadraticBezier=i,t.arc=h,t}),n("echarts/util/shape/Chain",["require","zrender/shape/Base","./Icon","zrender/shape/util/dashedLineTo","zrender/tool/util","zrender/tool/matrix"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("./Icon"),a=e("zrender/shape/util/dashedLineTo"),o=e("zrender/tool/util"),r=e("zrender/tool/matrix");return t.prototype={type:"chain",brush:function(e,t){var n=this.style;t&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),e.save(),this.setContext(e,n),this.setTransform(e),e.save(),e.beginPath(),this.buildLinePath(e,n),e.stroke(),e.restore(),this.brushSymbol(e,n),e.restore()},buildLinePath:function(e,t){var n=t.x,i=t.y+5,o=t.width,r=t.height/2-10;if(e.moveTo(n,i),e.lineTo(n,i+r),e.moveTo(n+o,i),e.lineTo(n+o,i+r),e.moveTo(n,i+r/2),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var s=(t.lineWidth||1)*("dashed"==t.lineType?5:1);a(e,n,i+r/2,n+o,i+r/2,s)}}else e.lineTo(n+o,i+r/2)},brushSymbol:function(e,t){var n=t.y+t.height/4;e.save();for(var a,o=t.chainPoint,r=0,s=o.length;s>r;r++){if(a=o[r],"none"!=a.symbol){e.beginPath();var l=a.symbolSize;i.prototype.buildPath(e,{iconType:a.symbol,x:a.x-l,y:n-l,width:2*l,height:2*l,n:a.n}),e.fillStyle=a.isEmpty?"#fff":t.strokeColor,e.closePath(),e.fill(),e.stroke()}a.showLabel&&(e.font=a.textFont,e.fillStyle=a.textColor,e.textAlign=a.textAlign,e.textBaseline=a.textBaseline,a.rotation?(e.save(),this._updateTextTransform(e,a.rotation),e.fillText(a.name,a.textX,a.textY),e.restore()):e.fillText(a.name,a.textX,a.textY))}e.restore()},_updateTextTransform:function(e,t){var n=r.create();if(r.identity(n),0!==t[0]){var i=t[1]||0,a=t[2]||0;(i||a)&&r.translate(n,n,[-i,-a]),r.rotate(n,n,t[0]),(i||a)&&r.translate(n,n,[i,a])}e.transform.apply(e,n)},isCover:function(e,t){var n=this.style;return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},o.inherits(t,n),t}),n("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,2*Math.PI,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,2*Math.PI,!0)},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function t(e,t,i,a,o,r){n.call(this,e,t,i,a,o),this.axisType=r,this._axisList=[],this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Line"),a=e("../config"),o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,n={_axisShape:"axisLine",zlevel:this._zlevelBase+1,hoverable:!1};switch(this.option.position){case"left":n.style={xStart:this.grid.getX()-t,yStart:this.grid.getYend(),xEnd:this.grid.getX()-t,yEnd:this.grid.getY(),lineCap:"round"};break;case"right":n.style={xStart:this.grid.getXend()+t,yStart:this.grid.getYend(),xEnd:this.grid.getXend()+t,yEnd:this.grid.getY(),lineCap:"round"};break;case"bottom":n.style={xStart:this.grid.getX(),yStart:this.grid.getYend()+t,xEnd:this.grid.getXend(),yEnd:this.grid.getYend()+t,lineCap:"round"};break;case"top":n.style={xStart:this.grid.getX(),yStart:this.grid.getY()-t,xEnd:this.grid.getXend(),yEnd:this.grid.getY()-t,lineCap:"round"}}""!==this.option.name&&(n.style.text=this.option.name,n.style.textPosition=this.option.nameLocation,n.style.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(n.style.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(n.style.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(n.style.textColor=this.option.nameTextStyle.color)),n.style.strokeColor=this.option.axisLine.lineStyle.color,n.style.lineWidth=e,this.isHorizontal()?n.style.yStart=n.style.yEnd=this.subPixelOptimize(n.style.yEnd,e):n.style.xStart=n.style.xEnd=this.subPixelOptimize(n.style.xEnd,e),n.style.lineType=this.option.axisLine.lineStyle.type,n=new i(n),this.shapeList.push(n)},_axisLabelClickable:function(e,t){return e?(o.pack(t,void 0,-1,void 0,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:s.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(this.option.axisLine.onZero){var n;if(this.isHorizontal()&&null!=t)for(var i=0,a=this.shapeList.length;a>i;i++)"axisLine"===this.shapeList[i]._axisShape?(this.shapeList[i].style.yStart=this.shapeList[i].style.yEnd=this.subPixelOptimize(t,this.shapeList[i].stylelineWidth),this.zr.modShape(this.shapeList[i].id)):"axisTick"===this.shapeList[i]._axisShape&&(n=this.shapeList[i].style.yEnd-this.shapeList[i].style.yStart,this.shapeList[i].style.yStart=t-n,this.shapeList[i].style.yEnd=t,this.zr.modShape(this.shapeList[i].id)); |
|
10 | if(!this.isHorizontal()&&null!=e)for(var i=0,a=this.shapeList.length;a>i;i++)"axisLine"===this.shapeList[i]._axisShape?(this.shapeList[i].style.xStart=this.shapeList[i].style.xEnd=this.subPixelOptimize(e,this.shapeList[i].stylelineWidth),this.zr.modShape(this.shapeList[i].id)):"axisTick"===this.shapeList[i]._axisShape&&(n=this.shapeList[i].style.xEnd-this.shapeList[i].style.xStart,this.shapeList[i].style.xStart=e,this.shapeList[i].style.xEnd=e+n,this.zr.modShape(this.shapeList[i].id))}},getPosition:function(){return this.option.position},isHorizontal:function(){return"bottom"===this.option.position||"top"===this.option.position}},reformOption:function(e){if(!e||e instanceof Array&&0===e.length?e=[{type:a.COMPONENT_TYPE_AXIS_VALUE}]:e instanceof Array||(e=[e]),e.length>2&&(e=[e[0],e[1]]),"xAxis"===this.axisType){(!e[0].position||"bottom"!=e[0].position&&"top"!=e[0].position)&&(e[0].position="bottom"),e.length>1&&(e[1].position="bottom"===e[0].position?"top":"bottom");for(var t=0,n=e.length;n>t;t++)e[t].type=e[t].type||"category",e[t].xAxisIndex=t,e[t].yAxisIndex=-1}else{(!e[0].position||"left"!=e[0].position&&"right"!=e[0].position)&&(e[0].position="left"),e.length>1&&(e[1].position="left"===e[0].position?"right":"left");for(var t=0,n=e.length;n>t;t++)e[t].type=e[t].type||"value",e[t].xAxisIndex=-1,e[t].yAxisIndex=t}return e},refresh:function(t){var n;t&&(this.option=t,"xAxis"===this.axisType?(this.option.xAxis=this.reformOption(t.xAxis),n=this.option.xAxis):(this.option.yAxis=this.reformOption(t.yAxis),n=this.option.yAxis),this.series=t.series);for(var i=e("./categoryAxis"),a=e("./valueAxis"),o=Math.max(n&&n.length||0,this._axisList.length),r=0;o>r;r++)!this._axisList[r]||!t||n[r]&&this._axisList[r].type==n[r].type||(this._axisList[r].dispose&&this._axisList[r].dispose(),this._axisList[r]=!1),this._axisList[r]?this._axisList[r].refresh&&this._axisList[r].refresh(n?n[r]:!1,this.series):n&&n[r]&&(this._axisList[r]="category"===n[r].type?new i(this.ecTheme,this.messageCenter,this.zr,n[r],this.myChart,this.axisBase):new a(this.ecTheme,this.messageCenter,this.zr,n[r],this.myChart,this.axisBase,this.series))},getAxis:function(e){return this._axisList[e]},clear:function(){for(var e=0,t=this._axisList.length;t>e;e++)this._axisList[e].dispose&&this._axisList[e].dispose();this._axisList=[]}},r.inherits(t,n),e("../component").define("axis",t),t}),n("echarts/component/grid",["require","./base","zrender/shape/Rectangle","../config","zrender/tool/util","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Rectangle"),a=e("../config"),o=e("zrender/tool/util");return t.prototype={type:a.COMPONENT_TYPE_GRID,getX:function(){return this._x},getY:function(){return this._y},getWidth:function(){return this._width},getHeight:function(){return this._height},getXend:function(){return this._x+this._width},getYend:function(){return this._y+this._height},getArea:function(){return{x:this._x,y:this._y,width:this._width,height:this._height}},getBbox:function(){return[[this._x,this._y],[this.getXend(),this.getYend()]]},refixAxisShape:function(e){for(var t,n,i,o=e.xAxis._axisList.concat(e.yAxis?e.yAxis._axisList:[]),r=o.length;r--;)i=o[r],i.type==a.COMPONENT_TYPE_AXIS_VALUE&&i._min<0&&i._max>=0&&(i.isHorizontal()?t=i.getCoord(0):n=i.getCoord(0));if("undefined"!=typeof t||"undefined"!=typeof n)for(r=o.length;r--;)o[r].refixAxisShape(t,n)},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var n=this.parsePercent(t.x2,this._zrWidth),a=this.parsePercent(t.y2,this._zrHeight);this._width="undefined"==typeof t.width?this._zrWidth-this._x-n:this.parsePercent(t.width,this._zrWidth),this._width=this._width<=0?10:this._width,this._height="undefined"==typeof t.height?this._zrHeight-this._y-a:this.parsePercent(t.height,this._zrHeight),this._height=this._height<=0?10:this._height,this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new i({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},o.inherits(t,n),e("../component").define("grid",t),t}),n("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","../util/date","zrender/tool/util","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o);var r=this;r._ondrift=function(e,t){return r.__ondrift(this,e,t)},r._ondragend=function(){return r.__ondragend()},this._fillerSize=28,this._handleSize=8,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this.myChart.canvasSupported||(this.zoomOption.realtime=!1),this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var n=e("./base"),i=e("zrender/shape/Rectangle"),a=e("zrender/shape/Polygon"),o=e("../util/shape/Icon"),r=e("../config"),s=e("../util/date"),l=e("zrender/tool/util");return t.prototype={type:r.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e]);this._syncFrameShape()},_getLocation:function(){var e,t,n,i,a=this.component.grid;return"horizontal"==this.zoomOption.orient?(n=this.zoomOption.width||a.getWidth(),i=this.zoomOption.height||this._fillerSize,e=null!=this.zoomOption.x?this.zoomOption.x:a.getX(),t=null!=this.zoomOption.y?this.zoomOption.y:this.zr.getHeight()-i-2):(n=this.zoomOption.width||this._fillerSize,i=this.zoomOption.height||a.getHeight(),e=null!=this.zoomOption.x?this.zoomOption.x:2,t=null!=this.zoomOption.y?this.zoomOption.y:a.getY()),{x:e,y:t,width:n,height:i}},_getZoom:function(){var e=this.option.series,t=this.option.xAxis;!t||t instanceof Array||(t=[t],this.option.xAxis=t);var n=this.option.yAxis;!n||n instanceof Array||(n=[n],this.option.yAxis=n);var i,a,o=[],s=this.zoomOption.xAxisIndex;if(t&&null==s){i=[];for(var l=0,h=t.length;h>l;l++)("category"==t[l].type||null==t[l].type)&&i.push(l)}else i=s instanceof Array?s:null!=s?[s]:[];if(s=this.zoomOption.yAxisIndex,n&&null==s){a=[];for(var l=0,h=n.length;h>l;l++)"category"==n[l].type&&a.push(l)}else a=s instanceof Array?s:null!=s?[s]:[];for(var m,l=0,h=e.length;h>l;l++)if(m=e[l],m.type==r.CHART_TYPE_LINE||m.type==r.CHART_TYPE_BAR||m.type==r.CHART_TYPE_SCATTER||m.type==r.CHART_TYPE_K){for(var V=0,U=i.length;U>V;V++)if(i[V]==(m.xAxisIndex||0)){o.push(l);break}for(var V=0,U=a.length;U>V;V++)if(a[V]==(m.yAxisIndex||0)){o.push(l);break}null==this.zoomOption.xAxisIndex&&null==this.zoomOption.yAxisIndex&&m.data&&m.data[0]&&m.data[0]instanceof Array&&(m.type==r.CHART_TYPE_SCATTER||m.type==r.CHART_TYPE_LINE||m.type==r.CHART_TYPE_BAR)&&o.push(l)}var d=null!=this._zoom.start?this._zoom.start:null!=this.zoomOption.start?this.zoomOption.start:0,p=null!=this._zoom.end?this._zoom.end:null!=this.zoomOption.end?this.zoomOption.end:100;d>p&&(d+=p,p=d-p,d-=p);var c=Math.round((p-d)/100*("horizontal"==this.zoomOption.orient?this._location.width:this._location.height));return{start:d,end:p,start2:0,end2:100,size:c,xAxisIndex:i,yAxisIndex:a,seriesIndex:o,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};for(var e=this.option.xAxis,t=this._zoom.xAxisIndex,n=0,i=t.length;i>n;n++)this._originalData.xAxis[t[n]]=e[t[n]].data;for(var a=this.option.yAxis,o=this._zoom.yAxisIndex,n=0,i=o.length;i>n;n++)this._originalData.yAxis[o[n]]=a[o[n]].data;for(var s,l=this.option.series,h=this._zoom.seriesIndex,n=0,i=h.length;i>n;n++)s=l[h[n]],this._originalData.series[h[n]]=s.data,s.data&&s.data[0]&&s.data[0]instanceof Array&&(s.type==r.CHART_TYPE_SCATTER||s.type==r.CHART_TYPE_LINE||s.type==r.CHART_TYPE_BAR)&&(this._backupScale(),this._calculScatterMap(h[n]))},_calculScatterMap:function(t){this._zoom.scatterMap=this._zoom.scatterMap||{},this._zoom.scatterMap[t]=this._zoom.scatterMap[t]||{};var n=e("../component"),i=n.get("axis"),a=l.clone(this.option.xAxis);"category"==a[0].type&&(a[0].type="value"),a[1]&&"category"==a[1].type&&(a[1].type="value");var o=new i(this.ecTheme,null,!1,{xAxis:a,series:this.option.series},this,"xAxis"),r=this.option.series[t].xAxisIndex||0;this._zoom.scatterMap[t].x=o.getAxis(r).getExtremum(),o.dispose(),a=l.clone(this.option.yAxis),"category"==a[0].type&&(a[0].type="value"),a[1]&&"category"==a[1].type&&(a[1].type="value"),o=new i(this.ecTheme,null,!1,{yAxis:a,series:this.option.series},this,"yAxis"),r=this.option.series[t].yAxisIndex||0,this._zoom.scatterMap[t].y=o.getAxis(r).getExtremum(),o.dispose()},_buildBackground:function(){var e=this._location.width,t=this._location.height;this.shapeList.push(new i({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._location.x,y:this._location.y,width:e,height:t,color:this.zoomOption.backgroundColor}}));for(var n=0,o=this._originalData.xAxis,s=this._zoom.xAxisIndex,l=0,h=s.length;h>l;l++)n=Math.max(n,o[s[l]].length);for(var m=this._originalData.yAxis,V=this._zoom.yAxisIndex,l=0,h=V.length;h>l;l++)n=Math.max(n,m[V[l]].length);for(var U,d=this._zoom.seriesIndex[0],p=this._originalData.series[d],c=Number.MIN_VALUE,u=Number.MAX_VALUE,l=0,h=p.length;h>l;l++)U=null!=p[l]?null!=p[l].value?p[l].value:p[l]:0,this.option.series[d].type==r.CHART_TYPE_K&&(U=U[1]),isNaN(U)&&(U=0),c=Math.max(c,U),u=Math.min(u,U);var y=c-u,b=[],g=e/(n-(n>1?1:0)),k=t/(n-(n>1?1:0)),f=1;"horizontal"==this.zoomOption.orient&&1>g?f=Math.floor(3*n/e):"vertical"==this.zoomOption.orient&&1>k&&(f=Math.floor(3*n/t));for(var l=0,h=n;h>l;l+=f)U=null!=p[l]?null!=p[l].value?p[l].value:p[l]:0,this.option.series[d].type==r.CHART_TYPE_K&&(U=U[1]),isNaN(U)&&(U=0),b.push("horizontal"==this.zoomOption.orient?[this._location.x+g*l,this._location.y+t-1-Math.round((U-u)/y*(t-10))]:[this._location.x+1+Math.round((U-u)/y*(e-10)),this._location.y+k*l]);"horizontal"==this.zoomOption.orient?(b.push([this._location.x+e,this._location.y+t]),b.push([this._location.x,this._location.y+t])):(b.push([this._location.x,this._location.y+t]),b.push([this._location.x,this._location.y])),this.shapeList.push(new a({zlevel:this._zlevelBase,style:{pointList:b,color:this.zoomOption.dataBackgroundColor},hoverable:!1}))},_buildFiller:function(){this._fillerShae={zlevel:this._zlevelBase,draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,_type:"filler"},this._fillerShae.style="horizontal"==this.zoomOption.orient?{x:this._location.x+Math.round(this._zoom.start/100*this._location.width)+this._handleSize,y:this._location.y,width:this._zoom.size-2*this._handleSize,height:this._location.height,color:this.zoomOption.fillerColor,text:":::",textPosition:"inside"}:{x:this._location.x,y:this._location.y+Math.round(this._zoom.start/100*this._location.height)+this._handleSize,width:this._location.width,height:this._zoom.size-2*this._handleSize,color:this.zoomOption.fillerColor,text:"::",textPosition:"inside"},this._fillerShae.highlightStyle={brushType:"fill",color:"rgba(0,0,0,0)"},this._fillerShae=new i(this._fillerShae),this.shapeList.push(this._fillerShae)},_buildHandle:function(){this._startShape={zlevel:this._zlevelBase,draggable:!0,style:{iconType:"rectangle",x:this._location.x,y:this._location.y,width:this._handleSize,height:this._handleSize,color:this.zoomOption.handleColor,text:"=",textPosition:"inside"},highlightStyle:{text:"",brushType:"fill",textPosition:"left"},ondrift:this._ondrift,ondragend:this._ondragend},"horizontal"==this.zoomOption.orient?(this._startShape.style.height=this._location.height,this._endShape=l.clone(this._startShape),this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endShape.highlightStyle.textPosition="right"):(this._startShape.style.width=this._location.width,this._endShape=l.clone(this._startShape),this._startShape.style.y=this._fillerShae.style.y-this._handleSize,this._startShape.highlightStyle.textPosition="top",this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endShape.highlightStyle.textPosition="bottom"),this._startShape=new o(this._startShape),this._endShape=new o(this._endShape),this.shapeList.push(this._startShape),this.shapeList.push(this._endShape)},_buildFrame:function(){var e=this.subPixelOptimize(this._location.x,1),t=this.subPixelOptimize(this._location.y,1);this._startFrameShape={zlevel:this._zlevelBase,hoverable:!1,style:{x:e,y:t,width:this._location.width-(e>this._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=l.clone(this._startFrameShape),this._startFrameShape=new i(this._startFrameShape),this._endFrameShape=new i(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape)},_syncHandleShape:function(){"horizontal"==this.zoomOption.orient?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=Math.floor((this._startShape.style.x-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100)):(this._startShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._zoom.start=Math.floor((this._startShape.style.y-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((this._endShape.style.y+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refresh()},_syncFillerShape:function(){var e,t;"horizontal"==this.zoomOption.orient?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100)):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncFrameShape:function(){"horizontal"==this.zoomOption.orient?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.height=this._fillerShae.style.y-this._location.y,this._endFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endFrameShape.style.height=this._location.y+this._location.height-this._endFrameShape.style.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){this.zoomOption.show&&("horizontal"==this.zoomOption.orient?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._startShape.style.y+this._handleSize,this._fillerShae.style.height=this._endShape.style.y-this._startShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh())},_syncData:function(e){var t,n,i,a,o;for(var s in this._originalData){t=this._originalData[s];for(var l in t)o=t[l],null!=o&&(a=o.length,n=Math.floor(this._zoom.start/100*a),i=Math.ceil(this._zoom.end/100*a),this.option[s][l].data[0]instanceof Array&&this.option[s][l].type!=r.CHART_TYPE_K?(this._setScale(),this.option[s][l].data=this._synScatterData(l,o)):this.option[s][l].data=o.slice(n,i))}this._isSilence||!this.zoomOption.realtime&&!e||this.messageCenter.dispatch(r.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(0===this._zoom.start&&100==this._zoom.end&&0===this._zoom.start2&&100==this._zoom.end2)return t;var n,i,a,o,r,s=[],l=this._zoom.scatterMap[e];"horizontal"==this.zoomOption.orient?(n=l.x.max-l.x.min,i=this._zoom.start/100*n+l.x.min,a=this._zoom.end/100*n+l.x.min,n=l.y.max-l.y.min,o=this._zoom.start2/100*n+l.y.min,r=this._zoom.end2/100*n+l.y.min):(n=l.x.max-l.x.min,i=this._zoom.start2/100*n+l.x.min,a=this._zoom.end2/100*n+l.x.min,n=l.y.max-l.y.min,o=this._zoom.start/100*n+l.y.min,r=this._zoom.end/100*n+l.y.min);for(var h,m=0,V=t.length;V>m;m++)h=t[m].value||t[m],h[0]>=i&&h[0]<=a&&h[1]>=o&&h[1]<=r&&s.push(t[m]);return s},_setScale:function(){var e=0!==this._zoom.start||100!==this._zoom.end||0!==this._zoom.start2||100!==this._zoom.end2,t={xAxis:this.option.xAxis,yAxis:this.option.yAxis};for(var n in t)for(var i=0,a=t[n].length;a>i;i++)t[n][i].scale=e||t[n][i]._scale},_backupScale:function(){var e={xAxis:this.option.xAxis,yAxis:this.option.yAxis};for(var t in e)for(var n=0,i=e[t].length;i>n;n++)e[t][n]._scale=e[t][n].scale},_getDetail:function(){var e="horizontal"==this.zoomOption.orient?"xAxis":"yAxis",t=this._originalData[e];for(var n in t){var i=t[n];if(null!=i){var a=i.length,o=Math.floor(this._zoom.start/100*a),r=Math.ceil(this._zoom.end/100*a);return r-=r>=a?1:0,{start:null!=i[o].value?i[o].value:i[o],end:null!=i[r].value?i[r].value:i[r]}}}var l=this._zoom.seriesIndex[0],h=this.option.series[l][e+"Index"]||0,m=this.option[e][h].type,V=this._zoom.scatterMap[l][e.charAt(0)].min,U=this._zoom.scatterMap[l][e.charAt(0)].max,d=U-V;if("value"==m)return{start:V+d*this._zoom.start/100,end:V+d*this._zoom.end/100};if("time"==m){U=V+d*this._zoom.end/100,V+=d*this._zoom.start/100;var p=s.getAutoFormatter(V,U).formatter;return{start:s.format(p,V),end:s.format(p,U)}}return{start:"",end:""}},__ondrift:function(e,t,n){this.zoomOption.zoomLock&&(e=this._fillerShae);var i="filler"==e._type?this._handleSize:0;if("horizontal"==this.zoomOption.orient?e.style.x+t-i<=this._location.x?e.style.x=this._location.x+i:e.style.x+t+e.style.width+i>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-i:e.style.x+=t:e.style.y+n-i<=this._location.y?e.style.y=this._location.y+i:e.style.y+n+e.style.height+i>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-i:e.style.y+=n,"filler"==e._type?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),this.zoomOption.showDetail){var a=this._getDetail();this._startShape.style.text=this._startShape.highlightStyle.text=a.start,this._endShape.style.text=this._endShape.highlightStyle.text=a.end,this._startShape.style.textPosition=this._startShape.highlightStyle.textPosition,this._endShape.style.textPosition=this._endShape.highlightStyle.textPosition}return!0},__ondragend:function(){this.zoomOption.showDetail&&(this._startShape.style.text=this._endShape.style.text="=",this._startShape.style.textPosition=this._endShape.style.textPosition="inside",this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.refreshNextFrame()),this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,this._isSilence||this.zoomOption.realtime||this.messageCenter.dispatch(r.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1)},ondataZoom:function(e,t){t.needRefresh=!0},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0)},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var t=this.component.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};if(n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height),n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.x<t.x&&(n.x=t.x),n.x+n.width>t.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var i,a=(n.x-t.x)/t.width,o=1-(n.x+n.width-t.x)/t.width,r=1-(n.y+n.height-t.y)/t.height,s=(n.y-t.y)/t.height;return"horizontal"==this.zoomOption.orient?(i=this._zoom.end-this._zoom.start,this._zoom.start+=i*a,this._zoom.end-=i*o,i=this._zoom.end2-this._zoom.start2,this._zoom.start2+=i*r,this._zoom.end2-=i*s):(i=this._zoom.end-this._zoom.start,this._zoom.start+=i*r,this._zoom.end-=i*s,i=this._zoom.end2-this._zoom.start2,this._zoom.start2+=i*a,this._zoom.end2-=i*o),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){for(var t,n,i=this._originalData.series,a=e.series,o=0,r=a.length;r>o;o++){n=a[o].data||a[o].eventList,t=i[o]?Math.floor(this._zoom.start/100*i[o].length):0;for(var s=0,l=n.length;l>s;s++)i[o]&&(i[o][s+t]=n[s])}},syncOption:function(e){this.silence(!0),this.option=e,this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this.myChart.canvasSupported||(this.zoomOption.realtime=!1),this.clear(),this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom&&this.option.dataZoom.show&&this._buildShape(),this._syncData(),this.silence(!1)},silence:function(e){this._isSilence=e},getRealDataIndex:function(e,t){if(!this._originalData||0===this._zoom.start&&100==this._zoom.end)return t;var n=this._originalData.series;return n[e]?Math.floor(this._zoom.start/100*n[e].length)+t:-1},resize:function(){this.clear(),this._location=this._getLocation(),this._zoom=this._getZoom(),this.option.dataZoom.show&&this._buildShape()}},l.inherits(t,n),e("../component").define("dataZoom",t),t}),n("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function t(e,t,i,a,o,r){if(a.data.length<1)return void console.error("option.data.length < 1.");n.call(this,e,t,i,a,o),this.grid=this.component.grid;for(var s in r)this[s]=r[s];this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=e("../config"),s=e("zrender/tool/util"),l=e("zrender/tool/area");return t.prototype={type:r.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t="undefined"!=typeof this.option.data[e].value?this.option.data[e].value:this.option.data[e],n=this.option.data[e].formatter||this.option.axisLabel.formatter;return n&&("function"==typeof n?t=n.call(this.myChart,t):"string"==typeof n&&(t=n.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if("auto"==e){var t=this.option.axisLabel.textStyle.fontSize,n=this.option.data,i=this.option.data.length;if(this.isHorizontal())if(i>3){var a,o,r=this.getGap(),h=!1,m=Math.floor(.5/r);for(m=1>m?1:m,e=Math.floor(15/r);!h&&i>e;){e+=m,h=!0,a=Math.floor(r*e);for(var V=Math.floor((i-1)/e)*e;V>=0;V-=e){if(0!==this.option.axisLabel.rotate)o=t;else if(n[V].textStyle)o=l.getTextWidth(this._getReformedLabel(V),this.getFont(s.merge(n[V].textStyle,this.option.axisLabel.textStyle)));else{var U=this._getReformedLabel(V)+"",d=(U.match(/\w/g)||"").length,p=U.length-d;o=d*t*2/3+p*t}if(o>a){h=!1;break}}}}else e=1;else if(i>3){var r=this.getGap();for(e=Math.floor(11/r);t>r*e-6&&i>e;)e++}else e=1}else e=e-0+1;return e},_buildShape:function(){if(this._interval=this._getInterval(),this.option.show){this.option.splitArea.show&&this._buildSplitArea(),this.option.splitLine.show&&this._buildSplitLine(),this.option.axisLine.show&&this._buildAxisLine(),this.option.axisTick.show&&this._buildAxisTick(),this.option.axisLabel.show&&this._buildAxisLabel();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildAxisTick:function(){var e,t=this.option.data.length,n=this.option.axisTick,i=n.length,o=n.lineStyle.color,r=n.lineStyle.width,s="auto"==n.interval?this._interval:n.interval-0+1,l=n.onGap,h=l?this.getGap()/2:"undefined"==typeof l&&this.option.boundaryGap?this.getGap()/2:0,m=h>0?-s:0;if(this.isHorizontal())for(var V,U="bottom"==this.option.position?n.inside?this.grid.getYend()-i-1:this.grid.getYend()+1:n.inside?this.grid.getY()+1:this.grid.getY()-i-1,d=m;t>d;d+=s)V=this.subPixelOptimize(this.getCoordByIndex(d)+(d>=0?h:0),r),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:V,yStart:U,xEnd:V,yEnd:U+i,strokeColor:o,lineWidth:r}},this.shapeList.push(new a(e));else for(var p,c="left"==this.option.position?n.inside?this.grid.getX()+1:this.grid.getX()-i-1:n.inside?this.grid.getXend()-i-1:this.grid.getXend()+1,d=m;t>d;d+=s)p=this.subPixelOptimize(this.getCoordByIndex(d)-(d>=0?h:0),r),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:c,yStart:p,xEnd:c+i,yEnd:p,strokeColor:o,lineWidth:r}},this.shapeList.push(new a(e))},_buildAxisLabel:function(){var e,t,n=this.option.data,a=this.option.data.length,o=this.option.axisLabel.rotate,r=this.option.axisLabel.margin,l=this.option.axisLabel.clickable,h=this.option.axisLabel.textStyle;if(this.isHorizontal()){var m,V;"bottom"==this.option.position?(m=this.grid.getYend()+r,V="top"):(m=this.grid.getY()-r,V="bottom");for(var U=0;a>U;U+=this._interval)""!==this._getReformedLabel(U)&&(t=s.merge(n[U].textStyle||{},h),e={zlevel:this._zlevelBase,hoverable:!1,style:{x:this.getCoordByIndex(U),y:m,color:t.color,text:this._getReformedLabel(U),textFont:this.getFont(t),textAlign:t.align||"center",textBaseline:t.baseline||V}},o&&(e.style.textAlign=o>0?"bottom"==this.option.position?"right":"left":"bottom"==this.option.position?"left":"right",e.rotation=[o*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(l,e))))}else{var d,p;"left"==this.option.position?(d=this.grid.getX()-r,p="right"):(d=this.grid.getXend()+r,p="left");for(var U=0;a>U;U+=this._interval)""!==this._getReformedLabel(U)&&(t=s.merge(n[U].textStyle||{},h),e={zlevel:this._zlevelBase,hoverable:!1,style:{x:d,y:this.getCoordByIndex(U),color:t.color,text:this._getReformedLabel(U),textFont:this.getFont(t),textAlign:t.align||p,textBaseline:t.baseline||0===U&&""!==this.option.name?"bottom":U==a-1&&""!==this.option.name?"top":"middle"}},o&&(e.rotation=[o*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(l,e))))}},_buildSplitLine:function(){var e,t=this.option.data.length,n=this.option.splitLine,i=n.lineStyle.type,o=n.lineStyle.width,r=n.lineStyle.color;r=r instanceof Array?r:[r];var s=r.length,l=n.onGap,h=l?this.getGap()/2:"undefined"==typeof l&&this.option.boundaryGap?this.getGap()/2:0;if(t-=l||"undefined"==typeof l&&this.option.boundaryGap?1:0,this.isHorizontal())for(var m,V=this.grid.getY(),U=this.grid.getYend(),d=0;t>d;d+=this._interval)m=this.subPixelOptimize(this.getCoordByIndex(d)+h,o),e={zlevel:this._zlevelBase,hoverable:!1,style:{xStart:m,yStart:V,xEnd:m,yEnd:U,strokeColor:r[d/this._interval%s],lineType:i,lineWidth:o}},this.shapeList.push(new a(e));else for(var p,c=this.grid.getX(),u=this.grid.getXend(),d=0;t>d;d+=this._interval)p=this.subPixelOptimize(this.getCoordByIndex(d)-h,o),e={zlevel:this._zlevelBase,hoverable:!1,style:{xStart:c,yStart:p,xEnd:u,yEnd:p,strokeColor:r[d/this._interval%s],linetype:i,lineWidth:o}},this.shapeList.push(new a(e))},_buildSplitArea:function(){var e,t=this.option.splitArea,n=t.areaStyle.color;if(n instanceof Array){var i=n.length,a=this.option.data.length,r=t.onGap,s=r?this.getGap()/2:"undefined"==typeof r&&this.option.boundaryGap?this.getGap()/2:0;if(this.isHorizontal())for(var l,h=this.grid.getY(),m=this.grid.getHeight(),V=this.grid.getX(),U=0;a>=U;U+=this._interval)l=a>U?this.getCoordByIndex(U)+s:this.grid.getXend(),e={zlevel:this._zlevelBase,hoverable:!1,style:{x:V,y:h,width:l-V,height:m,color:n[U/this._interval%i]}},this.shapeList.push(new o(e)),V=l;else for(var d,p=this.grid.getX(),c=this.grid.getWidth(),u=this.grid.getYend(),U=0;a>=U;U+=this._interval)d=a>U?this.getCoordByIndex(U)-s:this.grid.getY(),e={zlevel:this._zlevelBase,hoverable:!1,style:{x:p,y:d,width:c,height:u-d,color:n[U/this._interval%i]}},this.shapeList.push(new o(e)),u=d}else e={zlevel:this._zlevelBase,hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:n}},this.shapeList.push(new o(e))},refresh:function(e){e&&(this.option=this.reformOption(e),this.option.axisLabel.textStyle=s.merge(this.option.axisLabel.textStyle||{},this.ecTheme.textStyle)),this.clear(),this._buildShape()},getGap:function(){var e=this.option.data.length,t=this.isHorizontal()?this.grid.getWidth():this.grid.getHeight();return this.option.boundaryGap?t/e:t/(e>1?e-1:1)},getCoord:function(e){for(var t=this.option.data,n=t.length,i=this.getGap(),a=this.option.boundaryGap?i/2:0,o=0;n>o;o++){if(t[o]==e||"undefined"!=typeof t[o].value&&t[o].value==e)return a=this.isHorizontal()?this.grid.getX()+a:this.grid.getYend()-a;a+=i}},getCoordByIndex:function(e){if(0>e)return this.isHorizontal()?this.grid.getX():this.grid.getYend();if(e>this.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),n=this.option.boundaryGap?t/2:0;return n+=e*t,n=this.isHorizontal()?this.grid.getX()+n:this.grid.getYend()-n},getNameByIndex:function(e){var t=this.option.data[e];return"undefined"!=typeof t&&"undefined"!=typeof t.value?t.value:t},getIndexByName:function(e){for(var t=this.option.data,n=t.length,i=0;n>i;i++)if(t[i]==e||"undefined"!=typeof t[i].value&&t[i].value==e)return i;return-1},getValueFromCoord:function(){return""},isMainAxis:function(e){return e%this._interval===0}},s.inherits(t,n),e("../component").define("categoryAxis",t),t}),n("echarts/component/valueAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","../util/date","zrender/tool/util","../util/smartSteps","../util/accMath","../component"],function(e){function t(e,t,i,a,o,r,s){if(!s||0===s.length)return void console.err("option.series.length == 0.");n.call(this,e,t,i,a,o),this.series=s,this.grid=this.component.grid;for(var l in r)this[l]=r[l];this.refresh(a,s)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=e("../config"),s=e("../util/date"),l=e("zrender/tool/util");return t.prototype={type:r.COMPONENT_TYPE_AXIS_VALUE,_buildShape:function(){if(this._hasData=!1,this._calculateValue(),this._hasData&&this.option.show){this.option.splitArea.show&&this._buildSplitArea(),this.option.splitLine.show&&this._buildSplitLine(),this.option.axisLine.show&&this._buildAxisLine(),this.option.axisTick.show&&this._buildAxisTick(),this.option.axisLabel.show&&this._buildAxisLabel(); |
|
11 | for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildAxisTick:function(){var e,t=this._valueList,n=this._valueList.length,i=this.option.axisTick,o=i.length,r=i.lineStyle.color,s=i.lineStyle.width;if(this.isHorizontal())for(var l,h="bottom"===this.option.position?i.inside?this.grid.getYend()-o-1:this.grid.getYend()+1:i.inside?this.grid.getY()+1:this.grid.getY()-o-1,m=0;n>m;m++)l=this.subPixelOptimize(this.getCoord(t[m]),s),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:l,yStart:h,xEnd:l,yEnd:h+o,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e));else for(var V,U="left"===this.option.position?i.inside?this.grid.getX()+1:this.grid.getX()-o-1:i.inside?this.grid.getXend()-o-1:this.grid.getXend()+1,m=0;n>m;m++)V=this.subPixelOptimize(this.getCoord(t[m]),s),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:U,yStart:V,xEnd:U+o,yEnd:V,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e))},_buildAxisLabel:function(){var e,t=this._valueList,n=this._valueList.length,a=this.option.axisLabel.rotate,o=this.option.axisLabel.margin,r=this.option.axisLabel.clickable,s=this.option.axisLabel.textStyle;if(this.isHorizontal()){var l,h;"bottom"===this.option.position?(l=this.grid.getYend()+o,h="top"):(l=this.grid.getY()-o,h="bottom");for(var m=0;n>m;m++)e={zlevel:this._zlevelBase,hoverable:!1,style:{x:this.getCoord(t[m]),y:l,color:"function"==typeof s.color?s.color(t[m]):s.color,text:this._valueLabel[m],textFont:this.getFont(s),textAlign:s.align||"center",textBaseline:s.baseline||h}},a&&(e.style.textAlign=a>0?"bottom"===this.option.position?"right":"left":"bottom"===this.option.position?"left":"right",e.rotation=[a*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(r,e)))}else{var V,U;"left"===this.option.position?(V=this.grid.getX()-o,U="right"):(V=this.grid.getXend()+o,U="left");for(var m=0;n>m;m++)e={zlevel:this._zlevelBase,hoverable:!1,style:{x:V,y:this.getCoord(t[m]),color:"function"==typeof s.color?s.color(t[m]):s.color,text:this._valueLabel[m],textFont:this.getFont(s),textAlign:s.align||U,textBaseline:s.baseline||0===m&&""!==this.option.name?"bottom":m===n-1&&""!==this.option.name?"top":"middle"}},a&&(e.rotation=[a*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(r,e)))}},_buildSplitLine:function(){var e,t=this._valueList,n=this._valueList.length,i=this.option.splitLine,o=i.lineStyle.type,r=i.lineStyle.width,s=i.lineStyle.color;s=s instanceof Array?s:[s];var l=s.length;if(this.isHorizontal())for(var h,m=this.grid.getY(),V=this.grid.getYend(),U=0;n>U;U++)h=this.subPixelOptimize(this.getCoord(t[U]),r),e={zlevel:this._zlevelBase,hoverable:!1,style:{xStart:h,yStart:m,xEnd:h,yEnd:V,strokeColor:s[U%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e));else for(var d,p=this.grid.getX(),c=this.grid.getXend(),U=0;n>U;U++)d=this.subPixelOptimize(this.getCoord(t[U]),r),e={zlevel:this._zlevelBase,hoverable:!1,style:{xStart:p,yStart:d,xEnd:c,yEnd:d,strokeColor:s[U%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e))},_buildSplitArea:function(){var e,t=this.option.splitArea.areaStyle.color;if(t instanceof Array){var n=t.length,i=this._valueList,a=this._valueList.length;if(this.isHorizontal())for(var r,s=this.grid.getY(),l=this.grid.getHeight(),h=this.grid.getX(),m=0;a>=m;m++)r=a>m?this.getCoord(i[m]):this.grid.getXend(),e={zlevel:this._zlevelBase,hoverable:!1,style:{x:h,y:s,width:r-h,height:l,color:t[m%n]}},this.shapeList.push(new o(e)),h=r;else for(var V,U=this.grid.getX(),d=this.grid.getWidth(),p=this.grid.getYend(),m=0;a>=m;m++)V=a>m?this.getCoord(i[m]):this.grid.getY(),e={zlevel:this._zlevelBase,hoverable:!1,style:{x:U,y:V,width:d,height:p-V,color:t[m%n]}},this.shapeList.push(new o(e)),p=V}else e={zlevel:this._zlevelBase,hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:t}},this.shapeList.push(new o(e))},_calculateValue:function(){if(isNaN(this.option.min-0)||isNaN(this.option.max-0)){for(var e,t,n={},i=this.component.legend,a=0,o=this.series.length;o>a;a++)!(this.series[a].type!=r.CHART_TYPE_LINE&&this.series[a].type!=r.CHART_TYPE_BAR&&this.series[a].type!=r.CHART_TYPE_SCATTER&&this.series[a].type!=r.CHART_TYPE_K&&this.series[a].type!=r.CHART_TYPE_EVENTRIVER||i&&!i.isSelected(this.series[a].name)||(e=this.series[a].xAxisIndex||0,t=this.series[a].yAxisIndex||0,this.option.xAxisIndex!=e&&this.option.yAxisIndex!=t||!this._calculSum(n,a)));var s;for(var a in n){s=n[a];for(var l=0,h=s.length;h>l;l++)if(!isNaN(s[l])){this._hasData=!0,this._min=s[l],this._max=s[l];break}if(this._hasData)break}for(var a in n){s=n[a];for(var l=0,h=s.length;h>l;l++)isNaN(s[l])||(this._min=Math.min(this._min,s[l]),this._max=Math.max(this._max,s[l]))}var m=Math.abs(this._max-this._min);this._min=isNaN(this.option.min-0)?this._min-Math.abs(m*this.option.boundaryGap[0]):this.option.min-0,this._max=isNaN(this.option.max-0)?this._max+Math.abs(m*this.option.boundaryGap[1]):this.option.max-0,this._min===this._max&&(0===this._max?this._max=1:this._max>0?this._min=this._max/this.option.splitNumber!=null?this.option.splitNumber:5:this._max=this._max/this.option.splitNumber!=null?this.option.splitNumber:5),"time"!=this.option.type?this._reformValue(this.option.scale):this._reformTimeValue()}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,"time"!=this.option.type?this._customerValue():this._reformTimeValue()},_calculSum:function(e,t){var n,i,a=this.series[t].name||"kener";if(this.series[t].stack){var o="__Magic_Key_Positive__"+this.series[t].stack,l="__Magic_Key_Negative__"+this.series[t].stack;e[o]=e[o]||[],e[l]=e[l]||[],e[a]=e[a]||[],i=this.series[t].data;for(var h=0,m=i.length;m>h;h++)n=null!=i[h].value?i[h].value:i[h],"-"!==n&&(n-=0,n>=0?null!=e[o][h]?e[o][h]+=n:e[o][h]=n:null!=e[l][h]?e[l][h]+=n:e[l][h]=n,this.option.scale&&e[a].push(n))}else if(e[a]=e[a]||[],this.series[t].type!=r.CHART_TYPE_EVENTRIVER){i=this.series[t].data;for(var h=0,m=i.length;m>h;h++)n=null!=i[h].value?i[h].value:i[h],this.series[t].type===r.CHART_TYPE_K?(e[a].push(n[0]),e[a].push(n[1]),e[a].push(n[2]),e[a].push(n[3])):n instanceof Array?(-1!=this.option.xAxisIndex&&e[a].push("time"!=this.option.type?n[0]:s.getNewDate(n[0])),-1!=this.option.yAxisIndex&&e[a].push("time"!=this.option.type?n[1]:s.getNewDate(n[1]))):e[a].push(n)}else{i=this.series[t].eventList;for(var h=0,m=i.length;m>h;h++)for(var V=i[h].evolution,U=0,d=V.length;d>U;U++)e[a].push(s.getNewDate(V[U].time))}},_reformValue:function(t){var n=e("../util/smartSteps"),i=this.option.splitNumber;!t&&this._min>=0&&this._max>=0&&(this._min=0),!t&&this._min<=0&&this._max<=0&&(this._max=0);var a=n(this._min,this._max,i);i=null!=i?i:a.secs,this.option.splitNumber=i,this._min=a.min,this._max=a.max,this._valueList=a.pnts,this._reformLabelData()},_reformTimeValue:function(){var e=null!=this.option.splitNumber?this.option.splitNumber:5,t=s.getAutoFormatter(this._min,this._max,e),n=t.formatter,i=t.gapValue;this._valueList=[s.getNewDate(this._min)];var a;switch(n){case"week":a=s.nextMonday(this._min);break;case"month":a=s.nextNthOnMonth(this._min,1);break;case"quarter":a=s.nextNthOnQuarterYear(this._min,1);break;case"half-year":a=s.nextNthOnHalfYear(this._min,1);break;case"year":a=s.nextNthOnYear(this._min,1);break;default:72e5>=i?a=(Math.floor(this._min/i)+1)*i:(a=s.getNewDate(this._min- -i),a.setHours(6*Math.round(a.getHours()/6)),a.setMinutes(0),a.setSeconds(0))}for(a-this._min<i/2&&(a-=-i),t=s.getNewDate(a),e*=1.5;e-->=0&&(("month"==n||"quarter"==n||"half-year"==n||"year"==n)&&t.setDate(1),!(this._max-t<i/2));)this._valueList.push(t),t=s.getNewDate(t- -i);this._valueList.push(s.getNewDate(this._max)),this._reformLabelData(n)},_customerValue:function(){var t=e("../util/accMath"),n=null!=this.option.splitNumber?this.option.splitNumber:5,i=(this._max-this._min)/n;this._valueList=[];for(var a=0;n>=a;a++)this._valueList.push(t.accAdd(this._min,t.accMul(i,a)));this._reformLabelData()},_reformLabelData:function(e){this._valueLabel=[];var t=this.option.axisLabel.formatter;if(t)for(var n=0,i=this._valueList.length;i>n;n++)"function"==typeof t?this._valueLabel.push(e?t.call(this.myChart,this._valueList[n],e):t.call(this.myChart,this._valueList[n])):"string"==typeof t&&this._valueLabel.push(e?s.format(t,this._valueList[n]):t.replace("{value}",this._valueList[n]));else if(e)for(var n=0,i=this._valueList.length;i>n;n++)this._valueLabel.push(s.format(e,this._valueList[n]));else for(var n=0,i=this._valueList.length;i>n;n++)this._valueLabel.push(this.numAddCommas(this._valueList[n]))},getExtremum:function(){return this._calculateValue(),{min:this._min,max:this._max}},refresh:function(e,t){e&&(this.option=this.reformOption(e),this.option.axisLabel.textStyle=l.merge(this.option.axisLabel.textStyle||{},this.ecTheme.textStyle),this.series=t),this.zr&&(this.clear(),this._buildShape())},getCoord:function(e){e=e<this._min?this._min:e,e=e>this._max?this._max:e;var t;return t=this.isHorizontal()?this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight()},getCoordSize:function(e){return Math.abs(this.isHorizontal()?e/(this._max-this._min)*this.grid.getWidth():e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=e<this.grid.getX()?this.grid.getX():e,e=e>this.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=e<this.grid.getY()?this.grid.getY():e,e=e>this.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0},isMaindAxis:function(e){for(var t=0,n=this._valueList.length;n>t;t++)if(this._valueList[t]===e)return!0;return!1}},l.inherits(t,n),e("../component").define("valueAxis",t),t}),n("echarts/util/date",[],function(){function e(e,t,n){n=n>1?n:2;for(var i,a,o,r,s=0,l=m.length;l>s;s++)if(i=m[s].value,a=Math.ceil(t/i)*i-Math.floor(e/i)*i,Math.round(a/i)<=1.2*n){o=m[s].formatter,r=m[s].value;break}return null==o&&(o="year",i=317088e5,a=Math.ceil(t/i)*i-Math.floor(e/i)*i,r=Math.round(a/(n-1)/i)*i),{formatter:o,gapValue:r}}function t(e){return 10>e?"0"+e:e}function n(e,n){("week"==e||"month"==e||"quarter"==e||"half-year"==e||"year"==e)&&(e="MM - dd\nyyyy");var i=h(n),a=i.getFullYear(),o=i.getMonth()+1,r=i.getDate(),s=i.getHours(),l=i.getMinutes(),m=i.getSeconds();return e=e.replace("MM",t(o)),e=e.toLowerCase(),e=e.replace("yyyy",a),e=e.replace("yy",a%100),e=e.replace("dd",t(r)),e=e.replace("d",r),e=e.replace("hh",t(s)),e=e.replace("h",s),e=e.replace("mm",t(l)),e=e.replace("m",l),e=e.replace("ss",t(m)),e=e.replace("s",m)}function i(e){return e=h(e),e.setDate(e.getDate()+8-e.getDay()),e}function a(e,t,n){return e=h(e),e.setMonth(Math.ceil((e.getMonth()+1)/n)*n),e.setDate(t),e}function o(e,t){return a(e,t,1)}function r(e,t){return a(e,t,3)}function s(e,t){return a(e,t,6)}function l(e,t){return a(e,t,12)}function h(e){return e instanceof Date?e:new Date("string"==typeof e?e.replace(/-/g,"/"):e)}var m=[{formatter:"hh : mm : ss",value:1e3},{formatter:"hh : mm : ss",value:5e3},{formatter:"hh : mm : ss",value:1e4},{formatter:"hh : mm : ss",value:15e3},{formatter:"hh : mm : ss",value:3e4},{formatter:"hh : mm\nMM - dd",value:6e4},{formatter:"hh : mm\nMM - dd",value:3e5},{formatter:"hh : mm\nMM - dd",value:6e5},{formatter:"hh : mm\nMM - dd",value:9e5},{formatter:"hh : mm\nMM - dd",value:18e5},{formatter:"hh : mm\nMM - dd",value:36e5},{formatter:"hh : mm\nMM - dd",value:72e5},{formatter:"hh : mm\nMM - dd",value:216e5},{formatter:"hh : mm\nMM - dd",value:432e5},{formatter:"MM - dd\nyyyy",value:864e5},{formatter:"week",value:6048e5},{formatter:"month",value:26784e5},{formatter:"quarter",value:8208e6},{formatter:"half-year",value:16416e6},{formatter:"year",value:32832e6}];return{getAutoFormatter:e,getNewDate:h,format:n,nextMonday:i,nextNthPerNmonth:a,nextNthOnMonth:o,nextNthOnQuarterYear:r,nextNthOnHalfYear:s,nextNthOnYear:l}}),n("echarts/util/smartSteps",[],function(){function e(e){return X.log(v(e))/X.LN10}function t(e){return X.pow(10,e)}function n(e){return e===w(e)}function i(e,t,i,a){g=a||{},k=g.steps||L,f=g.secs||W,i=K(+i||0)%99,e=+e||0,t=+t||0,_=x=0,"min"in g&&(e=+g.min||0,_=1),"max"in g&&(t=+g.max||0,x=1),e>t&&(t=[e,e=t][0]);var o=t-e;if(_&&x)return b(e,t,i);if((i||5)>o){if(n(e)&&n(t))return d(e,t,i);if(0===o)return p(e,t,i)}return h(e,t,i)}function a(e,n,i,a){a=a||0;var s=o((n-e)/i,-1),l=o(e,-1,1),h=o(n,-1),m=X.min(s.e,l.e,h.e);r(s,{c:0,e:m}),r(l,s,1),r(h,s),a+=m,e=l.c,n=h.c;for(var V=(n-e)/i,U=t(a),d=0,p=[],c=i+1;c--;)p[c]=(e+V*c)*U;if(0>a){d=u(U),V=+(V*U).toFixed(d),e=+(e*U).toFixed(d),n=+(n*U).toFixed(d);for(var c=p.length;c--;)p[c]=p[c].toFixed(d),0===+p[c]&&(p[c]="0")}else e*=U,n*=U,V*=U;return f=0,k=0,g=0,{min:e,max:n,secs:i,step:V,fix:d,exp:a,pnts:p}}function o(i,a,o){a=K(a%10)||2,0>a&&(n(i)?a=(""+v(i)).replace(/0+$/,"").length||1:(i=i.toFixed(15).replace(/0+$/,""),a=i.replace(".","").replace(/^[-0]+/,"").length,i=+i));var r=w(e(i))-a+1,s=+(i*t(-r)).toFixed(15)||0;return s=o?w(s):I(s),!s&&(r=0),(""+v(s)).length>a&&(r+=1,s/=10),{c:s,e:r}}function r(e,n,i){var a=n.e-e.e;a&&(e.e+=a,e.c*=t(-a),e.c=i?w(e.c):I(e.c))}function s(e,t,n){e.e<t.e?r(t,e,n):r(e,t,n)}function l(e,t){t=t||L,e=o(e);for(var n=e.c,i=0;n>t[i];)i++;if(!t[i])for(n/=10,e.e+=1,i=0;n>t[i];)i++;return e.c=t[i],e}function h(e,t,i){var s,h=i||+f.slice(-1),p=l((t-e)/h,k),u=o(t-e),b=o(e,-1,1),g=o(t,-1);if(r(u,p),r(b,p,1),r(g,p),i?s=V(b,g,h):h=m(b,g),n(e)&&n(t)&&e*t>=0){if(h>t-e)return d(e,t,h);h=U(e,t,i,b,g,h)}var L=c(e,t,b.c,g.c);return b.c=L[0],g.c=L[1],(_||x)&&y(e,t,b,g),a(b.c,g.c,h,g.e)}function m(e,n){for(var i,a,o,r,s=[],h=f.length;h--;)i=f[h],a=l((n.c-e.c)/i,k),a=a.c*t(a.e),o=w(e.c/a)*a,r=I(n.c/a)*a,s[h]={min:o,max:r,step:a,span:r-o};return s.sort(function(e,t){return e.span-t.span}),s=s[0],i=s.span/s.step,e.c=s.min,n.c=s.max,3>i?2*i:i}function V(e,n,i){for(var a,o,r=n.c,s=(n.c-e.c)/i-1;r>e.c;)s=l(s+1,k),s=s.c*t(s.e),a=s*i,o=I(n.c/s)*s,r=o-a;var h=e.c-r,m=o-n.c,V=h-m;return V>=2*s&&(V=w(V/s)*s,r+=V,o+=V),e.c=r,n.c=o,s}function U(e,i,a,o,r,s){var l=r.c-o.c,h=l/s*t(r.e);if(!n(h)&&(h=w(h),l=h*s,i-e>l&&(h+=1,l=h*s,!a&&h*(s-1)>=i-e&&(s-=1,l=h*s)),l>=i-e)){var m=l-(i-e);o.c=K(e-m/2),r.c=K(i+m/2),o.e=0,r.e=0}return s}function d(e,t,n){if(n=n||5,_)t=e+n;else if(x)e=t-n;else{var i=n-(t-e),o=K(e-i/2),r=K(t+i/2),s=c(e,t,o,r);e=s[0],t=s[1]}return a(e,t,n)}function p(e,t,n){n=n||5;var i=X.min(v(t/n),n)/2.1;return _?t=e+i:x?e=t-i:(e-=i,t+=i),h(e,t,n)}function c(e,t,n,i){return e>=0&&0>n?(i-=n,n=0):0>=t&&i>0&&(n-=i,i=0),[n,i]}function u(e){return e=(+e).toFixed(15).split("."),e.pop().replace(/0+$/,"").length}function y(e,t,n,i){if(_){var a=o(e,4,1);n.e-a.e>6&&(a={c:0,e:n.e}),s(n,a),s(i,a),i.c+=a.c-n.c,n.c=a.c}else if(x){var r=o(t,4);i.e-r.e>6&&(r={c:0,e:i.e}),s(n,r),s(i,r),n.c+=r.c-i.c,i.c=r.c}}function b(e,t,n){var i=n?[n]:f,s=t-e;if(0===s)return t=o(t,3),n=i[0],t.c=K(t.c+n/2),a(t.c-n,t.c,n,t.e);v(t/s)<1e-6&&(t=0),v(e/s)<1e-6&&(e=0);var l,h,m,V=[[5,10],[10,2],[50,10],[100,2]],U=[],d=[],p=o(t-e,3),c=o(e,-1,1),u=o(t,-1);r(c,p,1),r(u,p),s=u.c-c.c,p.c=s;for(var y=i.length;y--;){n=i[y],l=I(s/n),h=l*n-s,m=3*(h+3),m+=2*(n-i[0]+2),n%5===0&&(m-=10);for(var b=V.length;b--;)l%V[b][0]===0&&(m/=V[b][1]);d[y]=[n,l,h,m].join(),U[y]={secs:n,step:l,delta:h,score:m}}return U.sort(function(e,t){return e.score-t.score}),U=U[0],c.c=K(c.c-U.delta/2),u.c=K(u.c+U.delta/2),a(c.c,u.c,U.secs,p.e)}var g,k,f,_,x,L=[10,25,50],W=[4,5,6],X=Math,K=X.round,w=X.floor,I=X.ceil,v=X.abs;return i}),n("echarts/chart/line",["require","../component/base","./base","zrender/shape/BrokenLine","../util/shape/Icon","../util/shape/HalfSmoothPolygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,n,o,r){i.call(this,e,t,n,o,r),a.call(this),this.refresh(o)}function n(e,t,n){var i=t.x,a=t.y,o=t.width,s=t.height,l=s/2;t.symbol.match("empty")&&(e.fillStyle="#fff"),t.brushType="both";var h=t.symbol.replace("empty","").toLowerCase();h.match("star")?(l=h.replace("star","")-0||5,a-=1,h="star"):("rectangle"===h||"arrow"===h)&&(i+=(o-s)/2,o=s);var m="";if(h.match("image")&&(m=h.replace(new RegExp("^image:\\/\\/"),""),h="image",i+=Math.round((o-s)/2)-1,o=s+=2),h=r.prototype.iconLibrary[h]){var V=t.x,U=t.y;e.moveTo(V,U+l),e.lineTo(V+5,U+l),e.moveTo(V+t.width-5,U+l),e.lineTo(V+t.width,U+l);var d=this;h(e,{x:i+4,y:a+4,width:o-8,height:s-8,n:l,image:m},function(){d.modSelf(),n()})}else e.moveTo(i,a+l),e.lineTo(i+o,a+l)}var i=e("../component/base"),a=e("./base"),o=e("zrender/shape/BrokenLine"),r=e("../util/shape/Icon"),s=e("../util/shape/HalfSmoothPolygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var l=e("../config"),h=e("../util/ecData"),m=e("zrender/tool/util"),V=e("zrender/tool/color");return t.prototype={type:l.CHART_TYPE_LINE,_buildShape:function(){this.finalPLMap={},this._bulidPosition()},_buildHorizontal:function(e,t,n,i){for(var a,o,r,s,l,h,m,V,U,d,p=this.series,c=n[0][0],u=p[c],y=u.xAxisIndex,b=this.component.xAxis.getAxis(y),g={},k=0,f=t;f>k&&null!=b.getNameByIndex(k);k++){r=b.getCoordByIndex(k);for(var _=0,x=n.length;x>_;_++){a=p[n[_][0]].yAxisIndex||0,o=this.component.yAxis.getAxis(a),h=l=V=m=o.getCoord(0);for(var L=0,W=n[_].length;W>L;L++)c=n[_][L],u=p[c],U=u.data[k],d=null!=U?null!=U.value?U.value:U:"-",g[c]=g[c]||[],i[c]=i[c]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==d?(d>=0?(l-=L>0?o.getCoordSize(d):h-o.getCoord(d),s=l):0>d&&(m+=L>0?o.getCoordSize(d):o.getCoord(d)-V,s=m),g[c].push([r,s,k,b.getNameByIndex(k),r,h]),i[c].min>d&&(i[c].min=d,i[c].minY=s,i[c].minX=r),i[c].max<d&&(i[c].max=d,i[c].maxY=s,i[c].maxX=r),i[c].sum+=d,i[c].counter++):g[c].length>0&&(this.finalPLMap[c]=this.finalPLMap[c]||[],this.finalPLMap[c].push(g[c]),g[c]=[])}l=this.component.grid.getY();for(var X,_=0,x=n.length;x>_;_++)for(var L=0,W=n[_].length;W>L;L++)c=n[_][L],u=p[c],U=u.data[k],d=null!=U?null!=U.value?U.value:U:"-","-"==d&&this.deepQuery([U,u,this.option],"calculable")&&(X=this.deepQuery([U,u],"symbolSize"),l+=2*X+5,s=l,this.shapeList.push(this._getCalculableItem(c,k,b.getNameByIndex(k),r,s,"horizontal")))}for(var K in g)g[K].length>0&&(this.finalPLMap[K]=this.finalPLMap[K]||[],this.finalPLMap[K].push(g[K]),g[K]=[]);this._calculMarkMapXY(i,n,"y"),this._buildBorkenLine(e,this.finalPLMap,b,"horizontal")},_buildVertical:function(e,t,n,i){for(var a,o,r,s,l,h,m,V,U,d,p=this.series,c=n[0][0],u=p[c],y=u.yAxisIndex,b=this.component.yAxis.getAxis(y),g={},k=0,f=t;f>k&&null!=b.getNameByIndex(k);k++){s=b.getCoordByIndex(k);for(var _=0,x=n.length;x>_;_++){a=p[n[_][0]].xAxisIndex||0,o=this.component.xAxis.getAxis(a),h=l=V=m=o.getCoord(0);for(var L=0,W=n[_].length;W>L;L++)c=n[_][L],u=p[c],U=u.data[k],d=null!=U?null!=U.value?U.value:U:"-",g[c]=g[c]||[],i[c]=i[c]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==d?(d>=0?(l+=L>0?o.getCoordSize(d):o.getCoord(d)-h,r=l):0>d&&(m-=L>0?o.getCoordSize(d):V-o.getCoord(d),r=m),g[c].push([r,s,k,b.getNameByIndex(k),h,s]),i[c].min>d&&(i[c].min=d,i[c].minX=r,i[c].minY=s),i[c].max<d&&(i[c].max=d,i[c].maxX=r,i[c].maxY=s),i[c].sum+=d,i[c].counter++):g[c].length>0&&(this.finalPLMap[c]=this.finalPLMap[c]||[],this.finalPLMap[c].push(g[c]),g[c]=[])}l=this.component.grid.getXend();for(var X,_=0,x=n.length;x>_;_++)for(var L=0,W=n[_].length;W>L;L++)c=n[_][L],u=p[c],U=u.data[k],d=null!=U?null!=U.value?U.value:U:"-","-"==d&&this.deepQuery([U,u,this.option],"calculable")&&(X=this.deepQuery([U,u],"symbolSize"),l-=2*X+5,r=l,this.shapeList.push(this._getCalculableItem(c,k,b.getNameByIndex(k),r,s,"vertical")))}for(var K in g)g[K].length>0&&(this.finalPLMap[K]=this.finalPLMap[K]||[],this.finalPLMap[K].push(g[K]),g[K]=[]);this._calculMarkMapXY(i,n,"x"),this._buildBorkenLine(e,this.finalPLMap,b,"vertical")},_buildOther:function(e,t,n,i){for(var a,o,r=this.series,s={},l=0,h=n.length;h>l;l++)for(var m=0,V=n[l].length;V>m;m++){var U=n[l][m],d=r[U],p=d.xAxisIndex||0;a=this.component.xAxis.getAxis(p);var c=d.yAxisIndex||0;o=this.component.yAxis.getAxis(c);var u=o.getCoord(0);s[U]=s[U]||[],i[U]=i[U]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var y=0,b=d.data.length;b>y;y++){var g=d.data[y],k=null!=g?null!=g.value?g.value:g:"-";if(k instanceof Array){var f=a.getCoord(k[0]),_=o.getCoord(k[1]);s[U].push([f,_,y,k[0],f,u]),i[U].min0>k[0]&&(i[U].min0=k[0],i[U].minY0=_,i[U].minX0=f),i[U].max0<k[0]&&(i[U].max0=k[0],i[U].maxY0=_,i[U].maxX0=f),i[U].sum0+=k[0],i[U].counter0++,i[U].min1>k[1]&&(i[U].min1=k[1],i[U].minY1=_,i[U].minX1=f),i[U].max1<k[1]&&(i[U].max1=k[1],i[U].maxY1=_,i[U].maxX1=f),i[U].sum1+=k[1],i[U].counter1++}}}for(var x in s)s[x].length>0&&(this.finalPLMap[x]=this.finalPLMap[x]||[],this.finalPLMap[x].push(s[x]),s[x]=[]);this._calculMarkMapXY(i,n,"xy"),this._buildBorkenLine(e,this.finalPLMap,a,"other")},_buildBorkenLine:function(e,t,n,i){for(var a,r="other"==i?"horizontal":i,l=this.series,U=e.length-1;U>=0;U--){var d=e[U],p=l[d],c=t[d];if(p.type===this.type&&null!=c)for(var u=this._getBbox(d,r),y=this._sIndex2ColorMap[d],b=this.query(p,"itemStyle.normal.lineStyle.width"),g=this.query(p,"itemStyle.normal.lineStyle.type"),k=this.query(p,"itemStyle.normal.lineStyle.color"),f=this.getItemStyleColor(this.query(p,"itemStyle.normal.color"),d,-1),_=null!=this.query(p,"itemStyle.normal.areaStyle"),x=this.query(p,"itemStyle.normal.areaStyle.color"),L=0,W=c.length;W>L;L++){var X=c[L],K="other"!=i&&this._isLarge(r,X);if(K)X=this._getLargePointList(r,X);else for(var w=0,I=X.length;I>w;w++)a=p.data[X[w][2]],(this.deepQuery([a,p,this.option],"calculable")||this.deepQuery([a,p],"showAllSymbol")||"categoryAxis"===n.type&&n.isMainAxis(X[w][2])&&"none"!=this.deepQuery([a,p],"symbol"))&&this.shapeList.push(this._getSymbol(d,X[w][2],X[w][3],X[w][0],X[w][1],r));var v=new o({zlevel:this._zlevelBase,style:{miterLimit:b,pointList:X,strokeColor:k||f||y,lineWidth:b,lineType:g,smooth:this._getSmooth(p.smooth),smoothConstraint:u,shadowColor:this.query(p,"itemStyle.normal.lineStyle.shadowColor"),shadowBlur:this.query(p,"itemStyle.normal.lineStyle.shadowBlur"),shadowOffsetX:this.query(p,"itemStyle.normal.lineStyle.shadowOffsetX"),shadowOffsetY:this.query(p,"itemStyle.normal.lineStyle.shadowOffsetY")},hoverable:!1,_main:!0,_seriesIndex:d,_orient:r});if(h.pack(v,l[d],d,0,L,l[d].name),this.shapeList.push(v),_){var J=new s({zlevel:this._zlevelBase,style:{miterLimit:b,pointList:m.clone(X).concat([[X[X.length-1][4],X[X.length-1][5]],[X[0][4],X[0][5]]]),brushType:"fill",smooth:this._getSmooth(p.smooth),smoothConstraint:u,color:x?x:V.alpha(y,.5)},highlightStyle:{brushType:"fill"},hoverable:!1,_main:!0,_seriesIndex:d,_orient:r});h.pack(J,l[d],d,0,L,l[d].name),this.shapeList.push(J)}}}},_getBbox:function(e,t){var n=this.component.grid.getBbox(),i=this.xMarkMap[e];return null!=i.minX0?[[Math.min(i.minX0,i.maxX0,i.minX1,i.maxX1),Math.min(i.minY0,i.maxY0,i.minY1,i.maxY1)],[Math.max(i.minX0,i.maxX0,i.minX1,i.maxX1),Math.max(i.minY0,i.maxY0,i.minY1,i.maxY1)]]:("horizontal"===t?(n[0][1]=Math.min(i.minY,i.maxY),n[1][1]=Math.max(i.minY,i.maxY)):(n[0][0]=Math.min(i.minX,i.maxX),n[1][0]=Math.max(i.minX,i.maxX)),n)},_isLarge:function(e,t){return t.length<2?!1:"horizontal"===e?Math.abs(t[0][0]-t[1][0])<.5:Math.abs(t[0][1]-t[1][1])<.5},_getLargePointList:function(e,t){var n;n="horizontal"===e?this.component.grid.getWidth():this.component.grid.getHeight();for(var i=t.length,a=[],o=0;n>o;o++)a[o]=t[Math.floor(i/n*o)];return a},_getSmooth:function(e){return e?.3:0},_getCalculableItem:function(e,t,n,i,a,o){var r=this.series,s=r[e].calculableHolderColor||this.ecTheme.calculableHolderColor,l=this._getSymbol(e,t,n,i,a,o);return l.style.color=s,l.style.strokeColor=s,l.rotation=[0,0],l.hoverable=!1,l.draggable=!1,l.style.text=void 0,l},_getSymbol:function(e,t,n,i,a,o){var r=this.series,s=r[e],l=s.data[t],h=this.getSymbolShape(s,e,l,t,n,i,a,this._sIndex2ShapeMap[e],this._sIndex2ColorMap[e],"#fff","vertical"===o?"horizontal":"vertical");return h.zlevel=this._zlevelBase+1,this.deepQuery([l,s,this.option],"calculable")&&(this.setCalculable(h),h.draggable=!0),h},getMarkCoord:function(e,t){var n=this.series[e],i=this.xMarkMap[e],a=this.component.xAxis.getAxis(n.xAxisIndex),o=this.component.yAxis.getAxis(n.yAxisIndex);if(t.type&&("max"===t.type||"min"===t.type||"average"===t.type)){var r=null!=t.valueIndex?t.valueIndex:null!=i.maxX0?"1":"";return[i[t.type+"X"+r],i[t.type+"Y"+r],i[t.type+"Line"+r],i[t.type+r]]}return["string"!=typeof t.xAxis&&a.getCoordByIndex?a.getCoordByIndex(t.xAxis||0):a.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&o.getCoordByIndex?o.getCoordByIndex(t.yAxis||0):o.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ontooltipHover:function(e,t){for(var n,i,a=e.seriesIndex,o=e.dataIndex,r=a.length;r--;)if(n=this.finalPLMap[a[r]])for(var s=0,l=n.length;l>s;s++){i=n[s];for(var h=0,m=i.length;m>h;h++)o===i[h][2]&&t.push(this._getSymbol(a[r],i[h][2],i[h][3],i[h][0],i[h][1],"horizontal"))}},addDataAnimation:function(e){for(var t=this.series,n={},i=0,a=e.length;a>i;i++)n[e[i][0]]=e[i];for(var o,r,s,l,h,m,V,i=this.shapeList.length-1;i>=0;i--)if(h=this.shapeList[i]._seriesIndex,n[h]&&!n[h][3]){if(this.shapeList[i]._main&&this.shapeList[i].style.pointList.length>1){if(m=this.shapeList[i].style.pointList,r=Math.abs(m[0][0]-m[1][0]),l=Math.abs(m[0][1]-m[1][1]),V="horizontal"===this.shapeList[i]._orient,n[h][2]){if("half-smooth-polygon"===this.shapeList[i].type){var U=m.length;this.shapeList[i].style.pointList[U-3]=m[U-2],this.shapeList[i].style.pointList[U-3][V?0:1]=m[U-4][V?0:1],this.shapeList[i].style.pointList[U-2]=m[U-1]}this.shapeList[i].style.pointList.pop(),V?(o=r,s=0):(o=0,s=-l)}else{if(this.shapeList[i].style.pointList.shift(),"half-smooth-polygon"===this.shapeList[i].type){var d=this.shapeList[i].style.pointList.pop();V?d[0]=m[0][0]:d[1]=m[0][1],this.shapeList[i].style.pointList.push(d)}V?(o=-r,s=0):(o=0,s=l)}this.zr.modShape(this.shapeList[i].id,{style:{pointList:this.shapeList[i].style.pointList}},!0)}else{if(n[h][2]&&this.shapeList[i]._dataIndex===t[h].data.length-1){this.zr.delShape(this.shapeList[i].id);continue}if(!n[h][2]&&0===this.shapeList[i]._dataIndex){this.zr.delShape(this.shapeList[i].id);continue}}this.shapeList[i].position=[0,0],this.zr.animate(this.shapeList[i].id,"").when(500,{position:[o,s]}).start()}}},r.prototype.iconLibrary.legendLineIcon=n,m.inherits(t,a),m.inherits(t,i),e("../chart").define("line",t),t}),n("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/util/smoothBezier"),a=e("zrender/tool/util");return t.prototype={type:"half-smooth-polygon",buildPath:function(t,n){var a=n.pointList;if(!(a.length<2))if(n.smooth){var o=i(a.slice(0,-2),n.smooth,!1,n.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var r,s,l,h=a.length,m=0;h-3>m;m++)r=o[2*m],s=o[2*m+1],l=a[m+1],t.bezierCurveTo(r[0],r[1],s[0],s[1],l[0],l[1]);t.lineTo(a[h-2][0],a[h-2][1]),t.lineTo(a[h-1][0],a[h-1][1]),t.lineTo(a[0][0],a[0][1])}else e("zrender/shape/Polygon").prototype.buildPath(t,n)}},a.inherits(t,n),t}),n("echarts/chart/bar",["require","../component/base","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,a,o,r){n.call(this,e,t,a,o,r),i.call(this),this.refresh(o)}var n=e("../component/base"),i=e("./base"),a=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var o=e("../config"),r=e("../util/ecData"),s=e("zrender/tool/util"),l=e("zrender/tool/color");return t.prototype={type:o.CHART_TYPE_BAR,_buildShape:function(){this._bulidPosition()},_buildNormal:function(e,t,n,i,o){for(var r,s,l,h,m,V,U,d,p,c,u,y,b=this.series,g=n[0][0],k=b[g],f=k.xAxisIndex,_=k.yAxisIndex,x="horizontal"==o?this.component.xAxis.getAxis(f):this.component.yAxis.getAxis(_),L=this._mapSize(x,n),W=L.gap,X=L.barGap,K=L.barWidthMap,w=L.barMaxWidthMap,I=L.barWidth,v=L.barMinHeightMap,J=L.interval,C=0,S=t;S>C&&null!=x.getNameByIndex(C);C++){"horizontal"==o?h=x.getCoordByIndex(C)-W/2:m=x.getCoordByIndex(C)+W/2;for(var E=0,T=n.length;T>E;E++){_=b[n[E][0]].yAxisIndex||0,f=b[n[E][0]].xAxisIndex||0,r="horizontal"==o?this.component.yAxis.getAxis(_):this.component.xAxis.getAxis(f),U=V=p=d=r.getCoord(0);for(var F=0,A=n[E].length;A>F;F++)if(g=n[E][F],k=b[g],u=k.data[C],y=null!=u?null!=u.value?u.value:u:"-",i[g]=i[g]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==y){y>0?(s=F>0?r.getCoordSize(y):"horizontal"==o?U-r.getCoord(y):r.getCoord(y)-U,1===A&&v[g]>s&&(s=v[g]),"horizontal"==o?(V-=s,m=V):(h=V,V+=s)):0>y?(s=F>0?r.getCoordSize(y):"horizontal"==o?r.getCoord(y)-p:p-r.getCoord(y),1===A&&v[g]>s&&(s=v[g]),"horizontal"==o?(m=d,d+=s):(d-=s,h=d)):(s=0,"horizontal"==o?(V-=s,m=V):(h=V,V+=s));var l=Math.min(w[g]||Number.MAX_VALUE,K[g]||I);i[g][C]="horizontal"==o?h+l/2:m-l/2,i[g].min>y&&(i[g].min=y,"horizontal"==o?(i[g].minY=m,i[g].minX=i[g][C]):(i[g].minX=h+s,i[g].minY=i[g][C])),i[g].max<y&&(i[g].max=y,"horizontal"==o?(i[g].maxY=m,i[g].maxX=i[g][C]):(i[g].maxX=h+s,i[g].maxY=i[g][C])),i[g].sum+=y,i[g].counter++,C%J===0&&(c=this._getBarItem(g,C,x.getNameByIndex(C),h,m-("horizontal"==o?0:l),"horizontal"==o?l:s,"horizontal"==o?s:l,"horizontal"==o?"vertical":"horizontal"),this.shapeList.push(new a(c)))}for(var F=0,A=n[E].length;A>F;F++)g=n[E][F],k=b[g],u=k.data[C],y=null!=u?null!=u.value?u.value:u:"-","-"==y&&this.deepQuery([u,k,this.option],"calculable")&&("horizontal"==o?(V-=this.ecTheme.island.r,m=V):(h=V,V+=this.ecTheme.island.r),l=Math.min(w[g]||Number.MAX_VALUE,K[g]||I),c=this._getBarItem(g,C,x.getNameByIndex(C),h+.5,m+.5-("horizontal"==o?0:l),("horizontal"==o?l:this.ecTheme.island.r)-1,("horizontal"==o?this.ecTheme.island.r:l)-1,"horizontal"==o?"vertical":"horizontal"),c.hoverable=!1,c.draggable=!1,c.style.lineWidth=1,c.style.brushType="stroke",c.style.strokeColor=k.calculableHolderColor||this.ecTheme.calculableHolderColor,this.shapeList.push(new a(c)));"horizontal"==o?h+=l+X:m-=l+X}}this._calculMarkMapXY(i,n,"horizontal"==o?"y":"x")},_buildHorizontal:function(e,t,n,i){return this._buildNormal(e,t,n,i,"horizontal")},_buildVertical:function(e,t,n,i){return this._buildNormal(e,t,n,i,"vertical")},_buildOther:function(e,t,n,i){for(var o=this.series,r=0,s=n.length;s>r;r++)for(var l=0,h=n[r].length;h>l;l++){var m=n[r][l],V=o[m],U=V.xAxisIndex||0,d=this.component.xAxis.getAxis(U),p=d.getCoord(0),c=V.yAxisIndex||0,u=this.component.yAxis.getAxis(c),y=u.getCoord(0);i[m]=i[m]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var b=0,g=V.data.length;g>b;b++){var k=V.data[b],f=null!=k?null!=k.value?k.value:k:"-";if(f instanceof Array){var _,x,L=d.getCoord(f[0]),W=u.getCoord(f[1]),X=[k,V],K=this.deepQuery(X,"barWidth")||10,w=this.deepQuery(X,"barHeight");null!=w?(_="horizontal",f[0]>0?(K=L-p,L-=K):K=f[0]<0?p-L:0,x=this._getBarItem(m,b,f[0],L,W-w/2,K,w,_)):(_="vertical",f[1]>0?w=y-W:f[1]<0?(w=W-y,W-=w):w=0,x=this._getBarItem(m,b,f[0],L-K/2,W,K,w,_)),this.shapeList.push(new a(x)),L=d.getCoord(f[0]),W=u.getCoord(f[1]),i[m].min0>f[0]&&(i[m].min0=f[0],i[m].minY0=W,i[m].minX0=L),i[m].max0<f[0]&&(i[m].max0=f[0],i[m].maxY0=W,i[m].maxX0=L),i[m].sum0+=f[0],i[m].counter0++,i[m].min1>f[1]&&(i[m].min1=f[1],i[m].minY1=W,i[m].minX1=L),i[m].max1<f[1]&&(i[m].max1=f[1],i[m].maxY1=W,i[m].maxX1=L),i[m].sum1+=f[1],i[m].counter1++ |
|
12 | }}}this._calculMarkMapXY(i,n,"xy")},_mapSize:function(e,t,n){var i,a,o=this._findSpecialBarSzie(t,n),r=o.barWidthMap,s=o.barMaxWidthMap,l=o.barMinHeightMap,h=o.sBarWidthCounter,m=o.sBarWidthTotal,V=o.barGap,U=o.barCategoryGap,d=1;if(t.length!=h){if(n)i=e.getGap(),V=0,a=Math.floor(i/t.length),0>=a&&(d=Math.floor(t.length/i),a=1);else if(i="string"==typeof U&&U.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(U))/100):e.getGap()-U,"string"==typeof V&&V.match(/%$/)?(V=parseFloat(V)/100,a=Math.floor((i-m)/((t.length-1)*V+t.length-h)),V=Math.floor(a*V)):(V=parseFloat(V),a=Math.floor((i-m-V*(t.length-1))/(t.length-h))),0>=a)return this._mapSize(e,t,!0)}else if(i=h>1?"string"==typeof U&&U.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(U))/100):e.getGap()-U:m,a=0,V=h>1?Math.floor((i-m)/(h-1)):0,0>V)return this._mapSize(e,t,!0);return this._recheckBarMaxWidth(t,r,s,l,i,a,V,d)},_findSpecialBarSzie:function(e,t){for(var n,i,a,o,r=this.series,s={},l={},h={},m=0,V=0,U=0,d=e.length;d>U;U++)for(var p={barWidth:!1,barMaxWidth:!1},c=0,u=e[U].length;u>c;c++){var y=e[U][c],b=r[y];if(!t){if(p.barWidth)s[y]=n;else if(n=this.query(b,"barWidth"),null!=n){s[y]=n,V+=n,m++,p.barWidth=!0;for(var g=0,k=c;k>g;g++){var f=e[U][g];s[f]=n}}if(p.barMaxWidth)l[y]=i;else if(i=this.query(b,"barMaxWidth"),null!=i){l[y]=i,p.barMaxWidth=!0;for(var g=0,k=c;k>g;g++){var f=e[U][g];l[f]=i}}}h[y]=this.query(b,"barMinHeight"),a=null!=a?a:this.query(b,"barGap"),o=null!=o?o:this.query(b,"barCategoryGap")}return{barWidthMap:s,barMaxWidthMap:l,barMinHeightMap:h,sBarWidth:n,sBarMaxWidth:i,sBarWidthCounter:m,sBarWidthTotal:V,barGap:a,barCategoryGap:o}},_recheckBarMaxWidth:function(e,t,n,i,a,o,r,s){for(var l=0,h=e.length;h>l;l++){var m=e[l][0];n[m]&&n[m]<o&&(a-=o-n[m])}return{barWidthMap:t,barMaxWidthMap:n,barMinHeightMap:i,gap:a,barWidth:o,barGap:r,interval:s}},_getBarItem:function(e,t,n,i,a,o,s,h){var m,V=this.series,U=V[e],d=U.data[t],p=this._sIndex2ColorMap[e],c=[d,U],u=this.deepQuery(c,"itemStyle.normal.color")||p,y=this.deepQuery(c,"itemStyle.emphasis.color"),b=this.deepMerge(c,"itemStyle.normal"),g=b.barBorderWidth,k=this.deepMerge(c,"itemStyle.emphasis");if(m={zlevel:this._zlevelBase,clickable:this.deepQuery(c,"clickable"),style:{x:i,y:a,width:o,height:s,brushType:"both",color:this.getItemStyleColor(u,e,t,d),radius:b.barBorderRadius,lineWidth:g,strokeColor:b.barBorderColor},highlightStyle:{color:this.getItemStyleColor(y,e,t,d),radius:k.barBorderRadius,lineWidth:k.barBorderWidth,strokeColor:k.barBorderColor},_orient:h},m.highlightStyle.color=m.highlightStyle.color||("string"==typeof m.style.color?l.lift(m.style.color,-.3):m.style.color),g>0&&m.style.height>g&&m.style.width>g?(m.style.y+=g/2,m.style.height-=g,m.style.x+=g/2,m.style.width-=g):m.style.brushType="fill",m.highlightStyle.textColor=m.highlightStyle.color,m=this.addLabel(m,U,d,n,h),"insideLeft"===m.style.textPosition||"insideRight"===m.style.textPosition||"insideTop"===m.style.textPosition||"insideBottom"===m.style.textPosition){var f=5;switch(m.style.textPosition){case"insideLeft":m.style.textX=m.style.x+f,m.style.textY=m.style.y+m.style.height/2,m.style.textAlign="left",m.style.textBaseline="middle";break;case"insideRight":m.style.textX=m.style.x+m.style.width-f,m.style.textY=m.style.y+m.style.height/2,m.style.textAlign="right",m.style.textBaseline="middle";break;case"insideTop":m.style.textX=m.style.x+m.style.width/2,m.style.textY=m.style.y+f/2,m.style.textAlign="center",m.style.textBaseline="top";break;case"insideBottom":m.style.textX=m.style.x+m.style.width/2,m.style.textY=m.style.y+m.style.height-f/2,m.style.textAlign="center",m.style.textBaseline="bottom"}m.style.textPosition="specific",m.style.textColor=m.style.textColor||"#fff"}return this.deepQuery([d,U,this.option],"calculable")&&(this.setCalculable(m),m.draggable=!0),r.pack(m,V[e],e,V[e].data[t],t,n),m},getMarkCoord:function(e,t){var n,i,a=this.series[e],o=this.xMarkMap[e],r=this.component.xAxis.getAxis(a.xAxisIndex),s=this.component.yAxis.getAxis(a.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)if(o.isHorizontal){n="string"==typeof t.xAxis&&r.getIndexByName?r.getIndexByName(t.xAxis):t.xAxis||0;var l=o[n];l=null!=l?l:"string"!=typeof t.xAxis&&r.getCoordByIndex?r.getCoordByIndex(t.xAxis||0):r.getCoord(t.xAxis||0),i=[l,s.getCoord(t.yAxis||0)]}else{n="string"==typeof t.yAxis&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var h=o[n];h=null!=h?h:"string"!=typeof t.yAxis&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),i=[r.getCoord(t.xAxis||0),h]}else{var m=null!=t.valueIndex?t.valueIndex:null!=o.maxX0?"1":"";i=[o[t.type+"X"+m],o[t.type+"Y"+m],o[t.type+"Line"+m],o[t.type+m]]}return i},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,n={},i=0,a=e.length;a>i;i++)n[e[i][0]]=e[i];for(var o,s,l,h,m,V,U,i=this.shapeList.length-1;i>=0;i--)if(V=r.get(this.shapeList[i],"seriesIndex"),n[V]&&!n[V][3]&&"rectangle"===this.shapeList[i].type){if(U=r.get(this.shapeList[i],"dataIndex"),m=t[V],n[V][2]&&U===m.data.length-1){this.zr.delShape(this.shapeList[i].id);continue}if(!n[V][2]&&0===U){this.zr.delShape(this.shapeList[i].id);continue}"horizontal"===this.shapeList[i]._orient?(h=this.component.yAxis.getAxis(m.yAxisIndex||0).getGap(),l=n[V][2]?-h:h,o=0):(s=this.component.xAxis.getAxis(m.xAxisIndex||0).getGap(),o=n[V][2]?s:-s,l=0),this.shapeList[i].position=[0,0],this.zr.animate(this.shapeList[i].id,"").when(500,{position:[o,l]}).start()}}},s.inherits(t,i),s.inherits(t,n),e("../chart").define("bar",t),t}),n("echarts/chart/scatter",["require","../component/base","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,a,o,r){n.call(this,e,t,a,o,r),i.call(this),this.refresh(o)}var n=e("../component/base"),i=e("./base"),a=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var o=e("../config"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:o.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};for(var t,n,i,a,r=this.component.legend,l=[],h=0,m=e.length;m>h;h++)if(t=e[h],n=t.name,t.type===o.CHART_TYPE_SCATTER){if(e[h]=this.reformOption(e[h]),this.legendHoverLink=e[h].legendHoverLink||this.legendHoverLink,this._sIndex2ShapeMap[h]=this.query(t,"symbol")||this._symbol[h%this._symbol.length],r){if(this.selectedMap[n]=r.isSelected(n),this._sIndex2ColorMap[h]=s.alpha(r.getColor(n),.5),i=r.getItemShape(n)){var a=this._sIndex2ShapeMap[h];i.style.brushType=a.match("empty")?"stroke":"both",a=a.replace("empty","").toLowerCase(),a.match("rectangle")&&(i.style.x+=Math.round((i.style.width-i.style.height)/2),i.style.width=i.style.height),a.match("star")&&(i.style.n=a.replace("star","")-0||5,a="star"),a.match("image")&&(i.style.image=a.replace(new RegExp("^image:\\/\\/"),""),i.style.x+=Math.round((i.style.width-i.style.height)/2),i.style.width=i.style.height,a="image"),i.style.iconType=a,r.setItemShape(n,i)}}else this.selectedMap[n]=!0,this._sIndex2ColorMap[h]=s.alpha(this.zr.getColor(h),.5);this.selectedMap[n]&&l.push(h)}this._buildSeries(l),this.addShapeList()},_buildSeries:function(e){if(0!==e.length){for(var t,n,i,a,o,r,s,l,h=this.series,m={},V=0,U=e.length;U>V;V++)if(t=e[V],n=h[t],0!==n.data.length){o=this.component.xAxis.getAxis(n.xAxisIndex||0),r=this.component.yAxis.getAxis(n.yAxisIndex||0),m[t]=[];for(var d=0,p=n.data.length;p>d;d++)i=n.data[d],a=null!=i?null!=i.value?i.value:i:"-","-"===a||a.length<2||(s=o.getCoord(a[0]),l=r.getCoord(a[1]),m[t].push([s,l,d,i.name||""]));this.xMarkMap[t]=this._markMap(o,r,n.data,m[t]),this.buildMark(t)}this._buildPointList(m)}},_markMap:function(e,t,n,i){for(var a,o={min0:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,sum0:0,counter0:0,average0:0,min1:Number.POSITIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum1:0,counter1:0,average1:0},r=0,s=i.length;s>r;r++)a=n[i[r][2]].value||n[i[r][2]],o.min0>a[0]&&(o.min0=a[0],o.minY0=i[r][1],o.minX0=i[r][0]),o.max0<a[0]&&(o.max0=a[0],o.maxY0=i[r][1],o.maxX0=i[r][0]),o.sum0+=a[0],o.counter0++,o.min1>a[1]&&(o.min1=a[1],o.minY1=i[r][1],o.minX1=i[r][0]),o.max1<a[1]&&(o.max1=a[1],o.maxY1=i[r][1],o.maxX1=i[r][0]),o.sum1+=a[1],o.counter1++;var l=this.component.grid.getX(),h=this.component.grid.getXend(),m=this.component.grid.getY(),V=this.component.grid.getYend();o.average0=(o.sum0/o.counter0).toFixed(2)-0;var U=e.getCoord(o.average0);o.averageLine0=[[U,V],[U,m]],o.minLine0=[[o.minX0,V],[o.minX0,m]],o.maxLine0=[[o.maxX0,V],[o.maxX0,m]],o.average1=(o.sum1/o.counter1).toFixed(2)-0;var d=t.getCoord(o.average1);return o.averageLine1=[[l,d],[h,d]],o.minLine1=[[l,o.minY1],[h,o.minY1]],o.maxLine1=[[l,o.maxY1],[h,o.maxY1]],o},_buildPointList:function(e){var t,n,i,a,o=this.series;for(var r in e)if(t=o[r],n=e[r],t.large&&t.data.length>t.largeThreshold)this.shapeList.push(this._getLargeSymbol(n,this.getItemStyleColor(this.query(t,"itemStyle.normal.color"),r,-1)||this._sIndex2ColorMap[r]));else for(var s=0,l=n.length;l>s;s++)i=n[s],a=this._getSymbol(r,i[2],i[3],i[0],i[1]),a&&this.shapeList.push(a)},_getSymbol:function(e,t,n,i,a){var o,r=this.series,s=r[e],l=s.data[t],h=this.component.dataRange;if(h){if(o=isNaN(l[2])?this._sIndex2ColorMap[e]:h.getColor(l[2]),!o)return null}else o=this._sIndex2ColorMap[e];var m=this.getSymbolShape(s,e,l,t,n,i,a,this._sIndex2ShapeMap[e],o,"rgba(0,0,0,0)","vertical");return m.zlevel=this._zlevelBase,m._main=!0,m},_getLargeSymbol:function(e,t){return new a({zlevel:this._zlevelBase,_main:!0,hoverable:!1,style:{pointList:e,color:t,strokeColor:t},highlightStyle:{pointList:[]}})},getMarkCoord:function(e,t){var n,i=this.series[e],a=this.xMarkMap[e],o=this.component.xAxis.getAxis(i.xAxisIndex),r=this.component.yAxis.getAxis(i.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)n=["string"!=typeof t.xAxis&&o.getCoordByIndex?o.getCoordByIndex(t.xAxis||0):o.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&r.getCoordByIndex?r.getCoordByIndex(t.yAxis||0):r.getCoord(t.yAxis||0)];else{var s=null!=t.valueIndex?t.valueIndex:1;n=[a[t.type+"X"+s],a[t.type+"Y"+s],a[t.type+"Line"+s],a[t.type+s]]}return n},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ondataRange:function(e,t){this.component.dataRange&&(this.refresh(),t.needRefresh=!0)}},r.inherits(t,i),r.inherits(t,n),e("../chart").define("scatter",t),t}),n("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/event","zrender/tool/area","zrender/tool/color","../component"],function(e){function t(e,t,i,a,o){if("undefined"==typeof this.query(a,"dataRange.min")||"undefined"==typeof this.query(a,"dataRange.max"))return void console.error("option.dataRange.min or option.dataRange.max has not been defined.");n.call(this,e,t,i,a,o);var s=this;s._ondrift=function(e,t){return s.__ondrift(this,e,t)},s._ondragend=function(){return s.__ondragend()},s._dataRangeSelected=function(e){return s.__dataRangeSelected(e)},s._dispatchHoverLink=function(e){return s.__dispatchHoverLink(e)},s._onhoverlink=function(e){return s.__onhoverlink(e)},this._selectedMap={},this._range={},this.refresh(a),t.bind(r.EVENT.HOVER,this._onhoverlink)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Rectangle"),o=e("../util/shape/HandlePolygon"),r=e("../config"),s=e("zrender/tool/util"),l=e("zrender/tool/event"),h=e("zrender/tool/area"),m=e("zrender/tool/color");return t.prototype={type:r.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){if(this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem(),this.dataRangeOption.show)for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e]);this._syncShapeFromRange()},_buildItem:function(){var e,t,n,o,r=this._valueTextList,s=r.length,l=this.getFont(this.dataRangeOption.textStyle),m=this._itemGroupLocation.x,V=this._itemGroupLocation.y,U=this.dataRangeOption.itemWidth,d=this.dataRangeOption.itemHeight,p=this.dataRangeOption.itemGap,c=h.getTextHeight("国",l);"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(m=this._itemGroupLocation.x+this._itemGroupLocation.width-U);var u=!0;this.dataRangeOption.text&&(u=!1,this.dataRangeOption.text[0]&&(n=this._getTextShape(m,V,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?m+=h.getTextWidth(this.dataRangeOption.text[0],l)+this._textGap:(V+=c+this._textGap,n.style.y+=c/2+this._textGap,n.style.textBaseline="bottom"),this.shapeList.push(new i(n))));for(var y=0;s>y;y++)e=r[y],o=this.getColorByIndex(y),t=this._getItemShape(m,V,U,d,this._selectedMap[y]?o:"#ccc"),t._idx=y,t.onmousemove=this._dispatchHoverLink,t.onclick=this._dataRangeSelected,this.shapeList.push(new a(t)),u&&(n={zlevel:this._zlevelBase,style:{x:m+U+5,y:V,color:this._selectedMap[y]?this.dataRangeOption.textStyle.color:"#ccc",text:r[y],textFont:l,textBaseline:"top"},highlightStyle:{brushType:"fill"},clickable:!0},"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(n.style.x-=U+10,n.style.textAlign="right"),n._idx=y,n.onclick=this._dataRangeSelected,this.shapeList.push(new i(n))),"horizontal"==this.dataRangeOption.orient?m+=U+(u?5:0)+(u?h.getTextWidth(e,l):0)+p:V+=d+p;!u&&this.dataRangeOption.text[1]&&("horizontal"==this.dataRangeOption.orient?m=m-p+this._textGap:V=V-p+this._textGap,n=this._getTextShape(m,V,this.dataRangeOption.text[1]),"horizontal"!=this.dataRangeOption.orient&&(n.style.y-=5,n.style.textBaseline="top"),this.shapeList.push(new i(n)))},_buildGradient:function(){var t,n,o=this.getFont(this.dataRangeOption.textStyle),r=this._itemGroupLocation.x,s=this._itemGroupLocation.y,l=this.dataRangeOption.itemWidth,m=this.dataRangeOption.itemHeight,V=h.getTextHeight("国",o),U=!0;this.dataRangeOption.text&&(U=!1,this.dataRangeOption.text[0]&&(n=this._getTextShape(r,s,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?r+=h.getTextWidth(this.dataRangeOption.text[0],o)+this._textGap:(s+=V+this._textGap,n.style.y+=V/2+this._textGap,n.style.textBaseline="bottom"),this.shapeList.push(new i(n))));for(var d=e("zrender/tool/color"),p=1/(this.dataRangeOption.color.length-1),c=[],u=0,y=this.dataRangeOption.color.length;y>u;u++)c.push([u*p,this.dataRangeOption.color[u]]);"horizontal"==this.dataRangeOption.orient?(t={zlevel:this._zlevelBase,style:{x:r,y:s,width:10*l,height:m,color:d.getLinearGradient(r,s,r+10*l,s,c)},hoverable:!1},r+=10*l+this._textGap):(t={zlevel:this._zlevelBase,style:{x:r,y:s,width:l,height:10*m,color:d.getLinearGradient(r,s,r,s+10*m,c)},hoverable:!1},s+=10*m+this._textGap),this.shapeList.push(new a(t)),this._calculableLocation=t.style,this.dataRangeOption.calculable&&(this._buildFiller(),this._bulidMask(),this._bulidHandle()),this._buildIndicator(),!U&&this.dataRangeOption.text[1]&&(n=this._getTextShape(r,s,this.dataRangeOption.text[1]),this.shapeList.push(new i(n)))},_buildIndicator:function(){var e,t,n=this._calculableLocation.x,i=this._calculableLocation.y,a=this._calculableLocation.width,r=this._calculableLocation.height,s=5;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(e=[[n,i+r],[n-s,i+r+s],[n+s,i+r+s]],t="bottom"):(e=[[n,i],[n-s,i-s],[n+s,i-s]],t="top"):"right"!=this.dataRangeOption.x?(e=[[n+a,i],[n+a+s,i-s],[n+a+s,i+s]],t="right"):(e=[[n,i],[n-s,i-s],[n-s,i+s]],t="left"),this._indicatorShape={style:{pointList:e,color:"#fff",__rect:{x:Math.min(e[0][0],e[1][0]),y:Math.min(e[0][1],e[1][1]),width:s*("horizontal"==this.dataRangeOption.orient?2:1),height:s*("horizontal"==this.dataRangeOption.orient?1:2)}},highlightStyle:{brushType:"fill",textPosition:t,textColor:this.dataRangeOption.textStyle.color},hoverable:!1},this._indicatorShape=new o(this._indicatorShape)},_buildFiller:function(){this._fillerShape={zlevel:this._zlevelBase+1,style:{x:this._calculableLocation.x,y:this._calculableLocation.y,width:this._calculableLocation.width,height:this._calculableLocation.height,color:"rgba(255,255,255,0)"},highlightStyle:{strokeColor:"rgba(255,255,255,0.5)",lineWidth:1},draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,onmousemove:this._dispatchHoverLink,_type:"filler"},this._fillerShape=new a(this._fillerShape),this.shapeList.push(this._fillerShape)},_bulidHandle:function(){var e,t,n,i,a,r,s,l,m=this._calculableLocation.x,V=this._calculableLocation.y,U=this._calculableLocation.width,d=this._calculableLocation.height,p=this.getFont(this.dataRangeOption.textStyle),c=h.getTextHeight("国",p),u=Math.max(h.getTextWidth(this._textFormat(this.dataRangeOption.max),p),h.getTextWidth(this._textFormat(this.dataRangeOption.min),p))+2;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(e=[[m,V],[m,V+d+c],[m-c,V+d+c],[m-1,V+d],[m-1,V]],t=m-u/2-c,n=V+d+c/2+2,i={x:m-u-c,y:V+d,width:u+c,height:c},a=[[m+U,V],[m+U,V+d+c],[m+U+c,V+d+c],[m+U+1,V+d],[m+U+1,V]],r=m+U+u/2+c,s=n,l={x:m+U,y:V+d,width:u+c,height:c}):(e=[[m,V+d],[m,V-c],[m-c,V-c],[m-1,V],[m-1,V+d]],t=m-u/2-c,n=V-c/2-2,i={x:m-u-c,y:V-c,width:u+c,height:c},a=[[m+U,V+d],[m+U,V-c],[m+U+c,V-c],[m+U+1,V],[m+U+1,V+d]],r=m+U+u/2+c,s=n,l={x:m+U,y:V-c,width:u+c,height:c}):(u+=c,"right"!=this.dataRangeOption.x?(e=[[m,V],[m+U+c,V],[m+U+c,V-c],[m+U,V-1],[m,V-1]],t=m+U+u/2+c/2,n=V-c/2,i={x:m+U,y:V-c,width:u+c,height:c},a=[[m,V+d],[m+U+c,V+d],[m+U+c,V+c+d],[m+U,V+1+d],[m,V+d+1]],r=t,s=V+d+c/2,l={x:m+U,y:V+d,width:u+c,height:c}):(e=[[m+U,V],[m-c,V],[m-c,V-c],[m,V-1],[m+U,V-1]],t=m-u/2-c/2,n=V-c/2,i={x:m-u-c,y:V-c,width:u+c,height:c},a=[[m+U,V+d],[m-c,V+d],[m-c,V+c+d],[m,V+1+d],[m+U,V+d+1]],r=t,s=V+d+c/2,l={x:m-u-c,y:V+d,width:u+c,height:c})),this._startShape={style:{pointList:e,text:this._textFormat(this.dataRangeOption.max),textX:t,textY:n,color:this.getColor(this.dataRangeOption.max),rect:i,x:e[0][0],y:e[0][1],_x:e[0][0],_y:e[0][1]}},this._startShape.highlightStyle={strokeColor:this._startShape.style.color,lineWidth:1},this._endShape={style:{pointList:a,text:this._textFormat(this.dataRangeOption.min),textX:r,textY:s,color:this.getColor(this.dataRangeOption.min),rect:l,x:a[0][0],y:a[0][1],_x:a[0][0],_y:a[0][1]}},this._endShape.highlightStyle={strokeColor:this._endShape.style.color,lineWidth:1},this._startShape.zlevel=this._endShape.zlevel=this._zlevelBase+1,this._startShape.draggable=this._endShape.draggable=!0,this._startShape.ondrift=this._endShape.ondrift=this._ondrift,this._startShape.ondragend=this._endShape.ondragend=this._ondragend,this._startShape.style.textColor=this._endShape.style.textColor=this.dataRangeOption.textStyle.color,this._startShape.style.textAlign=this._endShape.style.textAlign="center",this._startShape.style.textPosition=this._endShape.style.textPosition="specific",this._startShape.style.textBaseline=this._endShape.style.textBaseline="middle",this._startShape.style.width=this._endShape.style.width=0,this._startShape.style.height=this._endShape.style.height=0,this._startShape.style.textPosition=this._endShape.style.textPosition="specific",this._startShape=new o(this._startShape),this._endShape=new o(this._endShape),this.shapeList.push(this._startShape),this.shapeList.push(this._endShape)},_bulidMask:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,i=this._calculableLocation.height;this._startMask={zlevel:this._zlevelBase+1,style:{x:e,y:t,width:"horizontal"==this.dataRangeOption.orient?0:n,height:"horizontal"==this.dataRangeOption.orient?i:0,color:"#ccc"},hoverable:!1},this._endMask={zlevel:this._zlevelBase+1,style:{x:"horizontal"==this.dataRangeOption.orient?e+n:e,y:"horizontal"==this.dataRangeOption.orient?t:t+i,width:"horizontal"==this.dataRangeOption.orient?0:n,height:"horizontal"==this.dataRangeOption.orient?i:0,color:"#ccc"},hoverable:!1},this._startMask=new a(this._startMask),this._endMask=new a(this._endMask),this.shapeList.push(this._startMask),this.shapeList.push(this._endMask)},_buildBackground:function(){var e=this.reformCssArray(this.dataRangeOption.padding);this.shapeList.push(new a({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.dataRangeOption.borderWidth?"fill":"both",color:this.dataRangeOption.backgroundColor,strokeColor:this.dataRangeOption.borderColor,lineWidth:this.dataRangeOption.borderWidth}}))},_getItemGroupLocation:function(){var e=this._valueTextList,t=e.length,n=this.dataRangeOption.itemGap,i=this.dataRangeOption.itemWidth,a=this.dataRangeOption.itemHeight,o=0,r=0,s=this.getFont(this.dataRangeOption.textStyle),l=h.getTextHeight("国",s);if("horizontal"==this.dataRangeOption.orient){if(this.dataRangeOption.text||this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable)o=(this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?10*i+n:t*(i+n))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?h.getTextWidth(this.dataRangeOption.text[0],s)+this._textGap:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?h.getTextWidth(this.dataRangeOption.text[1],s)+this._textGap:0);else{i+=5;for(var m=0;t>m;m++)o+=i+h.getTextWidth(e[m],s)+n}o-=n,r=Math.max(l,a)}else{var V;if(this.dataRangeOption.text||this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable)r=(this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?10*a+n:t*(a+n))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?this._textGap+l:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?this._textGap+l:0),V=Math.max(h.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[0]||"",s),h.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[1]||"",s)),o=Math.max(i,V);else{r=(a+n)*t,i+=5,V=0;for(var m=0;t>m;m++)V=Math.max(V,h.getTextWidth(e[m],s));o=i+V}r-=n}var U,d=this.reformCssArray(this.dataRangeOption.padding),p=this.zr.getWidth();switch(this.dataRangeOption.x){case"center":U=Math.floor((p-o)/2);break;case"left":U=d[3]+this.dataRangeOption.borderWidth;break;case"right":U=p-o-d[1]-this.dataRangeOption.borderWidth;break;default:U=this.parsePercent(this.dataRangeOption.x,p),U=isNaN(U)?0:U}var c,u=this.zr.getHeight();switch(this.dataRangeOption.y){case"top":c=d[0]+this.dataRangeOption.borderWidth;break;case"bottom":c=u-r-d[2]-this.dataRangeOption.borderWidth;break;case"center":c=Math.floor((u-r)/2);break;default:c=this.parsePercent(this.dataRangeOption.y,u),c=isNaN(c)?0:c}if(this.dataRangeOption.calculable){var y=Math.max(h.getTextWidth(this.dataRangeOption.max,s),h.getTextWidth(this.dataRangeOption.min,s))+l;"horizontal"==this.dataRangeOption.orient?(y>U&&(U=y),U+o+y>p&&(U-=y)):(l>c&&(c=l),c+r+l>u&&(c-=l))}return{x:U,y:c,width:o,height:r}},_getTextShape:function(e,t,n){return{zlevel:this._zlevelBase,style:{x:"horizontal"==this.dataRangeOption.orient?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:"horizontal"==this.dataRangeOption.orient?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:"horizontal"==this.dataRangeOption.orient?"middle":"top",textAlign:"horizontal"==this.dataRangeOption.orient?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,i,a){return{zlevel:this._zlevelBase,style:{x:e,y:t+1,width:n,height:i-2,color:a},highlightStyle:{strokeColor:a,lineWidth:1},clickable:!0}},__ondrift:function(e,t,n){var i=this._calculableLocation.x,a=this._calculableLocation.y,o=this._calculableLocation.width,r=this._calculableLocation.height;return"horizontal"==this.dataRangeOption.orient?e.style.x+t<=i?e.style.x=i:e.style.x+t+e.style.width>=i+o?e.style.x=i+o-e.style.width:e.style.x+=t:e.style.y+n<=a?e.style.y=a:e.style.y+n+e.style.height>=a+r?e.style.y=a+r-e.style.height:e.style.y+=n,"filler"==e._type?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(!this.dataRangeOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,this.dataRangeOption.realtime||this.messageCenter.dispatch(r.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart),t.needRefresh=!1,this.isDragend=!1)},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};if(this._range.end="undefined"!=typeof this._range.end?this._range.end:"undefined"!=typeof e.start?e.start:0,this._range.start="undefined"!=typeof this._range.start?this._range.start:"undefined"!=typeof e.end?e.end:100,100!=this._range.start||0!==this._range.end){if("horizontal"==this.dataRangeOption.orient){var t=this._fillerShape.style.width;this._fillerShape.style.x+=t*(100-this._range.start)/100,this._fillerShape.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShape.style.height;this._fillerShape.style.y+=n*(100-this._range.start)/100,this._fillerShape.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShape.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,i=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(this._startShape.style.x=this._fillerShape.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShape.style.x+this._fillerShape.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShape.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShape.style.y+this._fillerShape.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+i-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/i*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/i*100)),this._syncShape()},_syncFillerShape:function(e){var t,n,i=this._calculableLocation.x,a=this._calculableLocation.y,o=this._calculableLocation.width,r=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(t=this._startShape.style.x,n=this._endShape.style.x,e.id==this._startShape.id&&t>=n?(n=t,this._endShape.style.x=t):e.id==this._endShape.id&&t>=n&&(t=n,this._startShape.style.x=t),this._fillerShape.style.x=t,this._fillerShape.style.width=n-t,this._startMask.style.width=t-i,this._endMask.style.x=n,this._endMask.style.width=i+o-n,this._range.start=Math.ceil(100-(t-i)/o*100),this._range.end=Math.floor(100-(n-i)/o*100)):(t=this._startShape.style.y,n=this._endShape.style.y,e.id==this._startShape.id&&t>=n?(n=t,this._endShape.style.y=t):e.id==this._endShape.id&&t>=n&&(t=n,this._startShape.style.y=t),this._fillerShape.style.y=t,this._fillerShape.style.height=n-t,this._startMask.style.height=t-a,this._endMask.style.y=n,this._endMask.style.height=a+r-n,this._range.start=Math.ceil(100-(t-a)/r*100),this._range.end=Math.floor(100-(n-a)/r*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShape.id),this.zr.refresh()},_syncData:function(){this.dataRangeOption.realtime&&this.messageCenter.dispatch(r.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){var t=e.target._idx;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(r.EVENT.REFRESH,null,null,this.myChart)},__dispatchHoverLink:function(e){var t,n;if(this.dataRangeOption.calculable){var i,a=this.dataRangeOption.max-this.dataRangeOption.min;i="horizontal"==this.dataRangeOption.orient?(1-(l.getX(e.event)-this._calculableLocation.x)/this._calculableLocation.width)*a:(1-(l.getY(e.event)-this._calculableLocation.y)/this._calculableLocation.height)*a,t=i-.05*a,n=i+.05*a}else{var o=e.target._idx;n=(this._colorList.length-o)*this._gap+this.dataRangeOption.min,t=n-this._gap}this.messageCenter.dispatch(r.EVENT.DATA_RANGE_HOVERLINK,e.event,{valueMin:t,valueMax:n},this.myChart)},__onhoverlink:function(e){if(this.dataRangeOption.show&&this.dataRangeOption.hoverLink&&this._indicatorShape&&e&&null!=e.seriesIndex&&null!=e.dataIndex){var t=e.value;if(isNaN(t))return;t<this.dataRangeOption.min?t=this.dataRangeOption.min:t>this.dataRangeOption.max&&(t=this.dataRangeOption.max),this._indicatorShape.position="horizontal"==this.dataRangeOption.orient?[(this.dataRangeOption.max-t)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.width,0]:[0,(this.dataRangeOption.max-t)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.height],this._indicatorShape.style.text=e.value,this._indicatorShape.style.color=this.getColor(t),this.zr.addHoverShape(this._indicatorShape)}},_textFormat:function(e,t){if(e=e.toFixed(this.dataRangeOption.precision),t="undefined"!=typeof t?t.toFixed(this.dataRangeOption.precision):"",this.dataRangeOption.formatter){if("string"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if("function"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.call(this.myChart,e,t)}return""!==t?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.dataRangeOption=this.option.dataRange,this.myChart.canvasSupported||(this.dataRangeOption.realtime=!1);var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;if(this._colorList=m.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1),this._colorList.length>t){for(var n=this._colorList.length,i=[this._colorList[0]],a=n/(t-1),o=1;t-1>o;o++)i.push(this._colorList[Math.floor(o*a)]);i.push(this._colorList[n-1]),this._colorList=i}var r=this.dataRangeOption.precision;for(this._gap=(this.dataRangeOption.max-this.dataRangeOption.min)/t;this._gap.toFixed(r)-0!=this._gap&&5>r;)r++;this.dataRangeOption.precision=r,this._gap=((this.dataRangeOption.max-this.dataRangeOption.min)/t).toFixed(r)-0,this._valueTextList=[];for(var o=0;t>o;o++)this._selectedMap[o]=!0,this._valueTextList.unshift(this._textFormat(o*this._gap+this.dataRangeOption.min,(o+1)*this._gap+this.dataRangeOption.min))}this.clear(),this._buildShape() |