@canvasjs/charts 3.7.27 → 3.7.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/canvasjs.min.js +46 -46
- package/package.json +1 -1
package/LICENSE
CHANGED
package/canvasjs.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
CanvasJS Chart - v3.7.
|
|
2
|
+
CanvasJS Chart - v3.7.30 GA - https://canvasjs.com/
|
|
3
3
|
Copyright 2023 fenopix
|
|
4
4
|
|
|
5
5
|
--------------------- License Information --------------------
|
|
@@ -518,30 +518,30 @@ b[0]=0;c<y.length;c++)b.push(Math.abs(y[c].y)*E/a);return b}function c(){var a=T
|
|
|
518
518
|
2,a-=k,m=e-h,h+=e-h,m+=0==p?0:a/p,h+=a/p,k=!0):(m=(Math.abs(aa)*b-Math.sqrt(p))/2,p=b-2*m/Math.abs(aa),h+=m,h>e&&(h-=m,p=c,k=(b+p)*(e-h)/2,a-=k,m=e-h,h+=e-h,m+=a/p,h+=a/p,k=!0),b=p)),d.push(m);return d}function b(){if(u&&y){for(var a,b,c,d,e,f,l,k,h,m,p,q,t,n,r,C=[],x=[],v={percent:null,total:null},z=null,D=0;D<y.length;D++)r=R[D],r="undefined"!==typeof r.x5?(r.y2+r.y4)/2:(r.y2+r.y3)/2,r=g(r).x2+1,C[D]=K-r-X;r=0.5*X;for(var D=0,B=y.length-1;D<y.length||0<=B;D++,B--){b=u.reversed?y[B]:y[D];a=b.color?
|
|
519
519
|
b.color:u.reversed?u._colorSet[(y.length-1-D)%u._colorSet.length]:u._colorSet[D%u._colorSet.length];c=b.indexLabelPlacement||u.indexLabelPlacement||"outside";n=b.indexLabelTextAlign||u.indexLabelTextAlign||"left";d=b.indexLabelBackgroundColor||u.indexLabelBackgroundColor||(w?"transparent":null);e=b.indexLabelFontColor||u.indexLabelFontColor||"#979797";f=s(b.indexLabelFontSize)?u.indexLabelFontSize:b.indexLabelFontSize;l=b.indexLabelFontStyle||u.indexLabelFontStyle||"normal";k=b.indexLabelFontFamily||
|
|
520
520
|
u.indexLabelFontFamily||"arial";h=b.indexLabelFontWeight||u.indexLabelFontWeight||"normal";a=b.indexLabelLineColor||u.options.indexLabelLineColor||a;m="number"===typeof b.indexLabelLineThickness?b.indexLabelLineThickness:"number"===typeof u.indexLabelLineThickness?u.indexLabelLineThickness:2;p=b.indexLabelLineDashType||u.indexLabelLineDashType||"solid";q="undefined"!==typeof b.indexLabelWrap?b.indexLabelWrap:"undefined"!==typeof u.indexLabelWrap?u.indexLabelWrap:!0;t=u.dataPointIds[D];A._eventManager.objectMap[t]=
|
|
521
|
-
{id:t,objectType:"dataPoint",dataPointIndex:D,dataSeriesIndex:0,funnelSection:R[u.reversed?y.length-1-D:D]};"inside"===u.indexLabelPlacement&&(C[D]=D!==ca?u.reversed?R[D].x2-R[D].x1:R[D].x3-R[D].x4:R[D].x3-R[D].x6,20>C[D]&&(C[D]=D!==ca?u.reversed?R[D].x3-R[D].x4:R[D].x2-R[D].x1:R[D].x2-R[D].x1,C[D]/=2));t=b.indexLabelMaxWidth?b.indexLabelMaxWidth:u.options.indexLabelMaxWidth?u.indexLabelMaxWidth:C[D];if(t>C[D]||0>t)t=C[D];x[D]="inside"===u.indexLabelPlacement?R[D].height:!1;v=
|
|
522
|
-
b);if(u.indexLabelFormatter||b.indexLabelFormatter)z={chart:A.options,dataSeries:u,dataPoint:b,total:v.total,percent:v.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(z):b.indexLabel?A.replaceKeywordsWithValue(b.indexLabel,b,u,D):u.indexLabelFormatter?u.indexLabelFormatter(z):u.indexLabel?A.replaceKeywordsWithValue(u.indexLabel,b,u,D):b.label?b.label:"";0>=m&&(m=0);1E3>t&&1E3-t<r&&(t+=1E3-t);P.roundRect||Da(P);c=new ja(P,{fontSize:f,fontFamily:k,fontColor:e,fontStyle:l,
|
|
523
|
-
textAlign:n,backgroundColor:d,maxWidth:t,maxHeight:!1===x[D]?q?4.28571429*f:1.5*f:x[D],text:b,padding:da});c.measureText();I.push({textBlock:c,id:u.reversed?B:D,isDirty:!1,lineColor:a,lineThickness:m,lineDashType:p,height:c.height<c.maxHeight?c.height:c.maxHeight,width:c.width<c.maxWidth?c.width:c.maxWidth})}}}function e(){var a,b,c,d,e,f=[];e=!1;c=0;for(var g,l=K-V-X/2,l=u.options.indexLabelMaxWidth?u.indexLabelMaxWidth>l?l:u.indexLabelMaxWidth:l,k=I.length-1;0<=k;k--){g=
|
|
524
|
-
b=(a=q(k)<R.length?I[q(k)]:null)?a.textBlock:null;c=c.height;a&&d.y+c+da>b.y&&(e=!0);c=g.indexLabelMaxWidth||l;if(c>l||0>c)c=l;f.push(c)}if(e)for(k=I.length-1;0<=k;k--)a=R[k],I[k].textBlock.maxWidth=f[f.length-(k+1)],I[k].textBlock.measureText(),I[k].textBlock.x=K-l,c=I[k].textBlock.height<I[k].textBlock.maxHeight?I[k].textBlock.height:I[k].textBlock.maxHeight,e=I[k].textBlock.width<I[k].textBlock.maxWidth?I[k].textBlock.width:I[k].textBlock.maxWidth,I[k].height=c,
|
|
525
|
-
(a.y2+a.y4)/2:(a.y2+a.y3)/2,I[k].textBlock.y=c-I[k].height/2,u.reversed?(I[k].textBlock.y+I[k].height>U+z&&(I[k].textBlock.y=U+z-I[k].height),I[k].textBlock.y<ta-z&&(I[k].textBlock.y=ta-z)):(I[k].textBlock.y<U-z&&(I[k].textBlock.y=U-z),I[k].textBlock.y+I[k].height>ta+z&&(I[k].textBlock.y=ta+z-I[k].height))}function f(){var a,b,c,d;if("inside"!==u.indexLabelPlacement)for(var e=0;e<R.length;e++)0==I[e].textBlock.text.length?I[e].isDirty=!0:(a=R[e],c="undefined"!==
|
|
526
|
-
2,b=u.reversed?"undefined"!==typeof a.x5?c>Ca?g(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?c<Ca?g(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,I[e].textBlock.x=b+X,I[e].textBlock.y=c-I[e].height/2,u.reversed?(I[e].textBlock.y+I[e].height>U+z&&(I[e].textBlock.y=U+z-I[e].height),I[e].textBlock.y<ta-z&&(I[e].textBlock.y=ta-z)):(I[e].textBlock.y<U-z&&(I[e].textBlock.y=U-z),I[e].textBlock.y+I[e].height>ta+z&&(I[e].textBlock.y=ta+z-I[e].height)));
|
|
527
|
-
I[e].isDirty=!0:(a=R[e],b=a.height,c=I[e].height,d=I[e].width,b>=c?(b=e!=ca?(a.x4+a.x3)/2-d/2:(a.x5+a.x4)/2-d/2,c=e!=ca?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,I[e].textBlock.x=b,I[e].textBlock.y=c):I[e].isDirty=!0)}function l(){function a(b,c){var d;if(0>b||b>=I.length)return 0;var e,f=I[b].textBlock;if(0>c){c*=-1;e=p(b);d=h(e,b);if(d>=c)return f.y-=c,c;if(0==b)return 0<d&&(f.y-=d),d;d+=a(e,-(c-d));0<d&&(f.y-=d);return d}e=q(b);d=h(b,e);if(d>=
|
|
528
|
-
d+=a(e,c-d);0<d&&(f.y+=d);return d}function b(){var a,d,e,f,g=0,l;f=(N-$+2*z)/m;l=m;for(var k,h=1;h<l;h++){e=h*f;for(var t=I.length-1;0<=t;t--)!I[t].isDirty&&(I[t].textBlock.y<e&&I[t].textBlock.y+I[t].height>e)&&(k=q(t),!(k>=I.length-1)&&I[t].textBlock.y+I[t].height+da>I[k].textBlock.y&&(I[t].textBlock.y=I[t].textBlock.y+I[t].height-e>e-I[t].textBlock.y?e+1:e-I[t].height-1))}for(k=R.length-1;0<k;k--)if(!I[k].isDirty){e=p(k);if(0>e&&(e=0,I[e].isDirty))break;
|
|
529
|
-
d||k;f=k;for(l=0;I[f].textBlock.y<I[e].textBlock.y+I[e].height+da;){a=a||I[f].textBlock.y+I[f].height;l+=I[f].height;l+=da;f=e;if(0>=f){f=0;l+=I[f].height;break}e=p(f);if(0>e){f=0;l+=I[f].height;break}}if(f!=k){g=I[f].textBlock.y;a-=g;a=l-a;g=c(a,d,f);break}}}return g}function c(a,b,d){var e=[],f=0,g=0;for(a=Math.abs(a);d<=b;d++)e.push(R[d]);e.sort(function(a,b){return a.height-b.height});for(d=0;d<e.length;d++)if(b=e[d],f<a)g++,f+=I[b.id].height+
|
|
530
|
-
"",I[b.id].isDirty=!0,I[b.id].textBlock.measureText();else break;return g}for(var d,e,f,g,l,k,m=1,r=0;r<2*m;r++){for(var n=I.length-1;0<=n&&!(0<=p(n)&&p(n),f=I[n],g=f.textBlock,k=(l=q(n)<R.length?I[q(n)]:null)?l.textBlock:null,d=+f.height.toFixed(6),e=+g.y.toFixed(6),!f.isDirty&&(l&&e+d+da>+k.y.toFixed(6))&&(d=g.y+d+da-k.y,e=a(n,-d),e<d&&(0<e&&(d-=e),e=a(q(n),d),e!=d)));n--);b()}}function h(a,b){return(b<R.length?I[b].textBlock.y:u.reversed?U+z:
|
|
531
|
-
da)}function n(a,b,c){var d,e,g,l=[],h=z,p=[];-1!==b&&(0<=Z.indexOf(b)?(e=Z.indexOf(b),Z.splice(e,1)):(Z.push(b),Z=Z.sort(function(a,b){return a-b})));if(0===Z.length)l=ia;else{e=z*(1!=Z.length||0!=Z[0]&&Z[0]!=R.length-1?2:1)/k();for(var q=0;q<R.length;q++){if(1==Z.length&&0==Z[0]){if(0===q){l.push(ia[q]);d=h;continue}}else 0===q&&(d=-1*h);l.push(ia[q]+d);if(0<=Z.indexOf(q)||q<R.length&&0<=Z.indexOf(q+1))d+=e}}g=function(){for(var a=[],b=
|
|
532
|
-
duration:c||500,easingFunction:function(a,b,c,d){return M.easing.easeOutQuart(a,b,c,d)},changeSection:function(a){for(var b,c,d=0;d<R.length;d++)b=g[d],c=R[d],b*=a,"undefined"===typeof p[d]&&(p[d]=0),0>p&&(p*=-1),c.y1+=b-p[d],c.y2+=b-p[d],c.y3+=b-p[d],c.y4+=b-p[d],c.y5&&(c.y5+=b-p[d],c.y6+=b-p[d]),p[d]=b}};a._animator.animate(0,c,function(c){var d=a.plotArea.ctx||a.ctx;ha=!0;d.clearRect(x.x1,x.y1,x.x2-x.x1,x.y2-
|
|
533
|
-
b);var e={};e.dataSeries=u;e.dataPoint=u.reversed?u.dataPoints[y.length-1-b]:u.dataPoints[b];e.index=u.reversed?y.length-1-b:b;a.toolTip.highlightObjects([e]);for(e=0;e<R.length;e++)ra(d,R[e],u.fillOpacity);v(d);L&&("inside"!==u.indexLabelPlacement?m(d):f(),r(d));1<=c&&(ha=!1)},null,M.easing.easeOutQuart)}function k(){for(var a=0,b=0;b<R.length-1;b++)(0<=Z.indexOf(b)||0<=Z.indexOf(b+1))&&a++;return a}function m(a){for(var b,
|
|
534
|
-
2<<0)+e,b=g(c).x2-1,d=I[f].textBlock.x,e=(I[f].textBlock.y+I[f].height/2<<0)+e,I[f].isDirty||0==I[f].lineThickness||(a.strokeStyle=I[f].lineColor,a.lineWidth=I[f].lineThickness,a.setLineDash&&a.setLineDash(J(I[f].lineDashType,I[f].lineThickness)),a.beginPath(),a.moveTo(b,c),a.lineTo(d,e),a.stroke())}function p(a){for(a-=1;-1<=a&&-1!=a&&I[a].isDirty;a--);return a}function q(a){for(a+=1;a<=R.length&&a!=R.length&&I[a].isDirty;a++);
|
|
535
|
-
a){b=R[c];break}return b?(a=b.y6?a>b.y6?b.x3+(b.x4-b.x3)/(b.y4-b.y3)*(a-b.y3):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2),{x1:a,x2:a}):-1}function r(a){for(var b=0;b<R.length;b++)I[b].isDirty||(a&&(I[b].textBlock.ctx=a),I[b].textBlock.render(!0))}function v(a){A.plotArea.layoutManager.reset();a.roundRect||Da(a);A.title&&(A.title.dockInsidePlotArea||"center"===A.title.horizontalAlign&&"center"===
|
|
536
|
-
0;b<A.subtitles.length;b++){var c=A.subtitles[b];if(c.dockInsidePlotArea||"center"===c.horizontalAlign&&"center"===c.verticalAlign)A.subtitles.ctx=a,c.render()}A.legend&&(A.legend.dockInsidePlotArea||"center"===A.legend.horizontalAlign&&"center"===A.legend.verticalAlign)&&(A.legend.ctx=a,A.legend.setLayout(),A.legend.render());va.fNg&&va.fNg(A)}var A=this;if(!(0>=a.dataSeriesIndexes.length)){for(var u=this.data[a.dataSeriesIndexes[0]],
|
|
537
|
-
D=0,E=x.height-2*z,G=Math.min(x.width-2*B,2.8*x.height),L=!1,S=0;S<y.length;S++)if(!L&&("undefined"!==typeof y[S].indexLabel&&null!==y[S].indexLabel&&0<y[S].indexLabel.toString().length)&&(L=!0),!L&&("undefined"!==typeof y[S].label&&null!==y[S].label&&0<y[S].label.toString().length)&&(L=!0),!L&&"function"===typeof u.indexLabelFormatter||"function"===typeof y[S].indexLabelFormatter)L=!0;L=L||"undefined"!==typeof u.indexLabel&&null!==u.indexLabel&&
|
|
538
|
-
L||(B=(x.width-0.75*G)/2);var S=x.x1+B,K=x.x2-B,$=x.y1+z,N=x.y2-z,P=a.targetCanvasCtx||this.plotArea.ctx||this.ctx;if(0!=u.length&&(u.dataPoints&&u.visible)&&0!==y.length){var Q,F;a=75*G/100;var X=30*(K-a)/100;"funnel"===u.type?(Q=s(u.options.neckHeight)?0.35*E:u.neckHeight,F=s(u.options.neckWidth)?0.25*a:u.neckWidth,"string"===typeof Q&&Q.match(/%$/)?(Q=parseInt(Q),Q=Q*E/100):Q=parseInt(Q),"string"===typeof F&&F.match(/%$/)?(F=parseInt(F),
|
|
539
|
-
0>=F&&(F=0)):"pyramid"===u.type&&(F=Q=0,u.reversed=u.reversed?!1:!0);var B=S+a/2,T=S,V=S+a,U=u.reversed?N:$,O=B-F/2,W=B+F/2,Ca=u.reversed?$+Q:N-Q,ta=u.reversed?$:N;a=[];var B=[],R=[],G=[],Y=$,ca,aa=(Ca-U)/(O-T),fa=-aa,S="area"===(u.valueRepresents?u.valueRepresents:"height")?c():d();if(-1!==S){if(u.reversed)for(G.push(Y),F=S.length-1;0<F;F--)Y+=S[F],G.push(Y);else for(F=0;F<S.length;F++)Y+=S[F],G.push(Y);if(u.reversed)for(F=0;F<S.length;F++)G[F]<
|
|
540
|
-
aa),B.push((G[F]-U+fa*V)/fa));else for(F=0;F<S.length;F++)G[F]<Ca?(a.push((G[F]-U+aa*T)/aa),B.push((G[F]-U+fa*V)/fa),ca=F):(a.push(O),B.push(W));for(F=0;F<S.length-1;F++)Y=u.reversed?y[y.length-1-F].color?y[y.length-1-F].color:u._colorSet[(y.length-1-F)%u._colorSet.length]:y[F].color?y[F].color:u._colorSet[F%u._colorSet.length],F===ca?R.push({x1:a[F],y1:G[F],x2:B[F],y2:G[F],x3:W,y3:Ca,x4:B[F+1],y4:G[F+1],x5:a[F+1],y5:G[F+1],x6:O,y6:Ca,id:F,height:G[F+
|
|
541
|
-
y2:G[F],x3:B[F+1],y3:G[F+1],x4:a[F+1],y4:G[F+1],id:F,height:G[F+1]-G[F],color:Y});var da=2,I=[],ha=!1,Z=[],ia=[],S=!1;a=a=0;Ea(Z);for(F=0;F<y.length;F++)y[F].exploded&&(S=!0,u.reversed?Z.push(y.length-1-F):Z.push(F));P.clearRect(x.x1,x.y1,x.width,x.height);P.fillStyle=A.backgroundColor;P.fillRect(x.x1,x.y1,x.width,x.height);if(L&&u.visible&&(b(),f(),e(),"inside"!==u.indexLabelPlacement)){l();for(F=0;F<y.length;F++)I[F].isDirty||(a=I[F].textBlock.x+
|
|
542
|
-
0;F<R.length;F++)R[F].x1+=D,R[F].x2+=D,R[F].x3+=D,R[F].x4+=D,R[F].x5&&(R[F].x5+=D,R[F].x6+=D),I[F].textBlock.x+=D}for(F=0;F<R.length;F++)D=R[F],ra(P,D,u.fillOpacity),ia.push(D.y1);v(P);L&&u.visible&&("inside"===u.indexLabelPlacement||A.animationEnabled||m(P),A.animationEnabled||r());if(!L)for(F=0;F<y.length;F++)D=u.dataPointIds[F],a={id:D,objectType:"dataPoint",dataPointIndex:F,dataSeriesIndex:0,funnelSection:R[u.reversed?y.length-1-F:F]},A._eventManager.objectMap[D]=
|
|
543
|
-
|
|
544
|
-
b);1<=a&&(n(A,-1,500),v(A.plotArea.ctx||A.ctx))},easingFunction:M.easing.easeInQuad,animationBase:0}}}}};n.prototype.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();n.prototype.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||
|
|
521
|
+
{id:t,objectType:"dataPoint",dataPointIndex:D,dataSeriesIndex:0,funnelSection:R[u.reversed?y.length-1-D:D]};"inside"===u.indexLabelPlacement&&(C[D]=D!==ca?u.reversed?R[D].x2-R[D].x1:R[D].x3-R[D].x4:R[D].x3-R[D].x6,20>C[D]&&(C[D]=D!==ca?u.reversed?R[D].x3-R[D].x4:R[D].x2-R[D].x1:R[D].x2-R[D].x1,C[D]/=2));t=b.indexLabelMaxWidth?b.indexLabelMaxWidth:u.options.indexLabelMaxWidth?u.indexLabelMaxWidth:C[D];if(t>C[D]||0>t)t=C[D];x[D]="inside"===u.indexLabelPlacement?q?Math.max(R[D].height,f):1.5*f:!1;v=
|
|
522
|
+
A.getPercentAndTotal(u,b);if(u.indexLabelFormatter||b.indexLabelFormatter)z={chart:A.options,dataSeries:u,dataPoint:b,total:v.total,percent:v.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(z):b.indexLabel?A.replaceKeywordsWithValue(b.indexLabel,b,u,D):u.indexLabelFormatter?u.indexLabelFormatter(z):u.indexLabel?A.replaceKeywordsWithValue(u.indexLabel,b,u,D):b.label?b.label:"";0>=m&&(m=0);1E3>t&&1E3-t<r&&(t+=1E3-t);P.roundRect||Da(P);c=new ja(P,{fontSize:f,fontFamily:k,fontColor:e,fontStyle:l,
|
|
523
|
+
fontWeight:h,horizontalAlign:c,textAlign:n,backgroundColor:d,maxWidth:t,maxHeight:!1===x[D]?q?4.28571429*f:1.5*f:x[D],text:b,padding:da});c.measureText();I.push({textBlock:c,id:u.reversed?B:D,isDirty:!1,lineColor:a,lineThickness:m,lineDashType:p,height:c.height<c.maxHeight?c.height:c.maxHeight,width:c.width<c.maxWidth?c.width:c.maxWidth})}}}function e(){var a,b,c,d,e,f=[];e=!1;c=0;for(var g,l=K-V-X/2,l=u.options.indexLabelMaxWidth?u.indexLabelMaxWidth>l?l:u.indexLabelMaxWidth:l,k=I.length-1;0<=k;k--){g=
|
|
524
|
+
y[I[k].id];c=I[k];d=c.textBlock;b=(a=q(k)<R.length?I[q(k)]:null)?a.textBlock:null;c=c.height;a&&d.y+c+da>b.y&&(e=!0);c=g.indexLabelMaxWidth||l;if(c>l||0>c)c=l;f.push(c)}if(e)for(k=I.length-1;0<=k;k--)a=R[k],I[k].textBlock.maxWidth=f[f.length-(k+1)],I[k].textBlock.measureText(),I[k].textBlock.x=K-l,c=I[k].textBlock.height<I[k].textBlock.maxHeight?I[k].textBlock.height:I[k].textBlock.maxHeight,e=I[k].textBlock.width<I[k].textBlock.maxWidth?I[k].textBlock.width:I[k].textBlock.maxWidth,I[k].height=c,
|
|
525
|
+
I[k].width=e,c="undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,I[k].textBlock.y=c-I[k].height/2,u.reversed?(I[k].textBlock.y+I[k].height>U+z&&(I[k].textBlock.y=U+z-I[k].height),I[k].textBlock.y<ta-z&&(I[k].textBlock.y=ta-z)):(I[k].textBlock.y<U-z&&(I[k].textBlock.y=U-z),I[k].textBlock.y+I[k].height>ta+z&&(I[k].textBlock.y=ta+z-I[k].height))}function f(){var a,b,c,d;if("inside"!==u.indexLabelPlacement)for(var e=0;e<R.length;e++)0==I[e].textBlock.text.length?I[e].isDirty=!0:(a=R[e],c="undefined"!==
|
|
526
|
+
typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,b=u.reversed?"undefined"!==typeof a.x5?c>Ca?g(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?c<Ca?g(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,I[e].textBlock.x=b+X,I[e].textBlock.y=c-I[e].height/2,u.reversed?(I[e].textBlock.y+I[e].height>U+z&&(I[e].textBlock.y=U+z-I[e].height),I[e].textBlock.y<ta-z&&(I[e].textBlock.y=ta-z)):(I[e].textBlock.y<U-z&&(I[e].textBlock.y=U-z),I[e].textBlock.y+I[e].height>ta+z&&(I[e].textBlock.y=ta+z-I[e].height)));
|
|
527
|
+
else for(e=0;e<R.length;e++)0==I[e].textBlock.text.length?I[e].isDirty=!0:(a=R[e],b=a.height,c=I[e].height,d=I[e].width,b>=c?(b=e!=ca?(a.x4+a.x3)/2-d/2:(a.x5+a.x4)/2-d/2,c=e!=ca?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,I[e].textBlock.x=b,I[e].textBlock.y=c):I[e].isDirty=!0)}function l(){function a(b,c){var d;if(0>b||b>=I.length)return 0;var e,f=I[b].textBlock;if(0>c){c*=-1;e=p(b);d=h(e,b);if(d>=c)return f.y-=c,c;if(0==b)return 0<d&&(f.y-=d),d;d+=a(e,-(c-d));0<d&&(f.y-=d);return d}e=q(b);d=h(b,e);if(d>=
|
|
528
|
+
c)return f.y+=c,c;if(b==R.length-1)return 0<d&&(f.y+=d),d;d+=a(e,c-d);0<d&&(f.y+=d);return d}function b(){var a,d,e,f,g=0,l;f=(N-$+2*z)/m;l=m;for(var k,h=1;h<l;h++){e=h*f;for(var t=I.length-1;0<=t;t--)!I[t].isDirty&&(I[t].textBlock.y<e&&I[t].textBlock.y+I[t].height>e)&&(k=q(t),!(k>=I.length-1)&&I[t].textBlock.y+I[t].height+da>I[k].textBlock.y&&(I[t].textBlock.y=I[t].textBlock.y+I[t].height-e>e-I[t].textBlock.y?e+1:e-I[t].height-1))}for(k=R.length-1;0<k;k--)if(!I[k].isDirty){e=p(k);if(0>e&&(e=0,I[e].isDirty))break;
|
|
529
|
+
if(I[k].textBlock.y<I[e].textBlock.y+I[e].height){d=d||k;f=k;for(l=0;I[f].textBlock.y<I[e].textBlock.y+I[e].height+da;){a=a||I[f].textBlock.y+I[f].height;l+=I[f].height;l+=da;f=e;if(0>=f){f=0;l+=I[f].height;break}e=p(f);if(0>e){f=0;l+=I[f].height;break}}if(f!=k){g=I[f].textBlock.y;a-=g;a=l-a;g=c(a,d,f);break}}}return g}function c(a,b,d){var e=[],f=0,g=0;for(a=Math.abs(a);d<=b;d++)e.push(R[d]);e.sort(function(a,b){return a.height-b.height});for(d=0;d<e.length;d++)if(b=e[d],f<a)g++,f+=I[b.id].height+
|
|
530
|
+
da,I[b.id].textBlock.text="",I[b.id].indexLabelText="",I[b.id].isDirty=!0,I[b.id].textBlock.measureText();else break;return g}for(var d,e,f,g,l,k,m=1,r=0;r<2*m;r++){for(var n=I.length-1;0<=n&&!(0<=p(n)&&p(n),f=I[n],g=f.textBlock,k=(l=q(n)<R.length?I[q(n)]:null)?l.textBlock:null,d=+f.height.toFixed(6),e=+g.y.toFixed(6),!f.isDirty&&(l&&e+d+da>+k.y.toFixed(6))&&(d=g.y+d+da-k.y,e=a(n,-d),e<d&&(0<e&&(d-=e),e=a(q(n),d),e!=d)));n--);b()}}function h(a,b){return(b<R.length?I[b].textBlock.y:u.reversed?U+z:
|
|
531
|
+
ta+z)-(0>a?u.reversed?ta-z:U-z:I[a].textBlock.y+I[a].height+da)}function n(a,b,c){var d,e,g,l=[],h=z,p=[];-1!==b&&(0<=Z.indexOf(b)?(e=Z.indexOf(b),Z.splice(e,1)):(Z.push(b),Z=Z.sort(function(a,b){return a-b})));if(0===Z.length)l=ia;else{e=z*(1!=Z.length||0!=Z[0]&&Z[0]!=R.length-1?2:1)/k();for(var q=0;q<R.length;q++){if(1==Z.length&&0==Z[0]){if(0===q){l.push(ia[q]);d=h;continue}}else 0===q&&(d=-1*h);l.push(ia[q]+d);if(0<=Z.indexOf(q)||q<R.length&&0<=Z.indexOf(q+1))d+=e}}g=function(){for(var a=[],b=
|
|
532
|
+
0;b<R.length;b++)a.push(l[b]-R[b].y1);return a}();var t={startTime:(new Date).getTime(),duration:c||500,easingFunction:function(a,b,c,d){return M.easing.easeOutQuart(a,b,c,d)},changeSection:function(a){for(var b,c,d=0;d<R.length;d++)b=g[d],c=R[d],b*=a,"undefined"===typeof p[d]&&(p[d]=0),0>p&&(p*=-1),c.y1+=b-p[d],c.y2+=b-p[d],c.y3+=b-p[d],c.y4+=b-p[d],c.y5&&(c.y5+=b-p[d],c.y6+=b-p[d]),p[d]=b}};a._animator.animate(0,c,function(c){var d=a.plotArea.ctx||a.ctx;ha=!0;d.clearRect(x.x1,x.y1,x.x2-x.x1,x.y2-
|
|
533
|
+
x.y1);d.fillStyle=a.backgroundColor;d.fillRect(x.x1,x.y1,x.width,x.height);t.changeSection(c,b);var e={};e.dataSeries=u;e.dataPoint=u.reversed?u.dataPoints[y.length-1-b]:u.dataPoints[b];e.index=u.reversed?y.length-1-b:b;a.toolTip.highlightObjects([e]);for(e=0;e<R.length;e++)ra(d,R[e],u.fillOpacity);v(d);L&&("inside"!==u.indexLabelPlacement?m(d):f(),r(d));1<=c&&(ha=!1)},null,M.easing.easeOutQuart)}function k(){for(var a=0,b=0;b<R.length-1;b++)(0<=Z.indexOf(b)||0<=Z.indexOf(b+1))&&a++;return a}function m(a){for(var b,
|
|
534
|
+
c,d,e,f=0;f<R.length;f++)e=1===I[f].lineThickness%2?0.5:0,c=((R[f].y2+R[f].y4)/2<<0)+e,b=g(c).x2-1,d=I[f].textBlock.x,e=(I[f].textBlock.y+I[f].height/2<<0)+e,I[f].isDirty||0==I[f].lineThickness||(a.strokeStyle=I[f].lineColor,a.lineWidth=I[f].lineThickness,a.setLineDash&&a.setLineDash(J(I[f].lineDashType,I[f].lineThickness)),a.beginPath(),a.moveTo(b,c),a.lineTo(d,e),a.stroke())}function p(a){for(a-=1;-1<=a&&-1!=a&&I[a].isDirty;a--);return a}function q(a){for(a+=1;a<=R.length&&a!=R.length&&I[a].isDirty;a++);
|
|
535
|
+
return a}function g(a){for(var b,c=0;c<y.length;c++)if(R[c].y1<a&&R[c].y4>a){b=R[c];break}return b?(a=b.y6?a>b.y6?b.x3+(b.x4-b.x3)/(b.y4-b.y3)*(a-b.y3):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2),{x1:a,x2:a}):-1}function r(a){for(var b=0;b<R.length;b++)I[b].isDirty||(a&&(I[b].textBlock.ctx=a),I[b].textBlock.render(!0))}function v(a){A.plotArea.layoutManager.reset();a.roundRect||Da(a);A.title&&(A.title.dockInsidePlotArea||"center"===A.title.horizontalAlign&&"center"===
|
|
536
|
+
A.title.verticalAlign)&&(A.title.ctx=a,A.title.render());if(A.subtitles)for(var b=0;b<A.subtitles.length;b++){var c=A.subtitles[b];if(c.dockInsidePlotArea||"center"===c.horizontalAlign&&"center"===c.verticalAlign)A.subtitles.ctx=a,c.render()}A.legend&&(A.legend.dockInsidePlotArea||"center"===A.legend.horizontalAlign&&"center"===A.legend.verticalAlign)&&(A.legend.ctx=a,A.legend.setLayout(),A.legend.render());va.fNg&&va.fNg(A)}var A=this;if(!(0>=a.dataSeriesIndexes.length)){for(var u=this.data[a.dataSeriesIndexes[0]],
|
|
537
|
+
y=u.dataPoints,x=this.plotArea,z=0.025*x.width,B=0.01*x.width,D=0,E=x.height-2*z,G=Math.min(x.width-2*B,2.8*x.height),L=!1,S=0;S<y.length;S++)if(!L&&("undefined"!==typeof y[S].indexLabel&&null!==y[S].indexLabel&&0<y[S].indexLabel.toString().length)&&(L=!0),!L&&("undefined"!==typeof y[S].label&&null!==y[S].label&&0<y[S].label.toString().length)&&(L=!0),!L&&"function"===typeof u.indexLabelFormatter||"function"===typeof y[S].indexLabelFormatter)L=!0;L=L||"undefined"!==typeof u.indexLabel&&null!==u.indexLabel&&
|
|
538
|
+
0<u.indexLabel.toString().length;"inside"!==u.indexLabelPlacement&&L||(B=(x.width-0.75*G)/2);var S=x.x1+B,K=x.x2-B,$=x.y1+z,N=x.y2-z,P=a.targetCanvasCtx||this.plotArea.ctx||this.ctx;if(0!=u.length&&(u.dataPoints&&u.visible)&&0!==y.length){var Q,F;a=75*G/100;var X=30*(K-a)/100;"funnel"===u.type?(Q=s(u.options.neckHeight)?0.35*E:u.neckHeight,F=s(u.options.neckWidth)?0.25*a:u.neckWidth,"string"===typeof Q&&Q.match(/%$/)?(Q=parseInt(Q),Q=Q*E/100):Q=parseInt(Q),"string"===typeof F&&F.match(/%$/)?(F=parseInt(F),
|
|
539
|
+
F=F*a/100):F=parseInt(F),Q>E?Q=E:0>=Q&&(Q=0),F>a?F=a-0.5:0>=F&&(F=0)):"pyramid"===u.type&&(F=Q=0,u.reversed=u.reversed?!1:!0);var B=S+a/2,T=S,V=S+a,U=u.reversed?N:$,O=B-F/2,W=B+F/2,Ca=u.reversed?$+Q:N-Q,ta=u.reversed?$:N;a=[];var B=[],R=[],G=[],Y=$,ca,aa=(Ca-U)/(O-T),fa=-aa,S="area"===(u.valueRepresents?u.valueRepresents:"height")?c():d();if(-1!==S){if(u.reversed)for(G.push(Y),F=S.length-1;0<F;F--)Y+=S[F],G.push(Y);else for(F=0;F<S.length;F++)Y+=S[F],G.push(Y);if(u.reversed)for(F=0;F<S.length;F++)G[F]<
|
|
540
|
+
Ca?(a.push(O),B.push(W),ca=F):(a.push((G[F]-U+aa*T)/aa),B.push((G[F]-U+fa*V)/fa));else for(F=0;F<S.length;F++)G[F]<Ca?(a.push((G[F]-U+aa*T)/aa),B.push((G[F]-U+fa*V)/fa),ca=F):(a.push(O),B.push(W));for(F=0;F<S.length-1;F++)Y=u.reversed?y[y.length-1-F].color?y[y.length-1-F].color:u._colorSet[(y.length-1-F)%u._colorSet.length]:y[F].color?y[F].color:u._colorSet[F%u._colorSet.length],F===ca?R.push({x1:a[F],y1:G[F],x2:B[F],y2:G[F],x3:W,y3:Ca,x4:B[F+1],y4:G[F+1],x5:a[F+1],y5:G[F+1],x6:O,y6:Ca,id:F,height:G[F+
|
|
541
|
+
1]-G[F],color:Y}):R.push({x1:a[F],y1:G[F],x2:B[F],y2:G[F],x3:B[F+1],y3:G[F+1],x4:a[F+1],y4:G[F+1],id:F,height:G[F+1]-G[F],color:Y});var da=2,I=[],ha=!1,Z=[],ia=[],S=!1;a=a=0;Ea(Z);for(F=0;F<y.length;F++)y[F].exploded&&(S=!0,u.reversed?Z.push(y.length-1-F):Z.push(F));P.clearRect(x.x1,x.y1,x.width,x.height);P.fillStyle=A.backgroundColor;P.fillRect(x.x1,x.y1,x.width,x.height);if(L&&u.visible&&(b(),f(),e(),"inside"!==u.indexLabelPlacement)){l();for(F=0;F<y.length;F++)I[F].isDirty||(a=I[F].textBlock.x+
|
|
542
|
+
I[F].width,a=(K-a)/2,0==F&&(D=a),D>a&&(D=a));for(F=0;F<R.length;F++)R[F].x1+=D,R[F].x2+=D,R[F].x3+=D,R[F].x4+=D,R[F].x5&&(R[F].x5+=D,R[F].x6+=D),I[F].textBlock.x+=D}for(F=0;F<R.length;F++)D=R[F],ra(P,D,u.fillOpacity),ia.push(D.y1);v(P);L&&u.visible&&("inside"===u.indexLabelPlacement||A.animationEnabled||m(P),A.animationEnabled||r());if(!L)for(F=0;F<y.length;F++)D=u.dataPointIds[F],a={id:D,objectType:"dataPoint",dataPointIndex:F,dataSeriesIndex:0,funnelSection:R[u.reversed?y.length-1-F:F]},A._eventManager.objectMap[D]=
|
|
543
|
+
a;!A.animationEnabled&&S?n(A,-1,0):A.animationEnabled&&!A.animatedRender&&n(A,-1,0);this.funnelPyramidClickHandler=function(a){var b=-1;if(!ha&&!A.isAnimating&&(s(a.dataSeries.explodeOnClick)||a.dataSeries.explodeOnClick)&&(b=u.reversed?y.length-1-a.dataPointIndex:a.dataPointIndex,0<=b)){a=b;if("funnel"===u.type||"pyramid"===u.type)u.reversed?y[y.length-1-a].exploded=y[y.length-1-a].exploded?!1:!0:y[a].exploded=y[a].exploded?!1:!0;n(A,b,500)}};return{source:P,dest:this.plotArea.ctx,animationCallback:function(a,
|
|
544
|
+
b){M.fadeInAnimation(a,b);1<=a&&(n(A,-1,500),v(A.plotArea.ctx||A.ctx))},easingFunction:M.easing.easeInQuad,animationBase:0}}}}};n.prototype.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();n.prototype.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||
|
|
545
545
|
window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;n.prototype.set=function(a,d,c){c="undefined"===typeof c?!0:c;"options"===a?(this.options=d,c&&this.render()):n.base.set.call(this,a,d,c)};n.prototype.exportChart=function(a){a="undefined"===typeof a?{}:a;var d=a.format?a.format:"png",c=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+d);var b=this.canvas;if(b&&d&&c){c=c+"."+d;a="image/"+d;var b=b.toDataURL(a),e=!1,
|
|
546
546
|
f=document.createElement("a");f.download=c;f.href=b;if("undefined"!==typeof Blob&&new Blob){for(var l=b.replace(/^data:[a-z\/]*;base64,/,""),l=atob(l),h=new ArrayBuffer(l.length),h=new Uint8Array(h),n=0;n<l.length;n++)h[n]=l.charCodeAt(n);d=new Blob([h.buffer],{type:"image/"+d});try{window.navigator.msSaveBlob(d,c),e=!0}catch(k){f.dataset.downloadurl=[a,f.download,f.href].join(":"),f.href=window.URL.createObjectURL(d)}}if(!e)try{event=document.createEvent("MouseEvents"),event.initMouseEvent("click",
|
|
547
547
|
!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),f.dispatchEvent?f.dispatchEvent(event):f.fireEvent&&f.fireEvent("onclick")}catch(m){d=window.open(),d.document.write("<img src='"+b+"'></img><div>Please right click on the image and save it to your device</div>"),d.document.close()}}};n.prototype.print=function(){var a=this.exportChart({toDataURL:!0}),d=document.createElement("iframe");d.setAttribute("class","canvasjs-chart-print-frame");V(d,{position:"absolute",width:"100%",border:"0px",margin:"0px 0px 0px 0px",
|
|
@@ -558,26 +558,26 @@ Q.getDefaultLegendMarker(p.type):p.markerType,g=p.legendText?p.legendText:this.i
|
|
|
558
558
|
p.markerBorderColor,u=p.legendMarkerBorderThickness?p.legendMarkerBorderThickness:p.markerBorderThickness?Math.max(1,Math.round(0.2*w)):0;"error"===p.type&&this.errorMarkerColor.push(r);g=this.chart.replaceKeywordsWithValue(g,p.dataPoints[0],p,m);q={markerType:q,markerColor:r,text:g,textBlock:null,chartType:p.type,markerSize:w,lineColor:p._colorSet[0],dataSeriesIndex:p.index,dataPointIndex:null,markerBorderColor:v,markerBorderThickness:u};n.push(q)}else for(var y=0;y<p.dataPoints.length;y++){var x=
|
|
559
559
|
p.dataPoints[y],q=x.legendMarkerType?x.legendMarkerType:p.legendMarkerType?p.legendMarkerType:Q.getDefaultLegendMarker(p.type),g=x.legendText?x.legendText:p.legendText?p.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:p,dataPoint:x}):x.name?x.name:"DataPoint: "+(y+1),r=x.legendMarkerColor?x.legendMarkerColor:p.legendMarkerColor?p.legendMarkerColor:x.color?x.color:p.color?p.color:p._colorSet[y%p._colorSet.length],w=0.75*this.lineHeight,v=x.legendMarkerBorderColor?
|
|
560
560
|
x.legendMarkerBorderColor:p.legendMarkerBorderColor?p.legendMarkerBorderColor:x.markerBorderColor?x.markerBorderColor:p.markerBorderColor,u=x.legendMarkerBorderThickness?x.legendMarkerBorderThickness:p.legendMarkerBorderThickness?p.legendMarkerBorderThickness:x.markerBorderThickness||p.markerBorderThickness?Math.max(1,Math.round(0.2*w)):0,g=this.chart.replaceKeywordsWithValue(g,x,p,y),q={markerType:q,markerColor:r,text:g,textBlock:null,chartType:p.type,markerSize:w,dataSeriesIndex:m,dataPointIndex:y,
|
|
561
|
-
markerBorderColor:v,markerBorderThickness:u};(x.showInLegend||p.showInLegend&&!1!==x.showInLegend)&&n.push(q)}}!0===this.reversed&&n.reverse();if(0<n.length){p=null;r=g=x=y=0;x=null!==this.itemWidth?null!==this.itemMaxWidth?Math.min(this.itemWidth,this.itemMaxWidth,f):this.itemMaxWidth=Math.min(this.itemWidth,f):null!==this.itemMaxWidth?Math.min(this.itemMaxWidth,f):this.itemMaxWidth=f;w=0===w?0.75*this.lineHeight:w;x
|
|
562
|
-
"stepLine"===q.chartType)v-=2*0.1*this.lineHeight;if(!(0>=l||"undefined"===typeof l||0>=v||"undefined"===typeof v)){if("horizontal"===this.orientation){q.textBlock=new ja(this.ctx,{x:0,y:0,maxWidth:v,maxHeight:this.itemWrap?l:this.lineHeight,angle:0,text:q.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"});q.textBlock.measureText();
|
|
563
|
-
this.itemWidth-(w+h+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0)));if(!p||p.width+Math.round(q.textBlock.width+w+h+(0===p.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))>f)p={items:[],width:0},k.push(p),this.height+=g,g=0;g=Math.max(g,q.textBlock.height?q.textBlock.height:this.lineHeight)}else q.textBlock=new ja(this.ctx,{x:0,
|
|
564
|
-
l:1.5*this.fontSize,angle:0,text:q.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),q.textBlock.measureText(),null!==this.itemWidth&&(q.textBlock.width=this.itemWidth-(w+h+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))),this.height<l-this.lineHeight?(p={items:[],width:0},k.push(p)):
|
|
565
|
-
q.textBlock.height?q.textBlock.height:this.lineHeight;q.textBlock.x=p.width;q.textBlock.y=0;p.width+=Math.round(q.textBlock.width+w+h+(0===p.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0));p.items.push(q);this.width=Math.max(p.width,this.width);r=q.textBlock.width+(w+h+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))}}this.itemWidth=
|
|
566
|
-
this.lineHeight:this.height+g;this.height=Math.min(l,this.height);this.width=Math.min(f,this.width)}"top"===this.verticalAlign?(e="left"===this.horizontalAlign?d.x1:"right"===this.horizontalAlign?d.x2-this.width:d.x1+d.width/2-this.width/2,b=d.y1):"center"===this.verticalAlign?(e="left"===this.horizontalAlign?d.x1:"right"===this.horizontalAlign?d.x2-this.width:d.x1+d.width/2-this.width/2,b=d.y1+d.height/2-this.height/2):"bottom"===this.verticalAlign&&(e="left"===
|
|
567
|
-
this.horizontalAlign?d.x2-this.width:d.x1+d.width/2-this.width/2,b=d.y2-this.height);this.items=n;for(m=0;m<this.items.length;m++)q=n[m],q.id=++this.chart._eventManager.lastObjectId,this.chart._eventManager.objectMap[q.id]={id:q.id,objectType:"legendItem",legendItemIndex:m,dataSeriesIndex:q.dataSeriesIndex,dataPointIndex:q.dataPointIndex};this.markerSize=w;this.rows=k;0<n.length&&a.layoutManager.registerSpace(c,{width:this.width+2+2,height:this.height+5+5});this.bounds=
|
|
568
|
-
y2:b+this.height}};K.prototype.render=function(){var a=this.bounds.x1,d=this.bounds.y1,c=this.markerMargin,b=this.maxWidth,e=this.maxHeight,f=this.markerSize,l=this.rows;(0<this.borderThickness&&this.borderColor||this.backgroundColor)&&this.ctx.roundRect(a,d,this.width,this.height,this.cornerRadius,this.borderThickness,this.backgroundColor,this.borderColor);for(var h=0,n=0;n<l.length;n++){for(var k=l[n],m=0,p=0;p<k.items.length;p++){var q=k.items[p],g=q.textBlock.x+a+(0===
|
|
569
|
-
r=d+h,s=g;this.chart.data[q.dataSeriesIndex].visible||(this.ctx.globalAlpha=0.5);this.ctx.save();this.ctx.beginPath();this.ctx.rect(a,d,b,Math.max(e-e%this.lineHeight,0));this.ctx.clip();if("line"===q.chartType||"stepLine"===q.chartType||"spline"===q.chartType)this.ctx.strokeStyle=q.lineColor,this.ctx.lineWidth=Math.ceil(this.lineHeight/8),this.ctx.beginPath(),this.ctx.moveTo(g-0.1*this.lineHeight,r+this.lineHeight/2),this.ctx.lineTo(g+0.85*this.lineHeight,r+this.lineHeight/
|
|
570
|
-
0.1*this.lineHeight;if("error"===q.chartType){this.ctx.strokeStyle=this.errorMarkerColor[0];this.ctx.lineWidth=f/8;this.ctx.beginPath();var w=g-0.08*this.lineHeight+0.1*this.lineHeight,u=r+0.15*this.lineHeight,v=0.7*this.lineHeight,x=v+0.02*this.lineHeight;this.ctx.moveTo(w,u);this.ctx.lineTo(w+v,u);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(w+v/2,u);this.ctx.lineTo(w+v/2,u+x);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(w,u+x);this.ctx.lineTo(w+v,u+x);
|
|
571
|
-
f/2,r+this.lineHeight/2,this.ctx,q.markerType,"error"===q.chartType||"line"===q.chartType||"spline"===q.chartType?q.markerSize/2:q.markerSize,q.markerColor,q.markerBorderColor,q.markerBorderThickness);q.textBlock.x=g+c+f;if("line"===q.chartType||"stepLine"===q.chartType||"spline"===q.chartType)q.textBlock.x+=0.1*this.lineHeight;q.textBlock.y=Math.round(r+this.lineHeight/2);q.textBlock.render(!0);this.ctx.restore();m=0<p?Math.max(m,q.textBlock.height?
|
|
572
|
-
q.textBlock.height:this.lineHeight;this.chart.data[q.dataSeriesIndex].visible||(this.ctx.globalAlpha=1);g=X(q.id);this.ghostCtx.fillStyle=g;this.ghostCtx.beginPath();this.ghostCtx.fillRect(s,q.textBlock.y-this.lineHeight/2,q.textBlock.x+q.textBlock.width-s,q.textBlock.height?q.textBlock.height:this.lineHeight);q.x1=this.chart._eventManager.objectMap[q.id].x1=s;q.y1=this.chart._eventManager.objectMap[q.id].y1=q.textBlock.y-this.lineHeight/2;q.x2=
|
|
573
|
-
q.textBlock.width;q.y2=this.chart._eventManager.objectMap[q.id].y2=q.textBlock.y+(q.textBlock.height?q.textBlock.height:this.lineHeight)-this.lineHeight/2}h+=m}};oa(Q,G);Q.prototype.getDefaultAxisPlacement=function(){var a=this.type;if("column"===a||"line"===a||"stepLine"===a||"spline"===a||"area"===a||"stepArea"===a||"splineArea"===a||"stackedColumn"===a||"stackedLine"===a||"bubble"===a||"scatter"===a||"stackedArea"===a||"stackedColumn100"===
|
|
574
|
-
a||"ohlc"===a||"rangeColumn"===a||"rangeArea"===a||"rangeSplineArea"===a||"boxAndWhisker"===a||"waterfall"===a)return"normal";if("bar"===a||"stackedBar"===a||"stackedBar100"===a||"rangeBar"===a)return"xySwapped";if("pie"===a||"doughnut"===a||"funnel"===a||"pyramid"===a)return"none";"error"!==a&&window.console.log("Unknown Chart Type: "+a);return null};Q.getDefaultLegendMarker=function(a){if("column"===a||"stackedColumn"===a||"stackedLine"===
|
|
575
|
-
a||"scatter"===a||"stackedColumn100"===a||"stackedLine100"===a||"stepArea"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeBar"===a||"rangeArea"===a||"rangeSplineArea"===a||"boxAndWhisker"===a||"waterfall"===a)return"square";if("line"===a||"stepLine"===a||"spline"===a||"pie"===a||"doughnut"===a)return"circle";if("area"===a||"splineArea"===a||"stackedArea"===a||"stackedArea100"===a||"funnel"===a||"pyramid"===a)return"triangle";
|
|
576
|
-
a);return null};Q.prototype.getDataPointAtX=function(a,d){if(!this.dataPoints||0===this.dataPoints.length)return null;var c={dataPoint:null,distance:Infinity,index:NaN},b=null,e=0,f=0,l=1,h=Infinity,n=0,k=0,m=0;"none"!==this.chart.plotInfo.axisPlacement&&(this.axisX.logarithmic?(m=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),m=1<m?Math.min(Math.max((this.dataPoints.length-1)/m*Math.log(a/this.dataPoints[0].x)>>
|
|
577
|
-
1].x-this.dataPoints[0].x,m=0<m?Math.min(Math.max((this.dataPoints.length-1)/m*(a-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0));for(;;){f=0<l?m+e:m-e;if(0<=f&&f<this.dataPoints.length){var b=this.dataPoints[f],p=this.axisX.logarithmic?b.x>a?b.x/a:a/b.x:Math.abs(b.x-a);p<c.distance&&(c.dataPoint=b,c.distance=p,c.index=f);b=p;b<=h?h=b:0<l?n++:k++;if(1E3<n&&1E3<k)break}else if(0>m-e&&m+e>=this.dataPoints.length)break
|
|
578
|
-
c.dataPoint.x)!==(a.getTime?a.getTime():a)?d&&null!==c.dataPoint?c:null:c};Q.prototype.getDataPointAtXY=function(a,d,c){if(!this.dataPoints||0===this.dataPoints.length||a<this.chart.plotArea.x1||a>this.chart.plotArea.x2||d<this.chart.plotArea.y1||d>this.chart.plotArea.y2)return null;c=c||!1;var b=[],e=0,f=0,l=1,h=!1,n=Infinity,k=0,m=0,p=0;if("none"!==this.chart.plotInfo.axisPlacement)if(p=(this.chart.axisX[0]?this.chart.axisX[0]:
|
|
579
|
-
Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),p=1<q?Math.min(Math.max((this.dataPoints.length-1)/q*Math.log(p/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;else q=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0<q?Math.min(Math.max((this.dataPoints.length-1)/q*(p-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;for(;;){f=0<l?p+e:p-e;if(0<=f&&f<this.dataPoints.length){var q=
|
|
580
|
-
r=null;if(q){switch(this.type){case "column":case "stackedColumn":case "stackedColumn100":case "bar":case "stackedBar":case "stackedBar100":case "rangeColumn":case "rangeBar":case "waterfall":case "error":a>=q.x1&&(a<=q.x2&&d>=q.y1&&d<=q.y2)&&(b.push({dataPoint:g,dataPointIndex:f,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y1-d),Math.abs(q.y2-d))}),h=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var w=
|
|
561
|
+
markerBorderColor:v,markerBorderThickness:u};(x.showInLegend||p.showInLegend&&!1!==x.showInLegend)&&n.push(q)}}!0===this.reversed&&n.reverse();if(0<n.length){p=null;r=g=x=y=0;x=null!==this.itemWidth?null!==this.itemMaxWidth?Math.min(this.itemWidth,this.itemMaxWidth,f):this.itemMaxWidth=Math.min(this.itemWidth,f):null!==this.itemMaxWidth?Math.min(this.itemMaxWidth,f):this.itemMaxWidth=f;w=0===w?0.75*this.lineHeight:w;x=(this.itemMaxWidth?this.itemMaxWidth:x)-(w+h);for(m=0;m<n.length;m++){q=n[m];v=
|
|
562
|
+
x;if("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType)v-=2*0.1*this.lineHeight;if(!(0>=l||"undefined"===typeof l||0>=v||"undefined"===typeof v)){if("horizontal"===this.orientation){q.textBlock=new ja(this.ctx,{x:0,y:0,maxWidth:v,maxHeight:this.itemWrap?l:this.lineHeight,angle:0,text:q.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"});q.textBlock.measureText();
|
|
563
|
+
null!==this.itemWidth&&(q.textBlock.width=this.itemWidth-(w+h+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0)));if(!p||p.width+Math.round(q.textBlock.width+w+h+(0===p.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))>f)p={items:[],width:0},k.push(p),this.height+=g,g=0;g=Math.max(g,q.textBlock.height?q.textBlock.height:this.lineHeight)}else q.textBlock=new ja(this.ctx,{x:0,
|
|
564
|
+
y:0,maxWidth:x,maxHeight:!0===this.itemWrap?l:1.5*this.fontSize,angle:0,text:q.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),q.textBlock.measureText(),null!==this.itemWidth&&(q.textBlock.width=this.itemWidth-(w+h+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))),this.height<l-this.lineHeight?(p={items:[],width:0},k.push(p)):
|
|
565
|
+
(p=k[y],y=(y+1)%k.length),this.height+=q.textBlock.height?q.textBlock.height:this.lineHeight;q.textBlock.x=p.width;q.textBlock.y=0;p.width+=Math.round(q.textBlock.width+w+h+(0===p.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0));p.items.push(q);this.width=Math.max(p.width,this.width);r=q.textBlock.width+(w+h+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))}}this.itemWidth=
|
|
566
|
+
r;this.height=!1===this.itemWrap?k.length*this.lineHeight:this.height+g;this.height=Math.min(l,this.height);this.width=Math.min(f,this.width)}"top"===this.verticalAlign?(e="left"===this.horizontalAlign?d.x1:"right"===this.horizontalAlign?d.x2-this.width:d.x1+d.width/2-this.width/2,b=d.y1):"center"===this.verticalAlign?(e="left"===this.horizontalAlign?d.x1:"right"===this.horizontalAlign?d.x2-this.width:d.x1+d.width/2-this.width/2,b=d.y1+d.height/2-this.height/2):"bottom"===this.verticalAlign&&(e="left"===
|
|
567
|
+
this.horizontalAlign?d.x1:"right"===this.horizontalAlign?d.x2-this.width:d.x1+d.width/2-this.width/2,b=d.y2-this.height);this.items=n;for(m=0;m<this.items.length;m++)q=n[m],q.id=++this.chart._eventManager.lastObjectId,this.chart._eventManager.objectMap[q.id]={id:q.id,objectType:"legendItem",legendItemIndex:m,dataSeriesIndex:q.dataSeriesIndex,dataPointIndex:q.dataPointIndex};this.markerSize=w;this.rows=k;0<n.length&&a.layoutManager.registerSpace(c,{width:this.width+2+2,height:this.height+5+5});this.bounds=
|
|
568
|
+
{x1:e,y1:b,x2:e+this.width,y2:b+this.height}};K.prototype.render=function(){var a=this.bounds.x1,d=this.bounds.y1,c=this.markerMargin,b=this.maxWidth,e=this.maxHeight,f=this.markerSize,l=this.rows;(0<this.borderThickness&&this.borderColor||this.backgroundColor)&&this.ctx.roundRect(a,d,this.width,this.height,this.cornerRadius,this.borderThickness,this.backgroundColor,this.borderColor);for(var h=0,n=0;n<l.length;n++){for(var k=l[n],m=0,p=0;p<k.items.length;p++){var q=k.items[p],g=q.textBlock.x+a+(0===
|
|
569
|
+
p?0.2*f:this.horizontalSpacing),r=d+h,s=g;this.chart.data[q.dataSeriesIndex].visible||(this.ctx.globalAlpha=0.5);this.ctx.save();this.ctx.beginPath();this.ctx.rect(a,d,b,Math.max(e-e%this.lineHeight,0));this.ctx.clip();if("line"===q.chartType||"stepLine"===q.chartType||"spline"===q.chartType)this.ctx.strokeStyle=q.lineColor,this.ctx.lineWidth=Math.ceil(this.lineHeight/8),this.ctx.beginPath(),this.ctx.moveTo(g-0.1*this.lineHeight,r+this.lineHeight/2),this.ctx.lineTo(g+0.85*this.lineHeight,r+this.lineHeight/
|
|
570
|
+
2),this.ctx.stroke(),s-=0.1*this.lineHeight;if("error"===q.chartType){this.ctx.strokeStyle=this.errorMarkerColor[0];this.ctx.lineWidth=f/8;this.ctx.beginPath();var w=g-0.08*this.lineHeight+0.1*this.lineHeight,u=r+0.15*this.lineHeight,v=0.7*this.lineHeight,x=v+0.02*this.lineHeight;this.ctx.moveTo(w,u);this.ctx.lineTo(w+v,u);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(w+v/2,u);this.ctx.lineTo(w+v/2,u+x);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(w,u+x);this.ctx.lineTo(w+v,u+x);
|
|
571
|
+
this.ctx.stroke();this.errorMarkerColor.shift()}W.drawMarker(g+f/2,r+this.lineHeight/2,this.ctx,q.markerType,"error"===q.chartType||"line"===q.chartType||"spline"===q.chartType?q.markerSize/2:q.markerSize,q.markerColor,q.markerBorderColor,q.markerBorderThickness);q.textBlock.x=g+c+f;if("line"===q.chartType||"stepLine"===q.chartType||"spline"===q.chartType)q.textBlock.x+=0.1*this.lineHeight;q.textBlock.y=Math.round(r+this.lineHeight/2);q.textBlock.render(!0);this.ctx.restore();m=0<p?Math.max(m,q.textBlock.height?
|
|
572
|
+
q.textBlock.height:this.lineHeight):q.textBlock.height?q.textBlock.height:this.lineHeight;this.chart.data[q.dataSeriesIndex].visible||(this.ctx.globalAlpha=1);g=X(q.id);this.ghostCtx.fillStyle=g;this.ghostCtx.beginPath();this.ghostCtx.fillRect(s,q.textBlock.y-this.lineHeight/2,q.textBlock.x+q.textBlock.width-s,q.textBlock.height?q.textBlock.height:this.lineHeight);q.x1=this.chart._eventManager.objectMap[q.id].x1=s;q.y1=this.chart._eventManager.objectMap[q.id].y1=q.textBlock.y-this.lineHeight/2;q.x2=
|
|
573
|
+
this.chart._eventManager.objectMap[q.id].x2=q.textBlock.x+q.textBlock.width;q.y2=this.chart._eventManager.objectMap[q.id].y2=q.textBlock.y+(q.textBlock.height?q.textBlock.height:this.lineHeight)-this.lineHeight/2}h+=m}};oa(Q,G);Q.prototype.getDefaultAxisPlacement=function(){var a=this.type;if("column"===a||"line"===a||"stepLine"===a||"spline"===a||"area"===a||"stepArea"===a||"splineArea"===a||"stackedColumn"===a||"stackedLine"===a||"bubble"===a||"scatter"===a||"stackedArea"===a||"stackedColumn100"===
|
|
574
|
+
a||"stackedLine100"===a||"stackedArea100"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeArea"===a||"rangeSplineArea"===a||"boxAndWhisker"===a||"waterfall"===a)return"normal";if("bar"===a||"stackedBar"===a||"stackedBar100"===a||"rangeBar"===a)return"xySwapped";if("pie"===a||"doughnut"===a||"funnel"===a||"pyramid"===a)return"none";"error"!==a&&window.console.log("Unknown Chart Type: "+a);return null};Q.getDefaultLegendMarker=function(a){if("column"===a||"stackedColumn"===a||"stackedLine"===
|
|
575
|
+
a||"bar"===a||"stackedBar"===a||"stackedBar100"===a||"bubble"===a||"scatter"===a||"stackedColumn100"===a||"stackedLine100"===a||"stepArea"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeBar"===a||"rangeArea"===a||"rangeSplineArea"===a||"boxAndWhisker"===a||"waterfall"===a)return"square";if("line"===a||"stepLine"===a||"spline"===a||"pie"===a||"doughnut"===a)return"circle";if("area"===a||"splineArea"===a||"stackedArea"===a||"stackedArea100"===a||"funnel"===a||"pyramid"===a)return"triangle";
|
|
576
|
+
if("error"===a)return"none";window.console.log("Unknown Chart Type: "+a);return null};Q.prototype.getDataPointAtX=function(a,d){if(!this.dataPoints||0===this.dataPoints.length)return null;var c={dataPoint:null,distance:Infinity,index:NaN},b=null,e=0,f=0,l=1,h=Infinity,n=0,k=0,m=0;"none"!==this.chart.plotInfo.axisPlacement&&(this.axisX.logarithmic?(m=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),m=1<m?Math.min(Math.max((this.dataPoints.length-1)/m*Math.log(a/this.dataPoints[0].x)>>
|
|
577
|
+
0,0),this.dataPoints.length):0):(m=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,m=0<m?Math.min(Math.max((this.dataPoints.length-1)/m*(a-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0));for(;;){f=0<l?m+e:m-e;if(0<=f&&f<this.dataPoints.length){var b=this.dataPoints[f],p=this.axisX.logarithmic?b.x>a?b.x/a:a/b.x:Math.abs(b.x-a);p<c.distance&&(c.dataPoint=b,c.distance=p,c.index=f);b=p;b<=h?h=b:0<l?n++:k++;if(1E3<n&&1E3<k)break}else if(0>m-e&&m+e>=this.dataPoints.length)break;
|
|
578
|
+
-1===l?(e++,l=1):l=-1}return d||(c.dataPoint.x.getTime?c.dataPoint.x.getTime():c.dataPoint.x)!==(a.getTime?a.getTime():a)?d&&null!==c.dataPoint?c:null:c};Q.prototype.getDataPointAtXY=function(a,d,c){if(!this.dataPoints||0===this.dataPoints.length||a<this.chart.plotArea.x1||a>this.chart.plotArea.x2||d<this.chart.plotArea.y1||d>this.chart.plotArea.y2)return null;c=c||!1;var b=[],e=0,f=0,l=1,h=!1,n=Infinity,k=0,m=0,p=0;if("none"!==this.chart.plotInfo.axisPlacement)if(p=(this.chart.axisX[0]?this.chart.axisX[0]:
|
|
579
|
+
this.chart.axisX2[0]).getXValueAt({x:a,y:d}),this.axisX.logarithmic)var q=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),p=1<q?Math.min(Math.max((this.dataPoints.length-1)/q*Math.log(p/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;else q=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0<q?Math.min(Math.max((this.dataPoints.length-1)/q*(p-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;for(;;){f=0<l?p+e:p-e;if(0<=f&&f<this.dataPoints.length){var q=
|
|
580
|
+
this.chart._eventManager.objectMap[this.dataPointIds[f]],g=this.dataPoints[f],r=null;if(q){switch(this.type){case "column":case "stackedColumn":case "stackedColumn100":case "bar":case "stackedBar":case "stackedBar100":case "rangeColumn":case "rangeBar":case "waterfall":case "error":a>=q.x1&&(a<=q.x2&&d>=q.y1&&d<=q.y2)&&(b.push({dataPoint:g,dataPointIndex:f,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y1-d),Math.abs(q.y2-d))}),h=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var w=
|
|
581
581
|
ma("markerSize",g,this)||4,v=c?20:w,r=Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-d,2));r<=v&&b.push({dataPoint:g,dataPointIndex:f,dataSeries:this,distance:r});q=Math.abs(q.x1-a);q<=n?n=q:0<l?k++:m++;r<=w/2&&(h=!0);break;case "rangeArea":case "rangeSplineArea":w=ma("markerSize",g,this)||4;v=c?20:w;r=Math.min(Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-d,2)),Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y2-d,2)));r<=v&&b.push({dataPoint:g,dataPointIndex:f,dataSeries:this,distance:r});q=Math.abs(q.x1-a);q<=
|
|
582
582
|
n?n=q:0<l?k++:m++;r<=w/2&&(h=!0);break;case "bubble":w=q.size;r=Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-d,2));r<=w/2&&(b.push({dataPoint:g,dataPointIndex:f,dataSeries:this,distance:r}),h=!0);break;case "pie":case "doughnut":w=q.center;v="doughnut"===this.type?q.percentInnerRadius*q.radius:0;r=Math.sqrt(Math.pow(w.x-a,2)+Math.pow(w.y-d,2));r<q.radius&&r>v&&(r=Math.atan2(d-w.y,a-w.x),0>r&&(r+=2*Math.PI),r=Number(((180*(r/Math.PI)%360+360)%360).toFixed(12)),w=Number(((180*(q.startAngle/Math.PI)%360+
|
|
583
583
|
360)%360).toFixed(12)),v=Number(((180*(q.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===v&&1<q.endAngle&&(v=360),w>=v&&(0!==g.y&&!s(g.y))&&(v+=360,r<w&&(r+=360)),r>w&&r<v&&(b.push({dataPoint:g,dataPointIndex:f,dataSeries:this,distance:0}),h=!0));break;case "funnel":case "pyramid":r=q.funnelSection;d>r.y1&&d<r.y4&&(r.y6?d>r.y6?(f=r.x6+(r.x5-r.x6)/(r.y5-r.y6)*(d-r.y6),r=r.x3+(r.x4-r.x3)/(r.y4-r.y3)*(d-r.y3)):(f=r.x1+(r.x6-r.x1)/(r.y6-r.y1)*(d-r.y1),r=r.x2+(r.x3-r.x2)/(r.y3-r.y2)*(d-r.y2)):(f=r.x1+
|
|
@@ -929,7 +929,7 @@ this.chart.requestAnimFrame.call(window,function(){f.animate.call(f)}):this.char
|
|
|
929
929
|
d){if(0!==a){var c=d.dest,b=d.source.canvas,e=d.animationBase;c.drawImage(b,0,0,b.width,b.height,e-e*a,0,a*c.canvas.width/la,c.canvas.height/la)}},xClipAnimation:function(a,d){if(0!==a){var c=d.dest,b=d.source.canvas;c.save();0<a&&c.drawImage(b,0,0,b.width*a,b.height,0,0,b.width*a/la,b.height/la);c.restore()}},fadeInAnimation:function(a,d){if(0!==a){var c=d.dest,b=d.source.canvas;c.save();c.globalAlpha=a;c.drawImage(b,0,0,b.width,b.height,0,0,c.canvas.width/la,c.canvas.height/la);c.restore()}},easing:{linear:function(a,
|
|
930
930
|
d,c,b){return c*a/b+d},easeOutQuad:function(a,d,c,b){return-c*(a/=b)*(a-2)+d},easeOutQuart:function(a,d,c,b){return-c*((a=a/b-1)*a*a*a-1)+d},easeInQuad:function(a,d,c,b){return c*(a/=b)*a+d},easeInQuart:function(a,d,c,b){return c*(a/=b)*a*a*a+d}}},W={drawMarker:function(a,d,c,b,e,f,h,n){if(c){var s=1;c.fillStyle=f?f:"#000000";c.strokeStyle=h?h:"#000000";c.lineWidth=n?n:0;c.setLineDash&&c.setLineDash(J("solid",n));"circle"===b?(c.moveTo(a,d),c.beginPath(),c.arc(a,d,e/2,0,2*Math.PI,!1),f&&c.fill(),
|
|
931
931
|
n&&(h?c.stroke():(s=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=s))):"square"===b?(c.beginPath(),c.rect(a-e/2,d-e/2,e,e),f&&c.fill(),n&&(h?c.stroke():(s=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=s))):"triangle"===b?(c.beginPath(),c.moveTo(a-e/2,d+e/2),c.lineTo(a+e/2,d+e/2),c.lineTo(a,d-e/2),c.closePath(),f&&c.fill(),n&&(h?c.stroke():(s=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=s)),c.beginPath()):
|
|
932
|
-
"cross"===b&&(c.strokeStyle=f,c.lineWidth=e/4,c.beginPath(),c.moveTo(a-e/2,d-e/2),c.lineTo(a+e/2,d+e/2),c.stroke(),c.moveTo(a+e/2,d-e/2),c.lineTo(a-e/2,d+e/2),c.stroke())}},drawMarkers:function(a){for(var d=0;d<a.length;d++){var c=a[d];W.drawMarker(c.x,c.y,c.ctx,c.type,c.size,c.color,c.borderColor,c.borderThickness)}}};return n}();B.version="v3.7.
|
|
932
|
+
"cross"===b&&(c.strokeStyle=f,c.lineWidth=e/4,c.beginPath(),c.moveTo(a-e/2,d-e/2),c.lineTo(a+e/2,d+e/2),c.stroke(),c.moveTo(a+e/2,d-e/2),c.lineTo(a-e/2,d+e/2),c.stroke())}},drawMarkers:function(a){for(var d=0;d<a.length;d++){var c=a[d];W.drawMarker(c.x,c.y,c.ctx,c.type,c.size,c.color,c.borderColor,c.borderThickness)}}};return n}();B.version="v3.7.30 GA";window.CanvasJS&&(B&&!window.CanvasJS.Chart)&&(window.CanvasJS.Chart=B)})();
|
|
933
933
|
|
|
934
934
|
/*
|
|
935
935
|
excanvas is used to support IE678 which do not implement HTML5 Canvas Element. You can safely remove the following excanvas code if you don't need to support older browsers.
|