@canvasjs/stockcharts 1.15.2 → 1.15.3
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.stock.min.js +65 -65
- package/package.json +1 -1
package/LICENSE
CHANGED
package/canvasjs.stock.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
CanvasJS StockChart - v1.15.
|
|
2
|
+
CanvasJS StockChart - v1.15.3 GA - https://canvasjs.com/
|
|
3
3
|
Copyright 2025 fenopix
|
|
4
4
|
|
|
5
5
|
--------------------- License Information --------------------
|
|
@@ -49,7 +49,7 @@ this.height=this.width=null;this.bounds={x1:null,y1:null,x2:null,y2:null}}functi
|
|
|
49
49
|
Pa[e]);Na.base.constructor.call(this,"CultureInfo",null,k,null,null)}var La=!1,ka={},w=!!document.createElement("canvas").getContext,ga={Chart:{width:500,height:400,zoomEnabled:!1,zoomType:"x",backgroundColor:"white",theme:"light1",animationEnabled:!1,animationDuration:1200,dataPointWidth:null,dataPointMinWidth:null,dataPointMaxWidth:null,colorSet:"colorSet1",culture:"en",creditText:"CanvasJS",interactivityEnabled:!0,exportEnabled:!1,exportFileName:"Chart",rangeChanging:null,rangeChanged:null,publicProperties:{title:"readWrite",
|
|
50
50
|
subtitles:"readWrite",toolbar:"readWrite",toolTip:"readWrite",legend:"readWrite",axisX:"readWrite",axisY:"readWrite",axisX2:"readWrite",axisY2:"readWrite",data:"readWrite",options:"readWrite",bounds:"readOnly",container:"readOnly",selectedColorSet:"readOnly"}},Title:{padding:0,text:null,verticalAlign:"top",horizontalAlign:"center",fontSize:20,fontFamily:"Calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:w?"transparent":
|
|
51
51
|
null,margin:5,wrap:!0,maxWidth:null,textAlign:"center",dockInsidePlotArea:!1,publicProperties:{options:"readWrite",bounds:"readOnly",chart:"readOnly"}},Subtitle:{padding:0,text:null,verticalAlign:"top",horizontalAlign:"center",fontSize:14,fontFamily:"Calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:null,margin:2,wrap:!0,maxWidth:null,textAlign:"center",dockInsidePlotArea:!1,publicProperties:{options:"readWrite",
|
|
52
|
-
bounds:"readOnly",chart:"readOnly"}},Toolbar:{itemBackgroundColor:"white",itemBackgroundColorOnHover:"#2196f3",buttonBorderColor:"#2196f3",buttonBorderThickness:1,fontColor:"black",fontColorOnHover:"white",publicProperties:{options:"readWrite",chart:"readOnly"}},Legend:{name:null,verticalAlign:"center",horizontalAlign:"right",fontSize:14,fontFamily:"calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",cursor:
|
|
52
|
+
bounds:"readOnly",chart:"readOnly"}},Toolbar:{itemBackgroundColor:"white",itemBackgroundColorOnHover:"#2196f3",buttonBorderColor:"#2196f3",buttonBorderThickness:1,fontColor:"black",fontColorOnHover:"white",publicProperties:{options:"readWrite",chart:"readOnly"}},Legend:{name:null,verticalAlign:"center",horizontalAlign:"right",fontSize:14,fontFamily:"calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",cursor:"default",itemmouseover:null,itemmouseout:null,itemmousemove:null,itemclick:null,
|
|
53
53
|
dockInsidePlotArea:!1,reversed:!1,backgroundColor:w?"transparent":null,borderColor:w?"transparent":null,borderThickness:0,cornerRadius:0,maxWidth:null,maxHeight:null,markerMargin:null,itemMaxWidth:null,itemWidth:null,itemWrap:!0,itemTextAlign:"left",itemTextFormatter:null,publicProperties:{options:"readWrite",bounds:"readOnly",chart:"readOnly"}},ToolTip:{enabled:!0,shared:!1,animationEnabled:!0,content:null,contentFormatter:null,reversed:!1,backgroundColor:w?"rgba(255,255,255,.9)":"rgb(255,255,255)",
|
|
54
54
|
borderColor:null,borderThickness:2,cornerRadius:5,fontSize:14,fontColor:"black",fontFamily:"Calibri, Arial, Georgia, serif;",fontWeight:"normal",fontStyle:"italic",updated:null,hidden:null,publicProperties:{options:"readWrite",chart:"readOnly"}},Axis:{minimum:null,maximum:null,viewportMinimum:null,viewportMaximum:null,interval:null,intervalType:null,reversed:!1,logarithmic:!1,logarithmBase:10,title:null,titleFontColor:"black",titleFontSize:20,titleFontFamily:"arial",titleFontWeight:"normal",titleFontStyle:"normal",
|
|
55
55
|
titleWrap:!0,titleMaxWidth:null,titleBackgroundColor:w?"transparent":null,titleBorderColor:w?"transparent":null,titleBorderThickness:0,titleCornerRadius:0,titleTextAlign:"left",titlePadding:0,labelAngle:0,labelFontFamily:"arial",labelFontColor:"black",labelFontSize:12,labelFontWeight:"normal",labelFontStyle:"normal",labelAutoFit:!0,labelWrap:!0,labelMaxWidth:null,labelFormatter:null,labelBackgroundColor:w?"transparent":null,labelBorderColor:w?"transparent":null,labelBorderThickness:0,labelPadding:0,
|
|
@@ -517,7 +517,7 @@ c.moveTo(z,B-y),c.lineTo(K,T-y),0<u&&c.stroke(),w&&(b.beginPath(),b.moveTo(z,B-y
|
|
|
517
517
|
dataPoint:t[e],dataSeries:s,point:{x:d+(F-d)/2,y:0<=t[e].y?p:m},direction:0>t[e].y===a.axisY.reversed?1:-1,bounds:{x1:d,y1:Math.min(p,m),x2:F,y2:Math.max(p,m)},color:f})}}w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,
|
|
518
518
|
0,0,this.width,this.height),c.clearRect(l.x1,l.y1,l.width,l.height),this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:v.fadeInAnimation,easingFunction:v.easing.easeInQuad,animationBase:0}}};var d=function(a,g,c,b,f,l,e,d,p){if(!(0>c)){"undefined"===typeof d&&(d=1);if(!w){var m=Number((e%(2*Math.PI)).toFixed(8));Number((l%(2*Math.PI)).toFixed(8))===m&&(e-=1E-4)}a.save();a.globalAlpha=d;"pie"===f?(a.beginPath(),a.moveTo(g.x,g.y),a.arc(g.x,g.y,
|
|
519
519
|
c,l,e,!1),a.fillStyle=b,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.fill()):"doughnut"===f&&(a.beginPath(),a.arc(g.x,g.y,c,l,e,!1),0<=p&&a.arc(g.x,g.y,p*c,e,l,!0),a.closePath(),a.fillStyle=b,a.strokeStyle="white",a.lineWidth=2,a.fill());a.globalAlpha=1;a.restore()}};k.prototype.renderPie=function(a){function g(){if(m&&q){var a=0,b=0,c=0,g=0;e(m.options.indexLabelMaxWidth)&&(m.indexLabelMaxWidth=0.33*r.width);for(var f=0;f<q.length;f++){var l=q[f],d=m.dataPointIds[f];h[f].id=d;h[f].objectType=
|
|
520
|
-
"dataPoint";h[f].dataPointIndex=f;h[f].dataSeriesIndex=0;var n=h[f],p={percent:null,total:null},C=null,p=v.getPercentAndTotal(m,l);if(m.indexLabelFormatter||l.indexLabelFormatter)C={chart:v
|
|
520
|
+
"dataPoint";h[f].dataPointIndex=f;h[f].dataSeriesIndex=0;var n=h[f],p={percent:null,total:null},C=null,p=v.getPercentAndTotal(m,l);if(m.indexLabelFormatter||l.indexLabelFormatter)C={chart:v,dataSeries:m,dataPoint:l,total:p.total,percent:p.percent};p=l.indexLabelFormatter?l.indexLabelFormatter(C):l.indexLabel?v.replaceKeywordsWithValue(l.indexLabel,l,m,f):m.indexLabelFormatter?m.indexLabelFormatter(C):m.indexLabel?v.replaceKeywordsWithValue(m.indexLabel,l,m,f):l.label?l.label:"";v._eventManager.objectMap[d]=
|
|
521
521
|
n;n.center={x:x.x,y:x.y};n.y=l.y;n.radius=B;n.percentInnerRadius=F;n.indexLabelText=p;n.indexLabelPlacement=m.indexLabelPlacement;n.indexLabelLineColor=l.indexLabelLineColor?l.indexLabelLineColor:m.options.indexLabelLineColor?m.options.indexLabelLineColor:l.color?l.color:m._colorSet[f%m._colorSet.length];n.indexLabelLineThickness=e(l.indexLabelLineThickness)?m.indexLabelLineThickness:l.indexLabelLineThickness;n.indexLabelLineDashType=l.indexLabelLineDashType?l.indexLabelLineDashType:m.indexLabelLineDashType;
|
|
522
522
|
n.indexLabelFontColor=l.indexLabelFontColor?l.indexLabelFontColor:m.indexLabelFontColor;n.indexLabelFontStyle=l.indexLabelFontStyle?l.indexLabelFontStyle:m.indexLabelFontStyle;n.indexLabelFontWeight=l.indexLabelFontWeight?l.indexLabelFontWeight:m.indexLabelFontWeight;n.indexLabelFontSize=e(l.indexLabelFontSize)?m.indexLabelFontSize:l.indexLabelFontSize;n.indexLabelFontFamily=l.indexLabelFontFamily?l.indexLabelFontFamily:m.indexLabelFontFamily;n.indexLabelBackgroundColor=l.indexLabelBackgroundColor?
|
|
523
523
|
l.indexLabelBackgroundColor:m.options.indexLabelBackgroundColor?m.options.indexLabelBackgroundColor:m.indexLabelBackgroundColor;n.indexLabelBorderColor=l.indexLabelBorderColor?l.indexLabelBorderColor:m.options.indexLabelBorderColor?m.options.indexLabelBorderColor:m.indexLabelBorderColor;n.indexLabelBorderThickness=l.indexLabelBorderThickness?l.indexLabelBorderThickness:m.options.indexLabelBorderThickness?m.options.indexLabelBorderThickness:m.indexLabelBorderThickness;n.indexLabelPadding=l.indexLabelPadding?
|
|
@@ -553,66 +553,66 @@ ga*ga*b*b-4*Math.abs(ga)*a,0>q?(q=c,d=(b+q)*(f-m)/2,a-=d,n=f-m,m+=f-m,n+=0==q?0:
|
|
|
553
553
|
0,D=y.length-1;S<y.length||0<=D;S++,D--){b=u.reversed?y[D]:y[S];a=b.color?b.color:u.reversed?u._colorSet[(y.length-1-S)%u._colorSet.length]:u._colorSet[S%u._colorSet.length];c=b.indexLabelPlacement||u.indexLabelPlacement||"outside";s=b.indexLabelTextAlign||u.indexLabelTextAlign||"left";f=b.indexLabelBackgroundColor||u.indexLabelBackgroundColor||(w?"transparent":null);g=b.indexLabelBorderColor||u.indexLabelBorderColor||(w?"transparent":null);l=e(b.indexLabelBorderThickness)?u.indexLabelBorderThickness:
|
|
554
554
|
b.indexLabelBorderThickness;d=e(b.indexLabelPadding)?u.options.indexLabelPadding?u.options.indexLabelPadding:u.indexLabelPadding:b.indexLabelPadding;m=b.indexLabelFontColor||u.indexLabelFontColor||"#979797";n=e(b.indexLabelFontSize)?u.indexLabelFontSize:b.indexLabelFontSize;q=b.indexLabelFontStyle||u.indexLabelFontStyle||"normal";r=b.indexLabelFontFamily||u.indexLabelFontFamily||"arial";p=b.indexLabelFontWeight||u.indexLabelFontWeight||"normal";a=b.indexLabelLineColor||u.options.indexLabelLineColor||
|
|
555
555
|
a;C="number"===typeof b.indexLabelLineThickness?b.indexLabelLineThickness:"number"===typeof u.indexLabelLineThickness?u.indexLabelLineThickness:2;k=b.indexLabelLineDashType||u.indexLabelLineDashType||"solid";v="undefined"!==typeof b.indexLabelWrap?b.indexLabelWrap:"undefined"!==typeof u.indexLabelWrap?u.indexLabelWrap:!0;t=u.dataPointIds[S];z._eventManager.objectMap[t]={id:t,objectType:"dataPoint",dataPointIndex:S,dataSeriesIndex:0,funnelSection:P[u.reversed?y.length-1-S:S]};"inside"===u.indexLabelPlacement&&
|
|
556
|
-
(x[S]=S!==Y?u.reversed?P[S].x2-P[S].x1:P[S].x3-P[S].x4:P[S].x3-P[S].x6,20>x[S]&&(x[S]=S!==Y?u.reversed?P[S].x3-P[S].x4:P[S].x2-P[S].x1:P[S].x2-P[S].x1,x[S]/=2));t=b.indexLabelMaxWidth?b.indexLabelMaxWidth:u.options.indexLabelMaxWidth?u.indexLabelMaxWidth:x[S];if(t>x[S]||0>t)t=x[S];E[S]="inside"===u.indexLabelPlacement?v?Math.max(P[S].height,n):1.5*n+("object"===typeof d?(d.top||0)+(d.bottom||0):2*d):!1;B=z.getPercentAndTotal(u,b);if(u.indexLabelFormatter||b.indexLabelFormatter)N={chart:z
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
J[
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
window.
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
n.
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
r.
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
r.
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
a
|
|
615
|
-
|
|
556
|
+
(x[S]=S!==Y?u.reversed?P[S].x2-P[S].x1:P[S].x3-P[S].x4:P[S].x3-P[S].x6,20>x[S]&&(x[S]=S!==Y?u.reversed?P[S].x3-P[S].x4:P[S].x2-P[S].x1:P[S].x2-P[S].x1,x[S]/=2));t=b.indexLabelMaxWidth?b.indexLabelMaxWidth:u.options.indexLabelMaxWidth?u.indexLabelMaxWidth:x[S];if(t>x[S]||0>t)t=x[S];E[S]="inside"===u.indexLabelPlacement?v?Math.max(P[S].height,n):1.5*n+("object"===typeof d?(d.top||0)+(d.bottom||0):2*d):!1;B=z.getPercentAndTotal(u,b);if(u.indexLabelFormatter||b.indexLabelFormatter)N={chart:z,dataSeries:u,
|
|
557
|
+
dataPoint:b,total:B.total,percent:B.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(N):b.indexLabel?z.replaceKeywordsWithValue(b.indexLabel,b,u,S):u.indexLabelFormatter?u.indexLabelFormatter(N):u.indexLabel?z.replaceKeywordsWithValue(u.indexLabel,b,u,S):b.label?b.label:"";0>=C&&(C=0);1E3>t&&1E3-t<A&&(t+=1E3-t);e(u.options.indexLabelMaxWidth)&&(u.indexLabelMaxWidth=e(u.indexLabelMaxWidth)?t:Math.max(t,u.indexLabelMaxWidth));Q.roundRect||Ea(Q);c=new na(Q,{fontSize:n,fontFamily:r,fontColor:m,
|
|
558
|
+
fontStyle:q,fontWeight:p,horizontalAlign:c,textAlign:s,backgroundColor:f,borderColor:g,borderThickness:l,maxWidth:t,maxHeight:!1===E[S]?(v?4.28571429*n:1.5*n)+("object"===typeof d?(d.top||0)+(d.bottom||0):2*d):E[S],text:b,padding:d,textBaseline:"middle"});c.measureText();c.height=c.height===2*c.padding?0:c.height;c.width=c.width===2*c.padding?0:c.width;J.push({textBlock:c,id:u.reversed?D:S,isDirty:!1,lineColor:a,lineThickness:C,lineDashType:k,height:c.height<c.maxHeight?c.height:c.maxHeight,width:c.width<
|
|
559
|
+
c.maxWidth?c.width:c.maxWidth})}}}function f(){var a,b,c,f,g,h=[];g=!1;c=0;for(var l,e=L-U-aa/2,e=u.options.indexLabelMaxWidth?u.indexLabelMaxWidth>e?e:u.indexLabelMaxWidth:e,d=J.length-1;0<=d;d--){l=y[J[d].id];c=J[d];f=c.textBlock;b=(a=r(d)<P.length?J[r(d)]:null)?a.textBlock:null;c=c.height;a&&f.y+c+ha>b.y&&(g=!0);c=l.indexLabelMaxWidth||e;if(c>e||0>c)c=e;h.push(c)}if(g)for(d=J.length-1;0<=d;d--)a=P[d],J[d].textBlock.maxWidth=h[h.length-(d+1)],J[d].textBlock.measureText(),J[d].textBlock.height=J[d].textBlock.height===
|
|
560
|
+
2*J[d].textBlock.padding?0:J[d].textBlock.height,J[d].textBlock.width=J[d].textBlock.width===2*J[d].textBlock.padding?0:J[d].textBlock.width,J[d].textBlock.x=L-e,c=J[d].textBlock.height<J[d].textBlock.maxHeight?J[d].textBlock.height:J[d].textBlock.maxHeight,g=J[d].textBlock.width<J[d].textBlock.maxWidth?J[d].textBlock.width:J[d].textBlock.maxWidth,J[d].height=c,J[d].width=g,c="undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,J[d].textBlock.y=c-J[d].height/2,u.reversed?(J[d].textBlock.y+J[d].height>
|
|
561
|
+
X+B&&(J[d].textBlock.y=X+B-J[d].height),J[d].textBlock.y<ya-B&&(J[d].textBlock.y=ya-B)):(J[d].textBlock.y<X-B&&(J[d].textBlock.y=X-B),J[d].textBlock.y+J[d].height>ya+B&&(J[d].textBlock.y=ya+B-J[d].height))}function l(){var a,b,c,f;if("inside"!==u.indexLabelPlacement)for(var g=0;g<P.length;g++)0==J[g].textBlock.text.length?J[g].isDirty=!0:(a=P[g],c="undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,b=u.reversed?"undefined"!==typeof a.x5?c>$?h(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==
|
|
562
|
+
typeof a.x5?c<$?h(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,J[g].textBlock.x=b+aa,J[g].textBlock.y=c-J[g].height/2,u.reversed?(J[g].textBlock.y+J[g].height>X+B&&(J[g].textBlock.y=X+B-J[g].height),J[g].textBlock.y<ya-B&&(J[g].textBlock.y=ya-B)):(J[g].textBlock.y<X-B&&(J[g].textBlock.y=X-B),J[g].textBlock.y+J[g].height>ya+B&&(J[g].textBlock.y=ya+B-J[g].height)));else for(g=0;g<P.length;g++)0==J[g].textBlock.text.length?J[g].isDirty=!0:(a=P[g],b=a.height,c=J[g].height,f=J[g].width,b>=c?(b=g!=Y?(a.x4+a.x3)/
|
|
563
|
+
2-f/2:(a.x5+a.x4)/2-f/2,c=g!=Y?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,J[g].textBlock.x=b,J[g].textBlock.y=c):J[g].isDirty=!0)}function d(){function a(b,c){var g;if(0>b||b>=J.length)return 0;var f,h=J[b].textBlock;if(0>c){c*=-1;f=n(b);g=k(f,b);if(g>=c)return h.y-=c,c;if(0==b)return 0<g&&(h.y-=g),g;g+=a(f,-(c-g));0<g&&(h.y-=g);return g}f=r(b);g=k(b,f);if(g>=c)return h.y+=c,c;if(b==P.length-1)return 0<g&&(h.y+=g),g;g+=a(f,c-g);0<g&&(h.y+=g);return g}function b(){var a,g,f,h,l=0,e;h=(O-M+2*B)/q;e=q;for(var d,
|
|
564
|
+
m=1;m<e;m++){f=m*h;for(var p=J.length-1;0<=p;p--)!J[p].isDirty&&(J[p].textBlock.y<f&&J[p].textBlock.y+J[p].height>f)&&(d=r(p),!(d>=J.length-1)&&J[p].textBlock.y+J[p].height+ha>J[d].textBlock.y&&(J[p].textBlock.y=J[p].textBlock.y+J[p].height-f>f-J[p].textBlock.y?f+1:f-J[p].height-1))}for(d=P.length-1;0<d;d--)if(!J[d].isDirty){f=n(d);if(0>f&&(f=0,J[f].isDirty))break;if(J[d].textBlock.y<J[f].textBlock.y+J[f].height){g=g||d;h=d;for(e=0;J[h].textBlock.y<J[f].textBlock.y+J[f].height+ha;){a=a||J[h].textBlock.y+
|
|
565
|
+
J[h].height;e+=J[h].height;e+=ha;h=f;if(0>=h){h=0;e+=J[h].height;break}f=n(h);if(0>f){h=0;e+=J[h].height;break}}if(h!=d){l=J[h].textBlock.y;a-=l;a=e-a;l=c(a,g,h);break}}}return l}function c(a,b,g){var f=[],h=0,l=0;for(a=Math.abs(a);g<=b;g++)f.push(P[g]);f.sort(function(a,b){return a.height-b.height});for(g=0;g<f.length;g++)if(b=f[g],h<a)l++,h+=J[b.id].height+ha,J[b.id].textBlock.text="",J[b.id].indexLabelText="",J[b.id].isDirty=!0,J[b.id].textBlock.measureText();else break;return l}for(var g,f,h,
|
|
566
|
+
l,e,m,q=1,p=0;p<2*q;p++){for(var C=J.length-1;0<=C&&!(0<=n(C)&&n(C),h=J[C],l=h.textBlock,m=(e=r(C)<P.length?J[r(C)]:null)?e.textBlock:null,g=+h.height.toFixed(6),f=+l.y.toFixed(6),!h.isDirty&&(e&&f+g+ha>+m.y.toFixed(6))&&(g=l.y+g+ha-m.y,f=a(C,-g),f<g&&(0<f&&(g-=f),f=a(r(C),g),f!=g)));C--);b()}}function k(a,b){return(b<P.length?J[b].textBlock.y:u.reversed?X+B:ya+B)-(0>a?u.reversed?ya-B:X-B:J[a].textBlock.y+J[a].height+ha)}function t(a,b,c){var g,f,h,e=[],d=B,n=[];-1!==b&&(0<=fa.indexOf(b)?(f=fa.indexOf(b),
|
|
567
|
+
fa.splice(f,1)):(fa.push(b),fa=fa.sort(function(a,b){return a-b})));if(0===fa.length)e=ma;else{f=B*(1!=fa.length||0!=fa[0]&&fa[0]!=P.length-1?2:1)/m();for(var r=0;r<P.length;r++){if(1==fa.length&&0==fa[0]){if(0===r){e.push(ma[r]);g=d;continue}}else 0===r&&(g=-1*d);e.push(ma[r]+g);if(0<=fa.indexOf(r)||r<P.length&&0<=fa.indexOf(r+1))g+=f}}h=function(){for(var a=[],b=0;b<P.length;b++)a.push(e[b]-P[b].y1);return a}();var C={startTime:(new Date).getTime(),duration:c||500,easingFunction:function(a,b,c,
|
|
568
|
+
g){return v.easing.easeOutQuart(a,b,c,g)},changeSection:function(a){for(var b,c,g=0;g<P.length;g++)b=h[g],c=P[g],b*=a,"undefined"===typeof n[g]&&(n[g]=0),0>n&&(n*=-1),c.y1+=b-n[g],c.y2+=b-n[g],c.y3+=b-n[g],c.y4+=b-n[g],c.y5&&(c.y5+=b-n[g],c.y6+=b-n[g]),n[g]=b}};a._animator.animate(0,c,function(c){var g=a.plotArea.ctx||a.ctx;oa=!0;g.clearRect(x.x1,x.y1,x.x2-x.x1,x.y2-x.y1);g.fillStyle=a.backgroundColor;g.fillRect(x.x1,x.y1,x.width,x.height);C.changeSection(c,b);var f={};f.dataSeries=u;f.dataPoint=
|
|
569
|
+
u.reversed?u.dataPoints[y.length-1-b]:u.dataPoints[b];f.index=u.reversed?y.length-1-b:b;a.toolTip.highlightObjects([f]);for(f=0;f<P.length;f++)p(g,P[f],u.fillOpacity);E(g);K&&("inside"!==u.indexLabelPlacement?q(g):l(),s(g));1<=c&&(oa=!1)},null,v.easing.easeOutQuart)}function m(){for(var a=0,b=0;b<P.length-1;b++)(0<=fa.indexOf(b)||0<=fa.indexOf(b+1))&&a++;return a}function q(a){for(var b,c,g,f,l=0;l<P.length;l++)f=1===J[l].lineThickness%2?0.5:0,c=((P[l].y2+P[l].y4)/2<<0)+f,b=h(c).x2-1,isNaN(b)&&(Math.round(P[l].x1)===
|
|
570
|
+
Math.round(P[l].x4)&&Math.round(P[l].x2)===Math.round(P[l].x3))&&(b=P[l].x2),g=J[l].textBlock.x,f=(J[l].textBlock.y+J[l].height/2<<0)+f,J[l].isDirty||0==J[l].lineThickness||(a.strokeStyle=J[l].lineColor,a.lineWidth=J[l].lineThickness,a.setLineDash&&a.setLineDash(R(J[l].lineDashType,J[l].lineThickness)),a.beginPath(),a.moveTo(b,c),a.lineTo(g,f),a.stroke())}function n(a){for(a-=1;-1<=a&&-1!=a&&J[a].isDirty;a--);return a}function r(a){for(a+=1;a<=P.length&&a!=P.length&&J[a].isDirty;a++);return a}function h(a){for(var b,
|
|
571
|
+
c=0;c<y.length;c++)if(P[c].y1<a&&P[c].y4>a){b=P[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 s(a){for(var b=0;b<P.length;b++)J[b].isDirty||(a&&(J[b].textBlock.ctx=a),J[b].textBlock.y+=J[b].textBlock._lineHeight/2,J[b].textBlock.render(!0),J[b].textBlock.y-=J[b].textBlock._lineHeight/2)}function E(a){z.plotArea.layoutManager.reset();a.roundRect||Ea(a);z.title&&(z.title.dockInsidePlotArea||
|
|
572
|
+
"center"===z.title.horizontalAlign&&"center"===z.title.verticalAlign)&&(z.title.ctx=a,z.title.render());if(z.subtitles)for(var b=0;b<z.subtitles.length;b++){var c=z.subtitles[b];if(c.dockInsidePlotArea||"center"===c.horizontalAlign&&"center"===c.verticalAlign)z.subtitles.ctx=a,c.render()}z.legend&&(z.legend.dockInsidePlotArea||"center"===z.legend.horizontalAlign&&"center"===z.legend.verticalAlign)&&(z.legend.ctx=a,z.legend.setLayout(),z.legend.render());ka.fNg&&ka.fNg(z)}var z=this;if(!(0>=a.dataSeriesIndexes.length)){for(var u=
|
|
573
|
+
this.data[a.dataSeriesIndexes[0]],y=u.dataPoints,x=this.plotArea,B=0.025*x.width,D=0.01*x.width,G=0,F=x.height-2*B-4,H=Math.min(x.width-2*D,2.8*x.height),K=!1,T=0;T<y.length;T++)if(!K&&("undefined"!==typeof y[T].indexLabel&&null!==y[T].indexLabel&&0<y[T].indexLabel.toString().length)&&(K=!0),!K&&("undefined"!==typeof y[T].label&&null!==y[T].label&&0<y[T].label.toString().length)&&(K=!0),!K&&"function"===typeof u.indexLabelFormatter||"function"===typeof y[T].indexLabelFormatter)K=!0;K=K||"undefined"!==
|
|
574
|
+
typeof u.indexLabel&&null!==u.indexLabel&&0<u.indexLabel.toString().length;"inside"!==u.indexLabelPlacement&&K||(D=(x.width-0.75*H)/2);var T=x.x1+D,L=x.x2-D,M=x.y1+B+2,O=x.y2-B-2,Q=a.targetCanvasCtx||this.plotArea.ctx||this.ctx;if(0!=u.length&&(u.dataPoints&&u.visible)&&0!==y.length){var ia,I;a=75*H/100;var aa=30*(L-a)/100;"funnel"===u.type?(ia=e(u.options.neckHeight)?0.35*F:u.neckHeight,I=e(u.options.neckWidth)?0.25*a:u.neckWidth,"string"===typeof ia&&ia.match(/%$/)?(ia=parseInt(ia),ia=ia*F/100):
|
|
575
|
+
ia=parseInt(ia),"string"===typeof I&&I.match(/%$/)?(I=parseInt(I),I=I*a/100):I=parseInt(I),ia>F?ia=F:0>=ia&&(ia=0),I>a?I=a-0.5:0>=I&&(I=0)):"pyramid"===u.type&&(I=ia=0,u.reversed=u.reversed?!1:!0);var D=T+a/2,W=T,U=T+a,X=u.reversed?O:M,ba=D-I/2,Z=D+I/2,$=u.reversed?M+ia:O-ia,ya=u.reversed?M:O;I=u.valueRepresents=u.valueRepresents?u.valueRepresents:"height";T=[];a=[];var P=[],D=[],V=M,Y,ga=($-X)/(ba-W),ja=-ga,H="area"===I?c():g();if(-1!==H){if(u.reversed)for(D.push(V),I=H.length-1;0<I;I--)V+=H[I],
|
|
576
|
+
D.push(Math.round(V));else for(I=0;I<H.length;I++)V+=H[I],D.push(Math.round(V));if(u.reversed)for(I=0;I<H.length;I++)D[I]<$?(T.push(ba),a.push(Z),Y=I):(T.push((D[I]-X+ga*W)/ga),a.push((D[I]-X+ja*U)/ja));else for(I=0;I<H.length;I++)D[I]<$?(T.push((D[I]-X+ga*W)/ga),a.push((D[I]-X+ja*U)/ja),Y=I):(T.push(ba),a.push(Z));for(I=0;I<H.length-1;I++)V=u.reversed?y[y.length-1-I].color?y[y.length-1-I].color:u._colorSet[(y.length-1-I)%u._colorSet.length]:y[I].color?y[I].color:u._colorSet[I%u._colorSet.length],
|
|
577
|
+
I===Y?P.push({x1:T[I],y1:D[I],x2:a[I],y2:D[I],x3:Z,y3:$,x4:a[I+1],y4:D[I+1],x5:T[I+1],y5:D[I+1],x6:ba,y6:$,id:I,height:D[I+1]-D[I],color:V}):P.push({x1:T[I],y1:D[I],x2:a[I],y2:D[I],x3:a[I+1],y3:D[I+1],x4:T[I+1],y4:D[I+1],id:I,height:D[I+1]-D[I],color:V}),u.dataPointEOs[I]&&P[I]&&(u.dataPointEOs[I].sectionsofFunnel=P[I]);var ha=2,J=[],oa=!1,fa=[],ma=[],T=!1;a=a=0;wa(fa);for(I=0;I<y.length;I++)y[I].exploded&&(T=!0,u.reversed?fa.push(y.length-1-I):fa.push(I));Q.clearRect(x.x1,x.y1,x.width,x.height);
|
|
578
|
+
Q.fillStyle=z.backgroundColor;Q.fillRect(x.x1,x.y1,x.width,x.height);if(K&&u.visible&&(b(),l(),"inside"!==u.indexLabelPlacement)){f();d();for(I=0;I<y.length;I++)J[I].isDirty||(a=J[I].textBlock.x+J[I].width,a=(L-a)/2,0==I&&(G=a),G>a&&(G=a));for(I=0;I<P.length;I++)P[I].x1+=G,P[I].x2+=G,P[I].x3+=G,P[I].x4+=G,P[I].x5&&(P[I].x5+=G,P[I].x6+=G),J[I].textBlock.x+=G}for(I=0;I<P.length;I++)G=P[I],p(Q,G,u.fillOpacity),ma.push(G.y1);E(Q);K&&u.visible&&("inside"===u.indexLabelPlacement||z.animationEnabled||q(Q),
|
|
579
|
+
z.animationEnabled||s());if(!K)for(I=0;I<y.length;I++)G=u.dataPointIds[I],a={id:G,objectType:"dataPoint",dataPointIndex:I,dataSeriesIndex:0,funnelSection:P[u.reversed?y.length-1-I:I]},z._eventManager.objectMap[G]=a;!z.animationEnabled&&T?t(z,-1,0):z.animationEnabled&&!z.animatedRender&&t(z,-1,0);this.funnelPyramidClickHandler=function(a){var b=-1;if(!oa&&!z.isAnimating&&(e(a.dataSeries.explodeOnClick)||a.dataSeries.explodeOnClick)&&(b=u.reversed?y.length-1-a.dataPointIndex:a.dataPointIndex,0<=b)){a=
|
|
580
|
+
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;t(z,b,500)}};return{source:Q,dest:this.plotArea.ctx,animationCallback:function(a,b){v.fadeInAnimation(a,b);1<=a&&(t(z,-1,500),E(z.plotArea.ctx||z.ctx))},easingFunction:v.easing.easeInQuad,animationBase:0}}}}};k.prototype.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||
|
|
581
|
+
window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();k.prototype.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;k.prototype.set=function(a,g,c){c="undefined"===typeof c?!0:c;"options"===a?(this.options=g,c&&this.render()):k.base.set.call(this,a,g,c)};k.prototype.exportChart=function(a){a="undefined"===typeof a?
|
|
582
|
+
{}:a;var g=a.format?a.format:"png",c=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+g);db(this.canvas,g,c)};k.prototype.print=function(){var a=this.exportChart({toDataURL:!0}),g=document.createElement("iframe");g.setAttribute("class","canvasjs-chart-print-frame");Q(g,{position:"absolute",width:"100%",border:"0px",margin:"0px 0px 0px 0px",padding:"0px 0px 0px 0px"});g.style.height=this.height+"px";this._canvasJSContainer.appendChild(g);var c=this,b=g.contentWindow||
|
|
583
|
+
g.contentDocument.document||g.contentDocument;b.document.open();b.document.write('<!DOCTYPE HTML>\n<html><body><img src="'+a+'"/><body/></html>');b.document.body&&b.document.body.style&&(b.document.body.style.margin="0px 0px 0px 0px",b.document.body.style.padding="0px 0px 0px 0px");b.document.close();setTimeout(function(){b.focus();b.print();setTimeout(function(){c._canvasJSContainer.removeChild(g)},1E3)},500)};k.prototype.getPercentAndTotal=function(a,g){var c=null,b=null,f=c=null;if(0<=a.type.indexOf("stacked"))b=
|
|
584
|
+
0,c=g.x.getTime?g.x.getTime():g.x,c in a.plotUnit.yTotals&&(b=a.plotUnit.yTotals[c],c=a.plotUnit.yAbsTotals[c],f=isNaN(g.y)?0:0===c?0:100*(g.y/c));else if("pie"===a.type||"doughnut"===a.type||"funnel"===a.type||"pyramid"===a.type){for(c=b=0;c<a.dataPoints.length;c++)isNaN(a.dataPoints[c].y)||(b+=a.dataPoints[c].y);f=isNaN(g.y)?0:100*(g.y/b)}return{percent:f,total:b}};k.prototype.replaceKeywordsWithValue=function(a,g,c,b,f){var l=this;f="undefined"===typeof f?0:f;if((0<=c.type.indexOf("stacked")||
|
|
585
|
+
"pie"===c.type||"doughnut"===c.type||"funnel"===c.type||"pyramid"===c.type)&&(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))){var e="#percent",d="#total",p=this.getPercentAndTotal(c,g),d=isNaN(p.total)?d:p.total,e=isNaN(p.percent)?e:p.percent;do{p="";if(c.percentFormatString)p=c.percentFormatString;else{var p="#,##0.",m=Math.max(Math.ceil(Math.log(1/Math.abs(e))/Math.LN10),2);if(isNaN(m)||!isFinite(m))m=2;for(var q=0;q<m;q++)p+="#";c.percentFormatString=p}a=a.replace("#percent",$(e,p,l._cultureInfo));
|
|
586
|
+
a=a.replace("#total",$(d,c.yValueFormatString?c.yValueFormatString:"#,##0.########",l._cultureInfo))}while(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))}return a.replace(/\{.*?\}|"[^"]*"|'[^']*'/g,function(a){if('"'===a[0]&&'"'===a[a.length-1]||"'"===a[0]&&"'"===a[a.length-1])return a.slice(1,a.length-1);a=Oa(a.slice(1,a.length-1));a=a.replace("#index",f);var e=null;try{var h=a.match(/(.*?)\s*\[\s*(.*?)\s*\]/);h&&0<h.length&&(e=Oa(h[2]),a=Oa(h[1]))}catch(d){}h=null;if("color"===a)return"waterfall"===
|
|
587
|
+
c.type?g.color?g.color:0<g.y?c.risingColor:c.fallingColor:"error"===c.type?c.color?c.color:c._colorSet[e%c._colorSet.length]:g.color?g.color:c.color?c.color:c._colorSet[b%c._colorSet.length];if(g.hasOwnProperty(a))h=g;else if(c.hasOwnProperty(a))h=c;else return"";h=h[a];null!==e&&(h=h[e]);return"x"===a?(c.axisX&&"dateTime"===c.axisX.valueType||"dateTime"===c.xValueType||g.x&&g.x.getTime)&&!c.axisX.logarithmic?sa(h,g.xValueFormatString?g.xValueFormatString:c.xValueFormatString?c.xValueFormatString:
|
|
588
|
+
c.xValueFormatString=l.axisX&&l.axisX.autoValueFormatString?l.axisX.autoValueFormatString:"DD MMM YY",l._cultureInfo):$(h,g.xValueFormatString?g.xValueFormatString:c.xValueFormatString?c.xValueFormatString:c.xValueFormatString="#,##0.########",l._cultureInfo):"y"===a?$(h,g.yValueFormatString?g.yValueFormatString:c.yValueFormatString?c.yValueFormatString:c.yValueFormatString=c.axisY&&c.axisY.logarithmic&&"number"===typeof h&&0<h&&(1E-7>Math.abs(h)||1E7<Math.abs(h))?"0.##E+0":"#,##0.########",l._cultureInfo):
|
|
589
|
+
"z"===a?$(h,g.zValueFormatString?g.zValueFormatString:c.zValueFormatString?c.zValueFormatString:c.zValueFormatString="#,##0.########",l._cultureInfo):h})};ja(F,Z);F.prototype.setLayout=function(){var a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,g=a.layoutManager.getFreeSpace(),c=null,b=0,f=0,l=0,d=0,p=this.markerMargin=this.chart.options.legend&&!e(this.chart.options.legend.markerMargin)?this.chart.options.legend.markerMargin:0.3*this.fontSize;this.height=0;var k=[],m=[];if("top"===this.verticalAlign||
|
|
590
|
+
"bottom"===this.verticalAlign)this.orientation="horizontal",c=this.verticalAlign,l=this.maxWidth=null!==this.maxWidth?this.maxWidth:g.width,d=this.maxHeight=null!==this.maxHeight?this.maxHeight:0.5*g.height;else if("center"===this.verticalAlign){this.orientation="vertical";if("left"===this.horizontalAlign||"center"===this.horizontalAlign||"right"===this.horizontalAlign)c=this.horizontalAlign;l=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*g.width;d=this.maxHeight=null!==this.maxHeight?this.maxHeight:
|
|
591
|
+
g.height}this.errorMarkerColor=[];for(var q=0;q<this.dataSeries.length;q++){var n=this.dataSeries[q];if(n.dataPoints&&n.dataPoints.length){if("pie"!==n.type&&"doughnut"!==n.type&&"funnel"!==n.type&&"pyramid"!==n.type){var r=n.legendMarkerType=n.legendMarkerType?n.legendMarkerType:"line"!==n.type&&"stepLine"!==n.type&&"spline"!==n.type&&"scatter"!==n.type&&"bubble"!==n.type||!n.markerType?"error"===n.type&&n._linkedSeries?n._linkedSeries.legendMarkerType?n._linkedSeries.legendMarkerType:H.getDefaultLegendMarker(n._linkedSeries.type):
|
|
592
|
+
H.getDefaultLegendMarker(n.type):n.markerType,h=n.legendText?n.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:n,dataPoint:null}):n.name,v=n.legendMarkerColor=n.legendMarkerColor?n.legendMarkerColor:n.markerColor?n.markerColor:"error"===n.type?e(n.whiskerColor)?n._colorSet[0]:n.whiskerColor:n._colorSet[0],t=n.markerSize||"line"!==n.type&&"stepLine"!==n.type&&"spline"!==n.type?0.75*this.lineHeight:0,s=n.legendMarkerBorderColor?n.legendMarkerBorderColor:
|
|
593
|
+
n.markerBorderColor,u=n.legendMarkerBorderThickness?n.legendMarkerBorderThickness:n.markerBorderThickness?Math.max(1,Math.round(0.2*t)):0;"error"===n.type&&this.errorMarkerColor.push(v);h=n.legendText=this.chart.replaceKeywordsWithValue(h,n.dataPoints[0],n,q);r={markerType:r,markerColor:v,text:h,textBlock:null,chartType:n.type,markerSize:t,lineColor:n._colorSet[0],dataSeriesIndex:n.index,dataPointIndex:null,markerBorderColor:s,markerBorderThickness:u};k.push(r)}else{e(n.options.legendText)&&(n.legendText=
|
|
594
|
+
n.options.legendText);for(var y=0;y<n.dataPoints.length;y++){var x=n.dataPoints[y],r=x.legendMarkerType?x.legendMarkerType:n.legendMarkerType?n.legendMarkerType:H.getDefaultLegendMarker(n.type),h=x.legendText?x.legendText:x.name?x.name:n.legendText?n.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:n,dataPoint:x}):x.name?x.name:"DataPoint: "+(y+1),v=x.legendMarkerColor?x.legendMarkerColor:n.legendMarkerColor?n.legendMarkerColor:x.color?x.color:
|
|
595
|
+
n.color?n.color:n._colorSet[y%n._colorSet.length],t=0.75*this.lineHeight,s=x.legendMarkerBorderColor?x.legendMarkerBorderColor:n.legendMarkerBorderColor?n.legendMarkerBorderColor:x.markerBorderColor?x.markerBorderColor:n.markerBorderColor,u=x.legendMarkerBorderThickness?x.legendMarkerBorderThickness:n.legendMarkerBorderThickness?n.legendMarkerBorderThickness:x.markerBorderThickness||n.markerBorderThickness?Math.max(1,Math.round(0.2*t)):0,h=this.chart.replaceKeywordsWithValue(h,x,n,y),r={markerType:r,
|
|
596
|
+
markerColor:v,text:h,textBlock:null,chartType:n.type,markerSize:t,dataSeriesIndex:q,dataPointIndex:y,markerBorderColor:s,markerBorderThickness:u};(x.showInLegend||n.showInLegend&&!1!==x.showInLegend)&&k.push(r)}}e(n.legendText)&&(n.legendText=n.name)}}!0===this.reversed&&k.reverse();if(0<k.length){n=null;h=x=y=0;x=null!==this.itemWidth?null!==this.itemMaxWidth?this.itemWidth=Math.min(this.itemWidth,this.itemMaxWidth,l):this.itemMaxWidth=Math.min(this.itemWidth,l):null!==this.itemMaxWidth?Math.min(this.itemMaxWidth,
|
|
597
|
+
l):this.itemMaxWidth=l;t=0===t?0.75*this.lineHeight:t;x-=t+p;for(q=0;q<k.length;q++){r=k[q];v=x;if("line"===r.chartType||"spline"===r.chartType||"stepLine"===r.chartType)v-=2*0.1*this.lineHeight;if(!(0>=d||"undefined"===typeof d||0>=v||"undefined"===typeof v))if("horizontal"===this.orientation){r.textBlock=new na(this.ctx,{x:0,y:0,maxWidth:v,maxHeight:this.itemWrap?d:this.lineHeight,angle:0,text:r.text,textAlign:this.itemTextAlign,fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,
|
|
598
|
+
fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"});r.textBlock.measureText();null!==this.itemWidth&&(r.textBlock.width=this.itemWidth-(t+p+("line"===r.chartType||"spline"===r.chartType||"stepLine"===r.chartType?2*0.1*this.lineHeight:0)));if(!n||n.width+Math.round(r.textBlock.width+t+p+(0===n.width?0:this.horizontalSpacing)+("line"===r.chartType||"spline"===r.chartType||"stepLine"===r.chartType?2*0.1*this.lineHeight:0))>l)n={items:[],width:0},m.push(n),this.height+=h,h=0;h=Math.max(h,
|
|
599
|
+
r.textBlock.height?r.textBlock.height:this.lineHeight);r.textBlock.x=n.width;r.textBlock.y=0;n.width+=Math.round(r.textBlock.width+t+p+(0===n.width?0:this.horizontalSpacing)+("line"===r.chartType||"spline"===r.chartType||"stepLine"===r.chartType?2*0.1*this.lineHeight:0));n.items.push(r);this.width=Math.max(n.width,this.width)}else r.textBlock=new na(this.ctx,{x:0,y:0,maxWidth:x,maxHeight:!0===this.itemWrap?d:1.5*this.fontSize,angle:0,text:r.text,textAlign:this.itemTextAlign,fontSize:this.fontSize,
|
|
600
|
+
fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),r.textBlock.measureText(),null!==this.itemWidth&&(r.textBlock.width=this.itemWidth-(t+p+("line"===r.chartType||"spline"===r.chartType||"stepLine"===r.chartType?2*0.1*this.lineHeight:0))),this.height<d-this.lineHeight?(n={items:[],width:0},m.push(n)):(n=m[y],y=(y+1)%m.length),n&&(this.height+=r.textBlock.height?r.textBlock.height:this.lineHeight,r.textBlock.x=n.width,r.textBlock.y=
|
|
601
|
+
0,n.width+=Math.round(r.textBlock.width+t+p+(0===n.width?0:this.horizontalSpacing)+("line"===r.chartType||"spline"===r.chartType||"stepLine"===r.chartType?2*0.1*this.lineHeight:0)),n.items.push(r),this.width=Math.max(n.width,this.width))}this.height=!1===this.itemWrap?m.length*this.lineHeight:this.height+h;this.height=Math.min(d,this.height)>=this.lineHeight?Math.min(d,this.height):0;this.width=Math.min(l,this.width)}"top"===this.verticalAlign?(f="left"===this.horizontalAlign?g.x1:"right"===this.horizontalAlign?
|
|
602
|
+
g.x2-this.width-2:g.x1+g.width/2-this.width/2,b=g.y1):"center"===this.verticalAlign?(f="left"===this.horizontalAlign?g.x1:"right"===this.horizontalAlign?g.x2-this.width-2:g.x1+g.width/2-this.width/2,b=g.y1+g.height/2-this.height/2):"bottom"===this.verticalAlign&&(f="left"===this.horizontalAlign?g.x1:"right"===this.horizontalAlign?g.x2-this.width-2:g.x1+g.width/2-this.width/2,b=g.y2-this.height);this.items=k;for(q=0;q<this.items.length;q++)r=k[q],r.id=++this.chart._eventManager.lastObjectId,this.chart._eventManager.objectMap[r.id]=
|
|
603
|
+
{id:r.id,objectType:"legendItem",legendItemIndex:q,dataSeriesIndex:r.dataSeriesIndex,dataPointIndex:r.dataPointIndex};this.markerSize=t;this.rows=m;0<k.length&&0<this.height&&a.layoutManager.registerSpace(c,{width:this.width+2+2,height:this.height+5+5});this.bounds={x1:f,y1:b,x2:f+this.width,y2:b+this.height}};F.prototype.render=function(){var a=this.bounds.x1,g=this.bounds.y1,c=this.markerMargin,b=this.maxWidth,f=this.maxHeight,l=this.markerSize,e=this.rows;(0<this.borderThickness&&this.borderColor||
|
|
604
|
+
this.backgroundColor)&&this.ctx.roundRect(a,g,this.width,this.height,this.cornerRadius,this.borderThickness,this.backgroundColor,this.borderColor);for(var d=0,p=0;p<e.length;p++){for(var m=e[p],q=0,n=0;n<m.items.length;n++){var r=m.items[n],h=r.textBlock.x+a+(0===n?0.2*l:this.horizontalSpacing),k=g+d,v=h;this.chart.data[r.dataSeriesIndex].visible||(this.ctx.globalAlpha=0.5);this.ctx.save();this.ctx.beginPath();this.ctx.rect(a,g,b,Math.max(f-f%this.lineHeight,0));this.ctx.clip();if("line"===r.chartType||
|
|
605
|
+
"stepLine"===r.chartType||"spline"===r.chartType)this.ctx.strokeStyle=r.lineColor,this.ctx.lineWidth=Math.ceil(this.lineHeight/8),this.ctx.beginPath(),this.ctx.moveTo(h-0.1*this.lineHeight,k+this.lineHeight/2),this.ctx.lineTo(h+0.85*this.lineHeight,k+this.lineHeight/2),this.ctx.stroke(),v-=0.1*this.lineHeight;if("error"===r.chartType){this.ctx.strokeStyle=this.errorMarkerColor[0];this.ctx.lineWidth=l/8;this.ctx.beginPath();var t=h-0.08*this.lineHeight+0.1*this.lineHeight,u=k+0.15*this.lineHeight,
|
|
606
|
+
s=0.7*this.lineHeight,x=s+0.02*this.lineHeight;this.ctx.moveTo(t,u);this.ctx.lineTo(t+s,u);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(t+s/2,u);this.ctx.lineTo(t+s/2,u+x);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(t,u+x);this.ctx.lineTo(t+s,u+x);this.ctx.stroke();this.errorMarkerColor.shift()}E.drawMarker(h+l/2,k+this.lineHeight/2,this.ctx,r.markerType,"error"===r.chartType||"line"===r.chartType||"spline"===r.chartType?r.markerSize/2:r.markerSize,r.markerColor,r.markerBorderColor,
|
|
607
|
+
r.markerBorderThickness);r.textBlock.x=h+c+l;if("line"===r.chartType||"stepLine"===r.chartType||"spline"===r.chartType)r.textBlock.x+=0.1*this.lineHeight;r.textBlock.y=Math.round(k+this.lineHeight/2);r.textBlock.render(!0);this.ctx.restore();q=0<n?Math.max(q,r.textBlock.height?r.textBlock.height:this.lineHeight):r.textBlock.height?r.textBlock.height:this.lineHeight;this.chart.data[r.dataSeriesIndex].visible||(this.ctx.globalAlpha=1);h=U(r.id);this.ghostCtx.fillStyle=h;this.ghostCtx.beginPath();this.ghostCtx.fillRect(v,
|
|
608
|
+
r.textBlock.y-this.lineHeight/2,r.textBlock.x+r.textBlock.width-v,r.textBlock.height?r.textBlock.height:this.lineHeight);r.x1=this.chart._eventManager.objectMap[r.id].x1=v;r.y1=this.chart._eventManager.objectMap[r.id].y1=r.textBlock.y-this.lineHeight/2;r.x2=this.chart._eventManager.objectMap[r.id].x2=r.textBlock.x+r.textBlock.width;r.y2=this.chart._eventManager.objectMap[r.id].y2=r.textBlock.y+(r.textBlock.height?r.textBlock.height:this.lineHeight)-this.lineHeight/2}d+=q}};ja(H,Z);H.prototype.getDefaultAxisPlacement=
|
|
609
|
+
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"===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";
|
|
610
|
+
if("pie"===a||"doughnut"===a||"funnel"===a||"pyramid"===a)return"none";"error"!==a&&window.console.log("Unknown Chart Type: "+a);return null};H.getDefaultLegendMarker=function(a){if("column"===a||"stackedColumn"===a||"stackedLine"===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"===
|
|
611
|
+
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";if("error"===a)return"none";window.console.log("Unknown Chart Type: "+a);return null};H.prototype.getDataPointAtX=function(a,g,c){if(!this.dataPoints||0===this.dataPoints.length)return null;var b={dataPoint:null,distance:Infinity,index:NaN},f=null,l=0,d=0,p=1,k=
|
|
612
|
+
Infinity,m=0,q=0,n=0;"none"!==this.chart.plotInfo.axisPlacement&&(this.axisX.logarithmic?(n=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),n=1<n?Math.min(Math.max((this.dataPoints.length-1)/n*Math.log(a/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0):(n=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,n=0<n?Math.min(Math.max((this.dataPoints.length-1)/n*(a-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0));for(;;){d=0<p?n+l:n-l;if(0<=d&&d<this.dataPoints.length){var f=
|
|
613
|
+
this.dataPoints[d],r=this.axisX&&this.axisX.logarithmic?f.x>a?f.x/a:a/f.x:Math.abs(f.x-a);r<b.distance&&(e(c)||c&&!e(f.y))&&(b.dataPoint=f,b.distance=r,b.index=d);f=r;f<=k?k=f:0<p?m++:q++;if(1E3<m&&1E3<q)break}else if(0>n-l&&n+l>=this.dataPoints.length)break;-1===p?(l++,p=1):p=-1}return g||(b.dataPoint.x.getTime?b.dataPoint.x.getTime():b.dataPoint.x)!==(a.getTime?a.getTime():a)?g&&null!==b.dataPoint?b:null:b};H.prototype.getDataPointAtXY=function(a,g,c){if(!this.dataPoints||0===this.dataPoints.length||
|
|
614
|
+
a<this.chart.plotArea.x1||a>this.chart.plotArea.x2||g<this.chart.plotArea.y1||g>this.chart.plotArea.y2)return null;c=c||!1;var b=[],f=0,l=0,d=1,p=!1,k=Infinity,m=0,q=0,n=0;if("none"!==this.chart.plotInfo.axisPlacement)if(n=(this.chart.axisX[0]?this.chart.axisX[0]:this.chart.axisX2[0]).getXValueAt({x:a,y:g}),this.axisX.logarithmic)var r=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),n=1<r?Math.min(Math.max((this.dataPoints.length-1)/r*Math.log(n/this.dataPoints[0].x)>>0,
|
|
615
|
+
0),this.dataPoints.length):0;else r=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,n=0<r?Math.min(Math.max((this.dataPoints.length-1)/r*(n-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;for(;;){l=0<d?n+f:n-f;if(0<=l&&l<this.dataPoints.length){var r=this.chart._eventManager.objectMap[this.dataPointIds[l]],h=this.dataPoints[l],v=null;if(r){switch(this.type){case "column":case "stackedColumn":case "stackedColumn100":case "bar":case "stackedBar":case "stackedBar100":case "rangeColumn":case "rangeBar":case "waterfall":case "error":a>=
|
|
616
616
|
r.x1&&(a<=r.x2&&g>=r.y1&&g<=r.y2)&&(b.push({dataPoint:h,dataPointIndex:l,dataSeries:this,distance:Math.min(Math.abs(r.x1-a),Math.abs(r.x2-a),Math.abs(r.y1-g),Math.abs(r.y2-g))}),p=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var t=pa("markerSize",h,this)||4,s=c?20:t,v=Math.sqrt(Math.pow(r.x1-a,2)+Math.pow(r.y1-g,2));v<=s&&b.push({dataPoint:h,dataPointIndex:l,dataSeries:this,distance:v});r=
|
|
617
617
|
Math.abs(r.x1-a);r<=k?k=r:0<d?m++:q++;v<=t/2&&(p=!0);break;case "rangeArea":case "rangeSplineArea":t=pa("markerSize",h,this)||4;s=c?20:t;v=Math.min(Math.sqrt(Math.pow(r.x1-a,2)+Math.pow(r.y1-g,2)),Math.sqrt(Math.pow(r.x1-a,2)+Math.pow(r.y2-g,2)));v<=s&&b.push({dataPoint:h,dataPointIndex:l,dataSeries:this,distance:v});r=Math.abs(r.x1-a);r<=k?k=r:0<d?m++:q++;v<=t/2&&(p=!0);break;case "bubble":t=r.size;v=Math.sqrt(Math.pow(r.x1-a,2)+Math.pow(r.y1-g,2));v<=t/2&&(b.push({dataPoint:h,dataPointIndex:l,dataSeries:this,
|
|
618
618
|
distance:v}),p=!0);break;case "pie":case "doughnut":t=r.center;s="doughnut"===this.type?r.percentInnerRadius*r.radius:0;v=Math.sqrt(Math.pow(t.x-a,2)+Math.pow(t.y-g,2));v<r.radius&&v>s&&(v=Math.atan2(g-t.y,a-t.x),0>v&&(v+=2*Math.PI),v=Number(((180*(v/Math.PI)%360+360)%360).toFixed(12)),t=Number(((180*(r.startAngle/Math.PI)%360+360)%360).toFixed(12)),s=Number(((180*(r.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===s&&1<r.endAngle&&(s=360),t>=s&&(0!==h.y&&!e(h.y))&&(s+=360,v<t&&(v+=360)),v>t&&v<s&&
|
|
@@ -993,7 +993,7 @@ onComplete:b});for(a=[];0<this.animations.length;)if(d=this.animations.shift(),c
|
|
|
993
993
|
ma)}},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/ma,b.height/ma);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/ma,c.canvas.height/ma);c.restore()}},easing:{linear:function(a,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*
|
|
994
994
|
((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}}},E={drawMarker:function(a,d,c,b,f,e,p,v){if(c){var k=1;c.fillStyle=e?e:"#000000";c.strokeStyle=p?p:"#000000";c.lineWidth=v?v:0;c.setLineDash&&c.setLineDash(R("solid",v));"circle"===b?(c.moveTo(a,d),c.beginPath(),c.arc(a,d,f/2,0,2*Math.PI,!1),e&&c.fill(),v&&(p?c.stroke():(k=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=k))):"square"===b?
|
|
995
995
|
(c.beginPath(),c.rect(a-f/2,d-f/2,f,f),e&&c.fill(),v&&(p?c.stroke():(k=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=k))):"triangle"===b?(c.beginPath(),c.moveTo(a-f/2,d+f/2),c.lineTo(a+f/2,d+f/2),c.lineTo(a,d-f/2),c.closePath(),e&&c.fill(),v&&(p?c.stroke():(k=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=k)),c.beginPath()):"cross"===b&&(c.strokeStyle=e,c.lineWidth=f/4,c.beginPath(),c.moveTo(a-f/2,d-f/2),c.lineTo(a+f/2,d+f/2),c.stroke(),
|
|
996
|
-
c.moveTo(a+f/2,d-f/2),c.lineTo(a-f/2,d+f/2),c.stroke())}},drawMarkers:function(a){for(var d=0;d<a.length;d++){var c=a[d];E.drawMarker(c.x,c.y,c.ctx,c.type,c.size,c.color,c.borderColor,c.borderThickness)}}};return k}();Ja.version="v3.15.
|
|
996
|
+
c.moveTo(a+f/2,d-f/2),c.lineTo(a-f/2,d+f/2),c.stroke())}},drawMarkers:function(a){for(var d=0;d<a.length;d++){var c=a[d];E.drawMarker(c.x,c.y,c.ctx,c.type,c.size,c.color,c.borderColor,c.borderThickness)}}};return k}();Ja.version="v3.15.3 GA";window.CanvasJS&&(Ja&&!window.CanvasJS.Chart)&&(window.CanvasJS.Chart=Ja);ga.StockChart={width:500,height:600,backgroundColor:"white",theme:"light1",animationEnabled:!1,animationDuration:1200,culture:"en",creditHref:"",creditText:"CanvasJS",exportEnabled:!1,exportFileName:"StockChart",
|
|
997
997
|
colorSet:"colorSet1",rangeChanging:null,rangeChanged:null,publicProperties:{title:"readWrite",subtitles:"readWrite",toolbar:"readWrite",navigator:"readWrite",rangeSelector:"readWrite",charts:"readWrite",options:"readWrite",bounds:"readOnly",container:"readOnly",selectedColorSet:"readOnly"}};ga.Navigator={enabled:!0,width:500,height:70,verticalAlign:"bottom",horizontalAlign:"left",dynamicUpdate:!0,backgroundColor:"#fff",animationEnabled:!1,animationDuration:1200,theme:"light1",colorSet:"colorSet1",
|
|
998
998
|
publicProperties:{slider:"readWrite",backgroundColor:"readWrite",animationEnabled:"readWrite",animationDuration:"readWrite",theme:"readWrite",axisX:"readWrite",axisY:"readWrite",axisX2:"readWrite",axisY2:"readWrite",data:"readWrite",colorSet:"readWrite",options:"readWrite",bounds:"readOnly"}};ga.RangeSelector={enabled:!0,width:500,height:35,label:"Range",verticalAlign:"top",horizontalAlign:"center",selectedRangeButtonIndex:null,publicProperties:{options:"readWrite",buttons:"readWrite",inputFields:"readWrite",
|
|
999
999
|
buttonStyle:"readWrite",bounds:"readOnly"}};ga.RangeButton={range:null,rangeType:null,label:null,style:"position: inline; margin: 5px 0;text-align:center;cursor: pointer;",backgroundColorDisabled:"#ddd",publicProperties:{options:"readWrite",bounds:"readOnly"}};ga.ButtonStyle={backgroundColor:"#fff",backgroundColorOnHover:"#2196f3",backgroundColorOnSelect:"#2196f3",borderColor:"#2196f3",borderThickness:2,labelFontColor:"#000",labelFontColorOnHover:"#fff",labelFontSize:14,labelFontStyle:"normal",labelFontFamily:w?
|
|
@@ -1234,7 +1234,7 @@ if(!e(this.elements))for(var d=0;d<this.elements.length;d++)this.elements[d].sty
|
|
|
1234
1234
|
0)+"px",this.elements[d].style.paddingBottom=(this.style.padding.bottom||0)+"px",this.elements[d].style.paddingLeft=(this.style.padding.left||0)+"px"):this.elements[d].style.padding=this.style.padding+"px",this.elements[d].style.mozAppearance=this.elements[d].style.webkitAppearance=this.elements[d].style.appearance="none",this.elements[d].style.webkitBorderRadius=0,this.elements[d].style.mozBorderRadius=0,this.elements[d].style.borderRadius=0,this.elements[d].style.boxSizing="content-box";this.parent=
|
|
1235
1235
|
this.rangeSelector=this.stockChart.rangeSelector}};ja(Y,Z);Y.prototype._updateOptions=function(){this.updateOption("backgroundColor");this.updateOption("backgroundColorOnHover");this.updateOption("backgroundColorOnSelect");this.updateOption("borderColor");this.updateOption("borderThickness");this.updateOption("labelFontColor");this.updateOption("labelFontColorOnHover");this.updateOption("labelFontSize");this.updateOption("labelFontStyle");this.updateOption("labelFontFamily");this.updateOption("labelFontWeight");
|
|
1236
1236
|
this.updateOption("width");this.updateOption("maxWidth");this.updateOption("padding");this.updateOption("spacing");this.updateOption("cursor")};ja(ga,Z);ga.prototype._updateOptions=function(){this.updateOption("backgroundColor");this.updateOption("borderColor");this.updateOption("borderThickness");this.updateOption("borderColorOnFocus");this.updateOption("fontColor");this.updateOption("fontSize");this.updateOption("fontStyle");this.updateOption("fontFamily");this.updateOption("fontWeight");this.updateOption("width");
|
|
1237
|
-
this.updateOption("maxWidth");this.updateOption("padding");this.updateOption("spacing");this.updateOption("cursor")};return s}();W.version="v1.15.
|
|
1237
|
+
this.updateOption("maxWidth");this.updateOption("padding");this.updateOption("spacing");this.updateOption("cursor")};return s}();W.version="v1.15.3 GA";window.CanvasJS&&(W&&(!window.CanvasJS.StockChart&&window.CanvasJS.Chart)&&(window.CanvasJS.StockChart=W),W&&!window.CanvasJS.Chart&&(window.CanvasJS.Chart=Ja,window.CanvasJS.StockChart=W))})();
|
|
1238
1238
|
|
|
1239
1239
|
/*
|
|
1240
1240
|
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.
|