text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("echarts/lib/echarts"),require("echarts/lib/component/tooltip"),require("echarts/lib/component/legend"),require("echarts/lib/chart/radar")):"function"==typeof define&&define.amd?define(["echarts/lib/echarts","echarts/lib/component/tooltip","echarts/lib/component/legend","echarts/lib/chart/radar"],e):t.VeRadar=e(t.echarts)}(this,function(t){"use strict";(t="default"in t?t.default:t).registerTheme("ve-chart",{categoryAxis:{axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1}},valueAxis:{axisLine:{show:!1}},line:{smooth:!0},grid:{containLabel:!0,left:10,right:10}});var e=function(t){return['<span style="',"background-color:"+t+";","display: inline-block;","width: 10px;","height: 10px;","border-radius: 50%;","margin-right:2px;",'"></span>'].join("")},i=["#19d4ae","#5ab1ef","#fa6e86","#ffb980","#0067a6","#c4b4e4","#d87a80","#9cbbff","#d9d0c7","#87a997","#d49ea2","#5b4947","#7ba3a8"],n=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-";if(null==t||isNaN(t))return n;switch(e){case"KMB":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(isNaN(+t))return t;for(var i=[{value:1e18,symbol:"E"},{value:1e15,symbol:"P"},{value:1e12,symbol:"T"},{value:1e9,symbol:"B"},{value:1e6,symbol:"M"},{value:1e3,symbol:"k"}],n=0;n<i.length;n++)if(Math.abs(t)>=i[n].value)return(t/i[n].value).toFixed(e)+i[n].symbol;return t.toString()}(t);case"percent":return parseFloat((100*t).toFixed(i))+"%";case"normal":return String(t).replace(/^(\s+|-)?\d+(?=.?\d*($|\s))/g,function(t){return t.replace(/(?=(?!\b)(\d{3})+$)/g,",")});default:return t}},r=function(t){return Object.prototype.toString.call(t)},a=function(t){return"[object Object]"===r(t)};var o=function(t,i,r,a){var o=r.dataType,s=void 0===o?{}:o,c=r.legendName,h=void 0===c?{}:c,l=r.labelMap,d=void 0===l?{}:l,u=r.dimension,f=void 0===u?t[0]:u,p=r.digit,b=void 0===p?2:p,m=r.label,y=r.itemStyle,v=r.lineStyle,g=r.areaStyle,O=a.tooltipVisible,j=a.legendVisible,x=t.slice();r.metrics?x=r.metrics:x.splice(t.indexOf(f),1);var S,k,A,w,E,C,P,$,L,H,F=j&&(S=f,k=h,{data:i.map(function(t){return t[S]}),formatter:function(t){return null!=k[t]?k[t]:t}}),M=(A=x,w=d,E={indicator:[],shape:"circle",splitNumber:5},C={},i.forEach(function(t){A.forEach(function(e){var i=null!=w[e]?w[e]:e;C[i]?C[i].push(t[e]):C[i]=[t[e]]})}),E.indicator=Object.keys(C).map(function(t){return{name:t,max:Math.max.apply(null,C[t])}}),E);return{legend:F,tooltip:O&&(P=s,$=b,L=[],H=[],M.indicator.map(function(t,e){L[e]=P[t.name],H[e]=t.name}),{formatter:function(t){var i=[];return i.push(e(t.color)),i.push(t.name+"<br />"),t.data.value.forEach(function(t,e){i.push(H[e]+": "),i.push(n(t,L[e],$)+"<br />")}),i.join("")}}),radar:M,series:function(t){var e=t.rows,i=t.dimension,n=t.metrics,r=t.radar,a=t.label,o=t.itemStyle,s=t.lineStyle,c=t.labelMap,h=t.areaStyle,l={};r.indicator.forEach(function(t,e){var i=t.name;l[i]=e});var d=e.map(function(t){var e={value:[],name:t[i]};return Object.keys(t).forEach(function(i){if(~n.indexOf(i)){var r=null!=c[i]?l[c[i]]:l[i];e.value[r]=t[i]}}),e}),u={name:i,type:"radar",data:d};return a&&(u.label=a),o&&(u.itemStyle=o),s&&(u.lineStyle=s),h&&(u.areaStyle=h),[u]}({rows:i,dimension:f,metrics:x,radar:M,label:m,itemStyle:y,lineStyle:v,labelMap:d,areaStyle:g})}},s={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"v-charts-component-loading"},[e("div",{staticClass:"loader"},[e("div",{staticClass:"loading-spinner"},[e("svg",{staticClass:"circular",attrs:{viewBox:"25 25 50 50"}},[e("circle",{staticClass:"path",attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})])])])])},staticRenderFns:[]},c={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"v-charts-data-empty"},[this._v(" 暂无数据 ")])},staticRenderFns:[]},h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t};return{name:"VeRadar",mixins:[{render:function(t){return t("div",{class:[(e=this.$options.name||this.$options._componentTag,e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())],style:this.canvasStyle},[t("div",{style:this.canvasStyle,ref:"canvas"}),t(s,{style:{display:this.loading?"":"none"}}),t(c,{style:{display:this.dataEmpty?"":"none"}}),this.$slots.default]);var e},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,legend:[Object,Array],xAxis:[Object,Array],yAxis:[Object,Array],radar:Object,tooltip:Object,axisPointer:Object,brush:[Object,Array],geo:Object,timeline:[Object,Array],graphic:[Object,Array],series:[Object,Array],backgroundColor:[Object,String],textStyle:Object,animation:Object,theme:Object,themeName:String,loading:Boolean,dataEmpty:Boolean,extend:Object,judgeWidth:{type:Boolean,default:!0},widthChangeDelay:{type:Number,default:300},tooltipFormatter:{type:Function}},watch:{data:{deep:!0,handler:function(t){t&&this.dataHandler(t)}},settings:{deep:!0,handler:function(t){t.type&&this.chartLib&&(this.chartHandler=this.chartLib[t.type]),this.dataHandler(this.data)}},events:{deep:!0,handler:function(){this.createEventProxy()}}},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(t){if(this.chartHandler){var e=t,i=e.columns,n=void 0===i?[]:i,r=e.rows,a=void 0===r?[]:r,o={tooltipVisible:this.tooltipVisible,legendVisible:this.legendVisible,echarts:this.echarts,color:this.chartColor,tooltipFormatter:this.tooltipFormatter};this.beforeConfig&&(t=this.beforeConfig(t));var s=this.chartHandler(n,a,this.settings,o);s&&("function"==typeof s.then?s.then(this.optionsHandler):this.optionsHandler(s))}},resize:function(){this.echarts.resize()},optionsHandler:function(t){var e=this;this.legendPosition&&t.legend&&(t.legend[this.legendPosition]=10,~["left","right"].indexOf(this.legendPosition)&&(t.legend.top="middle",t.legend.orient="vertical")),this.themeName||(t.color=this.chartColor);if(["grid","dataZoom","visualMap","toolbox","title","legend","xAxis","yAxis","radar","tooltip","axisPointer","brush","geo","timeline","graphic","series","backgroundColor","textStyle"].forEach(function(i){e[i]&&(t[i]=e[i])}),this.animation&&Object.keys(this.animation).forEach(function(i){t[i]=e.animation[i]}),this.markArea||this.markLine||this.markPoint){var i={markArea:this.markArea,markLine:this.markLine,markPoint:this.markPoint},n=t.series;"[object Array]"===r(n)?n.forEach(function(t){e.addMark(t,i)}):"[object Object]"===r(n)&&this.addMark(n,i)}this.extend&&Object.keys(this.extend).forEach(function(i){var n;"function"==typeof e.extend[i]?t[i]=e.extend[i](t[i]):(n=t[i],"[object Array]"===r(n)&&a(t[i][0])?t[i].forEach(function(n,r){t[i][r]=h({},n,e.extend[i])}):a(t[i])?t[i]=h({},t[i],e.extend[i]):t[i]=e.extend[i])}),this.afterConfig&&(t=this.afterConfig(t)),this.echarts.setOption(t,!0),this.judgeWidth&&this.judgeWidthHandler(t),this.afterSetOption&&this.afterSetOption(this.echarts),this.afterSetOptionOnce&&!this._once.afterSetOptionOnce&&(this._once.afterSetOptionOnce=this.afterSetOptionOnce(this.echarts))},judgeWidthHandler:function(t){var e=this;this.$el.clientWidth?this.echarts.resize():this.$nextTick(function(t){e.$el.clientWidth?e.echarts.resize():setTimeout(function(t){e.echarts.resize(),e.$el.clientWidth||console.warn(" Can't get dom width or height ")},e.widthChangeDelay)})},addMark:function(t,e){Object.keys(e).forEach(function(i){e[i]&&(t[i]=e[i])})},init:function(){if(!this.echarts){var t=this.themeName||(this.theme?"outer-theme":"ve-chart");this.echarts=this.echartsLib.init(this.$refs.canvas,t,this.initOptions),this.data&&this.dataHandler(this.data),this.createEventProxy()}},addWatchToProps:function(){var t=this,e=this._watchers.map(function(t){return t.expression});Object.keys(this.$props).forEach(function(i){if(!~e.indexOf(i)){var n={};"[object Object]"===r(i)&&(n.deep=!0),t.$watch(i,function(){t.dataHandler(t.data)},n)}})},registerTheme:function(){t.registerTheme("outer-theme",this.theme)},createEventProxy:function(){var t=this,e=this,i=Object.keys(this.events||{});i.length&&i.forEach(function(i){var n;-1===t.registeredEvents.indexOf(i)&&(t.registeredEvents.push(i),t.echarts.on(i,(n=i,function(){if(n in e.events){for(var t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];e.events[n].apply(null,i)}})))})}},created:function(){this.echarts=null,this.registeredEvents=[],this._once={},this.addWatchToProps(),this.theme&&this.registerTheme()},mounted:function(){this.init(),window.addEventListener("resize",this.echarts.resize)},beforeDestroy:function(){window.removeEventListener("resize",this.echarts.resize),this.echarts.dispose()}}],created:function(){this.chartHandler=o,this.echartsLib=t}}});
  