2 lines
152 KiB
JavaScript
2 lines
152 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).F2={})}(this,(function(t){"use strict";var e=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},i={}.toString,n=function(t,e){return i.call(t)==="[object "+e+"]"},r=function(t){return n(t,"Function")},a=function(t){return null==t},s=function(t){return Array.isArray?Array.isArray(t):n(t,"Array")},o=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function h(t,e){if(t)if(s(t))for(var i=0,n=t.length;i<n&&!1!==e(t[i],i);i++);else if(o(t))for(var r in t)if(t.hasOwnProperty(r)&&!1===e(t[r],r))break}var l=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return h(t,(function(i,n){r(t)&&"prototype"===n||e.push(n)})),e};var u=function(t){return"object"==typeof t&&null!==t},c=function(t){if(!u(t)||!n(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var f=function(t){return n(t,"String")},g=function(t){var i=[];return h(t,(function(t){(function(t,i){return!!e(t)&&t.indexOf(i)>-1})(i,t)||i.push(t)})),i},p=function(t){return n(t,"Number")},d=function(t){return a(t)?"":t.toString()},v=function(t){var e=d(t);return e.charAt(0).toLowerCase()+e.substring(1)},y=function(t){var e=d(t);return e.charAt(0).toUpperCase()+e.substring(1)},m=function(t){return n(t,"Boolean")};function x(t,e){for(var i in e)e.hasOwnProperty(i)&&"constructor"!==i&&void 0!==e[i]&&(t[i]=e[i])}function _(t,e,i,n){return e&&x(t,e),i&&x(t,i),n&&x(t,n),t}function S(t,e,i,n){for(var r in i=i||0,n=n||5,e)if(e.hasOwnProperty(r)){var a=e[r];null!==a&&c(a)?(c(t[r])||(t[r]={}),i<n?S(t[r],a,i+1,n):t[r]=e[r]):s(a)?(t[r]=[],t[r]=t[r].concat(a)):void 0!==a&&(t[r]=a)}}var w=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=0;n<e.length;n+=1)S(t,e[n]);return t},C=function(t,i){if(t===i)return!0;if(!t||!i)return!1;if(f(t)||f(i))return!1;if(e(t)||e(i)){if(t.length!==i.length)return!1;for(var n=!0,r=0;r<t.length&&(n=C(t[r],i[r]));r++);return n}if(u(t)||u(i)){var a=Object.keys(t),s=Object.keys(i);if(a.length!==s.length)return!1;for(n=!0,r=0;r<a.length&&(n=C(t[a[r]],i[a[r]]));r++);return n}return!1};function P(t){for(var e=[],i=0,n=t.length;i<n;i++)e=e.concat(t[i]);return e}function b(t,e){for(var i=[],n={},r=0,o=t.length;r<o;r++){var l=t[r][e];a(l)||(s(l)?h(l,(function(t){n[t]||(i.push(t),n[t]=!0)})):n[l]||(i.push(l),n[l]=!0))}return i}function M(t,e){for(var i=null,n=0,r=t.length;n<r;n++){var o=t[n][e];if(!a(o)){i=s(o)?o[0]:o;break}}return i}function k(t,e){if(!e)return{0:t};for(var i=function(t){for(var i="_",n=0,r=e.length;n<r;n++)i+=t[e[n]]&&t[e[n]].toString();return i},n={},r=0,a=t.length;r<a;r++){var s=t[r],o=i(s);n[o]?n[o].push(s):n[o]=[s]}return n}function T(t,e,i){if(void 0===i&&(i={}),!e)return[t];var n=k(t,e),r=[];if(1===e.length&&i[e[0]])h(i[e[0]],(function(t){t="_"+t,r.push(n[t])}));else for(var a in n)r.push(n[a]);return r}function A(t,e){if(t){var i=t.indexOf(e);-1!==i&&t.splice(i,1)}}function D(t){if(!t.length)return{min:0,max:0};var e=Math.max.apply(null,t);return{min:Math.min.apply(null,t),max:e}}var I=Object.freeze({__proto__:null,merge:P,values:b,firstValue:M,group:T,groupToMap:k,remove:A,getRange:D}),Y=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0},O="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync,F="object"==typeof my&&"function"==typeof my.getSystemInfoSync,E=typeof global&&!1,N="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.sessionStorage;function z(t){return!(!t||"object"!=typeof t)&&(!(1!==t.nodeType||!t.nodeName)||!!t.isCanvasElement)}function B(){return window&&window.devicePixelRatio||1}function X(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function L(t){var e=X(t,"width");return"auto"===e&&(e=t.offsetWidth),parseFloat(e)}function R(t){var e=X(t,"height");return"auto"===e&&(e=t.offsetHeight),parseFloat(e)}function j(t){return t?document.getElementById(t):null}function G(t,e){var i=e.get("el");if(!i)return t;var n=i.getBoundingClientRect(),r=n.top,a=n.right,s=n.bottom,o=n.left,h=parseFloat(X(i,"padding-left")),l=parseFloat(X(i,"padding-top")),u=a-o-h-parseFloat(X(i,"padding-right")),c=s-r-l-parseFloat(X(i,"padding-bottom")),f=e.get("pixelRatio");return{x:(t.x-o-h)/u*i.width/f,y:(t.y-r-l)/c*i.height/f}}function H(t,e,i){t.addEventListener(e,i,Y)}function W(t,e,i){t.removeEventListener(e,i,Y)}function V(t,e,i,n,r){return{type:t,chart:e,native:r||null,x:void 0!==i?i:null,y:void 0!==n?n:null}}function q(t,e){var i,n=t.type;if(t.touches){var r=t.changedTouches[0]||{},a=r.x,s=r.y,o=r.clientX,h=r.clientY;if(a&&s)return V(n,e,a,s,t);i={x:o,y:h}}else i={x:t.clientX,y:t.clientY};var l=G(i,e.get("canvas"));return V(n,e,l.x,l.y,t)}function U(t,e,i){return i||(i=document.createElement("canvas").getContext("2d")),i.font=e||"12px sans-serif",i.measureText(t)}function Z(t){var e,i,n,r;return p(t)||f(t)?e=n=r=i=t:s(t)&&(e=t[0],i=a(t[1])?t[0]:t[1],n=a(t[2])?t[0]:t[2],r=a(t[3])?i:t[3]),[e,i,n,r]}function J(t,e){return void 0===t||"string"==typeof t&&-1!==t.indexOf(e)}var $=Object.freeze({__proto__:null,Array:I,upperFirst:y,lowerFirst:v,isString:f,isNumber:p,isBoolean:m,isFunction:r,isDate:function(t){return n(t,"Date")},isArray:s,isNil:a,isObject:o,isPlainObject:c,isEqual:C,deepMix:w,mix:_,each:h,uniq:g,find:function(t,e){if(!s(t))return null;var i;if(r(e)&&(i=e),c(e)&&(i=function(t){return function(t,e){var i=l(e),n=i.length;if(a(t))return!n;for(var r=0;r<n;r+=1){var s=i[r];if(e[s]!==t[s]||!(s in t))return!1}return!0}(t,e)}),i)for(var n=0;n<t.length;n+=1)if(i(t[n]))return t[n];return null},isObjectValueEqual:function(t,e){t=Object.assign({},t),e=Object.assign({},e);var i=Object.getOwnPropertyNames(t),n=Object.getOwnPropertyNames(e);if(i.length!==n.length)return!1;for(var r=0,a=i.length;r<a;r++){var s=i[r];if(t[s]!==e[s])return!1}return!0},parsePadding:Z,directionEnabled:J,isWx:O,isMy:F,isNode:E,isBrowser:N,isCanvasElement:z,getPixelRatio:B,getStyle:X,getWidth:L,getHeight:R,getDomById:j,getRelativePosition:G,addEventListener:H,removeEventListener:W,createEvent:q,measureText:U}),K={label:{fill:"#808080",fontSize:10},line:{stroke:"#E8E8E8",lineWidth:1},grid:{type:"line",stroke:"#E8E8E8",lineWidth:1,lineDash:[2]},tickLine:null,labelOffset:7.5},Q={fontFamily:'"Helvetica Neue", "San Francisco", Helvetica, Tahoma, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", sans-serif',defaultColor:"#1890FF",pixelRatio:1,padding:"auto",appendPadding:15,colors:["#1890FF","#2FC25B","#FACC14","#223273","#8543E0","#13C2C2","#3436C7","#F04864"],shapes:{line:["line","dash"],point:["circle","hollowCircle"]},sizes:[4,10],axis:{common:K,bottom:_({},K,{grid:null}),left:_({},K,{line:null}),right:_({},K,{line:null}),circle:_({},K,{line:null}),radius:_({},K,{labelOffset:4})},shape:{line:{lineWidth:2,lineJoin:"round",lineCap:"round"},point:{lineWidth:0,size:3},area:{fillOpacity:.1}},_defaultAxis:K},tt={version:"3.7.0",scales:{},widthRatio:{column:.5,rose:.999999,multiplePie:3/4},lineDash:[4,4]};function et(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function it(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function nt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}tt.setTheme=function(t){w(this,t)},tt.setTheme(Q);var rt=function(){function t(){this.__events={}}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this.__events[t]||[];i.push(e),this.__events[t]=i}},e.emit=function(t,e){var i=this;if(o(t)&&(t=(e=t)&&e.type),t){var n=this.__events[t];n&&n.length&&n.forEach((function(t){t.call(i,e)}))}},e.off=function(t,e){var i=this.__events,n=i[t];if(n&&n.length)if(e)for(var r=0,a=n.length;r<a;r++)n[r]===e&&(n.splice(r,1),r--);else delete i[t]},t}(),at=function(t){it(i,t);var e=i.prototype;function i(e){var i,n={},r=(i=t.call(this)||this).getDefaultCfg();return i._attrs=n,_(n,r,e),i}return e.getDefaultCfg=function(){return{}},e.get=function(t){return this._attrs[t]},e.set=function(t,e){this._attrs[t]=e},e.destroy=function(){this._attrs={},this.destroyed=!0},i}(rt),st=function(){function t(t){_(this,t),this._init()}var e=t.prototype;return e._init=function(){var t=this.start,e=this.end,i=Math.min(t.x,e.x),n=Math.max(t.x,e.x),r=Math.min(t.y,e.y),a=Math.max(t.y,e.y);this.tl={x:i,y:r},this.tr={x:n,y:r},this.bl={x:i,y:a},this.br={x:n,y:a},this.width=n-i,this.height=a-r},e.reset=function(t,e){this.start=t,this.end=e,this._init()},e.isInRange=function(t,e){o(t)&&(e=t.y,t=t.x);var i=this.tl,n=this.br;return i.x<=t&&t<=n.x&&i.y<=e&&e<=n.y},t}(),ot={multiply:function(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]},scale:function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[0],t[2]=e[2]*i[1],t[3]=e[3]*i[1],t[4]=e[4],t[5]=e[5],t},rotate:function(t,e,i){var n=Math.cos(i),r=Math.sin(i),a=e[0]*n+e[2]*r,s=e[1]*n+e[3]*r,o=e[0]*-r+e[2]*n,h=e[1]*-r+e[3]*n;return t[0]=a,t[1]=s,t[2]=o,t[3]=h,t[4]=e[4],t[5]=e[5],t},translate:function(t,e,i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+e[0]*i[0]+e[2]*i[1],t[5]=e[5]+e[1]*i[0]+e[3]*i[1],t},transform:function(t,e){for(var i=[].concat(t),n=0,r=e.length;n<r;n++){var a=e[n];switch(a[0]){case"t":ot.translate(i,i,[a[1],a[2]]);break;case"s":ot.scale(i,i,[a[1],a[2]]);break;case"r":ot.rotate(i,i,a[1])}}return i}},ht={create:function(){return[0,0]},length:function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)},normalize:function(t,e){var i=this.length(e);return 0===i?(t[0]=0,t[1]=0):(t[0]=e[0]/i,t[1]=e[1]/i),t},add:function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t},sub:function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t},scale:function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},direction:function(t,e){return t[0]*e[1]-e[0]*t[1]},angle:function(t,e){var i=this.dot(t,e)/(this.length(t)*this.length(e));return Math.acos(i)},angleTo:function(t,e,i){var n=this.angle(t,e),r=this.direction(t,e)>=0;return i?r?2*Math.PI-n:n:r?n:2*Math.PI-n},zero:function(t){return 0===t[0]&&0===t[1]},distance:function(t,e){var i=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(i*i+n*n)},clone:function(t){return[t[0],t[1]]},min:function(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t},max:function(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t},transformMat2d:function(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t}},lt=[1,0,0,1,0,0],ut=function(){var t=e.prototype;function e(t){var e,i;this._initDefaultCfg(),_(this,t),this.plot?(e=this.plot.bl,i=this.plot.tr,this.start=e,this.end=i):(e=this.start,i=this.end),this.init(e,i)}return t._initDefaultCfg=function(){},t._scale=function(t,e){var i=this.matrix,n=this.center;ot.translate(i,i,[n.x,n.y]),ot.scale(i,i,[t,e]),ot.translate(i,i,[-n.x,-n.y])},t.init=function(t,e){this.matrix=[].concat(lt),this.center={x:(e.x-t.x)/2+t.x,y:(e.y-t.y)/2+t.y},this.scale&&this._scale(this.scale[0],this.scale[1])},t.convertPoint=function(t){var e=this._convertPoint(t),i=[e.x,e.y];return ht.transformMat2d(i,i,this.matrix),{x:i[0],y:i[1]}},t.invertPoint=function(t){return this._invertPoint(t)},t._convertPoint=function(t){return t},t._invertPoint=function(t){return t},t.reset=function(t){this.plot=t;var e=t.bl,i=t.tr;this.start=e,this.end=i,this.init(e,i)},e}(),ct=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="cartesian",this.transposed=!1,this.isRect=!0},i.init=function(e,i){t.prototype.init.call(this,e,i),this.x={start:e.x,end:i.x},this.y={start:e.y,end:i.y}},i._convertPoint=function(t){var e=this.transposed,i=e?"y":"x",n=e?"x":"y",r=this.x,a=this.y;return{x:r.start+(r.end-r.start)*t[i],y:a.start+(a.end-a.start)*t[n]}},i._invertPoint=function(t){var e=this.transposed,i=e?"y":"x",n=e?"x":"y",r=this.x,a=this.y,s={};return s[i]=(t.x-r.start)/(r.end-r.start),s[n]=(t.y-a.start)/(a.end-a.start),s},e}(ut);function ft(t,e){return f(e)?e:t.invert(t.scale(e))}ut.Cartesian=ct,ut.Rect=ct;var gt=function(){function t(t){var e=this;this.type="base",this.name=null,this.method=null,this.values=[],this.scales=[],this.linear=null;var i=null,n=this.callback;if(t.callback){var r=t.callback;i=function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];var o=r.apply(void 0,i);return a(o)&&(o=n.apply(e,i)),o}}_(this,t),i&&_(this,{callback:i})}var e=t.prototype;return e._getAttrValue=function(t,e){var i=this.values;if(t.isCategory&&!this.linear)return i[t.translate(e)%i.length];var n=t.scale(e);return this.getLinearValue(n)},e.getLinearValue=function(t){var e=this.values,i=e.length-1,n=Math.floor(i*t),r=i*t-n,a=e[n];return a+((n===i?a:e[n+1])-a)*r},e.callback=function(t){var e=this.scales[0];return"identity"===e.type?e.value:this._getAttrValue(e,t)},e.getNames=function(){for(var t=this.scales,e=this.names,i=Math.min(t.length,e.length),n=[],r=0;r<i;r++)n.push(e[r]);return n},e.getFields=function(){var t=this.scales,e=[];return h(t,(function(t){e.push(t.field)})),e},e.getScale=function(t){return this.scales[this.names.indexOf(t)]},e.mapping=function(){for(var t=this.scales,e=this.callback,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];var a=n;if(e){for(var s=0,o=n.length;s<o;s++)n[s]=this._toOriginParam(n[s],t[s]);a=e.apply(this,n)}return a=[].concat(a)},e._toOriginParam=function(t,e){var i=t;if(!e.isLinear)if(s(t)){i=[];for(var n=0,r=t.length;n<r;n++)i.push(ft(e,t[n]))}else i=ft(e,t);return i},t}(),pt=function(t){function e(e){var i;return(i=t.call(this,e)||this).names=["x","y"],i.type="position",i}return it(e,t),e.prototype.mapping=function(t,e){var i,n,r,o=this.scales,l=this.coord,u=o[0],c=o[1];if(a(t)||a(e))return[];if(s(e)&&s(t)){i=[],n=[];for(var f=0,g=0,p=t.length,d=e.length;f<p&&g<d;f++,g++)r=l.convertPoint({x:u.scale(t[f]),y:c.scale(e[g])}),i.push(r.x),n.push(r.y)}else if(s(e))t=u.scale(t),n=[],h(e,(function(e){e=c.scale(e),r=l.convertPoint({x:t,y:e}),i&&i!==r.x?(s(i)||(i=[i]),i.push(r.x)):i=r.x,n.push(r.y)}));else if(s(t))e=c.scale(e),i=[],h(t,(function(t){t=u.scale(t),r=l.convertPoint({x:t,y:e}),n&&n!==r.y?(s(n)||(n=[n]),n.push(r.y)):n=r.y,i.push(r.x)}));else{t=u.scale(t),e=c.scale(e);var v=l.convertPoint({x:t,y:e});i=v.x,n=v.y}return[i,n]},e}(gt),dt=function(t){function e(e){var i;return(i=t.call(this,e)||this).names=["shape"],i.type="shape",i.gradient=null,i}return it(e,t),e.prototype.getLinearValue=function(t){var e=this.values;return e[Math.round((e.length-1)*t)]},e}(gt),vt=function(t){function e(e){var i;return(i=t.call(this,e)||this).names=["size"],i.type="size",i.gradient=null,i}return it(e,t),e}(gt);function yt(t,e,i,n){return t[n]+(e[n]-t[n])*i}function mt(t){return"#"+xt(t[0])+xt(t[1])+xt(t[2])}function xt(t){return 1===(t=(t=Math.round(t)).toString(16)).length&&(t="0"+t),t}var _t={black:"#000000",blue:"#0000ff",grey:"#808080",green:"#008000",orange:"#ffa500",pink:"#ffc0cb",purple:"#800080",red:"#ff0000",white:"#ffffff",yellow:"#ffff00"};function St(t){var e=[];return f(t)&&(t=t.split("-")),h(t,(function(t){var i,n;-1===t.indexOf("#")&&(t=function(t){if(_t[t])return _t[t];if("#"===t[0]){if(7===t.length)return t;var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,n){return"#"+e+e+i+i+n+n}));return _t[t]=e,e}var i=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);return i.shift(),i=mt(i),_t[t]=i,i}(t)),e.push((i=t,(n=[]).push(parseInt(i.substr(1,2),16)),n.push(parseInt(i.substr(3,2),16)),n.push(parseInt(i.substr(5,2),16)),n))})),function(t){return function(t,e){var i=t.length-1,n=Math.floor(i*e),r=i*e-n,a=t[n],s=n===i?a:t[n+1];return mt([yt(a,s,r,0),yt(a,s,r,1),yt(a,s,r,2)])}(e,t)}}var wt=function(t){function e(e){var i;return(i=t.call(this,e)||this).names=["color"],i.type="color",i.gradient=null,f(i.values)&&(i.linear=!0),i}return it(e,t),e.prototype.getLinearValue=function(t){var e=this.gradient;e||(e=St(this.values),this.gradient=e);return e(t)},e}(gt),Ct=Object.freeze({__proto__:null,Position:pt,Shape:dt,Size:vt,Color:wt}),Pt={},bt={_coord:null,draw:function(t,e){this.drawShape&&this.drawShape(t,e)},setCoord:function(t){this._coord=t},parsePoint:function(t){var e=this._coord;return e.isPolar&&(1===t.x&&(t.x=.9999999),1===t.y&&(t.y=.9999999)),e.convertPoint(t)},parsePoints:function(t){if(!t)return!1;var e=this,i=[];return t.forEach((function(t){i.push(e.parsePoint(t))})),i}},Mt={defaultShapeType:null,setCoord:function(t){this._coord=t},getShape:function(t){s(t)&&(t=t[0]);var e=this[t]||this[this.defaultShapeType];return e._coord=this._coord,e},getShapePoints:function(t,e){var i=this.getShape(t);return(i.getPoints||i.getShapePoints||this.getDefaultPoints)(e)},getDefaultPoints:function(){return[]},drawShape:function(t,e,i){var n=this.getShape(t);return e.color||(e.color=tt.colors[0]),n.draw(e,i)}};function kt(t,e){for(var i in e)e.hasOwnProperty(i)&&"constructor"!==i&&void 0!==e[i]&&(t[i]=e[i])}Pt.registerFactory=function(t,e){var i=y(t),n=_({},Mt,e);return Pt[i]=n,n.name=t,n},Pt.registerShape=function(t,e,i){var n=y(t),r=Pt[n],a=_({},bt,i);return r[e]=a,a},Pt.registShape=Pt.registerShape,Pt.getShapeFactory=function(t){return this[y(t=t||"point")]};var Tt=function(t,e,i,n){return e&&kt(t,e),i&&kt(t,i),n&&kt(t,n),t},At=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),Tt(this,t)}return t._initDefaultCfg=function(){this.adjustNames=["x","y"]},t.processAdjust=function(){},e}(),Dt=["color","size","shape"];function It(t){return s(t)?t:f(t)?t.split("*"):[t]}var Yt=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i.getDefaultCfg=function(){return{type:null,data:null,attrs:{},scales:{},container:null,styleOptions:null,chart:null,shapeType:"",generatePoints:!1,attrOptions:{},sortable:!1,startOnZero:!0,visible:!0,connectNulls:!1,ignoreEmptyGroup:!1,isInit:!1}},i.init=function(){this.get("isInit")||(this._initAttrs(),this._processData(),this.set("isInit",!0))},i._getGroupScales=function(){var t=this,e=[];return h(Dt,(function(i){var n=t.getAttr(i);n&&h(n.scales,(function(t){t&&t.isCategory&&-1===e.indexOf(t)&&e.push(t)}))})),e},i._groupData=function(t){var e=this.get("colDefs"),i=this._getGroupScales();if(i.length){var n={},r=[];return h(i,(function(t){var i=t.field;r.push(i),e&&e[i]&&e[i].values&&(n[t.field]=e[i].values)})),T(t,r,n)}return[t]},i._setAttrOptions=function(t,e){this.get("attrOptions")[t]=e;var i=this.get("attrs");Object.keys(i).length&&this._createAttr(t,e)},i._createAttrOption=function(t,e,i,n){var a={};a.field=e,i?r(i)?a.callback=i:a.values=i:a.values=n,this._setAttrOptions(t,a)},i._createAttr=function(t,e){var i=this.get("attrs"),n=this.get("coord"),r=y(t),a=It(e.field);"position"===t&&(e.coord=n);for(var s=[],o=0,h=a.length;o<h;o++){var l=a[o],u=this._createScale(l);s.push(u)}if("position"===t){var c=s[1];"polar"===n.type&&n.transposed&&this.hasAdjust("stack")&&c.values.length&&c.change({nice:!1,min:0,max:Math.max.apply(null,c.values)})}e.scales=s;var f=new Ct[r](e);return i[t]=f,f},i._initAttrs=function(){var t=this.get("attrOptions");for(var e in t)t.hasOwnProperty(e)&&this._createAttr(e,t[e])},i._createScale=function(t){var e=this.get("scales"),i=e[t];return i||(i=this.get("chart").createScale(t),e[t]=i),i},i._processData=function(){var t=this.get("data"),e=[],i=this._groupData(t);if(this.get("ignoreEmptyGroup")){var n=this.getYScale();i=i.filter((function(t){return t.some((function(t){return void 0!==t[n.field]}))}))}for(var r=0,a=i.length;r<a;r++){var s=i[r],o=this._saveOrigin(s);this.hasAdjust("dodge")&&this._numberic(o),e.push(o)}return this.get("adjust")&&this._adjustData(e),this.get("sortable")&&this._sort(e),this.emit("afterprocessdata",{dataArray:e}),this.set("dataArray",e),e},i._saveOrigin=function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i],a={};for(var s in r)a[s]=r[s];a._origin=r,e.push(a)}return e},i._numberic=function(t){for(var e=this.getAttr("position").scales,i=0,n=t.length;i<n;i++)for(var r=t[i],a=Math.min(2,e.length),s=0;s<a;s++){var o=e[s];if(o.isCategory){var h=o.field;r[h]=o.translate(r[h])}}},i._adjustData=function(t){var e=this.get("adjust");if(e){var i=y(e.type);if(!At[i])throw new Error("not support such adjust : "+e);var n=this.getXScale(),r=this.getYScale(),a=_({xField:n.field,yField:r.field},e);new At[i](a).processAdjust(t),"Stack"===i&&this._updateStackRange(r.field,r,t)}},i._updateStackRange=function(t,e,i){for(var n=P(i),r=e.min,a=e.max,s=0,o=n.length;s<o;s++){var h=n[s],l=Math.min.apply(null,h[t]),u=Math.max.apply(null,h[t]);l<r&&(r=l),u>a&&(a=u)}(r<e.min||a>e.max)&&e.change({min:r,max:a})},i._sort=function(t){var e=this.getXScale(),i=e.field,n=e.type;"identity"!==n&&e.values.length>1&&h(t,(function(t){t.sort((function(t,r){return"timeCat"===n?e._toTimeStamp(t._origin[i])-e._toTimeStamp(r._origin[i]):e.translate(t._origin[i])-e.translate(r._origin[i])}))})),this.set("hasSorted",!0),this.set("dataArray",t)},i.paint=function(){var t=this.get("dataArray"),e=[],i=this.getShapeFactory();i.setCoord(this.get("coord")),this._beforeMapping(t);for(var n=0,r=t.length;n<r;n++){var a=t[n];a.length&&(a=this._mapping(a),e.push(a),this.draw(a,i))}this.set("dataArray",e)},i.getShapeFactory=function(){var t=this.get("shapeFactory");if(!t){var e=this.get("shapeType");t=Pt.getShapeFactory(e),this.set("shapeFactory",t)}return t},i._mapping=function(t){var e=this.get("attrs"),i=this.getYScale().field,n={};for(var r in e)if(e.hasOwnProperty(r))for(var a=e[r],o=a.names,h=a.scales,l=0,u=t.length;l<u;l++){var c=t[l];if(c._originY=c[i],"position"===a.type)for(var f=this._getAttrValues(a,c),g=0,p=f.length;g<p;g++){var d=f[g];c[o[g]]=s(d)&&1===d.length?d[0]:d}else{var v=o[0],y=""+v+c[h[0].field],m=n[y];m||(m=this._getAttrValues(a,c),n[y]=m),c[v]=m[0]}}return t},i._getAttrValues=function(t,e){for(var i=t.scales,n=[],r=0,a=i.length;r<a;r++){var s=i[r],o=s.field;"identity"===s.type?n.push(s.value):n.push(e[o])}return t.mapping.apply(t,n)},i.getAttrValue=function(t,e){var i=this.getAttr(t),n=null;i&&(n=this._getAttrValues(i,e)[0]);return n},i._beforeMapping=function(t){this.get("generatePoints")&&this._generatePoints(t)},i.isInCircle=function(){var t=this.get("coord");return t&&t.isPolar},i.getCallbackCfg=function(t,e,i){if(!t)return e;var n={},a=t.map((function(t){return i[t]}));return h(e,(function(t,e){r(t)?n[e]=t.apply(null,a):n[e]=t})),n},i.getDrawCfg=function(t){var e=this.isInCircle(),i={origin:t,x:t.x,y:t.y,color:t.color,size:t.size,shape:t.shape,isInCircle:e,opacity:t.opacity},n=this.get("styleOptions");return n&&n.style&&(i.style=this.getCallbackCfg(n.fields,n.style,t._origin)),this.get("generatePoints")&&(i.points=t.points,i.nextPoints=t.nextPoints),e&&(i.center=this.get("coord").center),i},i.draw=function(t,e){var i=this,n=i.get("container"),r=i.getYScale();h(t,(function(t,s){if(!r||!a(t._origin[r.field])){t.index=s;var o=i.getDrawCfg(t),h=t.shape;i.drawShape(h,t,o,n,e)}}))},i.drawShape=function(t,e,i,n,r){var a=r.drawShape(t,i,n);a&&h([].concat(a),(function(t){t.set("origin",e)}))},i._generatePoints=function(t){var e=this,i=e.getShapeFactory(),n=e.getAttr("shape");h(t,(function(t){for(var r=0,a=t.length;r<a;r++){var s=t[r],o=e.createShapePointsCfg(s),h=n?e._getAttrValues(n,s):null,l=i.getShapePoints(h,o);s.points=l}})),h(t,(function(e,i){var n=t[i+1];n&&(e[0].nextPoints=n[0].points)}))},i.createShapePointsCfg=function(t){var e=this.getXScale(),i=this.getYScale();return{x:this._normalizeValues(t[e.field],e),y:i?this._normalizeValues(t[i.field],i):t.y?t.y:.1,y0:i?i.scale(this.getYMinValue()):void 0}},i.getYMinValue=function(){var t=this.getYScale(),e=t.min,i=t.max;return this.get("startOnZero")?i<=0&&e<=0?i:e>=0?e:0:e},i._normalizeValues=function(t,e){var i=[];if(s(t))for(var n=0,r=t.length;n<r;n++){var a=t[n];i.push(e.scale(a))}else i=e.scale(t);return i},i.getAttr=function(t){return this.get("attrs")[t]},i.getXScale=function(){return this.getAttr("position").scales[0]},i.getYScale=function(){return this.getAttr("position").scales[1]},i.hasAdjust=function(t){return this.get("adjust")&&this.get("adjust").type===t},i._getSnap=function(t,e,i){var n,r=0,a=this.getYScale().field;if(this.hasAdjust("stack")&&t.field===a){n=[],i.forEach((function(t){n.push(t._originY)}));for(var s=n.length;r<s&&!(n[0][0]>e);r++){if(n[n.length-1][1]<=e){r=n.length-1;break}if(n[r][0]<=e&&n[r][1]>e)break}}else{(n=t.values).sort((function(t,e){return t-e}));for(var o=n.length;r<o&&!(o<=1)&&!((n[0]+n[1])/2>e)&&!((n[r-1]+n[r])/2<=e&&(n[r+1]+n[r])/2>e);r++)if((n[n.length-2]+n[n.length-1])/2<=e){r=n.length-1;break}}return n[r]},i.getSnapRecords=function(t){var e=this,i=e.get("coord"),n=e.getXScale(),r=e.getYScale(),o=n.field,h=e.get("dataArray");this.get("hasSorted")||this._sort(h);var l=[],u=i.invertPoint(t),c=u.x;e.isInCircle()&&!i.transposed&&c>(1+n.rangeMax())/2&&(c=n.rangeMin());var f=n.invert(c);n.isCategory||(f=e._getSnap(n,f));var g=[];if(h.forEach((function(t){t.forEach((function(t){var i=a(t._origin)?t[o]:t._origin[o];e._isEqual(i,f,n)&&g.push(t)}))})),this.hasAdjust("stack")&&i.isPolar&&i.transposed){if(c>=0&&c<=1){var p=r.invert(u.y);p=e._getSnap(r,p,g),g.forEach((function(t){(s(p)?t._originY.toString()===p.toString():t._originY===p)&&l.push(t)}))}}else l=g;return l},i.getRecords=function(t){var e=this,i=this.getXScale(),n=this.get("dataArray"),r=i.field;return n.map((function(n){for(var s=n.length-1;s>=0;s--){var o=n[s],h=a(o._origin)?o[r]:o._origin[r];if(e._isEqual(h,t,i))return o}return null}))},i._isEqual=function(t,e,i){return"timeCat"===i.type?i._toTimeStamp(t)===e:e===t},i.position=function(t){return this._setAttrOptions("position",{field:t}),this},i.color=function(t,e){return this._createAttrOption("color",t,e,tt.colors),this},i.size=function(t,e){return this._createAttrOption("size",t,e,tt.sizes),this},i.shape=function(t,e){var i=this.get("type"),n=tt.shapes[i]||[];return this._createAttrOption("shape",t,e,n),this},i.style=function(t,e){var i,n=this.get("styleOptions");return n||(n={},this.set("styleOptions",n)),o(t)&&(e=t,t=null),t&&(i=It(t)),n.fields=i,n.style=e,this},i.adjust=function(t){return f(t)&&(t={type:t}),this.set("adjust",t),this},i.animate=function(t){return this.set("animateCfg",t),this},i.changeData=function(t){this.set("data",t),this.set("scales",{}),this.get("isInit")&&(this.set("isInit",!1),this.init())},i.clearInner=function(){var t=this.get("container");t&&t.clear()},i.reset=function(){this.set("isInit",!1),this.set("attrs",{}),this.set("attrOptions",{}),this.set("adjust",null),this.clearInner()},i.clear=function(){this.clearInner()},i.destroy=function(){this.set("isInit",!1),this.clear(),t.prototype.destroy.call(this)},i._display=function(t){this.set("visible",t);var e=this.get("container"),i=e.get("canvas");e.set("visible",t),i.draw()},i.show=function(){this._display(!0)},i.hide=function(){this._display(!1)},e}(at),Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft=function(t){var e=void 0===t?"undefined":Ot(t);return null!==t&&"object"===e||"function"===e},Et={}.toString,Nt=function(t,e){return Et.call(t)==="[object "+e+"]"},zt=Array.isArray?Array.isArray:function(t){return Nt(t,"Array")},Bt=function(t,e){if(t){if(zt(t))for(var i=0,n=t.length;i<n&&!1!==e(t[i],i);i++);else if(Ft(t))for(var r in t)if(t.hasOwnProperty(r)&&!1===e(t[r],r))break}},Xt=function(t){return null==t},Lt=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),Tt(this,t),this.init()}return t._initDefaultCfg=function(){this.type="base",this.formatter=null,this.range=[0,1],this.ticks=null,this.values=[]},t.init=function(){},t.getTicks=function(){var t=this,e=t.ticks,i=[];return Bt(e,(function(e){var n;n=Ft(e)?e:{text:t.getText(e),tickValue:e,value:t.scale(e)},i.push(n)})),i},t.getText=function(t,e){var i=this.formatter;return t=i?i(t,e):t,!Xt(t)&&t.toString||(t=""),t.toString()},t.rangeMin=function(){return this.range[0]},t.rangeMax=function(){var t=this.range;return t[t.length-1]},t.invert=function(t){return t},t.translate=function(t){return t},t.scale=function(t){return t},t.clone=function(){var t=this,e=t.constructor,i={};return Bt(t,(function(e,n){i[n]=t[n]})),new e(i)},t.change=function(t){return this.ticks=null,Tt(this,t),this.init(),this},e}(),Rt=function(t){return Nt(t,"Number")};function jt(t,e){var i=t.length;if(0===i)return NaN;var n=t[0];if(e<t[0])return NaN;if(e>=t[i-1])return t[i-1];for(var r=1;r<t.length&&!(e<t[r]);r++)n=t[r];return n}function Gt(t,e){var i,n=t.length;if(0===n)return NaN;if(e>t[n-1])return NaN;if(e<t[0])return t[0];for(var r=1;r<t.length;r++)if(e<=t[r]){i=t[r];break}return i}var Ht={snapFactorTo:function(t,e,i){if(isNaN(t))return NaN;var n=1;if(0!==t){t<0&&(n=-1);var r=function(t){var e=1;if(t===1/0||t===-1/0)throw new Error("Not support Infinity!");if(t<1){for(var i=0;t<1;)e/=10,t*=10,i++;e.toString().length>12&&(e=parseFloat(e.toFixed(i)))}else for(;t>10;)e*=10,t/=10;return e}(t*=n);n*=r,t/=r}t="floor"===i?Ht.snapFloor(e,t):"ceil"===i?Ht.snapCeiling(e,t):Ht.snapTo(e,t);var a=parseFloat((t*n).toPrecision(12));Math.abs(n)<1&&a.toString().length>12&&(a=t/parseInt(1/n)*(n>0?1:-1));return a},snapMultiple:function(t,e,i){return("ceil"===i?Math.ceil(t/e):"floor"===i?Math.floor(t/e):Math.round(t/e))*e},snapTo:function(t,e){var i=jt(t,e),n=Gt(t,e);if(isNaN(i)||isNaN(n)){if(t[0]>=e)return t[0];var r=t[t.length-1];if(r<=e)return r}return Math.abs(e-i)<Math.abs(n-e)?i:n},snapFloor:function(t,e){return jt(t,e)},snapCeiling:function(t,e){return Gt(t,e)},fixedBase:function(t,e){var i=e.toString(),n=i.indexOf("."),r=i.indexOf("e-");if(n<0&&r<0)return Math.round(t);var a=r>=0?parseInt(i.substr(r+2),10):i.substr(n+1).length;return a>20&&(a=20),parseFloat(t.toFixed(a))}},Wt=Ht,Vt=[0,1,1.2,1.5,1.6,2,2.2,2.4,2.5,3,4,5,6,7.5,8,10],qt=[0,1,2,4,5,10];var Ut=function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i;var r=n.prototype;return r._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this);this.type="linear",this.isLinear=!0,this.nice=!1,this.min=null,this.minLimit=null,this.max=null,this.maxLimit=null,this.tickCount=null,this.tickInterval=null,this.minTickInterval=null,this.snapArray=null},r.init=function(){if(this.ticks){var t=this.ticks,e=this.translate(t[0]),i=this.translate(t[t.length-1]);(Xt(this.min)||this.min>e)&&(this.min=e),(Xt(this.max)||this.max<i)&&(this.max=i)}else this.min=this.translate(this.min),this.max=this.translate(this.max),this.initTicks()},r.calculateTicks=function(){var t=this.min,e=this.max,i=this.minLimit,n=this.maxLimit,r=this.tickCount,a=this.tickInterval,s=this.minTickInterval,o=this.snapArray;if(1===r)throw new Error("linear scale'tickCount should not be 1");if(e<t)throw new Error("max: "+e+" should not be less than min: "+t);return function(t){var e=t.min,i=t.max,n=t.interval,r=t.minTickInterval,a=[],s=t.minCount||5,o=t.maxCount||7,h=s===o,l=Xt(t.minLimit)?-1/0:t.minLimit,u=Xt(t.maxLimit)?1/0:t.maxLimit,c=(s+o)/2,f=c,g=t.snapArray?t.snapArray:h?Vt:qt;if(e===l&&i===u&&h&&(n=(i-e)/(f-1)),Xt(e)&&(e=0),Xt(i)&&(i=0),Math.abs(i-e)<1e-12&&(0===e?i=1:e>0?e=0:i=0,i-e<5&&!n&&i-e>=1&&(n=1)),Xt(n)){var p=(i-e)/(c-1);n=Wt.snapFactorTo(p,g,"ceil"),o!==s&&((f=parseInt((i-e)/n,10))>o&&(f=o),f<s&&(f=s),n=Wt.snapFactorTo((i-e)/(f-1),g,"floor"))}if(Rt(r)&&n<r&&(n=r),t.interval||o!==s)i=Math.min(Wt.snapMultiple(i,n,"ceil"),u),e=Math.max(Wt.snapMultiple(e,n,"floor"),l),f=Math.round((i-e)/n),e=Wt.fixedBase(e,n),i=Wt.fixedBase(i,n);else{c=parseInt(c,10);var d,v=(i+e)/2,y=Wt.snapMultiple(v,n,"ceil"),m=Math.floor((c-2)/2),x=y+m*n;d=c%2==0?y-m*n:y-(m+1)*n;for(var _=null;x<i&&(null===_||x>_);)_=x,x=Wt.fixedBase(x+n,n);for(var S=null;d>e&&(null===S||d<S);)S=d,d=Wt.fixedBase(d-n,n);i=x,e=d}i=Math.min(i,u),e=Math.max(e,l),a.push(e);for(var w=1;w<f;w++){var C=Wt.fixedBase(n*w+e,n);C<i&&a.push(C)}return a[a.length-1]<i&&a.push(i),{min:e,max:i,interval:n,count:f,ticks:a}}({min:t,max:e,minLimit:i,maxLimit:n,minCount:r,maxCount:r,interval:a,minTickInterval:s,snapArray:o}).ticks},r.initTicks=function(){var t=this,e=t.calculateTicks();if(t.nice)t.ticks=e,t.min=e[0],t.max=e[e.length-1];else{var i=[];Bt(e,(function(e){e>=t.min&&e<=t.max&&i.push(e)})),i.length||(i.push(t.min),i.push(t.max)),t.ticks=i}},r.scale=function(t){if(Xt(t))return NaN;var e=this.max,i=this.min;if(e===i)return 0;var n=(t-i)/(e-i),r=this.rangeMin();return r+n*(this.rangeMax()-r)},r.invert=function(t){var e=(t-this.rangeMin())/(this.rangeMax()-this.rangeMin());return this.min+e*(this.max-this.min)},n}(Lt);Lt.Linear=Ut;var Zt=function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i;var r=n.prototype;return r._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.isIdentity=!0,this.type="identity",this.value=null},r.getText=function(){return this.value.toString()},r.scale=function(t){return this.value!==t&&Rt(t)?t:this.range[0]},r.invert=function(){return this.value},n}(Lt);Lt.Identity=Zt;var Jt=function(t){var e,i,n,r={},a=[],s=t.isRounding,o=(e=t.data,i=[],Bt(e,(function(t){i=i.concat(t)})),i),h=o.length,l=t.maxCount||8;if(s?2===(n=function(t,e){var i;for(i=e;i>0&&t%i!=0;i--);if(1===i)for(i=e;i>0&&(t-1)%i!=0;i--);return i}(h-1,l-1)+1)?n=l:n<l-4&&(n=l-4):n=l,!s&&h<=n+n/2)a=[].concat(o);else{for(var u=parseInt(h/(n-1),10),c=o.map((function(t,e){return e%u==0?o.slice(e,e+u):null})).filter((function(t){return t})),f=1,g=c.length;f<g&&(s?f*u<h-u:f<n-1);f++)a.push(c[f][0]);if(o.length){a.unshift(o[0]);var p=o[h-1];-1===a.indexOf(p)&&a.push(p)}}return r.categories=o,r.ticks=a,r},$t=function(t){return Nt(t,"String")};var Kt=function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i;var r=n.prototype;return r._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="cat",this.isCategory=!0,this.isRounding=!0},r.init=function(){var t=this.values,e=this.tickCount;if(Bt(t,(function(e,i){t[i]=e.toString()})),!this.ticks){var i=t;if(e)i=Jt({maxCount:e,data:t,isRounding:this.isRounding}).ticks;this.ticks=i}},r.getText=function(e){return-1===this.values.indexOf(e)&&Rt(e)&&(e=this.values[Math.round(e)]),t.prototype.getText.call(this,e)},r.translate=function(t){var e=this.values.indexOf(t);return-1===e&&Rt(t)?e=t:-1===e&&(e=NaN),e},r.scale=function(t){var e=this.rangeMin(),i=this.rangeMax();return($t(t)||-1!==this.values.indexOf(t))&&(t=this.translate(t)),e+(this.values.length>1?t/(this.values.length-1):t)*(i-e)},r.invert=function(t){if($t(t))return t;var e=this.rangeMin(),i=this.rangeMax();t<e&&(t=e),t>i&&(t=i);var n=(t-e)/(i-e),r=Math.round(n*(this.values.length-1))%this.values.length;return r=r||0,this.values[r]},n}(Lt);Lt.Cat=Kt;var Qt=Kt,te={linear:"Linear",cat:"Cat",timeCat:"TimeCat",identity:"Identity"};function ee(t){Object.keys(t).forEach((function(e){delete t[e]}))}var ie=function(){function t(t){this.defs={},this.scales={},_(this,t)}var e=t.prototype;return e.setFieldDef=function(t,e){var i=this.defs;o(t)?_(i,t):i[t]=e,this.updateScales()},e._getDef=function(t){var e=this.defs,i=null;return(tt.scales[t]||e[t])&&(i=_({},tt.scales[t]),h(e[t],(function(t,e){a(t)?delete i[e]:i[e]=t}))),i},e._getDefaultType=function(t,e,i){if(i&&i.type)return i.type;var n="linear",r=M(e,t);return s(r)&&(r=r[0]),f(r)&&(n="cat"),n},e._getScaleDef=function(t,e,i,n){var r,a={field:e,values:r=n&&n.values?n.values:b(i,e)};if("cat"!==t&&"timeCat"!==t){if(!n||!n.min||!n.max){var s=D(r),o=s.min,h=s.max;a.min=o,a.max=h,a.nice=!0}}else a.isRounding=!1;return a},e._adjustRange=function(t,e){var i=e.range,n=e.values;if("linear"===t||i||!n)return e;var r=n.length;if(1===r)e.range=[.5,1];else{var s=this.chart.get("coord"),o=tt.widthRatio.multiplePie,h=0;!function(t){if(!t.isPolar)return!1;var e=t.startAngle,i=t.endAngle;return!(!a(e)&&!a(i)&&i-e<2*Math.PI)}(s)?(h=1/r*.5,e.range=[h,1-h]):s.transposed?(h=1/r*o,e.range=[h/2,1-h/2]):e.range=[0,1-1/r]}return e},e._getScaleCfg=function(t,e){var i=this._getDef(t);if(!e||!e.length)return i&&i.type?(i.field=t,{type:te[i.type],cfg:i}):{type:"Identity",cfg:{value:t,field:t.toString(),values:[t]}};var n=e[0][t];if(null===n&&(n=M(e,t)),p(t)||a(n)&&!i)return{type:"Identity",cfg:{value:t,field:t.toString(),values:[t]}};var r=this._getDefaultType(t,e,i),s=this._getScaleDef(r,t,e,i);return i&&_(s,i),s=this._adjustRange(r,s),{type:te[r],cfg:s}},e.createScale=function(t,e){var i=this.scales,n=this._getScaleCfg(t,e),r=n.type,a=n.cfg,s=i[t];if(s&&te[s.type]===r)return s.change(a),s;var o=new Lt[r](a);return i[t]=o,o},e._updateScale=function(t){var e=t.field,i=this.chart._getScaleData(e),n=this._getScaleCfg(e,i).cfg;t.change(n)},e.updateScales=function(){var t=this;h(this.scales,(function(e){t._updateScale(e)}))},e.adjustStartZero=function(t){var e=this.defs,i=t.field,n=t.min,r=t.max;e[i]&&e[i].min||(n>0?t.change({min:0}):r<0&&t.change({max:0}))},e.clear=function(){ee(this.defs),ee(this.scales),this.data=null},t}(),ne=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),_(this,t),this.draw()}return t._initDefaultCfg=function(){this.ticks=[],this.tickLine={},this.offsetFactor=1,this.frontContainer=null,this.backContainer=null,this.gridPoints=[]},t.draw=function(){var t=this.line,e=this.tickLine,i=this.label,n=this.grid;n&&this.drawGrid(n),e&&this.drawTicks(e),t&&this.drawLine(t),i&&this.drawLabels()},t.drawTicks=function(t){var e=this,i=e.ticks,n=t.length,r=e.getContainer(t.top);h(i,(function(i){var a=e.getOffsetPoint(i.value),s=e.getSidePoint(a,n);r.addShape("line",{className:"axis-tick",attrs:_({x1:a.x,y1:a.y,x2:s.x,y2:s.y},t)})._id=e._id+"-ticks"}))},t.drawLabels=function(){var t=this,e=t.labelOffset;h(t.labels,(function(i){var n=t.getContainer(i.get("top")),r=t.getOffsetPoint(i.get("value")),a=t.getSidePoint(r,e),s=a.x,o=a.y;i.attr(_({x:s,y:o},t.getTextAlignInfo(r,e),i.get("textStyle"))),i._id=t._id+"-"+i.attr("text"),n.add(i)}))},t.drawLine=function(){},t.drawGrid=function(t){var e=this,i=e.gridPoints,n=e.ticks,a=t,s=i.length;h(i,(function(i,o){if(r(t)){var h=n[o]||{},l=t(h.text,o,s);a=l?_({},tt._defaultAxis.grid,l):null}if(a){var u,c=a.type,f=i.points,g=e.getContainer(a.top);if("arc"===c){var p=e.center,d=e.startAngle,v=e.endAngle,y=ht.length([f[0].x-p.x,f[0].y-p.y]);u=g.addShape("Arc",{className:"axis-grid",attrs:_({x:p.x,y:p.y,startAngle:d,endAngle:v,r:y},a)})}else u=g.addShape("Polyline",{className:"axis-grid",attrs:_({points:f},a)});u._id=i._id}}))},t.getOffsetPoint=function(){},t.getAxisVector=function(){},t.getOffsetVector=function(t,e){var i=this.getAxisVector(t),n=ht.normalize([],i),r=this.offsetFactor,a=[-1*n[1]*r,n[0]*r];return ht.scale([],a,e)},t.getSidePoint=function(t,e){var i=this.getOffsetVector(t,e);return{x:t.x+i[0],y:t.y+i[1]}},t.getTextAlignInfo=function(t,e){var i=this.getOffsetVector(t,e);return{textAlign:i[0]>0?"left":i[0]<0?"right":"center",textBaseline:i[1]>0?"top":i[1]<0?"bottom":"middle"}},t.getContainer=function(t){var e=this.frontContainer,i=this.backContainer;return t?e:i},e}(),re=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.start=null,this.end=null},i.getOffsetPoint=function(t){var e=this.start,i=this.end;return{x:e.x+(i.x-e.x)*t,y:e.y+(i.y-e.y)*t}},i.getAxisVector=function(){var t=this.start,e=this.end;return[e.x-t.x,e.y-t.y]},i.drawLine=function(t){var e=this.getContainer(t.top),i=this.start,n=this.end;e.addShape("line",{className:"axis-line",attrs:_({x1:i.x,y1:i.y,x2:n.x,y2:n.y},t)})},e}(ne);ne.Line=re;var ae=function(t,e){var i=e.x-t.x,n=e.y-t.y;return Math.abs(i)>Math.abs(n)?i>0?"right":"left":n>0?"down":"up"},se=function(t,e){var i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.sqrt(i*i+n*n)},oe=function(t,e){var i=t.touches;if(!i)return[G({x:t.clientX,y:t.clientY},e)];for(var n=[],r=i.length,a=0;a<r;a++){var s=i[a],o=s.x,h=s.y,l=s.clientX,u=s.clientY,c=void 0;c=p(o)||p(h)?{x:o,y:h}:G({x:l,y:u},e),n.push(c)}return n},he=function(){function t(t){var e=this,i=t.canvas,n=t.el;et(this,"_click",(function(t){var i=oe(t,e.canvas);t.points=i,e.emitEvent("click",t)})),et(this,"_start",(function(t){var i,n,r=oe(t,e.canvas);r&&(t.points=r,e.emitEvent("touchstart",t),e.reset(),e.startTime=Date.now(),e.startPoints=r,r.length>1?(e.startDistance=se(r[0],r[1]),e.center=(i=r[0],n=r[1],{x:i.x+(n.x-i.x)/2,y:i.y+(n.y-i.y)/2})):e.pressTimeout=setTimeout((function(){t.direction="none",e.emitStart("press",t),e.emitEvent("press",t),e.eventType="press",e.direction="none"}),250))})),et(this,"_move",(function(t){var i=oe(t,e.canvas);if(i){e.clearPressTimeout(),t.points=i,e.emitEvent("touchmove",t);var n=e.startPoints;if(n)if(i.length>1){var r=e.startDistance,a=se(i[0],i[1]);t.zoom=a/r,t.center=e.center,e.emitStart("pinch",t),e.emitEvent("pinch",t)}else{var s=i[0].x-n[0].x,o=i[0].y-n[0].y,h=e.direction||ae(n[0],i[0]);e.direction=h;var l=e.getEventType(i);t.direction=h,t.deltaX=s,t.deltaY=o,e.emitStart(l,t),e.emitEvent(l,t);var u=e.lastMoveTime,c=Date.now();c-u>0&&(e.prevMoveTime=u,e.prevMovePoints=e.lastMovePoints,e.lastMoveTime=c,e.lastMovePoints=i)}}})),et(this,"_end",(function(t){e.emitEnd(t),e.emitEvent("touchend",t);var i=e.lastMoveTime;if(Date.now()-i<100){var n=i-(e.prevMoveTime||e.startTime);if(n>0){var r=e.prevMovePoints||e.startPoints,a=e.lastMovePoints,s=se(r[0],a[0])/n;s>.3&&(t.velocity=s,t.direction=ae(r[0],a[0]),e.emitEvent("swipe",t))}}e.reset();var o=t.touches;o&&o.length>0&&e._start(t)})),et(this,"_cancel",(function(t){e.emitEvent("touchcancel",t),e.reset()})),this.canvas=i,this.delegateEvent(n),this.processEvent={}}var e=t.prototype;return e.delegateEvent=function(t){t.addEventListener("click",this._click),t.addEventListener("touchstart",this._start),t.addEventListener("touchmove",this._move),t.addEventListener("touchend",this._end),t.addEventListener("touchcancel",this._cancel)},e.emitEvent=function(t,e){this.canvas.emit(t,e)},e.getEventType=function(t){var e,i=this.eventType,n=this.canvas,r=this.startTime,a=this.startPoints;if(i)return i;var s=n.__events.pan;s&&s.length?e=Date.now()-r>250&&se(a[0],t[0])<10?"press":"pan":e="press";return this.eventType=e,e},e.enable=function(t){this.processEvent[t]=!0},e.isProcess=function(t){return this.processEvent[t]},e.emitStart=function(t,e){this.isProcess(t)||(this.enable(t),this.emitEvent(t+"start",e))},e.emitEnd=function(t){var e=this,i=this.processEvent;Object.keys(i).forEach((function(n){e.emitEvent(n+"end",t),delete i[n]}))},e.clearPressTimeout=function(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=0)},e.reset=function(){this.clearPressTimeout(),this.startTime=0,this.startPoints=null,this.startDistance=0,this.direction=null,this.eventType=null,this.pinch=!1,this.prevMoveTime=0,this.prevMovePoints=null,this.lastMoveTime=0,this.lastMovePoints=null},t}(),le=function(t){function e(e){var i;return(i=t.call(this)||this).context=e,i.width=0,i.height=0,i.style={},i.currentStyle={},i.isCanvasElement=!0,i}it(e,t);var i=e.prototype;return i.getContext=function(){return this.context},i.getBoundingClientRect=function(){return{top:0,right:this.width,bottom:this.height,left:0}},i.addEventListener=function(t,e){this.on(t,e)},i.removeEventListener=function(t,e){this.off(t,e)},i.dispatchEvent=function(t,e){this.emit(t,e)},e}(rt);var ue=function(t){return t?function(t){if(!t)return!1;if(1!==t.nodeType||!t.nodeName||"canvas"!==t.nodeName.toLowerCase())return!1;var e=!1;try{t.addEventListener("eventTest",(function(){e=!0})),t.dispatchEvent(new Event("eventTest"))}catch(t){e=!1}return e}(t.canvas)?t.canvas:new le(t):null};function ce(t,e){h(t,(function(t){t=t.split(":"),e.addColorStop(Number(t[0]),t[1])}))}function fe(t,e,i){if("("===t[1])try{var n=t[0];if("l"===n)return function(t,e,i){var n,r,a=t.split(" "),s=a[0].slice(2,a[0].length-1);n=parseFloat(s)*Math.PI/180,r=2*Math.PI,s=(n%r+r)%r;var o,h,l=a.slice(1),u=e.getBBox(),c=u.minX,f=u.minY,g=u.maxX,p=u.maxY;s>=0&&s<.5*Math.PI?(o={x:c,y:f},h={x:g,y:p}):.5*Math.PI<=s&&s<Math.PI?(o={x:g,y:f},h={x:c,y:p}):Math.PI<=s&&s<1.5*Math.PI?(o={x:g,y:p},h={x:c,y:f}):(o={x:c,y:p},h={x:g,y:f});var d=Math.tan(s),v=d*d,y=(h.x-o.x+d*(h.y-o.y))/(v+1)+o.x,m=d*(h.x-o.x+d*(h.y-o.y))/(v+1)+o.y,x=i.createLinearGradient(o.x,o.y,y,m);return ce(l,x),x}(t,e,i);if("r"===n)return function(t,e,i){var n=t.split(" "),r=n[0].slice(2,n[0].length-1);r=r.split(",");var a=parseFloat(r[0]),s=parseFloat(r[1]),o=parseFloat(r[2]),h=n.slice(1);if(0===o)return h[h.length-1].split(":")[1];var l=e.getBBox(),u=l.width,c=l.height,f=l.minX,g=l.minY,p=Math.sqrt(u*u+c*c)/2,d=i.createRadialGradient(f+u*a,g+c*s,o*p,f+u/2,g+c/2,p);return ce(h,d),d}(t,e,i)}catch(t){console.error("error in parsing gradient string, please check if there are any extra whitespaces."),console.error(t)}return t}var ge={stroke:"strokeStyle",fill:"fillStyle",opacity:"globalAlpha"},pe=["fillStyle","font","globalAlpha","lineCap","lineWidth","lineJoin","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle","textAlign","textBaseline","lineDash","shadow"],de=["circle","sector","polygon","rect","polyline"],ve=function(){var t=e.prototype;function e(t){this._initProperties(),_(this._attrs,t);var e=this._attrs.attrs;e&&this.initAttrs(e),this.initTransform()}return t._initProperties=function(){this._attrs={zIndex:0,visible:!0,destroyed:!1}},t.get=function(t){return this._attrs[t]},t.set=function(t,e){this._attrs[t]=e},t.isGroup=function(){return this.get("isGroup")},t.isShape=function(){return this.get("isShape")},t.initAttrs=function(t){this.attr(_(this.getDefaultAttrs(),t))},t.getDefaultAttrs=function(){return{}},t._setAttr=function(t,e){var i=this._attrs.attrs;if("clip"===t)e=this._setAttrClip(e);else{var n=ge[t];n&&(i[n]=e)}i[t]=e},t._getAttr=function(t){return this._attrs.attrs[t]},t._setAttrClip=function(t){return t&&de.indexOf(t._attrs.type)>-1?(null===t.get("canvas")&&(t=Object.assign({},t)),t.set("parent",this.get("parent")),t.set("context",this.get("context")),t):null},t.attr=function(t,e){var i=this;if(i.get("destroyed"))return null;var n=arguments.length;if(0===n)return i._attrs.attrs;if(o(t)){for(var r in this._attrs.bbox=null,t)i._setAttr(r,t[r]);return i._afterAttrsSet&&i._afterAttrsSet(),i}return 2===n?(this._attrs.bbox=null,i._setAttr(t,e),i._afterAttrsSet&&i._afterAttrsSet(),i):i._getAttr(t)},t.getParent=function(){return this.get("parent")},t.draw=function(t){this.get("destroyed")||this.get("visible")&&(this.setContext(t),this.drawInner(t),this.restoreContext(t))},t.setContext=function(t){var e=this._attrs.attrs.clip;t.save(),e&&(e.resetTransform(t),e.createPath(t),t.clip()),this.resetContext(t),this.resetTransform(t)},t.restoreContext=function(t){t.restore()},t.resetContext=function(t){var e=this._attrs.attrs;if(!this._attrs.isGroup)for(var i in e)if(pe.indexOf(i)>-1){var n=e[i];"fillStyle"!==i&&"strokeStyle"!==i||(n=fe(n,this,t)),"lineDash"===i&&t.setLineDash&&s(n)?t.setLineDash(n):t[i]=n}},t.hasFill=function(){return this.get("canFill")&&this._attrs.attrs.fillStyle},t.hasStroke=function(){return this.get("canStroke")&&this._attrs.attrs.strokeStyle},t.drawInner=function(){},t.show=function(){return this.set("visible",!0),this},t.hide=function(){return this.set("visible",!1),this},t.isVisible=function(){return this.get("visible")},t._removeFromParent=function(){var t=this.get("parent");t&&A(t.get("children"),this);return this},t.remove=function(t){t?this.destroy():this._removeFromParent()},t.destroy=function(){if(this.get("destroyed"))return null;this._removeFromParent(),this._attrs={},this.set("destroyed",!0)},t.getBBox=function(){return{minX:0,maxX:0,minY:0,maxY:0,width:0,height:0}},t.initTransform=function(){var t=this._attrs.attrs||{};t.matrix||(t.matrix=[1,0,0,1,0,0]),this._attrs.attrs=t},t.getMatrix=function(){return this._attrs.attrs.matrix},t.setMatrix=function(t){this._attrs.attrs.matrix=[t[0],t[1],t[2],t[3],t[4],t[5]]},t.transform=function(t){var e=this._attrs.attrs.matrix;return this._attrs.attrs.matrix=ot.transform(e,t),this},t.setTransform=function(t){return this._attrs.attrs.matrix=[1,0,0,1,0,0],this.transform(t)},t.translate=function(t,e){var i=this._attrs.attrs.matrix;ot.translate(i,i,[t,e])},t.rotate=function(t){var e=this._attrs.attrs.matrix;ot.rotate(e,e,t)},t.scale=function(t,e){var i=this._attrs.attrs.matrix;ot.scale(i,i,[t,e])},t.moveTo=function(t,e){var i=this._attrs.x||0,n=this._attrs.y||0;this.translate(t-i,e-n),this.set("x",t),this.set("y",e)},t.apply=function(t){var e=this._attrs.attrs.matrix;return ht.transformMat2d(t,t,e),this},t.resetTransform=function(t){var e,i=this._attrs.attrs.matrix;(1!==(e=i)[0]||0!==e[1]||0!==e[2]||1!==e[3]||0!==e[4]||0!==e[5])&&t.transform(i[0],i[1],i[2],i[3],i[4],i[5])},t.isDestroyed=function(){return this.get("destroyed")},e}(),ye=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){this._attrs={zIndex:0,visible:!0,destroyed:!1,isShape:!0,attrs:{}}},i.getType=function(){return this._attrs.type},i.drawInner=function(t){var e=this.get("attrs");this.createPath(t);var i=t.globalAlpha;if(this.hasFill()){var n=e.fillOpacity;a(n)||1===n?t.fill():(t.globalAlpha=n,t.fill(),t.globalAlpha=i)}if(this.hasStroke()&&e.lineWidth>0){var r=e.strokeOpacity;a(r)||1===r||(t.globalAlpha=r),t.stroke()}},i.getBBox=function(){var t=this._attrs.bbox;return t||((t=this.calculateBox())&&(t.x=t.minX,t.y=t.minY,t.width=t.maxX-t.minX,t.height=t.maxY-t.minY),this._attrs.bbox=t),t},i.calculateBox=function(){return null},i.createPath=function(){},e}(ve),me={};var xe={getGroupClass:function(){},getChildren:function(){return this.get("children")},addShape:function(t,e){void 0===e&&(e={});var i=this.get("canvas"),n=me[t];n||(n=y(t),me[t]=n),e.canvas=i,"Text"===n&&i&&i.get("fontFamily")&&(e.attrs.fontFamily=e.attrs.fontFamily||i.get("fontFamily"));var r=new ye[n](e);return this.add(r),r},addGroup:function(t){var e=this.get("canvas"),i=this.getGroupClass();(t=_({},t)).canvas=e,t.parent=this;var n=new i(t);return this.add(n),n},contain:function(t){return this.get("children").indexOf(t)>-1},sort:function(){for(var t=this.get("children"),e=0,i=t.length;e<i;e++){t[e]._INDEX=e}return t.sort(function(t){return function(e,i){var n=t(e,i);return 0===n?e._INDEX-i._INDEX:n}}((function(t,e){return t.get("zIndex")-e.get("zIndex")}))),this},clear:function(){for(var t=this.get("children");0!==t.length;)t[t.length-1].remove(!0);return this},add:function(t){var e=this.get("children");s(t)||(t=[t]);for(var i=0,n=t.length;i<n;i++){var r=t[i],a=r.get("parent");if(a)A(a.get("children"),r);this._setEvn(r),e.push(r)}return this},_setEvn:function(t){t._attrs.parent=this,t._attrs.context=this._attrs.context,t._attrs.canvas=this._attrs.canvas;var e=t._attrs.attrs.clip;if(e&&(e.set("parent",this),e.set("context",this.get("context"))),t._attrs.isGroup)for(var i=t._attrs.children,n=0,r=i.length;n<r;n++)t._setEvn(i[n])}},_e=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){this._attrs={zIndex:0,visible:!0,destroyed:!1,isGroup:!0,children:[]}},i.drawInner=function(t){for(var e=this.get("children"),i=0,n=e.length;i<n;i++){e[i].draw(t)}return this},i.getBBox=function(){for(var t=1/0,e=-1/0,i=1/0,n=-1/0,r=this.get("children"),a=0,s=r.length;a<s;a++){var o=r[a];if(o.get("visible")){var h=o.getBBox();if(!h)continue;var l=[h.minX,h.minY],u=[h.minX,h.maxY],c=[h.maxX,h.minY],f=[h.maxX,h.maxY],g=o.attr("matrix");ht.transformMat2d(l,l,g),ht.transformMat2d(u,u,g),ht.transformMat2d(c,c,g),ht.transformMat2d(f,f,g),t=Math.min(l[0],u[0],c[0],f[0],t),e=Math.max(l[0],u[0],c[0],f[0],e),i=Math.min(l[1],u[1],c[1],f[1],i),n=Math.max(l[1],u[1],c[1],f[1],n)}}return{minX:t,minY:i,maxX:e,maxY:n,x:t,y:i,width:e-t,height:n-i}},i.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e}(ve);_(_e.prototype,xe,{getGroupClass:function(){return _e}});var Se="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:function(t){return setTimeout(t,16)},we=function(t){it(i,t);var e=i.prototype;function i(e){var i;return(i=t.call(this)||this)._attrs=_({type:"canvas",children:[]},e),i._initPixelRatio(),i._initCanvas(),i}return e.get=function(t){return this._attrs[t]},e.set=function(t,e){this._attrs[t]=e},e._initPixelRatio=function(){this.get("pixelRatio")||this.set("pixelRatio",B())},e.beforeDraw=function(){var t=this._attrs.context,e=this._attrs.el;t&&t.clearRect&&t.clearRect(0,0,e.width,e.height)},e._initCanvas=function(){var t,e=this.get("el"),i=this.get("context");if(!e&&!i)throw new Error("Please specify the id, el or context of the chart!");t=e?f(e)?j(e):e:ue(i),i&&t&&!t.getContext&&(t.getContext=function(){return i});var n=this.get("width");n||(n=L(t));var r=this.get("height");r||(r=R(t)),this.set("canvas",this),this.set("el",t),this.set("context",i||t.getContext("2d")),this.changeSize(n,r);var a=new he({canvas:this,el:t});this.set("eventController",a)},e.changeSize=function(t,e){var i=this.get("pixelRatio"),n=this.get("el");(n.style&&(n.style.width=t+"px",n.style.height=e+"px"),z(n))&&(n.width=t*i,n.height=e*i,1!==i&&this.get("context").scale(i,i));this.set("width",t),this.set("height",e)},e.getWidth=function(){var t=this.get("pixelRatio");return this.get("width")*t},e.getHeight=function(){var t=this.get("pixelRatio");return this.get("height")*t},e.getPointByClient=function(t,e){var i=this.get("el"),n=i.getBoundingClientRect(),r=n.right-n.left,a=n.bottom-n.top;return{x:(t-n.left)*(i.width/r),y:(e-n.top)*(i.height/a)}},e._beginDraw=function(){this._attrs.toDraw=!0},e._endDraw=function(){this._attrs.toDraw=!1},e.draw=function(){var t=this;t.get("destroyed")||(t.get("animateHandler")?this._beginDraw():function e(){t.set("animateHandler",Se((function(){t.set("animateHandler",void 0),t.get("toDraw")&&e()}))),t.beforeDraw();try{for(var i=t._attrs.context,n=t._attrs.children,r=0,a=n.length;r<a;r++){n[r].draw(i)}i.draw&&i.draw()}catch(e){console.warn("error in draw canvas, detail as:"),console.warn(e),t._endDraw()}t._endDraw()}())},e.destroy=function(){if(!this.get("destroyed")){var t=this.get("el");t.width=0,t.height=0,this.clear(),this._attrs={},this.set("destroyed",!0)}},e.isDestroyed=function(){return this.get("destroyed")},i}(rt);_(we.prototype,xe,{getGroupClass:function(){return _e}});var Ce=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="rect"},i.getDefaultAttrs=function(){return{x:0,y:0,width:0,height:0,radius:0,lineWidth:0}},i.createPath=function(t){var e=this.get("attrs"),i=e.x,n=e.y,r=e.width,a=e.height,s=e.radius;t.beginPath(),s&&r*a?(s=function(t,e,i){if(!((t=Z(t))[0]||t[1]||t[2]||t[3]))return t;var n=Math.max(t[0]+t[1],t[2]+t[3]),r=Math.max(t[0]+t[3],t[1]+t[2]),a=Math.min(e/n,i/r);return a<1?t.map((function(t){return t*a})):t}(s,r,a),t.moveTo(i+s[0],n),t.lineTo(i+r-s[1],n),t.arc(i+r-s[1],n+s[1],s[1],-Math.PI/2,0,!1),t.lineTo(i+r,n+a-s[2]),t.arc(i+r-s[2],n+a-s[2],s[2],0,Math.PI/2,!1),t.lineTo(i+s[3],n+a),t.arc(i+s[3],n+a-s[3],s[3],Math.PI/2,Math.PI,!1),t.lineTo(i,n+s[0]),t.arc(i+s[0],n+s[0],s[0],Math.PI,3*Math.PI/2,!1),t.closePath()):t.rect(i,n,r,a)},i.calculateBox=function(){var t=this.get("attrs"),e=t.x,i=t.y;return{minX:e,minY:i,maxX:e+t.width,maxY:i+t.height}},e}(ye);ye.Rect=Ce;var Pe=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!1,this._attrs.canStroke=!1,this._attrs.loading=!1,this._attrs.image=null,this._attrs.type="image"},i.getDefaultAttrs=function(){return{x:0,y:0,width:0,height:0}},i.createPath=function(t){var e=this,i=this.get("attrs").src;if(!this.get("loading")){var n=this.get("image");if(n)this.drawImage(t,n);else if(i&&Image){this.set("loading",!0);var r=new Image;r.src=i,r.crossOrigin="Anonymous",r.onload=function(){e.set("loading",!1),e.set("image",r),e.drawImage(t,r)}}}},i.drawImage=function(t,e){var i=this.get("attrs"),n=i.x,r=i.y,s=i.width,o=i.height,h=i.sx,l=i.sy,u=i.swidth,c=i.sheight;a(h)||a(l)||a(u)||a(c)?t.drawImage(e,n,r,s,o):t.drawImage(e,h,l,u,c,n,r,s,o)},i.calculateBox=function(){var t=this.get("attrs"),e=t.x,i=t.y;return{minX:e,minY:i,maxX:e+t.width,maxY:i+t.height}},e}(ye);ye.Image=Pe;var be=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="circle"},i.getDefaultAttrs=function(){return{x:0,y:0,r:0,lineWidth:0}},i.createPath=function(t){var e=this.get("attrs"),i=e.x,n=e.y,r=e.r;t.beginPath(),t.arc(i,n,r,0,2*Math.PI,!1),t.closePath()},i.calculateBox=function(){var t=this.get("attrs"),e=t.x,i=t.y,n=t.r;return{minX:e-n,maxX:e+n,minY:i-n,maxY:i+n}},e}(ye);ye.Circle=be;var Me=ht.create(),ke=ht.create(),Te=ht.create();function Ae(t,e,i,n,r){var a=t*t;return e+(3*-e+t*(3*e-e*t))*t+(3*i+t*(-6*i+3*i*t))*t+(3*n-3*n*t)*a+r*(a*t)}function De(t){for(var e,i,n,r,a,s=1/0,o=-1/0,h=1/0,l=-1/0,u={x:t[0],y:t[1]},c={x:t[2],y:t[3]},f={x:t[4],y:t[5]},g={x:t[6],y:t[7]},p=0;p<100;p++){var d={x:Ae(a=p/100,(e=u).x,(i=c).x,(n=f).x,(r=g).x),y:Ae(a,e.y,i.y,n.y,r.y)};d.x<s&&(s=d.x),d.x>o&&(o=d.x),d.y<h&&(h=d.y),d.y>l&&(l=d.y)}return{minX:s,minY:h,maxX:o,maxY:l}}function Ie(t,e){if(0!==t.length){for(var i=t[0],n=i.x,r=i.x,a=i.y,s=i.y,o=t.length,h=1;h<o;h++)i=t[h],n=Math.min(n,i.x),r=Math.max(r,i.x),a=Math.min(a,i.y),s=Math.max(s,i.y);return{minX:n-(e=e/2||0),minY:a-e,maxX:r+e,maxY:s+e}}}function Ye(t,e,i,n,r,a){var s=Math.abs(n-r);if(s%(2*Math.PI)<1e-4&&s>1e-4)return{minX:t-i,minY:e-i,maxX:t+i,maxY:e+i};Me[0]=Math.cos(n)*i+t,Me[1]=Math.sin(n)*i+e,ke[0]=Math.cos(r)*i+t,ke[1]=Math.sin(r)*i+e;var o=[0,0],h=[0,0];if(ht.min(o,Me,ke),ht.max(h,Me,ke),(n%=2*Math.PI)<0&&(n+=2*Math.PI),(r%=2*Math.PI)<0&&(r+=2*Math.PI),n>r&&!a?r+=2*Math.PI:n<r&&a&&(n+=2*Math.PI),a){var l=r;r=n,n=l}for(var u=0;u<r;u+=Math.PI/2)u>n&&(Te[0]=Math.cos(u)*i+t,Te[1]=Math.sin(u)*i+e,ht.min(o,Te,o),ht.max(h,Te,h));return{minX:o[0],minY:o[1],maxX:h[0],maxY:h[1]}}var Oe=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canStroke=!0,this._attrs.type="line"},i.getDefaultAttrs=function(){return{x1:0,y1:0,x2:0,y2:0,lineWidth:1}},i.createPath=function(t){var e=this.get("attrs"),i=e.x1,n=e.y1,r=e.x2,a=e.y2;t.beginPath(),t.moveTo(i,n),t.lineTo(r,a)},i.calculateBox=function(){var t=this.get("attrs");return function(t,e,i,n,r){return r=r/2||0,{minX:Math.min(t,i)-r,minY:Math.min(e,n)-r,maxX:Math.max(t,i)+r,maxY:Math.max(e,n)+r}}(t.x1,t.y1,t.x2,t.y2,t.lineWidth)},e}(ye);ye.Line=Oe;var Fe=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="polygon"},i.getDefaultAttrs=function(){return{points:null,lineWidth:0}},i.createPath=function(t){var e=this.get("attrs").points;t.beginPath();for(var i=0,n=e.length;i<n;i++){var r=e[i];0===i?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y)}t.closePath()},i.calculateBox=function(){return Ie(this.get("attrs").points)},e}(ye);function Ee(t){return[t.x,t.y]}function Ne(t,e,i){for(var n,r,a,s=!!e,o=function(t,e,i,n){var r,a,s,o,h,l,u,c,f=[],g=!!n;if(g){for(s=[1/0,1/0],o=[-1/0,-1/0],c=0,u=t.length;c<u;c++)h=Ee(t[c]),ht.min(s,s,h),ht.max(o,o,h);ht.min(s,s,n[0]),ht.max(o,o,n[1])}for(c=0,l=t.length;c<l;c++){if(h=Ee(t[c]),i)r=Ee(t[c?c-1:l-1]),a=Ee(t[(c+1)%l]);else{if(0===c||c===l-1){f.push([h[0],h[1]]);continue}r=Ee(t[c-1]),a=Ee(t[c+1])}var p=ht.sub([],a,r);ht.scale(p,p,e);var d=ht.distance(h,r),v=ht.distance(h,a),y=d+v;0!==y&&(d/=y,v/=y);var m=ht.scale([],p,-d),x=ht.scale([],p,v),_=ht.add([],h,m),S=ht.add([],h,x);g&&(ht.max(_,_,s),ht.min(_,_,o),ht.max(S,S,s),ht.min(S,S,o)),f.push([_[0],_[1]]),f.push([S[0],S[1]])}return i&&f.push(f.shift()),f}(t,.4,s,i),h=t.length,l=[],u=0;u<h-1;u++)n=o[2*u],r=o[2*u+1],a=t[u+1],l.push(["C",n[0],n[1],r[0],r[1],a.x,a.y]);return s&&(n=o[h],r=o[h+1],a=t[0],l.push(["C",n[0],n[1],r[0],r[1],a.x,a.y])),l}function ze(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];isNaN(r.x)||isNaN(r.y)||e.push(r)}return e}ye.Polygon=Fe;var Be=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="polyline"},i.getDefaultAttrs=function(){return{points:null,lineWidth:1,smooth:!1}},i.createPath=function(t){var e=this.get("attrs"),i=e.points,n=e.smooth,r=ze(i);if(t.beginPath(),r.length)if(t.moveTo(r[0].x,r[0].y),n)for(var a=Ne(r,!1,[[0,0],[1,1]]),s=0,o=a.length;s<o;s++){var h=a[s];t.bezierCurveTo(h[1],h[2],h[3],h[4],h[5],h[6])}else{var l,u;for(l=1,u=r.length-1;l<u;l++)t.lineTo(r[l].x,r[l].y);t.lineTo(r[u].x,r[u].y)}},i.calculateBox=function(){var t=this.get("attrs"),e=t.points,i=t.smooth,n=t.lineWidth,r=ze(e);if(i){for(var a=[],s=Ne(r,!1,[[0,0],[1,1]]),o=0,h=s.length;o<h;o++){var l=s[o];if(0===o)a.push([r[0].x,r[0].y,l[1],l[2],l[3],l[4],l[5],l[6]]);else{var u=s[o-1];a.push([u[5],u[6],l[1],l[2],l[3],l[4],l[5],l[6]])}}return function(t,e){for(var i=1/0,n=-1/0,r=1/0,a=-1/0,s=0,o=t.length;s<o;s++){var h=De(t[s]);h.minX<i&&(i=h.minX),h.maxX>n&&(n=h.maxX),h.minY<r&&(r=h.minY),h.maxY>a&&(a=h.maxY)}return{minX:i-(e=e/2||0),minY:r-e,maxX:n+e,maxY:a+e}}(a,n)}return Ie(r,n)},e}(ye);ye.Polyline=Be;var Xe=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canStroke=!0,this._attrs.canFill=!0,this._attrs.type="arc"},i.getDefaultAttrs=function(){return{x:0,y:0,r:0,startAngle:0,endAngle:2*Math.PI,anticlockwise:!1,lineWidth:1}},i.createPath=function(t){var e=this.get("attrs"),i=e.x,n=e.y,r=e.r,a=e.startAngle,s=e.endAngle,o=e.anticlockwise;t.beginPath(),a!==s&&t.arc(i,n,r,a,s,o)},i.calculateBox=function(){var t=this.get("attrs");return Ye(t.x,t.y,t.r,t.startAngle,t.endAngle,t.anticlockwise)},e}(ye);ye.Arc=Xe;var Le=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="sector"},i.getDefaultAttrs=function(){return{x:0,y:0,lineWidth:0,r:0,r0:0,startAngle:0,endAngle:2*Math.PI,anticlockwise:!1}},i.createPath=function(t){var e=this.get("attrs"),i=e.x,n=e.y,r=e.startAngle,a=e.endAngle,s=e.r,o=e.r0,h=e.anticlockwise;t.beginPath();var l=Math.cos(r),u=Math.sin(r);t.moveTo(l*o+i,u*o+n),t.lineTo(l*s+i,u*s+n),(Math.abs(a-r)>1e-4||0===r&&a<0)&&(t.arc(i,n,s,r,a,h),t.lineTo(Math.cos(a)*o+i,Math.sin(a)*o+n),0!==o&&t.arc(i,n,o,a,r,!h)),t.closePath()},i.calculateBox=function(){var t=this.get("attrs"),e=t.x,i=t.y,n=t.r,r=t.r0,a=t.startAngle,s=t.endAngle,o=t.anticlockwise,h=Ye(e,i,n,a,s,o),l=Ye(e,i,r,a,s,o);return{minX:Math.min(h.minX,l.minX),minY:Math.min(h.minY,l.minY),maxX:Math.max(h.maxX,l.maxX),maxY:Math.max(h.maxY,l.maxY)}},e}(ye);ye.Sector=Le;var Re=function(t){var e=t.width,i=t.height,n=t.rotate,r=Math.abs(n);return{width:Math.abs(e*Math.cos(r)+i*Math.sin(r)),height:Math.abs(i*Math.cos(r)+e*Math.sin(r))}},je=0,Ge={},He=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="text"},i.getDefaultAttrs=function(){return{lineWidth:0,lineCount:1,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom",lineHeight:null,textArr:null}},i._getFontStyle=function(){var t=this._attrs.attrs,e=t.fontSize,i=t.fontFamily,n=t.fontWeight;return t.fontStyle+" "+t.fontVariant+" "+n+" "+e+"px "+i},i._afterAttrsSet=function(){var t=this._attrs.attrs;if(t.font=this._getFontStyle(),t.text){var e=t.text,i=null,n=1;f(e)&&-1!==e.indexOf("\n")&&(n=(i=e.split("\n")).length),t.lineCount=n,t.textArr=i}this.set("attrs",t)},i._getTextHeight=function(){var t=this._attrs.attrs;if(t.height)return t.height;var e=t.lineCount,i=1*t.fontSize;return e>1?i*e+this._getSpaceingY()*(e-1):i},i._getSpaceingY=function(){var t=this._attrs.attrs,e=t.lineHeight,i=1*t.fontSize;return e?e-i:.14*i},i.drawInner=function(t){var e=this._attrs.attrs,i=e.text,n=e.x,r=e.y;if(!(a(i)||isNaN(n)||isNaN(r))){var s=e.textArr,o=1*e.fontSize,h=this._getSpaceingY();e.rotate&&(t.translate(n,r),t.rotate(e.rotate),n=0,r=0);var l,u,c=e.textBaseline;if(s&&(l=this._getTextHeight()),this.hasFill()){var f=e.fillOpacity;if(a(f)||1===f||(t.globalAlpha=f),s)for(var g=0,p=s.length;g<p;g++){var d=s[g];u=r+g*(h+o)-l+o,"middle"===c&&(u+=l-o-(l-o)/2),"top"===c&&(u+=l-o),t.fillText(d,n,u)}else t.fillText(i,n,r)}if(this.hasStroke())if(s)for(var v=0,y=s.length;v<y;v++){var m=s[v];u=r+v*(h+o)-l+o,"middle"===c&&(u+=l-o-(l-o)/2),"top"===c&&(u+=l-o),t.strokeText(m,n,u)}else t.strokeText(i,n,r)}},i.calculateBox=function(){var t=this._attrs.attrs,e=t.x,i=t.y,n=t.textAlign,r=t.textBaseline,a=this._getTextWidth();if(!a)return{minX:e,minY:i,maxX:e,maxY:i};var s=this._getTextHeight();if(t.rotate){var o=Re({width:a,height:s,rotate:t.rotate});a=o.width,s=o.height}var h={x:e,y:i-s};return n&&("end"===n||"right"===n?h.x-=a:"center"===n&&(h.x-=a/2)),r&&("top"===r?h.y+=s:"middle"===r&&(h.y+=s/2)),{minX:h.x,minY:h.y,maxX:h.x+a,maxY:h.y+s}},i._getTextWidth=function(){var t=this._attrs.attrs;if(t.width)return t.width;var e=t.text,i=this.get("context");if(!a(e)){var n=t.font,r=t.textArr,s=e+""+n;if(Ge[s])return Ge[s];var o=0;if(r)for(var h=0,l=r.length;h<l;h++){var u=r[h];o=Math.max(o,U(u,n,i).width)}else o=U(e,n,i).width;return je>5e3&&(je=0,Ge={}),je++,Ge[s]=o,o}},e}(ye);ye.Text=He;var We=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.createPath=null,this._attrs.type="custom"},i.createPath=function(t){var e=this.get("createPath");e&&e.call(this,t)},i.calculateBox=function(){var t=this.get("calculateBox");return t&&t.call(this)},e}(ye);ye.Custom=We;var Ve=Object.freeze({__proto__:null,Canvas:we,Group:_e,Shape:ye,Matrix:ot,Vector2:ht});var qe=function(){function t(t){this.axisCfg={},this.frontPlot=null,this.backPlot=null,this.axes={},_(this,t)}var e=t.prototype;return e._isHide=function(t){var e=this.axisCfg;return!e||!1===e[t]},e._getLinePosition=function(t,e,i,n){var r="",a=t.field,s=this.axisCfg;return s[a]&&s[a].position?r=s[a].position:"x"===e?r=n?"left":"bottom":"y"===e&&(r=i?"right":"left",n&&(r="bottom")),r},e._getLineCfg=function(t,e,i){var n,r,a=1;return"x"===e?(n={x:0,y:0},r={x:1,y:0}):"right"===i?(n={x:1,y:0},r={x:1,y:1}):(n={x:0,y:0},r={x:0,y:1},a=-1),t.transposed&&(a*=-1),{offsetFactor:a,start:t.convertPoint(n),end:t.convertPoint(r)}},e._getCircleCfg=function(t){return{startAngle:t.startAngle,endAngle:t.endAngle,center:t.center,radius:t.circleRadius}},e._getRadiusCfg=function(t){var e,i;return t.transposed?(e={x:0,y:0},i={x:1,y:0}):(e={x:0,y:0},i={x:0,y:1}),{offsetFactor:-1,start:t.convertPoint(e),end:t.convertPoint(i)}},e._getAxisCfg=function(t,e,i,n,a){var s=this,o=this.axisCfg,l=e.getTicks(),u=w({ticks:l,frontContainer:this.frontPlot,backContainer:this.backPlot},a,o[e.field]),c=[],f=u.label,g=l.length,p=0,d=0,v=f;return h(l,(function(t,e){if(r(f)){var i=f(t.text,e,g);v=i?_({},tt._defaultAxis.label,i):null}if(v){var n={};v.textAlign&&(n.textAlign=v.textAlign),v.textBaseline&&(n.textBaseline=v.textBaseline);var a=new ye.Text({className:"axis-label",attrs:_({x:0,y:0,text:t.text,fontFamily:s.chart.get("canvas").get("fontFamily")},v),value:t.value,textStyle:n,top:v.top,context:s.chart.get("canvas").get("context")});c.push(a);var o=a.getBBox(),h=o.width,l=o.height;p=Math.max(p,h),d=Math.max(d,l)}})),u.labels=c,u.maxWidth=p,u.maxHeight=d,u},e._createAxis=function(t,e,i,n,r){void 0===r&&(r="");var a,s,o,h=t.type,l=t.transposed;if("cartesian"===h||"rect"===h){var u=this._getLinePosition(e,n,r,l);(o=tt.axis[u]).position=u,a="Line",s=u}else"x"===n&&!l||"y"===n&&l?(o=tt.axis.circle,a="Circle",s="circle"):(o=tt.axis.radius,a="Line",s="radius");var c=this._getAxisCfg(t,e,i,n,o);c.type=a,c.dimType=n,c.verticalScale=i,c.index=r,this.axes[s]=c},e.createAxis=function(t,e,i){var n=this;e&&!n._isHide(e.field)&&n._createAxis(t,e,i[0],"x"),h(i,(function(i,r){n._isHide(i.field)||n._createAxis(t,i,e,"y",r)}));var r=this.axes,s=n.chart;if(s._isAutoPadding()){var o=Z(s.get("padding")),l=Z(s.get("appendPadding")),u=s.get("legendRange")||{top:0,right:0,bottom:0,left:0},c=["auto"===o[0]?u.top+2*l[0]:o[0],"auto"===o[1]?u.right+l[1]:o[1],"auto"===o[2]?u.bottom+l[2]:o[2],"auto"===o[3]?u.left+l[3]:o[3]];if(t.isPolar){var f=r.circle;if(f){var g=f.maxHeight,p=f.maxWidth,d=f.labelOffset;c[0]+=g+d,c[1]+=p+d,c[2]+=g+d,c[3]+=p+d}}else{if(r.right&&"auto"===o[1]){var v=r.right,y=v.maxWidth,m=v.labelOffset;c[1]+=y+m}if(r.left&&"auto"===o[3]){var x=r.left,S=x.maxWidth,w=x.labelOffset;c[3]+=S+w}if(r.bottom&&"auto"===o[2]){var C=r.bottom,P=C.maxHeight,b=C.labelOffset;c[2]+=P+b}}s.set("_padding",c),s._updateLayout(c)}h(r,(function(e){var i,r=e.type,s=e.grid,o=e.verticalScale,l=e.ticks,u=e.dimType,c=e.position,f=e.index;if(t.isPolar?"Line"===r?i=n._getRadiusCfg(t):"Circle"===r&&(i=n._getCircleCfg(t)):i=n._getLineCfg(t,u,c),s&&o){var g=[],p=function(t){var e=t.slice(0);if(e.length>0){var i=e[0],n=e[e.length-1];0!==i.value&&e.unshift({value:0}),1!==n.value&&e.push({value:1})}return e}(o.getTicks());h(l,(function(e){var i=[];h(p,(function(n){var r="x"===u?e.value:n.value,a="x"===u?n.value:e.value;if(r>=0&&r<=1&&a>=0&&a<=1){var s=t.convertPoint({x:r,y:a});i.push(s)}})),g.push({points:i,_id:"axis-"+u+f+"-grid-"+e.tickValue})})),e.gridPoints=g,t.isPolar&&(e.center=t.center,e.startAngle=t.startAngle,e.endAngle=t.endAngle)}i._id="axis-"+u,a(f)||(i._id="axis-"+u+f),new ne[r](_(e,i))}))},e.clear=function(){this.axes={},this.frontPlot.clear(),this.backPlot.clear()},t}();function Ue(t){var e,i=t.start,n=t.end,r=n.x-i.x,a=Math.abs(n.y-i.y);if(t.isPolar){var s=t.circleRadius,o=t.center,h=t.startAngle,l=t.endAngle;e=new ye.Sector({attrs:{x:o.x,y:o.y,r:s,r0:0,startAngle:h,endAngle:l}})}else e=new ye.Rect({attrs:{x:i.x,y:n.y-10,width:r,height:a+20}});return e.isClip=!0,e}function Ze(t,e){var i=t.x,n=t.y,r=e.tl,a=e.tr,s=e.br;return i>=r.x&&i<=a.x&&n>=r.y&&n<=s.y}var Je=Object.freeze({__proto__:null,getClip:Ue,isPointInPlot:Ze});function $e(t,e){return t-e}var Ke=function(t){it(i,t),i.initPlugins=function(){return{_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach((function(t){-1===e.indexOf(t)&&e.push(t)})),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach((function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)})),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,i){var n,r,a,s,o=this.descriptors(t),h=o.length;for(n=0;n<h;++n)if("function"==typeof(s=(r=o[n].plugin)[e])&&(a=[t].concat(i||[]),!1===s.apply(r,a)))return!1;return!0},descriptors:function(t){var e=t._plugins||(t._plugins={});if(e.id===this._cacheId)return e.descriptors;var i=[],n=[];return this._plugins.concat(t&&t.get("plugins")||[]).forEach((function(t){-1===i.indexOf(t)&&(i.push(t),n.push({plugin:t}))})),e.descriptors=n,e.id=this._cacheId,n}}};var e=i.prototype;function i(e){var i,n=nt(i=t.call(this,e)||this);return h(Yt,(function(t,e){var i=v(e);n[i]=function(e){var i=new t(e);return n.addGeom(i),i}})),n._init(),i}return e.getDefaultCfg=function(){return{id:null,rendered:!1,padding:tt.padding,data:null,scales:{},geoms:[],colDefs:null,pixelRatio:tt.pixelRatio,filters:null,appendPadding:tt.appendPadding}},e._syncYScales=function(){if(this.get("syncY")){var t=this.get("geoms"),e=[],i=[],n=[];h(t,(function(t){var r=t.getYScale();r.isLinear&&(e.push(r),i.push(r.min),n.push(r.max))})),i=Math.min.apply(null,i),n=Math.max.apply(null,n),h(e,(function(t){t.change({min:i}),t.change({max:n})}))}},e._getFieldsForLegend=function(){var t=[];return h(this.get("geoms"),(function(e){var i=e.get("attrOptions").color;i&&i.field&&f(i.field)&&h(i.field.split("*"),(function(e){-1===t.indexOf(e)&&t.push(e)}))})),t},e._getScaleData=function(t){var e=this.get("data"),i=this.get("filteredData");i.length&&(-1===this._getFieldsForLegend().indexOf(t)&&(e=i));return e},e._adjustScale=function(){for(var t=this.get("scaleController"),e=this.get("geoms"),i=0;i<e.length;i++){var n=e[i];if("interval"===n.get("type")){var r=n.getYScale();t.adjustStartZero(r)}}},e._removeGeoms=function(){for(var t=this.get("geoms");t.length>0;){t.shift().destroy()}},e._clearGeoms=function(){for(var t=this.get("geoms"),e=0,i=t.length;e<i;e++){t[e].clear()}},e._clearInner=function(){this._clearGeoms(),i.plugins.notify(this,"clearInner"),this.emit("clearinner"),this.get("axisController")&&this.get("axisController").clear()},e._initFilteredData=function(){var t=this.get("filters"),e=this.get("data")||[];t&&(e=e.filter((function(e){var i=!0;return h(t,(function(t,n){if(t&&!(i=t(e[n],e)))return!1})),i}))),this.set("filteredData",e)},e._changeGeomsData=function(){for(var t=this.get("geoms"),e=this.get("filteredData"),i=0,n=t.length;i<n;i++){t[i].changeData(e)}},e._initGeom=function(t){if(!t.get("isInit")){var e=this.get("coord"),i=this.get("filteredData"),n=this.get("colDefs"),r=this.get("middlePlot");t.set("chart",this),t.set("container",r.addGroup()),t.set("data",i),t.set("coord",e),t.set("colDefs",n),t.init(),this.emit("_aftergeominit",t)}},e._initGeoms=function(){for(var t=this.get("geoms"),e=0,i=t.length;e<i;e++)this._initGeom(t[e])},e._initCoord=function(){var t=this.get("plotRange"),e=_({type:"cartesian"},this.get("coordCfg"),{plot:t}),i=e.type,n=new(0,ut[y(i)])(e);this.set("coord",n)},e._initLayout=function(){var t=this.get("_padding");t||(t=Z(t=this.get("margin")||this.get("padding")));var e="auto"===t[0]?0:t[0],i="auto"===t[1]?0:t[1],n="auto"===t[2]?0:t[2],r={x:"auto"===t[3]?0:t[3],y:e},a={x:this.get("width")-i,y:this.get("height")-n},s=this.get("plot");if(s)s.reset(r,a);else{var o=new st({start:r,end:a});this.set("plotRange",o),this.set("plot",o)}},e._initCanvas=function(){try{var t=new we({el:this.get("el")||this.get("id"),context:this.get("context"),pixelRatio:this.get("pixelRatio"),width:this.get("width"),height:this.get("height"),fontFamily:tt.fontFamily});this.set("canvas",t),this.set("el",t.get("el")),this.set("width",t.get("width")),this.set("height",t.get("height"))}catch(t){throw t}i.plugins.notify(this,"afterCanvasInit")},e._initLayers=function(){var t=this.get("canvas");this.set("backPlot",t.addGroup()),this.set("middlePlot",t.addGroup({zIndex:10})),this.set("frontPlot",t.addGroup({zIndex:20}))},e._initEvents=function(){var t=this;this.on("afterdatachange",(function(){t._initFilteredData(),t._changeGeomsData()})),this.on("_aftersizechange",(function(){t._initLayout();var e=t.get("coord");e&&e.reset(t.get("plot"))}))},e._initScaleController=function(){var t=new ie({chart:this});this.set("colDefs",t.defs),this.set("scales",t.scales),this.set("scaleController",t)},e._clearScaleController=function(){this.get("scaleController").clear()},e._init=function(){this._initCanvas(),this._initLayout(),this._initLayers(),this._initEvents(),this._initScaleController(),this.set("axisController",new qe({frontPlot:this.get("frontPlot").addGroup({className:"axisContainer"}),backPlot:this.get("backPlot").addGroup({className:"axisContainer"}),chart:this})),i.plugins.notify(this,"init")},e.init=function(){this._initFilteredData(),this._initCoord(),i.plugins.notify(this,"beforeGeomInit"),this._initGeoms(),this._syncYScales(),this._adjustScale(),this.emit("afterinit")},e.source=function(t,e){return this.set("data",t),e&&this.scale(e),this},e.scale=function(t,e){return this.get("scaleController").setFieldDef(t,e),this},e.axis=function(t,e){var i=this.get("axisController");return t?(i.axisCfg=i.axisCfg||{},i.axisCfg[t]=e):i.axisCfg=null,this},e.coord=function(t,e){var i;return o(t)?i=t:(i=e||{}).type=t||"cartesian",this.set("coordCfg",i),this},e.filter=function(t,e){var i=this.get("filters")||{};i[t]=e,this.set("filters",i),this.get("rendered")&&this.emit("afterdatachange",this.get("data"))},e.render=function(){var t=this.get("rendered"),e=this.get("canvas"),n=this.get("geoms");t?(this._initGeoms(),this._adjustScale()):(this.init(),this.set("rendered",!0)),this.emit("beforerender"),i.plugins.notify(this,"beforeGeomDraw"),this._renderAxis();var r=this.get("middlePlot");if(this.get("limitInPlot")&&!r.attr("clip")){var a=Ue(this.get("coord"));a.set("canvas",r.get("canvas")),r.attr("clip",a)}this.emit("beforegeomdraw");for(var s=0,o=n.length;s<o;s++){n[s].paint()}return this.emit("aftergeomdraw"),i.plugins.notify(this,"afterGeomDraw"),e.sort(),this.get("frontPlot").sort(),i.plugins.notify(this,"beforeCanvasDraw"),e.draw(),this.emit("afterrender"),this},e.clear=function(){return i.plugins.notify(this,"clear"),this.emit("clear"),this._clearInner(),this._removeGeoms(),this._clearScaleController(),this.set("legendItems",null),this.set("filters",null),this.set("isUpdate",!1),this.set("_padding",null),this.set("rendered",!1),this.get("canvas").draw(),this},e.repaint=function(){this.get("rendered")&&(this.set("isUpdate",!0),this.set("legendItems",null),i.plugins.notify(this,"repaint"),this._clearInner(),this.render())},e.changeData=function(t){this.emit("beforedatachange",t),this.set("data",t),i.plugins.notify(this,"changeData"),this.emit("afterdatachange",t),this.set("_padding",null),this.repaint()},e.changeSize=function(t,e){return t?this.set("width",t):t=this.get("width"),e?this.set("height",e):e=this.get("height"),this.get("canvas").changeSize(t,e),this.emit("_aftersizechange",{width:t,height:e}),this.repaint(),this},e.destroy=function(){this.clear(),this.get("canvas").destroy(),i.plugins.notify(this,"afterCanvasDestroyed"),this._interactions&&h(this._interactions,(function(t){t.destroy()})),t.prototype.destroy.call(this)},e.getPosition=function(t){var e=this.get("coord"),i=this.getXScale(),n=this.getYScales()[0],r=i.field,a=i.scale(t[r]),s=n.field,o=n.scale(t[s]);return e.convertPoint({x:a,y:o})},e.getRecord=function(t){var e=this.get("coord"),i=this.getXScale(),n=this.getYScales()[0],r=e.invertPoint(t),a={};return a[i.field]=i.invert(r.x),a[n.field]=n.invert(r.y),a},e.getSnapRecords=function(t){var e=this.get("geoms")[0],i=[];return e&&(i=e.getSnapRecords(t)),i},e.createScale=function(t){var e=this._getScaleData(t);return this.get("scaleController").createScale(t,e)},e.addGeom=function(t){this.get("geoms").push(t)},e.getXScale=function(){return this.get("geoms")[0].getXScale()},e.getYScales=function(){var t=this.get("geoms"),e=[];return h(t,(function(t){var i=t.getYScale();-1===e.indexOf(i)&&e.push(i)})),e},e.getLegendItems=function(){if(this.get("legendItems"))return this.get("legendItems");var t={},e=[];return h(this.get("geoms"),(function(i){var n=i.getAttr("color");if(n){var r=n.getScale("color");if(r.isCategory&&!function(t,e){var i=!1;return h(t,(function(t){var n=[].concat(t.values),r=[].concat(e.values);t.type!==e.type||t.field!==e.field||n.sort($e).toString()!==r.sort($e).toString()||(i=!0)})),i}(e,r)){e.push(r);var a=r.field,s=r.getTicks(),o=[];h(s,(function(t){var e=t.text,i=t.value,a=r.invert(i),s={fill:n.mapping(a).join("")||tt.defaultColor,radius:3,symbol:"circle",stroke:"#fff"};o.push({name:e,dataValue:a,checked:!0,marker:s})})),t[a]=o}}})),this.set("legendItems",t),t},e.registerPlugins=function(t){var e=this,n=e.get("plugins")||[];s(n)||(n=[n]),[].concat(t).forEach((function(t){-1===n.indexOf(t)&&(t.init&&t.init(e),n.push(t))})),i.plugins._cacheId++,e.set("plugins",n)},e._renderAxis=function(){var t=this.get("axisController"),e=this.getXScale(),n=this.getYScales(),r=this.get("coord");i.plugins.notify(this,"beforeRenderAxis"),t.createAxis(r,e,n)},e._isAutoPadding=function(){if(this.get("_padding"))return!1;var t=this.get("padding");return s(t)?-1!==t.indexOf("auto"):"auto"===t},e._updateLayout=function(t){var e=this.get("width"),i=this.get("height"),n={x:t[3],y:t[0]},r={x:e-t[1],y:i-t[2]},a=this.get("plot"),s=this.get("coord");a.reset(n,r),s.reset(a)},i}(at);Ke.plugins=Ke.initPlugins();var Qe=function(){return null};function ti(t){var e=[],i=t.x,n=t.y;return(n=s(n)?n:[n]).forEach((function(t,n){var r={x:s(i)?i[n]:i,y:t};e.push(r)})),e}function ei(t,e,i){if(!t.length)return[];var n,r=[],o=[];return h(t,(function(t){n=t._origin?t._origin[e]:t[e],i?a(n)||o.push(t):s(n)&&a(n[0])||a(n)?o.length&&(r.push(o),o=[]):o.push(t)})),o.length&&r.push(o),r}Pt.registerFactory("point",{defaultShapeType:"circle",getDefaultPoints:function(t){return ti(t)}});function ii(t,e,i){if(0!==t.size){var n=function(t){var e={lineWidth:0,stroke:t.color,fill:t.color};return t.size&&(e.size=t.size),_(e,t.style),_({},tt.shape.point,e)}(t),r=n.r||n.size,a=t.x,o=s(t.y)?t.y:[t.y];"hollowCircle"===i&&(n.lineWidth=1,n.fill=null);for(var h=0,l=o.length;h<l;h++)return"rect"===i?e.addShape("Rect",{className:"point",attrs:_({x:a-r,y:o[h]-r,width:2*r,height:2*r},n)}):e.addShape("Circle",{className:"point",attrs:_({x:a,y:o[h],r:r},n)})}}h(["circle","hollowCircle","rect"],(function(t){Pt.registerShape("point",t,{draw:function(e,i){return ii(e,i,t)}})}));var ni=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="point",e.shapeType="point",e.generatePoints=!1,e},i.draw=function(t,e){var i=this,n=i.get("container");h(t,(function(t){var r=t.shape,o=i.getDrawCfg(t);if(s(t.y)){var l=i.hasAdjust("stack");h(t.y,(function(a,s){o.y=a,l&&0===s||i.drawShape(r,t,o,n,e)}))}else a(t.y)||i.drawShape(r,t,o,n,e)}))},e}(Yt);Yt.Point=ni;Pt.registerFactory("line",{defaultShapeType:"line"});h(["line","smooth","dash"],(function(t){Pt.registerShape("line",t,{draw:function(e,i){var n="smooth"===t,r=function(t){var e={strokeStyle:t.color};return t.size>=0&&(e.lineWidth=t.size),_(e,t.style),_({},tt.shape.line,e)}(e);return"dash"===t&&(r.lineDash=tt.lineDash),function(t,e,i,n){var r=t.points;if(r.length&&s(r[0].y)){for(var a=[],o=[],h=0,l=r.length;h<l;h++){var u=ti(r[h]);o.push(u[0]),a.push(u[1])}return t.isInCircle&&(a.push(a[0]),o.push(o[0])),t.isStack?e.addShape("Polyline",{className:"line",attrs:_({points:a,smooth:n},i)}):[e.addShape("Polyline",{className:"line",attrs:_({points:a,smooth:n},i)}),e.addShape("Polyline",{className:"line",attrs:_({points:o,smooth:n},i)})]}return t.isInCircle&&r.push(r[0]),e.addShape("Polyline",{className:"line",attrs:_({points:r,smooth:n},i)})}(e,i,r,n)}})}));var ri=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="path",e.shapeType="line",e},i.getDrawCfg=function(e){var i=t.prototype.getDrawCfg.call(this,e);return i.isStack=this.hasAdjust("stack"),i},i.draw=function(t,e){var i=this,n=i.get("container"),r=i.getYScale(),a=i.get("connectNulls"),s=ei(t,r.field,a),o=this.getDrawCfg(t[0]);o.origin=t,h(s,(function(r,a){o.splitedIndex=a,o.points=r,i.drawShape(o.shape,t[0],o,n,e)}))},e}(Yt);Yt.Path=ri;var ai=function(t){function e(){return t.apply(this,arguments)||this}return it(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="line",e.sortable=!0,e},e}(ri);function si(t,e){return Math.abs(t-e)<1e-5}function oi(t){return!isNaN(t)&&!a(t)}function hi(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];oi(r.x)&&oi(r.y)&&e.push(r)}return e}function li(t,e,i){var n=t.points,r=[],a=[];h(n,(function(t){a.push(t[0]),r.push(t[1])}));var s=_({fillStyle:t.color},tt.shape.area,t.style);return a.reverse(),r=this.parsePoints(r),a=this.parsePoints(a),t.isInCircle&&(r.push(r[0]),a.unshift(a[a.length-1]),function(t,e){var i=!0;return h(t,(function(t){if(!si(t.x,e.x)||!si(t.y,e.y))return i=!1,!1})),i}(a,t.center)&&(a=[])),function(t,e,i,n,r){var a=t.concat(e);return r?i.addShape("Custom",{className:"area",attrs:_({points:a},n),createPath:function(t){var e=[[0,0],[1,1]],i=hi(this._attrs.attrs.points),n=i.length,r=i.slice(0,n/2),a=i.slice(n/2,n),s=Ne(r,!1,e);t.beginPath(),t.moveTo(r[0].x,r[0].y);for(var o=0,h=s.length;o<h;o++){var l=s[o];t.bezierCurveTo(l[1],l[2],l[3],l[4],l[5],l[6])}if(a.length){var u=Ne(a,!1,e);t.lineTo(a[0].x,a[0].y);for(var c=0,f=u.length;c<f;c++){var g=u[c];t.bezierCurveTo(g[1],g[2],g[3],g[4],g[5],g[6])}}t.closePath()},calculateBox:function(){return Ie(hi(this._attrs.attrs.points))}}):i.addShape("Polyline",{className:"area",attrs:_({points:a},n)})}(r,a,e,s,i)}Yt.Line=ai;Pt.registerFactory("area",{defaultShapeType:"area",getDefaultPoints:function(t){var e=t.x,i=t.y,n=t.y0;i=s(i)?i:[n,i];var r=[];return r.push({x:e,y:i[0]},{x:e,y:i[1]}),r}});h(["area","smooth"],(function(t){Pt.registerShape("area",t,{draw:function(e,i){var n="smooth"===t;return li.call(this,e,i,n)}})}));var ui=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="area",e.shapeType="area",e.generatePoints=!0,e.sortable=!0,e},i.draw=function(t,e){var i=this,n=i.get("container"),r=this.getDrawCfg(t[0]),a=i.getYScale(),s=i.get("connectNulls"),o=ei(t,a.field,s);r.origin=t,h(o,(function(a,s){r.splitedIndex=s;var o=a.map((function(t){return t.points}));r.points=o,i.drawShape(r.shape,t[0],r,n,e)}))},e}(Yt);Yt.Area=ui;var ci={initEvent:function(){var t=this,e=this.get("chart");e&&e.on("_aftersizechange",(function(){t.set("_width",null)}))},getDefaultSize:function(){var t=this.get("defaultSize");if(!t){var e=this.get("coord"),i=this.getXScale(),n=this.get("dataArray"),r=g(i.values).length,a=i.range,s=1/r,o=1;e&&e.isPolar?o=e.transposed&&r>1?tt.widthRatio.multiplePie:tt.widthRatio.rose:(i.isLinear&&(s*=a[1]-a[0]),o=tt.widthRatio.column),s*=o,this.hasAdjust("dodge")&&(s/=n.length),t=s,this.set("defaultSize",t)}return t},getDimWidth:function(t){var e=this.get("coord"),i=e.convertPoint({x:0,y:0}),n=e.convertPoint({x:"x"===t?1:0,y:"x"===t?0:1}),r=0;return i&&n&&(r=Math.sqrt(Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2))),r},_getWidth:function(){var t=this.get("_width");if(!t){var e=this.get("coord");t=e&&e.isPolar&&!e.transposed?(e.endAngle-e.startAngle)*e.circleRadius:this.getDimWidth("x"),this.set("_width",t)}return t},_toNormalizedSize:function(t){return t/this._getWidth()},_toCoordSize:function(t){return this._getWidth()*t},getNormalizedSize:function(t){var e=this.getAttrValue("size",t);return e=a(e)?this.getDefaultSize():this._toNormalizedSize(e)},getSize:function(t){var e=this.getAttrValue("size",t);if(a(e)){var i=this.getDefaultSize();e=this._toCoordSize(i)}return e}};function fi(t){var e,i,n=t.x,r=t.y,a=t.y0,o=t.size,h=a,l=r;return s(r)&&(l=r[1],h=r[0]),s(n)?(e=n[0],i=n[1]):(e=n-o/2,i=n+o/2),[{x:e,y:h},{x:e,y:l},{x:i,y:l},{x:i,y:h}]}Pt.registerFactory("interval",{defaultShapeType:"rect",getDefaultPoints:function(t){return fi(t)}});Pt.registerShape("interval","rect",{draw:function(t,e){var i=this.parsePoints(t.points),n=_({fill:t.color},tt.shape.interval,t.style);if(t.isInCircle){var r=i.slice(0);this._coord.transposed&&(r=[i[0],i[3],i[2],i[1]]);var a=t.center,s=a.x,o=a.y,h=[1,0],l=[r[0].x-s,r[0].y-o],u=[r[1].x-s,r[1].y-o],c=[r[2].x-s,r[2].y-o],f=ht.angleTo(h,u),g=ht.angleTo(h,c),p=ht.length(l),d=ht.length(u);return f>=1.5*Math.PI&&(f-=2*Math.PI),g>=1.5*Math.PI&&(g-=2*Math.PI),e.addShape("Sector",{className:"interval",attrs:_({x:s,y:o,r:d,r0:p,startAngle:f,endAngle:g},n)})}var v=function(t){for(var e=[],i=[],n=0,r=t.length;n<r;n++){var a=t[n];e.push(a.x),i.push(a.y)}var s=Math.min.apply(null,e),o=Math.min.apply(null,i);return{x:s,y:o,width:Math.max.apply(null,e)-s,height:Math.max.apply(null,i)-o}}(i);return e.addShape("rect",{className:"interval",attrs:_(v,n)})}}),["pyramid","funnel"].forEach((function(t){Pt.registerShape("interval",t,{getPoints:function(t){return t.size=2*t.size,fi(t)},draw:function(e,i){var n,r,a=this.parsePoints(e.points),s=this.parsePoints(e.nextPoints),o=null;s?o=[a[0],a[1],s[1],s[0]]:(o=[a[0],a[1]],"pyramid"===t?o.push((n=a[2],r=a[3],{x:(n.x-r.x)/2+r.x,y:(n.y-r.y)/2+r.y})):o.push(a[2],a[3]));var h=_({fill:e.color,points:o},tt.shape.interval,e.style);return i.addShape("polygon",{className:"interval",attrs:h})}})}));var gi=function(t){it(i,t);var e=i.prototype;function i(e){var i;return _(nt(i=t.call(this,e)||this),ci),i}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="interval",e.shapeType="interval",e.generatePoints=!0,e},e.init=function(){t.prototype.init.call(this),this.initEvent()},e.createShapePointsCfg=function(e){var i=t.prototype.createShapePointsCfg.call(this,e);return i.size=this.getNormalizedSize(e),i},e.clearInner=function(){t.prototype.clearInner.call(this),this.set("defaultSize",null)},i}(Yt);Yt.Interval=gi;Pt.registerFactory("polygon",{defaultShapeType:"polygon",getDefaultPoints:function(t){for(var e=[],i=t.x,n=t.y,r=0,a=i.length;r<a;r++)e.push({x:i[r],y:n[r]});return e}});Pt.registerShape("polygon","polygon",{draw:function(t,e){var i=this.parsePoints(t.points),n=_({fill:t.color,points:i},t.style);return e.addShape("Polygon",{className:"polygon",attrs:n})}});var pi=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="polygon",e.shapeType="polygon",e.generatePoints=!0,e},i.createShapePointsCfg=function(e){var i,n=t.prototype.createShapePointsCfg.call(this,e),r=n.x,a=n.y;if(!s(r)||!s(a)){var o=this.getXScale(),h=this.getYScale(),l=.5/(o.values?o.values.length:o.ticks.length),u=.5/(h.values?h.values.length:h.ticks.length);o.isCategory&&h.isCategory?(r=[r-l,r-l,r+l,r+l],a=[a-u,a+u,a+u,a-u]):s(r)?(r=[(i=r)[0],i[0],i[1],i[1]],a=[a-u/2,a+u/2,a+u/2,a-u/2]):s(a)&&(a=[(i=a)[0],i[1],i[1],i[0]],r=[r-l/2,r-l/2,r+l/2,r+l/2]),n.x=r,n.y=a}return n},e}(Yt);Yt.Polygon=pi;Pt.registerFactory("schema",{});Pt.registerShape("schema","candle",{getPoints:function(t){return e=t.x,i=t.y,n=t.size,r=function(t){var e=t.sort((function(t,e){return t<e?1:-1})),i=e.length;if(i<4)for(var n=e[i-1],r=0;r<4-i;r++)e.push(n);return e}(i),[{x:e,y:r[0]},{x:e,y:r[1]},{x:e-n/2,y:r[2]},{x:e-n/2,y:r[1]},{x:e+n/2,y:r[1]},{x:e+n/2,y:r[2]},{x:e,y:r[2]},{x:e,y:r[3]}];var e,i,n,r},draw:function(t,e){var i=this.parsePoints(t.points),n=_({stroke:t.color,fill:t.color,lineWidth:1},t.style);return e.addShape("Custom",{className:"schema",attrs:n,createPath:function(t){t.beginPath(),t.moveTo(i[0].x,i[0].y),t.lineTo(i[1].x,i[1].y),t.moveTo(i[2].x,i[2].y);for(var e=3;e<6;e++)t.lineTo(i[e].x,i[e].y);t.closePath(),t.moveTo(i[6].x,i[6].y),t.lineTo(i[7].x,i[7].y)}})}});var di=function(t){it(i,t);var e=i.prototype;function i(e){var i;return _(nt(i=t.call(this,e)||this),ci),i}return e.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.type="schema",e.shapeType="schema",e.generatePoints=!0,e},e.init=function(){t.prototype.init.call(this),this.initEvent()},e.createShapePointsCfg=function(e){var i=t.prototype.createShapePointsCfg.call(this,e);return i.size=this.getNormalizedSize(e),i},e.clearInner=function(){t.prototype.clearInner.call(this),this.set("defaultSize",null)},i}(Yt);Yt.Schema=di;var vi=function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i;var r=n.prototype;return r._initDefaultCfg=function(){this.xField=null,this.yField=null},r.processAdjust=function(t){this.processStack(t)},r.processStack=function(t){var e=this.xField,i=this.yField,n=t.length,r={positive:{},negative:{}};this.reverseOrder&&(t=t.slice(0).reverse());for(var a=0;a<n;a++)for(var s=t[a],o=0,h=s.length;o<h;o++){var l=s[o],u=l[e]||0,c=l[i],f=u.toString();if(c=zt(c)?c[1]:c,!Xt(c)){var g=c>=0?"positive":"negative";r[g][f]||(r[g][f]=0),l[i]=[r[g][f],c+r[g][f]],r[g][f]+=c}}},n}(At);At.Stack=vi;var yi=function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i;var r=n.prototype;return r._initDefaultCfg=function(){this.marginRatio=.5,this.dodgeRatio=.5,this.adjustNames=["x","y"]},r.getDodgeOffset=function(t,e,i){var n=t.pre,r=t.next,a=r-n,s=a*this.dodgeRatio/i,o=this.marginRatio*s;return(n+r)/2+(.5*(a-i*s-(i-1)*o)+((e+1)*s+e*o)-.5*s-.5*a)},r.processAdjust=function(t){var e=this,i=t.length,n=e.xField;Bt(t,(function(t,r){for(var a=0,s=t.length;a<s;a++){var o=t[a],h=o[n],l={pre:1===s?h-1:h-.5,next:1===s?h+1:h+.5},u=e.getDodgeOffset(l,r,i);o[n]=u}}))},n}(At);At.Dodge=yi;var mi=function(t){return Nt(t,"Function")},xi=function(t,e){if(zt(t)){var i=t[0],n=void 0;n=mi(e)?e(t[0]):t[0][e];var r=void 0;return Bt(t,(function(t){(r=mi(e)?e(t):t[e])>n&&(i=t,n=r)})),i}};var _i={merge:function(t){for(var e=[],i=0;i<t.length;i++)e=e.concat(t[i]);return e}},Si=function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i;var r=n.prototype;return r._initDefaultCfg=function(){this.xField=null,this.yField=null,this.cacheMax=null,this.adjustNames=["y"],this.groupFields=null},r._getMax=function(t){var e=this.mergeData,i=xi(e,(function(e){var i=e[t];return zt(i)?Math.max.apply(null,i):i}))[t];return zt(i)?Math.max.apply(null,i):i},r._getXValuesMax=function(){var t=this.yField,e=this.xField,i={},n=this.mergeData;return Bt(n,(function(n){var r=n[e],a=n[t],s=zt(a)?Math.max.apply(null,a):a;i[r]=i[r]||0,i[r]<s&&(i[r]=s)})),i},r.processAdjust=function(t){var e=_i.merge(t);this.mergeData=e,this._processSymmetric(t),this.mergeData=null},r._processSymmetric=function(t){var e,i=this.xField,n=this.yField,r=this._getMax(n),a=t[0][0];a&&zt(a[n])&&(e=this._getXValuesMax()),Bt(t,(function(t){Bt(t,(function(t){var a,s=t[n];if(zt(s)){var o=t[i],h=e[o];a=(r-h)/2;var l=[];Bt(s,(function(t){l.push(a+t)})),t[n]=l}else a=(r-s)/2,t[n]=[a,s+a]}))}))},n}(At);At.Symmetric=Si;var wi=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="polar",this.startAngle=-Math.PI/2,this.endAngle=3*Math.PI/2,this.inner=0,this.innerRadius=0,this.isPolar=!0,this.transposed=!1,this.center=null,this.radius=null},i.init=function(e,i){t.prototype.init.call(this,e,i);var n,r,a=this.inner||this.innerRadius,s=Math.abs(i.x-e.x),o=Math.abs(i.y-e.y);this.startAngle===-Math.PI&&0===this.endAngle?(n=Math.min(s/2,o),r={x:(e.x+i.x)/2,y:e.y}):(n=Math.min(s,o)/2,r={x:(e.x+i.x)/2,y:(e.y+i.y)/2});var h=this.radius;h>0&&h<=1&&(n*=h),this.x={start:this.startAngle,end:this.endAngle},this.y={start:n*a,end:n},this.center=r,this.circleRadius=n},i._convertPoint=function(t){var e=this.center,i=this.transposed,n=i?"y":"x",r=i?"x":"y",a=this.x,s=this.y,o=a.start+(a.end-a.start)*t[n],h=s.start+(s.end-s.start)*t[r];return{x:e.x+Math.cos(o)*h,y:e.y+Math.sin(o)*h}},i._invertPoint=function(t){var e=this.center,i=this.transposed,n=this.x,r=this.y,a=i?"y":"x",s=i?"x":"y",o=[1,0,0,1,0,0];ot.rotate(o,o,n.start);var h=[1,0];ht.transformMat2d(h,h,o),h=[h[0],h[1]];var l=[t.x-e.x,t.y-e.y];if(ht.zero(l))return{x:0,y:0};var u=ht.angleTo(h,l,n.end<n.start);Math.abs(u-2*Math.PI)<.001&&(u=0);var c=ht.length(l),f=u/(n.end-n.start);f=n.end-n.start>0?f:-f;var g=(c-r.start)/(r.end-r.start),p={};return p[a]=f,p[s]=g,p},e}(ut);ut.Polar=wi;var Ci=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.startAngle=-Math.PI/2,this.endAngle=3*Math.PI/2,this.radius=null,this.center=null},i.getOffsetPoint=function(t){var e=this.startAngle,i=e+(this.endAngle-e)*t;return this._getCirclePoint(i)},i._getCirclePoint=function(t,e){var i=this.center;return e=e||this.radius,{x:i.x+Math.cos(t)*e,y:i.y+Math.sin(t)*e}},i.getTextAlignInfo=function(t,e){var i,n=this.getOffsetVector(t,e),r="middle";return n[0]>0?i="left":n[0]<0?i="right":(i="center",n[1]>0?r="top":n[1]<0&&(r="bottom")),{textAlign:i,textBaseline:r}},i.getAxisVector=function(t){var e=this.center,i=this.offsetFactor;return[(t.y-e.y)*i,-1*(t.x-e.x)*i]},i.drawLine=function(t){var e=this.center,i=this.radius,n=this.startAngle,r=this.endAngle;this.getContainer(t.top).addShape("arc",{className:"axis-line",attrs:_({x:e.x,y:e.y,r:i,startAngle:n,endAngle:r},t)})},e}(ne);ne.Circle=Ci;var Pi="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var bi=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){!function(e){var i={},n=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,r=/\d\d?/,a=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,s=/\[([^]*?)\]/gm,o=function(){};function h(t,e){for(var i=[],n=0,r=t.length;n<r;n++)i.push(t[n].substr(0,e));return i}function l(t){return function(e,i,n){var r=n[t].indexOf(i.charAt(0).toUpperCase()+i.substr(1).toLowerCase());~r&&(e.month=r)}}function u(t,e){for(t=String(t),e=e||2;t.length<e;)t="0"+t;return t}var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"],g=h(f,3),p=h(c,3);i.i18n={dayNamesShort:p,dayNames:c,monthNamesShort:g,monthNames:f,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10)*t%10]}};var d={D:function(t){return t.getDate()},DD:function(t){return u(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return t.getDay()},dd:function(t){return u(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return u(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return String(t.getFullYear()).substr(2)},YYYY:function(t){return u(t.getFullYear(),4)},h:function(t){return t.getHours()%12||12},hh:function(t){return u(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return u(t.getHours())},m:function(t){return t.getMinutes()},mm:function(t){return u(t.getMinutes())},s:function(t){return t.getSeconds()},ss:function(t){return u(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)},SS:function(t){return u(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return u(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+u(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)}},v={D:[r,function(t,e){t.day=e}],Do:[new RegExp(r.source+a.source),function(t,e){t.day=parseInt(e,10)}],M:[r,function(t,e){t.month=e-1}],YY:[r,function(t,e){var i=+(""+(new Date).getFullYear()).substr(0,2);t.year=""+(e>68?i-1:i)+e}],h:[r,function(t,e){t.hour=e}],m:[r,function(t,e){t.minute=e}],s:[r,function(t,e){t.second=e}],YYYY:[/\d{4}/,function(t,e){t.year=e}],S:[/\d/,function(t,e){t.millisecond=100*e}],SS:[/\d{2}/,function(t,e){t.millisecond=10*e}],SSS:[/\d{3}/,function(t,e){t.millisecond=e}],d:[r,o],ddd:[a,o],MMM:[a,l("monthNamesShort")],MMMM:[a,l("monthNames")],a:[a,function(t,e,i){var n=e.toLowerCase();n===i.amPm[0]?t.isPm=!1:n===i.amPm[1]&&(t.isPm=!0)}],ZZ:[/([\+\-]\d\d:?\d\d|Z)/,function(t,e){"Z"===e&&(e="+00:00");var i,n=(e+"").match(/([\+\-]|\d\d)/gi);n&&(i=60*n[1]+parseInt(n[2],10),t.timezoneOffset="+"===n[0]?i:-i)}]};v.dd=v.d,v.dddd=v.ddd,v.DD=v.D,v.mm=v.m,v.hh=v.H=v.HH=v.h,v.MM=v.M,v.ss=v.s,v.A=v.a,i.masks={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},i.format=function(t,e,r){var a=r||i.i18n;if("number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date in fecha.format");e=i.masks[e]||e||i.masks.default;var o=[];return(e=(e=e.replace(s,(function(t,e){return o.push(e),"??"}))).replace(n,(function(e){return e in d?d[e](t,a):e.slice(1,e.length-1)}))).replace(/\?\?/g,(function(){return o.shift()}))},i.parse=function(t,e,r){var a=r||i.i18n;if("string"!=typeof e)throw new Error("Invalid format in fecha.parse");if(e=i.masks[e]||e,t.length>1e3)return!1;var s=!0,o={};if(e.replace(n,(function(e){if(v[e]){var i=v[e],n=t.search(i[0]);~n?t.replace(i[0],(function(e){return i[1](o,e,a),t=t.substr(n+e.length),e})):s=!1}return v[e]?"":e.slice(1,e.length-1)})),!s)return!1;var h,l=new Date;return!0===o.isPm&&null!=o.hour&&12!=+o.hour?o.hour=+o.hour+12:!1===o.isPm&&12==+o.hour&&(o.hour=0),null!=o.timezoneOffset?(o.minute=+(o.minute||0)-+o.timezoneOffset,h=new Date(Date.UTC(o.year||l.getFullYear(),o.month||0,o.day||1,o.hour||0,o.minute||0,o.second||0,o.millisecond||0))):h=new Date(o.year||l.getFullYear(),o.month||0,o.day||1,o.hour||0,o.minute||0,o.second||0,o.millisecond||0),h},t.exports?t.exports=i:e.fecha=i}(Pi)})),Mi=function(t){return Nt(t,"Date")},ki=function(t){return $t(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),Mi(t)&&(t=t.getTime()),t};var Ti=function(t){var e,i;function n(){return t.apply(this,arguments)||this}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,e.__proto__=i;var r=n.prototype;return r._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="timeCat",this.sortable=!0,this.tickCount=5,this.mask="YYYY-MM-DD"},r.init=function(){var t=this,e=this.values;Bt(e,(function(i,n){e[n]=t._toTimeStamp(i)})),this.sortable&&e.sort((function(t,e){return t-e})),t.ticks||(t.ticks=this.calculateTicks())},r.calculateTicks=function(){var t,e=this.tickCount;e?t=Jt({maxCount:e,data:this.values,isRounding:this.isRounding}).ticks:t=this.values;return t},r.translate=function(t){t=this._toTimeStamp(t);var e=this.values.indexOf(t);return-1===e&&(e=Rt(t)&&t<this.values.length?t:NaN),e},r.scale=function(t){var e=this.rangeMin(),i=this.rangeMax(),n=this.translate(t);return e+(1===this.values.length||isNaN(n)?n:n>-1?n/(this.values.length-1):0)*(i-e)},r.getText=function(t){var e="",i=this.translate(t);e=i>-1?this.values[i]:t;var n=this.formatter;return e=parseInt(e,10),e=n?n(e):bi.format(e,this.mask)},r.getTicks=function(){var t=this,e=this.ticks,i=[];return Bt(e,(function(e){var n;n=Ft(e)?e:{text:$t(e)?e:t.getText(e),value:t.scale(e),tickValue:e},i.push(n)})),i},r._toTimeStamp=function(t){return ki(t)},n}(Qt);Lt.TimeCat=Ti;var Ai={min:0,median:.5,max:1},Di=function(){var t=e.prototype;function e(t){this._initDefaultCfg(),w(this,t)}return t._initDefaultCfg=function(){},t._getNormalizedValue=function(t,e){return a(Ai[t])?e.scale(t):Ai[t]},t.parsePercentPoint=function(t,e){var i=parseFloat(e[0])/100,n=parseFloat(e[1])/100,r=t.start,a=t.end,s=Math.abs(r.x-a.x),o=Math.abs(r.y-a.y);return{x:s*i+Math.min(r.x,a.x),y:o*n+Math.min(r.y,a.y)}},t.parsePoint=function(t,e){var i=this.xScale,n=this.yScales;if(r(e)&&(e=e(i,n)),f(e[0])&&-1!==e[0].indexOf("%")&&!isNaN(e[0].slice(0,-1)))return this.parsePercentPoint(t,e);var a=this._getNormalizedValue(e[0],i),s=this._getNormalizedValue(e[1],n[0]),o=t.convertPoint({x:a,y:s});return this.limitInPlot?a>=0&&a<=1&&s>=0&&s<=1?o:null:o},t.render=function(){},t.repaint=function(){this.remove();var t=this.coord,e=this.container,i=this.canvas;e&&!e.isDestroyed()&&(this.render(t,e),i.draw())},t.remove=function(){var t=this.element;t&&t.remove(!0)},t.changeVisible=function(t){this.visible=t;var e=this.element;e&&(e.set?e.set("visible",t):e.style.display=t?"":"none")},e}(),Ii=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="arc",this.start=[],this.end=[],this.style={stroke:"#999",lineWidth:1}},i.render=function(t,e){var i=this.parsePoint(t,this.start),n=this.parsePoint(t,this.end);if(i&&n){var r=t.center,a=Math.sqrt((i.x-r.x)*(i.x-r.x)+(i.y-r.y)*(i.y-r.y)),s=Math.atan2(i.y-r.y,i.x-r.x),o=Math.atan2(n.y-r.y,n.x-r.x),h=e.addShape("arc",{className:"guide-arc",attrs:_({x:r.x,y:r.y,r:a,startAngle:s,endAngle:o},this.style)});return this.element=h,h}},e}(Di);function Yi(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style[i]=e[i]);return t}function Oi(t){var e=document.createElement("div");return t=t.replace(/(^\s*)|(\s*$)/g,""),e.innerHTML=""+t,e.childNodes[0]}Di.Arc=Ii;var Fi=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="html",this.position=null,this.alignX="center",this.alignY="middle",this.offsetX=null,this.offsetY=null,this.html=null},i.render=function(t,e){var i=this.parsePoint(t,this.position);if(i){var n=Oi(this.html);n=Yi(n,{position:"absolute",top:Math.floor(i.y)+"px",left:Math.floor(i.x)+"px",visibility:"hidden"});var r=e.get("canvas").get("el"),a=r.parentNode;a=Yi(a,{position:"relative"});var s=Oi('<div class="guideWapper" style="position: absolute;top: 0; left: 0;"></div>');a.appendChild(s),s.appendChild(n);var o=r.offsetTop,h=r.offsetLeft,l=this.alignX,u=this.alignY,c=this.offsetX,f=this.offsetY,g=function(t,e,i,n){var r=[];return"left"===t&&"top"===e?(r[0]=0,r[1]=0):"right"===t&&"top"===e?(r[0]=-i,r[1]=0):"left"===t&&"bottom"===e?(r[0]=0,r[1]=Math.floor(-n)):"right"===t&&"bottom"===e?(r[0]=Math.floor(-i),r[1]=Math.floor(-n)):"right"===t&&"middle"===e?(r[0]=Math.floor(-i),r[1]=Math.floor(-n/2)):"left"===t&&"middle"===e?(r[0]=0,r[1]=Math.floor(-n/2)):"center"===t&&"bottom"===e?(r[0]=Math.floor(-i/2),r[1]=Math.floor(-n)):"center"===t&&"top"===e?(r[0]=Math.floor(-i/2),r[1]=0):(r[0]=Math.floor(-i/2),r[1]=Math.floor(-n/2)),r}(l,u,L(n),R(n));i.x=i.x+g[0]+h,i.y=i.y+g[1]+o,c&&(i.x+=c),f&&(i.y+=f),Yi(n,{top:Math.floor(i.y)+"px",left:Math.floor(i.x)+"px",visibility:"visible"}),this.element=s}},i.remove=function(){var t=this.element;t&&t.parentNode&&t.parentNode.removeChild(t)},e}(Di);Di.Html=Fi;var Ei=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="line",this.start=[],this.end=[],this.style={stroke:"#000",lineWidth:1}},i.render=function(t,e){var i=[];if(i[0]=this.parsePoint(t,this.start),i[1]=this.parsePoint(t,this.end),i[0]&&i[1]){var n=e.addShape("Line",{className:"guide-line",attrs:_({x1:i[0].x,y1:i[0].y,x2:i[1].x,y2:i[1].y},this.style)});return this.element=n,n}},e}(Di);Di.Line=Ei;var Ni=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="rect",this.start=[],this.end=[],this.style={fill:"#CCD7EB",opacity:.4}},i.render=function(t,e){var i=this.parsePoint(t,this.start),n=this.parsePoint(t,this.end);if(i&&n){var r=e.addShape("rect",{className:"guide-rect",attrs:_({x:Math.min(i.x,n.x),y:Math.min(i.y,n.y),width:Math.abs(n.x-i.x),height:Math.abs(i.y-n.y)},this.style)});return this.element=r,r}},e}(Di);Di.Rect=Ni;var zi=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="text",this.position=null,this.content=null,this.style={fill:"#000"},this.offsetX=0,this.offsetY=0},i.render=function(t,e){var i=this.position,n=this.parsePoint(t,i);if(n){var r=this.content,a=this.style,s=this.offsetX,o=this.offsetY;s&&(n.x+=s),o&&(n.y+=o);var h=e.addShape("text",{className:"guide-text",attrs:_({x:n.x,y:n.y,text:r},a)});return this.element=h,h}},e}(Di);Di.Text=zi;var Bi=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="tag",this.position=null,this.content=null,this.direct="tl",this.autoAdjust=!0,this.offsetX=0,this.offsetY=0,this.side=4,this.background={padding:5,radius:2,fill:"#1890FF"},this.textStyle={fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"},this.withPoint=!0,this.pointStyle={fill:"#1890FF",r:3,lineWidth:1,stroke:"#fff"}},i._getDirect=function(t,e,i,n){var r=this.direct,a=this.side,s=t.get("canvas"),o=s.get("width"),h=s.get("height"),l=e.x,u=e.y,c=r[0],f=r[1];"t"===c&&u-a-n<0?c="b":"b"===c&&u+a+n>h&&(c="t");var g="c"===c?a:0;return"l"===f&&l-g-i<0?f="r":"r"===f&&l+g+i>o?f="l":"c"===f&&(i/2+l+g>o?f="l":l-i/2-g<0&&(f="r")),r=c+f},i.render=function(t,e){var i=this.parsePoint(t,this.position);if(i&&!isNaN(i.x)&&!isNaN(i.y)){var n=this.content,r=this.background,a=this.textStyle,s=[],o=e.addGroup({className:"guide-tag"});if(this.withPoint){var h=o.addShape("Circle",{className:"guide-tag-point",attrs:_({x:i.x,y:i.y},this.pointStyle)});s.push(h)}var l=o.addGroup(),u=l.addShape("text",{className:"guide-tag-text",zIndex:1,attrs:_({x:0,y:0,text:n},a)});s.push(u);var c=u.getBBox(),f=Z(r.padding),g=c.width+f[1]+f[3],p=c.height+f[0]+f[2],d=c.minY-f[0],v=c.minX-f[3],y=l.addShape("rect",{className:"guide-tag-bg",zIndex:-1,attrs:_({x:v,y:d,width:g,height:p},r)});s.push(y);var m,x=this.autoAdjust?this._getDirect(e,i,g,p):this.direct,S=this.side,w=i.x+this.offsetX,C=i.y+this.offsetY,P=Z(r.radius);"tl"===x?(m=[{x:g+v-S-1,y:p+d-1},{x:g+v,y:p+d-1},{x:g+v,y:p+S+d}],P[2]=0,w-=g,C=C-S-p):"cl"===x?(m=[{x:g+v-1,y:(p-S)/2+d-1},{x:g+v-1,y:(p+S)/2+d+1},{x:g+S+v,y:p/2+d}],w=w-g-S,C-=p/2):"bl"===x?(m=[{x:g+v,y:-S+d},{x:g+v-S-1,y:d+1},{x:g+v,y:d+1}],P[1]=0,w-=g,C+=S):"bc"===x?(m=[{x:g/2+v,y:-S+d},{x:(g-S)/2+v-1,y:d+1},{x:(g+S)/2+v+1,y:d+1}],w-=g/2,C+=S):"br"===x?(m=[{x:v,y:d-S},{x:v,y:d+1},{x:v+S+1,y:d+1}],P[0]=0,C+=S):"cr"===x?(m=[{x:v-S,y:p/2+d},{x:v+1,y:(p-S)/2+d-1},{x:v+1,y:(p+S)/2+d+1}],w+=S,C-=p/2):"tr"===x?(m=[{x:v,y:p+S+d},{x:v,y:p+d-1},{x:S+v+1,y:p+d-1}],P[3]=0,C=C-p-S):"tc"===x&&(m=[{x:(g-S)/2+v-1,y:p+d-1},{x:(g+S)/2+v+1,y:p+d-1},{x:g/2+v,y:p+S+d}],w-=g/2,C=C-p-S);var b=l.addShape("Polygon",{className:"guide-tag-side",zIndex:0,attrs:{points:m,fill:r.fill}});return s.push(b),y.attr("radius",P),l.moveTo(w-v,C-d),l.sort(),this.element=o,s}},e}(Di);Di.Tag=Bi;var Xi=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initDefaultCfg=function(){this.type="point",this.position=null,this.offsetX=0,this.offsetY=0,this.style={fill:"#1890FF",r:3,lineWidth:1,stroke:"#fff"}},i.render=function(t,e){var i=this.parsePoint(t,this.position);if(!i)return null;var n=e.addShape("Circle",{className:"guide-point",attrs:_({x:i.x+this.offsetX,y:i.y+this.offsetY},this.style)});return this.element=n,n},e}(Di);Di.Point=Xi;var Li={circle:function(t,e,i,n){n.arc(t,e,i,0,2*Math.PI,!1)},square:function(t,e,i,n){n.moveTo(t-i,e-i),n.lineTo(t+i,e-i),n.lineTo(t+i,e+i),n.lineTo(t-i,e+i),n.closePath()}},Ri=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i._initProperties=function(){t.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="marker"},i.getDefaultAttrs=function(){return{x:0,y:0,lineWidth:0}},i.createPath=function(t){var e,i=this.get("attrs"),n=i.x,a=i.y,s=i.radius,o=i.symbol||"circle";e=r(o)?o:Li[o],t.beginPath(),e(n,a,s,t,this)},i.calculateBox=function(){var t=this.get("attrs"),e=t.x,i=t.y,n=t.radius;return{minX:e-n,minY:i-n,maxX:e+n,maxY:i+n}},e}(ye),ji=function(){var t=e.prototype;function e(t){w(this,this.getDefaultCfg(),t),this._init(),this._renderTitle(),this._renderItems()}return t.getDefaultCfg=function(){return{showTitle:!1,title:null,items:null,titleGap:12,itemGap:10,itemMarginBottom:12,itemFormatter:null,itemWidth:null,wordSpace:6,x:0,y:0,layout:"horizontal",joinString:": "}},t._init=function(){var t=new _e({zIndex:this.zIndex||0});this.container=t;var e=t.addGroup();this.wrapper=e;var i=e.addGroup({className:"itemsGroup"});this.itemsGroup=i,this.parent&&this.parent.add(t)},t._renderTitle=function(t){t=t||this.title;var e=this.titleShape,i=0;if(this.showTitle&&t){if(e&&!e.get("destroyed"))e.attr("text",t);else{var n=this.wrapper,r=this.titleStyle;e=n.addShape("text",{className:"title",attrs:_({x:0,y:0,text:t},r)}),this.titleShape=e}i=e.getBBox().height+this.titleGap}this._titleHeight=i},t._renderItems=function(t){var e=this;(t=t||e.items)&&(e.reversed&&t.reverse(),h(t,(function(t,i){e._addItem(t,i)})),t.length>1&&this._adjustItems(),this._renderBackground())},t._renderBackground=function(){var t=this.background;if(t){var e=this.container,i=this.wrapper.getBBox(),n=i.minX,r=i.minY,a=i.width,s=i.height,o=t.padding||[0,0,0,0],h=_({x:n-(o=Z(o))[3],y:r-o[0],width:a+o[1]+o[3],height:s+o[0]+o[2]},t),l=this.backShape;l?l.attr(h):l=e.addShape("Rect",{zIndex:-1,attrs:h}),this.backShape=l,e.sort()}},t._addItem=function(t){var e,i=this.itemsGroup.addGroup({name:t.name,value:t.value,dataValue:t.dataValue,checked:t.checked}),n=this.unCheckStyle,r=this.unCheckColor,a=this.nameStyle,s=this.valueStyle,o=this.wordSpace,h=t.marker,l=t.value,u=0;if(r&&(n.fill=r),h){var c=_({x:h.radius||3,y:this._titleHeight},h);!1===t.checked&&_(c,n);var f=new Ri({className:"item-marker",attrs:c});i.add(f),u+=f.getBBox().width+o}var g=t.name;if(g){var p=this.joinString||"";g=l?g+p:g,e=i.addShape("text",{className:"name",attrs:_({x:u,y:this._titleHeight,text:this._formatItemValue(g)},a,!1===t.checked?n:null)})}if(l){var d=u;e&&(d+=e.getBBox().width),i.addShape("text",{className:"value",attrs:_({x:d,y:this._titleHeight,text:l},s,!1===t.checked?n:null)})}return i},t._formatItemValue=function(t){var e=this.itemFormatter;return e&&(t=e.call(this,t)),t},t._getMaxItemWidth=function(){var t=this.itemWidth;if(p(t)||a(t))return t;if("auto"===t){for(var e=this.itemsGroup.get("children"),i=e.length,n=0,r=0;r<i;r++){var s=e[r].getBBox().width;n=Math.max(n,s)}var o=this.maxLength,h=this.itemGap,l=(o-h)/2,u=(o-2*h)/3;return 2===i?Math.max(n,l):n<=u?u:n<=l?l:n}},t._adjustHorizontal=function(){for(var t,e,i=this.maxLength,n=this.itemsGroup.get("children"),r=this.itemGap,a=this.itemMarginBottom,s=this._titleHeight,o=0,h=0,l=this._getMaxItemWidth(),u=[],c=0,f=n.length;c<f;c++){var g=n[c],p=g.getBBox(),d=p.height,v=p.width;e=d+a,(t=l||v)-(i-h)>1e-4&&(o++,h=0),g.moveTo(h,o*e),u.push({x:h,y:o*e+s-d/2,width:1.375*v,height:1.375*d}),h+=t+r}this.legendHitBoxes=u},t._adjustVertical=function(){for(var t,e,i=this.maxLength,n=this.itemsGroup,r=this.itemGap,a=this.itemMarginBottom,s=this.itemWidth,o=this._titleHeight,h=n.get("children"),l=0,u=0,c=0,f=[],g=0,d=h.length;g<d;g++){var v=h[g],y=v.getBBox();t=y.width,e=y.height,p(s)?u=s+r:t>u&&(u=t+r),i-l<e?(l=0,c+=u,v.moveTo(c,0),f.push({x:c,y:o-e/2,width:1.375*t,height:1.375*e})):(v.moveTo(c,l),f.push({x:c,y:l-e/2+o,width:1.375*t,height:1.375*e})),l+=e+a}this.legendHitBoxes=f},t._adjustItems=function(){"horizontal"===this.layout?this._adjustHorizontal():this._adjustVertical()},t.moveTo=function(t,e){this.x=t,this.y=e;var i=this.container;return i&&i.moveTo(t,e),this},t.setItems=function(t){this.clearItems(),this._renderItems(t)},t.setTitle=function(t){this._renderTitle(t)},t.clearItems=function(){this.itemsGroup.clear()},t.getWidth=function(){return this.container.getBBox().width},t.getHeight=function(){return this.container.getBBox().height},t.show=function(){this.container.show()},t.hide=function(){this.container.hide()},t.clear=function(){var t=this.container;t.clear(),t.remove(!0)},e}(),Gi=function(){var t=e.prototype;function e(t){w(this,this.getDefaultCfg(),t),this._init();var e=this.content,i=this.x,n=this.y;a(e)||this.updateContent(e),this.updatePosition(i,n)}return t.getDefaultCfg=function(){return{x:0,y:0,content:"",textStyle:{fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle",fontFamily:"Arial"},background:{radius:1,fill:"rgba(0, 0, 0, 0.65)",padding:[3,5]},width:0,height:0,className:""}},t._init=function(){var t=this.content,e=this.textStyle,i=this.background,n=this.className,r=this.visible,a=new _e({className:n,zIndex:0,visible:r}),s=a.addShape("Text",{className:n+"-text",zIndex:1,attrs:_({text:t,x:0,y:0},e)}),o=a.addShape("Rect",{className:n+"-bg",zIndex:-1,attrs:_({x:0,y:0,width:0,height:0},i)});a.sort(),this.container=a,this.textShape=s,this.backgroundShape=o},t._getBBox=function(){var t=this.textShape,e=this.background,i=t.getBBox(),n=Z(e.padding),r=i.width+n[1]+n[3],a=i.height+n[0]+n[2];return{x:i.minX-n[3],y:i.minY-n[0],width:r,height:a}},t.updateContent=function(t){var e=this.textShape,i=this.backgroundShape;if(!a(t)){o(t)||(t={text:t}),e.attr(t);var n=this._getBBox(),r=n.x,s=n.y,h=n.width,l=n.height,u=this.width||h,c=this.height||l;i.attr({x:r,y:s,width:u,height:c}),this._width=u,this._height=c,this.content=t.text}},t.updatePosition=function(t,e){var i=this.container,n=this._getBBox(),r=n.x,a=n.y;i.moveTo(t-r,e-a),this.x=t-r,this.y=e-a},t.getWidth=function(){return this._width},t.getHeight=function(){return this._height},t.show=function(){this.container.show()},t.hide=function(){this.container.hide()},t.clear=function(){var t=this.container;t.clear(),t.remove(!0),this.container=null,this.textShape=null,this.backgroundShape=null},e}(),Hi=function(){var t=e.prototype;function e(t){w(this,this.getDefaultCfg(),t);var e=this.frontPlot;if(!this.custom){var i=new ji(_({parent:e,zIndex:3},t));this.container=i;var n=this.fixed,r=this.background;n||(this.tooltipArrow=e.addShape("Polygon",{className:"tooltip-arrow",visible:!1,zIndex:2,attrs:_({points:[]},r)}))}if(this.showXTip){var a=this.xTipBackground,s=this.xTipTextStyle,o=new Gi({className:"xTip",background:a,textStyle:s,visible:!1});e.add(o.container),this.xTipBox=o}if(this.showYTip){var h=this.yTipBackground,l=this.yTipTextStyle,u=new Gi({className:"yTip",background:h,textStyle:l,visible:!1});e.add(u.container),this.yTipBox=u}this.showCrosshairs&&this._renderCrosshairs(),e.sort()}return t.getDefaultCfg=function(){return{showCrosshairs:!1,crosshairsStyle:{stroke:"rgba(0, 0, 0, 0.25)",lineWidth:1},crosshairsType:"y",showXTip:!1,showYTip:!1,xTip:null,xTipBackground:{radius:1,fill:"rgba(0, 0, 0, 0.65)",padding:[3,5]},xTipTextStyle:{fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"},yTip:null,yTipBackground:{radius:1,fill:"rgba(0, 0, 0, 0.65)",padding:[3,5]},yTipTextStyle:{fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"},background:null,layout:"horizontal",offsetX:0,offsetY:0}},t.setContent=function(t,e){if(this.title=t,this.items=e,!this.custom){var i=this.container;i.setTitle(t),i.setItems(e)}},t.setYTipContent=function(t){var e=this.yTip;t=r(e)?e(t):_({text:t},e),this.yTipBox&&this.yTipBox.updateContent(t)},t.setYTipPosition=function(t){var e=this.plotRange,i=this.crosshairsShapeX;if(this.showYTip){var n=this.yTipBox,r=n.getHeight(),a=n.getWidth(),s=e.tl.x-a,o=t-r/2;o<=e.tl.y&&(o=e.tl.y),o+r>=e.br.y&&(o=e.br.y-r),s<0&&(s=e.tl.x,i&&i.attr("x1",e.tl.x+a)),n.updatePosition(s,o)}},t.setXTipContent=function(t){var e=this.xTip;t=r(e)?e(t):_({text:t},e),this.xTipBox&&this.xTipBox.updateContent(t)},t.setXTipPosition=function(t){var e=this.showXTip,i=this.canvas,n=this.plotRange,r=this.xTipBox,a=this.crosshairsShapeY;if(e){var s=i.get("height"),o=r.getWidth(),h=r.getHeight(),l=t-o/2,u=n.br.y;l<=n.tl.x&&(l=n.tl.x),l+o>=n.tr.x&&(l=n.tr.x-o),s-u<h&&(u-=h),r.updatePosition(l,u),a&&a.attr("y1",u)}},t.setXCrosshairPosition=function(t){this.crosshairsShapeX&&this.crosshairsShapeX.moveTo(0,t)},t.setYCrosshairPosition=function(t){this.crosshairsShapeY&&this.crosshairsShapeY.moveTo(t,0)},t.setPosition=function(t){var e=this.container,i=this.plotRange,n=this.offsetX,r=this.offsetY,a=this.fixed,s=this.tooltipArrow;if(e){var o,h=e.container.getBBox(),l=h.minX,u=h.minY,c=h.width,f=h.height,g=i.tl,p=i.tr,d=0,v=g.y-f-4+r;if(a)d=(g.x+p.x)/2-c/2+n;else if((d=(o=t.length>1?(t[0].x+t[t.length-1].x)/2:t[0].x)-c/2+n)<g.x&&(d=g.x),d+c>p.x&&(d=p.x-c),s){s.attr("points",[{x:o-3,y:g.y-4+r},{x:o+3,y:g.y-4+r},{x:o,y:g.y+r}]);var y=e.backShape,m=Z(y.attr("radius"));o===g.x?(m[3]=0,s.attr("points",[{x:g.x,y:g.y+r},{x:g.x,y:g.y-4+r},{x:g.x+4,y:g.y-4+r}])):o===p.x&&(m[2]=0,s.attr("points",[{x:p.x,y:g.y+r},{x:p.x-4,y:g.y-4+r},{x:p.x,y:g.y-4+r}])),y.attr("radius",m)}e.moveTo(d-l,v-u)}},t.setMarkers=function(t){void 0===t&&(t={});var e=t,i=e.items,n=e.style,r=e.type,a=this._getMarkerGroup(r);if("circle"===r)for(var s=0,o=i.length;s<o;s++){var h=i[s],l=new Ri({className:"tooltip-circle-marker",attrs:_({x:h.x,y:h.y,stroke:h.color},n)});a.add(l)}else a.addShape("rect",{className:"tooltip-rect-marker",attrs:n})},t.clearMarkers=function(){var t=this.markerGroup;t&&t.clear()},t.show=function(){var t=this.crosshairsShapeX,e=this.crosshairsShapeY,i=this.markerGroup,n=this.container,r=this.tooltipArrow,a=this.xTipBox,s=this.yTipBox,o=this.canvas;t&&t.show(),e&&e.show(),i&&i.show(),n&&n.show(),r&&r.show(),a&&a.show(),s&&s.show(),o.draw()},t.hide=function(){var t=this.crosshairsShapeX,e=this.crosshairsShapeY,i=this.markerGroup,n=this.container,r=this.tooltipArrow,a=this.xTipBox,s=this.yTipBox;t&&t.hide(),e&&e.hide(),i&&i.hide(),n&&n.hide(),r&&r.hide(),a&&a.hide(),s&&s.hide()},t.destroy=function(){var t=this.crosshairsShapeX,e=this.crosshairsShapeY,i=this.markerGroup,n=this.container,r=this.tooltipArrow,a=this.xTipBox,s=this.yTipBox;t&&t.remove(!0),e&&e.remove(!0),i&&i.remove(!0),r&&r.remove(!0),n&&n.clear(),a&&a.clear(),s&&s.clear(),this.destroyed=!0},t._getMarkerGroup=function(t){var e=this.markerGroup;return e?e.clear():("circle"===t?(e=this.frontPlot.addGroup({zIndex:1}),this.frontPlot.sort()):e=this.backPlot.addGroup(),this.markerGroup=e),e},t._renderCrosshairs=function(){var t=this.crosshairsType,e=this.crosshairsStyle,i=this.frontPlot,n=this.plotRange,r=n.tl,a=n.br;J(t,"x")&&(this.crosshairsShapeX=i.addShape("Line",{className:"tooltip-crosshairs-x",zIndex:0,visible:!1,attrs:_({x1:r.x,y1:0,x2:a.x,y2:0},e)})),J(t,"y")&&(this.crosshairsShapeY=i.addShape("Line",{className:"tooltip-crosshairs-y",zIndex:0,visible:!1,attrs:_({x1:0,y1:a.y,x2:0,y2:r.y},e)}))},e}();function Wi(t){var e=t.getAttr("color");if(e){var i=e.getScale(e.type);if(i.isLinear)return i}var n=t.getXScale(),r=t.getYScale();return r||n}function Vi(t,e){var i,n,r=t._getGroupScales();if(r.length&&h(r,(function(t){return n=t,!1})),n){var a=n.field;i=n.getText(e[a])}else{var s=Wi(t);i=s.alias||s.field}return i}function qi(t,e){var i=Wi(t);return i.getText(e[i.field])}function Ui(t,e){var i=t.getAttr("position").getFields()[0],n=t.get("scales")[i];return n.getText(e[n.field])}function Zi(t){var e=[];return h(t,(function(t){var i=function(t,e){var i=-1;return h(t,(function(t,n){if(t.title===e.title&&t.name===e.name&&t.value===e.value&&t.color===e.color)return i=n,!1})),i}(e,t);-1===i?e.push(t):e[i]=t})),e}tt.tooltip=w({triggerOn:"press",triggerOff:"pressend",alwaysShow:!1,showTitle:!1,showCrosshairs:!1,crosshairsStyle:{stroke:"rgba(0, 0, 0, 0.25)",lineWidth:1},showTooltipMarker:!0,background:{radius:1,fill:"rgba(0, 0, 0, 0.65)",padding:[3,5]},titleStyle:{fontSize:12,fill:"#fff",textAlign:"start",textBaseline:"top"},nameStyle:{fontSize:12,fill:"rgba(255, 255, 255, 0.65)",textAlign:"start",textBaseline:"middle"},valueStyle:{fontSize:12,fill:"#fff",textAlign:"start",textBaseline:"middle"},showItemMarker:!0,itemMarkerStyle:{radius:3,symbol:"circle",lineWidth:1,stroke:"#fff"},layout:"horizontal",snap:!1},tt.tooltip||{});var Ji=function(){function t(t){var e=this;et(this,"handleShowEvent",(function(t){var i=e.chart;if(e.enable){var n=i.get("plotRange"),r=q(t,i);if(Ze(r,n)||e._tooltipCfg.alwaysShow){var a=e.timeStamp,s=+new Date;s-a>16&&(e.showTooltip(r),e.timeStamp=s)}else e.hideTooltip()}})),et(this,"handleHideEvent",(function(){e.enable&&e.hideTooltip()})),this.enable=!0,this.cfg={},this.tooltip=null,this.chart=null,this.timeStamp=0,_(this,t);var i=this.chart.get("canvas");this.canvas=i,this.canvasDom=i.get("el")}var e=t.prototype;return e._setCrosshairsCfg=function(){var t=this.chart,e=_({},tt.tooltip),i=t.get("geoms"),n=[];h(i,(function(t){var e=t.get("type");-1===n.indexOf(e)&&n.push(e)}));var r=t.get("coord").type;return!i.length||"cartesian"!==r&&"rect"!==r||1===n.length&&-1!==["line","area","path","point"].indexOf(n[0])&&_(e,{showCrosshairs:!0}),e},e._getMaxLength=function(t){void 0===t&&(t={});var e=t,i=e.layout,n=e.plotRange;return"horizontal"===i?n.br.x-n.bl.x:n.bl.y-n.tr.y},e.render=function(){if(!this.tooltip){var t=this.chart,e=t.get("canvas"),i=t.get("frontPlot").addGroup({className:"tooltipContainer",zIndex:10}),n=t.get("backPlot").addGroup({className:"tooltipContainer"}),r=t.get("plotRange"),a=t.get("coord"),s=this._setCrosshairsCfg(),o=this.cfg,h=w({plotRange:r,frontPlot:i,backPlot:n,canvas:e,fixed:a.transposed||a.isPolar},s,o);h.maxLength=this._getMaxLength(h),this._tooltipCfg=h;var l=new Hi(h);this.tooltip=l,this.bindEvents()}},e.clear=function(){var t=this.tooltip;t&&(t.destroy(),this.unBindEvents()),this.tooltip=null,this.prePoint=null,this._lastActive=null},e._getTooltipMarkerStyle=function(t){void 0===t&&(t={});var e=t,i=e.type,n=e.items,r=this._tooltipCfg;if("rect"===i){var a,s,o,h,l=this.chart,u=l.get("plotRange"),c=u.tl,f=u.br,g=l.get("coord"),p=n[0],d=n[n.length-1],v=p.width;g.transposed?(a=c.x,s=d.y-.75*v,o=f.x-c.x,h=p.y-d.y+1.5*v):(a=p.x-.75*v,s=c.y,o=d.x-p.x+1.5*v,h=f.y-c.y),t.style=_({x:a,y:s,width:o,height:h,fill:"#CCD6EC",opacity:.3},r.tooltipMarkerStyle)}else t.style=_({radius:4,fill:"#fff",lineWidth:2},r.tooltipMarkerStyle);return t},e._setTooltip=function(t,e,i){void 0===i&&(i={});var n=this._lastActive,r=this.tooltip,a=this._tooltipCfg;e=Zi(e);var s=this.chart,o=s.get("coord"),h=s.getYScales()[0],l=a.snap;if(!1===l&&h.isLinear){var u,c,f=o.invertPoint(t);Ze(t,s.get("plotRange"))&&(o.transposed?(u=h.invert(f.x),c=t.x,r.setXTipContent(u),r.setXTipPosition(c),r.setYCrosshairPosition(c)):(u=h.invert(f.y),c=t.y,r.setYTipContent(u),r.setYTipPosition(c),r.setXCrosshairPosition(c)))}if(a.onShow&&a.onShow({x:t.x,y:t.y,tooltip:r,items:e,tooltipMarkerCfg:i}),g=n,p=e,JSON.stringify(g)!==JSON.stringify(p)){var g,p;this._lastActive=e;var d=a.onChange;d&&d({x:t.x,y:t.y,tooltip:r,items:e,tooltipMarkerCfg:i});var v=e[0],y=v.title||v.name,m=v.x;if(e.length>1&&(m=(e[0].x+e[e.length-1].x)/2),r.setContent(y,e,o.transposed),r.setPosition(e,t),o.transposed){var x=v.y;e.length>1&&(x=(e[0].y+e[e.length-1].y)/2),r.setYTipContent(y),r.setYTipPosition(x),r.setXCrosshairPosition(x),l&&(r.setXTipContent(v.value),r.setXTipPosition(m),r.setYCrosshairPosition(m))}else r.setXTipContent(y),r.setXTipPosition(m),r.setYCrosshairPosition(m),l&&(r.setYTipContent(v.value),r.setYTipPosition(v.y),r.setXCrosshairPosition(v.y));var _=i.items;a.showTooltipMarker&&_.length?(i=this._getTooltipMarkerStyle(i),r.setMarkers(i)):r.clearMarkers(),r.show()}else{!1===l&&(J(a.crosshairsType,"y")||a.showYTip)&&this.chart.get("canvas").draw()}},e.showTooltip=function(t){var e,i,n=this.chart,r=[],a=[],o=this._tooltipCfg;o.showItemMarker&&(i=o.itemMarkerStyle);var l=n.get("geoms"),u=n.get("coord");if(h(l,(function(n){if(n.get("visible")){var o=n.get("type"),l=n.getSnapRecords(t),c=n.get("adjust");if("interval"===o&&c&&"symmetric"===c.type)return;h(l,(function(t){if(t.x&&t.y){var h=t.x,l=t.y,c=t._origin,f=t.color,g={x:h,y:s(l)?l[1]:l,color:f||tt.defaultColor,origin:c,name:Vi(n,c),value:qi(n,c),title:Ui(n,c)};i&&(g.marker=_({fill:f||tt.defaultColor},i)),a.push(g),-1!==["line","area","path"].indexOf(o)?(e="circle",r.push(g)):"interval"!==o||"cartesian"!==u.type&&"rect"!==u.type||(e="rect",g.width=n.getSize(t._origin),r.push(g))}}))}})),a.length){var c={items:r,type:e};this._setTooltip(t,a,c)}else this.hideTooltip()},e.hideTooltip=function(){var t=this._tooltipCfg;this._lastActive=null;var e=this.tooltip;e&&(e.hide(),t.onHide&&t.onHide({tooltip:e}),this.chart.get("canvas").draw())},e._handleEvent=function(t,e,i){var n=this.canvas;h([].concat(t),(function(t){"bind"===i?n.on(t,e):n.off(t,e)}))},e.bindEvents=function(){var t=this._tooltipCfg,e=t.triggerOn,i=t.triggerOff,n=t.alwaysShow;e&&this._handleEvent(e,this.handleShowEvent,"bind"),n||this._handleEvent(i,this.handleHideEvent,"bind")},e.unBindEvents=function(){var t=this._tooltipCfg,e=t.triggerOn,i=t.triggerOff,n=t.alwaysShow;e&&this._handleEvent(e,this.handleShowEvent,"unBind"),n||this._handleEvent(i,this.handleHideEvent,"unBind")},t}();function $i(t){var e=new Ji({chart:t});t.set("tooltipController",e),t.tooltip=function(t,i){return o(t)&&(i=t,t=!0),e.enable=t,i&&(e.cfg=i),this}}function Ki(t){var e=t.get("tooltipController");e.render(),t.showTooltip=function(t){return e.showTooltip(t),this},t.hideTooltip=function(){return e.hideTooltip(),this}}function Qi(t){t.get("tooltipController").clear()}var tn={init:$i,afterGeomDraw:Ki,clearInner:Qi},en=Object.freeze({__proto__:null,init:$i,afterGeomDraw:Ki,clearInner:Qi,default:tn});tt.guide=w({line:{style:{stroke:"#a3a3a3",lineWidth:1},top:!0},text:{style:{fill:"#787878",textAlign:"center",textBaseline:"middle"},offsetX:0,offsetY:0,top:!0},rect:{style:{fill:"#fafafa"},top:!1},arc:{style:{stroke:"#a3a3a3"},top:!0},html:{offsetX:0,offsetY:0,alignX:"center",alignY:"middle"},tag:{top:!0,offsetX:0,offsetY:0,side:4,background:{padding:5,radius:2,fill:"#1890FF"},textStyle:{fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"}},point:{top:!0,offsetX:0,offsetY:0,style:{fill:"#fff",r:3,lineWidth:2,stroke:"#1890ff"}}},tt.guide||{});var nn=function(){function t(t){this.guides=[],this.xScale=null,this.yScales=null,this.guideShapes=[],_(this,t)}var e=t.prototype;return e._toString=function(t){return r(t)&&(t=t(this.xScale,this.yScales)),t=t.toString()},e._getId=function(t,e){var i=e.id;if(!i){var n=e.type;i="arc"===n||"line"===n||"rect"===n?this._toString(e.start)+"-"+this._toString(e.end):this._toString(e.position)}return i},e.paint=function(t){var e=this,i=e.chart,n=e.guides,r=e.xScale,a=e.yScales,s=[];h(n,(function(n,o){var h;n.xScale=r,n.yScales=a,"regionFilter"===n.type?n.chart=i:h=n.top?e.frontPlot:e.backPlot,n.coord=t,n.container=h,n.canvas=i.get("canvas");var l=n.render(t,h);if(l){var u=e._getId(l,n);[].concat(l).forEach((function(t){t._id=t.get("className")+"-"+u,t.set("index",o),s.push(t)}))}})),e.guideShapes=s},e.clear=function(){return this.reset(),this.guides=[],this},e.reset=function(){h(this.guides,(function(t){t.remove()}))},e._createGuide=function(t,e){var i=y(t),n=new Di[i](w({},tt.guide[t],e));return this.guides.push(n),n},e.line=function(t){return void 0===t&&(t={}),this._createGuide("line",t)},e.text=function(t){return void 0===t&&(t={}),this._createGuide("text",t)},e.arc=function(t){return void 0===t&&(t={}),this._createGuide("arc",t)},e.html=function(t){return void 0===t&&(t={}),this._createGuide("html",t)},e.rect=function(t){return void 0===t&&(t={}),this._createGuide("rect",t)},e.tag=function(t){return void 0===t&&(t={}),this._createGuide("tag",t)},e.point=function(t){return void 0===t&&(t={}),this._createGuide("point",t)},e.regionFilter=function(t){return void 0===t&&(t={}),this._createGuide("regionFilter",t)},t}();function rn(t){var e=new nn({frontPlot:t.get("frontPlot").addGroup({zIndex:20,className:"guideContainer"}),backPlot:t.get("backPlot").addGroup({className:"guideContainer"})});t.set("guideController",e),t.guide=function(){return e}}function an(t){var e=t.get("guideController");if(e.guides.length){var i=t.getXScale(),n=t.getYScales(),r=t.get("coord");e.xScale=i,e.yScales=n,e.chart=t,e.paint(r)}}function sn(t){t.get("guideController").clear()}function on(t){t.get("guideController").reset()}var hn={init:rn,afterGeomDraw:an,clear:sn,repaint:on},ln=Object.freeze({__proto__:null,init:rn,afterGeomDraw:an,clear:sn,repaint:on,default:hn}),un={itemMarginBottom:12,itemGap:10,showTitle:!1,titleStyle:{fontSize:12,fill:"#808080",textAlign:"start",textBaseline:"top"},nameStyle:{fill:"#808080",fontSize:12,textAlign:"start",textBaseline:"middle"},valueStyle:{fill:"#000000",fontSize:12,textAlign:"start",textBaseline:"middle"},unCheckStyle:{fill:"#bfbfbf"},itemWidth:"auto",wordSpace:6,selectedMode:"multiple"};tt.legend=w({common:un,right:_({position:"right",layout:"vertical"},un),left:_({position:"left",layout:"vertical"},un),top:_({position:"top",layout:"horizontal"},un),bottom:_({position:"bottom",layout:"horizontal"},un)},tt.legend||{});var cn=function(){function t(t){var e=this;et(this,"handleEvent",(function(t){var i=e;var n=i.chart,r=q(t,n),a=function(t,e){var n=null;return h(i.legends,(function(i){h(i,(function(i){var r=i.itemsGroup,a=i.legendHitBoxes,s=r.get("children");if(s.length){var o=i.x,l=i.y;h(a,(function(r,a){if(t>=r.x+o&&t<=r.x+r.width+o&&e>=r.y+l&&e<=r.height+r.y+l)return n={clickedItem:s[a],clickedLegend:i},!1}))}}))})),n}(r.x,r.y);if(a&&!1!==a.clickedLegend.clickable){var s=a.clickedItem,o=a.clickedLegend;if(o.onClick)t.clickedItem=s,o.onClick(t);else if(!o.custom){var l=s.get("checked"),u=s.get("dataValue"),c=o.filteredVals,f=o.field;"single"===o.selectedMode?n.filter(f,(function(t){return t===u})):(l?c.push(u):A(c,u),n.filter(f,(function(t){return-1===c.indexOf(t)}))),n.repaint()}}})),this.legendCfg={},this.enable=!0,this.position="top",_(this,t);var i=this.chart;this.canvasDom=i.get("canvas").get("el"),this.clear()}var e=t.prototype;return e.addLegend=function(t,e,i){var n=this.legendCfg,r=t.field,a=n[r];if(!1===a)return null;if(a&&a.custom)this.addCustomLegend(r);else{var s=n.position||this.position;a&&a.position&&(s=a.position),t.isCategory&&this._addCategoryLegend(t,e,s,i)}},e.addCustomLegend=function(t){var e=this.legendCfg;t&&e[t]&&(e=e[t]);var i=e.position||this.position,n=this.legends;n[i]=n[i]||[];var r=e.items;if(!r)return null;var s=this.container;h(r,(function(t){c(t.marker)?t.marker.radius=t.marker.radius||3:t.marker={symbol:t.marker||"circle",fill:t.fill,radius:3},t.checked=!!a(t.checked)||t.checked,t.name=t.name||t.value}));var o=new ji(w({},tt.legend[i],e,{maxLength:this._getMaxLength(i),items:r,parent:s}));n[i].push(o)},e.clear=function(){h(this.legends,(function(t){h(t,(function(t){t.clear()}))})),this.legends={},this.unBindEvents()},e._isFiltered=function(t,e,i){var n=!1;return h(e,(function(e){if(n=n||t.getText(e)===t.getText(i))return!1})),n},e._getMaxLength=function(t){var e=this.chart,i=Z(e.get("appendPadding"));return"right"===t||"left"===t?e.get("height")-(i[0]+i[2]):e.get("width")-(i[1]+i[3])},e._addCategoryLegend=function(t,e,i,n){var r=this,a=r.legendCfg,s=r.legends,o=r.container,l=r.chart,u=t.field;s[i]=s[i]||[];var f="circle";a[u]&&a[u].marker?f=a[u].marker:a.marker&&(f=a.marker),h(e,(function(e){c(f)?_(e.marker,f):e.marker.symbol=f,n&&(e.checked=!r._isFiltered(t,n,e.dataValue))})),l.get("legendItems")[u]=e;var g=w({},tt.legend[i],a[u]||a,{maxLength:r._getMaxLength(i),items:e,field:u,filteredVals:n,parent:o});g.showTitle&&w(g,{title:t.alias||t.field});var p=new ji(g);return s[i].push(p),p},e._alignLegend=function(t,e,i){var n=this.plotRange,r=n.tl,a=n.bl,s=this.chart,o=t.offsetX||0,h=t.offsetY||0,l=s.get("width"),u=s.get("height"),c=Z(s.get("appendPadding")),f=t.getHeight(),g=t.getWidth(),p=0,d=0;if("left"===i||"right"===i){var v=t.verticalAlign||"middle",y=Math.abs(r.y-a.y);p="left"===i?c[3]:l-g-c[1],d=(y-f)/2+r.y,"top"===v?d=r.y:"bottom"===v&&(d=a.y-f),e&&(d=e.get("y")-f-12)}else{var m=t.align||"left";if(p=c[3],"center"===m?p=l/2-g/2:"right"===m&&(p=l-(g+c[1])),d="top"===i?c[0]+Math.abs(t.container.getBBox().minY):u-f,e){var x=e.getWidth();p=e.x+x+12}}"bottom"===i&&h>0&&(h=0),"right"===i&&o>0&&(o=0),t.moveTo(p+o,d+h)},e.alignLegends=function(){var t=this;return h(t.legends,(function(e,i){h(e,(function(n,r){var a=e[r-1];t._alignLegend(n,a,i)}))})),t},e.bindEvents=function(){var t=this.legendCfg.triggerOn||"touchstart";H(this.canvasDom,t,this.handleEvent)},e.unBindEvents=function(){var t=this.legendCfg.triggerOn||"touchstart";W(this.canvasDom,t,this.handleEvent)},t}();function fn(t){var e=new cn({container:t.get("backPlot"),plotRange:t.get("plotRange"),chart:t});t.set("legendController",e),t.legend=function(t,i){var n=e.legendCfg;return e.enable=!0,m(t)?(e.enable=t,n=i||{}):o(t)?n=t:n[t]=i,e.legendCfg=n,this}}function gn(t){var e=t.get("legendController");if(!e.enable)return null;var i=e.legendCfg;if(i&&i.custom)e.addCustomLegend();else{var n=t.getLegendItems(),r=t.get("scales"),a=t.get("filters");h(n,(function(t,i){var n,s=r[i],o=s.values;n=a&&a[i]?o.filter((function(t){return!a[i](t)})):[],e.addLegend(s,t,n)}))}i&&!1!==i.clickable&&e.bindEvents();var s=e.legends,o={top:0,right:0,bottom:0,left:0};h(s,(function(e,i){var n=0;h(e,(function(t){var e=t.getWidth(),r=t.getHeight();"top"===i||"bottom"===i?(n=Math.max(n,r),t.offsetY>0&&(n+=t.offsetY)):(n=Math.max(n,e),t.offsetX>0&&(n+=t.offsetX))})),o[i]=n+function(t,e){var i=0;switch(e=Z(e),t){case"top":i=e[0];break;case"right":i=e[1];break;case"bottom":i=e[2];break;case"left":i=e[3]}return i}(i,t.get("appendPadding"))})),t.set("legendRange",o)}function pn(t){t.get("legendController").alignLegends()}function dn(t){t.get("legendController").clear(),t.set("legendRange",null)}var vn={init:fn,beforeGeomDraw:gn,afterGeomDraw:pn,clearInner:dn},yn=Object.freeze({__proto__:null,init:fn,beforeGeomDraw:gn,afterGeomDraw:pn,clearInner:dn,default:vn}),mn="object"==typeof performance&&performance.now?performance:Date,xn=function(){function t(){this.anims=[],this.time=null,this.playing=!1,this.canvas=[]}var e=t.prototype;return e.play=function(){var t=this;t.time=mn.now(),t.playing=!0,Se((function e(){t.playing&&(Se(e),t.update())}))},e.stop=function(){this.playing=!1,this.time=null,this.canvas=[]},e.update=function(){var t=mn.now();this.canvas=[];for(var e=0;e<this.anims.length;e++){var i=this.anims[e];if(!(t<i.startTime||i.hasEnded)){var n=i.shape;if(n.get("destroyed"))this.anims.splice(e,1),e--;else{var r=i.startState,a=i.endState,s=i.interpolate,o=i.duration;t>=i.startTime&&!i.hasStarted&&(i.hasStarted=!0,i.onStart&&i.onStart());var h=(t-i.startTime)/o;if(h=Math.max(0,Math.min(h,1)),h=i.easing(h),i.onFrame)i.onFrame(h);else for(var l in s){var u=(0,s[l])(h),c=void 0;if("points"===l){c=[];for(var f=Math.max(r.points.length,a.points.length),g=0;g<f;g+=2)c.push({x:u[g],y:u[g+1]})}else c=u;n._attrs.attrs[l]=c,n._attrs.bbox=null}var p=n.get("canvas");-1===this.canvas.indexOf(p)&&this.canvas.push(p),i.onUpdate&&i.onUpdate(h),t>=i.endTime&&!i.hasEnded&&(i.hasEnded=!0,i.onEnd&&i.onEnd()),1===h&&(this.anims.splice(e,1),e--)}}}this.canvas.map((function(t){return t.draw(),t})),this.time=mn.now()},t}();function _n(t){return t}function Sn(t){return 1-wn(1-t)}function wn(t){return(t/=1)<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}var Cn=Object.freeze({__proto__:null,linear:_n,quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},elasticIn:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1,n=.4;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=n/(2*Math.PI)*Math.asin(1/i),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:Sn,bounceOut:wn,bounceInOut:function(t){return t<.5?.5*Sn(2*t):.5*wn(2*t-1)+.5}});function Pn(t){for(var e=[],i=0,n=t.length;i<n;i++)t[i]&&(e.push(t[i].x),e.push(t[i].y));return e}function bn(t,e){return e-=t=+t,function(i){return t+e*i}}function Mn(t,e){var i,n=e?e.length:0,r=t?Math.min(n,t.length):0,a=new Array(r),s=new Array(n);for(i=0;i<r;++i)a[i]=bn(t[i],e[i]);for(;i<n;++i)s[i]=e[i];return function(t){for(i=0;i<r;++i)s[i]=a[i](t);return s}}var kn=function(){function t(t,e,i){this.hasStarted=!1,this.hasEnded=!1,this.shape=t,this.source=e,this.timeline=i,this.animate=null}var e=t.prototype;return e.to=function(t){void 0===t&&(t={});var e,i=t.delay||0,n=t.attrs||{},r=t.duration||1e3;e="function"==typeof t.easing?t.easing:Cn[t.easing]||_n;var a={shape:this.shape,startTime:this.timeline.time+i,duration:r,easing:e},s={};for(var o in n){var h=this.source[o],l=n[o];"points"===o?(h=Pn(h),l=Pn(l),s.points=Mn(h,l),this.source.points=h,n.points=l):"matrix"===o?s.matrix=Mn(h,l):s[o]=bn(h,l)}return a.interpolate=s,a.startState=this.source,a.endState=n,a.endTime=a.startTime+r,this.timeline.anims.push(a),this.animate=a,this},e.onFrame=function(t){return this.animate&&(this.animate.onFrame=function(e){t(e)}),this},e.onStart=function(t){return this.animate&&(this.animate.onStart=function(){t()}),this},e.onUpdate=function(t){return this.animate&&(this.animate.onUpdate=function(e){t(e)}),this},e.onEnd=function(t){return this.animate&&(this.animate.onEnd=function(){t()}),this},t}(),Tn={appear:{duration:450,easing:"quadraticOut"},update:{duration:300,easing:"quadraticOut"},enter:{duration:300,easing:"quadraticOut"},leave:{duration:350,easing:"quadraticIn"}},An={defaultCfg:{},Action:{},getAnimation:function(t,e,i){var n=this.defaultCfg[t];if(n){var a=n[i];if(r(a))return a(e)}return!1},getAnimateCfg:function(t,e){var i=Tn[e],n=this.defaultCfg[t];return n&&n.cfg&&n.cfg[e]?w({},i,n.cfg[e]):i},registerAnimation:function(t,e){this.Action||(this.Action={}),this.Action[t]=e}};function Dn(t,e,i){var n;t.apply(e);var r=e[0],a=e[1];if("x"===i){t.transform([["t",r,a],["s",.01,1],["t",-r,-a]]);var s=t.getMatrix();n=ot.transform(s,[["t",r,a],["s",100,1],["t",-r,-a]])}else if("y"===i){t.transform([["t",r,a],["s",1,.01],["t",-r,-a]]);var o=t.getMatrix();n=ot.transform(o,[["t",r,a],["s",1,100],["t",-r,-a]])}else if("xy"===i){t.transform([["t",r,a],["s",.01,.01],["t",-r,-a]]);var h=t.getMatrix();n=ot.transform(h,[["t",r,a],["s",100,100],["t",-r,-a]])}return n}function In(t,e,i,n){var a=t._id,s=function(t,e,i){var n={};return t.delay&&(n.delay=r(t.delay)?t.delay(e,i):t.delay),n.easing=t.easing,n.duration=t.duration,n.delay=t.delay,n}(i,t.get("index"),a),o=s.easing,h=s.delay,l=s.duration,u=t.animate().to({attrs:e,duration:l,delay:h,easing:o});n&&u.onEnd((function(){n()}))}function Yn(t,e){var i=a(t.attr("fillOpacity"))?1:t.attr("fillOpacity"),n=a(t.attr("strokeOpacity"))?1:t.attr("strokeOpacity");t.attr("fillOpacity",0),t.attr("strokeOpacity",0),In(t,{fillOpacity:i,strokeOpacity:n},e)}var On=Object.freeze({__proto__:null,fadeIn:Yn});function Fn(t,e,i,n,r){var a,s,o=function(t){var e=t.start,i=t.end;return{start:e,end:i,width:i.x-e.x,height:Math.abs(i.y-e.y)}}(i),h=o.start,l=o.end,u=o.width,c=o.height,f=new ye.Rect({attrs:{x:h.x,y:l.y,width:u,height:c}});"y"===r?(a=h.x+u/2,s=n.y<h.y?n.y:h.y):"x"===r?(a=n.x>h.x?n.x:h.x,s=h.y+c/2):"xy"===r&&(i.isPolar?(a=i.center.x,s=i.center.y):(a=(h.x+l.x)/2,s=(h.y+l.y)/2));var g=Dn(f,[a,s],r);f.isClip=!0,f.endState={matrix:g},f.set("canvas",t.get("canvas")),t.attr("clip",f);In(f,f.endState,e,(function(){t.attr("clip",null),f.remove(!0)}))}function En(t,e,i){for(var n=t.get("children"),r=0,a=n.length;r<a;r++){var s=n[r],o=s.getBBox();In(s,{matrix:Dn(s,[(o.minX+o.maxX)/2,(o.minY+o.maxY)/2],i)},e)}}function Nn(t,e,i,n){Fn(t,e,i,n,"x")}function zn(t,e,i,n){Fn(t,e,i,n,"y")}function Bn(t,e,i,n){Fn(t,e,i,n,"xy")}function Xn(t,e){En(t,e,"xy")}function Ln(t,e,i){var n=Ue(i);n.set("canvas",t.get("canvas")),t.attr("clip",n);var r={};if(i.isPolar){var a=i.startAngle,s=i.endAngle;r.endAngle=s,n.attr("endAngle",a)}else{var o=i.start,h=i.end,l=Math.abs(o.x-h.x),u=Math.abs(o.y-h.y);i.isTransposed?(n.attr("height",0),r.height=u):(n.attr("width",0),r.width=l)}In(n,r,e,(function(){t.attr("clip",null),n.remove(!0)}))}var Rn,jn=Object.freeze({__proto__:null,groupWaveIn:Ln,groupScaleInX:Nn,groupScaleInY:zn,groupScaleInXY:Bn,shapesScaleInX:function(t,e){En(t,e,"x")},shapesScaleInY:function(t,e){En(t,e,"y")},shapesScaleInXY:Xn});ve.prototype.animate=function(){var t=_({},this.get("attrs"));return new kn(this,t,Rn)},Ke.prototype.animate=function(t){return this.set("animate",t),this},An.Action=On,An.defaultCfg={interval:{enter:function(t){return t.isPolar&&t.transposed?function(t){t.set("zIndex",-1),t.get("parent").sort()}:Yn}},area:{enter:function(t){return t.isPolar?null:Yn}},line:{enter:function(t){return t.isPolar?null:Yn}},path:{enter:function(t){return t.isPolar?null:Yn}}};var Gn={line:function(t){return t.isPolar?Bn:Ln},area:function(t){return t.isPolar?Bn:Ln},path:function(t){return t.isPolar?Bn:Ln},point:function(){return Xn},interval:function(t){var e;return t.isPolar?(e=Bn,t.transposed&&(e=Ln)):e=t.transposed?Nn:zn,e},schema:function(){return Ln}};function Hn(t,e,i){var n=[];return h(t,(function(t,r){var s=t.get("container").get("children"),o=t.get("type"),l=a(t.get("animateCfg"))?Un(o,e):t.get("animateCfg");!1!==l&&h(s,(function(e,a){e.get("className")===o&&(e._id=function(t,e,i){var n,r=t.get("type"),a="geom"+i+"-"+r,s=t.getXScale(),o=t.getYScale(),l=s.field||"x",u=o.field||"y",c=e[u];return n=s.isIdentity?s.value:e[l],a+="interval"===r||"schema"===r?"-"+n:"line"===r||"area"===r||"path"===r?"-"+r:s.isCategory?"-"+n:"-"+n+"-"+c,h(t._getGroupScales(),(function(t){var i=t.field;"identity"!==t.type&&(a+="-"+e[i])})),a}(t,e.get("origin")._origin,r),e.set("coord",i),e.set("animateCfg",l),e.set("index",a),n.push(e))})),t.set("shapes",s)})),n}function Wn(t,e,i,n){return r(n)?n:f(n)?An.Action[n]:An.getAnimation(t,e,i)}function Vn(t,e,i){if(!1===i||o(i)&&!1===i[e])return!1;var n=An.getAnimateCfg(t,e);return i&&i[e]?w({},n,i[e]):n}function qn(t,e,i){var n,a,o=[],l=[];h(e,(function(e){var i=t[e._id];i?(e.set("cacheShape",i),o.push(e),delete t[e._id]):l.push(e)})),h(t,(function(t){var e=t.className,s=t.coord,o=t._id,h=t.attrs,l=t.index,u=t.type;if(!1===(a=Vn(e,"leave",t.animateCfg)))return!0;if(n=Wn(e,s,"leave",a.animation),r(n)){var c=i.addShape(u,{attrs:h,index:l,canvas:i,className:e});c._id=o,n(c,a,s)}})),h(o,(function(t){var e=t.get("className");if(!1===(a=Vn(e,"update",t.get("animateCfg"))))return!0;var i=t.get("coord"),o=t.get("cacheShape").attrs,h=function(t,e){var i={};for(var n in e)(p(t[n])&&t[n]!==e[n]||s(t[n])&&JSON.stringify(t[n])!==JSON.stringify(e[n]))&&(i[n]=e[n]);return i}(o,t._attrs.attrs);Object.keys(h).length&&(n=Wn(e,i,"update",a.animation),r(n)?n(t,a,i):(t.attr(o),t.animate().to({attrs:h,duration:a.duration,easing:a.easing,delay:a.delay}).onEnd((function(){t.set("cacheShape",null)}))))})),h(l,(function(t){var e=t.get("className"),i=t.get("coord");if(!1===(a=Vn(e,"enter",t.get("animateCfg"))))return!0;if(n=Wn(e,i,"enter",a.animation),r(n))if("interval"===e&&i.isPolar&&i.transposed){var s=t.get("index"),h=o[s-1];n(t,a,h)}else n(t,a,i)}))}function Un(t,e){if(!t)return null;var i=e.get("animate");return t.indexOf("guide-tag")>-1&&(t="guide-tag"),o(i)?i[t]:!1!==i&&null}function Zn(){(Rn=new xn).play()}function Jn(t){if(!1!==t.get("animate")){var e=t.get("isUpdate"),i=t.get("canvas"),n=t.get("coord"),s=t.get("geoms"),o=i.get("caches")||[];0===o.length&&(e=!1);var l=Hn(s,t,n),u=t.get("axisController"),c=u.frontPlot,f=u.backPlot,g=c.get("children").concat(f.get("children")),p=[];t.get("guideController")&&(p=t.get("guideController").guideShapes);var d,v,y=[];if(g.concat(p).forEach((function(e){var i=Un(e.get("className"),t);e.set("coord",n),e.set("animateCfg",i),y.push(e),l.push(e)})),i.set("caches",function(t){for(var e={},i=0,n=t.length;i<n;i++){var r=t[i];if(r._id&&!r.isClip){var a=r._id;e[a]={_id:a,type:r.get("type"),attrs:_({},r._attrs.attrs),className:r.get("className"),geomType:r.get("className"),index:r.get("index"),coord:r.get("coord"),animateCfg:r.get("animateCfg")}}}return e}(l)),e)qn(o,l,i);else h(s,(function(e){var i=e.get("type"),s=a(e.get("animateCfg"))?Un(i,t):e.get("animateCfg");if(!1!==s)if(d=Vn(i,"appear",s),v=Wn(i,n,"appear",d.animation),r(v))h(e.get("shapes"),(function(t){v(t,d,n)}));else if(Gn[i]){v=jn[d.animation]||Gn[i](n);var o=e.getYScale(),l=n.convertPoint({x:0,y:o.scale(e.getYMinValue())}),u=e.get("container");v&&v(u,d,n,l)}})),h(y,(function(t){var e=t.get("animateCfg"),i=t.get("className");if(e&&e.appear){var a=An.getAnimateCfg(i,"appear"),s=w({},a,e.appear),o=Wn(i,n,"appear",s.animation);r(o)&&o(t,s,n)}}))}}function $n(){Rn.stop()}var Kn={afterCanvasInit:Zn,beforeCanvasDraw:Jn,afterCanvasDestroyed:$n},Qn=Object.freeze({__proto__:null,afterCanvasInit:Zn,beforeCanvasDraw:Jn,afterCanvasDestroyed:$n,default:Kn});Ke._Interactions={},Ke.registerInteraction=function(t,e){Ke._Interactions[t]=e},Ke.getInteraction=function(t){return Ke._Interactions[t]},Ke.prototype.interaction=function(t,e){var i=this._interactions||{};i[t]&&i[t].destroy();var n=new(Ke.getInteraction(t))(e,this);return i[t]=n,this._interactions=i,this},Ke.prototype.clearInteraction=function(t){var e=this._interactions;if(e)return t?(e[t]&&e[t].destroy(),delete e[t]):h(e,(function(t,i){t.destroy(),delete e[i]})),this};var tr=[0,1],er=function(){function t(t){var e=this;et(this,"chart",null),et(this,"values",null),et(this,"range",tr),et(this,"startRange",tr),et(this,"minCount",10),et(this,"_afterinit",(function(){var t=e.getPinchScale(),i=[].concat(t.values);e.values=i,e.minScale||(e.minScale=e.minCount/i.length),e.range!==tr&&(e.updateRange(e.range),e.updateTicks())})),et(this,"_afterdatachange",(function(){e.updateRange(e.range)})),this.chart=t,this._initEvent(t)}var e=t.prototype;return e._initEvent=function(t){t.on("afterinit",this._afterinit),t.on("afterdatachange",this._afterdatachange)},e.getPinchScale=function(){return this.chart.getXScale()},e.getFollowScale=function(){return(this.chart.getYScales()||[])[0]},e.start=function(){var t=this.range,e=this.getPinchScale(),i=t[0],n=t[1];this.startRange=[i,n],this.lastTickCount=e.tickCount},e.doZoom=function(t,e,i){var n=this.startRange,r=this.minScale,a=n[0],s=n[1],o=(s-a)*(1-i),h=o*t,l=o*e,u=Math.max(0,a-h),c=Math.min(1,s+l),f=[u,c];c-u<r||this.updateRange(f)},e.doMove=function(t){if(t){var e,i=this.startRange,n=i[0],r=i[1],a=r-n,s=a*t,o=n-s,h=r-s;e=o<0?[0,a]:h>1?[1-a,1]:[o,h],this.updateRange(e)}},e.updateRange=function(t){var e=this.values,i=t[0],n=t[1];i=Math.max(0,i),n=Math.min(1,n),this.range=[i,n];var r=e.length,a=i*r,s=n*r,o=e.slice(a,s);this.repaint(o)},e.repaint=function(t){var e=this.chart,i=this.getPinchScale(),n=i.values,r=i.ticks;(function(t,e){if(t.length!==e.length)return!1;var i=t.length-1;return t[0]===e[0]&&t[i]===e[i]})(n,t)||(this.updateScale(i,{ticks:r,values:t}),this.updateFollowScale(i,t),e.repaint())},e.updateFollowScale=function(t,e){var i=this.chart,n=this.getFollowScale(),r=t.field,a=t.type,s=n.field,o=[],h={};e.forEach((function(t){h[t]=!0})),i.get("data").forEach((function(e){if("timeCat"===a){var i=t._toTimeStamp(e[r]);h[i]&&o.push(e[s])}}));var l=D(o),u=l.min,c=l.max;this.updateScale(n,{min:u,max:c,nice:!0})},e.updateScale=function(t,e){t&&t.change(e)},e.updateTicks=function(){var t=this.chart,e=this.values,i=this.getPinchScale(),n=i.values,r=i.tickCount,a=i.isRounding,s=Math.round(r*e.length/n.length),o=Jt({maxCount:s,data:e,isRounding:a}).ticks;this.updateScale(i,{ticks:o,values:n}),t.repaint()},e.destroy=function(){var t=this.chart;t.off("afterinit",this._afterinit),t.off("afterdatachange",this._afterdatachange)},t}(),ir=function(){var t=e.prototype;function e(t,e){var i=this;et(this,"type",""),et(this,"startEvent","touchstart"),et(this,"processEvent","touchmove"),et(this,"endEvent","touchend"),et(this,"resetEvent",null),et(this,"context",null),et(this,"_start",(function(t){i.preStart&&i.preStart(t),i.start(t),i.onStart&&i.onStart(t)})),et(this,"_process",(function(t){i.preProcess&&i.preProcess(t),i.process(t),i.onProcess&&i.onProcess(t)})),et(this,"_end",(function(t){i.preEnd&&i.preEnd(t),i.end(t),i.onEnd&&i.onEnd(t)})),et(this,"_reset",(function(t){i.preReset&&i.preReset(t),i.reset(t),i.onReset&&i.onReset(t)})),_(this,this.getDefaultCfg(),t),this.context=this.getInteractionContext(e),this.chart=e;var n=this.range;n&&(this.context.range=n),this._bindEvents(e)}return t.getDefaultCfg=function(){return{}},t.getInteractionContext=function(t){var e=t.get("interactionContext");return e||(e=new er(t),t.set("interactionContext",e),e)},t._bindEvents=function(t){var e=this.startEvent,i=this.processEvent,n=this.endEvent,r=this.resetEvent,a=t.get("canvas");a.on(e,this._start),a.on(i,this._process),a.on(n,this._end),a.on(r,this._reset)},t._clearEvents=function(){var t=this.chart,e=this.startEvent,i=this.processEvent,n=this.endEvent,r=this.resetEvent,a=t.get("canvas");a.off(e,this._start),a.off(i,this._process),a.off(n,this._end),a.off(r,this._start)},t.start=function(){},t.process=function(){},t.end=function(){},t.reset=function(){},t.destroy=function(){this.context.destroy(),this._clearEvents()},e}(),nr=function(t){function e(){return t.apply(this,arguments)||this}it(e,t);var i=e.prototype;return i.getDefaultCfg=function(){return{type:"pan",startEvent:"panstart",processEvent:"pan",endEvent:"panend"}},i.start=function(){this.context.start()},i.process=function(t){var e=t.direction,i=t.deltaX;if("up"!==e&&"down"!==e){t.preventDefault&&t.preventDefault();var n=this.context,r=n.chart.get("coord"),a=r.start,s=i/(r.end.x-a.x);n.doMove(s)}},e}(ir),rr=function(t){it(i,t);var e=i.prototype;function i(e,i){var n;return _(nt(n=t.call(this,e,i)||this).context,e),n}return e.getDefaultCfg=function(){return{type:"pinch",startEvent:"pinchstart",processEvent:"pinch",endEvent:"pinchend"}},e.start=function(){this.context.start()},e.process=function(t){t.preventDefault&&t.preventDefault();var e=t.zoom,i=t.center,n=this.context,r=n.chart.get("coord"),a=r.start,s=r.end,o=s.x-a.x,h=Math.abs(i.x-a.x)/o,l=Math.abs(s.x-i.x)/o;n.doZoom(h,l,e)},e.end=function(){this.context.updateTicks()},i}(ir);Ke.registerInteraction("pan",nr),Ke.registerInteraction("pinch",rr);var ar={Marker:Ri};Ke.plugins.register([en,yn,ln,Qn]);var sr={Component:ar,Global:tt,Chart:Ke,Shape:Pt,G:Ve,Util:$,Helper:Je,track:Qe,Animate:An};t.Animate=An,t.Chart=Ke,t.Component=ar,t.G=Ve,t.Global=tt,t.Helper=Je,t.Shape=Pt,t.Util=$,t.default=sr,t.track=Qe,Object.defineProperty(t,"__esModule",{value:!0})}));
|