f&&bj?j:M,L=L>j?j:L,I=I>j?j:I,R=R>j?j:R,M=M<0?0:M,L=L<0?0:L,I=I<0?0:I,R=R<0?0:R,r.arc(C+M,D+M,M,-Math.PI,-Math.PI/2),r.arc(C+F-L,D+L,L,-Math.PI/2,0),r.arc(C+F-I,D+_-I,I,0,Math.PI/2),r.arc(C+R,D+_-R,R,Math.PI/2,Math.PI)}else r.moveTo(k,w.y),r.lineTo(k+w.width,w.y),r.lineTo(k+w.width,t.height-t.area[2]),r.lineTo(k,t.height-t.area[2]),r.lineTo(k,w.y),r.setLineWidth(1),r.setStrokeStyle(O);r.setFillStyle(T),r.closePath(),r.fill()}}break;case"stack":x=ye(m,v,y,s,c,t,n,u,e,o);d.push(x),x=ue(x,c,e.length,u,n,t,e);for(var K=0;Kf&&K0&&(S-=B),r.setFillStyle(T),r.moveTo(k,z.y),r.fillRect(k,z.y,z.width,S),r.closePath(),r.fill()}}break;case"meter":x=pe(m,v,y,s,c,t,n,o);d.push(x),x=le(x,c,e.length,u,n,t,l.meterBorder);for(var U=0;Uf&&U0&&(r.setStrokeStyle(a.color),r.setLineWidth(l.meterBorder*t.pix)),0==u?r.setFillStyle(l.meterFillColor):r.setFillStyle(N.color||a.color);k=N.x-N.width/2,S=t.height-N.y-t.area[2];if(l.barBorderRadius&&4===l.barBorderRadius.length||!0===l.barBorderCircle){var H=k,W=N.y,Z=N.width,G=t.height-t.area[2]-N.y;l.barBorderCircle&&(l.barBorderRadius=[Z/2,Z/2,0,0]);var X=i(l.barBorderRadius,4),q=X[0],V=X[1],Q=X[2],J=X[3],Y=Math.min(Z/2,G/2);q=q>Y?Y:q,V=V>Y?Y:V,Q=Q>Y?Y:Q,J=J>Y?Y:J,q=q<0?0:q,V=V<0?0:V,Q=Q<0?0:Q,J=J<0?0:J,r.arc(H+q,W+q,q,-Math.PI,-Math.PI/2),r.arc(H+Z-V,W+V,V,-Math.PI/2,0),r.arc(H+Z-Q,W+G-Q,Q,0,Math.PI/2),r.arc(H+J,W+G-J,J,Math.PI/2,Math.PI),r.fill()}else r.moveTo(k,N.y),r.lineTo(k+N.width,N.y),r.lineTo(k+N.width,t.height-t.area[2]),r.lineTo(k,t.height-t.area[2]),r.lineTo(k,N.y),r.fill();0==u&&l.meterBorder>0&&(r.closePath(),r.stroke())}}break}})),!1!==t.dataLabel&&1===o&&e.forEach((function(i,a){var u,d,h;u=[].concat(t.chartData.yAxisData.ranges[i.index]),d=u.pop(),h=u.shift();var f=i.data;switch(l.type){case"group":var p=pe(f,d,h,s,c,t,n,o);p=se(p,c,e.length,a,n,t),Oe(p,i,n,r,t);break;case"stack":p=ye(f,d,h,s,c,t,n,a,e,o);Oe(p,i,n,r,t);break;case"meter":p=pe(f,d,h,s,c,t,n,o);Oe(p,i,n,r,t);break}})),r.restore(),{xAxisPoints:s,calPoints:d,eachSpacing:c}}function ze(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=t.chartData.xAxisData,s=a.xAxisPoints,c=a.eachSpacing,l=u({},{type:"mount",widthRatio:1,borderWidth:1,barBorderCircle:!1,barBorderRadius:[],linearType:"none",linearOpacity:1,customColor:[],colorStop:0},t.extra.mount);l.widthRatio=l.widthRatio<=0?0:l.widthRatio,l.widthRatio=l.widthRatio>=2?2:l.widthRatio;r.save();var d,f,p,g=-2,v=s.length+2;t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(r.translate(t._scrollDistance_,0),g=Math.floor(-t._scrollDistance_/c)-2,v=g+t.xAxis.itemCount+4),l.customColor=w(l.linearType,l.customColor,e,n),d=[].concat(t.chartData.yAxisData.ranges[0]),f=d.pop(),p=d.shift();var y=ge(e,f,p,s,c,t,l,o);switch(l.type){case"bar":for(var m=0;mg&&mI?I:_,E=E>I?I:E,M=M>I?I:M,L=L>I?I:L,_=_<0?0:_,E=E<0?0:E,M=M<0?0:M,L=L<0?0:L,r.arc(O+_,P+_,_,-Math.PI,-Math.PI/2),r.arc(O+C-E,P+E,E,-Math.PI/2,0),r.arc(O+C-M,P+D-M,M,0,Math.PI/2),r.arc(O+L,P+D-L,L,Math.PI/2,Math.PI)}else r.moveTo(A,x.y),r.lineTo(A+x.width,x.y),r.lineTo(A+x.width,t.height-t.area[2]),r.lineTo(A,t.height-t.area[2]),r.lineTo(A,x.y);r.setStrokeStyle(S),r.setFillStyle(k),l.borderWidth>0&&(r.setLineWidth(l.borderWidth*t.pix),r.closePath(),r.stroke()),r.fill()}}break;case"triangle":for(var R=0;Rg&&R0&&(r.setLineWidth(l.borderWidth*t.pix),r.stroke()),r.fill()}}break;case"mount":for(var K=0;Kg&&K0&&(r.setLineWidth(l.borderWidth*t.pix),r.stroke()),r.fill()}}break;case"sharp":for(var B=0;Bg&&B0&&(r.setLineWidth(l.borderWidth*t.pix),r.stroke()),r.fill()}}break}if(!1!==t.dataLabel&&1===o){var N,H,W;N=[].concat(t.chartData.yAxisData.ranges[0]),H=N.pop(),W=N.shift();y=ge(e,H,W,s,c,t,l,o);Pe(y,e,n,r,t)}return r.restore(),{xAxisPoints:s,calPoints:y,eachSpacing:c}}function Be(e,t,n,r){for(var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=[],s=(t.height-t.area[0]-t.area[2])/t.categories.length,c=0;cf&&bj?j:M,L=L>j?j:L,I=I>j?j:I,R=R>j?j:R,M=M<0?0:M,L=L<0?0:L,I=I<0?0:I,R=R<0?0:R,r.arc(C+R,F+R,R,-Math.PI,-Math.PI/2),r.arc(w.x-M,F+M,M,-Math.PI/2,0),r.arc(w.x-L,F+D-L,L,0,Math.PI/2),r.arc(C+I,F+D-I,I,Math.PI/2,Math.PI)}else r.moveTo(k,S),r.lineTo(w.x,S),r.lineTo(w.x,S+w.width),r.lineTo(k,S+w.width),r.lineTo(k,S),r.setLineWidth(1),r.setStrokeStyle(O);r.setFillStyle(T),r.closePath(),r.fill()}}break;case"stack":x=me(m,v,y,a,s,t,n,u,e,o);d.push(x),x=de(x,s,e.length,u,n,t,e);for(var K=0;Kf&&K5&&void 0!==arguments[5]?arguments[5]:1,a=u({},{color:{},average:{}},n.extra.candle);a.color=u({},{upLine:"#f04864",upFill:"#f04864",downLine:"#2fc25b",downFill:"#2fc25b"},a.color),a.average=u({},{show:!1,name:[],day:[],color:i.color},a.average),n.extra.candle=a;var s=n.chartData.xAxisData,c=s.xAxisPoints,l=s.eachSpacing,d=[];r.save();var h=-2,f=c.length+2,p=0,g=n.width+l;return n._scrollDistance_&&0!==n._scrollDistance_&&!0===n.enableScroll&&(r.translate(n._scrollDistance_,0),h=Math.floor(-n._scrollDistance_/l)-2,f=h+n.xAxis.itemCount+4,p=-n._scrollDistance_-2*l+n.area[3],g=p+(n.xAxis.itemCount+4)*l),(a.average.show||t)&&t.forEach((function(e,t){var a,s,u;a=[].concat(n.chartData.yAxisData.ranges[e.index]),s=a.pop(),u=a.shift();for(var d=e.data,h=pe(d,s,u,c,l,n,i,o),f=X(h,e),v=0;vp&&(r.moveTo(b.x,b.y),x=1),A>0&&b.x>p&&b.xh&&m0?(r.setStrokeStyle(a.color.upLine),r.setFillStyle(a.color.upFill),r.setLineWidth(1*n.pix),r.moveTo(x[3].x,x[3].y),r.lineTo(x[1].x,x[1].y),r.lineTo(x[1].x-l/4,x[1].y),r.lineTo(x[0].x-l/4,x[0].y),r.lineTo(x[0].x,x[0].y),r.lineTo(x[2].x,x[2].y),r.lineTo(x[0].x,x[0].y),r.lineTo(x[0].x+l/4,x[0].y),r.lineTo(x[1].x+l/4,x[1].y),r.lineTo(x[1].x,x[1].y),r.moveTo(x[3].x,x[3].y)):(r.setStrokeStyle(a.color.downLine),r.setFillStyle(a.color.downFill),r.setLineWidth(1*n.pix),r.moveTo(x[3].x,x[3].y),r.lineTo(x[0].x,x[0].y),r.lineTo(x[0].x-l/4,x[0].y),r.lineTo(x[1].x-l/4,x[1].y),r.lineTo(x[1].x,x[1].y),r.lineTo(x[2].x,x[2].y),r.lineTo(x[1].x,x[1].y),r.lineTo(x[1].x+l/4,x[1].y),r.lineTo(x[0].x+l/4,x[0].y),r.lineTo(x[0].x,x[0].y),r.moveTo(x[3].x,x[3].y)),r.closePath(),r.fill(),r.stroke()}})),r.restore(),{xAxisPoints:c,calPoints:d,eachSpacing:l}}function Ne(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=u({},{type:"straight",opacity:.2,addLine:!1,width:2,gradient:!1},t.extra.area),a=t.chartData.xAxisData,s=a.xAxisPoints,c=a.eachSpacing,l=t.height-t.area[2],d=[];i.save();var f=0,p=t.width+c;return t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(i.translate(t._scrollDistance_,0),f=-t._scrollDistance_-2*c+t.area[3],p=f+(t.xAxis.itemCount+4)*c),e.forEach((function(e,a){var u,g,v;u=[].concat(t.chartData.yAxisData.ranges[e.index]),g=u.pop(),v=u.shift();var m=e.data,x=pe(m,g,v,s,c,t,n,r);d.push(x);for(var A=X(x,e),b=0;b1){var S=w[0],T=w[w.length-1];i.moveTo(S.x,S.y);var O=0;if("curve"===o.type)for(var P=0;Pf&&(i.moveTo(C.x,C.y),O=1),P>0&&C.x>f&&C.xf&&(i.moveTo(_.x,_.y),O=1),F>0&&_.x>f&&_.x
f&&(i.moveTo(M.x,M.y),O=1),E>0&&M.x>f&&M.x
f&&(i.moveTo(K.x,K.y),R=1),j>0&&K.x>f&&K.x
f&&(i.moveTo(U.x,U.y),R=1),B>0&&U.x>f&&U.x
f&&(i.moveTo(H.x,H.y),R=1),N>0&&H.x>f&&H.x
4&&void 0!==arguments[4]?arguments[4]:1,o=(u({},{type:"circle"},t.extra.scatter),t.chartData.xAxisData),a=o.xAxisPoints,s=o.eachSpacing,c=[];i.save();var l=0;t.width;return t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(i.translate(t._scrollDistance_,0),l=-t._scrollDistance_-2*s+t.area[3],l+(t.xAxis.itemCount+4)*s),e.forEach((function(e,o){var c,l,u;c=[].concat(t.chartData.yAxisData.ranges[e.index]),l=c.pop(),u=c.shift();var d=e.data,h=pe(d,l,u,a,s,t,n,r);i.beginPath(),i.setStrokeStyle(e.color),i.setFillStyle(e.color),i.setLineWidth(1*t.pix);var f=e.pointShape;if("diamond"===f)h.forEach((function(e,t){null!==e&&(i.moveTo(e.x,e.y-4.5),i.lineTo(e.x-4.5,e.y),i.lineTo(e.x,e.y+4.5),i.lineTo(e.x+4.5,e.y),i.lineTo(e.x,e.y-4.5))}));else if("circle"===f)h.forEach((function(e,n){null!==e&&(i.moveTo(e.x+2.5*t.pix,e.y),i.arc(e.x,e.y,3*t.pix,0,2*Math.PI,!1))}));else if("square"===f)h.forEach((function(e,t){null!==e&&(i.moveTo(e.x-3.5,e.y-3.5),i.rect(e.x-3.5,e.y-3.5,7,7))}));else if("triangle"===f)h.forEach((function(e,t){null!==e&&(i.moveTo(e.x,e.y-4.5),i.lineTo(e.x-4.5,e.y+4.5),i.lineTo(e.x+4.5,e.y+4.5),i.lineTo(e.x,e.y-4.5))}));else if("triangle"===f)return;i.closePath(),i.fill(),i.stroke()})),!1!==t.dataLabel&&1===r&&e.forEach((function(e,o){var c,l,u;c=[].concat(t.chartData.yAxisData.ranges[e.index]),l=c.pop(),u=c.shift();var d=e.data,h=pe(d,l,u,a,s,t,n,r);Oe(h,e,n,i,t)})),i.restore(),{xAxisPoints:a,calPoints:c,eachSpacing:s}}function We(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=u({},{opacity:1,border:2},t.extra.bubble),a=t.chartData.xAxisData,s=a.xAxisPoints,c=a.eachSpacing,l=[];i.save();var d=0;t.width;return t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(i.translate(t._scrollDistance_,0),d=-t._scrollDistance_-2*c+t.area[3],d+(t.xAxis.itemCount+4)*c),e.forEach((function(a,l){var u,d,f;u=[].concat(t.chartData.yAxisData.ranges[a.index]),d=u.pop(),f=u.shift();var p=a.data,g=pe(p,d,f,s,c,t,n,r);i.beginPath(),i.setStrokeStyle(a.color),i.setLineWidth(o.border*t.pix),i.setFillStyle(h(a.color,o.opacity)),g.forEach((function(e,n){i.moveTo(e.x+e.r,e.y),i.arc(e.x,e.y,e.r*t.pix,0,2*Math.PI,!1)})),i.closePath(),i.fill(),i.stroke(),!1!==t.dataLabel&&1===r&&g.forEach((function(r,o){i.beginPath();var a=e.textSize*t.pix||n.fontSize;i.setFontSize(a),i.setFillStyle(e.textColor||"#FFFFFF"),i.setTextAlign("center"),i.fillText(String(r.t),r.x,r.y+a/2),i.closePath(),i.stroke(),i.setTextAlign("left")}))})),i.restore(),{xAxisPoints:s,calPoints:l,eachSpacing:c}}function Ze(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=u({},{type:"straight",width:2},t.extra.line);o.width*=t.pix;var a=t.chartData.xAxisData,s=a.xAxisPoints,c=a.eachSpacing,l=[];i.save();var d=0,h=t.width+c;return t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(i.translate(t._scrollDistance_,0),d=-t._scrollDistance_-2*c+t.area[3],h=d+(t.xAxis.itemCount+4)*c),e.forEach((function(e,a){var u,f,p;u=[].concat(t.chartData.yAxisData.ranges[e.index]),f=u.pop(),p=u.shift();var g=e.data,v=pe(g,f,p,s,c,t,n,r);l.push(v);var m=X(v,e);if("dash"==e.lineType){var x=e.dashLength?e.dashLength:8;x*=t.pix,i.setLineDash([x,x])}i.beginPath(),i.setStrokeStyle(e.color),i.setLineWidth(o.width),m.forEach((function(e,t){if(1===e.length)i.moveTo(e[0].x,e[0].y),i.arc(e[0].x,e[0].y,1,0,2*Math.PI);else{i.moveTo(e[0].x,e[0].y);var n=0;if("curve"===o.type)for(var r=0;rd&&(i.moveTo(a.x,a.y),n=1),r>0&&a.x>d&&a.xd&&(i.moveTo(l.x,l.y),n=1),c>0&&l.x>d&&l.xd&&(i.moveTo(f.x,f.y),n=1),u>0&&f.x>d&&f.x4&&void 0!==arguments[4]?arguments[4]:1,a=t.chartData.xAxisData,s=a.xAxisPoints,c=a.eachSpacing,l=u({},{width:c/2,barBorderCircle:!1,barBorderRadius:[],seriesGap:2,linearType:"none",linearOpacity:1,customColor:[],colorStop:0},t.extra.mix.column),d=u({},{opacity:.2,gradient:!1},t.extra.mix.area),f=t.height-t.area[2],p=[],g=0,v=0;e.forEach((function(e,t){"column"==e.type&&(v+=1)})),r.save();var m=-2,x=s.length+2,A=0,b=t.width+c;if(t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(r.translate(t._scrollDistance_,0),m=Math.floor(-t._scrollDistance_/c)-2,x=m+t.xAxis.itemCount+4,A=-t._scrollDistance_-2*c+t.area[3],b=A+(t.xAxis.itemCount+4)*c),l.customColor=w(l.linearType,l.customColor,e,n),e.forEach((function(e,a){var u,w,k;u=[].concat(t.chartData.yAxisData.ranges[e.index]),w=u.pop(),k=u.shift();var S=e.data,T=pe(S,w,k,s,c,t,n,o);if(p.push(T),"column"==e.type){T=se(T,c,v,g,n,t);for(var O=0;Om&&OU?U:j,K=K>U?U:K,z=z>U?U:z,B=B>U?U:B,j=j<0?0:j,K=K<0?0:K,z=z<0?0:z,B=B<0?0:B,r.arc(E+j,M+j,j,-Math.PI,-Math.PI/2),r.arc(E+L-K,M+K,K,-Math.PI/2,0),r.arc(E+L-z,M+I-z,z,0,Math.PI/2),r.arc(E+B,M+I-B,B,Math.PI/2,Math.PI)}else r.moveTo(C,P.y),r.lineTo(C+P.width,P.y),r.lineTo(C+P.width,t.height-t.area[2]),r.lineTo(C,t.height-t.area[2]),r.lineTo(C,P.y),r.setLineWidth(1),r.setStrokeStyle(F);r.setFillStyle(D),r.closePath(),r.fill()}}g+=1}if("area"==e.type)for(var N=X(T,e),H=0;H1){var G=W[0],q=W[W.length-1];r.moveTo(G.x,G.y);var V=0;if("curve"===e.style)for(var Q=0;QA&&(r.moveTo(J.x,J.y),V=1),Q>0&&J.x>A&&J.xA&&(r.moveTo(ee.x,ee.y),V=1),$>0&&ee.x>A&&ee.xA&&(r.moveTo(c.x,c.y),a=1),s>0&&c.x>A&&c.xA&&(r.moveTo(d.x,d.y),a=1),u>0&&d.x>A&&d.x1&&(t.extra.mount.widthRatio>2&&(t.extra.mount.widthRatio=2),p+=(t.extra.mount.widthRatio-1)*c);var g=f*f/p,v=0;t._scrollDistance_&&(v=-t._scrollDistance_*f/p),i.beginPath(),i.setLineCap("round"),i.setLineWidth(6*t.pix),i.setStrokeStyle(t.xAxis.scrollBackgroundColor||"#EFEBEF"),i.moveTo(a,h),i.lineTo(s,h),i.stroke(),i.closePath(),i.beginPath(),i.setLineCap("round"),i.setLineWidth(6*t.pix),i.setStrokeStyle(t.xAxis.scrollColor||"#A6A6A6"),i.moveTo(a+v,h),i.lineTo(a+v+g,h),i.stroke(),i.closePath(),i.setLineCap("butt")}if(i.save(),t._scrollDistance_&&0!==t._scrollDistance_&&i.translate(t._scrollDistance_,0),!0===t.xAxis.calibration&&(i.setStrokeStyle(t.xAxis.gridColor||"#cccccc"),i.setLineCap("butt"),i.setLineWidth(1*t.pix),o.forEach((function(e,n){n>0&&(i.beginPath(),i.moveTo(e-c/2,u),i.lineTo(e-c/2,u+3*t.pix),i.closePath(),i.stroke())}))),!0!==t.xAxis.disableGrid&&(i.setStrokeStyle(t.xAxis.gridColor||"#cccccc"),i.setLineCap("butt"),i.setLineWidth(1*t.pix),"dash"==t.xAxis.gridType&&i.setLineDash([t.xAxis.dashLength*t.pix,t.xAxis.dashLength*t.pix]),t.xAxis.gridEval=t.xAxis.gridEval||1,o.forEach((function(e,n){n%t.xAxis.gridEval==0&&(i.beginPath(),i.moveTo(e,u),i.lineTo(e,d),i.stroke())})),i.setLineDash([])),!0!==t.xAxis.disabled){var y=e.length;t.xAxis.labelCount&&(y=t.xAxis.itemCount?Math.ceil(e.length/t.xAxis.itemCount*t.xAxis.labelCount):t.xAxis.labelCount,y-=1);for(var m=Math.ceil(e.length/y),x=[],A=e.length,b=0;b1&&(t.extra.mount.widthRatio>2&&(t.extra.mount.widthRatio=2),l+=(t.extra.mount.widthRatio-1)*c);var u=a+l,d=[],h=1;!1===t.xAxis.axisLine&&(h=0);for(var f=h;f4&&void 0!==arguments[4]?arguments[4]:1,o=u({},{activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,ringWidth:30,customRadius:0,border:!1,borderWidth:2,borderColor:"#FFFFFF",centerColor:"#FFFFFF",linearType:"none",customColor:[]},"pie"==t.type?t.extra.pie:t.extra.ring),a={x:t.area[3]+(t.width-t.area[1]-t.area[3])/2,y:t.area[0]+(t.height-t.area[0]-t.area[2])/2};0==n.pieChartLinePadding&&(n.pieChartLinePadding=o.activeRadius*t.pix);var s=Math.min((t.width-t.area[1]-t.area[3])/2-n.pieChartLinePadding-n.pieChartTextPadding-n._pieTextMaxLength_,(t.height-t.area[0]-t.area[2])/2-n.pieChartLinePadding-n.pieChartTextPadding);s=s<10?10:s,o.customRadius>0&&(s=o.customRadius*t.pix),e=$(e,s,r);var c=o.activeRadius*t.pix;if(o.customColor=w(o.linearType,o.customColor,e,n),e=e.map((function(e){return e._start_+=o.offsetAngle*Math.PI/180,e})),e.forEach((function(e,n){t.tooltip&&t.tooltip.index==n&&(i.beginPath(),i.setFillStyle(h(e.color,o.activeOpacity||.5)),i.moveTo(a.x,a.y),i.arc(a.x,a.y,e._radius_+c,e._start_,e._start_+2*e._proportion_*Math.PI),i.closePath(),i.fill()),i.beginPath(),i.setLineWidth(o.borderWidth*t.pix),i.lineJoin="round",i.setStrokeStyle(o.borderColor);var r,s=e.color;"custom"==o.linearType&&(r=i.createCircularGradient?i.createCircularGradient(a.x,a.y,e._radius_):i.createRadialGradient(a.x,a.y,0,a.x,a.y,e._radius_),r.addColorStop(0,h(o.customColor[e.linearIndex],1)),r.addColorStop(1,h(e.color,1)),s=r);i.setFillStyle(s),i.moveTo(a.x,a.y),i.arc(a.x,a.y,e._radius_,e._start_,e._start_+2*e._proportion_*Math.PI),i.closePath(),i.fill(),1==o.border&&i.stroke()})),"ring"===t.type){var l=.6*s;"number"===typeof o.ringWidth&&o.ringWidth>0&&(l=Math.max(0,s-o.ringWidth*t.pix)),i.beginPath(),i.setFillStyle(o.centerColor),i.moveTo(a.x,a.y),i.arc(a.x,a.y,l,0,2*Math.PI),i.closePath(),i.fill()}return!1!==t.dataLabel&&1===r&&_e(e,t,n,i,s,a),1===r&&"ring"===t.type&&Te(t,n,i,a),{center:a,radius:s,series:e}}function $e(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=u({},{type:"area",activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!1,borderWidth:2,borderColor:"#FFFFFF",linearType:"none",customColor:[]},t.extra.rose);0==n.pieChartLinePadding&&(n.pieChartLinePadding=o.activeRadius*t.pix);var a={x:t.area[3]+(t.width-t.area[1]-t.area[3])/2,y:t.area[0]+(t.height-t.area[0]-t.area[2])/2},s=Math.min((t.width-t.area[1]-t.area[3])/2-n.pieChartLinePadding-n.pieChartTextPadding-n._pieTextMaxLength_,(t.height-t.area[0]-t.area[2])/2-n.pieChartLinePadding-n.pieChartTextPadding);s=s<10?10:s;var c=o.minRadius||.5*s;e=te(e,o.type,c,s,r);var l=o.activeRadius*t.pix;return o.customColor=w(o.linearType,o.customColor,e,n),e=e.map((function(e){return e._start_+=(o.offsetAngle||0)*Math.PI/180,e})),e.forEach((function(e,n){t.tooltip&&t.tooltip.index==n&&(i.beginPath(),i.setFillStyle(h(e.color,o.activeOpacity||.5)),i.moveTo(a.x,a.y),i.arc(a.x,a.y,l+e._radius_,e._start_,e._start_+2*e._rose_proportion_*Math.PI),i.closePath(),i.fill()),i.beginPath(),i.setLineWidth(o.borderWidth*t.pix),i.lineJoin="round",i.setStrokeStyle(o.borderColor);var r,s=e.color;"custom"==o.linearType&&(r=i.createCircularGradient?i.createCircularGradient(a.x,a.y,e._radius_):i.createRadialGradient(a.x,a.y,0,a.x,a.y,e._radius_),r.addColorStop(0,h(o.customColor[e.linearIndex],1)),r.addColorStop(1,h(e.color,1)),s=r);i.setFillStyle(s),i.moveTo(a.x,a.y),i.arc(a.x,a.y,e._radius_,e._start_,e._start_+2*e._rose_proportion_*Math.PI),i.closePath(),i.fill(),1==o.border&&i.stroke()})),!1!==t.dataLabel&&1===r&&_e(e,t,n,i,s,a),{center:a,radius:s,series:e}}function et(e,t,n,i){var r,o,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=u({},{startAngle:.75,endAngle:.25,type:"default",lineCap:"round",width:12,gap:2,linearType:"none",customColor:[]},t.extra.arcbar);e=ne(e,s,a),r=s.centerX||s.centerY?{x:s.centerX?s.centerX:t.width/2,y:s.centerY?s.centerY:t.height/2}:{x:t.width/2,y:t.height/2},s.radius?o=s.radius:(o=Math.min(r.x,r.y),o-=5*t.pix,o-=s.width/2),o=o<10?10:o,s.customColor=w(s.linearType,s.customColor,e,n);for(var c=0;c5&&void 0!==arguments[5]?arguments[5]:1,a=u({},{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"}},n.extra.gauge);void 0==a.oldAngle&&(a.oldAngle=a.startAngle),void 0==a.oldData&&(a.oldData=0),e=re(e,a.startAngle,a.endAngle);var s={x:n.width/2,y:n.height/2},c=Math.min(s.x,s.y);c-=5*n.pix,c-=a.width/2,c=c<10?10:c;var l=c-a.width,d=0;if("progress"==a.type){var f=c-3*a.width;r.beginPath();var p=r.createLinearGradient(s.x,s.y-f,s.x,s.y+f);p.addColorStop("0",h(t[0].color,.3)),p.addColorStop("1.0",h("#FFFFFF",.1)),r.setFillStyle(p),r.arc(s.x,s.y,f,0,2*Math.PI,!1),r.fill(),r.setLineWidth(a.width),r.setStrokeStyle(h(t[0].color,.3)),r.setLineCap("round"),r.beginPath(),r.arc(s.x,s.y,l,a.startAngle*Math.PI,a.endAngle*Math.PI,!1),r.stroke(),d=a.startAngle-a.endAngle+1;a.splitLine.splitNumber;var g=d/a.splitLine.splitNumber/a.splitLine.childNumber,v=-c-.5*a.width-a.splitLine.fixRadius,y=-c-a.width-a.splitLine.fixRadius+a.splitLine.width;r.save(),r.translate(s.x,s.y),r.rotate((a.startAngle-1)*Math.PI);for(var m=a.splitLine.splitNumber*a.splitLine.childNumber+1,x=t[0].data*o,A=0;AA/m?r.setStrokeStyle(h(t[0].color,1)):r.setStrokeStyle(h(t[0].color,.3)),r.setLineWidth(3*n.pix),r.moveTo(v,0),r.lineTo(y,0),r.stroke(),r.rotate(g*Math.PI);r.restore(),t=ie(t,a,o),r.setLineWidth(a.width),r.setStrokeStyle(t[0].color),r.setLineCap("round"),r.beginPath(),r.arc(s.x,s.y,l,a.startAngle*Math.PI,t[0]._proportion_*Math.PI,!1),r.stroke();var b=c-2.5*a.width;r.save(),r.translate(s.x,s.y),r.rotate((t[0]._proportion_-1)*Math.PI),r.beginPath(),r.setLineWidth(a.width/3);var w=r.createLinearGradient(0,.6*-b,0,.6*b);w.addColorStop("0",h("#FFFFFF",0)),w.addColorStop("0.5",h(t[0].color,1)),w.addColorStop("1.0",h("#FFFFFF",0)),r.setStrokeStyle(w),r.arc(0,0,b,.85*Math.PI,1.15*Math.PI,!1),r.stroke(),r.beginPath(),r.setLineWidth(1),r.setStrokeStyle(t[0].color),r.setFillStyle(t[0].color),r.moveTo(-b-a.width/3/2,-4),r.lineTo(-b-a.width/3/2-4,0),r.lineTo(-b-a.width/3/2,4),r.lineTo(-b-a.width/3/2,-4),r.stroke(),r.fill(),r.restore()}else{r.setLineWidth(a.width),r.setLineCap("butt");for(var k=0;k4&&void 0!==arguments[4]?arguments[4]:1,o=u({},{gridColor:"#cccccc",gridType:"radar",gridEval:1,axisLabel:!1,axisLabelTofix:0,labelColor:"#666666",labelPointShow:!1,labelPointRadius:3,labelPointColor:"#cccccc",opacity:.2,gridCount:3,border:!1,borderWidth:2,linearType:"none",customColor:[]},t.extra.radar),a=F(t.categories.length),s={x:t.area[3]+(t.width-t.area[1]-t.area[3])/2,y:t.area[0]+(t.height-t.area[0]-t.area[2])/2},c=(t.width-t.area[1]-t.area[3])/2,l=(t.height-t.area[0]-t.area[2])/2,d=Math.min(c-(D(t.categories,n.fontSize,i)+n.radarLabelTextMargin),l-n.radarLabelTextMargin);d-=n.radarLabelTextMargin*t.pix,d=d<10?10:d,i.beginPath(),i.setLineWidth(1*t.pix),i.setStrokeStyle(o.gridColor),a.forEach((function(e,t){var n=m(d*Math.cos(e),d*Math.sin(e),s);i.moveTo(s.x,s.y),t%o.gridEval==0&&i.lineTo(n.x,n.y)})),i.stroke(),i.closePath();for(var f=function(e){var n={};if(i.beginPath(),i.setLineWidth(1*t.pix),i.setStrokeStyle(o.gridColor),"radar"==o.gridType)a.forEach((function(t,r){var a=m(d/o.gridCount*e*Math.cos(t),d/o.gridCount*e*Math.sin(t),s);0===r?(n=a,i.moveTo(a.x,a.y)):i.lineTo(a.x,a.y)})),i.lineTo(n.x,n.y);else{var r=m(d/o.gridCount*e*Math.cos(1.5),d/o.gridCount*e*Math.sin(1.5),s);i.arc(s.x,s.y,s.y-r.y,0,2*Math.PI,!1)}i.stroke(),i.closePath()},p=1;p<=o.gridCount;p++)f(p);o.customColor=w(o.linearType,o.customColor,e,n);var g=Y(a,s,d,e,t,r);if(g.forEach((function(n,r){i.beginPath(),i.setLineWidth(o.borderWidth*t.pix),i.setStrokeStyle(n.color);var a,c=h(n.color,o.opacity);"custom"==o.linearType&&(a=i.createCircularGradient?i.createCircularGradient(s.x,s.y,d):i.createRadialGradient(s.x,s.y,0,s.x,s.y,d),a.addColorStop(0,h(o.customColor[e[r].linearIndex],o.opacity)),a.addColorStop(1,h(n.color,o.opacity)),c=a);if(i.setFillStyle(c),n.data.forEach((function(e,t){0===t?i.moveTo(e.position.x,e.position.y):i.lineTo(e.position.x,e.position.y)})),i.closePath(),i.fill(),!0===o.border&&i.stroke(),i.closePath(),!1!==t.dataPointShape){var l=n.data.map((function(e){return e.position}));Se(l,n.color,n.pointShape,i,t)}})),!0===o.axisLabel){var v=Math.max(o.max,Math.max.apply(null,T(e))),y=d/o.gridCount,x=t.fontSize*t.pix;i.setFontSize(x),i.setFillStyle(t.fontColor),i.setTextAlign("left");for(p=0;pl.x?n.xMax:l.x,n.yMin=n.yMinl.y?n.yMax:l.y}}return n}function ot(e,t,n,i,r,o){return{x:(t-n.xMin)*i+r,y:(n.yMax-e)*i+o}}function at(e,t,n,i,r,o){return{x:(t-r)/i+n.xMin,y:n.yMax-(e-o)/i}}function st(e,t,n){if(t[1]==n[1])return!1;if(t[1]>e[1]&&n[1]>e[1])return!1;if(t[1]e[1])return!1;if(n[1]==e[1]&&t[1]>e[1])return!1;if(t[0]t[o].area[2]||e[1]>t[o].area[3]||e[2]n||e[3]>i){r=!0;break}r=!1}return r}function ht(e,t,n){var i=e.series;switch(t){case"normal":for(var r=0;r.7},p=0;p4&&void 0!==arguments[4]?arguments[4]:1,o=u({},{type:"normal",autoColors:!0},t.extra.word);t.chartData.wordCloudData||(t.chartData.wordCloudData=ht(t,o.type,i)),i.beginPath(),i.setFillStyle(t.background),i.rect(0,0,t.width,t.height),i.fill(),i.save();var a=t.chartData.wordCloudData;i.translate(t.width/2,t.height/2);for(var s=0;s0&&(t.tooltip&&t.tooltip.index==s?i.strokeText(c,(a[s].areav[0]+5-t.width/2)*r-d*(1-r)/2,(a[s].areav[1]+5+l-t.height/2)*r):i.fillText(c,(a[s].areav[0]+5-t.width/2)*r-d*(1-r)/2,(a[s].areav[1]+5+l-t.height/2)*r)):a[s].area[0]>0&&(t.tooltip&&t.tooltip.index==s?i.strokeText(c,(a[s].area[0]+5-t.width/2)*r-d*(1-r)/2,(a[s].area[1]+5+l-t.height/2)*r):i.fillText(c,(a[s].area[0]+5-t.width/2)*r-d*(1-r)/2,(a[s].area[1]+5+l-t.height/2)*r)),i.stroke(),i.restore()}i.restore()}function pt(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=u({},{type:"funnel",activeWidth:10,activeOpacity:.3,border:!1,borderWidth:2,borderColor:"#FFFFFF",fillOpacity:1,labelAlign:"right",linearType:"none",customColor:[]},t.extra.funnel),a=(t.height-t.area[0]-t.area[2])/e.length,s={x:t.area[3]+(t.width-t.area[1]-t.area[3])/2,y:t.height-t.area[2]},c=o.activeWidth*t.pix,l=Math.min((t.width-t.area[1]-t.area[3])/2-c,(t.height-t.area[0]-t.area[2])/2-c);if(e=ee(e,l,o.type,a,r),i.save(),i.translate(s.x,s.y),o.customColor=w(o.linearType,o.customColor,e,n),"pyramid"==o.type)for(var d=0;d0?m[T].width+t.yAxis.padding*t.pix:m[T].width,S+=1):"right"==m[T].position&&(t.area[1]+=k>0?m[T].width+t.yAxis.padding*t.pix:m[T].width,k+=1)}else n.yAxisWidth=m;if(t.chartData.yAxisData=y,t.categories&&t.categories.length&&"radar"!==t.type&&"gauge"!==t.type&&"bar"!==t.type){t.chartData.xAxisData=he(t.categories,t,n);var O=V(t.categories,t,n,t.chartData.xAxisData.eachSpacing,i),P=O.xAxisHeight,C=O.angle;n.xAxisHeight=P,n._xAxisTextAngle_=C,t.area[2]+=P,t.chartData.categoriesData=O}else if("line"===t.type||"area"===t.type||"scatter"===t.type||"bubble"===t.type||"bar"===t.type){t.chartData.xAxisData=J(o,t,n,i),a=t.chartData.xAxisData.rangesFormat;var D=V(a,t,n,t.chartData.xAxisData.eachSpacing,i),F=D.xAxisHeight,_=D.angle;n.xAxisHeight=F,n._xAxisTextAngle_=_,t.area[2]+=F,t.chartData.categoriesData=D}else t.chartData.xAxisData={xAxisPoints:[]};if(t.enableScroll&&"right"==t.xAxis.scrollAlign&&void 0===t._scrollDistance_){var E=0,M=t.chartData.xAxisData.xAxisPoints,I=t.chartData.xAxisData.startX,R=t.chartData.xAxisData.endX,j=t.chartData.xAxisData.eachSpacing,K=j*(M.length-1),z=R-I;E=z-K,r.scrollOption.currentOffset=E,r.scrollOption.startTouchX=E,r.scrollOption.distance=0,r.scrollOption.lastMoveTime=0,t._scrollDistance_=E}switch("pie"!==e&&"ring"!==e&&"rose"!==e||(n._pieTextMaxLength_=!1===t.dataLabel?0:ae(l,n,i,t)),e){case"word":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),ft(o,t,n,i,e),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"map":i.clearRect(0,0,t.width,t.height),lt(o,t,n,i);break;case"funnel":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),t.chartData.funnelData=pt(o,t,n,i,e),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"line":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),Ve(a,t,n,i),qe(a,t,n,i);var r=Ze(o,t,n,i,e),s=r.xAxisPoints,c=r.calPoints,l=r.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=c,t.chartData.eachSpacing=l,Qe(o,t,n,i),!1!==t.enableMarkLine&&1===e&&Me(t,n,i),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e,l,s),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"scatter":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),Ve(a,t,n,i),qe(a,t,n,i);var r=He(o,t,n,i,e),s=r.xAxisPoints,c=r.calPoints,l=r.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=c,t.chartData.eachSpacing=l,Qe(o,t,n,i),!1!==t.enableMarkLine&&1===e&&Me(t,n,i),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e,l,s),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"bubble":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),Ve(a,t,n,i),qe(a,t,n,i);var r=We(o,t,n,i,e),s=r.xAxisPoints,c=r.calPoints,l=r.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=c,t.chartData.eachSpacing=l,Qe(o,t,n,i),!1!==t.enableMarkLine&&1===e&&Me(t,n,i),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e,l,s),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"mix":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),Ve(a,t,n,i),qe(a,t,n,i);var r=Ge(o,t,n,i,e),s=r.xAxisPoints,c=r.calPoints,l=r.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=c,t.chartData.eachSpacing=l,Qe(o,t,n,i),!1!==t.enableMarkLine&&1===e&&Me(t,n,i),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e,l,s),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"column":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),Ve(a,t,n,i),qe(a,t,n,i);var r=Ke(o,t,n,i,e),s=r.xAxisPoints,c=r.calPoints,l=r.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=c,t.chartData.eachSpacing=l,Qe(o,t,n,i),!1!==t.enableMarkLine&&1===e&&Me(t,n,i),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e,l,s),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"mount":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),Ve(a,t,n,i),qe(a,t,n,i);var r=ze(o,t,n,i,e),s=r.xAxisPoints,c=r.calPoints,l=r.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=c,t.chartData.eachSpacing=l,Qe(o,t,n,i),!1!==t.enableMarkLine&&1===e&&Me(t,n,i),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e,l,s),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"bar":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),qe(a,t,n,i);var r=Be(o,t,n,i,e),s=r.yAxisPoints,c=r.calPoints,l=r.eachSpacing;t.chartData.yAxisPoints=s,t.chartData.xAxisPoints=t.chartData.xAxisData.xAxisPoints,t.chartData.calPoints=c,t.chartData.eachSpacing=l,Qe(o,t,n,i),!1!==t.enableMarkLine&&1===e&&Me(t,n,i),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e,l,s),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"area":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),Ve(a,t,n,i),qe(a,t,n,i);var r=Ne(o,t,n,i,e),s=r.xAxisPoints,c=r.calPoints,l=r.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=c,t.chartData.eachSpacing=l,Qe(o,t,n,i),!1!==t.enableMarkLine&&1===e&&Me(t,n,i),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e,l,s),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"ring":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),t.chartData.pieData=Ye(o,t,n,i,e),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"pie":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),t.chartData.pieData=Ye(o,t,n,i,e),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"rose":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),t.chartData.pieData=$e(o,t,n,i,e),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"radar":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),t.chartData.radarData=nt(o,t,n,i,e),Je(t.series,t,n,i,t.chartData),Xe(t,n,i,e),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"arcbar":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),t.chartData.arcbarData=et(o,t,n,i,e),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"gauge":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),t.chartData.gaugeData=tt(a,o,t,n,i,e),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break;case"candle":this.animationInstance=new mt({timing:t.timing,duration:c,onProcess:function(e){i.clearRect(0,0,t.width,t.height),t.rotate&&ke(i,t),Ve(a,t,n,i),qe(a,t,n,i);var r=Ue(o,l,t,n,i,e),s=r.xAxisPoints,c=r.calPoints,u=r.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=c,t.chartData.eachSpacing=u,Qe(o,t,n,i),!1!==t.enableMarkLine&&1===e&&Me(t,n,i),Je(l||t.series,t,n,i,t.chartData),Xe(t,n,i,e,u,s),vt(t,i)},onAnimationFinish:function(){r.uevent.trigger("renderComplete")}});break}}function At(){this.events={}}mt.prototype.stop=function(){this.isStop=!0},At.prototype.addEventListener=function(e,t){this.events[e]=this.events[e]||[],this.events[e].push(t)},At.prototype.delEventListener=function(e){this.events[e]=[]},At.prototype.trigger=function(){for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.opts=u({},this.opts,e),this.opts.updateData=!0;var t=e.scrollPosition||"current";switch(t){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":var n=Ae(this.opts.series,this.opts,this.config,this.context),i=n.yAxisWidth;this.config.yAxisWidth=i;var r=0,o=he(this.opts.categories,this.opts,this.config),a=o.xAxisPoints,s=o.startX,c=o.endX,l=o.eachSpacing,d=l*(a.length-1),h=c-s;r=h-d,this.scrollOption={currentOffset:r,startTouchX:r,distance:0,lastMoveTime:0},this.opts._scrollDistance_=r;break}xt.call(this,this.opts.type,this.opts,this.config,this.context)},bt.prototype.zoom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.opts.xAxis.itemCount;if(!0===this.opts.enableScroll){var t=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=e.itemCount;var n=Ae(this.opts.series,this.opts,this.config,this.context),i=n.yAxisWidth;this.config.yAxisWidth=i;var r=0,o=he(this.opts.categories,this.opts,this.config),a=o.xAxisPoints,s=o.startX,c=o.endX,l=o.eachSpacing,u=l*t,d=c-s,h=d-l*(a.length-1);r=d/2-u,r>0&&(r=0),r=this.opts.categories.length?this.opts.categories.length:d,this.opts.animation=!1,this.opts.xAxis.itemCount=d;var h=0,f=he(this.opts.categories,this.opts,this.config),p=f.xAxisPoints,v=f.startX,y=f.endX,m=f.eachSpacing,x=m*this.scrollOption.moveCurrent1,A=y-v,b=A-m*(p.length-1);h=-x+Math.min(i[0].x,i[1].x)-this.opts.area[3]-m,h>0&&(h=0),h1&&void 0!==arguments[1]?arguments[1]:{},n=null;if(n=e.changedTouches?e.changedTouches[0]:e.mp.changedTouches[0],n){P(n,this.opts,e);var i=this.getLegendDataIndex(e);i>=0&&("candle"==this.opts.type?this.opts.seriesMA[i].show=!this.opts.seriesMA[i].show:this.opts.series[i].show=!this.opts.series[i].show,this.opts.animation=!!t.animation,this.opts._scrollDistance_=this.scrollOption.currentOffset,xt.call(this,this.opts.type,this.opts,this.config,this.context))}},bt.prototype.showToolTip=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;i=e.changedTouches?e.changedTouches[0]:e.mp.changedTouches[0],i||console.log("[uCharts] 未获取到event坐标信息");var r=P(i,this.opts,e),o=this.scrollOption.currentOffset,a=u({},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 s=this.getCurrentDataIndex(e),c=void 0==n.index?s.index:n.index;if(c>-1||c.length>0){var l=C(this.opts.series,c,s.group);if(0!==l.length){var d=_(l,this.opts,c,s.group,this.opts.categories,n),h=d.textList,f=d.offset;f.y=r.y,a.tooltip={textList:void 0!==n.textList?n.textList:h,offset:void 0!==n.offset?n.offset:f,option:n,index:c}}}xt.call(this,a.type,a,this.config,this.context)}if("mount"===this.opts.type){c=void 0==n.index?this.getCurrentDataIndex(e).index:n.index;if(c>-1){a=u({},this.opts,{animation:!1}),l=u({},a._series_[c]),h=[{text:n.formatter?n.formatter(l,void 0,c,a):l.name+": "+l.data,color:l.color}],f={x:a.chartData.calPoints[c].x,y:r.y};a.tooltip={textList:n.textList?n.textList:h,offset:void 0!==n.offset?n.offset:f,option:n,index:c}}xt.call(this,a.type,a,this.config,this.context)}if("bar"===this.opts.type){s=this.getCurrentDataIndex(e),c=void 0==n.index?s.index:n.index;if(c>-1||c.length>0){l=C(this.opts.series,c,s.group);if(0!==l.length){d=_(l,this.opts,c,s.group,this.opts.categories,n),h=d.textList,f=d.offset;f.x=r.x,a.tooltip={textList:void 0!==n.textList?n.textList:h,offset:void 0!==n.offset?n.offset:f,option:n,index:c}}}xt.call(this,a.type,a,this.config,this.context)}if("mix"===this.opts.type){s=this.getCurrentDataIndex(e),c=void 0==n.index?s.index:n.index;if(c>-1){o=this.scrollOption.currentOffset,a=u({},this.opts,{_scrollDistance_:o,animation:!1}),l=C(this.opts.series,c);if(0!==l.length){var p=E(l,this.opts,c,this.opts.categories,n);h=p.textList,f=p.offset;f.y=r.y,a.tooltip={textList:n.textList?n.textList:h,offset:void 0!==n.offset?n.offset:f,option:n,index:c}}}xt.call(this,a.type,a,this.config,this.context)}if("candle"===this.opts.type){s=this.getCurrentDataIndex(e),c=void 0==n.index?s.index:n.index;if(c>-1){o=this.scrollOption.currentOffset,a=u({},this.opts,{_scrollDistance_:o,animation:!1}),l=C(this.opts.series,c);if(0!==l.length){d=M(this.opts.series[0].data,l,this.opts,c,this.opts.categories,this.opts.extra.candle,n),h=d.textList,f=d.offset;f.y=r.y,a.tooltip={textList:n.textList?n.textList:h,offset:void 0!==n.offset?n.offset:f,option:n,index:c}}}xt.call(this,a.type,a,this.config,this.context)}if("pie"===this.opts.type||"ring"===this.opts.type||"rose"===this.opts.type||"funnel"===this.opts.type){c=void 0==n.index?this.getCurrentDataIndex(e):n.index;if(c>-1){a=u({},this.opts,{animation:!1}),l=u({},a._series_[c]),h=[{text:n.formatter?n.formatter(l,void 0,c,a):l.name+": "+l.data,color:l.color}],f={x:r.x,y:r.y};a.tooltip={textList:n.textList?n.textList:h,offset:void 0!==n.offset?n.offset:f,option:n,index:c}}xt.call(this,a.type,a,this.config,this.context)}if("map"===this.opts.type){c=void 0==n.index?this.getCurrentDataIndex(e):n.index;if(c>-1){a=u({},this.opts,{animation:!1}),l=u({},this.opts.series[c]);l.name=l.properties.name;h=[{text:n.formatter?n.formatter(l,void 0,c,this.opts):l.name,color:l.color}],f={x:r.x,y:r.y};a.tooltip={textList:n.textList?n.textList:h,offset:void 0!==n.offset?n.offset:f,option:n,index:c}}a.updateData=!1,xt.call(this,a.type,a,this.config,this.context)}if("word"===this.opts.type){c=void 0==n.index?this.getCurrentDataIndex(e):n.index;if(c>-1){a=u({},this.opts,{animation:!1}),l=u({},this.opts.series[c]),h=[{text:n.formatter?n.formatter(l,void 0,c,this.opts):l.name,color:l.color}],f={x:r.x,y:r.y};a.tooltip={textList:n.textList?n.textList:h,offset:void 0!==n.offset?n.offset:f,option:n,index:c}}a.updateData=!1,xt.call(this,a.type,a,this.config,this.context)}if("radar"===this.opts.type){c=void 0==n.index?this.getCurrentDataIndex(e):n.index;if(c>-1){a=u({},this.opts,{animation:!1}),l=C(this.opts.series,c);if(0!==l.length){h=l.map((function(e){return{text:n.formatter?n.formatter(e,t.opts.categories[c],c,t.opts):e.name+": "+e.data,color:e.color}})),f={x:r.x,y:r.y};a.tooltip={textList:n.textList?n.textList:h,offset:void 0!==n.offset?n.offset:f,option:n,index:c}}}xt.call(this,a.type,a,this.config,this.context)}},bt.prototype.translate=function(e){this.scrollOption={currentOffset:e,startTouchX:e,distance:0,lastMoveTime:0};var t=u({},this.opts,{_scrollDistance_:e,animation:!1});xt.call(this,this.opts.type,t,this.config,this.context)},bt.prototype.scrollStart=function(e){var t=null;t=e.changedTouches?e.changedTouches[0]:e.mp.changedTouches[0];var n=P(t,this.opts,e);t&&!0===this.opts.enableScroll&&(this.scrollOption.startTouchX=n.x)},bt.prototype.scroll=function(e){0===this.scrollOption.lastMoveTime&&(this.scrollOption.lastMoveTime=Date.now());var t=this.opts.touchMoveLimit||60,n=Date.now(),i=n-this.scrollOption.lastMoveTime;if(!(i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),F(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;F(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:E(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=n),g}}}function A(e,t,n,i){var r=t&&t.prototype instanceof w?t:w,o=Object.create(r.prototype),a=new _(i||[]);return o._invoke=P(e,n,a),o}function b(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(i){return{type:"throw",arg:i}}}function w(){}function k(){}function S(){}function T(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function O(e){function t(n,i,o,a){var s=b(e[n],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"===typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then((function(e){t("next",e,o,a)}),(function(e){t("throw",e,o,a)})):Promise.resolve(l).then((function(e){c.value=e,o(c)}),(function(e){return t("throw",e,o,a)}))}a(s.arg)}var n;function i(e,i){function r(){return new Promise((function(n,r){t(e,i,n,r)}))}return n=n?n.then(r,r):r()}this._invoke=i}function P(e,t,n){var i=d;return function(r,o){if(i===f)throw new Error("Generator is already running");if(i===p){if("throw"===r)throw o;return M()}n.method=r,n.arg=o;while(1){var a=n.delegate;if(a){var s=C(a,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=f;var c=b(e,t,n);if("normal"===c.type){if(i=n.done?p:h,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=p,n.method="throw",n.arg=c.arg)}}}function C(e,t){var i=e.iterator[t.method];if(i===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,C(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var r=b(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,g;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function D(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function F(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(D,this),this.reset(!0)}function E(e){if(e){var t=e[a];if(t)return t.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function t(){while(++i=0;--r){var o,a=e[r];if("[]"===a)o=[],o=o.concat(i);else{o=n.plainObjects?Object.create(null):{};var s="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(s,10);!isNaN(c)&&a!==s&&String(c)===s&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(o=[],o[c]=i):o[s]=i}i=o}return i},c=function(e,t,n){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=o.exec(i),l=c?i.slice(0,c.index):i,u=[];if(l){if(!n.plainObjects&&r.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}var d=0;while(null!==(c=a.exec(i))&&d=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function g(e,t){if(e){if("string"===typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n>>2]>>>24-o%4*8&255;t[i+o>>>2]|=a<<24-(i+o)%4*8}else for(o=0;o>>2]=n[o>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,i=[],r=function(t){t=t;var n=987654321,i=4294967295;return function(){var r=((n=36969*(65535&n)+(n>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return r/=4294967296,(r+=.5)*(e.random()>.5?1:-1)}},o=0;o>>2]>>>24-r%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new a.init(n,t/2)}},l=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r>>2]>>>24-r%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new a.init(n,t)}},u=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},d=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,i=n.words,r=n.sigBytes,o=this.blockSize,s=r/(4*o),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,l=e.min(4*c,r);if(c){for(var u=0;u>>24)|4278255360&(r<<24|r>>>8)}var o=this._hash.words,a=e[t+0],c=e[t+1],f=e[t+2],p=e[t+3],g=e[t+4],v=e[t+5],y=e[t+6],m=e[t+7],x=e[t+8],A=e[t+9],b=e[t+10],w=e[t+11],k=e[t+12],S=e[t+13],T=e[t+14],O=e[t+15],P=o[0],C=o[1],D=o[2],F=o[3];P=l(P,C,D,F,a,7,s[0]),F=l(F,P,C,D,c,12,s[1]),D=l(D,F,P,C,f,17,s[2]),C=l(C,D,F,P,p,22,s[3]),P=l(P,C,D,F,g,7,s[4]),F=l(F,P,C,D,v,12,s[5]),D=l(D,F,P,C,y,17,s[6]),C=l(C,D,F,P,m,22,s[7]),P=l(P,C,D,F,x,7,s[8]),F=l(F,P,C,D,A,12,s[9]),D=l(D,F,P,C,b,17,s[10]),C=l(C,D,F,P,w,22,s[11]),P=l(P,C,D,F,k,7,s[12]),F=l(F,P,C,D,S,12,s[13]),D=l(D,F,P,C,T,17,s[14]),P=u(P,C=l(C,D,F,P,O,22,s[15]),D,F,c,5,s[16]),F=u(F,P,C,D,y,9,s[17]),D=u(D,F,P,C,w,14,s[18]),C=u(C,D,F,P,a,20,s[19]),P=u(P,C,D,F,v,5,s[20]),F=u(F,P,C,D,b,9,s[21]),D=u(D,F,P,C,O,14,s[22]),C=u(C,D,F,P,g,20,s[23]),P=u(P,C,D,F,A,5,s[24]),F=u(F,P,C,D,T,9,s[25]),D=u(D,F,P,C,p,14,s[26]),C=u(C,D,F,P,x,20,s[27]),P=u(P,C,D,F,S,5,s[28]),F=u(F,P,C,D,f,9,s[29]),D=u(D,F,P,C,m,14,s[30]),P=d(P,C=u(C,D,F,P,k,20,s[31]),D,F,v,4,s[32]),F=d(F,P,C,D,x,11,s[33]),D=d(D,F,P,C,w,16,s[34]),C=d(C,D,F,P,T,23,s[35]),P=d(P,C,D,F,c,4,s[36]),F=d(F,P,C,D,g,11,s[37]),D=d(D,F,P,C,m,16,s[38]),C=d(C,D,F,P,b,23,s[39]),P=d(P,C,D,F,S,4,s[40]),F=d(F,P,C,D,a,11,s[41]),D=d(D,F,P,C,p,16,s[42]),C=d(C,D,F,P,y,23,s[43]),P=d(P,C,D,F,A,4,s[44]),F=d(F,P,C,D,k,11,s[45]),D=d(D,F,P,C,O,16,s[46]),P=h(P,C=d(C,D,F,P,f,23,s[47]),D,F,a,6,s[48]),F=h(F,P,C,D,m,10,s[49]),D=h(D,F,P,C,T,15,s[50]),C=h(C,D,F,P,v,21,s[51]),P=h(P,C,D,F,k,6,s[52]),F=h(F,P,C,D,p,10,s[53]),D=h(D,F,P,C,b,15,s[54]),C=h(C,D,F,P,c,21,s[55]),P=h(P,C,D,F,x,6,s[56]),F=h(F,P,C,D,O,10,s[57]),D=h(D,F,P,C,y,15,s[58]),C=h(C,D,F,P,S,21,s[59]),P=h(P,C,D,F,g,6,s[60]),F=h(F,P,C,D,w,10,s[61]),D=h(D,F,P,C,f,15,s[62]),C=h(C,D,F,P,A,21,s[63]),o[0]=o[0]+P|0,o[1]=o[1]+C|0,o[2]=o[2]+D|0,o[3]=o[3]+F|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;n[r>>>5]|=128<<24-r%32;var o=e.floor(i/4294967296),a=i;n[15+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(r+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,i,r,o,a){var s=e+(t&n|~t&i)+r+a;return(s<>>32-o)+t}function u(e,t,n,i,r,o,a){var s=e+(t&i|n&~i)+r+a;return(s<>>32-o)+t}function d(e,t,n,i,r,o,a){var s=e+(t^n^i)+r+a;return(s<