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/gauge")):"function"==typeof define&&define.amd?define(["echarts/lib/echarts","echarts/lib/component/tooltip","echarts/lib/component/legend","echarts/lib/chart/gauge"],e):t.VeGauge=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=["#19d4ae","#5ab1ef","#fa6e86","#ffb980","#0067a6","#c4b4e4","#d87a80","#9cbbff","#d9d0c7","#87a997","#d49ea2","#5b4947","#7ba3a8"],i=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}},n=function(t){return Object.prototype.toString.call(t)},a=function(t){return"[object Object]"===n(t)},r=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};var s=function(t,e,n,s){var o,c,h,l,d,u,f,p,y,b,m,g,v,O=n.dimension,j=void 0===O?t[0]:O,x=n.metrics,A=void 0===x?t[1]:x,k=n.digit,w=void 0===k?2:k,C=n.dataType,E=void 0===C?{}:C,S=n.labelMap,$=void 0===S?{}:S,P=n.seriesMap,F=void 0===P?{}:P,L=n.dataName,H=void 0===L?{}:L,M=s.tooltipFormatter;return{tooltip:s.tooltipVisible&&(c=(o={tooltipFormatter:M,dataType:E}).tooltipFormatter,h=o.dataType,l=o.digit,{formatter:function(t){var e=t.seriesName,n=t.data,a=n.value,r=n.name;if(c)return c.apply(null,arguments);var s=[];return s.push(e+": "),s.push(i(a,h[e],l)+" "+r),s.join("")}}),series:(u=(d={rows:e,dimension:j,metrics:A,digit:w,dataType:E,labelMap:$,seriesMap:F,dataName:H}).rows,f=d.dimension,p=d.metrics,y=d.digit,b=d.dataType,m=d.labelMap,g=d.seriesMap,v=d.dataName,u.map(function(t){var e=t[f],n=g[e],s={type:"gauge",name:null!=m[e]?m[e]:e,data:[{name:v[e]||"",value:t[p]}],detail:{formatter:function(t){return i(t,b[e],y)}},axisLabel:{formatter:function(t){return i(t,b[e],y)}}};return n&&Object.keys(n).forEach(function(t){a(s[t])?r(s[t],n[t]):s[t]=n[t]}),s}))}},o={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:[]};return{name:"VeGauge",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(o,{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()}},theme:{deep:!0,handler:function(t){this.themeChange(t)}},themeName:function(t){this.themeChange(t)}},computed:{canvasStyle:function(){return{width:this.width,height:this.height,position:"relative"}},chartColor:function(){return this.colors||this.theme&&this.theme.color||e}},methods:{dataHandler:function(t){if(this.chartHandler){var e=t,i=e.columns,n=void 0===i?[]:i,a=e.rows,r=void 0===a?[]:a,s={tooltipVisible:this.tooltipVisible,legendVisible:this.legendVisible,echarts:this.echarts,color:this.chartColor,tooltipFormatter:this.tooltipFormatter};this.beforeConfig&&(t=this.beforeConfig(t));var o=this.chartHandler(n,r,this.settings,s);o&&("function"==typeof o.then?o.then(this.optionsHandler):this.optionsHandler(o))}},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},s=t.series;"[object Array]"===n(s)?s.forEach(function(t){e.addMark(t,i)}):"[object Object]"===n(s)&&this.addMark(s,i)}this.extend&&Object.keys(this.extend).forEach(function(i){var s;"function"==typeof e.extend[i]?t[i]=e.extend[i](t[i]):(s=t[i],"[object Array]"===n(s)&&a(t[i][0])?t[i].forEach(function(n,a){t[i][a]=r({},n,e.extend[i])}):a(t[i])?t[i]=r({},t[i],e.extend[i]):t[i]=e.extend[i])}),this.afterConfig&&(t=this.afterConfig(t)),this.echarts.setOption(t,!0),this.$emit("ready",this.echarts),this._once["ready-once"]||(this._once["ready-once"]=!0,this.$emit("ready-once",this.echarts)),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,i=this.echarts,n=this.widthChangeDelay;this.$el.clientWidth?i&&i.resize():this.$nextTick(function(t){e.$el.clientWidth?i&&i.resize():setTimeout(function(t){i&&i.resize(),e.$el.clientWidth||console.warn(" Can't get dom width or height ")},n)})},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||"ve-chart";this.echarts=this.echartsLib.init(this.$refs.canvas,t,this.initOptions),this.data&&this.dataHandler(this.data),this.createEventProxy(),window.addEventListener("resize",this.echarts.resize)}},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 a={};~["[object Object]","[object Array]"].indexOf(n(t.$props[i]))&&(a.deep=!0),t.$watch(i,function(){t.dataHandler(t.data)},a)}})},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),a=0;a<t;a++)i[a]=arguments[a];e.events[n].apply(null,i)}})))})},themeChange:function(t){this.clean(),this.echarts=null,this.init()},clean:function(){window.removeEventListener("resize",this.echarts.resize),this.echarts.dispose()}},created:function(){this.echarts=null,this.registeredEvents=[],this._once={},this.addWatchToProps()},mounted:function(){this.init()},beforeDestroy:function(){this.clean()}}],created:function(){this.chartHandler=s,this.echartsLib=t}}});
  