import{Z as t}from"./uni-cloud.es.t_RKYAwE.js";import{o as e,c as i,w as a,b as o,i as r,M as n,s as l,e as s,t as h,l as c,a9 as d,A as p,aa as x,ao as g}from"./index-CZsuXyof.js";import{_ as u}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{r as f}from"./uni-app.es.Cv5-J_i3.js";const y=u({components:{Loading1:u({name:"loading1",data:()=>({})},[["render",function(t,n,l,s,h,c){const d=r;return e(),i(d,{class:"container loading1"},{default:a((()=>[o(d,{class:"shape shape1"}),o(d,{class:"shape shape2"}),o(d,{class:"shape shape3"}),o(d,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-a16ea79e"]]),Loading2:u({name:"loading2",data:()=>({})},[["render",function(t,n,l,s,h,c){const d=r;return e(),i(d,{class:"container loading2"},{default:a((()=>[o(d,{class:"shape shape1"}),o(d,{class:"shape shape2"}),o(d,{class:"shape shape3"}),o(d,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-51d40d8b"]]),Loading3:u({name:"loading3",data:()=>({})},[["render",function(t,n,l,s,h,c){const d=r;return e(),i(d,{class:"container loading3"},{default:a((()=>[o(d,{class:"shape shape1"}),o(d,{class:"shape shape2"}),o(d,{class:"shape shape3"}),o(d,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-47408335"]]),Loading4:u({name:"loading5",data:()=>({})},[["render",function(t,n,l,s,h,c){const d=r;return e(),i(d,{class:"container loading5"},{default:a((()=>[o(d,{class:"shape shape1"}),o(d,{class:"shape shape2"}),o(d,{class:"shape shape3"}),o(d,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-49a6258a"]]),Loading5:u({name:"loading6",data:()=>({})},[["render",function(t,n,l,s,h,c){const d=r;return e(),i(d,{class:"container loading6"},{default:a((()=>[o(d,{class:"shape shape1"}),o(d,{class:"shape shape2"}),o(d,{class:"shape shape3"}),o(d,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-08a06125"]])},name:"qiun-loading",props:{loadingType:{type:Number,default:2}},data:()=>({})},[["render",function(t,o,s,h,c,d){const p=n("Loading1"),x=n("Loading2"),g=n("Loading3"),u=n("Loading4"),f=n("Loading5"),y=r;return e(),i(y,null,{default:a((()=>[1==s.loadingType?(e(),i(p,{key:0})):l("",!0),2==s.loadingType?(e(),i(x,{key:1})):l("",!0),3==s.loadingType?(e(),i(g,{key:2})):l("",!0),4==s.loadingType?(e(),i(u,{key:3})):l("",!0),5==s.loadingType?(e(),i(f,{key:4})):l("",!0)])),_:1})}]]);const m=u({name:"qiun-error",props:{errorMessage:{type:String,default:null}},data:()=>({})},[["render",function(t,n,l,c,d,p){const x=r;return e(),i(x,{class:"chartsview"},{default:a((()=>[o(x,{class:"charts-error"}),o(x,{class:"charts-font"},{default:a((()=>[s(h(null==l.errorMessage?"请点击重试":l.errorMessage),1)])),_:1})])),_:1})}],["__scopeId","data-v-af32de60"]]);var b={version:"v2.5.0-20230101",yAxisWidth:15,xAxisHeight:22,padding:[10,10,10,10],rotate:!1,fontSize:13,fontColor:"#666666",dataPointShape:["circle","circle","circle","circle"],color:["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],linearColor:["#0EE2F8","#2BDCA8","#FA7D8D","#EB88E2","#2AE3A0","#0EE2F8","#EB88E2","#6773E3","#F78A85"],pieChartLinePadding:15,pieChartTextPadding:5,titleFontSize:20,subtitleFontSize:15,radarLabelTextMargin:13},v=function(t,...e){if(null==t)throw new TypeError("[uCharts] Cannot convert undefined or null to object");if(!e||e.length<=0)return t;function i(t,e){for(let a in e)t[a]=t[a]&&"[object Object]"===t[a].toString()?i(t[a],e[a]):t[a]=e[a];return t}return e.forEach((e=>{t=i(t,e)})),t},S={toFixed:function(t,e){return e=e||2,this.isFloat(t)&&(t=t.toFixed(e)),t},isFloat:function(t){return t%1!=0},approximatelyEqual:function(t,e){return Math.abs(t-e)<1e-10},isSameSign:function(t,e){return Math.abs(t)===t&&Math.abs(e)===e||Math.abs(t)!==t&&Math.abs(e)!==e},isSameXCoordinateArea:function(t,e){return this.isSameSign(t.x,e.x)},isCollision:function(t,e){return t.end={},t.end.x=t.start.x+t.width,t.end.y=t.start.y-t.height,e.end={},e.end.x=e.start.x+e.width,e.end.y=e.start.y-e.height,!(e.start.x>t.end.x||e.end.xt.start.y||e.start.y1&&(o.extra.mount.widthRatio>2&&(o.extra.mount.widthRatio=2),n+=(o.extra.mount.widthRatio-1)*i.eachSpacing);var l=e;return e>=0?(l=0,t.uevent.trigger("scrollLeft"),t.scrollOption.position="left",o.xAxis.scrollPosition="left"):Math.abs(e)>=n-r?(l=r-n,t.uevent.trigger("scrollRight"),t.scrollOption.position="right",o.xAxis.scrollPosition="right"):(t.scrollOption.position=e,o.xAxis.scrollPosition=e),l}function C(t,e,i){function a(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}return t=a(t),(e=a(e))>(i=a(i))&&(i+=2*Math.PI,t=e&&t<=i}function P(t,e){function i(t,e){return!(!t[e-1]||!t[e+1])&&(t[e].y>=Math.max(t[e-1].y,t[e+1].y)||t[e].y<=Math.min(t[e-1].y,t[e+1].y))}function a(t,e){return!(!t[e-1]||!t[e+1])&&(t[e].x>=Math.max(t[e-1].x,t[e+1].x)||t[e].x<=Math.min(t[e-1].x,t[e+1].x))}var o=.2,r=.2,n=null,l=null,s=null,h=null;if(e<1?(n=t[0].x+(t[1].x-t[0].x)*o,l=t[0].y+(t[1].y-t[0].y)*o):(n=t[e].x+(t[e+1].x-t[e-1].x)*o,l=t[e].y+(t[e+1].y-t[e-1].y)*o),e>t.length-3){var c=t.length-1;s=t[c].x-(t[c].x-t[c-1].x)*r,h=t[c].y-(t[c].y-t[c-1].y)*r}else s=t[e+1].x-(t[e+2].x-t[e].x)*r,h=t[e+1].y-(t[e+2].y-t[e].y)*r;return i(t,e+1)&&(h=t[e+1].y),i(t,e)&&(l=t[e].y),a(t,e+1)&&(s=t[e+1].x),a(t,e)&&(n=t[e].x),(l>=Math.max(t[e].y,t[e+1].y)||l<=Math.min(t[e].y,t[e+1].y))&&(l=t[e].y),(h>=Math.max(t[e].y,t[e+1].y)||h<=Math.min(t[e].y,t[e+1].y))&&(h=t[e+1].y),(n>=Math.max(t[e].x,t[e+1].x)||n<=Math.min(t[e].x,t[e+1].x))&&(n=t[e].x),(s>=Math.max(t[e].x,t[e+1].x)||s<=Math.min(t[e].x,t[e+1].x))&&(s=t[e+1].x),{ctrA:{x:n,y:l},ctrB:{x:s,y:h}}}function D(t,e,i){return{x:i.x+t,y:i.y-e}}function M(t,e){if(e)for(;S.isCollision(t,e);)t.start.x>0?t.start.y--:t.start.x<0||t.start.y>0?t.start.y++:t.start.y--;return t}function F(t,e,i){for(var a=0,o=0;o-1;if(r){let e=W(t);for(var n=0;n5&&void 0!==arguments[5]?arguments[5]:{},n=e.chartData.calPoints?e.chartData.calPoints:[];let l={};if(a.length>0){let t=[];for(let e=0;e0&&(a=o[i]),{text:r.formatter?r.formatter(t,a,i,e):t.name+": "+t.data,color:t.color,legendShape:"auto"==e.extra.tooltip.legendShape?t.legendShape:e.extra.tooltip.legendShape}})),offset:{x:Math.round(l.x),y:Math.round(l.y)}}}function W(t){let e=[];for(let i=0;i=e.area[3]-10&&t.y>=e.area[0]&&t.y<=e.height-e.area[2]}function B(t,e,i){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<=Math.pow(i,2)}function G(t,e){var i=[],a=[];return t.forEach((function(t,o){e.connectNulls?null!==t&&a.push(t):null!==t?a.push(t):(a.length&&i.push(a),a=[])})),a.length&&i.push(a),i}function N(t,e,i,a,o){var r={angle:0,xAxisHeight:e.xAxis.lineHeight*e.pix+e.xAxis.marginTop*e.pix},n=e.xAxis.fontSize*e.pix,l=t.map((function(t,i){var a=e.xAxis.formatter?e.xAxis.formatter(t,i,e):t;return _(String(a),n,o)})),s=Math.max.apply(this,l);if(1==e.xAxis.rotateLabel){r.angle=e.xAxis.rotateAngle*Math.PI/180;let t=e.xAxis.marginTop*e.pix*2+Math.abs(s*Math.sin(r.angle));t=t4&&void 0!==arguments[4]?arguments[4]:-1;o="stack"==a?I(t,e.categories.length):k(t);var n=[];(o=o.filter((function(t){return"object"==typeof t&&null!==t?t.constructor.toString().indexOf("Array")>-1?null!==t:null!==t.value:null!==t}))).map((function(t){"object"==typeof t?t.constructor.toString().indexOf("Array")>-1?"candle"==e.type?t.map((function(t){n.push(t)})):n.push(t[0]):n.push(t.value):n.push(t)}));var l=0,s=0;n.length>0&&(l=Math.min.apply(this,n),s=Math.max.apply(this,n)),r>-1?("number"==typeof e.xAxis.data[r].min&&(l=Math.min(e.xAxis.data[r].min,l)),"number"==typeof e.xAxis.data[r].max&&(s=Math.max(e.xAxis.data[r].max,s))):("number"==typeof e.xAxis.min&&(l=Math.min(e.xAxis.min,l)),"number"==typeof e.xAxis.max&&(s=Math.max(e.xAxis.max,s))),l===s&&(s+=s||10);for(var h=l,c=[],d=(s-h)/e.xAxis.splitNumber,p=0;p<=e.xAxis.splitNumber;p++)c.push(h+d*p);return c}(t,e,i,o.type),r.rangesFormat=r.ranges.map((function(t){return t=S.toFixed(t,2)}));var n=r.ranges.map((function(t){return t=S.toFixed(t,2)}));return(r=Object.assign(r,q(n,e))).eachSpacing,n.map((function(t){return _(t,e.xAxis.fontSize*e.pix,a)})),!0===e.xAxis.disabled&&(r.xAxisHeight=0),r}function X(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=0,o=0;for(let r=0;r4&&void 0!==arguments[4]?arguments[4]:1,r=0,n=0,l=[];for(let d=0;d0&&(t.width=Math.min(t.width,+r.extra.mix.column.width*r.pix)),r.extra.column&&r.extra.column.width&&+r.extra.column.width>0&&(t.width=Math.min(t.width,+r.extra.column.width*r.pix)),t.width<=0&&(t.width=1),t.x+=(a+.5-i/2)*(t.width+o),t}))}function Y(t,e,i,a,o,r){return t.map((function(t){if(null===t)return null;var o=0,n=0;return o=r.extra.bar.seriesGap*r.pix||0,n=r.extra.bar.categoryGap*r.pix||0,o=Math.min(o,e/i),n=Math.min(n,e/i),t.width=Math.ceil((e-2*n-o*(i-1))/i),r.extra.bar&&r.extra.bar.width&&+r.extra.bar.width>0&&(t.width=Math.min(t.width,+r.extra.bar.width*r.pix)),t.width<=0&&(t.width=1),t.y+=(a+.5-i/2)*(t.width+o),t}))}function q(t,e,i){var a=e.width-e.area[1]-e.area[3],o=e.enableScroll?Math.min(e.xAxis.itemCount,t.length):t.length;("line"==e.type||"area"==e.type||"scatter"==e.type||"bubble"==e.type||"bar"==e.type)&&o>1&&"justify"==e.xAxis.boundaryGap&&(o-=1);var r=0;"mount"==e.type&&e.extra&&e.extra.mount&&e.extra.mount.widthRatio&&e.extra.mount.widthRatio>1&&(e.extra.mount.widthRatio>2&&(e.extra.mount.widthRatio=2),o+=r=e.extra.mount.widthRatio-1);var n=a/o,l=[],s=e.area[3],h=e.width-e.area[1];return t.forEach((function(t,e){l.push(s+r/2*n+e*n)})),"justify"!==e.xAxis.boundaryGap&&(!0===e.enableScroll?l.push(s+r*n+t.length*n):l.push(h)),{xAxisPoints:l,startX:s,endX:h,eachSpacing:n}}function $(t,e,i,a,o,r,n){var l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,s="center";"line"!=r.type&&"area"!=r.type&&"scatter"!=r.type&&"bubble"!=r.type||(s=r.xAxis.boundaryGap);var h=[],c=r.height-r.area[0]-r.area[2],d=r.width-r.area[1]-r.area[3];return t.forEach((function(t,n){if(null===t)h.push(null);else{var p={};p.color=t.color,p.x=a[n];var x=t;if("object"==typeof t&&null!==t)if(t.constructor.toString().indexOf("Array")>-1){let e,i,a;e=[].concat(r.chartData.xAxisData.ranges),i=e.shift(),a=e.pop(),x=t[1],p.x=r.area[3]+d*(t[0]-i)/(a-i),"bubble"==r.type&&(p.r=t[2],p.t=t[3])}else x=t.value;"center"==s&&(p.x+=o/2);var g=c*(x-e)/(i-e);g*=l,p.y=r.height-g-r.area[2],h.push(p)}})),h}function U(t,e,i,a,o,r,n,l,s){s=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1;var h=[],c=r.height-r.area[0]-r.area[2],d=r.width-r.area[1]-r.area[3];return t.forEach((function(t,n){if(null===t)h.push(null);else{var l={};l.color=t.color,l.x=a[n];var p=t;if("object"==typeof t&&null!==t)if(t.constructor.toString().indexOf("Array")>-1){let e,i,a;e=[].concat(r.chartData.xAxisData.ranges),i=e.shift(),a=e.pop(),p=t[1],l.x=r.area[3]+d*(t[0]-i)/(a-i)}else p=t.value;l.x+=o/2;var x=c*(p*s-e)/(i-e);l.y=r.height-x-r.area[2],h.push(l)}})),h}function Z(t,e,i,a,o,r,n,l){var s=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,h=[],c=r.height-r.area[0]-r.area[2];r.width,r.area[1],r.area[3];var d=o*n.widthRatio;return t.forEach((function(t,n){if(null===t)h.push(null);else{var l={};l.color=t.color,l.x=a[n],l.x+=o/2;var p=t.data,x=c*(p*s-e)/(i-e);l.y=r.height-x-r.area[2],l.value=p,l.width=d,h.push(l)}})),h}function Q(t,e,i,a,o,r,n){var l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,s=[];r.height,r.area[0],r.area[2];var h=r.width-r.area[1]-r.area[3];return t.forEach((function(t,o){if(null===t)s.push(null);else{var n={};n.color=t.color,n.y=a[o];var c=t;"object"==typeof t&&null!==t&&(c=t.value);var d=h*(c-e)/(i-e);d*=l,n.height=d,n.value=c,n.x=d+r.area[3],s.push(n)}})),s}function V(t,e,i,a,o,r,n,l,s){var h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:1,c=[],d=r.height-r.area[0]-r.area[2];return t.forEach((function(t,n){if(null===t)c.push(null);else{var p={};if(p.color=t.color,p.x=a[n]+Math.round(o/2),l>0){var x=0;for(let t=0;t<=l;t++)x+=s[t].data[n];var g=d*(x-e)/(i-e),u=d*(x-t-e)/(i-e)}else{x=t;"object"==typeof t&&null!==t&&(x=t.value);g=d*(x-e)/(i-e),u=0}var f=u;g*=h,f*=h,p.y=r.height-Math.round(g)-r.area[2],p.y0=r.height-Math.round(f)-r.area[2],c.push(p)}})),c}function K(t,e,i,a,o,r,n,l,s){var h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:1,c=[],d=r.width-r.area[1]-r.area[3];return t.forEach((function(t,o){if(null===t)c.push(null);else{var n={};if(n.color=t.color,n.y=a[o],l>0){var p=0;for(let t=0;t<=l;t++)p+=s[t].data[o];var x=d*(p-e)/(i-e),g=d*(p-t-e)/(i-e)}else{p=t;"object"==typeof t&&null!==t&&(p=t.value);x=d*(p-e)/(i-e),g=0}var u=g;x*=h,u*=h,n.height=x-u,n.x=r.area[3]+x,n.x0=r.area[3]+u,c.push(n)}})),c}function tt(t,e,i,a,o){var r;r="stack"==a?I(t,e.categories.length):k(t);var n=[];(r=r.filter((function(t){return"object"==typeof t&&null!==t?t.constructor.toString().indexOf("Array")>-1?null!==t:null!==t.value:null!==t}))).map((function(t){"object"==typeof t?t.constructor.toString().indexOf("Array")>-1?"candle"==e.type?t.map((function(t){n.push(t)})):n.push(t[1]):n.push(t.value):n.push(t)}));var l=o.min||0,s=o.max||0;n.length>0&&(l=Math.min.apply(this,n),s=Math.max.apply(this,n)),l===s&&(0==s?s=10:l=0);for(var h=function(t,e){var i=0,a=e-t;return{minRange:T(t,"lower",i=a>=1e4?1e3:a>=1e3?100:a>=100?10:a>=10?5:a>=1?1:a>=.1?.1:a>=.01?.01:a>=.001?.001:a>=1e-4?1e-4:a>=1e-5?1e-5:1e-6),maxRange:T(e,"upper",i)}}(l,s),c=void 0===o.min||null===o.min?h.minRange:o.min,d=((void 0===o.max||null===o.max?h.maxRange:o.max)-c)/e.yAxis.splitNumber,p=[],x=0;x<=e.yAxis.splitNumber;x++)p.push(c+d*x);return p.reverse()}function et(t,e,i,a){var o=v({},{type:""},e.extra.column),r=e.yAxis.data.length,n=new Array(r);if(r>0){for(let e=0;et+(r.unit||"")),r.categories=r.categories||e.categories,l[t]=r.categories):(r.formatter||(r.formatter=(t,e,i)=>S.toFixed(t,r.tofix||0)+(r.unit||"")),l[t]=tt(n[t],e,0,o.type,r));let c=r.fontSize*e.pix||i.fontSize;h[t]={position:r.position?r.position:"left",width:0},s[t]=l[t].map((function(i,o){return i=r.formatter(i,o,e),h[t].width=Math.max(h[t].width,_(i,c,a)+5),i}));let d=r.calibration?4*e.pix:0;h[t].width+=d+3*e.pix,!0===r.disabled&&(h[t].width=0)}}else{l=new Array(1),s=new Array(1),h=new Array(1);"bar"===e.type?(l[0]=e.categories,e.yAxis.formatter||(e.yAxis.formatter=(t,e,i)=>t+(i.yAxis.unit||""))):(e.yAxis.formatter||(e.yAxis.formatter=(t,e,i)=>t.toFixed(i.yAxis.tofix)+(i.yAxis.unit||"")),l[0]=tt(t,e,0,o.type,{})),h[0]={position:"left",width:0};var c=e.yAxis.fontSize*e.pix||i.fontSize;s[0]=l[0].map((function(t,i){return t=e.yAxis.formatter(t,i,e),h[0].width=Math.max(h[0].width,_(t,c,a)+5),t})),h[0].width+=3*e.pix,!0===e.yAxis.disabled?(h[0]={position:"left",width:0},e.yAxis.data[0]={disabled:!0}):(e.yAxis.data[0]={disabled:!1,position:"left",max:e.yAxis.max,min:e.yAxis.min,formatter:e.yAxis.formatter},"bar"===e.type&&(e.yAxis.data[0].categories=e.categories,e.yAxis.data[0].type="categories"))}return{rangesFormat:s,ranges:l,yAxisWidth:h}}function it(t,e){!0!==e.rotateLock?(t.translate(e.height,0),t.rotate(90*Math.PI/180)):!0!==e._rotate_&&(t.translate(e.height,0),t.rotate(90*Math.PI/180),e._rotate_=!0)}function at(t,e,i,a,o){if(a.beginPath(),"hollow"==o.dataPointShapeType?(a.setStrokeStyle(e),a.setFillStyle(o.background),a.setLineWidth(2*o.pix)):(a.setStrokeStyle("#ffffff"),a.setFillStyle(e),a.setLineWidth(1*o.pix)),"diamond"===i)t.forEach((function(t,e){null!==t&&(a.moveTo(t.x,t.y-4.5),a.lineTo(t.x-4.5,t.y),a.lineTo(t.x,t.y+4.5),a.lineTo(t.x+4.5,t.y),a.lineTo(t.x,t.y-4.5))}));else if("circle"===i)t.forEach((function(t,e){null!==t&&(a.moveTo(t.x+2.5*o.pix,t.y),a.arc(t.x,t.y,3*o.pix,0,2*Math.PI,!1))}));else if("square"===i)t.forEach((function(t,e){null!==t&&(a.moveTo(t.x-3.5,t.y-3.5),a.rect(t.x-3.5,t.y-3.5,7,7))}));else if("triangle"===i)t.forEach((function(t,e){null!==t&&(a.moveTo(t.x,t.y-4.5),a.lineTo(t.x-4.5,t.y+4.5),a.lineTo(t.x+4.5,t.y+4.5),a.lineTo(t.x,t.y-4.5))}));else if("none"===i)return;a.closePath(),a.fill(),a.stroke()}function ot(t,e,i,a,o,r,n){if(o.tooltip&&!(o.tooltip.group.length>0&&0==o.tooltip.group.includes(n))){var l="number"==typeof o.tooltip.index?o.tooltip.index:o.tooltip.index[o.tooltip.group.indexOf(n)];if(a.beginPath(),"hollow"==r.activeType?(a.setStrokeStyle(e),a.setFillStyle(o.background),a.setLineWidth(2*o.pix)):(a.setStrokeStyle("#ffffff"),a.setFillStyle(e),a.setLineWidth(1*o.pix)),"diamond"===i)t.forEach((function(t,e){null!==t&&l==e&&(a.moveTo(t.x,t.y-4.5),a.lineTo(t.x-4.5,t.y),a.lineTo(t.x,t.y+4.5),a.lineTo(t.x+4.5,t.y),a.lineTo(t.x,t.y-4.5))}));else if("circle"===i)t.forEach((function(t,e){null!==t&&l==e&&(a.moveTo(t.x+2.5*o.pix,t.y),a.arc(t.x,t.y,3*o.pix,0,2*Math.PI,!1))}));else if("square"===i)t.forEach((function(t,e){null!==t&&l==e&&(a.moveTo(t.x-3.5,t.y-3.5),a.rect(t.x-3.5,t.y-3.5,7,7))}));else if("triangle"===i)t.forEach((function(t,e){null!==t&&l==e&&(a.moveTo(t.x,t.y-4.5),a.lineTo(t.x-4.5,t.y+4.5),a.lineTo(t.x+4.5,t.y+4.5),a.lineTo(t.x,t.y-4.5))}));else if("none"===i)return;a.closePath(),a.fill(),a.stroke()}}function rt(t,e,i,a){var o=t.title.fontSize||e.titleFontSize,r=t.subtitle.fontSize||e.subtitleFontSize,n=t.title.name||"",l=t.subtitle.name||"",s=t.title.color||t.fontColor,h=t.subtitle.color||t.fontColor,c=n?o:0,d=l?r:0;if(l){var p=_(l,r*t.pix,i),x=a.x-p/2+(t.subtitle.offsetX||0)*t.pix,g=a.y+r*t.pix/2+(t.subtitle.offsetY||0)*t.pix;n&&(g+=(c*t.pix+5)/2),i.beginPath(),i.setFontSize(r*t.pix),i.setFillStyle(h),i.fillText(l,x,g),i.closePath(),i.stroke()}if(n){var u=_(n,o*t.pix,i),f=a.x-u/2+(t.title.offsetX||0),y=a.y+o*t.pix/2+(t.title.offsetY||0)*t.pix;l&&(y-=(d*t.pix+5)/2),i.beginPath(),i.setFontSize(o*t.pix),i.setFillStyle(s),i.fillText(n,f,y),i.closePath(),i.stroke()}}function nt(t,e,i,a,o){var r=e.data,n=e.textOffset?e.textOffset:0;t.forEach((function(t,l){if(null!==t){a.beginPath();var s=e.textSize?e.textSize*o.pix:i.fontSize;a.setFontSize(s),a.setFillStyle(e.textColor||o.fontColor);var h=r[l];"object"==typeof r[l]&&null!==r[l]&&(h=r[l].constructor.toString().indexOf("Array")>-1?r[l][1]:r[l].value);var c=e.formatter?e.formatter(h,l,e,o):h;a.setTextAlign("center"),a.fillText(String(c),t.x,t.y-4+n*o.pix),a.closePath(),a.stroke(),a.setTextAlign("left")}}))}function lt(t,e,i,a,o){var r=e.data,n=e.textOffset?e.textOffset:0,l=o.extra.column.labelPosition;t.forEach((function(t,s){if(null!==t){a.beginPath();var h=e.textSize?e.textSize*o.pix:i.fontSize;a.setFontSize(h),a.setFillStyle(e.textColor||o.fontColor);var c=r[s];"object"==typeof r[s]&&null!==r[s]&&(c=r[s].constructor.toString().indexOf("Array")>-1?r[s][1]:r[s].value);var d=e.formatter?e.formatter(c,s,e,o):c;a.setTextAlign("center");var p=t.y-4*o.pix+n*o.pix;t.y>e.zeroPoints&&(p=t.y+n*o.pix+h),"insideTop"==l&&(p=t.y+h+n*o.pix,t.y>e.zeroPoints&&(p=t.y-n*o.pix-4*o.pix)),"center"==l&&(p=t.y+n*o.pix+(o.height-o.area[2]-t.y+h)/2,e.zeroPointse.zeroPoints&&(p=t.y-n*o.pix-(t.y-e.zeroPoints-h)/2),"stack"==o.extra.column.type&&(p=t.y+n*o.pix+(t.y0-t.y+h)/2)),"bottom"==l&&(p=o.height-o.area[2]+n*o.pix-4*o.pix,e.zeroPointse.zeroPoints&&(p=e.zeroPoints-n*o.pix+h+2*o.pix),"stack"==o.extra.column.type&&(p=t.y0+n*o.pix-4*o.pix)),a.fillText(String(d),t.x,p),a.closePath(),a.stroke(),a.setTextAlign("left")}}))}function st(t,e,i,a,o){var r=e.data;e.textOffset&&e.textOffset,t.forEach((function(t,n){if(null!==t){a.beginPath();var l=e.textSize?e.textSize*o.pix:i.fontSize;a.setFontSize(l),a.setFillStyle(e.textColor||o.fontColor);var s=r[n];"object"==typeof r[n]&&null!==r[n]&&(s=r[n].value);var h=e.formatter?e.formatter(s,n,e,o):s;a.setTextAlign("left"),a.fillText(String(h),t.x+4*o.pix,t.y+l/2-3),a.closePath(),a.stroke()}}))}function ht(t,e,i,a,o,r){var n=i.pieChartLinePadding,l=[],s=null,h=t.map((function(i,a){var o=i.formatter?i.formatter(i,a,t,e):S.toFixed(100*i._proportion_.toFixed(4))+"%";o=i.labelText?i.labelText:o;var r=2*Math.PI-(i._start_+2*Math.PI*i._proportion_/2);return i._rose_proportion_&&(r=2*Math.PI-(i._start_+2*Math.PI*i._rose_proportion_/2)),{arc:r,text:o,color:i.color,radius:i._radius_,textColor:i.textColor,textSize:i.textSize,labelShow:i.labelShow}}));for(let c=0;c=0?o+i.pieChartTextPadding:o-i.pieChartTextPadding,g=r,u=_(t.text,t.textSize*e.pix||i.fontSize,a),f=g;s&&S.isSameXCoordinateArea(s.start,{x:x})&&(f=x>0?Math.min(g,s.start.y):o<0||g>0?Math.max(g,s.start.y):Math.min(g,s.start.y)),x<0&&(x-=u),s=M({lineStart:{x:d,y:p},lineEnd:{x:o,y:r},start:{x:x,y:f},width:u,height:i.fontSize,text:t.text,color:t.color,textColor:t.textColor,textSize:t.textSize},s),l.push(s)}for(let c=0;ci.width&&(g=!0),y+e.y>i.height&&(e.y=i.height-y),o.beginPath(),o.setFillStyle(w(l.bgColor,l.bgOpacity)),o.setLineWidth(l.borderWidth*i.pix),o.setStrokeStyle(w(l.borderColor,l.borderOpacity));var m=l.borderRadius;g?(f+x>i.width&&(e.x=i.width+Math.abs(i._scrollDistance_||0)+x+(f-i.width)),f>e.x&&(e.x=i.width+Math.abs(i._scrollDistance_||0)+x+(f-i.width)),l.showArrow&&(o.moveTo(e.x,e.y+10*i.pix),o.lineTo(e.x-x,e.y+10*i.pix+5*i.pix)),o.arc(e.x-x-m,e.y+y-m,m,0,Math.PI/2,!1),o.arc(e.x-x-Math.round(f)+m,e.y+y-m,m,Math.PI/2,Math.PI,!1),o.arc(e.x-x-Math.round(f)+m,e.y+m,m,-Math.PI,-Math.PI/2,!1),o.arc(e.x-x-m,e.y+m,m,-Math.PI/2,0,!1),l.showArrow&&(o.lineTo(e.x-x,e.y+10*i.pix-5*i.pix),o.lineTo(e.x,e.y+10*i.pix))):(l.showArrow&&(o.moveTo(e.x,e.y+10*i.pix),o.lineTo(e.x+x,e.y+10*i.pix-5*i.pix)),o.arc(e.x+x+m,e.y+m,m,-Math.PI,-Math.PI/2,!1),o.arc(e.x+x+Math.round(f)-m,e.y+m,m,-Math.PI/2,0,!1),o.arc(e.x+x+Math.round(f)-m,e.y+y-m,m,0,Math.PI/2,!1),o.arc(e.x+x+m,e.y+y-m,m,Math.PI/2,Math.PI,!1),l.showArrow&&(o.lineTo(e.x+x,e.y+10*i.pix+5*i.pix),o.lineTo(e.x,e.y+10*i.pix))),o.closePath(),o.fill(),l.borderWidth>0&&o.stroke(),l.legendShow&&t.forEach((function(t,a){if(null!==t.color){o.beginPath(),o.setFillStyle(t.color);var r=e.x+x+2*c,n=e.y+(h-s)/2+h*a+c+1;switch(g&&(r=e.x-f-x+2*c),t.legendShape){case"line":o.moveTo(r,n+.5*d-2*i.pix),o.fillRect(r,n+.5*d-2*i.pix,d,4*i.pix);break;case"triangle":o.moveTo(r+7.5*i.pix,n+.5*d-5*i.pix),o.lineTo(r+2.5*i.pix,n+.5*d+5*i.pix),o.lineTo(r+12.5*i.pix,n+.5*d+5*i.pix),o.lineTo(r+7.5*i.pix,n+.5*d-5*i.pix);break;case"diamond":o.moveTo(r+7.5*i.pix,n+.5*d-5*i.pix),o.lineTo(r+2.5*i.pix,n+.5*d),o.lineTo(r+7.5*i.pix,n+.5*d+5*i.pix),o.lineTo(r+12.5*i.pix,n+.5*d),o.lineTo(r+7.5*i.pix,n+.5*d-5*i.pix);break;case"circle":o.moveTo(r+7.5*i.pix,n+.5*d),o.arc(r+7.5*i.pix,n+.5*d,5*i.pix,0,2*Math.PI);break;case"rect":default:o.moveTo(r,n+.5*d-5*i.pix),o.fillRect(r,n+.5*d-5*i.pix,15*i.pix,10*i.pix);break;case"square":o.moveTo(r+2*i.pix,n+.5*d-5*i.pix),o.fillRect(r+2*i.pix,n+.5*d-5*i.pix,10*i.pix,10*i.pix)}o.closePath(),o.fill()}})),t.forEach((function(t,i){var a=e.x+x+2*c+d+p;g&&(a=e.x-f-x+2*c+d+p);var r=e.y+h*i+(h-s)/2-1+c+s;o.beginPath(),o.setFontSize(s),o.setTextBaseline("normal"),o.setFillStyle(l.fontColor),o.fillText(t.text,a,r),o.closePath(),o.stroke()}))}}function xt(t,e,i,a){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=e.chartData.xAxisData,n=r.xAxisPoints,l=r.eachSpacing,s=v({},{type:"group",width:l/2,meterBorder:4,meterFillColor:"#FFFFFF",barBorderCircle:!1,barBorderRadius:[],seriesGap:2,linearType:"none",linearOpacity:1,customColor:[],colorStop:0,labelPosition:"outside"},e.extra.column),h=[];a.save();let c=-2,d=n.length+2;return e._scrollDistance_&&0!==e._scrollDistance_&&!0===e.enableScroll&&(a.translate(e._scrollDistance_,0),c=Math.floor(-e._scrollDistance_/l)-2,d=c+e.xAxis.itemCount+4),e.tooltip&&e.tooltip.textList&&e.tooltip.textList.length&&1===o&&function(t,e,i,a,o){var r=v({},{activeBgColor:"#000000",activeBgOpacity:.08,activeWidth:o},e.extra.column);r.activeWidth=r.activeWidth>o?o:r.activeWidth;var n=e.area[0],l=e.height-e.area[2];a.beginPath(),a.setFillStyle(w(r.activeBgColor,r.activeBgOpacity)),a.rect(t-r.activeWidth/2,n,r.activeWidth,l-n),a.closePath(),a.fill(),a.setFillStyle("#FFFFFF")}(e.tooltip.offset.x,e,0,a,l),s.customColor=L(s.linearType,s.customColor,t,i),t.forEach((function(r,p){let x,g,u;x=[].concat(e.chartData.yAxisData.ranges[r.index]),g=x.pop(),u=x.shift();let f=(e.height-e.area[0]-e.area[2])*(0-g)/(u-g),y=e.height-Math.round(f)-e.area[2];r.zeroPoints=y;var m=r.data;switch(s.type){case"group":var b=U(m,g,u,n,l,e,i,y,o),v=V(m,g,u,n,l,e,i,p,t,o);h.push(v),b=J(b,l,t.length,p,0,e);for(let t=0;tc&&ty?y:i.y,o=i.width,r=Math.abs(y-i.y);s.barBorderCircle&&(s.barBorderRadius=[o/2,o/2,0,0]),i.y>y&&(s.barBorderRadius=[0,0,o/2,o/2]);let[n,l,h,c]=s.barBorderRadius,d=Math.min(o/2,r/2);n=n>d?d:n,l=l>d?d:l,h=h>d?d:h,c=c>d?d:c,n=n<0?0:n,l=l<0?0:l,h=h<0?0:h,c=c<0?0:c,a.arc(t+n,e+n,n,-Math.PI,-Math.PI/2),a.arc(t+o-l,e+l,l,-Math.PI/2,0),a.arc(t+o-h,e+r-h,h,0,Math.PI/2),a.arc(t+c,e+r-c,c,Math.PI/2,Math.PI)}else a.moveTo(S,i.y),a.lineTo(S+i.width,i.y),a.lineTo(S+i.width,y),a.lineTo(S,y),a.lineTo(S,i.y),a.setLineWidth(1),a.setStrokeStyle(C);a.setFillStyle(A),a.closePath(),a.fill()}}break;case"stack":b=V(m,g,u,n,l,e,i,p,t,o);h.push(b),b=function(t,e,i,a,o,r){var n=r.extra.column.categoryGap*r.pix||0;return t.map((function(t,i){return null===t?null:(t.width=Math.ceil(e-2*n),r.extra.column&&r.extra.column.width&&+r.extra.column.width>0&&(t.width=Math.min(t.width,+r.extra.column.width*r.pix)),t.width<=0&&(t.width=1),t)}))}(b,l,t.length,0,0,e);for(let t=0;tc&&t0&&(T-=D),a.setFillStyle(A),a.moveTo(S,i.y),a.fillRect(S,i.y,i.width,T),a.closePath(),a.fill()}}break;case"meter":b=$(m,g,u,n,l,e,i,o);h.push(b),b=function(t,e,i,a,o,r,n){var l=r.extra.column.categoryGap*r.pix||0;return t.map((function(t){return null===t?null:(t.width=e-2*l,r.extra.column&&r.extra.column.width&&+r.extra.column.width>0&&(t.width=Math.min(t.width,+r.extra.column.width*r.pix)),a>0&&(t.width-=n),t)}))}(b,l,t.length,p,0,e,s.meterBorder);for(let t=0;tc&&t0&&(a.setStrokeStyle(r.color),a.setLineWidth(s.meterBorder*e.pix)),0==p?a.setFillStyle(s.meterFillColor):a.setFillStyle(i.color||r.color);S=i.x-i.width/2,T=e.height-i.y-e.area[2];if(s.barBorderRadius&&4===s.barBorderRadius.length||!0===s.barBorderCircle){const t=S,e=i.y,o=i.width,r=y-i.y;s.barBorderCircle&&(s.barBorderRadius=[o/2,o/2,0,0]);let[n,l,h,c]=s.barBorderRadius,d=Math.min(o/2,r/2);n=n>d?d:n,l=l>d?d:l,h=h>d?d:h,c=c>d?d:c,n=n<0?0:n,l=l<0?0:l,h=h<0?0:h,c=c<0?0:c,a.arc(t+n,e+n,n,-Math.PI,-Math.PI/2),a.arc(t+o-l,e+l,l,-Math.PI/2,0),a.arc(t+o-h,e+r-h,h,0,Math.PI/2),a.arc(t+c,e+r-c,c,Math.PI/2,Math.PI),a.fill()}else a.moveTo(S,i.y),a.lineTo(S+i.width,i.y),a.lineTo(S+i.width,y),a.lineTo(S,y),a.lineTo(S,i.y),a.fill();0==p&&s.meterBorder>0&&(a.closePath(),a.stroke())}}}})),!1!==e.dataLabel&&1===o&&t.forEach((function(r,h){let c,d,p;c=[].concat(e.chartData.yAxisData.ranges[r.index]),d=c.pop(),p=c.shift();var x=r.data;switch(s.type){case"group":lt(J(U(x,d,p,n,l,e,i,o),l,t.length,h,0,e),r,i,a,e);break;case"stack":lt(V(x,d,p,n,l,e,i,h,t,o),r,i,a,e);break;case"meter":lt($(x,d,p,n,l,e,i,o),r,i,a,e)}})),a.restore(),{xAxisPoints:n,calPoints:h,eachSpacing:l}}function gt(t,e,i,a){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=e.chartData.xAxisData,n=r.xAxisPoints,l=r.eachSpacing,s=v({},{type:"mount",widthRatio:1,borderWidth:1,barBorderCircle:!1,barBorderRadius:[],linearType:"none",linearOpacity:1,customColor:[],colorStop:0},e.extra.mount);s.widthRatio=s.widthRatio<=0?0:s.widthRatio,s.widthRatio=s.widthRatio>=2?2:s.widthRatio,a.save();let h,c,d,p=-2,x=n.length+2;e._scrollDistance_&&0!==e._scrollDistance_&&!0===e.enableScroll&&(a.translate(e._scrollDistance_,0),p=Math.floor(-e._scrollDistance_/l)-2,x=p+e.xAxis.itemCount+4),s.customColor=L(s.linearType,s.customColor,t,i),h=[].concat(e.chartData.yAxisData.ranges[0]),c=h.pop(),d=h.shift();let g=(e.height-e.area[0]-e.area[2])*(0-c)/(d-c),u=e.height-Math.round(g)-e.area[2];var f=Z(t,c,d,n,l,e,s,u,o);switch(s.type){case"bar":for(let i=0;ip&&iu?u:o.y,i=o.width,r=Math.abs(u-o.y);s.barBorderCircle&&(s.barBorderRadius=[i/2,i/2,0,0]),o.y>u&&(s.barBorderRadius=[0,0,i/2,i/2]);let[n,l,h,c]=s.barBorderRadius,d=Math.min(i/2,r/2);n=n>d?d:n,l=l>d?d:l,h=h>d?d:h,c=c>d?d:c,n=n<0?0:n,l=l<0?0:l,h=h<0?0:h,c=c<0?0:c,a.arc(t+n,e+n,n,-Math.PI,-Math.PI/2),a.arc(t+i-l,e+l,l,-Math.PI/2,0),a.arc(t+i-h,e+r-h,h,0,Math.PI/2),a.arc(t+c,e+r-c,c,Math.PI/2,Math.PI)}else a.moveTo(y,o.y),a.lineTo(y+o.width,o.y),a.lineTo(y+o.width,u),a.lineTo(y,u),a.lineTo(y,o.y);a.setStrokeStyle(S),a.setFillStyle(b),s.borderWidth>0&&(a.setLineWidth(s.borderWidth*e.pix),a.closePath(),a.stroke()),a.fill()}}break;case"triangle":for(let i=0;ip&&i0&&(a.setLineWidth(s.borderWidth*e.pix),a.stroke()),a.fill()}}break;case"mount":for(let i=0;ip&&i0&&(a.setLineWidth(s.borderWidth*e.pix),a.stroke()),a.fill()}}break;case"sharp":for(let i=0;ip&&i0&&(a.setLineWidth(s.borderWidth*e.pix),a.stroke()),a.fill()}}}if(!1!==e.dataLabel&&1===o){let r,h,c;r=[].concat(e.chartData.yAxisData.ranges[0]),h=r.pop(),c=r.shift(),function(t,e,i,a,o,r){e.data;var n=e.textOffset?e.textOffset:0;o.extra.mount.labelPosition,t.forEach((function(t,l){if(null!==t){a.beginPath();var s=e[l].textSize?e[l].textSize*o.pix:i.fontSize;a.setFontSize(s),a.setFillStyle(e[l].textColor||o.fontColor);var h=t.value,c=e[l].formatter?e[l].formatter(h,l,e,o):h;a.setTextAlign("center");var d=t.y-4*o.pix+n*o.pix;t.y>r&&(d=t.y+n*o.pix+s),a.fillText(String(c),t.x,d),a.closePath(),a.stroke(),a.setTextAlign("left")}}))}(f=Z(t,h,c,n,l,e,s,u,o),t,i,a,e,u)}return a.restore(),{xAxisPoints:n,calPoints:f,eachSpacing:l}}function ut(t,e,i,a){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=[],n=(e.height-e.area[0]-e.area[2])/e.categories.length;for(let c=0;c-2&&td?d:n,s=s>d?d:s,h=h>d?d:h,c=c>d?d:c,n=n<0?0:n,s=s<0?0:s,h=h<0?0:h,c=c<0?0:c,a.arc(t+c,o+c,c,-Math.PI,-Math.PI/2),a.arc(i.x-n,o+n,n,-Math.PI/2,0),a.arc(i.x-s,o+e-s,s,0,Math.PI/2),a.arc(t+h,o+e-h,h,Math.PI/2,Math.PI)}else a.moveTo(m,b),a.lineTo(i.x,b),a.lineTo(i.x,b+i.width),a.lineTo(m,b+i.width),a.lineTo(m,b),a.setLineWidth(1),a.setStrokeStyle(S);a.setFillStyle(v),a.closePath(),a.fill()}}break;case"stack":f=K(u,x,g,r,n,e,i,d,t,o);s.push(f),f=function(t,e,i,a,o,r){var n=r.extra.bar.categoryGap*r.pix||0;return t.map((function(t,i){return null===t?null:(t.width=Math.ceil(e-2*n),r.extra.bar&&r.extra.bar.width&&+r.extra.bar.width>0&&(t.width=Math.min(t.width,+r.extra.bar.width*r.pix)),t.width<=0&&(t.width=1),t)}))}(f,n,t.length,0,0,e);for(let t=0;t-2&&t5&&void 0!==arguments[5]?arguments[5]:1,n=v({},{color:{},average:{}},i.extra.candle);n.color=v({},{upLine:"#f04864",upFill:"#f04864",downLine:"#2fc25b",downFill:"#2fc25b"},n.color),n.average=v({},{show:!1,name:[],day:[],color:a.color},n.average),i.extra.candle=n;let l=i.chartData.xAxisData,s=l.xAxisPoints,h=l.eachSpacing,c=[];o.save();let d=-2,p=s.length+2,x=0,g=i.width+h;return i._scrollDistance_&&0!==i._scrollDistance_&&!0===i.enableScroll&&(o.translate(i._scrollDistance_,0),d=Math.floor(-i._scrollDistance_/h)-2,p=d+i.xAxis.itemCount+4,x=-i._scrollDistance_-2*h+i.area[3],g=x+(i.xAxis.itemCount+4)*h),(n.average.show||e)&&e.forEach((function(t,e){let n,l,c;n=[].concat(i.chartData.yAxisData.ranges[t.index]),l=n.pop(),c=n.shift();var d=G($(t.data,l,c,s,h,i,a,r),t);for(let i=0;ix&&(o.moveTo(a.x,a.y),t=1),i>0&&a.x>x&&a.x7&&void 0!==arguments[7]?arguments[7]:1,s=[],h=r.height-r.area[0]-r.area[2];return t.forEach((function(t,n){if(null===t)s.push(null);else{var c=[];t.forEach((function(t,s){var d={};d.x=a[n]+Math.round(o/2);var p=t.value||t,x=h*(p-e)/(i-e);x*=l,d.y=r.height-Math.round(x)-r.area[2],c.push(d)})),s.push(c)}})),s}(u,x,g,s,h,i,a,r);c.push(f);var y=G(f,t);for(let a=0;ad&&a0?(o.setStrokeStyle(n.color.upLine),o.setFillStyle(n.color.upFill),o.setLineWidth(1*i.pix),o.moveTo(t[3].x,t[3].y),o.lineTo(t[1].x,t[1].y),o.lineTo(t[1].x-h/4,t[1].y),o.lineTo(t[0].x-h/4,t[0].y),o.lineTo(t[0].x,t[0].y),o.lineTo(t[2].x,t[2].y),o.lineTo(t[0].x,t[0].y),o.lineTo(t[0].x+h/4,t[0].y),o.lineTo(t[1].x+h/4,t[1].y),o.lineTo(t[1].x,t[1].y),o.moveTo(t[3].x,t[3].y)):(o.setStrokeStyle(n.color.downLine),o.setFillStyle(n.color.downFill),o.setLineWidth(1*i.pix),o.moveTo(t[3].x,t[3].y),o.lineTo(t[0].x,t[0].y),o.lineTo(t[0].x-h/4,t[0].y),o.lineTo(t[1].x-h/4,t[1].y),o.lineTo(t[1].x,t[1].y),o.lineTo(t[2].x,t[2].y),o.lineTo(t[1].x,t[1].y),o.lineTo(t[1].x+h/4,t[1].y),o.lineTo(t[0].x+h/4,t[0].y),o.lineTo(t[0].x,t[0].y),o.moveTo(t[3].x,t[3].y)),o.closePath(),o.fill(),o.stroke()}})),o.restore(),{xAxisPoints:s,calPoints:c,eachSpacing:h}}function yt(t,e,i,a,o,r){(t.extra.tooltip||{}).horizentalLine&&t.tooltip&&1===a&&("line"==t.type||"area"==t.type||"column"==t.type||"mount"==t.type||"candle"==t.type||"mix"==t.type)&&dt(t,e,i),i.save(),t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&i.translate(t._scrollDistance_,0),t.tooltip&&t.tooltip.textList&&t.tooltip.textList.length&&1===a&&pt(t.tooltip.textList,t.tooltip.offset,t,e,i),i.restore()}function mt(t,e,i,a){let o=e.chartData.xAxisData,r=o.xAxisPoints,n=o.startX,l=o.endX,s=o.eachSpacing;var h="center";"bar"!=e.type&&"line"!=e.type&&"area"!=e.type&&"scatter"!=e.type&&"bubble"!=e.type||(h=e.xAxis.boundaryGap);var c=e.height-e.area[2],d=e.area[0];if(e.enableScroll&&e.xAxis.scrollShow){var p=e.height-e.area[2]+i.xAxisHeight,x=l-n,g=s*(r.length-1);"mount"==e.type&&e.extra&&e.extra.mount&&e.extra.mount.widthRatio&&e.extra.mount.widthRatio>1&&(e.extra.mount.widthRatio>2&&(e.extra.mount.widthRatio=2),g+=(e.extra.mount.widthRatio-1)*s);var u=x*x/g,f=0;e._scrollDistance_&&(f=-e._scrollDistance_*x/g),a.beginPath(),a.setLineCap("round"),a.setLineWidth(6*e.pix),a.setStrokeStyle(e.xAxis.scrollBackgroundColor||"#EFEBEF"),a.moveTo(n,p),a.lineTo(l,p),a.stroke(),a.closePath(),a.beginPath(),a.setLineCap("round"),a.setLineWidth(6*e.pix),a.setStrokeStyle(e.xAxis.scrollColor||"#A6A6A6"),a.moveTo(n+f,p),a.lineTo(n+f+u,p),a.stroke(),a.closePath(),a.setLineCap("butt")}if(a.save(),e._scrollDistance_&&0!==e._scrollDistance_&&a.translate(e._scrollDistance_,0),!0===e.xAxis.calibration&&(a.setStrokeStyle(e.xAxis.gridColor||"#cccccc"),a.setLineCap("butt"),a.setLineWidth(1*e.pix),r.forEach((function(t,i){i>0&&(a.beginPath(),a.moveTo(t-s/2,c),a.lineTo(t-s/2,c+3*e.pix),a.closePath(),a.stroke())}))),!0!==e.xAxis.disableGrid&&(a.setStrokeStyle(e.xAxis.gridColor||"#cccccc"),a.setLineCap("butt"),a.setLineWidth(1*e.pix),"dash"==e.xAxis.gridType&&a.setLineDash([e.xAxis.dashLength*e.pix,e.xAxis.dashLength*e.pix]),e.xAxis.gridEval=e.xAxis.gridEval||1,r.forEach((function(t,i){i%e.xAxis.gridEval==0&&(a.beginPath(),a.moveTo(t,c),a.lineTo(t,d),a.stroke())})),a.setLineDash([])),!0!==e.xAxis.disabled){let o=t.length;e.xAxis.labelCount&&(o=e.xAxis.itemCount?Math.ceil(t.length/e.xAxis.itemCount*e.xAxis.labelCount):e.xAxis.labelCount,o-=1);let n=Math.ceil(t.length/o),l=[],d=t.length;for(let e=0;e=e.area[3]-1&&d-Math.abs(l)<=e.width-e.area[1]+1&&(a.beginPath(),a.setFontSize(y),a.setFillStyle(e.xAxis.fontColor||e.fontColor),a.fillText(String(o),r[i]+n,c+e.xAxis.marginTop*e.pix+(e.xAxis.lineHeight-e.xAxis.fontSize)*e.pix/2+e.xAxis.fontSize*e.pix),a.closePath(),a.stroke())})):l.forEach((function(t,o){var n=e.xAxis.formatter?e.xAxis.formatter(t):t,l=e._scrollDistance_||0,d="center"==h?r[o]+s/2:r[o];if(d-Math.abs(l)>=e.area[3]-1&&d-Math.abs(l)<=e.width-e.area[1]+1){a.save(),a.beginPath(),a.setFontSize(y),a.setFillStyle(e.xAxis.fontColor||e.fontColor);var p=_(String(n),y,a),x=r[o];"center"==h&&(x=r[o]+s/2),e.xAxis.scrollShow&&e.pix;var g=c+e.xAxis.marginTop*e.pix+y-y*Math.abs(Math.sin(i._xAxisTextAngle_));e.xAxis.rotateAngle<0?(x-=y/2,p=0):(x+=y/2,p=-p),a.translate(x,g),a.rotate(-1*i._xAxisTextAngle_),a.fillText(String(n),p,0),a.closePath(),a.stroke(),a.restore()}}))}a.restore(),e.xAxis.title&&(a.beginPath(),a.setFontSize(e.xAxis.titleFontSize*e.pix),a.setFillStyle(e.xAxis.titleFontColor),a.fillText(String(e.xAxis.title),e.width-e.area[1]+e.xAxis.titleOffsetX*e.pix,e.height-e.area[2]+e.xAxis.marginTop*e.pix+(e.xAxis.lineHeight-e.xAxis.titleFontSize)*e.pix/2+(e.xAxis.titleFontSize+e.xAxis.titleOffsetY)*e.pix),a.closePath(),a.stroke()),e.xAxis.axisLine&&(a.beginPath(),a.setStrokeStyle(e.xAxis.axisLineColor),a.setLineWidth(1*e.pix),a.moveTo(n,e.height-e.area[2]),a.lineTo(l,e.height-e.area[2]),a.stroke())}function bt(t,e,i,a){if(!0===e.yAxis.disableGrid)return;let o=(e.height-e.area[0]-e.area[2])/e.yAxis.splitNumber,r=e.area[3],n=e.chartData.xAxisData.xAxisPoints,l=e.chartData.xAxisData.eachSpacing,s=l*(n.length-1);"mount"==e.type&&e.extra&&e.extra.mount&&e.extra.mount.widthRatio&&e.extra.mount.widthRatio>1&&(e.extra.mount.widthRatio>2&&(e.extra.mount.widthRatio=2),s+=(e.extra.mount.widthRatio-1)*l);let h=r+s,c=[],d=1;!1===e.xAxis.axisLine&&(d=0);for(let p=d;p4&&void 0!==arguments[4]?arguments[4]:1,r=v({},{activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,ringWidth:30,customRadius:0,border:!1,borderWidth:2,borderColor:"#FFFFFF",centerColor:"#FFFFFF",linearType:"none",customColor:[]},"pie"==e.type?e.extra.pie:e.extra.ring),n={x:e.area[3]+(e.width-e.area[1]-e.area[3])/2,y:e.area[0]+(e.height-e.area[0]-e.area[2])/2};0==i.pieChartLinePadding&&(i.pieChartLinePadding=r.activeRadius*e.pix);var l=Math.min((e.width-e.area[1]-e.area[3])/2-i.pieChartLinePadding-i.pieChartTextPadding-i._pieTextMaxLength_,(e.height-e.area[0]-e.area[2])/2-i.pieChartLinePadding-i.pieChartTextPadding);l=l<10?10:l,r.customRadius>0&&(l=r.customRadius*e.pix),t=X(t,l,o);var s=r.activeRadius*e.pix;if(r.customColor=L(r.linearType,r.customColor,t,i),(t=t.map((function(t){return t._start_+=r.offsetAngle*Math.PI/180,t}))).forEach((function(t,i){e.tooltip&&e.tooltip.index==i&&(a.beginPath(),a.setFillStyle(w(t.color,r.activeOpacity||.5)),a.moveTo(n.x,n.y),a.arc(n.x,n.y,t._radius_+s,t._start_,t._start_+2*t._proportion_*Math.PI),a.closePath(),a.fill()),a.beginPath(),a.setLineWidth(r.borderWidth*e.pix),a.lineJoin="round",a.setStrokeStyle(r.borderColor);var o,l=t.color;"custom"==r.linearType&&((o=a.createCircularGradient?a.createCircularGradient(n.x,n.y,t._radius_):a.createRadialGradient(n.x,n.y,0,n.x,n.y,t._radius_)).addColorStop(0,w(r.customColor[t.linearIndex],1)),o.addColorStop(1,w(t.color,1)),l=o);a.setFillStyle(l),a.moveTo(n.x,n.y),a.arc(n.x,n.y,t._radius_,t._start_,t._start_+2*t._proportion_*Math.PI),a.closePath(),a.fill(),1==r.border&&a.stroke()})),"ring"===e.type){var h=.6*l;"number"==typeof r.ringWidth&&r.ringWidth>0&&(h=Math.max(0,l-r.ringWidth*e.pix)),a.beginPath(),a.setFillStyle(r.centerColor),a.moveTo(n.x,n.y),a.arc(n.x,n.y,h,0,2*Math.PI),a.closePath(),a.fill()}return!1!==e.dataLabel&&1===o&&ht(t,e,i,a,0,n),1===o&&"ring"===e.type&&rt(e,i,a,n),{center:n,radius:l,series:t}}function Tt(t,e,i,a,o){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,n=v({},{type:"default",startAngle:.75,endAngle:.25,width:15,labelOffset:13,splitLine:{fixRadius:0,splitNumber:10,width:15,color:"#FFFFFF",childNumber:5,childWidth:5},pointer:{width:15,color:"auto"}},i.extra.gauge);null==n.oldAngle&&(n.oldAngle=n.startAngle),null==n.oldData&&(n.oldData=0),t=function(t,e,i){let a;a=i=2&&(t[r]._endAngle_=t[r]._endAngle_%2),o=t[r]._endAngle_;return t}(t,n.startAngle,n.endAngle);var l={x:i.width/2,y:i.height/2},s=Math.min(l.x,l.y);s-=5*i.pix;var h=(s=(s-=n.width/2)<10?10:s)-n.width,c=0;if("progress"==n.type){var d=s-3*n.width;o.beginPath();let t=o.createLinearGradient(l.x,l.y-d,l.x,l.y+d);t.addColorStop("0",w(e[0].color,.3)),t.addColorStop("1.0",w("#FFFFFF",.1)),o.setFillStyle(t),o.arc(l.x,l.y,d,0,2*Math.PI,!1),o.fill(),o.setLineWidth(n.width),o.setStrokeStyle(w(e[0].color,.3)),o.setLineCap("round"),o.beginPath(),o.arc(l.x,l.y,h,n.startAngle*Math.PI,n.endAngle*Math.PI,!1),o.stroke(),c=n.endAngler/g?o.setStrokeStyle(w(e[0].color,1)):o.setStrokeStyle(w(e[0].color,.3)),o.setLineWidth(3*i.pix),o.moveTo(p,0),o.lineTo(x,0),o.stroke(),o.rotate(a*Math.PI);o.restore(),e=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;1==i&&(i=.999999);for(let a=0;a=2&&(r._proportion_=r._proportion_%2)}return t}(e,n,r),o.setLineWidth(n.width),o.setStrokeStyle(e[0].color),o.setLineCap("round"),o.beginPath(),o.arc(l.x,l.y,h,n.startAngle*Math.PI,e[0]._proportion_*Math.PI,!1),o.stroke();let f=s-2.5*n.width;o.save(),o.translate(l.x,l.y),o.rotate((e[0]._proportion_-1)*Math.PI),o.beginPath(),o.setLineWidth(n.width/3);let y=o.createLinearGradient(0,.6*-f,0,.6*f);y.addColorStop("0",w("#FFFFFF",0)),y.addColorStop("0.5",w(e[0].color,1)),y.addColorStop("1.0",w("#FFFFFF",0)),o.setStrokeStyle(y),o.arc(0,0,f,.85*Math.PI,1.15*Math.PI,!1),o.stroke(),o.beginPath(),o.setLineWidth(1),o.setStrokeStyle(e[0].color),o.setFillStyle(e[0].color),o.moveTo(-f-n.width/3/2,-4),o.lineTo(-f-n.width/3/2-4,0),o.lineTo(-f-n.width/3/2,4),o.lineTo(-f-n.width/3/2,-4),o.stroke(),o.fill(),o.restore()}else{o.setLineWidth(n.width),o.setLineCap("butt");for(let e=0;e3&&void 0!==arguments[3]?arguments[3]:1;for(let o=0;o=i.oldData?n._proportion_=(n._endAngle_-n._oldAngle_)*a+i.oldAngle:n._proportion_=n._oldAngle_-(n._oldAngle_-n._endAngle_)*a,n._proportion_>=2&&(n._proportion_=n._proportion_%2)}return t}(e,t,n,r);for(let t=0;t=2&&(h%=2),c+=s}}(n,s,l,i,a,o)}return rt(i,a,o,l),1===r&&"gauge"===i.type&&(i.extra.gauge.oldAngle=e[0]._proportion_,i.extra.gauge.oldData=e[0].data),{center:l,radius:s,innerRadius:h,categories:t,totalAngle:c}}function At(t,e,i,a){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=v({},{gridColor:"#cccccc",gridType:"radar",gridEval:1,axisLabel:!1,axisLabelTofix:0,labelShow:!0,labelColor:"#666666",labelPointShow:!1,labelPointRadius:3,labelPointColor:"#cccccc",opacity:.2,gridCount:3,border:!1,borderWidth:2,linearType:"none",customColor:[]},e.extra.radar),n=function(t){for(var e=2*Math.PI/t,i=[],a=0;a5&&void 0!==arguments[5]?arguments[5]:1,n=o.extra.radar||{};n.max=n.max||0;var l=Math.max(n.max,Math.max.apply(null,k(a))),s=[];for(let h=0;ht[1]&&i[1]>t[1])return!1;if(e[1]t[1])return!1;if(i[1]==t[1]&&e[1]>t[1])return!1;if(e[0]e[r].area[2]||t[1]>e[r].area[3]||t[2]i||t[3]>a){o=!0;break}o=!1}return o}function _t(t,e,i,a){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=v({},{type:"normal",autoColors:!0},e.extra.word);e.chartData.wordCloudData||(e.chartData.wordCloudData=function(t,e,i){let a=t.series;switch(e){case"normal":for(let o=0;o.7};for(let o=0;o0&&(e.tooltip&&e.tooltip.index==l?a.strokeText(t,(n[l].areav[0]+5-e.width/2)*o-r*(1-o)/2,(n[l].areav[1]+5+i-e.height/2)*o):a.fillText(t,(n[l].areav[0]+5-e.width/2)*o-r*(1-o)/2,(n[l].areav[1]+5+i-e.height/2)*o)):n[l].area[0]>0&&(e.tooltip&&e.tooltip.index==l?a.strokeText(t,(n[l].area[0]+5-e.width/2)*o-r*(1-o)/2,(n[l].area[1]+5+i-e.height/2)*o):a.fillText(t,(n[l].area[0]+5-e.width/2)*o-r*(1-o)/2,(n[l].area[1]+5+i-e.height/2)*o)),a.stroke(),a.restore()}a.restore()}function kt(t,e,i,a){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=v({},{type:"funnel",activeWidth:10,activeOpacity:.3,border:!1,borderWidth:2,borderColor:"#FFFFFF",fillOpacity:1,minSize:0,labelAlign:"right",linearType:"none",customColor:[]},e.extra.funnel),n=(e.height-e.area[0]-e.area[2])/t.length,l={x:e.area[3]+(e.width-e.area[1]-e.area[3])/2,y:e.height-e.area[2]},s=r.activeWidth*e.pix,h=Math.min((e.width-e.area[1]-e.area[3])/2-s,(e.height-e.area[0]-e.area[2])/2-s),c=function(t,e,i,a){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;for(let r=0;r0&&t[0].data.constructor.toString().indexOf("Array")>-1){e._pieSeries_=t;let o=t[0].data;for(var a=0;ae.width-e.area[1]-e.area[3]?(i.push(x),p.push(a-e.legend.itemGap*e.pix),a=l,x=[n]):(a+=l,x.push(n))}if(x.length){i.push(x),p.push(a-e.legend.itemGap*e.pix),r.widthArr=p;let t=Math.max.apply(null,p);switch(e.legend.float){case"left":r.area.start.x=e.area[3],r.area.end.x=e.area[3]+t+2*n;break;case"right":r.area.start.x=e.width-e.area[1]-t-2*n,r.area.end.x=e.width-e.area[1];break;default:r.area.start.x=(e.width-t)/2-n,r.area.end.x=(e.width+t)/2+n}r.area.width=t+2*n,r.area.wholeWidth=t+2*n,r.area.height=i.length*d+2*n,r.area.wholeHeight=i.length*d+2*n+2*l,r.points=i}}else{let i=t.length,a=e.height-e.area[0]-e.area[2]-2*l-2*n,p=Math.min(Math.floor(a/d),i);switch(r.area.height=p*d+2*n,r.area.wholeHeight=p*d+2*n,e.legend.float){case"top":r.area.start.y=e.area[0]+l,r.area.end.y=e.area[0]+l+r.area.height;break;case"bottom":r.area.start.y=e.height-e.area[2]-l-r.area.height,r.area.end.y=e.height-e.area[2]-l;break;default:r.area.start.y=(e.height-r.area.height)/2,r.area.end.y=(e.height+r.area.height)/2}let x=i%p==0?i/p:Math.floor(i/p+1),g=[];for(let e=0;ea&&(a=r)}r.widthArr.push(a),r.heightArr.push(t.length*d+2*n)}let t=0;for(let e=0;e0?x[i].width+e.yAxis.padding*e.pix:x[i].width,o+=1):"right"==x[i].position&&(e.area[1]+=t>0?x[i].width+e.yAxis.padding*e.pix:x[i].width,t+=1)}else i.yAxisWidth=x;if(e.chartData.yAxisData=p,e.categories&&e.categories.length&&"radar"!==e.type&&"gauge"!==e.type&&"bar"!==e.type){e.chartData.xAxisData=q(e.categories,e);let t=N(e.categories,e,0,e.chartData.xAxisData.eachSpacing,a),o=t.xAxisHeight,r=t.angle;i.xAxisHeight=o,i._xAxisTextAngle_=r,e.area[2]+=o,e.chartData.categoriesData=t}else if("line"===e.type||"area"===e.type||"scatter"===e.type||"bubble"===e.type||"bar"===e.type){e.chartData.xAxisData=j(r,e,i,a);let t=N(n=e.chartData.xAxisData.rangesFormat,e,0,e.chartData.xAxisData.eachSpacing,a),o=t.xAxisHeight,l=t.angle;i.xAxisHeight=o,i._xAxisTextAngle_=l,e.area[2]+=o,e.chartData.categoriesData=t}else e.chartData.xAxisData={xAxisPoints:[]};if(e.enableScroll&&"right"==e.xAxis.scrollAlign&&void 0===e._scrollDistance_){let t=0,i=e.chartData.xAxisData.xAxisPoints,a=e.chartData.xAxisData.startX;t=e.chartData.xAxisData.endX-a-e.chartData.xAxisData.eachSpacing*(i.length-1),o.scrollOption.currentOffset=t,o.scrollOption.startTouchX=t,o.scrollOption.distance=0,o.scrollOption.lastMoveTime=0,e._scrollDistance_=t}switch("pie"!==t&&"ring"!==t&&"rose"!==t||(i._pieTextMaxLength_=!1===e.dataLabel?0:function(t,e,i,a){t=X(t);let o=0;for(let r=0;rl.x?i.xMax:l.x,i.yMin=i.yMinl.y?i.yMax:l.y}}return i}(l);if(n.mercator){var h=Ct(s.xMax,s.yMax),c=Ct(s.xMin,s.yMin);s.xMax=h[0],s.yMax=h[1],s.xMin=c[0],s.yMin=c[1]}for(var d=e.width/Math.abs(s.xMax-s.xMin),p=e.height/Math.abs(s.yMax-s.yMin),x=d{this.uevent.trigger("renderComplete")}),50);break;case"funnel":this.animationInstance=new zt({timing:e.timing,duration:l,onProcess:function(t){a.clearRect(0,0,e.width,e.height),e.rotate&&it(a,e),e.chartData.funnelData=kt(r,e,i,a,t),St(e.series,e,i,a,e.chartData),yt(e,i,a,t),It(0,a)},onAnimationFinish:function(){o.uevent.trigger("renderComplete")}});break;case"line":this.animationInstance=new zt({timing:e.timing,duration:l,onProcess:function(t){a.clearRect(0,0,e.width,e.height),e.rotate&&it(a,e),bt(0,e,0,a),mt(n,e,i,a);var o=function(t,e,i,a){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=v({},{type:"straight",width:2,activeType:"none",linearType:"none",onShadow:!1,animation:"vertical"},e.extra.line);r.width*=e.pix;let n=e.chartData.xAxisData,l=n.xAxisPoints,s=n.eachSpacing;var h=[];a.save();let c=0,d=e.width+s;return e._scrollDistance_&&0!==e._scrollDistance_&&!0===e.enableScroll&&(a.translate(e._scrollDistance_,0),c=-e._scrollDistance_-2*s+e.area[3],d=c+(e.xAxis.itemCount+4)*s),t.forEach((function(t,n){let p,x,g;a.beginPath(),a.setStrokeStyle(t.color),a.moveTo(-1e4,-1e4),a.lineTo(-10001,-10001),a.stroke(),p=[].concat(e.chartData.yAxisData.ranges[t.index]),x=p.pop(),g=p.shift();var u=function(t,e,i,a,o,r,n,l,s){s=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1;var h=r.xAxis.boundaryGap,c=[],d=r.height-r.area[0]-r.area[2],p=r.width-r.area[1]-r.area[3];return t.forEach((function(t,n){if(null===t)c.push(null);else{var x={};if(x.color=t.color,"vertical"==l.animation){x.x=a[n];var g=t;if("object"==typeof t&&null!==t)if(t.constructor.toString().indexOf("Array")>-1){let e,i,a;e=[].concat(r.chartData.xAxisData.ranges),i=e.shift(),a=e.pop(),g=t[1],x.x=r.area[3]+p*(t[0]-i)/(a-i)}else g=t.value;"center"==h&&(x.x+=o/2);var u=d*(g-e)/(i-e);u*=s,x.y=r.height-u-r.area[2],c.push(x)}else x.x=a[0]+o*n*s,g=t,"center"==h&&(x.x+=o/2),u=d*(g-e)/(i-e),x.y=r.height-u-r.area[2],c.push(x)}})),c}(t.data,x,g,l,s,e,i,r,o);h.push(u);var f=G(u,t);if("dash"==t.lineType){let i=t.dashLength?t.dashLength:8;i*=e.pix,a.setLineDash([i,i])}a.beginPath();var y=t.color;if("none"!==r.linearType&&t.linearColor&&t.linearColor.length>0){for(var m=a.createLinearGradient(e.chartData.xAxisData.startX,e.height/2,e.chartData.xAxisData.endX,e.height/2),b=0;b0?a.setShadow(t.setShadow[0],t.setShadow[1],t.setShadow[2],t.setShadow[3]):a.setShadow(0,0,0,"rgba(0,0,0,0)"),a.setLineWidth(r.width),f.forEach((function(t,e){if(1===t.length)a.moveTo(t[0].x,t[0].y);else{a.moveTo(t[0].x,t[0].y);let e=0;if("curve"===r.type)for(let o=0;oc&&(a.moveTo(r.x,r.y),e=1),o>0&&r.x>c&&r.xc&&(a.moveTo(o.x,o.y),e=1),i>0&&o.x>c&&o.xc&&(a.moveTo(o.x,o.y),e=1),i>0&&o.x>c&&o.x4&&void 0!==arguments[4]?arguments[4]:1;v({},{type:"circle"},e.extra.scatter);let r=e.chartData.xAxisData,n=r.xAxisPoints,l=r.eachSpacing;a.save();let s=0;return e.width,e._scrollDistance_&&0!==e._scrollDistance_&&!0===e.enableScroll&&(a.translate(e._scrollDistance_,0),s=-e._scrollDistance_-2*l+e.area[3],e.xAxis.itemCount),t.forEach((function(t,r){let s,h,c;s=[].concat(e.chartData.yAxisData.ranges[t.index]),h=s.pop(),c=s.shift();var d=$(t.data,h,c,n,l,e,i,o);a.beginPath(),a.setStrokeStyle(t.color),a.setFillStyle(t.color),a.setLineWidth(1*e.pix);var p=t.pointShape;if("diamond"===p)d.forEach((function(t,e){null!==t&&(a.moveTo(t.x,t.y-4.5),a.lineTo(t.x-4.5,t.y),a.lineTo(t.x,t.y+4.5),a.lineTo(t.x+4.5,t.y),a.lineTo(t.x,t.y-4.5))}));else if("circle"===p)d.forEach((function(t,i){null!==t&&(a.moveTo(t.x+2.5*e.pix,t.y),a.arc(t.x,t.y,3*e.pix,0,2*Math.PI,!1))}));else if("square"===p)d.forEach((function(t,e){null!==t&&(a.moveTo(t.x-3.5,t.y-3.5),a.rect(t.x-3.5,t.y-3.5,7,7))}));else if("triangle"===p)d.forEach((function(t,e){null!==t&&(a.moveTo(t.x,t.y-4.5),a.lineTo(t.x-4.5,t.y+4.5),a.lineTo(t.x+4.5,t.y+4.5),a.lineTo(t.x,t.y-4.5))}));else if("triangle"===p)return;a.closePath(),a.fill(),a.stroke()})),!1!==e.dataLabel&&1===o&&t.forEach((function(t,r){let s,h,c;s=[].concat(e.chartData.yAxisData.ranges[t.index]),h=s.pop(),c=s.shift(),nt($(t.data,h,c,n,l,e,i,o),t,i,a,e)})),a.restore(),{xAxisPoints:n,calPoints:[],eachSpacing:l}}(r,e,i,a,t),l=o.xAxisPoints,s=o.calPoints,h=o.eachSpacing;e.chartData.xAxisPoints=l,e.chartData.calPoints=s,e.chartData.eachSpacing=h,vt(0,e,i,a),!1!==e.enableMarkLine&&1===t&&ct(e,0,a),St(e.series,e,i,a,e.chartData),yt(e,i,a,t),It(0,a)},onAnimationFinish:function(){o.uevent.trigger("renderComplete")}});break;case"bubble":this.animationInstance=new zt({timing:e.timing,duration:l,onProcess:function(t){a.clearRect(0,0,e.width,e.height),e.rotate&&it(a,e),bt(0,e,0,a),mt(n,e,i,a);var o=function(t,e,i,a){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=v({},{opacity:1,border:2},e.extra.bubble);let n=e.chartData.xAxisData,l=n.xAxisPoints,s=n.eachSpacing;a.save();let h=0;return e.width,e._scrollDistance_&&0!==e._scrollDistance_&&!0===e.enableScroll&&(a.translate(e._scrollDistance_,0),h=-e._scrollDistance_-2*s+e.area[3],e.xAxis.itemCount),t.forEach((function(t,n){let h,c,d;h=[].concat(e.chartData.yAxisData.ranges[t.index]),c=h.pop(),d=h.shift();var p=$(t.data,c,d,l,s,e,i,o);a.beginPath(),a.setStrokeStyle(t.color),a.setLineWidth(r.border*e.pix),a.setFillStyle(w(t.color,r.opacity)),p.forEach((function(t,i){a.moveTo(t.x+t.r,t.y),a.arc(t.x,t.y,t.r*e.pix,0,2*Math.PI,!1)})),a.closePath(),a.fill(),a.stroke(),!1!==e.dataLabel&&1===o&&p.forEach((function(o,r){a.beginPath();var n=t.textSize*e.pix||i.fontSize;a.setFontSize(n),a.setFillStyle(t.textColor||"#FFFFFF"),a.setTextAlign("center"),a.fillText(String(o.t),o.x,o.y+n/2),a.closePath(),a.stroke(),a.setTextAlign("left")}))})),a.restore(),{xAxisPoints:l,calPoints:[],eachSpacing:s}}(r,e,i,a,t),l=o.xAxisPoints,s=o.calPoints,h=o.eachSpacing;e.chartData.xAxisPoints=l,e.chartData.calPoints=s,e.chartData.eachSpacing=h,vt(0,e,i,a),!1!==e.enableMarkLine&&1===t&&ct(e,0,a),St(e.series,e,i,a,e.chartData),yt(e,i,a,t),It(0,a)},onAnimationFinish:function(){o.uevent.trigger("renderComplete")}});break;case"mix":this.animationInstance=new zt({timing:e.timing,duration:l,onProcess:function(t){a.clearRect(0,0,e.width,e.height),e.rotate&&it(a,e),bt(0,e,0,a),mt(n,e,i,a);var o=function(t,e,i,a){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=e.chartData.xAxisData,n=r.xAxisPoints,l=r.eachSpacing,s=v({},{width:l/2,barBorderCircle:!1,barBorderRadius:[],seriesGap:2,linearType:"none",linearOpacity:1,customColor:[],colorStop:0},e.extra.mix.column),h=v({},{opacity:.2,gradient:!1},e.extra.mix.area),c=v({},{width:2},e.extra.mix.line),d=e.height-e.area[2],p=[];var x=0,g=0;t.forEach((function(t,e){"column"==t.type&&(g+=1)})),a.save();let u=-2,f=n.length+2,y=0,m=e.width+l;e._scrollDistance_&&0!==e._scrollDistance_&&!0===e.enableScroll&&(a.translate(e._scrollDistance_,0),u=Math.floor(-e._scrollDistance_/l)-2,f=u+e.xAxis.itemCount+4,y=-e._scrollDistance_-2*l+e.area[3],m=y+(e.xAxis.itemCount+4)*l),s.customColor=L(s.linearType,s.customColor,t,i),t.forEach((function(t,r){let b,v,S;b=[].concat(e.chartData.yAxisData.ranges[t.index]),v=b.pop(),S=b.shift();var T=$(t.data,v,S,n,l,e,i,o);if(p.push(T),"column"==t.type){T=J(T,l,g,x,0,e);for(let i=0;iu&&ip?p:l,h=h>p?p:h,c=c>p?p:c,d=d>p?p:d,l=l<0?0:l,h=h<0?0:h,c=c<0?0:c,d=d<0?0:d,a.arc(t+l,i+l,l,-Math.PI,-Math.PI/2),a.arc(t+r-h,i+h,h,-Math.PI/2,0),a.arc(t+r-c,i+n-c,c,0,Math.PI/2),a.arc(t+d,i+n-d,d,Math.PI/2,Math.PI)}else a.moveTo(A,o.y),a.lineTo(A+o.width,o.y),a.lineTo(A+o.width,e.height-e.area[2]),a.lineTo(A,e.height-e.area[2]),a.lineTo(A,o.y),a.setLineWidth(1),a.setStrokeStyle(D);a.setFillStyle(C),a.closePath(),a.fill()}}x+=1}if("area"==t.type){let i=G(T,t);for(let o=0;o1){var F=r[0];let e=r[r.length-1];a.moveTo(F.x,F.y);let i=0;if("curve"===t.style)for(let t=0;ty&&(a.moveTo(e.x,e.y),i=1),t>0&&e.x>y&&e.xy&&(a.moveTo(e.x,e.y),i=1),t>0&&e.x>y&&e.xy&&(a.moveTo(o.x,o.y),e=1),t>0&&o.x>y&&o.xy&&(a.moveTo(o.x,o.y),e=1),t>0&&o.x>y&&o.x4&&void 0!==arguments[4]?arguments[4]:1,r=v({},{type:"straight",opacity:.2,addLine:!1,width:2,gradient:!1,activeType:"none"},e.extra.area);let n=e.chartData.xAxisData,l=n.xAxisPoints,s=n.eachSpacing,h=e.height-e.area[2],c=[];a.save();let d=0,p=e.width+s;return e._scrollDistance_&&0!==e._scrollDistance_&&!0===e.enableScroll&&(a.translate(e._scrollDistance_,0),d=-e._scrollDistance_-2*s+e.area[3],p=d+(e.xAxis.itemCount+4)*s),t.forEach((function(t,n){let x,g,u;x=[].concat(e.chartData.yAxisData.ranges[t.index]),g=x.pop(),u=x.shift();let f=$(t.data,g,u,l,s,e,i,o);c.push(f);let y=G(f,t);for(let i=0;i1){let t=o[0],e=o[o.length-1];a.moveTo(t.x,t.y);let i=0;if("curve"===r.type)for(let r=0;rd&&(a.moveTo(t.x,t.y),i=1),r>0&&t.x>d&&t.xd&&(a.moveTo(t.x,t.y),i=1),r>0&&t.x>d&&t.xd&&(a.moveTo(t.x,t.y),i=1),r>0&&t.x>d&&t.xd&&(a.moveTo(i.x,i.y),t=1),e>0&&i.x>d&&i.xd&&(a.moveTo(i.x,i.y),t=1),e>0&&i.x>d&&i.xd&&(a.moveTo(i.x,i.y),t=1),e>0&&i.x>d&&i.x4&&void 0!==arguments[4]?arguments[4]:1,r=v({},{type:"area",activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!1,borderWidth:2,borderColor:"#FFFFFF",linearType:"none",customColor:[]},e.extra.rose);0==i.pieChartLinePadding&&(i.pieChartLinePadding=r.activeRadius*e.pix);var n={x:e.area[3]+(e.width-e.area[1]-e.area[3])/2,y:e.area[0]+(e.height-e.area[0]-e.area[2])/2},l=Math.min((e.width-e.area[1]-e.area[3])/2-i.pieChartLinePadding-i.pieChartTextPadding-i._pieTextMaxLength_,(e.height-e.area[0]-e.area[2])/2-i.pieChartLinePadding-i.pieChartTextPadding);l=l<10?10:l;var s=r.minRadius||.5*l;l4&&void 0!==arguments[4]?arguments[4]:1,l=v({},{startAngle:.75,endAngle:.25,type:"default",direction:"cw",lineCap:"round",width:12,gap:2,linearType:"none",customColor:[]},e.extra.arcbar);t=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;1==i&&(i=.999999);for(let a=0;a=2&&(r._proportion_=r._proportion_%2)}return t}(t,l,n),o=l.centerX||l.centerY?{x:l.centerX?l.centerX:e.width/2,y:l.centerY?l.centerY:e.height/2}:{x:e.width/2,y:e.height/2},l.radius?r=l.radius:(r=Math.min(o.x,o.y),r-=5*e.pix,r-=l.width/2),r=r<10?10:r,l.customColor=L(l.linearType,l.customColor,t,i);for(let c=0;c0&&void 0!==arguments[0]?arguments[0]:{};switch(this.opts=v({},this.opts,t),this.opts.updateData=!0,t.scrollPosition||"current"){case"current":this.opts._scrollDistance_=this.scrollOption.currentOffset;break;case"left":this.opts._scrollDistance_=0,this.scrollOption={currentOffset:0,startTouchX:0,distance:0,lastMoveTime:0};break;case"right":let t=et(this.opts.series,this.opts,this.config,this.context).yAxisWidth;this.config.yAxisWidth=t;let e=0,i=q(this.opts.categories,this.opts,this.config),a=i.xAxisPoints,o=i.startX;e=i.endX-o-i.eachSpacing*(a.length-1),this.scrollOption={currentOffset:e,startTouchX:e,distance:0,lastMoveTime:0},this.opts._scrollDistance_=e}Et.call(this,this.opts.type,this.opts,this.config,this.context)},Rt.prototype.zoom=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.opts.xAxis.itemCount;if(!0!==this.opts.enableScroll)return void console.log("[uCharts] 请启用滚动条后使用");let e=Math.round(Math.abs(this.scrollOption.currentOffset)/this.opts.chartData.eachSpacing)+Math.round(this.opts.xAxis.itemCount/2);this.opts.animation=!1,this.opts.xAxis.itemCount=t.itemCount;let i=et(this.opts.series,this.opts,this.config,this.context).yAxisWidth;this.config.yAxisWidth=i;let a=0,o=q(this.opts.categories,this.opts,this.config),r=o.xAxisPoints,n=o.startX,l=o.endX,s=o.eachSpacing,h=s*e,c=l-n,d=c-s*(r.length-1);a=c/2-h,a>0&&(a=0),a=this.opts.categories.length?this.opts.categories.length:n,this.opts.animation=!1,this.opts.xAxis.itemCount=n;let l=0,s=q(this.opts.categories,this.opts,this.config),h=s.xAxisPoints,c=s.startX,d=s.endX,p=s.eachSpacing,x=p*this.scrollOption.moveCurrent1,g=d-c-p*(h.length-1);l=-x+Math.min(a[0].x,a[1].x)-this.opts.area[3]-p,l>0&&(l=0),l2*Math.PI&&(t-=2*Math.PI),t},n=Math.atan2(e.center.y-t.y,t.x-e.center.x);(n*=-1)<0&&(n+=2*Math.PI),e.angleList.map((function(t){return r(-1*t)})).forEach((function(t,e){var i=r(t-a/2),l=r(t+a/2);l=i&&n<=l||n+2*Math.PI>=i&&n+2*Math.PI<=l)&&(o=e)}))}return o}({x:i.x,y:i.y},this.opts.chartData.radarData,this.opts.categories.length):"funnel"===this.opts.type?function(t,e){for(var i=-1,a=0,o=e.series.length;ar.funnelArea[0]&&t.xr.funnelArea[1]&&t.yr.area[0]&&t.xr.area[1]&&t.y4&&void 0!==arguments[4]?arguments[4]:0,r={index:-1,group:[]},n=i.chartData.eachSpacing/2;let l=i.chartData.yAxisPoints;return e&&e.length>0&&R(t,i)&&l.forEach((function(e,i){t.y+o+n>e&&(r.index=i)})),r}({x:i.x,y:i.y},this.opts.chartData.calPoints,this.opts,this.config,Math.abs(this.scrollOption.currentOffset)):function(t,e,i,a){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r={index:-1,group:[]},n=i.chartData.eachSpacing/2;let l=[];if(e&&e.length>0){if(i.categories){for(let t=1;te&&(r.index=i)}));else{let i=Array(e.length);for(let r=0;re.start.x&&t.xe.start.y&&t.ya[0]-0&&t.xa[1]-0&&t.y1&&void 0!==arguments[1]?arguments[1]:{},i=null;if(i=t.changedTouches?t.changedTouches[0]:t.mp.changedTouches[0]){O(i,this.opts,t);var a=this.getLegendDataIndex(t);a>=0&&("candle"==this.opts.type?this.opts.seriesMA[a].show=!this.opts.seriesMA[a].show:this.opts.series[a].show=!this.opts.series[a].show,this.opts.animation=!!e.animation,this.opts._scrollDistance_=this.scrollOption.currentOffset,Et.call(this,this.opts.type,this.opts,this.config,this.context))}},Rt.prototype.showToolTip=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;(i=t.changedTouches?t.changedTouches[0]:t.mp.changedTouches[0])||console.log("[uCharts] 未获取到event坐标信息");var a=O(i,this.opts,t),o=this.scrollOption.currentOffset,r=v({},this.opts,{_scrollDistance_:o,animation:!1});if("line"===this.opts.type||"area"===this.opts.type||"column"===this.opts.type||"scatter"===this.opts.type||"bubble"===this.opts.type){var n=this.getCurrentDataIndex(t);if((p=null==e.index?n.index:e.index)>-1||p.length>0)if(0!==(s=z(this.opts.series,p,n.group)).length){var l=(d=E(s,this.opts,p,n.group,this.opts.categories,e)).textList;(h=d.offset).y=a.y,r.tooltip={textList:void 0!==e.textList?e.textList:l,offset:void 0!==e.offset?e.offset:h,option:e,index:p,group:n.group}}Et.call(this,r.type,r,this.config,this.context)}if("mount"===this.opts.type){if((p=null==e.index?this.getCurrentDataIndex(t).index:e.index)>-1){r=v({},this.opts,{animation:!1});var s=v({},r._series_[p]),h=(l=[{text:e.formatter?e.formatter(s,void 0,p,r):s.name+": "+s.data,color:s.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?s.legendShape:this.opts.extra.tooltip.legendShape}],{x:r.chartData.calPoints[p].x,y:a.y});r.tooltip={textList:e.textList?e.textList:l,offset:void 0!==e.offset?e.offset:h,option:e,index:p}}Et.call(this,r.type,r,this.config,this.context)}if("bar"===this.opts.type){n=this.getCurrentDataIndex(t);if((p=null==e.index?n.index:e.index)>-1||p.length>0)if(0!==(s=z(this.opts.series,p,n.group)).length){l=(d=E(s,this.opts,p,n.group,this.opts.categories,e)).textList;(h=d.offset).x=a.x,r.tooltip={textList:void 0!==e.textList?e.textList:l,offset:void 0!==e.offset?e.offset:h,option:e,index:p}}Et.call(this,r.type,r,this.config,this.context)}if("mix"===this.opts.type){n=this.getCurrentDataIndex(t);if((p=null==e.index?n.index:e.index)>-1){o=this.scrollOption.currentOffset,r=v({},this.opts,{_scrollDistance_:o,animation:!1});if(0!==(s=z(this.opts.series,p)).length){var c=function(t,e,i,a){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},r=e.chartData.xAxisPoints[i]+e.chartData.eachSpacing/2,n=t.map((function(t){return{text:o.formatter?o.formatter(t,a[i],i,e):t.name+": "+t.data,color:t.color,disableLegend:!!t.disableLegend,legendShape:"auto"==e.extra.tooltip.legendShape?t.legendShape:e.extra.tooltip.legendShape}}));return{textList:n=n.filter((function(t){if(!0!==t.disableLegend)return t})),offset:{x:Math.round(r),y:0}}}(s,this.opts,p,this.opts.categories,e);l=c.textList;(h=c.offset).y=a.y,r.tooltip={textList:e.textList?e.textList:l,offset:void 0!==e.offset?e.offset:h,option:e,index:p}}}Et.call(this,r.type,r,this.config,this.context)}if("candle"===this.opts.type){n=this.getCurrentDataIndex(t);if((p=null==e.index?n.index:e.index)>-1){o=this.scrollOption.currentOffset,r=v({},this.opts,{_scrollDistance_:o,animation:!1});if(0!==(s=z(this.opts.series,p)).length){var d=function(t,e,i,a,o,r){var n=i.chartData.calPoints;let l=r.color.upFill,s=r.color.downFill,h=[l,l,s,l];var c=[];e.map((function(e){0==a?e.data[1]-e.data[0]<0?h[1]=s:h[1]=l:(e.data[0]t[a-1][1]&&(h[2]=l),e.data[3]-1){r=v({},this.opts,{animation:!1}),s=v({},r._series_[p]),l=[{text:e.formatter?e.formatter(s,void 0,p,r):s.name+": "+s.data,color:s.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?s.legendShape:this.opts.extra.tooltip.legendShape}],h={x:a.x,y:a.y};r.tooltip={textList:e.textList?e.textList:l,offset:void 0!==e.offset?e.offset:h,option:e,index:p}}Et.call(this,r.type,r,this.config,this.context)}if("map"===this.opts.type){if((p=null==e.index?this.getCurrentDataIndex(t):e.index)>-1){r=v({},this.opts,{animation:!1});(s=v({},this.opts.series[p])).name=s.properties.name;l=[{text:e.formatter?e.formatter(s,void 0,p,this.opts):s.name,color:s.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?s.legendShape:this.opts.extra.tooltip.legendShape}],h={x:a.x,y:a.y};r.tooltip={textList:e.textList?e.textList:l,offset:void 0!==e.offset?e.offset:h,option:e,index:p}}r.updateData=!1,Et.call(this,r.type,r,this.config,this.context)}if("word"===this.opts.type){if((p=null==e.index?this.getCurrentDataIndex(t):e.index)>-1){r=v({},this.opts,{animation:!1}),s=v({},this.opts.series[p]),l=[{text:e.formatter?e.formatter(s,void 0,p,this.opts):s.name,color:s.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?s.legendShape:this.opts.extra.tooltip.legendShape}],h={x:a.x,y:a.y};r.tooltip={textList:e.textList?e.textList:l,offset:void 0!==e.offset?e.offset:h,option:e,index:p}}r.updateData=!1,Et.call(this,r.type,r,this.config,this.context)}if("radar"===this.opts.type){var p;if((p=null==e.index?this.getCurrentDataIndex(t):e.index)>-1){r=v({},this.opts,{animation:!1});if(0!==(s=z(this.opts.series,p)).length){l=s.map((t=>({text:e.formatter?e.formatter(t,this.opts.categories[p],p,this.opts):t.name+": "+t.data,color:t.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?t.legendShape:this.opts.extra.tooltip.legendShape}))),h={x:a.x,y:a.y};r.tooltip={textList:e.textList?e.textList:l,offset:void 0!==e.offset?e.offset:h,option:e,index:p}}}Et.call(this,r.type,r,this.config,this.context)}},Rt.prototype.translate=function(t){this.scrollOption={currentOffset:t,startTouchX:t,distance:0,lastMoveTime:0};let e=v({},this.opts,{_scrollDistance_:t,animation:!1});Et.call(this,this.opts.type,e,this.config,this.context)},Rt.prototype.scrollStart=function(t){var e=null,i=O(e=t.changedTouches?t.changedTouches[0]:t.mp.changedTouches[0],this.opts,t);e&&!0===this.opts.enableScroll&&(this.scrollOption.startTouchX=i.x)},Rt.prototype.scroll=function(t){0===this.scrollOption.lastMoveTime&&(this.scrollOption.lastMoveTime=Date.now());let e=this.opts.touchMoveLimit||60,i=Date.now();if(!(i-this.scrollOption.lastMoveTime{var i=new Date;i.setTime(1e3*t);var a=i.getFullYear(),o=i.getMonth()+1;o=o<10?"0"+o:o;var r=i.getDate();r=r<10?"0"+r:r;var n=i.getHours();n=n<10?"0"+n:n;var l=i.getMinutes(),s=i.getSeconds();return l=l<10?"0"+l:l,s=s<10?"0"+s:s,"full"==e?a+"-"+o+"-"+r+" "+n+":"+l+":"+s:"y-m-d"==e?a+"-"+o+"-"+r:"h:m"==e?n+":"+l:"h:m:s"==e?n+":"+l+":"+s:[a,o,r,n,l,s]})(t,"h:m")},seriesDemo1:function(t,e,i,a){return t+"元"},tooltipDemo1:function(t,e,i,a){return 0==i?"随便用"+t.data+"年":"其他我没改"+t.data+"天"},pieDemo:function(t,e,i,a){if(void 0!==e)return i[e].name+":"+i[e].data+"元"}},demotype:{type:"line",color:Bt,padding:[15,10,0,15],xAxis:{disableGrid:!0},yAxis:{gridType:"dash",dashLength:2},legend:{},extra:{line:{type:"curve",width:2}}},pie:{type:"pie",color:Bt,padding:[5,5,5,5],extra:{pie:{activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!0,borderWidth:3,borderColor:"#FFFFFF"}}},ring:{type:"ring",color:Bt,padding:[5,5,5,5],rotate:!1,dataLabel:!0,legend:{show:!0,position:"right",lineHeight:25},title:{name:"收益率",fontSize:15,color:"#666666"},subtitle:{name:"70%",fontSize:25,color:"#7cb5ec"},extra:{ring:{ringWidth:30,activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!0,borderWidth:3,borderColor:"#FFFFFF"}}},rose:{type:"rose",color:Bt,padding:[5,5,5,5],legend:{show:!0,position:"left",lineHeight:25},extra:{rose:{type:"area",minRadius:50,activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!1,borderWidth:2,borderColor:"#FFFFFF"}}},word:{type:"word",color:Bt,extra:{word:{type:"normal",autoColors:!1}}},funnel:{type:"funnel",color:Bt,padding:[15,15,0,15],extra:{funnel:{activeOpacity:.3,activeWidth:10,border:!0,borderWidth:2,borderColor:"#FFFFFF",fillOpacity:1,labelAlign:"right"}}},map:{type:"map",color:Bt,padding:[0,0,0,0],dataLabel:!0,extra:{map:{border:!0,borderWidth:1,borderColor:"#666666",fillOpacity:.6,activeBorderColor:"#F04864",activeFillColor:"#FACC14",activeFillOpacity:1}}},arcbar:{type:"arcbar",color:Bt,title:{name:"百分比",fontSize:25,color:"#00FF00"},subtitle:{name:"默认标题",fontSize:15,color:"#666666"},extra:{arcbar:{type:"default",width:12,backgroundColor:"#E9E9E9",startAngle:.75,endAngle:.25,gap:2}}},line:{type:"line",color:Bt,padding:[15,10,0,15],xAxis:{disableGrid:!0},yAxis:{gridType:"dash",dashLength:2},legend:{},extra:{line:{type:"straight",width:2,activeType:"hollow"}}},tline:{type:"line",color:Bt,padding:[15,10,0,15],xAxis:{disableGrid:!1,boundaryGap:"justify"},yAxis:{gridType:"dash",dashLength:2,data:[{min:0,max:80}]},legend:{},extra:{line:{type:"curve",width:2,activeType:"hollow"}}},tarea:{type:"area",color:Bt,padding:[15,10,0,15],xAxis:{disableGrid:!0,boundaryGap:"justify"},yAxis:{gridType:"dash",dashLength:2,data:[{min:0,max:80}]},legend:{},extra:{area:{type:"curve",opacity:.2,addLine:!0,width:2,gradient:!0,activeType:"hollow"}}},column:{type:"column",color:Bt,padding:[15,15,0,5],xAxis:{disableGrid:!0},yAxis:{data:[{min:0}]},legend:{},extra:{column:{type:"group",width:30,activeBgColor:"#000000",activeBgOpacity:.08}}},mount:{type:"mount",color:Bt,padding:[15,15,0,5],xAxis:{disableGrid:!0},yAxis:{data:[{min:0}]},legend:{},extra:{mount:{type:"mount",widthRatio:1.5}}},bar:{type:"bar",color:Bt,padding:[15,30,0,5],xAxis:{boundaryGap:"justify",disableGrid:!1,min:0,axisLine:!1},yAxis:{},legend:{},extra:{bar:{type:"group",width:30,meterBorde:1,meterFillColor:"#FFFFFF",activeBgColor:"#000000",activeBgOpacity:.08}}},area:{type:"area",color:Bt,padding:[15,15,0,15],xAxis:{disableGrid:!0},yAxis:{gridType:"dash",dashLength:2},legend:{},extra:{area:{type:"straight",opacity:.2,addLine:!0,width:2,gradient:!1,activeType:"hollow"}}},radar:{type:"radar",color:Bt,padding:[5,5,5,5],dataLabel:!1,legend:{show:!0,position:"right",lineHeight:25},extra:{radar:{gridType:"radar",gridColor:"#CCCCCC",gridCount:3,opacity:.2,max:200,labelShow:!0}}},gauge:{type:"gauge",color:Bt,title:{name:"66Km/H",fontSize:25,color:"#2fc25b",offsetY:50},subtitle:{name:"实时速度",fontSize:15,color:"#1890ff",offsetY:-50},extra:{gauge:{type:"default",width:30,labelColor:"#666666",startAngle:.75,endAngle:.25,startNumber:0,endNumber:100,labelFormat:"",splitLine:{fixRadius:0,splitNumber:10,width:30,color:"#FFFFFF",childNumber:5,childWidth:12},pointer:{width:24,color:"auto"}}}},candle:{type:"candle",color:Bt,padding:[15,15,0,15],enableScroll:!0,enableMarkLine:!0,dataLabel:!1,xAxis:{labelCount:4,itemCount:40,disableGrid:!0,gridColor:"#CCCCCC",gridType:"solid",dashLength:4,scrollShow:!0,scrollAlign:"left",scrollColor:"#A6A6A6",scrollBackgroundColor:"#EFEBEF"},yAxis:{},legend:{},extra:{candle:{color:{upLine:"#f04864",upFill:"#f04864",downLine:"#2fc25b",downFill:"#2fc25b"},average:{show:!0,name:["MA5","MA10","MA30"],day:[5,10,20],color:["#1890ff","#2fc25b","#facc14"]}},markLine:{type:"dash",dashLength:5,data:[{value:2150,lineColor:"#f04864",showLabel:!0},{value:2350,lineColor:"#f04864",showLabel:!0}]}}},mix:{type:"mix",color:Bt,padding:[15,15,0,15],xAxis:{disableGrid:!0},yAxis:{disabled:!1,disableGrid:!1,splitNumber:5,gridType:"dash",dashLength:4,gridColor:"#CCCCCC",padding:10,showTitle:!0,data:[]},legend:{},extra:{mix:{column:{width:20}}}},scatter:{type:"scatter",color:Bt,padding:[15,15,0,15],dataLabel:!1,xAxis:{disableGrid:!1,gridType:"dash",splitNumber:5,boundaryGap:"justify",min:0},yAxis:{disableGrid:!1,gridType:"dash"},legend:{},extra:{scatter:{}}},bubble:{type:"bubble",color:Bt,padding:[15,15,0,15],xAxis:{disableGrid:!1,gridType:"dash",splitNumber:5,boundaryGap:"justify",min:0,max:250},yAxis:{disableGrid:!1,gridType:"dash",data:[{min:0,max:150}]},legend:{},extra:{bubble:{border:2,opacity:.5}}}},Nt=["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],jt={type:["pie","ring","rose","funnel","line","column","area","radar","gauge","candle","demotype"],categories:["line","column","area","radar","gauge","candle","demotype"],instance:{},option:{},formatter:{tooltipDemo1:function(t){let e="";for(let i in t){0==i&&(e+=t[i].axisValueLabel+"年销售额");let a="--";null!==t[i].data&&(a=t[i].data),e+="\n"+t[i].seriesName+":"+a+" 万元"}return e},legendFormat:function(t){return"自定义图例+"+t},yAxisFormatDemo:function(t,e){return t+"元"},seriesFormatDemo:function(t){return t.name+"年"+t.value+"元"}},demotype:{color:Nt},column:{color:Nt,title:{text:""},tooltip:{trigger:"axis"},grid:{top:30,bottom:50,right:15,left:40},legend:{bottom:"left"},toolbox:{show:!1},xAxis:{type:"category",axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}},boundaryGap:!0,data:[]},yAxis:{type:"value",axisTick:{show:!1},axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}}},seriesTemplate:{name:"",type:"bar",data:[],barwidth:20,label:{show:!0,color:"#666666",position:"top"}}},line:{color:Nt,title:{text:""},tooltip:{trigger:"axis"},grid:{top:30,bottom:50,right:15,left:40},legend:{bottom:"left"},toolbox:{show:!1},xAxis:{type:"category",axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}},boundaryGap:!0,data:[]},yAxis:{type:"value",axisTick:{show:!1},axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}}},seriesTemplate:{name:"",type:"line",data:[],barwidth:20,label:{show:!0,color:"#666666",position:"top"}}},area:{color:Nt,title:{text:""},tooltip:{trigger:"axis"},grid:{top:30,bottom:50,right:15,left:40},legend:{bottom:"left"},toolbox:{show:!1},xAxis:{type:"category",axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}},boundaryGap:!0,data:[]},yAxis:{type:"value",axisTick:{show:!1},axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}}},seriesTemplate:{name:"",type:"line",data:[],areaStyle:{},label:{show:!0,color:"#666666",position:"top"}}},pie:{color:Nt,title:{text:""},tooltip:{trigger:"item"},grid:{top:40,bottom:30,right:15,left:15},legend:{bottom:"left"},seriesTemplate:{name:"",type:"pie",data:[],radius:"50%",label:{show:!0,color:"#666666",position:"top"}}},ring:{color:Nt,title:{text:""},tooltip:{trigger:"item"},grid:{top:40,bottom:30,right:15,left:15},legend:{bottom:"left"},seriesTemplate:{name:"",type:"pie",data:[],radius:["40%","70%"],avoidLabelOverlap:!1,label:{show:!0,color:"#666666",position:"top"},labelLine:{show:!0}}},rose:{color:Nt,title:{text:""},tooltip:{trigger:"item"},legend:{top:"bottom"},seriesTemplate:{name:"",type:"pie",data:[],radius:"55%",center:["50%","50%"],roseType:"area"}},funnel:{color:Nt,title:{text:""},tooltip:{trigger:"item",formatter:"{b} : {c}%"},legend:{top:"bottom"},seriesTemplate:{name:"",type:"funnel",left:"10%",top:60,bottom:60,width:"80%",min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:2,label:{show:!0,position:"inside"},labelLine:{length:10,lineStyle:{width:1,type:"solid"}},itemStyle:{bordercolor:"#fff",borderwidth:1},emphasis:{label:{fontSize:20}},data:[]}},gauge:{color:Nt,tooltip:{formatter:"{a}
{b} : {c}%"},seriesTemplate:{name:"业务指标",type:"gauge",detail:{formatter:"{value}%"},data:[{value:50,name:"完成率"}]}},candle:{xAxis:{data:[]},yAxis:{},color:Nt,title:{text:""},dataZoom:[{type:"inside",xAxisIndex:[0,1],start:10,end:100},{show:!0,xAxisIndex:[0,1],type:"slider",bottom:10,start:10,end:100}],seriesTemplate:{name:"",type:"k",data:[]}}};var Xt={},Ht=null;function Jt(t={},...e){for(let i in e)for(let a in e[i])e[i].hasOwnProperty(a)&&(t[a]=e[i][a]&&"object"==typeof e[i][a]?Jt(Array.isArray(e[i][a])?[]:{},t[a],e[i][a]):e[i][a]);return t}function Yt(t,e){for(let i in t)t.hasOwnProperty(i)&&null!==t[i]&&"object"==typeof t[i]?Yt(t[i],e):"format"===i&&"string"==typeof t[i]&&(t.formatter=e[t[i]]?e[t[i]]:void 0);return t}const qt={data:()=>({rid:null}),mounted(){Ht={top:0,left:0};let t=document.querySelectorAll("uni-main")[0];void 0===t&&(t=document.querySelectorAll("uni-page-wrapper")[0]),Ht={top:t.offsetTop,left:t.offsetLeft},setTimeout((()=>{null===this.rid&&this.$ownerInstance&&this.$ownerInstance.callMethod("getRenderType")}),200)},destroyed(){delete Gt.option[this.rid],delete Gt.instance[this.rid],delete jt.option[this.rid],delete jt.instance[this.rid]},methods:{ecinit(t,e,i,a){let o=JSON.stringify(t.id);this.rid=o,Xt[o]=this.$ownerInstance||a;let r=JSON.parse(JSON.stringify(t)),n=r.type;n&&jt.type.includes(n)?jt.option[o]=Jt({},jt[n],r):jt.option[o]=Jt({},r);let l=r.chartData;if(l){jt.option[o].xAxis&&jt.option[o].xAxis.type&&"category"===jt.option[o].xAxis.type&&(jt.option[o].xAxis.data=l.categories),jt.option[o].yAxis&&jt.option[o].yAxis.type&&"category"===jt.option[o].yAxis.type&&(jt.option[o].yAxis.data=l.categories),jt.option[o].series=[];for(var s=0;s{let i=JSON.parse(JSON.stringify({x:e.event.offsetX,y:e.event.offsetY}));Xt[t].callMethod("emitMsg",{name:"getIndex",params:{type:"getIndex",event:i,currentIndex:e.dataIndex,value:e.data,seriesName:e.seriesName,id:t}})})),jt.instance[t].on("highlight",(e=>{Xt[t].callMethod("emitMsg",{name:"getHighlight",params:{type:"highlight",res:e,id:t}})}))),this.updataEChart(t,jt.option[t])):this.updataEChart(t,jt.option[t])},updataEChart(t,e){if((e=Yt(e,jt.formatter)).tooltip&&(e.tooltip.show=!!e.tooltipShow,e.tooltip.position=this.tooltipPosition(),"string"==typeof e.tooltipFormat&&jt.formatter[e.tooltipFormat]&&(e.tooltip.formatter=e.tooltip.formatter?e.tooltip.formatter:jt.formatter[e.tooltipFormat])),e.series)for(let i in e.series){let t=e.series[i].linearGradient;t&&(e.series[i].color=new echarts.graphic.LinearGradient(t[0],t[1],t[2],t[3],t[4]))}jt.instance[t].setOption(e,e.notMerge),jt.instance[t].on("finished",(function(){Xt[t].callMethod("emitMsg",{name:"complete",params:{type:"complete",complete:!0,id:t}}),jt.instance[t]&&jt.instance[t].off("finished")})),void 0!==Xt[t].$el.children[0].clientWidth&&(Math.abs(Xt[t].$el.children[0].clientWidth-jt.instance[t].getWidth())>3||Math.abs(Xt[t].$el.children[0].clientHeight-jt.instance[t].getHeight())>3)&&this.ecresize()},tooltipPosition:()=>(t,e,i,a,o)=>{let r=t[0],n=t[1],l=o.viewSize[0],s=o.viewSize[1],h=o.contentSize[0],c=o.contentSize[1],d=r+30,p=n+30;return d+h>l&&(d=r-h-30),p+c>s&&(p=n-c-30),[d,p]},ucinit(t,e,i,a){if(JSON.stringify(t)==JSON.stringify(e))return;if(!t.canvasId)return;let o=JSON.parse(JSON.stringify(t.canvasId));this.rid=o,Xt[o]=this.$ownerInstance||a,Gt.option[o]=JSON.parse(JSON.stringify(t)),Gt.option[o]=Yt(Gt.option[o],Gt.formatter);let r=document.getElementById(o);r&&r.children[0]&&(Gt.option[o].context=r.children[0].getContext("2d"),Gt.instance[o]&&Gt.option[o]&&!0===Gt.option[o].update?this.updataUChart():setTimeout((()=>{Gt.option[o].context.restore(),Gt.option[o].context.save(),this.newUChart()}),100))},newUChart(){let t=this.rid;Gt.instance[t]=new Rt(Gt.option[t]),Gt.instance[t].addEventListener("renderComplete",(()=>{Xt[t].callMethod("emitMsg",{name:"complete",params:{type:"complete",complete:!0,id:t,opts:Gt.instance[t].opts}}),Gt.instance[t].delEventListener("renderComplete")})),Gt.instance[t].addEventListener("scrollLeft",(()=>{Xt[t].callMethod("emitMsg",{name:"scrollLeft",params:{type:"scrollLeft",scrollLeft:!0,id:t,opts:Gt.instance[t].opts}})})),Gt.instance[t].addEventListener("scrollRight",(()=>{Xt[t].callMethod("emitMsg",{name:"scrollRight",params:{type:"scrollRight",scrollRight:!0,id:t,opts:Gt.instance[t].opts}})}))},updataUChart(){let t=this.rid;Gt.instance[t].updateData(Gt.option[t])},tooltipDefault(t,e,i,a){if(e){let i=t.data;return"object"==typeof t.data&&(i=t.data.value),e+" "+t.name+":"+i}return t.properties&&t.properties.name?t.properties.name:t.name+":"+t.data},showTooltip(t,e){let i=Gt.option[e].tooltipCustom;if(i&&null!=i){let a;i.x>=0&&i.y>=0&&(a={x:i.x,y:i.y+10}),Gt.instance[e].showToolTip(t,{index:i.index,offset:a,textList:i.textList,formatter:(t,i,a,o)=>"string"==typeof Gt.option[e].tooltipFormat&&Gt.formatter[Gt.option[e].tooltipFormat]?Gt.formatter[Gt.option[e].tooltipFormat](t,i,a,o):this.tooltipDefault(t,i,a,o)})}else Gt.instance[e].showToolTip(t,{formatter:(t,i,a,o)=>"string"==typeof Gt.option[e].tooltipFormat&&Gt.formatter[Gt.option[e].tooltipFormat]?Gt.formatter[Gt.option[e].tooltipFormat](t,i,a,o):this.tooltipDefault(t,i,a,o)})},tap(t){let e=this.rid,i=Gt.option[e].ontap,a=Gt.option[e].tooltipShow,o=Gt.option[e].tapLegend;if(0==i)return;let r=null,n=null,l=document.getElementById("UC"+e).getBoundingClientRect(),s={};s=t.detail.x?{x:t.detail.x-l.left,y:t.detail.y-l.top+Ht.top}:{x:t.clientX-l.left,y:t.clientY-l.top+Ht.top},t.changedTouches=[],t.changedTouches.unshift(s),r=Gt.instance[e].getCurrentDataIndex(t),n=Gt.instance[e].getLegendDataIndex(t),!0===o&&Gt.instance[e].touchLegend(t),1==a&&this.showTooltip(t,e),Xt[e].callMethod("emitMsg",{name:"getIndex",params:{type:"getIndex",event:s,currentIndex:r,legendIndex:n,id:e,opts:Gt.instance[e].opts}})},touchStart(t){let e=this.rid;0!=Gt.option[e].ontouch&&(!0===Gt.option[e].enableScroll&&1==t.touches.length&&Gt.instance[e].scrollStart(t),Xt[e].callMethod("emitMsg",{name:"getTouchStart",params:{type:"touchStart",event:t.changedTouches[0],id:e,opts:Gt.instance[e].opts}}))},touchMove(t){let e=this.rid,i=Gt.option[e].ontouch;if(0!=i){if(!0===Gt.option[e].enableScroll&&1==t.changedTouches.length&&Gt.instance[e].scroll(t),!0===Gt.option[e].ontap&&!1===Gt.option[e].enableScroll&&!0===Gt.option[e].onmovetip){let i=document.getElementById("UC"+e).getBoundingClientRect(),a={x:t.changedTouches[0].clientX-i.left,y:t.changedTouches[0].clientY-i.top+Ht.top};t.changedTouches.unshift(a),!0===Gt.option[e].tooltipShow&&this.showTooltip(t,e)}!0===i&&!0===Gt.option[e].enableScroll&&!0===Gt.option[e].onzoom&&2==t.changedTouches.length&&Gt.instance[e].dobuleZoom(t),Xt[e].callMethod("emitMsg",{name:"getTouchMove",params:{type:"touchMove",event:t.changedTouches[0],id:e,opts:Gt.instance[e].opts}})}},touchEnd(t){let e=this.rid;0!=Gt.option[e].ontouch&&(!0===Gt.option[e].enableScroll&&0==t.touches.length&&Gt.instance[e].scrollEnd(t),Xt[e].callMethod("emitMsg",{name:"getTouchEnd",params:{type:"touchEnd",event:t.changedTouches[0],id:e,opts:Gt.instance[e].opts}}))},mouseDown(t){let e=this.rid;if(0==Gt.option[e].onmouse)return;let i=document.getElementById("UC"+e).getBoundingClientRect(),a={};a={x:t.clientX-i.left,y:t.clientY-i.top+Ht.top},t.changedTouches=[],t.changedTouches.unshift(a),Gt.instance[e].scrollStart(t),Gt.option[e].mousedown=!0,Xt[e].callMethod("emitMsg",{name:"getTouchStart",params:{type:"mouseDown",event:a,id:e,opts:Gt.instance[e].opts}})},mouseMove(t){let e=this.rid,i=Gt.option[e].onmouse,a=Gt.option[e].tooltipShow;if(0==i)return;let o=document.getElementById("UC"+e).getBoundingClientRect(),r={};r={x:t.clientX-o.left,y:t.clientY-o.top+Ht.top},t.changedTouches=[],t.changedTouches.unshift(r),Gt.option[e].mousedown?(Gt.instance[e].scroll(t),Xt[e].callMethod("emitMsg",{name:"getTouchMove",params:{type:"mouseMove",event:r,id:e,opts:Gt.instance[e].opts}})):Gt.instance[e]&&1==a&&this.showTooltip(t,e)},mouseUp(t){let e=this.rid;if(0==Gt.option[e].onmouse)return;let i=document.getElementById("UC"+e).getBoundingClientRect(),a={};a={x:t.clientX-i.left,y:t.clientY-i.top+Ht.top},t.changedTouches=[],t.changedTouches.unshift(a),Gt.instance[e].scrollEnd(t),Gt.option[e].mousedown=!1,Xt[e].callMethod("emitMsg",{name:"getTouchEnd",params:{type:"mouseUp",event:a,id:e,opts:Gt.instance[e].opts}})}}},$t=t=>{t.$renderjs||(t.$renderjs=[]),t.$renderjs.push("rdcharts"),t.mixins||(t.mixins=[]),t.mixins.push({beforeCreate(){this.rdcharts=this},mounted(){this.$ownerInstance=this.$gcd(this,!0)}}),t.mixins.push(qt)};function Ut(t={},...e){for(let i in e)for(let a in e[i])e[i].hasOwnProperty(a)&&(t[a]=e[i][a]&&"object"==typeof e[i][a]?Ut(Array.isArray(e[i][a])?[]:{},t[a],e[i][a]):e[i][a]);return t}function Zt(t,e){for(let i in t)t.hasOwnProperty(i)&&null!==t[i]&&"object"==typeof t[i]?Zt(t[i],e):"format"===i&&"string"==typeof t[i]&&(t.formatter=e[t[i]]?e[t[i]]:void 0);return t}const Qt={name:"qiun-data-charts",mixins:[t.mixinDatacom],props:{type:{type:String,default:null},canvasId:{type:String,default:"uchartsid"},canvas2d:{type:Boolean,default:!1},background:{type:String,default:"rgba(0,0,0,0)"},animation:{type:Boolean,default:!0},chartData:{type:Object,default:()=>({categories:[],series:[]})},opts:{type:Object,default:()=>({})},eopts:{type:Object,default:()=>({})},loadingType:{type:Number,default:2},errorShow:{type:Boolean,default:!0},errorReload:{type:Boolean,default:!0},errorMessage:{type:String,default:null},inScrollView:{type:Boolean,default:!1},reshow:{type:Boolean,default:!1},reload:{type:Boolean,default:!1},disableScroll:{type:Boolean,default:!1},optsWatch:{type:Boolean,default:!0},onzoom:{type:Boolean,default:!1},ontap:{type:Boolean,default:!0},ontouch:{type:Boolean,default:!1},onmouse:{type:Boolean,default:!0},onmovetip:{type:Boolean,default:!1},echartsH5:{type:Boolean,default:!1},echartsApp:{type:Boolean,default:!1},tooltipShow:{type:Boolean,default:!0},tooltipFormat:{type:String,default:void 0},tooltipCustom:{type:Object,default:void 0},startDate:{type:String,default:void 0},endDate:{type:String,default:void 0},textEnum:{type:Array,default:()=>[]},groupEnum:{type:Array,default:()=>[]},pageScrollTop:{type:Number,default:0},directory:{type:String,default:"/"},tapLegend:{type:Boolean,default:!0},menus:{type:Array,default:()=>[]}},data:()=>({cid:"uchartsid",inWx:!1,inAli:!1,inTt:!1,inBd:!1,inH5:!1,inApp:!1,inWin:!1,type2d:!0,disScroll:!1,openmouse:!1,pixel:1,cWidth:375,cHeight:250,showchart:!1,echarts:!1,echartsResize:{state:!1},uchartsOpts:{},echartsOpts:{},drawData:{},lastDrawTime:null}),created(){if(this.cid=this.canvasId,"uchartsid"==this.canvasId||""==this.canvasId){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",e=t.length,i="";for(let a=0;a<32;a++)i+=t.charAt(Math.floor(Math.random()*e));this.cid=i}const t=uni.getSystemInfoSync();"windows"!==t.platform&&"mac"!==t.platform||(this.inWin=!0),this.type2d=!1,this.disScroll=this.disableScroll},mounted(){this.inH5=!0,!0===this.inWin&&(this.openmouse=this.onmouse),!0===this.echartsH5&&(this.echarts=!0),this.$nextTick((()=>{this.beforeInit()}));const t=this.inH5?500:200,e=this;uni.onWindowResize(function(t,e){let i=!1;return function(){clearTimeout(i),i&&clearTimeout(i),i=setTimeout((()=>{i=!1,t.apply(this,arguments)}),e)}}((function(t){if(1==e.mixinDatacomLoading)return;let i=e.mixinDatacomErrorMessage;null!==i&&"null"!==i&&""!==i||(e.echarts?e.echartsResize.state=!e.echartsResize.state:e.resizeHandler())}),t))},destroyed(){!0===this.echarts?(delete jt.option[this.cid],delete jt.instance[this.cid]):(delete Gt.option[this.cid],delete Gt.instance[this.cid]),uni.offWindowResize((()=>{}))},watch:{chartDataProps:{handler(t,e){"object"==typeof t?JSON.stringify(t)!==JSON.stringify(e)&&(this._clearChart(),t.series&&t.series.length>0?this.beforeInit():(this.mixinDatacomLoading=!0,this.showchart=!1,this.mixinDatacomErrorMessage=null)):(this.mixinDatacomLoading=!1,this._clearChart(),this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:chartData数据类型错误")},immediate:!1,deep:!0},localdata:{handler(t,e){JSON.stringify(t)!==JSON.stringify(e)&&(t.length>0?this.beforeInit():(this.mixinDatacomLoading=!0,this._clearChart(),this.showchart=!1,this.mixinDatacomErrorMessage=null))},immediate:!1,deep:!0},optsProps:{handler(t,e){"object"==typeof t?JSON.stringify(t)!==JSON.stringify(e)&&!1===this.echarts&&1==this.optsWatch&&this.checkData(this.drawData):(this.mixinDatacomLoading=!1,this._clearChart(),this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:opts数据类型错误")},immediate:!1,deep:!0},eoptsProps:{handler(t,e){"object"==typeof t?JSON.stringify(t)!==JSON.stringify(e)&&!0===this.echarts&&this.checkData(this.drawData):(this.mixinDatacomLoading=!1,this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:eopts数据类型错误")},immediate:!1,deep:!0},reshow(t,e){!0===t&&!1===this.mixinDatacomLoading&&setTimeout((()=>{this.mixinDatacomErrorMessage=null,this.echartsResize.state=!this.echartsResize.state,this.checkData(this.drawData)}),200)},reload(t,e){!0===t&&(this.showchart=!1,this.mixinDatacomErrorMessage=null,this.reloading())},mixinDatacomErrorMessage(t,e){t&&(this.emitMsg({name:"error",params:{type:"error",errorShow:this.errorShow,msg:t,id:this.cid}}),this.errorShow&&console.log("[秋云图表组件]"+t))},errorMessage(t,e){t&&this.errorShow&&null!==t&&"null"!==t&&""!==t?(this.showchart=!1,this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=t):(this.showchart=!1,this.mixinDatacomErrorMessage=null,this.reloading())}},computed:{optsProps(){return JSON.parse(JSON.stringify(this.opts))},eoptsProps(){return JSON.parse(JSON.stringify(this.eopts))},chartDataProps(){return JSON.parse(JSON.stringify(this.chartData))}},methods:{beforeInit(){this.mixinDatacomErrorMessage=null,"object"==typeof this.chartData&&null!=this.chartData&&void 0!==this.chartData.series&&this.chartData.series.length>0?(this.drawData=Ut({},this.chartData),this.mixinDatacomLoading=!1,this.showchart=!0,this.checkData(this.chartData)):this.localdata.length>0?(this.mixinDatacomLoading=!1,this.showchart=!0,this.localdataInit(this.localdata)):""!==this.collection?(this.mixinDatacomLoading=!1,this.getCloudData()):this.mixinDatacomLoading=!0},localdataInit(t){if(this.groupEnum.length>0)for(let c=0;c0)for(let c=0;c0)a=this.chartData.categories;else if(this.startDate&&this.endDate){let t=new Date(this.startDate),e=new Date(this.endDate);for(;t<=e;)a.push((n=void 0,l=void 0,s=void 0,n=(r=t).getFullYear(),l=r.getMonth()+1,s=r.getDate(),l>=1&&l<=9&&(l="0"+l),s>=0&&s<=9&&(s="0"+s),n+"-"+l+"-"+s)),t=t.setDate(t.getDate()+1),t=new Date(t)}else{let e={};t.map((function(t,i){null==t.text||e[t.text]||(a.push(t.text),e[t.text]=!0)}))}i.categories=a}var r,n,l,s;let h={};if(t.map((function(t,e){null==t.group||h[t.group]||(o.push({name:t.group,data:[]}),h[t.group]=!0)})),0==o.length)if(o=[{name:"默认分组",data:[]}],!0===e)for(let c=0;c0)for(let e=0;e0&&(this.mixinDatacomErrorMessage=null,!0===this.echarts?(jt.option[e].chartData=i,this.$nextTick((()=>{this.init()}))):(Gt.option[e].categories=i.categories,Gt.option[e].series=i.series,this.$nextTick((()=>{this.init()}))))},resizeHandler(){let t=Date.now();t-(this.lastDrawTime?this.lastDrawTime:t-3e3)<1e3||uni.createSelectorQuery().in(this).select("#ChartBoxId"+this.cid).boundingClientRect((t=>{this.showchart=!0,t.width>0&&t.height>0&&(t.width===this.cWidth&&t.height===this.cHeight||this.checkData(this.drawData))})).exec()},getCloudData(){1!=this.mixinDatacomLoading&&(this.mixinDatacomLoading=!0,this.mixinDatacomGet().then((t=>{this.mixinDatacomResData=t.result.data,this.localdataInit(this.mixinDatacomResData)})).catch((t=>{this.mixinDatacomLoading=!1,this.showchart=!1,this.mixinDatacomErrorMessage="请求错误:"+t})))},onMixinDatacomPropsChange(t,e){1==t&&""!==this.collection&&(this.showchart=!1,this.mixinDatacomErrorMessage=null,this._clearChart(),this.getCloudData())},_clearChart(){let t=this.cid;if(!0!==this.echarts&&Gt.option[t]&&Gt.option[t].context){const e=Gt.option[t].context;"object"!=typeof e||Gt.option[t].update||(e.clearRect(0,0,this.cWidth*this.pixel,this.cHeight*this.pixel),e.draw())}},init(){let t=this.cid;uni.createSelectorQuery().in(this).select("#ChartBoxId"+t).boundingClientRect((e=>{e.width>0&&e.height>0?(this.mixinDatacomLoading=!1,this.showchart=!0,this.lastDrawTime=Date.now(),this.cWidth=e.width,this.cHeight=e.height,!0!==this.echarts&&(Gt.option[t].background="rgba(0,0,0,0)"==this.background?"#FFFFFF":this.background,Gt.option[t].canvas2d=this.type2d,Gt.option[t].pixelRatio=this.pixel,Gt.option[t].animation=this.animation,Gt.option[t].width=e.width*this.pixel,Gt.option[t].height=e.height*this.pixel,Gt.option[t].onzoom=this.onzoom,Gt.option[t].ontap=this.ontap,Gt.option[t].ontouch=this.ontouch,Gt.option[t].onmouse=this.openmouse,Gt.option[t].onmovetip=this.onmovetip,Gt.option[t].tooltipShow=this.tooltipShow,Gt.option[t].tooltipFormat=this.tooltipFormat,Gt.option[t].tooltipCustom=this.tooltipCustom,Gt.option[t].inScrollView=this.inScrollView,Gt.option[t].lastDrawTime=this.lastDrawTime,Gt.option[t].tapLegend=this.tapLegend),this.inH5||this.inApp?1==this.echarts?(jt.option[t].ontap=this.ontap,jt.option[t].onmouse=this.openmouse,jt.option[t].tooltipShow=this.tooltipShow,jt.option[t].tooltipFormat=this.tooltipFormat,jt.option[t].tooltipCustom=this.tooltipCustom,jt.option[t].lastDrawTime=this.lastDrawTime,this.echartsOpts=Ut({},jt.option[t])):(Gt.option[t].rotateLock=Gt.option[t].rotate,this.uchartsOpts=Ut({},Gt.option[t])):(Gt.option[t]=Zt(Gt.option[t],Gt.formatter),this.mixinDatacomErrorMessage=null,this.mixinDatacomLoading=!1,this.showchart=!0,this.$nextTick((()=>{if(!0===this.type2d){uni.createSelectorQuery().in(this).select("#"+t).fields({node:!0,size:!0}).exec((i=>{if(i[0]){const a=i[0].node,o=a.getContext("2d");Gt.option[t].context=o,Gt.option[t].rotateLock=Gt.option[t].rotate,Gt.instance[t]&&Gt.option[t]&&!0===Gt.option[t].update?this._updataUChart(t):(a.width=e.width*this.pixel,a.height=e.height*this.pixel,a._width=e.width*this.pixel,a._height=e.height*this.pixel,setTimeout((()=>{Gt.option[t].context.restore(),Gt.option[t].context.save(),this._newChart(t)}),100))}else this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:开启2d模式后,未获取到dom节点,canvas-id:"+t}))}else this.inAli&&(Gt.option[t].rotateLock=Gt.option[t].rotate),Gt.option[t].context=uni.createCanvasContext(t,this),Gt.instance[t]&&Gt.option[t]&&!0===Gt.option[t].update?this._updataUChart(t):setTimeout((()=>{Gt.option[t].context.restore(),Gt.option[t].context.save(),this._newChart(t)}),100)})))):(this.mixinDatacomLoading=!1,this.showchart=!1,1==this.reshow&&(this.mixinDatacomErrorMessage="布局错误:未获取到父元素宽高尺寸!canvas-id:"+t))})).exec()},saveImage(){uni.canvasToTempFilePath({canvasId:this.cid,success:t=>{var e=document.createElement("a");e.href=t.tempFilePath,e.download=this.cid,e.target="_blank",e.click()}},this)},getImage(){if(0==this.type2d)uni.canvasToTempFilePath({canvasId:this.cid,success:t=>{this.emitMsg({name:"getImage",params:{type:"getImage",base64:t.tempFilePath}})}},this);else{uni.createSelectorQuery().in(this).select("#"+this.cid).fields({node:!0,size:!0}).exec((t=>{if(t[0]){const e=t[0].node;this.emitMsg({name:"getImage",params:{type:"getImage",base64:e.toDataURL("image/png")}})}}))}},_error(t){this.mixinDatacomErrorMessage=t.detail.errMsg},emitMsg(t){this.$emit(t.name,t.params)},getRenderType(){!0===this.echarts&&!1===this.mixinDatacomLoading&&this.beforeInit()},toJSON(){return this}}};$t(Qt);const Vt=u(Qt,[["render",function(t,n,s,h,u,b){const v=f(c("qiun-loading"),y),S=r,w=f(c("qiun-error"),m),T=g;return e(),i(S,{class:"chartsview",id:"ChartBoxId"+u.cid},{default:a((()=>[t.mixinDatacomLoading?(e(),i(S,{key:0},{default:a((()=>[o(v,{loadingType:s.loadingType},null,8,["loadingType"])])),_:1})):l("",!0),t.mixinDatacomErrorMessage&&s.errorShow?(e(),i(S,{key:1,onClick:b.reloading},{default:a((()=>[o(w,{errorMessage:s.errorMessage},null,8,["errorMessage"])])),_:1},8,["onClick"])):l("",!0),u.echarts?d((e(),i(S,{key:2,style:p([{background:s.background},{width:"100%",height:"100%"}]),"data-directory":s.directory,id:"EC"+u.cid,prop:u.echartsOpts,"change:prop":t.rdcharts.ecinit,resize:u.echartsResize,"change:resize":t.rdcharts.ecresize},null,8,["style","data-directory","id","prop","change:prop","resize","change:resize"])),[[x,u.showchart]]):(e(),i(S,{key:3,onClick:t.rdcharts.tap,onMousemove:t.rdcharts.mouseMove,onMousedown:t.rdcharts.mouseDown,onMouseup:t.rdcharts.mouseUp,onTouchstart:t.rdcharts.touchStart,onTouchmove:t.rdcharts.touchMove,onTouchend:t.rdcharts.touchEnd,id:"UC"+u.cid,prop:u.uchartsOpts,"change:prop":t.rdcharts.ucinit},{default:a((()=>[d(o(T,{id:u.cid,canvasId:u.cid,style:p({width:u.cWidth+"px",height:u.cHeight+"px",background:s.background}),"disable-scroll":s.disableScroll,onError:b._error},null,8,["id","canvasId","style","disable-scroll","onError"]),[[x,u.showchart]])])),_:1},8,["onClick","onMousemove","onMousedown","onMouseup","onTouchstart","onTouchmove","onTouchend","id","prop","change:prop"]))])),_:1},8,["id"])}],["__scopeId","data-v-d3533eac"]]);export{Vt as _};