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"),require("echarts/lib/chart/line")):"function"==typeof define&&define.amd?define(["echarts/lib/echarts","echarts/lib/component/tooltip","echarts/lib/component/legend","echarts/lib/chart/line"],t):e.VeLine=t(e.echarts)}(this,function(e){"use strict";function t(e){var t=e.dimension,i=e.rows,n=e.xAxisName,a=e.axisVisible;return t.map(function(e,t){return{type:"category",nameLocation:"middle",nameGap:22,boundaryGap:!1,name:n[t]||"",axisTick:{show:!0,lineStyle:{color:"#eee"}},data:i.map(function(t){return t[e]}),axisLabel:{formatter:function(e){return String(e)}},show:a}})}function i(e){var t=e.rows,i=e.axisSite,n=e.metrics,a=e.area,r=e.stack,s=[],o={},c=r&&l(r);return n.forEach(function(e){o[e]=[]}),t.forEach(function(e){n.forEach(function(t){o[t].push(e[t]||0)})}),n.forEach(function(e){var t={name:e,type:"line",data:o[e]};a&&(t.areaStyle={normal:{}}),t.yAxisIndex=~i.right.indexOf(e)?1:0,r&&c[e]&&(t.stack=c[e]),s.push(t)}),!!s.length&&s}function n(e){for(var t=e.yAxisName,i=e.yAxisType,n=e.axisVisible,a=e.scale,r=e.min,s=e.max,o={type:"value",axisTick:{show:!1},show:n},l=[],h=0;h<2;h++)!function(e){i[e]?l[e]=Object.assign({},o,{axisLabel:{formatter:function(t){return c(t,i[e])}}}):l[e]=Object.assign({},o),l[e].name=t[e]||"",l[e].scale=a[e]||!1,l[e].min=r[e]||null,l[e].max=s[e]||null}(h);return l}function a(e,t){return{trigger:"axis",formatter:function(i){var n=[];return n.push(i[0].name+"<br>"),i.forEach(function(i){var a=void 0,s=~e.right.indexOf(i.seriesName)?t[1]:t[0];a=c(i.data,s),n.push(r(i.color)),n.push(i.seriesName+": "+a),n.push("<br>")}),n.join("")}}}(e="default"in e?e.default:e).registerTheme("ve-chart",{color:["#19d4ae","#5ab1ef","#fa6e86","#ffb980","#0067a6","#c4b4e4","#d87a80","#9cbbff","#d9d0c7","#87a997","#d49ea2","#5b4947","#7ba3a8"],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 r=function(e){return['<span style="',"background-color:"+e+";","display: inline-block;","width: 10px;","height: 10px;","border-radius: 50%;","margin-right:2px;",'"></span>'].join("")},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(isNaN(+e))return e;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(e)>=i[n].value)return(e/i[n].value).toFixed(t)+i[n].symbol;return e.toString()},o=function(e){return String(e).replace(/^(\s+|-)?\d+(?=.?\d*($|\s))/g,function(e){return e.replace(/(?=(?!\b)(\d{3})+$)/g,",")})},c=function(e,t){switch(t){case"KMB":return s(e);case"percent":return parseFloat((100*e).toFixed(2))+"%";case"normal":return o(e);default:return e}},l=function(e){var t={};return Object.keys(e).forEach(function(i){e[i].forEach(function(e){t[e]=i})}),t},h=function(e,r,s,o){var c=s.axisSite,l=void 0===c?{right:[]}:c,h=s.yAxisType,d=void 0===h?["normal","normal"]:h,u=s.yAxisName,f=void 0===u?[]:u,p=s.dimension,m=void 0===p?[e[0]]:p,b=s.xAxisName,y=void 0===b?[]:b,g=s.axisVisible,v=void 0===g||g,x=s.area,k=s.stack,A=s.scale,O=void 0===A?[!1,!1]:A,w=s.min,j=void 0===w?[null,null]:w,L=s.max,E=void 0===L?[null,null]:L,V=o.tooltipVisible,S=o.legendVisible,T=e.slice();s.metrics?T=s.metrics:T.splice(e.indexOf(m[0]),1);var M=S&&{data:T},N=V&&a(l,d),P=t({dimension:m,rows:r,xAxisName:y,axisVisible:v}),H=n({yAxisName:f,yAxisType:d,axisVisible:v,scale:O,min:j,max:E}),C=i({rows:r,axisSite:l,metrics:T,area:x,stack:k});return!(!P||!C)&&{legend:M,xAxis:P,series:C,yAxis:H,tooltip:N}};return{render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{ref:"canvas",staticClass:"ve-line",style:e.canvasStyle})},staticRenderFns:[],name:"VeLine",mixins:[{props:{data:{type:[Object,Array],default:null},settings:{type:Object,default:function(){return{}}},width:{type:String,default:"auto"},height:{type:String,default:"400px"},beforeConfig:{type:Function},afterConfig:{type:Function},events:{type:Object},grid:{type:Object},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},initOptions:{type:Object,default:function(){return{}}}},watch:{data:{deep:!0,handler:function(e){e&&this.dataHandler(e)}},settings:{deep:!0,handler:function(e){e.type&&this.chartLib&&(this.chartHandler=this.chartLib[e.type]),this.dataHandler(this.data)}}},computed:{canvasStyle:function(){return{width:this.width,height:this.height,position:"relative"}}},methods:{dataHandler:function(e){var t=this;if(this.chartHandler){if(!e||!Array.isArray(e.columns)||!Array.isArray(e.rows))return!1;var i=e,n=i.columns,a=i.rows,r={tooltipVisible:this.tooltipVisible,legendVisible:this.legendVisible};this.beforeConfig&&(e=this.beforeConfig(e));var s=this.chartHandler(n,a,this.settings,r);if(s){if(this.colors&&(s.color=this.colors),this.grid&&(s.grid=this.grid),this.legendPosition&&s.legend&&(s.legend[this.legendPosition]=10,~["left","right"].indexOf(this.legendPosition)&&(s.legend.top="middle",s.legend.orient="vertical")),this.dataZoom&&(s.dataZoom=this.dataZoom),this.visualMap&&(s.visualMap=this.visualMap),this.toolbox&&(s.toolbox=this.toolbox),this.markArea||this.markLine||this.markPoint){var o={markArea:this.markArea,markLine:this.markLine,markPoint:this.markPoint},c=s.series;"[object Array]"===this.getType(c)?c.forEach(function(e){t.addMark(e,o)}):"[object Object]"===this.getType(c)&&this.addMark(c,o)}this.afterConfig&&(s=this.afterConfig(s)),this.echarts.setOption(s,!0)}}},addMark:function(e,t){Object.keys(t).forEach(function(i){t[i]&&(e[i]=t[i])})},getType:function(e){return Object.prototype.toString.call(e)},init:function(){this.echarts||(this.echarts=this.echartsLib.init(this.$refs.canvas,"ve-chart",this.initOptions),this.data&&this.dataHandler(this.data),this.events&&this.bindEvents())},bindEvents:function(){var e=this;Object.keys(this.events).forEach(function(t){e.echarts.on(t,e.events[t])})}},mounted:function(){var e=this;this.$nextTick(function(){e.init(),window.addEventListener("resize",e.echarts.resize)})},beforeDestory:function(){window.removeEventListener("resize",this.echarts.resize),this.echarts.dispose()}}],created:function(){this.chartHandler=h,this.echartsLib=e}}});
  