(function(a,d){typeof exports=="object"&&typeof module<"u"?module.exports=d():typeof define=="function"&&define.amd?define(d):(a=typeof globalThis<"u"?globalThis:a||self,a.index=d())})(this,function(){"use strict";const a=t=>{let e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if(!e)return;let o=100*(e/1920);return t*o},d="";function h(t,e,o,p,i,l,c,v){var n=typeof t=="function"?t.options:t;e&&(n.render=e,n.staticRenderFns=o,n._compiled=!0),p&&(n.functional=!0),l&&(n._scopeId="data-v-"+l);var r;if(c?(r=function(s){s=s||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!s&&typeof __VUE_SSR_CONTEXT__<"u"&&(s=__VUE_SSR_CONTEXT__),i&&i.call(this,s),s&&s._registeredComponents&&s._registeredComponents.add(c)},n._ssrRegister=r):i&&(r=v?function(){i.call(this,(n.functional?this.parent:this).$root.$options.shadowRoot)}:i),r)if(n.functional){n._injectStyles=r;var x=n.render;n.render=function(S,u){return r.call(u),x(S,u)}}else{var b=n.beforeCreate;n.beforeCreate=b?[].concat(b,r):[r]}return{exports:t,options:n}}const y={name:"yk-scatter-chart",props:{chartOption:{type:Array,default:()=>[]},width:{type:String,default:"100%"},height:{type:String,default:"100%"}},data(){return{option:{}}},mounted(){this.initOption()},methods:{scatterEchart(t){const e=t.values.map(p=>({name:p[4],icon:"rect"})),o=t.values.map((p,i)=>({name:e[i].name,data:[t.values[i]],type:"scatter",symbolSize:function(l){return Math.sqrt(l[2])/30},emphasis:{focus:"series",label:{show:!1,formatter:function(l){return l.data[t.titleIndex]+":"+l.data[2]+"\u5143"},position:"top"}}}));return this.scatterFormatter({legendData:e,series:o,tabType:"business"})},scatterFormatter(t){return console.log("//*",t),{color:[{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(224,104,15, 0.7)"},{offset:1,color:"rgba(242,161,34, 0.7)"}],opacity:.5,globalCoord:!1},{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(255,190,0,0.7)"},{offset:1,color:"rgba(255,190,0,0.7)"}],opacity:.5,globalCoord:!1},{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"rgba(77,212,155, 0.7)"},{offset:1,color:"rgba(77,212,155, 0.7)"}],opacity:.5,globalCoord:!1}],title:{},legend:{right:"5%",top:"3%",itemHeight:a(.144),itemWidth:a(.144),textStyle:{color:"#575B62",fontWeight:"500",fontSize:a(.14)},data:t.legendData},tooltip:{trigger:"item",formatter:function(e){let o=t.tabType=="business"?e.seriesName:e.data[3];if(!(o=="y"||o=="x\u8F74"))return e.marker+o+"</br>\u65E5\u5747\u9500\u552E\u989D&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+(e.data[0]*1e4).toFixed(2)+"\u5143</br>\u603B\u9500\u552E\u989D&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+e.data[2]+`\u5143</br>\u65E5\u5747\u9500\u552E\u989D\u589E\u957F\u7387&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${e.data[1]<0?"-":""}`+((e.data[1]<0?e.data[1]*-1:e.data[1])*100).toFixed(2)+"%"}},grid:{left:"8%",top:"14%"},xAxis:{splitLine:{lineStyle:{type:"dashed"}},show:!1},yAxis:{show:!0,splitLine:{lineStyle:{type:"dashed"}}},series:[...t.series,{name:"x\u8F74",type:"scatter",data:[[.0062,0]],itemStyle:{color:"rgba(255,255,255,0)",show:!1},cursor:"auto",markLine:{data:[{type:"average",name:"x\u8F74",valueIndex:0}]}},{name:"y",type:"scatter",data:[[0,-1]],itemStyle:{color:"rgba(255,255,255,0)",show:!1},cursor:"auto",markLine:{data:[{type:"average",name:"six"}],label:{show:!1}}}]}},initOption(){this.option=this.scatterEchart({values:this.chartOption,lengendIndex:4,titleIndex:4})}}};var _=function(){var e=this,o=e._self._c;return o("div",{staticClass:"scatter-chart"},[o("yk-base-chart",{style:{height:e.height,width:e.width},attrs:{options:e.option}})],1)},m=[],g=h(y,_,m,!1,null,"b34d1456",null,null);const f=g.exports;return{install(t){t.component(f.name,f)}}});
