text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("echarts/lib/echarts"),require("echarts/lib/component/tooltip"),require("echarts/lib/component/legend")):"function"==typeof define&&define.amd?define(["echarts/lib/echarts","echarts/lib/component/tooltip","echarts/lib/component/legend"],t):e.VeChart=t(e.echarts)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={categoryAxis:{axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1}},valueAxis:{axisLine:{show:!1}},line:{smooth:!0},grid:{containLabel:!0,left:10,right:10}},i=["#19d4ae","#5ab1ef","#fa6e86","#ffb980","#0067a6","#c4b4e4","#d87a80","#9cbbff","#d9d0c7","#87a997","#d49ea2","#5b4947","#7ba3a8"],n=function(e){return['<span style="',"background-color:"+e+";","display: inline-block;","width: 10px;","height: 10px;","border-radius: 50%;","margin-right:2px;",'"></span>'].join("")},a=["initOptions","loading","dataEmpty","judgeWidth","widthChangeDelay"],r=["grid","dataZoom","visualMap","toolbox","title","legend","xAxis","yAxis","radar","tooltip","axisPointer","brush","geo","timeline","graphic","series","backgroundColor","textStyle"],o={th:3,mi:6,bi:9,tr:12},s={zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0,abbrLabel:{th:"k",mi:"m",bi:"b",tr:"t"}},l=1e12,c=1e9,u=1e6,d=1e3;function m(e,t,i,n){var a=e.toString().split("."),r=t-(n||0),o=2===a.length?Math.min(Math.max(a[1].length,r),t):r,s=Math.pow(10,o),l=(i(e+"e+"+o)/s).toFixed(o);if(n>t-o){var c=new RegExp("\\.?0{1,"+(n-(t-o))+"}$");l=l.replace(c,"")}return l}function h(e,t,i,n){var a=Math.abs(t),r=!1,s=!1,h="",f="",p=!1,v=void 0,y=void 0;i=i||"",t=t||0,~i.indexOf("(")?(r=!0,i=i.replace(/[(|)]/g,"")):(~i.indexOf("+")||~i.indexOf("-"))&&(y=~i.indexOf("+")?i.indexOf("+"):t<0?i.indexOf("-"):-1,i=i.replace(/[+|-]/g,"")),~i.indexOf("a")&&(v=!!(v=i.match(/a(k|m|b|t)?/))&&v[1],~i.indexOf(" a")&&(h=" "),i=i.replace(new RegExp(h+"a[kmbt]?"),""),a>=l&&!v||"t"===v?(h+=e.abbrLabel.tr,t/=l):a<l&&a>=c&&!v||"b"===v?(h+=e.abbrLabel.bi,t/=c):a<c&&a>=u&&!v||"m"===v?(h+=e.abbrLabel.mi,t/=u):(a<u&&a>=d&&!v||"k"===v)&&(h+=e.abbrLabel.th,t/=d)),~i.indexOf("[.]")&&(s=!0,i=i.replace("[.]","."));var b=t.toString().split(".")[0],g=i.split(".")[1],x=i.indexOf(","),O=(i.split(".")[0].split(",")[0].match(/0/g)||[]).length;if(g?(b=(f=~g.indexOf("[")?m(t,(g=(g=g.replace("]","")).split("["))[0].length+g[1].length,n,g[1].length):m(t,g.length,n)).split(".")[0],f=~f.indexOf(".")?"."+f.split(".")[1]:"",s&&0==+f.slice(1)&&(f="")):b=m(t,0,n),h&&!v&&+b>=1e3&&h!==o.trillion&&(b=""+ +b/1e3,h=o.million),~b.indexOf("-")&&(b=b.slice(1),p=!0),b.length<O)for(var S=O-b.length;S>0;S--)b="0"+b;x>-1&&(b=b.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")),i.indexOf(".")||(b="");var A=b+f+(h||"");return r?A=(r&&p?"(":"")+A+(r&&p?")":""):y>=0?A=0===y?(p?"-":"+")+A:A+(p?"-":"+"):p&&(A="-"+A),A}function f(e,t){Object.keys(t).forEach(function(i){e[i]=t[i]})}var p={},v={};function y(e,t,i){return function(e,t,i){t=t||p.defaultFormat,i=i||Math.round;var n=void 0,a=void 0;if(0===e&&null!==p.zeroFormat)n=p.zeroFormat;else if(null===e&&null!==p.nullFormat)n=p.nullFormat;else{for(var r in v)if(v[r]&&t.match(v[r].regexp)){a=v[r].format;break}n=(a=a||h.bind(null,p))(e,t,i,y)}return n}(0===e||void 0===e?0:null===e||function(e){return"number"==typeof e&&isNaN(e)}(e)?null:"string"==typeof e?p.zeroFormat&&e===p.zeroFormat?0:p.nullFormat&&e===p.nullFormat||!e.replace(/[^0-9]+/g,"").length?null:+e:+e||null,t,i)}f(p,s),y.options=p,y._numberToFormat=h.bind(null,p),y.register=function(e,t){v[e]=t},y.unregister=function(e){v[e]=null},y.setOptions=function(e){f(p,e)},y.reset=function(){f(p,s)},y.register("percentage",{regexp:/%/,format:function(e,t,i,n){var a=~t.indexOf(" %")?" ":"",r=void 0;return n.options.scalePercentBy100&&(e*=100),t=t.replace(/\s?%/,""),~(r=n._numberToFormat(e,t,i)).indexOf(")")?((r=r.split("")).splice(-1,0,a+"%"),r=r.join("")):r=r+a+"%",r}});var b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g=function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e},x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e};function O(e,t){var i=null;return function(){var n=this,a=arguments;clearTimeout(i),i=setTimeout(function(){e.apply(n,a)},t)}}function S(e,t,i){if(t){var n=e,a=t.split(".");a.forEach(function(e,t){t===a.length-1?n[e]=i:(n[e]||(n[e]={}),n=n[e])})}}var A="function"==typeof Symbol&&"symbol"===b(Symbol.iterator)?function(e){return void 0===e?"undefined":b(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":b(e)};function w(e){return Object.prototype.toString.call(e)}function N(e){return void 0===e?"undefined":A(e)}function j(e){return"[object Object]"===w(e)}function T(e){return"[object Array]"===w(e)}function k(e){return JSON.parse(JSON.stringify(e))}function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var L=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-";if(isNaN(e))return n;if(!t)return e;if("[object Function]"===w(t))return t(e,y);i=isNaN(i)?0:++i;var a=".["+new Array(i).join(0)+"]",r=t;switch(t){case"KMB":r=i?"0,0"+a+"a":"0,0a";break;case"normal":r=i?"0,0"+a:"0,0";break;case"percent":r=i?"0,0"+a+"%":"0,0.[00]%"}return y(e,r)},M=function(e){var t={};return Object.keys(e).forEach(function(i){e[i].forEach(function(e){t[e]=i})}),t},V=.5;function z(e){var t=e.innerRows,i=e.dimAxisName,n=e.dimension,a=e.axisVisible,r=e.dimAxisType,o=e.dims;return n.map(function(e){return{type:"category",name:i,nameLocation:"middle",nameGap:22,data:"value"===r?function(e){for(var t=Math.max.apply(null,e),i=[],n=Math.min.apply(null,e);n<=t;n++)i.push(n);return i}(o):t.map(function(t){return t[e]}),axisLabel:{formatter:function(e){return String(e)}},show:a}})}function R(e){for(var t=e.meaAxisName,i=e.meaAxisType,n=e.axisVisible,a=e.digit,r=e.scale,o=e.min,s=e.max,l={type:"value",axisTick:{show:!1},show:n},c=[],u=function(e){i[e]?c[e]=x({},l,{axisLabel:{formatter:function(t){return L(t,i[e],a)}}}):c[e]=x({},l),c[e].name=t[e]||"",c[e].scale=r[e]||!1,c[e].min=o[e]||null,c[e].max=s[e]||null},d=0;d<2;d++)u(d);return c}function F(e){var t=e.axisSite,i=e.isHistogram,a=e.meaAxisType,r=e.digit,o=e.labelMap,s=i?t.right||[]:t.top||[];return o&&(s=s.map(function(e){return void 0===o[e]?e:o[e]})),{trigger:"axis",formatter:function(e){var t=[];return t.push(e[0].name+"<br>"),e.forEach(function(e){var i=e.seriesName,o=~s.indexOf(i)?a[1]:a[0];t.push(n(e.color)),t.push(i+": "),t.push(L(e.value,o,r)),t.push("<br>")}),t.join("")}}}function H(e){var t,i=e.innerRows,n=e.metrics,a=e.stack,r=e.axisSite,o=e.isHistogram,s=e.labelMap,l=e.itemStyle,c=e.label,u=e.showLine,d=void 0===u?[]:u,m=e.dimAxisType,h=e.barGap,f=e.opacity,p=e.dims,v={},y=o?r.right||[]:r.top||[],b=o?"yAxisIndex":"xAxisIndex",x=a&&M(a);return n.forEach(function(e){v[e]=[]}),i.forEach(function(e){n.forEach(function(t){v[t].push(e[t])})}),!!(t=Object.keys(v).map(function(e,t){var i="value"===m?function(e,t){for(var i=Math.max.apply(null,t),n=[],a=Math.min.apply(null,t);a<=i;a++){var r=t.indexOf(a);~r?n.push(e[r]):n.push(null)}return n}(v[e],p):v[e],n=g({name:null!=s[e]?s[e]:e,type:~d.indexOf(e)?"line":"bar",data:i},b,~y.indexOf(e)?"1":"0");a&&x[e]&&(n.stack=x[e]),c&&(n.label=c),l&&(n.itemStyle=l);var r=f||function(e,t,i){if(!t)return e;var n=e;return t.split(".").some(function(e,t){if(void 0===n[e])return n=i,!0;n=n[e]}),n}(n,"itemStyle.normal.opacity");return"value"===m&&(n.barGap=h,n.barCategoryGap="1%",null==r&&(r=V)),null!=r&&S(n,"itemStyle.normal.opacity",r),n})).length&&t}function C(e){var t=e.metrics,i=e.labelMap,n=e.legendName;return n||i?{data:i?t.map(function(e){return null==i[e]?e:i[e]}):t,formatter:function(e){return null!=n[e]?n[e]:e}}:{data:t}}function $(e,t){return e.map(function(e){return e[t[0]]})}var _=function(e,t,i,n){var a=k(t),r=i.axisSite,o=void 0===r?{}:r,s=i.dimension,l=void 0===s?[e[0]]:s,c=i.stack,u=void 0===c?{}:c,d=i.axisVisible,m=void 0===d||d,h=i.digit,f=void 0===h?2:h,p=i.dataOrder,v=void 0!==p&&p,y=i.scale,b=void 0===y?[!1,!1]:y,g=i.min,x=void 0===g?[null,null]:g,O=i.max,S=void 0===O?[null,null]:O,A=i.legendName,w=void 0===A?{}:A,N=i.labelMap,j=void 0===N?{}:N,T=i.label,E=i.itemStyle,L=i.showLine,M=i.barGap,V=void 0===M?"-100%":M,_=i.opacity,P=n.tooltipVisible,B=n.legendVisible,D=e.slice();o.top&&o.bottom?D=o.top.concat(o.bottom):o.bottom&&!o.right?D=o.bottom:i.metrics?D=i.metrics:D.splice(e.indexOf(l[0]),1);var W=i.xAxisType||["normal","normal"],G=i.yAxisType||"category",Z=i.xAxisName||[],q=i.yAxisName||"";if(v){var U=v.label,I=v.order;U&&I?a.sort(function(e,t){return"desc"===I?e[U]-t[U]:t[U]-e[U]}):console.warn("Need to provide name and order parameters")}var Y=$(a,l),J=B&&C({metrics:D,labelMap:j,legendName:w}),K=z({innerRows:a,dimAxisName:q,dimension:l,axisVisible:m,dimAxisType:G,dims:Y}),Q=R({meaAxisName:Z,meaAxisType:W,axisVisible:m,digit:f,scale:b,min:x,max:S});return{legend:J,yAxis:K,series:H({innerRows:a,metrics:D,stack:u,axisSite:o,isHistogram:!1,labelMap:j,itemStyle:E,label:T,showLine:L,dimAxisType:G,dimension:l,barGap:V,opacity:_,dims:Y}),xAxis:Q,tooltip:P&&F({axisSite:o,isHistogram:!1,meaAxisType:W,digit:f,labelMap:j})}},P=function(e,t,i,n){var a=k(t),r=i.axisSite,o=void 0===r?{}:r,s=i.dimension,l=void 0===s?[e[0]]:s,c=i.stack,u=void 0===c?{}:c,d=i.axisVisible,m=void 0===d||d,h=i.digit,f=void 0===h?2:h,p=i.dataOrder,v=void 0!==p&&p,y=i.scale,b=void 0===y?[!1,!1]:y,g=i.min,x=void 0===g?[null,null]:g,O=i.max,S=void 0===O?[null,null]:O,A=i.labelMap,w=void 0===A?{}:A,N=i.legendName,j=void 0===N?{}:N,T=i.label,E=i.itemStyle,L=i.showLine,M=i.barGap,V=void 0===M?"-100%":M,_=i.opacity;if(v){var P=v.label,B=v.order;P&&B?a.sort(function(e,t){return"desc"===B?e[P]-t[P]:t[P]-e[P]}):console.warn("Need to provide name and order parameters")}var D=n.tooltipVisible,W=n.legendVisible,G=e.slice();o.left&&o.right?G=o.left.concat(o.right):o.left&&!o.right?G=o.left:i.metrics?G=i.metrics:G.splice(e.indexOf(l[0]),1);var Z=i.yAxisType||["normal","normal"],q=i.xAxisType||"category",U=i.yAxisName||[],I=i.xAxisName||"",Y=$(a,l),J=W&&C({metrics:G,labelMap:w,legendName:j}),K=z({innerRows:a,dimAxisName:I,dimension:l,axisVisible:m,dimAxisType:q,dims:Y});return{legend:J,yAxis:R({meaAxisName:U,meaAxisType:Z,axisVisible:m,digit:f,scale:b,min:x,max:S}),series:H({innerRows:a,metrics:G,stack:u,axisSite:o,isHistogram:!0,labelMap:w,itemStyle:E,label:T,showLine:L,dimAxisType:q,dimension:l,barGap:V,opacity:_,dims:Y}),xAxis:K,tooltip:D&&F({axisSite:o,isHistogram:!0,meaAxisType:Z,digit:f,labelMap:w})}};var B=function(e,t,i,n){t=T(t)?t:[],e=T(e)?e:[];var a=i.axisSite,r=void 0===a?{}:a,o=i.yAxisType,s=void 0===o?["normal","normal"]:o,l=i.xAxisType,c=void 0===l?"category":l,u=i.yAxisName,d=void 0===u?[]:u,m=i.dimension,h=void 0===m?[e[0]]:m,f=i.xAxisName,p=void 0===f?[]:f,v=i.axisVisible,y=void 0===v||v,b=i.area,g=i.stack,O=i.scale,S=void 0===O?[!1,!1]:O,A=i.min,w=void 0===A?[null,null]:A,N=i.max,j=void 0===N?[null,null]:N,k=i.nullAddZero,E=void 0!==k&&k,V=i.digit,z=void 0===V?2:V,R=i.legendName,F=void 0===R?{}:R,H=i.labelMap,C=void 0===H?{}:H,$=i.label,_=i.itemStyle,P=i.lineStyle,B=i.areaStyle,D=n.tooltipVisible,W=n.legendVisible,G=n.tooltipFormatter,Z=e.slice();r.left&&r.right?Z=r.left.concat(r.right):r.left&&!r.right?Z=r.left:i.metrics?Z=i.metrics:Z.splice(e.indexOf(h[0]),1);var q=W&&function(e){var t=e.metrics,i=e.legendName,n=e.labelMap;return i||n?{data:n?t.map(function(e){return null==n[e]?e:n[e]}):t,formatter:function(e){return null!=i[e]?i[e]:e}}:{data:t}}({metrics:Z,legendName:F,labelMap:C}),U=D&&function(e){var t=e.axisSite,i=e.yAxisType,n=e.digit,a=e.labelMap,r=e.tooltipFormatter,o=t.right||[],s=a?o.map(function(e){return void 0===a[e]?e:a[e]}):o;return{trigger:"axis",formatter:function(e){if(r)return r.apply(null,arguments);var t=[],a=e[0],o=a.name,l=a.axisValueLabel,c=o||l;return t.push(c+"<br>"),e.forEach(function(e){var a,r=e.seriesName,o=e.data,l=e.marker,c=~s.indexOf(r)?i[1]:i[0],u=T(o)?o[1]:o;a=L(u,c,n),t.push(l),t.push(r+": "+a),t.push("<br>")}),t.join("")}}}({axisSite:r,yAxisType:s,digit:z,labelMap:C,xAxisType:c,tooltipFormatter:G}),I=function(e){var t=e.dimension,i=e.rows,n=e.xAxisName,a=e.axisVisible,r=e.xAxisType;return t.map(function(e,t){return{type:r,nameLocation:"middle",nameGap:22,name:n[t]||"",axisTick:{show:!0,lineStyle:{color:"#eee"}},data:i.map(function(t){return t[e]}),show:a}})}({dimension:h,rows:t,xAxisName:p,axisVisible:y,xAxisType:c}),Y=function(e){for(var t=e.yAxisName,i=e.yAxisType,n=e.axisVisible,a=e.scale,r=e.min,o=e.max,s=e.digit,l={type:"value",axisTick:{show:!1},show:n},c=[],u=function(e){i[e]?c[e]=x({},l,{axisLabel:{formatter:function(t){return L(t,i[e],s)}}}):c[e]=x({},l),c[e].name=t[e]||"",c[e].scale=a[e]||!1,c[e].min=r[e]||null,c[e].max=o[e]||null},d=0;d<2;d++)u(d);return c}({yAxisName:d,yAxisType:s,axisVisible:y,scale:S,min:w,max:j,digit:z});return{legend:q,xAxis:I,series:function(e){var t=e.rows,i=e.axisSite,n=e.metrics,a=e.area,r=e.stack,o=e.nullAddZero,s=e.labelMap,l=e.label,c=e.itemStyle,u=e.lineStyle,d=e.areaStyle,m=e.dimension,h=[],f={},p=r&&M(r);return n.forEach(function(e){f[e]=[]}),t.forEach(function(e){n.forEach(function(t){var i=null;null!=e[t]?i=e[t]:o&&(i=0),f[t].push([e[m[0]],i])})}),n.forEach(function(e){var t={name:null!=s[e]?s[e]:e,type:"line",data:f[e]};a&&(t.areaStyle={normal:{}}),i.right&&(t.yAxisIndex=~i.right.indexOf(e)?1:0),r&&p[e]&&(t.stack=p[e]),l&&(t.label=l),c&&(t.itemStyle=c),u&&(t.lineStyle=u),d&&(t.areaStyle=d),h.push(t)}),h}({rows:t,axisSite:r,metrics:Z,area:b,stack:g,nullAddZero:E,labelMap:C,label:$,itemStyle:_,lineStyle:P,areaStyle:B,xAxisType:c,dimension:h}),yAxis:Y,tooltip:U}},D=[80,100],W=[20,100];var G=function(e,t,i,a,r){var o=k(t),s=i.dataType,l=void 0===s?"normal":s,c=i.percentShow,u=i.dimension,d=void 0===u?e[0]:u,m=i.metrics,h=void 0===m?e[1]:m,f=i.roseType,p=void 0!==f&&f,v=i.radius,y=void 0===v?r?p?W:D:100:v,b=i.offsetY,g=void 0===b?200:b,O=i.legendLimit,S=void 0===O?30:O,A=i.selectedMode,w=void 0!==A&&A,N=i.hoverAnimation,j=void 0===N||N,T=i.digit,E=void 0===T?2:T,M=i.legendName,V=void 0===M?{}:M,z=i.label,R=void 0!==z&&z,F=i.level,H=void 0!==F&&F,C=i.limitShowNum,$=void 0===C?0:C,_=i.labelLine,P=i.itemStyle,B=a.tooltipVisible,G=a.legendVisible;return $&&o.sort(function(e,t){return t[h]-e[h]}),{series:function(e){var t=e.innerRows,i=e.dataType,n=e.percentShow,a=e.dimension,r=e.metrics,o=e.radius,s=e.offsetY,l=e.selectedMode,c=e.hoverAnimation,u=e.digit,d=e.roseType,m=e.label,h=e.level,f=e.limitShowNum,p=e.isRing,v=e.labelLine,y=e.itemStyle,b=[],g={},O=[];h?(h.forEach(function(e,t){e.forEach(function(e){g[e]=t})}),t.forEach(function(e){var t=g[e[a]];void 0!==t&&(O[t]?O[t].push(e):O[t]=[e])})):O.push(t);var S={type:"pie",selectedMode:l,hoverAnimation:c,roseType:d,center:["50%",s]},A=O.length;if(O.forEach(function(e,t){var s=x({data:[]},S),l=o/A;if(t){var c=l+o/(2*A)*(2*t-1),d=c+o/(2*A);s.radius=[c,d]}else s.radius=p?o:l;A>1&&0===t&&(s.label={normal:{position:"inner"}}),m&&(s.label=m),v&&(s.labelLine=v),y&&(s.itemStyle=y),n&&(s.label={normal:{show:!0,position:A>1&&0===t?"inner":"outside",formatter:function(e){var t=[];return t.push(e.name+":"),t.push(L(e.value,i,u)),t.push("("+e.percent+"%)"),t.join(" ")}}}),s.data=e.map(function(e){return{name:e[a],value:e[r]}}),b.push(s)}),f&&f<b[0].data.length){var w=b[0].data,N=0;w.slice(f,w.length).forEach(function(e){N+=e.value}),b[0].data=w.slice(0,f),b[0].data.push({name:"其他",value:N})}return b}({innerRows:o,dataType:l,percentShow:c,dimension:d,metrics:h,radius:y,offsetY:g,selectedMode:w,hoverAnimation:j,digit:E,roseType:p,label:R,level:H,legendName:V,limitShowNum:$,isRing:r,labelLine:_,itemStyle:P}),legend:G&&function(e){var t=e.innerRows,i=e.dimension,n=e.legendLimit,a=e.legendName,r=e.level,o=e.limitShowNum,s=[],l=[];if(r)r.forEach(function(e){e.forEach(function(e){l.push(e)})}),s=l;else if(o&&o<t.length){for(var c=0;c<o;c++)s.push(t[c][i]);s.push("其他")}else s=t.map(function(e){return e[i]});return!!s.length&&{data:s,show:s.length<n,formatter:function(e){return null!=a[e]?a[e]:e}}}({innerRows:o,dimension:d,legendLimit:S,legendName:V,level:H,limitShowNum:$}),tooltip:B&&function(e){var t=e.dataType,i=e.innerRows,a=e.limitShowNum,r=e.digit,o=e.metrics,s=e.dimension,l=0,c=i.map(function(e){return l+=e[o],{name:e[s],value:e[o]}}).slice(a,i.length);return{formatter:function(e){var i=[];return i.push(n(e.color)),a&&"其他"===e.name?(i.push("其他:"),c.forEach(function(e){var n=e.name,a=e.value,o=L(a/l,"percent");i.push("<br>"+n+":"),i.push(L(a,t,r)),i.push("("+o+")")})):(i.push(e.name+":"),i.push(L(e.value,t,r)),i.push("("+e.percent+"%)")),i.join(" ")}}}({dataType:l,innerRows:o,limitShowNum:$,digit:E,metrics:h,dimension:d})}},Z=function(e,t,i,n){return G(e,t,i,n,!0)};var q=function(e,t,i,a){var r=e.slice(),o=t.slice(),s=i.dataType,l=void 0===s?"normal":s,c=i.dimension,u=void 0===c?r[0]:c,d=i.sequence,m=void 0===d?o.map(function(e){return e[u]}):d,h=i.digit,f=void 0===h?2:h,p=i.ascending,v=i.label,y=i.labelLine,b=i.legendName,g=void 0===b?{}:b,x=i.itemStyle,O=i.filterZero,S=i.useDefaultOrder,A=a.tooltipVisible,w=a.legendVisible,N=void 0;if(i.metrics)N=i.metrics;else{var j=r.slice();j.splice(r.indexOf(u),1),N=j[0]}return{tooltip:A&&function(e,t){return{trigger:"item",formatter:function(i){var a=[];return a.push(n(i.color)),a.push(i.name+": "+L(i.data.realValue,e,t)),a.join("")}}}(l,f),legend:w&&function(e){var t=e.data,i=e.legendName;return{data:t,formatter:function(e){return null!=i[e]?i[e]:e}}}({data:m,legendName:g}),series:function(e){var t=e.dimension,i=e.metrics,n=e.rows,a=e.sequence,r=e.ascending,o=e.label,s=e.labelLine,l=e.itemStyle,c=e.filterZero,u=e.useDefaultOrder,d={type:"funnel"},m=n.sort(function(e,i){return a.indexOf(e[t])-a.indexOf(i[t])});c&&(m=m.filter(function(e){return e[i]}));var h=!1;m.some(function(e,t){if(t&&e[i]>m[t-1][i])return h=!0,!0});var f=100/m.length;return d.data=h&&!u?m.slice().reverse().map(function(e,n){return{name:e[t],value:(n+1)*f,realValue:e[i]}}):m.map(function(e){return{name:e[t],value:e[i],realValue:e[i]}}),r&&(d.sort="ascending"),o&&(d.label=o),s&&(d.labelLine=s),l&&(d.itemStyle=l),d}({dimension:u,metrics:N,rows:o,sequence:m,ascending:p,label:v,labelLine:y,itemStyle:x,filterZero:O,useDefaultOrder:S})}};var U=function(e,t,i,a){var r=i.dataType,o=void 0===r?{}:r,s=i.legendName,l=void 0===s?{}:s,c=i.labelMap,u=void 0===c?{}:c,d=i.dimension,m=void 0===d?e[0]:d,h=i.digit,f=void 0===h?2:h,p=i.label,v=i.itemStyle,y=i.lineStyle,b=i.areaStyle,g=a.tooltipVisible,x=a.legendVisible,O=e.slice();i.metrics?O=i.metrics:O.splice(e.indexOf(m),1);var S=x&&function(e,t,i){return{data:e.map(function(e){return e[t]}),formatter:function(e){return null!=i[e]?i[e]:e}}}(t,m,l),A=function(e,t,i){var n={indicator:[],shape:"circle",splitNumber:5},a={};return e.forEach(function(e){t.forEach(function(t){var n=null!=i[t]?i[t]:t;a[n]?a[n].push(e[t]):a[n]=[e[t]]})}),n.indicator=Object.keys(a).map(function(e){return{name:e,max:Math.max.apply(null,a[e])}}),n}(t,O,u);return{legend:S,tooltip:g&&function(e,t,i){var a=[],r=[];return t.indicator.map(function(t,i){a[i]=e[t.name],r[i]=t.name}),{formatter:function(e){var t=[];return t.push(n(e.color)),t.push(e.name+"<br />"),e.data.value.forEach(function(e,n){t.push(r[n]+": "),t.push(L(e,a[n],i)+"<br />")}),t.join("")}}}(o,A,f),radar:A,series:function(e){var t=e.rows,i=e.dimension,n=e.metrics,a=e.radar,r=e.label,o=e.itemStyle,s=e.lineStyle,l=e.labelMap,c=e.areaStyle,u={};a.indicator.forEach(function(e,t){var i=e.name;u[i]=t});var d=t.map(function(e){var t={value:[],name:e[i]};return Object.keys(e).forEach(function(i){if(~n.indexOf(i)){var a=null!=l[i]?u[l[i]]:u[i];t.value[a]=e[i]}}),t}),m={name:i,type:"radar",data:d};return r&&(m.label=r),o&&(m.itemStyle=o),s&&(m.lineStyle=s),c&&(m.areaStyle=c),[m]}({rows:t,dimension:m,metrics:O,radar:A,label:p,itemStyle:v,lineStyle:y,labelMap:u,areaStyle:b})}};var I=function(e,t,i,n){var a=i.dataType,r=void 0===a?"normal":a,o=i.dimension,s=void 0===o?e[0]:o,l=i.totalName,c=void 0===l?"总计":l,u=i.totalNum,d=i.remainName,m=void 0===d?"其他":d,h=i.xAxisName,f=void 0===h?s:h,p=i.labelMap,v=void 0===p?{}:p,y=i.axisVisible,b=void 0===y||y,g=i.digit,O=void 0===g?2:g,S=n.tooltipVisible,A=e.slice();A.splice(A.indexOf(s),1);var w=A[0],N=w,j=S&&function(e,t){return{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(i){var n=i[1];return[n.name+"<br/>"+n.seriesName+" :",""+L(n.value,e,t)].join("")}}}(r,O),T=parseFloat(t.reduce(function(e,t){return e+Number(t[w])},0).toFixed(O)),k=function(e,t){return t?t>e?"have-remain":"none-remain":"not-total"}(T,u);return{tooltip:j,xAxis:function(e){var t=e.dimension,i=e.rows,n=e.remainStatus,a=e.totalName,r=e.remainName,o=e.labelMap,s=e.xAxisName,l=e.axisVisible,c=[a].concat(i.map(function(e){return e[t]}));return"have-remain"===n&&(c=c.concat([r])),{type:"category",name:o&&o[s]||s,splitLine:{show:!1},data:c,show:l}}({dimension:s,rows:t,remainStatus:k,totalName:c,remainName:m,xAxisName:f,labelMap:v,axisVisible:b}),yAxis:function(e){var t=e.dataType,i=e.yAxisName,n=e.axisVisible,a=e.digit,r=e.labelMap;return{type:"value",name:null!=r[i]?r[i]:i,axisTick:{show:!1},axisLabel:{formatter:function(e){return L(e,t,a)}},show:n}}({dataType:r,yAxisName:N,axisVisible:b,digit:O,labelMap:v}),series:function(e){var t=e.dataType,i=e.rows,n=e.metrics,a=e.totalNum,r=e.remainStatus,o=e.dataSum,s=e.digit,l={type:"bar",stack:"总量"},c=o,u=a,d=void 0,m=void 0,h=i.map(function(e){return e[n]});"have-remain"===r?(d=[0].concat(i.map(function(e){return u-=e[n]})).concat([0]),m=[a].concat(h).concat([a-o])):(d=[0].concat(i.map(function(e){return c-=e[n]})),m=[o].concat(h));var f=[];return f.push(x({name:"辅助",itemStyle:{normal:{opacity:0},emphasis:{opacity:0}},data:d},l)),f.push(x({name:"数值",label:{normal:{show:!0,position:"top",formatter:function(e){return L(e.value,t,s)}}},data:m},l)),f}({dataType:r,rows:t,dimension:s,metrics:w,totalNum:u,remainStatus:k,dataSum:T,digit:O})}},Y={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"v-charts-component-loading"},[t("div",{staticClass:"loader"},[t("div",{staticClass:"loading-spinner"},[t("svg",{staticClass:"circular",attrs:{viewBox:"25 25 50 50"}},[t("circle",{staticClass:"path",attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})])])])])},staticRenderFns:[]},J={render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"v-charts-data-empty"},[this._v(" 暂无数据 ")])},staticRenderFns:[]};function K(e,t){Object.keys(t).forEach(function(i){t[i]&&(e[i]=t[i])})}var Q={render:function(e){return e("div",{class:[(t=this.$options.name||this.$options._componentTag,t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())],style:this.canvasStyle},[e("div",{style:this.canvasStyle,class:{"v-charts-mask-status":this.dataEmpty||this.loading},ref:"canvas"}),e(J,{style:{display:this.dataEmpty?"":"none"}}),e(Y,{style:{display:this.loading?"":"none"}}),this.$slots.default]);var t},props:{data:{type:[Object,Array],default:function(){return{}}},settings:{type:Object,default:function(){return{}}},width:{type:String,default:"auto"},height:{type:String,default:"400px"},beforeConfig:{type:Function},afterConfig:{type:Function},afterSetOption:{type:Function},afterSetOptionOnce:{type:Function},events:{type:Object},grid:{type:[Object,Array]},colors:{type:Array},tooltipVisible:{type:Boolean,default:!0},legendVisible:{type:Boolean,default:!0},legendPosition:{type:String},markLine:{type:Object},markArea:{type:Object},markPoint:{type:Object},visualMap:{type:[Object,Array]},dataZoom:{type:[Object,Array]},toolbox:{type:[Object,Array]},initOptions:{type:Object,default:function(){return{}}},title:[Object,Array],legend:[Object,Array],xAxis:[Object,Array],yAxis:[Object,Array],radar:Object,tooltip:Object,axisPointer:[Object,Array],brush:[Object,Array],geo:[Object,Array],timeline:[Object,Array],graphic:[Object,Array],series:[Object,Array],backgroundColor:[Object,String],textStyle:[Object,Array],animation:Object,theme:Object,themeName:String,loading:Boolean,dataEmpty:Boolean,extend:Object,judgeWidth:{type:Boolean,default:!1},widthChangeDelay:{type:Number,default:300},tooltipFormatter:{type:Function},resizeable:{type:Boolean,default:!0},resizeDelay:{type:Number,default:200},changeDelay:{type:Number,default:0},setOptionOpts:{type:[Boolean,Object],default:!0},cancelResizeCheck:Boolean,notSetUnchange:Array},watch:{data:{deep:!0,handler:function(e){e&&this.changeHandler()}},settings:{deep:!0,handler:function(e){e.type&&this.chartLib&&(this.chartHandler=this.chartLib[e.type]),this.changeHandler()}},width:"nextTickResize",height:"nextTickResize",events:{deep:!0,handler:"createEventProxy"},theme:{deep:!0,handler:"themeChange"},themeName:"themeChange",resizeable:"resizeableHandler"},computed:{canvasStyle:function(){return{width:this.width,height:this.height,position:"relative"}},chartColor:function(){return this.colors||this.theme&&this.theme.color||i}},methods:{dataHandler:function(){if(this.chartHandler){var e=this.data,t=e,i=t.columns,n=void 0===i?[]:i,a=t.rows,r=void 0===a?[]:a,o={tooltipVisible:this.tooltipVisible,legendVisible:this.legendVisible,echarts:this.echarts,color:this.chartColor,tooltipFormatter:this.tooltipFormatter,_once:this._once};this.beforeConfig&&(e=this.beforeConfig(e));var s=this.chartHandler(n,r,this.settings,o);s&&("function"==typeof s.then?s.then(this.optionsHandler):this.optionsHandler(s))}},nextTickResize:function(){this.$nextTick(this.resize)},resize:function(){this.cancelResizeCheck?this.echartsResize():this.$el&&this.$el.clientWidth&&this.$el.clientHeight&&this.echartsResize()},echartsResize:function(){this.echarts&&this.echarts.resize()},optionsHandler:function(t){var i=this;if(this.legendPosition&&t.legend&&(t.legend[this.legendPosition]=10,~["left","right"].indexOf(this.legendPosition)&&(t.legend.top="middle",t.legend.orient="vertical")),t.color=this.chartColor,r.forEach(function(e){i[e]&&(t[e]=i[e])}),this.animation&&function(e,t){Object.keys(t).forEach(function(i){e[i]=t[i]})}(t,this.animation),this.markArea||this.markLine||this.markPoint){var n={markArea:this.markArea,markLine:this.markLine,markPoint:this.markPoint},a=t.series;T(a)?a.forEach(function(e){K(e,n)}):j(a)&&K(a,n)}this.extend&&function(e,t){Object.keys(t).forEach(function(i){var n=t[i];~i.indexOf(".")?S(e,i,n):"function"==typeof n?e[i]=n(e[i]):T(e[i])&&j(e[i][0])?e[i].forEach(function(t,a){e[i][a]=x({},t,n)}):j(e[i])?e[i]=x({},e[i],n):e[i]=n})}(t,this.extend),this.afterConfig&&(t=this.afterConfig(t));var o=this.setOptionOpts;!this.settings.bmap&&!this.settings.amap||j(o)||(o=!1),this.notSetUnchange&&this.notSetUnchange.length&&(this.notSetUnchange.forEach(function(e){var n=t[e];n&&(!function e(t,i){if(t===i)return!0;if(null===t||null===i||"object"!==N(t)||"object"!==N(i))return t===i;for(var n in t)if(E(t,n)){var a=t[n],r=i[n],o=N(a);if("undefined"===N(r))return!1;if("object"===o){if(!e(a,r))return!1}else if(a!==r)return!1}for(var s in i)if(E(i,s)&&"undefined"===N(t)[s])return!1;return!0}(n,i._store[e])?i._store[e]=k(n):t[e]=void 0)}),j(o)?o.notMerge=!1:o=!1),this.echarts.setOption(t,o),this.$emit("ready",this.echarts,t,e),this._once["ready-once"]||(this._once["ready-once"]=!0,this.$emit("ready-once",this.echarts,t,e)),this.judgeWidth&&this.judgeWidthHandler(t),this.afterSetOption&&this.afterSetOption(this.echarts,t,e),this.afterSetOptionOnce&&!this._once.afterSetOptionOnce&&(this._once.afterSetOptionOnce=!0,this.afterSetOptionOnce(this.echarts,t,e))},judgeWidthHandler:function(e){var t=this,i=this.widthChangeDelay,n=this.resize;this.$el.clientWidth||this.$el.clientHeight?n():this.$nextTick(function(e){t.$el.clientWidth||t.$el.clientHeight?n():setTimeout(function(e){n(),t.$el.clientWidth&&t.$el.clientHeight||console.warn(" Can't get dom width or height ")},i)})},resizeableHandler:function(e){e&&!this._once.onresize&&this.addResizeListener(),!e&&this._once.onresize&&this.removeResizeListener()},init:function(){if(!this.echarts){var i=this.themeName||this.theme||t;this.echarts=e.init(this.$refs.canvas,i,this.initOptions),this.data&&this.changeHandler(),this.createEventProxy(),this.resizeable&&this.addResizeListener()}},addResizeListener:function(){window.addEventListener("resize",this.resizeHandler),this._once.onresize=!0},removeResizeListener:function(){window.removeEventListener("resize",this.resizeHandler),this._once.onresize=!1},addWatchToProps:function(){var e=this,t=this._watchers.map(function(e){return e.expression});Object.keys(this.$props).forEach(function(i){if(!~t.indexOf(i)&&!~a.indexOf(i)){var n={};~["[object Object]","[object Array]"].indexOf(w(e.$props[i]))&&(n.deep=!0),e.$watch(i,function(){e.changeHandler()},n)}})},createEventProxy:function(){var e=this,t=this,i=Object.keys(this.events||{});i.length&&i.forEach(function(i){-1===e.registeredEvents.indexOf(i)&&(e.registeredEvents.push(i),e.echarts.on(i,function(e){return function(){if(e in t.events){for(var i=arguments.length,n=Array(i),a=0;a<i;a++)n[a]=arguments[a];t.events[e].apply(null,n)}}}(i)))})},themeChange:function(e){this.clean(),this.echarts=null,this.init()},clean:function(){this.resizeable&&this.removeResizeListener(),this.echarts.dispose()}},created:function(){this.echarts=null,this.registeredEvents=[],this._once={},this._store={},this.resizeHandler=O(this.resize,this.resizeDelay),this.changeHandler=O(this.dataHandler,this.changeDelay),this.addWatchToProps()},mounted:function(){this.init()},beforeDestroy:function(){this.clean()},_numerify:y};return x({},Q,{name:"VeChart",data:function(){return this.chartLib={bar:_,histogram:P,line:B,pie:G,ring:Z,funnel:q,radar:U,waterfall:I},this.chartHandler=this.chartLib[this.settings.type],{}}})});
  