@canvasjs/charts 3.7.36 → 3.7.38
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 +2 -2
- package/README.md +10 -1
- package/canvasjs.min.js +294 -293
- package/package.json +1 -1
package/canvasjs.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
CanvasJS Chart - v3.7.
|
|
3
|
-
Copyright
|
|
2
|
+
CanvasJS Chart - v3.7.38 GA - https://canvasjs.com/
|
|
3
|
+
Copyright 2024 fenopix
|
|
4
4
|
|
|
5
5
|
--------------------- License Information --------------------
|
|
6
6
|
CanvasJS Chart is a commercial product which requires purchase of license. Without a commercial license you can use it for evaluation purposes for upto 30 days. Please refer to the following link for further details.
|
|
@@ -520,296 +520,297 @@ s._colorSet.length]:s._colorSet[F%s._colorSet.length];c=b.indexLabelPlacement||s
|
|
|
520
520
|
s.indexLabelFontWeight||"normal";a=b.indexLabelLineColor||s.options.indexLabelLineColor||a;m="number"===typeof b.indexLabelLineThickness?b.indexLabelLineThickness:"number"===typeof s.indexLabelLineThickness?s.indexLabelLineThickness:2;n=b.indexLabelLineDashType||s.indexLabelLineDashType||"solid";l="undefined"!==typeof b.indexLabelWrap?b.indexLabelWrap:"undefined"!==typeof s.indexLabelWrap?s.indexLabelWrap:!0;q=s.dataPointIds[F];x._eventManager.objectMap[q]={id:q,objectType:"dataPoint",dataPointIndex:F,
|
|
521
521
|
dataSeriesIndex:0,funnelSection:T[s.reversed?w.length-1-F:F]};"inside"===s.indexLabelPlacement&&(v[F]=F!==da?s.reversed?T[F].x2-T[F].x1:T[F].x3-T[F].x4:T[F].x3-T[F].x6,20>v[F]&&(v[F]=F!==da?s.reversed?T[F].x3-T[F].x4:T[F].x2-T[F].x1:T[F].x2-T[F].x1,v[F]/=2));q=b.indexLabelMaxWidth?b.indexLabelMaxWidth:s.options.indexLabelMaxWidth?s.indexLabelMaxWidth:v[F];if(q>v[F]||0>q)q=v[F];y[F]="inside"===s.indexLabelPlacement?l?Math.max(T[F].height,g):1.5*g:!1;A=x.getPercentAndTotal(s,b);if(s.indexLabelFormatter||
|
|
522
522
|
b.indexLabelFormatter)z={chart:x.options,dataSeries:s,dataPoint:b,total:A.total,percent:A.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(z):b.indexLabel?x.replaceKeywordsWithValue(b.indexLabel,b,s,F):s.indexLabelFormatter?s.indexLabelFormatter(z):s.indexLabel?x.replaceKeywordsWithValue(s.indexLabel,b,s,F):b.label?b.label:"";0>=m&&(m=0);1E3>q&&1E3-q<D&&(q+=1E3-q);R.roundRect||Aa(R);c=new ka(R,{fontSize:g,fontFamily:k,fontColor:e,fontStyle:p,fontWeight:h,horizontalAlign:c,textAlign:t,backgroundColor:d,
|
|
523
|
-
maxWidth:q,maxHeight:!1===y[F]?l?4.28571429*g:1.5*g:y[F],text:b,padding:ea,textBaseline:"middle"});c.measureText();I.push({textBlock:c,id:s.reversed?B:F,isDirty:!1,lineColor:a,lineThickness:m,lineDashType:n,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,p=L-X-Z/2,p=s.options.indexLabelMaxWidth?s.indexLabelMaxWidth>p?
|
|
524
|
-
b=(a=q(k)<T.length?I[q(k)]:null)?a.textBlock:null;c=c.height;a&&d.y+c+ea>b.y&&(e=!0);c=g.indexLabelMaxWidth||p;if(c>p||0>c)c=p;f.push(c)}if(e)for(k=I.length-1;0<=k;k--)a=T[k],I[k].textBlock.maxWidth=f[f.length-(k+1)],I[k].textBlock.measureText(),I[k].textBlock.
|
|
525
|
-
(a.y2+a.y4)/2:(a.y2+a.y3)/2,I[k].textBlock.y=c-I[k].height/2,s.reversed?(I[k].textBlock.y+I[k].height>W+A&&(I[k].textBlock.y=W+A-I[k].height),I[k].textBlock.y<ua-A&&(I[k].textBlock.y=ua-A)):(I[k].textBlock.y<W-A&&(I[k].textBlock.y=W-A),I[k].textBlock.y+
|
|
526
|
-
2,b=s.reversed?"undefined"!==typeof a.x5?c>Ea?f(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?c<Ea?f(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,I[e].textBlock.x=b+Z,I[e].textBlock.y=c-I[e].height/2,s.reversed?(I[e].textBlock.y+I[e].height>
|
|
527
|
-
I[e].isDirty=!0:(a=T[e],b=a.height,c=I[e].height,d=I[e].width,b>=c?(b=e!=da?(a.x4+a.x3)/2-d/2:(a.x5+a.x4)/2-d/2,c=e!=da?(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 p(){function a(b,
|
|
528
|
-
d+=a(e,c-d);0<d&&(f.y+=d);return d}function b(){var a,d,e,f,g=0,k;f=(Q-M+2*A)/m;k=m;for(var p,h=1;h<k;h++){e=h*f;for(var l=I.length-1;0<=l;l--)!I[l].isDirty&&(I[l].textBlock.y<e&&I[l].textBlock.y+I[l].height>e)&&(p=q(l),!(p>=I.length-1)&&
|
|
529
|
-
d||p;f=p;for(k=0;I[f].textBlock.y<I[e].textBlock.y+I[e].height+ea;){a=a||I[f].textBlock.y+I[f].height;k+=I[f].height;k+=ea;f=e;if(0>=f){f=0;k+=I[f].height;break}e=n(f);if(0>e){f=0;k+=I[f].height;break}}if(f!=p){g=I[f].textBlock.y;
|
|
530
|
-
"",I[b.id].isDirty=!0,I[b.id].textBlock.measureText();else break;return g}for(var d,e,f,g,k,p,m=1,l=0;l<2*m;l++){for(var r=I.length-1;0<=r&&!(0<=n(r)&&n(r),f=I[r],g=f.textBlock,p=(k=q(r)<T.length?I[q(r)]:null)?k.textBlock:null,d
|
|
531
|
-
ea)}function l(a,b,c){var d,e,f,p=[],h=A,n=[];-1!==b&&(0<=aa.indexOf(b)?(e=aa.indexOf(b),aa.splice(e,1)):(aa.push(b),aa=aa.sort(function(a,b){return a-b})));if(0===aa.length)p=ja;else{e=A*(1!=aa.length||0!=aa[0]&&aa[0]!=T.length-
|
|
532
|
-
var t={startTime:(new Date).getTime(),duration:c||500,easingFunction:function(a,b,c,d){return P.easing.easeOutQuart(a,b,c,d)},changeSection:function(a){for(var b,c,d=0;d<T.length;d++)b=f[d],c=T[d],b*=a,"undefined"===typeof n[d]&&
|
|
533
|
-
v.y1,v.width,v.height);t.changeSection(c,b);var e={};e.dataSeries=s;e.dataPoint=s.reversed?s.dataPoints[w.length-1-b]:s.dataPoints[b];e.index=s.reversed?w.length-1-b:b;a.toolTip.highlightObjects([e]);for(e=0;e<T.length;e++)sa(d,
|
|
534
|
-
I[g].lineThickness%2?0.5:0,c=((T[g].y2+T[g].y4)/2<<0)+e,b=f(c).x2-1,d=I[g].textBlock.x,e=(I[g].textBlock.y+I[g].height/2<<0)+e,I[g].isDirty||0==I[g].lineThickness||(a.strokeStyle=I[g].lineColor,a.lineWidth=I[g].lineThickness,a.setLineDash&&
|
|
535
|
-
c=0;c<w.length;c++)if(T[c].y1<a&&T[c].y4>a){b=T[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 z(a){for(var b=
|
|
536
|
-
"center"===x.title.horizontalAlign&&"center"===x.title.verticalAlign)&&(x.title.ctx=a,x.title.render());if(x.subtitles)for(var b=0;b<x.subtitles.length;b++){var c=x.subtitles[b];if(c.dockInsidePlotArea||"center"===c.horizontalAlign&&
|
|
537
|
-
this.data[a.dataSeriesIndexes[0]],w=s.dataPoints,v=this.plotArea,A=0.025*v.width,B=0.01*v.width,C=0,E=v.height-2*A,G=Math.min(v.width-2*B,2.8*v.height),N=!1,U=0;U<w.length;U++)if(!N&&("undefined"!==typeof w[U].indexLabel&&
|
|
538
|
-
typeof s.indexLabel&&null!==s.indexLabel&&0<s.indexLabel.toString().length;"inside"!==s.indexLabelPlacement&&N||(B=(v.width-0.75*G)/2);var U=v.x1+B,L=v.x2-B,M=v.y1+A,Q=v.y2-A,R=a.targetCanvasCtx||this.plotArea.ctx||this.ctx;
|
|
539
|
-
"string"===typeof H&&H.match(/%$/)?(H=parseInt(H),H=H*a/100):H=parseInt(H),S>E?S=E:0>=S&&(S=0),H>a?H=a-0.5:0>=H&&(H=0)):"pyramid"===s.type&&(H=S=0,s.reversed=s.reversed?!1:!0);var B=U+a/2,V=U,X=U+a,W=s.reversed?Q:M,O=B-H/2,
|
|
540
|
-
G.push($);if(s.reversed)for(H=0;H<U.length;H++)G[H]<Ea?(a.push(O),B.push(Y),da=H):(a.push((G[H]-W+ba*V)/ba),B.push((G[H]-W+ga*X)/ga));else for(H=0;H<U.length;H++)G[H]<Ea?(a.push((G[H]-W+ba*V)/ba),B.push((G[H]-W+ga*X)/ga),
|
|
541
|
-
y4:G[H+1],x5:a[H+1],y5:G[H+1],x6:O,y6:Ea,id:H,height:G[H+1]-G[H],color:$}):T.push({x1:a[H],y1:G[H],x2:B[H],y2:G[H],x3:B[H+1],y3:G[H+1],x4:a[H+1],y4:G[H+1],id:H,height:G[H+1]-G[H],color:$});var ea=2,I=[],ia=!1,aa=[],ja=[],
|
|
542
|
-
for(H=0;H<w.length;H++)I[H].isDirty||(a=I[H].textBlock.x+I[H].width,a=(L-a)/2,0==H&&(C=a),C>a&&(C=a));for(H=0;H<T.length;H++)T[H].x1+=C,T[H].x2+=C,T[H].x3+=C,T[H].x4+=C,T[H].x5&&(T[H].x5+=C,T[H].x6+=C),I[H].textBlock.x+=
|
|
543
|
-
funnelSection:T[s.reversed?w.length-1-H:H]},x._eventManager.objectMap[C]=a;!x.animationEnabled&&U?l(x,-1,0):x.animationEnabled&&!x.animatedRender&&l(x,-1,0);this.funnelPyramidClickHandler=function(a){var b=-1;if(!ia
|
|
544
|
-
!1:!0;l(x,b,500)}};return{source:R,dest:this.plotArea.ctx,animationCallback:function(a,b){P.fadeInAnimation(a,b);1<=a&&(l(x,-1,500),y(x.plotArea.ctx||x.ctx))},easingFunction:P.easing.easeInQuad,animationBase:0}}}}};l.prototype.requestAnimFrame=
|
|
545
|
-
window.
|
|
546
|
-
d);var b=this.canvas;if(b&&d&&c){c=c+"."+d;a="image/"+d;var b=b.toDataURL(a),e=!1,g=document.createElement("a");g.download=c;g.href=b;if("undefined"!==typeof Blob&&new Blob){for(var p=b.replace(/^data:[a-z\/]*;base64,/,
|
|
547
|
-
document.createEvent("MouseEvents"),event.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),g.dispatchEvent?g.dispatchEvent(event):g.fireEvent&&g.fireEvent("onclick")}catch(m){d=window.open(),
|
|
548
|
-
{position:"absolute",width:"100%",border:"0px",margin:"0px 0px 0px 0px",padding:"0px 0px 0px 0px"});d.style.height=this.height+"px";this._canvasJSContainer.appendChild(d);var c=this,b=d.contentWindow||d.contentDocument.document||
|
|
549
|
-
setTimeout(function(){b.focus();b.print();setTimeout(function(){c._canvasJSContainer.removeChild(d)},1E3)},500)};l.prototype.getPercentAndTotal=function(a,d){var c=null,b=null,e=c=null;if(0<=a.type.indexOf("stacked"))b=0,c=d.x.getTime?
|
|
550
|
-
(b+=a.dataPoints[c].y);e=isNaN(d.y)?0:100*(d.y/b)}return{percent:e,total:b}};l.prototype.replaceKeywordsWithValue=function(a,d,c,b,e){var g=this;e="undefined"===typeof e?0:e;if((0<=c.type.indexOf("stacked")||"pie"===c.type||
|
|
551
|
-
else{var l="#,##0.",k=Math.max(Math.ceil(Math.log(1/Math.abs(p))/Math.LN10),2);if(isNaN(k)||!isFinite(k))k=2;for(var m=0;m<k;m++)l+="#";c.percentFormatString=l}a=a.replace("#percent",ea(p,l,g._cultureInfo));a=a.replace("#total",
|
|
552
|
-
a.length-1);a=Ia(a.slice(1,a.length-1));a=a.replace("#index",e);var k=null;try{var f=a.match(/(.*?)\s*\[\s*(.*?)\s*\]/);f&&0<f.length&&(k=Ia(f[2]),a=Ia(f[1]))}catch(p){}f=null;if("color"===a)return"waterfall"===c.type?d.color?
|
|
553
|
-
return"x"===a?(c.axisX&&"dateTime"===c.axisX.valueType||"dateTime"===c.xValueType||d.x&&d.x.getTime)&&!c.axisX.logarithmic?Da(f,d.xValueFormatString?d.xValueFormatString:c.xValueFormatString?c.xValueFormatString:c.xValueFormatString=
|
|
554
|
-
d.
|
|
555
|
-
this.chart.options.legend.markerMargin:0.3*this.fontSize;this.height=0;var l=[],k=[];if("top"===this.verticalAlign||"bottom"===this.verticalAlign)this.orientation="horizontal",c=this.verticalAlign,g=this.maxWidth=null!==
|
|
556
|
-
g=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*d.width;p=this.maxHeight=null!==this.maxHeight?this.maxHeight:d.height}this.errorMarkerColor=[];for(var m=0;m<this.dataSeries.length;m++){var n=this.dataSeries[m];
|
|
557
|
-
"error"===n.type&&n._linkedSeries?n._linkedSeries.legendMarkerType?n._linkedSeries.legendMarkerType:S.getDefaultLegendMarker(n._linkedSeries.type):S.getDefaultLegendMarker(n.type):n.markerType,f=n.legendText?n.legendText:
|
|
558
|
-
y=n.markerSize||"line"!==n.type&&"stepLine"!==n.type&&"spline"!==n.type?0.75*this.lineHeight:0,x=n.legendMarkerBorderColor?n.legendMarkerBorderColor:n.markerBorderColor,s=n.legendMarkerBorderThickness?n.legendMarkerBorderThickness:
|
|
559
|
-
dataSeriesIndex:n.index,dataPointIndex:null,markerBorderColor:x,markerBorderThickness:s};l.push(q)}else for(var w=0;w<n.dataPoints.length;w++){var v=n.dataPoints[w],q=v.legendMarkerType?v.legendMarkerType:n.legendMarkerType?n.legendMarkerType:
|
|
560
|
-
n.legendMarkerColor?n.legendMarkerColor:v.color?v.color:n.color?n.color:n._colorSet[w%n._colorSet.length],y=0.75*this.lineHeight,x=v.legendMarkerBorderColor?v.legendMarkerBorderColor:n.legendMarkerBorderColor?n.legendMarkerBorderColor:
|
|
561
|
-
v,n,w),q={markerType:q,markerColor:u,text:f,textBlock:null,chartType:n.type,markerSize:y,dataSeriesIndex:m,dataPointIndex:w,markerBorderColor:x,markerBorderThickness:s};(v.showInLegend||n.showInLegend
|
|
562
|
-
g;y=0===y?0.75*this.lineHeight:y;v=(this.itemMaxWidth?this.itemMaxWidth:v)-(y+h);for(m=0;m<l.length;m++){q=l[m];u=v;if("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType)u-=2*
|
|
563
|
-
fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"});q.textBlock.measureText();null!==this.itemWidth&&(q.textBlock.width=this.itemWidth-(y+h+("line"===
|
|
564
|
-
q.
|
|
565
|
-
|
|
566
|
-
y+h+(
|
|
567
|
-
(e="left"===this.horizontalAlign?d.x1:"right"===this.horizontalAlign?d.x2-this.width:d.x1+d.width/2-this.width/2,b=d.y1
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
this.ctx.
|
|
572
|
-
|
|
573
|
-
q.textBlock.height:this.lineHeight)
|
|
574
|
-
a
|
|
575
|
-
|
|
576
|
-
a||"
|
|
577
|
-
(
|
|
578
|
-
b.x>a?b.x/a:a/b.x:Math.abs(b.x-a);n<c.distance&&(c.dataPoint=b,c.distance=n,c.index=g);b=n;b<=h?h=b:0<p?l++:k++;if(1E3<l&&1E3<k)break}else if(0>
|
|
579
|
-
d>this.chart.plotArea.y2)return null;c=c||!1;var b=[],e=0,g=0,p=1,h=!1,l=Infinity,k=0,m=0,n=0;if("none"!==this.chart.plotInfo.axisPlacement)if(n=
|
|
580
|
-
this.dataPoints[0].x,n=
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
d>=q.y1&&d<=q.y4)b.push({dataPoint:f,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y2-d),Math.abs(q.y3-d))}),h=!0;break;case "
|
|
587
|
-
Math.abs(q.x2-a),Math.abs(q.y2-d),Math.abs(q.y3-d))}),h=!0}if(h||1E3<k&&1E3<m)break}}else if(0>n-e&&n+e>=this.dataPoints.length)break
|
|
588
|
-
|
|
589
|
-
Math.log(d/this.viewportMinimum)<this.noTicks-1){for(var c=C.getNiceNumber((d-this.viewportMinimum)/Math.min(Math.max(2,this.noTicks-
|
|
590
|
-
|
|
591
|
-
b=0,f=q;b<this.logLabelValues.length;b++)if(c=this.logLabelValues[b],c<this.viewportMinimum)b++;else{for(;f<n.length&&c>n[f].endValue;f++);
|
|
592
|
-
|
|
593
|
-
this.
|
|
594
|
-
ea(m,this.valueFormatString,this.chart._cultureInfo),a=new ka(this.ctx,{x:0,y:0,maxWidth:g,maxHeight:p,angle:this.labelAngle,text:this.prefix+a+this.suffix,
|
|
595
|
-
this.
|
|
596
|
-
value:new Date(m),label:this.labels[m]?this.labels[m]:null}):"axisX"===this.type&&this.labels[m]?this.labels[m]:Da(m,this.valueFormatString,this.chart._cultureInfo),
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
this.
|
|
600
|
-
typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),p="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>
|
|
601
|
-
180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360)),"bottom"===this._position||"top"===this._position)if(g=0.9*h>>0,q=0,!this.chart.panEnabled&&1<=
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
p,this.sessionVariables.
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:m):(
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
this.options.
|
|
618
|
-
|
|
619
|
-
this.sessionVariables.labelMaxHeight=Math.max.apply(Math,e);b=g*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(p-a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
this.
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
"
|
|
632
|
-
|
|
633
|
-
g.labelPlacement?g.options.
|
|
634
|
-
0:5;if("left"===this._position||"right"===this._position){this.createLabels();if("inside"!=this.labelPlacement||"inside"===this.labelPlacement&&0<this._index)for(d=
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
0<this._index)
|
|
638
|
-
|
|
639
|
-
2:0)+a+("inside"===this.tickPlacement?0<this._index?this.tickLength:0:this.tickLength)+b};C.setLayout=function(a,d,c,b,e,g){var p,
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
y;){var H=0,Z=0,V=0,W=0,X=e=0,O=0,aa=0,Y=0,$=0,T=0,ba=0;if(c&&0<c.length)for(z=[],f=T=0;f<c.length;f++)z.push(Math.ceil(c[f]?
|
|
644
|
-
|
|
645
|
-
a[
|
|
646
|
-
0));S.push(v);if(a&&0<a.length)for(f=0;f<a.length;f++)a[f]&&(a[f].lineCoordinates.x1=p,l=Math.round(g.x2-ba-aa>m.width-n?m.width-n:g.x2-ba-aa),a[f]._labels&&
|
|
647
|
-
180*Math.abs(
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
a[f].
|
|
651
|
-
|
|
652
|
-
d[f
|
|
653
|
-
$+X
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
(
|
|
659
|
-
|
|
660
|
-
(
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
(
|
|
670
|
-
|
|
671
|
-
b[f].
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
(a[f].
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
0;h<c.length;h++)c[h].
|
|
683
|
-
u&&(
|
|
684
|
-
if(b&&0<b.length)for(h=0;h<b.length;h++)b[h].
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
this.
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
(0
|
|
694
|
-
q.y
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
Math.cos(Math.PI/180*this.labelAngle)+(0<this.labelAngle?n.textBlock.width*Math.
|
|
700
|
-
2
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
5:q.x-n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
0),this.ctx.stroke()
|
|
716
|
-
this.ctx.lineWidth%2?(b.
|
|
717
|
-
|
|
718
|
-
this.tickLength:b.x
|
|
719
|
-
2
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
3
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
this.
|
|
730
|
-
|
|
731
|
-
this.
|
|
732
|
-
d=this.getPixelCoordinatesOnAxis(this._labels[b].position),d=1===a.lineWidth%2?(d.
|
|
733
|
-
|
|
734
|
-
this.
|
|
735
|
-
|
|
736
|
-
e=this.
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
Math.pow(
|
|
740
|
-
e[c].
|
|
741
|
-
e[c].startValue
|
|
742
|
-
e[c].endValue
|
|
743
|
-
|
|
744
|
-
e[c].startValue
|
|
745
|
-
|
|
746
|
-
e[c].startValue
|
|
747
|
-
e[c].
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
(e[g].endValue
|
|
752
|
-
|
|
753
|
-
a
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
c-Math.min(a[e].spacing,0.1*c)
|
|
758
|
-
this.
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
(
|
|
763
|
-
(
|
|
764
|
-
this.
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
a?(this.interval=
|
|
769
|
-
a?(this.interval=
|
|
770
|
-
|
|
771
|
-
a?(this.interval=2,this.intervalType="
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
null
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
null===this.maximum
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
this.
|
|
784
|
-
|
|
785
|
-
this.
|
|
786
|
-
e
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
(this.
|
|
790
|
-
|
|
791
|
-
typeof this.options.interval?0:this.options.interval,b
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
isNaN(this.sessionVariables.
|
|
795
|
-
this.
|
|
796
|
-
|
|
797
|
-
(this.interval=
|
|
798
|
-
|
|
799
|
-
C.
|
|
800
|
-
|
|
801
|
-
a.setSeconds(0),a.setMilliseconds(0)}else if("
|
|
802
|
-
a.
|
|
803
|
-
|
|
804
|
-
this.
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
this.ctx.
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
523
|
+
maxWidth:q,maxHeight:!1===y[F]?l?4.28571429*g:1.5*g:y[F],text:b,padding:ea,textBaseline:"middle"});c.measureText();c.height=c.height===2*c.padding?0:c.height;c.width=c.width===2*c.padding?0:c.width;I.push({textBlock:c,id:s.reversed?B:F,isDirty:!1,lineColor:a,lineThickness:m,lineDashType:n,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,p=L-X-Z/2,p=s.options.indexLabelMaxWidth?s.indexLabelMaxWidth>p?
|
|
524
|
+
p:s.indexLabelMaxWidth:p,k=I.length-1;0<=k;k--){g=w[I[k].id];c=I[k];d=c.textBlock;b=(a=q(k)<T.length?I[q(k)]:null)?a.textBlock:null;c=c.height;a&&d.y+c+ea>b.y&&(e=!0);c=g.indexLabelMaxWidth||p;if(c>p||0>c)c=p;f.push(c)}if(e)for(k=I.length-1;0<=k;k--)a=T[k],I[k].textBlock.maxWidth=f[f.length-(k+1)],I[k].textBlock.measureText(),I[k].textBlock.height=I[k].textBlock.height===2*I[k].textBlock.padding?0:I[k].textBlock.height,I[k].textBlock.width=I[k].textBlock.width===2*I[k].textBlock.padding?0:I[k].textBlock.width,
|
|
525
|
+
I[k].textBlock.x=L-p,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,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,s.reversed?(I[k].textBlock.y+I[k].height>W+A&&(I[k].textBlock.y=W+A-I[k].height),I[k].textBlock.y<ua-A&&(I[k].textBlock.y=ua-A)):(I[k].textBlock.y<W-A&&(I[k].textBlock.y=W-A),I[k].textBlock.y+
|
|
526
|
+
I[k].height>ua+A&&(I[k].textBlock.y=ua+A-I[k].height))}function g(){var a,b,c,d;if("inside"!==s.indexLabelPlacement)for(var e=0;e<T.length;e++)0==I[e].textBlock.text.length?I[e].isDirty=!0:(a=T[e],c="undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,b=s.reversed?"undefined"!==typeof a.x5?c>Ea?f(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?c<Ea?f(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,I[e].textBlock.x=b+Z,I[e].textBlock.y=c-I[e].height/2,s.reversed?(I[e].textBlock.y+I[e].height>
|
|
527
|
+
W+A&&(I[e].textBlock.y=W+A-I[e].height),I[e].textBlock.y<ua-A&&(I[e].textBlock.y=ua-A)):(I[e].textBlock.y<W-A&&(I[e].textBlock.y=W-A),I[e].textBlock.y+I[e].height>ua+A&&(I[e].textBlock.y=ua+A-I[e].height)));else for(e=0;e<T.length;e++)0==I[e].textBlock.text.length?I[e].isDirty=!0:(a=T[e],b=a.height,c=I[e].height,d=I[e].width,b>=c?(b=e!=da?(a.x4+a.x3)/2-d/2:(a.x5+a.x4)/2-d/2,c=e!=da?(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 p(){function a(b,
|
|
528
|
+
c){var d;if(0>b||b>=I.length)return 0;var e,f=I[b].textBlock;if(0>c){c*=-1;e=n(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>=c)return f.y+=c,c;if(b==T.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,k;f=(Q-M+2*A)/m;k=m;for(var p,h=1;h<k;h++){e=h*f;for(var l=I.length-1;0<=l;l--)!I[l].isDirty&&(I[l].textBlock.y<e&&I[l].textBlock.y+I[l].height>e)&&(p=q(l),!(p>=I.length-1)&&
|
|
529
|
+
I[l].textBlock.y+I[l].height+ea>I[p].textBlock.y&&(I[l].textBlock.y=I[l].textBlock.y+I[l].height-e>e-I[l].textBlock.y?e+1:e-I[l].height-1))}for(p=T.length-1;0<p;p--)if(!I[p].isDirty){e=n(p);if(0>e&&(e=0,I[e].isDirty))break;if(I[p].textBlock.y<I[e].textBlock.y+I[e].height){d=d||p;f=p;for(k=0;I[f].textBlock.y<I[e].textBlock.y+I[e].height+ea;){a=a||I[f].textBlock.y+I[f].height;k+=I[f].height;k+=ea;f=e;if(0>=f){f=0;k+=I[f].height;break}e=n(f);if(0>e){f=0;k+=I[f].height;break}}if(f!=p){g=I[f].textBlock.y;
|
|
530
|
+
a-=g;a=k-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(T[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+ea,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,k,p,m=1,l=0;l<2*m;l++){for(var r=I.length-1;0<=r&&!(0<=n(r)&&n(r),f=I[r],g=f.textBlock,p=(k=q(r)<T.length?I[q(r)]:null)?k.textBlock:null,d=
|
|
531
|
+
+f.height.toFixed(6),e=+g.y.toFixed(6),!f.isDirty&&(k&&e+d+ea>+p.y.toFixed(6))&&(d=g.y+d+ea-p.y,e=a(r,-d),e<d&&(0<e&&(d-=e),e=a(q(r),d),e!=d)));r--);b()}}function h(a,b){return(b<T.length?I[b].textBlock.y:s.reversed?W+A:ua+A)-(0>a?s.reversed?ua-A:W-A:I[a].textBlock.y+I[a].height+ea)}function l(a,b,c){var d,e,f,p=[],h=A,n=[];-1!==b&&(0<=aa.indexOf(b)?(e=aa.indexOf(b),aa.splice(e,1)):(aa.push(b),aa=aa.sort(function(a,b){return a-b})));if(0===aa.length)p=ja;else{e=A*(1!=aa.length||0!=aa[0]&&aa[0]!=T.length-
|
|
532
|
+
1?2:1)/k();for(var q=0;q<T.length;q++){if(1==aa.length&&0==aa[0]){if(0===q){p.push(ja[q]);d=h;continue}}else 0===q&&(d=-1*h);p.push(ja[q]+d);if(0<=aa.indexOf(q)||q<T.length&&0<=aa.indexOf(q+1))d+=e}}f=function(){for(var a=[],b=0;b<T.length;b++)a.push(p[b]-T[b].y1);return a}();var t={startTime:(new Date).getTime(),duration:c||500,easingFunction:function(a,b,c,d){return P.easing.easeOutQuart(a,b,c,d)},changeSection:function(a){for(var b,c,d=0;d<T.length;d++)b=f[d],c=T[d],b*=a,"undefined"===typeof n[d]&&
|
|
533
|
+
(n[d]=0),0>n&&(n*=-1),c.y1+=b-n[d],c.y2+=b-n[d],c.y3+=b-n[d],c.y4+=b-n[d],c.y5&&(c.y5+=b-n[d],c.y6+=b-n[d]),n[d]=b}};a._animator.animate(0,c,function(c){var d=a.plotArea.ctx||a.ctx;ia=!0;d.clearRect(v.x1,v.y1,v.x2-v.x1,v.y2-v.y1);d.fillStyle=a.backgroundColor;d.fillRect(v.x1,v.y1,v.width,v.height);t.changeSection(c,b);var e={};e.dataSeries=s;e.dataPoint=s.reversed?s.dataPoints[w.length-1-b]:s.dataPoints[b];e.index=s.reversed?w.length-1-b:b;a.toolTip.highlightObjects([e]);for(e=0;e<T.length;e++)sa(d,
|
|
534
|
+
T[e],s.fillOpacity);y(d);N&&("inside"!==s.indexLabelPlacement?m(d):g(),z(d));1<=c&&(ia=!1)},null,P.easing.easeOutQuart)}function k(){for(var a=0,b=0;b<T.length-1;b++)(0<=aa.indexOf(b)||0<=aa.indexOf(b+1))&&a++;return a}function m(a){for(var b,c,d,e,g=0;g<T.length;g++)e=1===I[g].lineThickness%2?0.5:0,c=((T[g].y2+T[g].y4)/2<<0)+e,b=f(c).x2-1,d=I[g].textBlock.x,e=(I[g].textBlock.y+I[g].height/2<<0)+e,I[g].isDirty||0==I[g].lineThickness||(a.strokeStyle=I[g].lineColor,a.lineWidth=I[g].lineThickness,a.setLineDash&&
|
|
535
|
+
a.setLineDash(K(I[g].lineDashType,I[g].lineThickness)),a.beginPath(),a.moveTo(b,c),a.lineTo(d,e),a.stroke())}function n(a){for(a-=1;-1<=a&&-1!=a&&I[a].isDirty;a--);return a}function q(a){for(a+=1;a<=T.length&&a!=T.length&&I[a].isDirty;a++);return a}function f(a){for(var b,c=0;c<w.length;c++)if(T[c].y1<a&&T[c].y4>a){b=T[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 z(a){for(var b=
|
|
536
|
+
0;b<T.length;b++)I[b].isDirty||(a&&(I[b].textBlock.ctx=a),I[b].textBlock.y+=I[b].textBlock._lineHeight/2,I[b].textBlock.render(!0),I[b].textBlock.y-=I[b].textBlock._lineHeight/2)}function y(a){x.plotArea.layoutManager.reset();a.roundRect||Aa(a);x.title&&(x.title.dockInsidePlotArea||"center"===x.title.horizontalAlign&&"center"===x.title.verticalAlign)&&(x.title.ctx=a,x.title.render());if(x.subtitles)for(var b=0;b<x.subtitles.length;b++){var c=x.subtitles[b];if(c.dockInsidePlotArea||"center"===c.horizontalAlign&&
|
|
537
|
+
"center"===c.verticalAlign)x.subtitles.ctx=a,c.render()}x.legend&&(x.legend.dockInsidePlotArea||"center"===x.legend.horizontalAlign&&"center"===x.legend.verticalAlign)&&(x.legend.ctx=a,x.legend.setLayout(),x.legend.render());wa.fNg&&wa.fNg(x)}var x=this;if(!(0>=a.dataSeriesIndexes.length)){for(var s=this.data[a.dataSeriesIndexes[0]],w=s.dataPoints,v=this.plotArea,A=0.025*v.width,B=0.01*v.width,C=0,E=v.height-2*A,G=Math.min(v.width-2*B,2.8*v.height),N=!1,U=0;U<w.length;U++)if(!N&&("undefined"!==typeof w[U].indexLabel&&
|
|
538
|
+
null!==w[U].indexLabel&&0<w[U].indexLabel.toString().length)&&(N=!0),!N&&("undefined"!==typeof w[U].label&&null!==w[U].label&&0<w[U].label.toString().length)&&(N=!0),!N&&"function"===typeof s.indexLabelFormatter||"function"===typeof w[U].indexLabelFormatter)N=!0;N=N||"undefined"!==typeof s.indexLabel&&null!==s.indexLabel&&0<s.indexLabel.toString().length;"inside"!==s.indexLabelPlacement&&N||(B=(v.width-0.75*G)/2);var U=v.x1+B,L=v.x2-B,M=v.y1+A,Q=v.y2-A,R=a.targetCanvasCtx||this.plotArea.ctx||this.ctx;
|
|
539
|
+
if(0!=s.length&&(s.dataPoints&&s.visible)&&0!==w.length){var S,H;a=75*G/100;var Z=30*(L-a)/100;"funnel"===s.type?(S=r(s.options.neckHeight)?0.35*E:s.neckHeight,H=r(s.options.neckWidth)?0.25*a:s.neckWidth,"string"===typeof S&&S.match(/%$/)?(S=parseInt(S),S=S*E/100):S=parseInt(S),"string"===typeof H&&H.match(/%$/)?(H=parseInt(H),H=H*a/100):H=parseInt(H),S>E?S=E:0>=S&&(S=0),H>a?H=a-0.5:0>=H&&(H=0)):"pyramid"===s.type&&(H=S=0,s.reversed=s.reversed?!1:!0);var B=U+a/2,V=U,X=U+a,W=s.reversed?Q:M,O=B-H/2,
|
|
540
|
+
Y=B+H/2,Ea=s.reversed?M+S:Q-S,ua=s.reversed?M:Q;a=[];var B=[],T=[],G=[],$=M,da,ba=(Ea-W)/(O-V),ga=-ba,U="area"===(s.valueRepresents?s.valueRepresents:"height")?c():d();if(-1!==U){if(s.reversed)for(G.push($),H=U.length-1;0<H;H--)$+=U[H],G.push($);else for(H=0;H<U.length;H++)$+=U[H],G.push($);if(s.reversed)for(H=0;H<U.length;H++)G[H]<Ea?(a.push(O),B.push(Y),da=H):(a.push((G[H]-W+ba*V)/ba),B.push((G[H]-W+ga*X)/ga));else for(H=0;H<U.length;H++)G[H]<Ea?(a.push((G[H]-W+ba*V)/ba),B.push((G[H]-W+ga*X)/ga),
|
|
541
|
+
da=H):(a.push(O),B.push(Y));for(H=0;H<U.length-1;H++)$=s.reversed?w[w.length-1-H].color?w[w.length-1-H].color:s._colorSet[(w.length-1-H)%s._colorSet.length]:w[H].color?w[H].color:s._colorSet[H%s._colorSet.length],H===da?T.push({x1:a[H],y1:G[H],x2:B[H],y2:G[H],x3:Y,y3:Ea,x4:B[H+1],y4:G[H+1],x5:a[H+1],y5:G[H+1],x6:O,y6:Ea,id:H,height:G[H+1]-G[H],color:$}):T.push({x1:a[H],y1:G[H],x2:B[H],y2:G[H],x3:B[H+1],y3:G[H+1],x4:a[H+1],y4:G[H+1],id:H,height:G[H+1]-G[H],color:$});var ea=2,I=[],ia=!1,aa=[],ja=[],
|
|
542
|
+
U=!1;a=a=0;Fa(aa);for(H=0;H<w.length;H++)w[H].exploded&&(U=!0,s.reversed?aa.push(w.length-1-H):aa.push(H));R.clearRect(v.x1,v.y1,v.width,v.height);R.fillStyle=x.backgroundColor;R.fillRect(v.x1,v.y1,v.width,v.height);if(N&&s.visible&&(b(),g(),"inside"!==s.indexLabelPlacement)){e();p();for(H=0;H<w.length;H++)I[H].isDirty||(a=I[H].textBlock.x+I[H].width,a=(L-a)/2,0==H&&(C=a),C>a&&(C=a));for(H=0;H<T.length;H++)T[H].x1+=C,T[H].x2+=C,T[H].x3+=C,T[H].x4+=C,T[H].x5&&(T[H].x5+=C,T[H].x6+=C),I[H].textBlock.x+=
|
|
543
|
+
C}for(H=0;H<T.length;H++)C=T[H],sa(R,C,s.fillOpacity),ja.push(C.y1);y(R);N&&s.visible&&("inside"===s.indexLabelPlacement||x.animationEnabled||m(R),x.animationEnabled||z());if(!N)for(H=0;H<w.length;H++)C=s.dataPointIds[H],a={id:C,objectType:"dataPoint",dataPointIndex:H,dataSeriesIndex:0,funnelSection:T[s.reversed?w.length-1-H:H]},x._eventManager.objectMap[C]=a;!x.animationEnabled&&U?l(x,-1,0):x.animationEnabled&&!x.animatedRender&&l(x,-1,0);this.funnelPyramidClickHandler=function(a){var b=-1;if(!ia&&
|
|
544
|
+
!x.isAnimating&&(r(a.dataSeries.explodeOnClick)||a.dataSeries.explodeOnClick)&&(b=s.reversed?w.length-1-a.dataPointIndex:a.dataPointIndex,0<=b)){a=b;if("funnel"===s.type||"pyramid"===s.type)s.reversed?w[w.length-1-a].exploded=w[w.length-1-a].exploded?!1:!0:w[a].exploded=w[a].exploded?!1:!0;l(x,b,500)}};return{source:R,dest:this.plotArea.ctx,animationCallback:function(a,b){P.fadeInAnimation(a,b);1<=a&&(l(x,-1,500),y(x.plotArea.ctx||x.ctx))},easingFunction:P.easing.easeInQuad,animationBase:0}}}}};l.prototype.requestAnimFrame=
|
|
545
|
+
function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();l.prototype.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;l.prototype.set=function(a,d,c){c="undefined"===
|
|
546
|
+
typeof c?!0:c;"options"===a?(this.options=d,c&&this.render()):l.base.set.call(this,a,d,c)};l.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,g=document.createElement("a");g.download=c;g.href=b;if("undefined"!==typeof Blob&&new Blob){for(var p=b.replace(/^data:[a-z\/]*;base64,/,
|
|
547
|
+
""),p=atob(p),h=new ArrayBuffer(p.length),h=new Uint8Array(h),l=0;l<p.length;l++)h[l]=p.charCodeAt(l);d=new Blob([h.buffer],{type:"image/"+d});try{window.navigator.msSaveBlob(d,c),e=!0}catch(k){g.dataset.downloadurl=[a,g.download,g.href].join(":"),g.href=window.URL.createObjectURL(d)}}if(!e)try{event=document.createEvent("MouseEvents"),event.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),g.dispatchEvent?g.dispatchEvent(event):g.fireEvent&&g.fireEvent("onclick")}catch(m){d=window.open(),
|
|
548
|
+
d.document.write("<img src='"+b+"'></img><div>Please right click on the image and save it to your device</div>"),d.document.close()}}};l.prototype.print=function(){var a=this.exportChart({toDataURL:!0}),d=document.createElement("iframe");d.setAttribute("class","canvasjs-chart-print-frame");X(d,{position:"absolute",width:"100%",border:"0px",margin:"0px 0px 0px 0px",padding:"0px 0px 0px 0px"});d.style.height=this.height+"px";this._canvasJSContainer.appendChild(d);var c=this,b=d.contentWindow||d.contentDocument.document||
|
|
549
|
+
d.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(d)},1E3)},500)};l.prototype.getPercentAndTotal=function(a,d){var c=null,b=null,e=c=null;if(0<=a.type.indexOf("stacked"))b=0,c=d.x.getTime?
|
|
550
|
+
d.x.getTime():d.x,c in a.plotUnit.yTotals&&(b=a.plotUnit.yTotals[c],c=a.plotUnit.yAbsTotals[c],e=isNaN(d.y)?0:0===c?0:100*(d.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);e=isNaN(d.y)?0:100*(d.y/b)}return{percent:e,total:b}};l.prototype.replaceKeywordsWithValue=function(a,d,c,b,e){var g=this;e="undefined"===typeof e?0:e;if((0<=c.type.indexOf("stacked")||"pie"===c.type||
|
|
551
|
+
"doughnut"===c.type||"funnel"===c.type||"pyramid"===c.type)&&(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))){var p="#percent",h="#total",l=this.getPercentAndTotal(c,d),h=isNaN(l.total)?h:l.total,p=isNaN(l.percent)?p:l.percent;do{l="";if(c.percentFormatString)l=c.percentFormatString;else{var l="#,##0.",k=Math.max(Math.ceil(Math.log(1/Math.abs(p))/Math.LN10),2);if(isNaN(k)||!isFinite(k))k=2;for(var m=0;m<k;m++)l+="#";c.percentFormatString=l}a=a.replace("#percent",ea(p,l,g._cultureInfo));a=a.replace("#total",
|
|
552
|
+
ea(h,c.yValueFormatString?c.yValueFormatString:"#,##0.########",g._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=Ia(a.slice(1,a.length-1));a=a.replace("#index",e);var k=null;try{var f=a.match(/(.*?)\s*\[\s*(.*?)\s*\]/);f&&0<f.length&&(k=Ia(f[2]),a=Ia(f[1]))}catch(p){}f=null;if("color"===a)return"waterfall"===c.type?d.color?
|
|
553
|
+
d.color:0<d.y?c.risingColor:c.fallingColor:"error"===c.type?c.color?c.color:c._colorSet[k%c._colorSet.length]:d.color?d.color:c.color?c.color:c._colorSet[b%c._colorSet.length];if(d.hasOwnProperty(a))f=d;else if(c.hasOwnProperty(a))f=c;else return"";f=f[a];null!==k&&(f=f[k]);return"x"===a?(c.axisX&&"dateTime"===c.axisX.valueType||"dateTime"===c.xValueType||d.x&&d.x.getTime)&&!c.axisX.logarithmic?Da(f,d.xValueFormatString?d.xValueFormatString:c.xValueFormatString?c.xValueFormatString:c.xValueFormatString=
|
|
554
|
+
g.axisX&&g.axisX.autoValueFormatString?g.axisX.autoValueFormatString:"DD MMM YY",g._cultureInfo):ea(f,d.xValueFormatString?d.xValueFormatString:c.xValueFormatString?c.xValueFormatString:c.xValueFormatString="#,##0.########",g._cultureInfo):"y"===a?ea(f,d.yValueFormatString?d.yValueFormatString:c.yValueFormatString?c.yValueFormatString:c.yValueFormatString="#,##0.########",g._cultureInfo):"z"===a?ea(f,d.zValueFormatString?d.zValueFormatString:c.zValueFormatString?c.zValueFormatString:c.zValueFormatString=
|
|
555
|
+
"#,##0.########",g._cultureInfo):f})};pa(M,L);M.prototype.setLayout=function(){var a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,d=a.layoutManager.getFreeSpace(),c=null,b=0,e=0,g=0,p=0,h=this.markerMargin=this.chart.options.legend&&!r(this.chart.options.legend.markerMargin)?this.chart.options.legend.markerMargin:0.3*this.fontSize;this.height=0;var l=[],k=[];if("top"===this.verticalAlign||"bottom"===this.verticalAlign)this.orientation="horizontal",c=this.verticalAlign,g=this.maxWidth=null!==
|
|
556
|
+
this.maxWidth?this.maxWidth:d.width,p=this.maxHeight=null!==this.maxHeight?this.maxHeight:0.5*d.height;else if("center"===this.verticalAlign){this.orientation="vertical";if("left"===this.horizontalAlign||"center"===this.horizontalAlign||"right"===this.horizontalAlign)c=this.horizontalAlign;g=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*d.width;p=this.maxHeight=null!==this.maxHeight?this.maxHeight:d.height}this.errorMarkerColor=[];for(var m=0;m<this.dataSeries.length;m++){var n=this.dataSeries[m];
|
|
557
|
+
if(n.dataPoints&&n.dataPoints.length)if("pie"!==n.type&&"doughnut"!==n.type&&"funnel"!==n.type&&"pyramid"!==n.type){var q=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:S.getDefaultLegendMarker(n._linkedSeries.type):S.getDefaultLegendMarker(n.type):n.markerType,f=n.legendText?n.legendText:
|
|
558
|
+
this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:n,dataPoint:null}):n.name,u=n.legendMarkerColor=n.legendMarkerColor?n.legendMarkerColor:n.markerColor?n.markerColor:"error"===n.type?r(n.whiskerColor)?n._colorSet[0]:n.whiskerColor:n._colorSet[0],y=n.markerSize||"line"!==n.type&&"stepLine"!==n.type&&"spline"!==n.type?0.75*this.lineHeight:0,x=n.legendMarkerBorderColor?n.legendMarkerBorderColor:n.markerBorderColor,s=n.legendMarkerBorderThickness?n.legendMarkerBorderThickness:
|
|
559
|
+
n.markerBorderThickness?Math.max(1,Math.round(0.2*y)):0;"error"===n.type&&this.errorMarkerColor.push(u);f=this.chart.replaceKeywordsWithValue(f,n.dataPoints[0],n,m);q={markerType:q,markerColor:u,text:f,textBlock:null,chartType:n.type,markerSize:y,lineColor:n._colorSet[0],dataSeriesIndex:n.index,dataPointIndex:null,markerBorderColor:x,markerBorderThickness:s};l.push(q)}else for(var w=0;w<n.dataPoints.length;w++){var v=n.dataPoints[w],q=v.legendMarkerType?v.legendMarkerType:n.legendMarkerType?n.legendMarkerType:
|
|
560
|
+
S.getDefaultLegendMarker(n.type),f=v.legendText?v.legendText:n.legendText?n.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:n,dataPoint:v}):v.name?v.name:"DataPoint: "+(w+1),u=v.legendMarkerColor?v.legendMarkerColor:n.legendMarkerColor?n.legendMarkerColor:v.color?v.color:n.color?n.color:n._colorSet[w%n._colorSet.length],y=0.75*this.lineHeight,x=v.legendMarkerBorderColor?v.legendMarkerBorderColor:n.legendMarkerBorderColor?n.legendMarkerBorderColor:
|
|
561
|
+
v.markerBorderColor?v.markerBorderColor:n.markerBorderColor,s=v.legendMarkerBorderThickness?v.legendMarkerBorderThickness:n.legendMarkerBorderThickness?n.legendMarkerBorderThickness:v.markerBorderThickness||n.markerBorderThickness?Math.max(1,Math.round(0.2*y)):0,f=this.chart.replaceKeywordsWithValue(f,v,n,w),q={markerType:q,markerColor:u,text:f,textBlock:null,chartType:n.type,markerSize:y,dataSeriesIndex:m,dataPointIndex:w,markerBorderColor:x,markerBorderThickness:s};(v.showInLegend||n.showInLegend&&
|
|
562
|
+
!1!==v.showInLegend)&&l.push(q)}}!0===this.reversed&&l.reverse();if(0<l.length){n=null;f=v=w=0;v=null!==this.itemWidth?null!==this.itemMaxWidth?Math.min(this.itemWidth,this.itemMaxWidth,g):this.itemMaxWidth=Math.min(this.itemWidth,g):null!==this.itemMaxWidth?Math.min(this.itemMaxWidth,g):this.itemMaxWidth=g;y=0===y?0.75*this.lineHeight:y;v=(this.itemMaxWidth?this.itemMaxWidth:v)-(y+h);for(m=0;m<l.length;m++){q=l[m];u=v;if("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType)u-=2*
|
|
563
|
+
0.1*this.lineHeight;if(!(0>=p||"undefined"===typeof p||0>=u||"undefined"===typeof u))if("horizontal"===this.orientation){q.textBlock=new ka(this.ctx,{x:0,y:0,maxWidth:u,maxHeight:this.itemWrap?p: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();null!==this.itemWidth&&(q.textBlock.width=this.itemWidth-(y+h+("line"===
|
|
564
|
+
q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0)));if(!n||n.width+Math.round(q.textBlock.width+y+h+(0===n.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))>g)n={items:[],width:0},k.push(n),this.height+=f,f=0;f=Math.max(f,q.textBlock.height?q.textBlock.height:this.lineHeight);q.textBlock.x=n.width;q.textBlock.y=0;n.width+=Math.round(q.textBlock.width+y+h+(0===n.width?0:this.horizontalSpacing)+
|
|
565
|
+
("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0));n.items.push(q);this.width=Math.max(n.width,this.width)}else q.textBlock=new ka(this.ctx,{x:0,y:0,maxWidth:v,maxHeight:!0===this.itemWrap?p: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=
|
|
566
|
+
this.itemWidth-(y+h+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))),this.height<p-this.lineHeight?(n={items:[],width:0},k.push(n)):(n=k[w],w=(w+1)%k.length),n&&(this.height+=q.textBlock.height?q.textBlock.height:this.lineHeight,q.textBlock.x=n.width,q.textBlock.y=0,n.width+=Math.round(q.textBlock.width+y+h+(0===n.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0)),n.items.push(q),
|
|
567
|
+
this.width=Math.max(n.width,this.width))}this.height=!1===this.itemWrap?k.length*this.lineHeight:this.height+f;this.height=Math.min(p,this.height);this.width=Math.min(g,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/
|
|
568
|
+
2):"bottom"===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.y2-this.height);this.items=l;for(m=0;m<this.items.length;m++)q=l[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=y;this.rows=k;0<l.length&&a.layoutManager.registerSpace(c,{width:this.width+
|
|
569
|
+
2+2,height:this.height+5+5});this.bounds={x1:e,y1:b,x2:e+this.width,y2:b+this.height}};M.prototype.render=function(){var a=this.bounds.x1,d=this.bounds.y1,c=this.markerMargin,b=this.maxWidth,e=this.maxHeight,g=this.markerSize,p=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,l=0;l<p.length;l++){for(var k=p[l],m=0,n=0;n<k.items.length;n++){var q=
|
|
570
|
+
k.items[n],f=q.textBlock.x+a+(0===n?0.2*g:this.horizontalSpacing),r=d+h,u=f;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(f-0.1*this.lineHeight,r+this.lineHeight/2),this.ctx.lineTo(f+
|
|
571
|
+
0.85*this.lineHeight,r+this.lineHeight/2),this.ctx.stroke(),u-=0.1*this.lineHeight;if("error"===q.chartType){this.ctx.strokeStyle=this.errorMarkerColor[0];this.ctx.lineWidth=g/8;this.ctx.beginPath();var x=f-0.08*this.lineHeight+0.1*this.lineHeight,s=r+0.15*this.lineHeight,w=0.7*this.lineHeight,v=w+0.02*this.lineHeight;this.ctx.moveTo(x,s);this.ctx.lineTo(x+w,s);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(x+w/2,s);this.ctx.lineTo(x+w/2,s+v);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(x,
|
|
572
|
+
s+v);this.ctx.lineTo(x+w,s+v);this.ctx.stroke();this.errorMarkerColor.shift()}Y.drawMarker(f+g/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=f+c+g;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();
|
|
573
|
+
m=0<n?Math.max(m,q.textBlock.height?q.textBlock.height:this.lineHeight):q.textBlock.height?q.textBlock.height:this.lineHeight;this.chart.data[q.dataSeriesIndex].visible||(this.ctx.globalAlpha=1);f=Z(q.id);this.ghostCtx.fillStyle=f;this.ghostCtx.beginPath();this.ghostCtx.fillRect(u,q.textBlock.y-this.lineHeight/2,q.textBlock.x+q.textBlock.width-u,q.textBlock.height?q.textBlock.height:this.lineHeight);q.x1=this.chart._eventManager.objectMap[q.id].x1=u;q.y1=this.chart._eventManager.objectMap[q.id].y1=
|
|
574
|
+
q.textBlock.y-this.lineHeight/2;q.x2=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}};pa(S,L);S.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||
|
|
575
|
+
"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";if("pie"===a||"doughnut"===a||"funnel"===a||"pyramid"===a)return"none";"error"!==a&&window.console.log("Unknown Chart Type: "+a);return null};S.getDefaultLegendMarker=function(a){if("column"===
|
|
576
|
+
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"===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||
|
|
577
|
+
"funnel"===a||"pyramid"===a)return"triangle";if("error"===a)return"none";window.console.log("Unknown Chart Type: "+a);return null};S.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,g=0,p=1,h=Infinity,l=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-
|
|
578
|
+
1)/m*Math.log(a/this.dataPoints[0].x)>>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(;;){g=0<p?m+e:m-e;if(0<=g&&g<this.dataPoints.length){var b=this.dataPoints[g],n=this.axisX.logarithmic?b.x>a?b.x/a:a/b.x:Math.abs(b.x-a);n<c.distance&&(c.dataPoint=b,c.distance=n,c.index=g);b=n;b<=h?h=b:0<p?l++:k++;if(1E3<l&&1E3<k)break}else if(0>
|
|
579
|
+
m-e&&m+e>=this.dataPoints.length)break;-1===p?(e++,p=1):p=-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};S.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,g=0,p=1,h=!1,l=Infinity,k=0,m=0,n=0;if("none"!==this.chart.plotInfo.axisPlacement)if(n=
|
|
580
|
+
(this.chart.axisX[0]?this.chart.axisX[0]: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),n=1<q?Math.min(Math.max((this.dataPoints.length-1)/q*Math.log(n/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;else q=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,n=0<q?Math.min(Math.max((this.dataPoints.length-1)/q*(n-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;for(;;){g=0<
|
|
581
|
+
p?n+e:n-e;if(0<=g&&g<this.dataPoints.length){var q=this.chart._eventManager.objectMap[this.dataPointIds[g]],f=this.dataPoints[g],u=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:f,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y1-d),Math.abs(q.y2-
|
|
582
|
+
d))}),h=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var y=na("markerSize",f,this)||4,x=c?20:y,u=Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-d,2));u<=x&&b.push({dataPoint:f,dataPointIndex:g,dataSeries:this,distance:u});q=Math.abs(q.x1-a);q<=l?l=q:0<p?k++:m++;u<=y/2&&(h=!0);break;case "rangeArea":case "rangeSplineArea":y=na("markerSize",f,this)||4;x=c?20:y;u=Math.min(Math.sqrt(Math.pow(q.x1-
|
|
583
|
+
a,2)+Math.pow(q.y1-d,2)),Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y2-d,2)));u<=x&&b.push({dataPoint:f,dataPointIndex:g,dataSeries:this,distance:u});q=Math.abs(q.x1-a);q<=l?l=q:0<p?k++:m++;u<=y/2&&(h=!0);break;case "bubble":y=q.size;u=Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-d,2));u<=y/2&&(b.push({dataPoint:f,dataPointIndex:g,dataSeries:this,distance:u}),h=!0);break;case "pie":case "doughnut":y=q.center;x="doughnut"===this.type?q.percentInnerRadius*q.radius:0;u=Math.sqrt(Math.pow(y.x-a,2)+Math.pow(y.y-
|
|
584
|
+
d,2));u<q.radius&&u>x&&(u=Math.atan2(d-y.y,a-y.x),0>u&&(u+=2*Math.PI),u=Number(((180*(u/Math.PI)%360+360)%360).toFixed(12)),y=Number(((180*(q.startAngle/Math.PI)%360+360)%360).toFixed(12)),x=Number(((180*(q.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===x&&1<q.endAngle&&(x=360),y>=x&&(0!==f.y&&!r(f.y))&&(x+=360,u<y&&(u+=360)),u>y&&u<x&&(b.push({dataPoint:f,dataPointIndex:g,dataSeries:this,distance:0}),h=!0));break;case "funnel":case "pyramid":u=q.funnelSection;d>u.y1&&d<u.y4&&(u.y6?d>u.y6?(g=u.x6+
|
|
585
|
+
(u.x5-u.x6)/(u.y5-u.y6)*(d-u.y6),u=u.x3+(u.x4-u.x3)/(u.y4-u.y3)*(d-u.y3)):(g=u.x1+(u.x6-u.x1)/(u.y6-u.y1)*(d-u.y1),u=u.x2+(u.x3-u.x2)/(u.y3-u.y2)*(d-u.y2)):(g=u.x1+(u.x4-u.x1)/(u.y4-u.y1)*(d-u.y1),u=u.x2+(u.x3-u.x2)/(u.y3-u.y2)*(d-u.y2)),a>g&&a<u&&(b.push({dataPoint:f,dataPointIndex:q.dataPointIndex,dataSeries:this,distance:0}),h=!0));break;case "boxAndWhisker":if(a>=q.x1-q.borderThickness/2&&a<=q.x2+q.borderThickness/2&&d>=q.y4-q.borderThickness/2&&d<=q.y1+q.borderThickness/2||Math.abs(q.x2-a+q.x1-
|
|
586
|
+
a)<q.borderThickness&&d>=q.y1&&d<=q.y4)b.push({dataPoint:f,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y2-d),Math.abs(q.y3-d))}),h=!0;break;case "candlestick":if(a>=q.x1-q.borderThickness/2&&a<=q.x2+q.borderThickness/2&&d>=q.y2-q.borderThickness/2&&d<=q.y3+q.borderThickness/2||Math.abs(q.x2-a+q.x1-a)<q.borderThickness&&d>=q.y1&&d<=q.y4)b.push({dataPoint:f,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y2-
|
|
587
|
+
d),Math.abs(q.y3-d))}),h=!0;break;case "ohlc":if(Math.abs(q.x2-a+q.x1-a)<q.borderThickness&&d>=q.y2&&d<=q.y3||a>=q.x1&&a<=(q.x2+q.x1)/2&&d>=q.y1-q.borderThickness/2&&d<=q.y1+q.borderThickness/2||a>=(q.x1+q.x2)/2&&a<=q.x2&&d>=q.y4-q.borderThickness/2&&d<=q.y4+q.borderThickness/2)b.push({dataPoint:f,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y2-d),Math.abs(q.y3-d))}),h=!0}if(h||1E3<k&&1E3<m)break}}else if(0>n-e&&n+e>=this.dataPoints.length)break;
|
|
588
|
+
-1===p?(e++,p=1):p=-1}a=null;for(d=0;d<b.length;d++)a?b[d].distance<=a.distance&&(a=b[d]):a=b[d];return a};S.prototype.getMarkerProperties=function(a,d,c,b){var e=this.dataPoints,g=e[a].markerColor?e[a].markerColor:this.markerColor?this.markerColor:e[a].color?e[a].color:this.color?this.color:this._colorSet[a%this._colorSet.length],p=e[a].markerBorderColor?e[a].markerBorderColor:this.markerBorderColor?this.markerBorderColor:null,h=r(e[a].markerBorderThickness)?this.markerBorderThickness?this.markerBorderThickness:
|
|
589
|
+
null:e[a].markerBorderThickness,l=e[a].markerType?e[a].markerType:this.markerType;a=r(e[a].markerSize)?this.markerSize:e[a].markerSize;return{x:d,y:c,ctx:b,type:l,size:a,color:g,borderColor:p,borderThickness:h}};pa(C,L);C.prototype.createExtraLabelsForLog=function(a){a=(a||0)+1;if(!(5<a)){var d=this.logLabelValues[0]||this.intervalStartPosition;if(Math.log(this.range)/Math.log(d/this.viewportMinimum)<this.noTicks-1){for(var c=C.getNiceNumber((d-this.viewportMinimum)/Math.min(Math.max(2,this.noTicks-
|
|
590
|
+
this.logLabelValues.length),3),!0),b=Math.ceil(this.viewportMinimum/c)*c;b<d;b+=c)b<this.viewportMinimum||this.logLabelValues.push(b);this.logLabelValues.sort(Sa);this.createExtraLabelsForLog(a)}}};C.prototype.createLabels=function(){var a,d,c=0,b=0,e,g=0,p=0,b=0,b=this.interval,h=0,l,k=0.6*this.chart.height,m;a=!1;var n=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],q=n.length?r(this.scaleBreaks.firstBreakIndex)?0:this.scaleBreaks.firstBreakIndex:0;if("axisX"!==this.type||"dateTime"!==this.valueType||
|
|
591
|
+
this.logarithmic){e=this.viewportMaximum;if(this.labels){a=Math.ceil(b);for(var b=Math.ceil(this.intervalStartPosition),f=!1,c=b;c<this.viewportMaximum;c+=a)if(this.labels[c])f=!0;else{f=!1;break}f&&(this.interval=a,this.intervalStartPosition=b)}if(this.logarithmic&&!this.equidistantInterval)for(this.logLabelValues||(this.logLabelValues=[],this.createExtraLabelsForLog()),b=0,f=q;b<this.logLabelValues.length;b++)if(c=this.logLabelValues[b],c<this.viewportMinimum)b++;else{for(;f<n.length&&c>n[f].endValue;f++);
|
|
592
|
+
a=f<n.length&&c>=n[f].startValue&&c<=n[f].endValue;m=c;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:m,label:this.labels[m]?this.labels[m]:null}):"axisX"===this.type&&this.labels[m]?this.labels[m]:ea(m,this.valueFormatString,this.chart._cultureInfo),a=new ka(this.ctx,{x:0,y:0,maxWidth:g,maxHeight:p,angle:this.labelAngle,text:this.prefix+a+this.suffix,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,cornerRadius:this.labelCornerRadius,
|
|
593
|
+
textAlign:this.labelTextAlign,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle",borderThickness:0}),this._labels.push({position:m,textBlock:a,effectiveHeight:null}))}f=q;for(c=this.intervalStartPosition;c<=e;c=parseFloat(1E-12>this.interval?this.logarithmic&&this.equidistantInterval?c*Math.pow(this.logarithmBase,this.interval):c+this.interval:(this.logarithmic&&this.equidistantInterval?
|
|
594
|
+
c*Math.pow(this.logarithmBase,this.interval):c+this.interval).toFixed(12))){for(;f<n.length&&c>n[f].endValue;f++);a=f<n.length&&c>=n[f].startValue&&c<=n[f].endValue;m=c;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:m,label:this.labels[m]?this.labels[m]:null}):"axisX"===this.type&&this.labels[m]?this.labels[m]:ea(m,this.valueFormatString,this.chart._cultureInfo),a=new ka(this.ctx,{x:0,y:0,maxWidth:g,maxHeight:p,angle:this.labelAngle,text:this.prefix+a+this.suffix,
|
|
595
|
+
textAlign:this.labelTextAlign,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"}),this._labels.push({position:m,textBlock:a,effectiveHeight:null}))}}else for(this.intervalStartPosition=this.getLabelStartPoint(new Date(this.viewportMinimum),
|
|
596
|
+
this.intervalType,this.interval),e=Ya(new Date(this.viewportMaximum),this.interval,this.intervalType),f=q,c=this.intervalStartPosition;c<e;Ya(c,b,this.intervalType)){for(a=c.getTime();f<n.length&&a>n[f].endValue;f++);m=a;a=f<n.length&&a>=n[f].startValue&&a<=n[f].endValue;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:new Date(m),label:this.labels[m]?this.labels[m]:null}):"axisX"===this.type&&this.labels[m]?this.labels[m]:Da(m,this.valueFormatString,this.chart._cultureInfo),
|
|
597
|
+
a=new ka(this.ctx,{x:0,y:0,maxWidth:g,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,maxHeight:p,angle:this.labelAngle,text:this.prefix+a+this.suffix,textAlign:this.labelTextAlign,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"}),this._labels.push({position:m,textBlock:a,
|
|
598
|
+
effectiveHeight:null,breaksLabelType:void 0}))}if("bottom"===this._position||"top"===this._position)h=this.logarithmic&&!this.equidistantInterval&&2<=this._labels.length?this.lineCoordinates.width*Math.log(Math.min(this._labels[this._labels.length-1].position/this._labels[this._labels.length-2].position,this._labels[1].position/this._labels[0].position))/Math.log(this.range):this.lineCoordinates.width/(this.logarithmic&&this.equidistantInterval?Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*
|
|
599
|
+
V[this.intervalType+"Duration"]*this.interval,g="undefined"===typeof this.options.labelMaxWidth?0.5*this.chart.width>>0:this.options.labelMaxWidth,this.chart.panEnabled||(p="undefined"===typeof this.options.labelWrap||this.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize);else if("left"===this._position||"right"===this._position)h=this.logarithmic&&!this.equidistantInterval&&2<=this._labels.length?this.lineCoordinates.height*Math.log(Math.min(this._labels[this._labels.length-1].position/
|
|
600
|
+
this._labels[this._labels.length-2].position,this._labels[1].position/this._labels[0].position))/Math.log(this.range):this.lineCoordinates.height/(this.logarithmic&&this.equidistantInterval?Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*V[this.intervalType+"Duration"]*this.interval,this.chart.panEnabled||(g="undefined"===typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),p="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>
|
|
601
|
+
0:1.5*this.labelFontSize;for(b=0;b<this._labels.length;b++){a=this._labels[b].textBlock;a.maxWidth=g;a.maxHeight=p;var z=a.measureText();l=z.height}e=[];q=n=0;if(this.labelAutoFit||this.options.labelAutoFit)if(r(this.labelAngle)||(this.labelAngle=(this.labelAngle%360+360)%360,90<this.labelAngle&&270>this.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360)),"bottom"===this._position||"top"===this._position)if(g=0.9*h>>0,q=0,!this.chart.panEnabled&&1<=
|
|
602
|
+
this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=p;this.sessionVariables.labelAngle=this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(c=0;c<this._labels.length;c++)if(!this._labels[c].breaksLabelType){a=this._labels[c].textBlock;for(var y,f=a.text.split(" "),b=0;b<f.length;b++)m=f[b],this.ctx.font=a.fontStyle+" "+a.fontWeight+" "+a.fontSize+"px "+a.fontFamily,m=this.ctx.measureText(m),
|
|
603
|
+
m.width>q&&(y=c,q=m.width)}c=0;for(c=this.intervalStartPosition<this.viewportMinimum?1:0;c<this._labels.length;c++)if(!this._labels[c].breaksLabelType){a=this._labels[c].textBlock;z=a.measureText();for(f=c+1;f<this._labels.length;f++)if(!this._labels[f].breaksLabelType){d=this._labels[f].textBlock;d=d.measureText();break}e.push(a.height);this.sessionVariables.labelMaxHeight=Math.max.apply(Math,e);Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.sin(Math.PI/180*Math.abs(this.labelAngle));b=g*Math.sin(Math.PI/
|
|
604
|
+
180*Math.abs(this.labelAngle))+(p-a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));if(r(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle)if(this.sessionVariables.labelMaxHeight=0===this.labelAngle?p:Math.min((b-g*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),b),m=(k-(l+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(-25)))/Math.sin(Math.PI/180*Math.abs(-25)),!r(this.options.labelWrap))this.labelWrap?r(this.options.labelMaxWidth)?
|
|
605
|
+
(this.sessionVariables.labelMaxWidth=Math.min(Math.max(g,q),m),this.sessionVariables.labelWrap=this.labelWrap,d&&z.width+d.width>>0>2*g&&(this.sessionVariables.labelAngle=-25)):(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g?-25:this.sessionVariables.labelAngle):r(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=
|
|
606
|
+
p,this.sessionVariables.labelMaxWidth=g,d&&z.width+d.width>>0>2*g&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=m)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=p,this.sessionVariables.labelWrap=this.labelWrap);else{if(r(this.options.labelWrap))if(!r(this.options.labelMaxWidth))this.options.labelMaxWidth<g?
|
|
607
|
+
(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=b):(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=p);else if(!r(d))if(b=z.width+d.width>>0,f=this.labelFontSize,q<g)b-2*g>n&&(n=b-2*g,b>=2*g&&b<2.2*g?(this.sessionVariables.labelMaxWidth=g,r(this.options.labelFontSize)&&12<f&&(f=Math.floor(12/13*f),a.measureText()),this.sessionVariables.labelFontSize=r(this.options.labelFontSize)?
|
|
608
|
+
f:this.options.labelFontSize,this.sessionVariables.labelAngle=this.labelAngle):b>=2.2*g&&b<2.8*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=m,this.sessionVariables.labelFontSize=f):b>=2.8*g&&b<3.2*g?(this.sessionVariables.labelMaxWidth=Math.max(g,q),this.sessionVariables.labelWrap=!0,r(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=r(this.options.labelFontSize)?
|
|
609
|
+
f:this.options.labelFontSize,this.sessionVariables.labelAngle=this.labelAngle):b>=3.2*g&&b<3.6*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=m,this.sessionVariables.labelFontSize=this.labelFontSize):b>3.6*g&&b<5*g?(r(this.options.labelFontSize)&&12<f&&(f=Math.floor(12/13*f),a.measureText()),this.sessionVariables.labelFontSize=r(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=
|
|
610
|
+
-25,this.sessionVariables.labelMaxWidth=m):b>5*g&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelFontSize=f,this.sessionVariables.labelMaxHeight=p,this.sessionVariables.labelAngle=this.labelAngle));else if(y===c&&(0===y&&q+this._labels[y+1].textBlock.measureText().width-2*g>n||y===this._labels.length-1&&q+this._labels[y-1].textBlock.measureText().width-2*g>n||0<y&&y<this._labels.length-1&&q+this._labels[y+1].textBlock.measureText().width-2*g>n&&
|
|
611
|
+
q+this._labels[y-1].textBlock.measureText().width-2*g>n))n=0===y?q+this._labels[y+1].textBlock.measureText().width-2*g:q+this._labels[y-1].textBlock.measureText().width-2*g,this.sessionVariables.labelFontSize=r(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=m;else if(0===n)for(this.sessionVariables.labelFontSize=r(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelWrap=
|
|
612
|
+
!0,b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.sessionVariables.labelMaxWidth=Math.min(Math.max(g,q),m),z=a.measureText(),b<this._labels.length-1&&(f=b+1,d=this._labels[f].textBlock,d.maxWidth=this.sessionVariables.labelMaxWidth=Math.min(Math.max(g,q),m),d=d.measureText(),z.width+d.width>>0>2*g&&(this.sessionVariables.labelAngle=-25))}else(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxHeight=0===this.labelAngle?p:Math.min((b-g*Math.cos(Math.PI/
|
|
613
|
+
180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),b),m=0!=this.labelAngle?(k-(l+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)):g,this.sessionVariables.labelMaxHeight=this.labelWrap?(k-m*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)):1.5*this.labelFontSize,r(this.options.labelWrap))?r(this.options.labelWrap)&&(this.labelWrap&&!r(this.options.labelMaxWidth)?
|
|
614
|
+
(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:m,this.sessionVariables.labelMaxHeight=p):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=m,this.sessionVariables.labelMaxHeight=b<0.9*h?0.9*h:b,this.sessionVariables.labelWrap=this.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?
|
|
615
|
+
this.options.labelMaxWidth:m):(r(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:m,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight=p)}for(b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.labelMaxWidth=this.sessionVariables.labelMaxWidth,a.fontSize=this.sessionVariables.labelFontSize,a.angle=this.labelAngle=this.sessionVariables.labelAngle,a.wrap=this.labelWrap=this.sessionVariables.labelWrap,
|
|
616
|
+
a.maxHeight=this.sessionVariables.labelMaxHeight,a.measureText()}else for(c=0;c<this._labels.length;c++)a=this._labels[c].textBlock,a.maxWidth=this.labelMaxWidth=r(this.options.labelMaxWidth)?r(this.sessionVariables.labelMaxWidth)?this.sessionVariables.labelMaxWidth=g:this.sessionVariables.labelMaxWidth:this.options.labelMaxWidth,a.fontSize=this.labelFontSize=r(this.options.labelFontSize)?r(this.sessionVariables.labelFontSize)?this.sessionVariables.labelFontSize=this.labelFontSize:this.sessionVariables.labelFontSize:
|
|
617
|
+
this.options.labelFontSize,a.angle=this.labelAngle=r(this.options.labelAngle)?r(this.sessionVariables.labelAngle)?this.sessionVariables.labelAngle=this.labelAngle:this.sessionVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=r(this.options.labelWrap)?r(this.sessionVariables.labelWrap)?this.sessionVariables.labelWrap=this.labelWrap:this.sessionVariables.labelWrap:this.options.labelWrap,a.maxHeight=r(this.sessionVariables.labelMaxHeight)?this.sessionVariables.labelMaxHeight=p:this.sessionVariables.labelMaxHeight,
|
|
618
|
+
a.measureText();else if("left"===this._position||"right"===this._position)if(g=r(this.options.labelMaxWidth)?0.3*this.chart.width>>0:this.options.labelMaxWidth,p="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=p;this.sessionVariables.labelAngle=r(this.sessionVariables.labelAngle)?
|
|
619
|
+
0:this.sessionVariables.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(c=0;c<this._labels.length;c++)if(!this._labels[c].breaksLabelType){a=this._labels[c].textBlock;z=a.measureText();for(f=c+1;f<this._labels.length;f++)if(!this._labels[f].breaksLabelType){d=this._labels[f].textBlock;d=d.measureText();break}e.push(a.height);this.sessionVariables.labelMaxHeight=Math.max.apply(Math,e);b=g*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(p-a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));
|
|
620
|
+
Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.sin(Math.PI/180*Math.abs(this.labelAngle));r(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle?r(this.options.labelWrap)?r(this.options.labelWrap)&&(r(this.options.labelMaxWidth)?r(d)||(h=z.height+d.height>>0,h-2*p>q&&(q=h-2*p,h>=2*p&&h<2.4*p?(r(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelMaxHeight=p,this.sessionVariables.labelFontSize=
|
|
621
|
+
r(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize):h>=2.4*p&&h<2.8*p?(this.sessionVariables.labelMaxHeight=b,this.sessionVariables.labelFontSize=this.labelFontSize,this.sessionVariables.labelWrap=!0):h>=2.8*p&&h<3.2*p?(this.sessionVariables.labelMaxHeight=p,this.sessionVariables.labelWrap=!0,r(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=r(this.options.labelFontSize)?
|
|
622
|
+
this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelAngle=r(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):h>=3.2*p&&h<3.6*p?(this.sessionVariables.labelMaxHeight=b,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelFontSize=this.labelFontSize):h>3.6*p&&h<10*p?(r(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=r(this.options.labelFontSize)?
|
|
623
|
+
this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelMaxHeight=p,this.sessionVariables.labelAngle=r(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):h>10*p&&h<50*p&&(r(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=r(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelMaxHeight=
|
|
624
|
+
p,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelAngle=r(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle))):(this.sessionVariables.labelMaxHeight=p,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth)):(this.sessionVariables.labelMaxWidth=this.labelWrap?this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth:this.labelMaxWidth?this.options.labelMaxWidth?
|
|
625
|
+
this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth:g,this.sessionVariables.labelMaxHeight=p):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=0===this.labelAngle?g:Math.min((b-p*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)),p),r(this.options.labelWrap))?r(this.options.labelWrap)&&(this.labelWrap&&!r(this.options.labelMaxWidth)?(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:
|
|
626
|
+
this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=b):(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:g,this.sessionVariables.labelMaxHeight=0===this.labelAngle?p:b,r(this.options.labelMaxWidth)&&(this.sessionVariables.labelAngle=this.labelAngle))):this.options.labelWrap?(this.sessionVariables.labelMaxHeight=0===this.labelAngle?p:b,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=
|
|
627
|
+
g):(this.sessionVariables.labelMaxHeight=p,r(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=this.labelWrap)}for(b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.labelMaxWidth=this.sessionVariables.labelMaxWidth,a.fontSize=this.labelFontSize=this.sessionVariables.labelFontSize,a.angle=this.labelAngle=this.sessionVariables.labelAngle,a.wrap=
|
|
628
|
+
this.labelWrap=this.sessionVariables.labelWrap,a.maxHeight=this.sessionVariables.labelMaxHeight,a.measureText()}else for(c=0;c<this._labels.length;c++)a=this._labels[c].textBlock,a.maxWidth=this.labelMaxWidth=r(this.options.labelMaxWidth)?r(this.sessionVariables.labelMaxWidth)?this.sessionVariables.labelMaxWidth=g:this.sessionVariables.labelMaxWidth:this.options.labelMaxWidth,a.fontSize=this.labelFontSize=r(this.options.labelFontSize)?r(this.sessionVariables.labelFontSize)?this.sessionVariables.labelFontSize=
|
|
629
|
+
this.labelFontSize:this.sessionVariables.labelFontSize:this.options.labelFontSize,a.angle=this.labelAngle=r(this.options.labelAngle)?r(this.sessionVariables.labelAngle)?this.sessionVariables.labelAngle=this.labelAngle:this.sessionVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=r(this.options.labelWrap)?r(this.sessionVariables.labelWrap)?this.sessionVariables.labelWrap=this.labelWrap:this.sessionVariables.labelWrap:this.options.labelWrap,a.maxHeight=r(this.sessionVariables.labelMaxHeight)?
|
|
630
|
+
this.sessionVariables.labelMaxHeight=p:this.sessionVariables.labelMaxHeight,a.measureText();for(c=0;c<this.stripLines.length;c++){var g=this.stripLines[c],x;if("outside"===g.labelPlacement){p=this.sessionVariables.labelMaxWidth;if("bottom"===this._position||"top"===this._position)r(g.options.labelWrap)&&!r(this.sessionVariables.stripLineLabelMaxHeight)?x=this.sessionVariables.stripLineLabelMaxHeight:this.sessionVariables.stripLineLabelMaxHeight=x=g.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize;
|
|
631
|
+
if("left"===this._position||"right"===this._position)r(g.options.labelWrap)&&!r(this.sessionVariables.stripLineLabelMaxHeight)?x=this.sessionVariables.stripLineLabelMaxHeight:this.sessionVariables.stripLineLabelMaxHeight=x=g.labelWrap?0.8*this.chart.width>>0:1.5*this.labelFontSize;r(g.labelBackgroundColor)&&(g.labelBackgroundColor="#EEEEEE")}else p="bottom"===this._position||"top"===this._position?0.9*this.chart.width>>0:0.9*this.chart.height>>0,x=r(g.options.labelWrap)||g.labelWrap?"bottom"===this._position||
|
|
632
|
+
"top"===this._position?0.8*this.chart.width>>0:0.8*this.chart.height>>0:1.5*this.labelFontSize,r(g.labelBackgroundColor)&&(r(g.startValue)&&0!==g.startValue?g.labelBackgroundColor=u?"transparent":null:g.labelBackgroundColor="#EEEEEE");a=new ka(this.ctx,{x:0,y:0,backgroundColor:g.labelBackgroundColor,borderColor:g.labelBorderColor,borderThickness:g.labelBorderThickness,cornerRadius:g.labelCornerRadius,maxWidth:g.options.labelMaxWidth?g.options.labelMaxWidth:p,maxHeight:x,angle:this.labelAngle,text:g.labelFormatter?
|
|
633
|
+
g.labelFormatter({chart:this.chart,axis:this,stripLine:g}):g.label,textAlign:this.labelTextAlign,fontSize:"outside"===g.labelPlacement?g.options.labelFontSize?g.labelFontSize:this.labelFontSize:g.labelFontSize,fontFamily:"outside"===g.labelPlacement?g.options.labelFontFamily?g.labelFontFamily:this.labelFontFamily:g.labelFontFamily,fontWeight:"outside"===g.labelPlacement?g.options.labelFontWeight?g.labelFontWeight:this.labelFontWeight:g.labelFontWeight,fontColor:g.labelFontColor||g.color,fontStyle:"outside"===
|
|
634
|
+
g.labelPlacement?g.options.labelFontStyle?g.labelFontStyle:this.fontWeight:g.labelFontStyle,textBaseline:"middle"});this._stripLineLabels.push({position:g.value,textBlock:a,effectiveHeight:null,stripLine:g})}};C.prototype.createLabelsAndCalculateWidth=function(){var a=0,d=0;this._labels=[];this._stripLineLabels=[];var c=this.chart.isNavigator?0:5;if("left"===this._position||"right"===this._position){this.createLabels();if("inside"!=this.labelPlacement||"inside"===this.labelPlacement&&0<this._index)for(d=
|
|
635
|
+
0;d<this._labels.length;d++){var b=this._labels[d].textBlock,e=b.measureText(),g=0,g=0===this.labelAngle?e.width:e.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+(e.height-b.fontSize/2)*Math.sin(Math.PI/180*Math.abs(this.labelAngle));a<g&&(this.labelEffectiveWidth=a=g);this._labels[d].effectiveWidth=g}for(d=0;d<this._stripLineLabels.length;d++)"outside"===this._stripLineLabels[d].stripLine.labelPlacement&&(this._stripLineLabels[d].stripLine.value>=this.viewportMinimum&&this._stripLineLabels[d].stripLine.value<=
|
|
636
|
+
this.viewportMaximum)&&(b=this._stripLineLabels[d].textBlock,e=b.measureText(),g=0===this.labelAngle?e.width:e.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+(e.height-b.fontSize/2)*Math.sin(Math.PI/180*Math.abs(this.labelAngle)),"inside"===this.tickPlacement&&(g+=this.tickLength),"inside"===this.labelPlacement&&(a+=0<this._index?g:0),a<g&&(a=g),this.stripLineLabelEffectiveWidth=this._stripLineLabels[d].effectiveWidth=g)}return(this.title?this._titleTextBlock.measureText().height+2:0)+a+("inside"===
|
|
637
|
+
this.tickPlacement?0<this._index?this.tickLength:0:this.tickLength)+c};C.prototype.createLabelsAndCalculateHeight=function(){var a=0;this._labels=[];this._stripLineLabels=[];var d,c=0,b=this.chart.isNavigator?0:5;if("bottom"===this._position||"top"===this._position){this.createLabels();if("inside"!=this.labelPlacement||"inside"===this.labelPlacement&&0<this._index)for(c=0;c<this._labels.length;c++){d=this._labels[c].textBlock;var e=d.measureText(),g=0,g=0===this.labelAngle?e.height:e.width*Math.sin(Math.PI/
|
|
638
|
+
180*Math.abs(this.labelAngle))+(e.height-d.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));a<g&&(this.labelEffectiveHeight=a=g);this._labels[c].effectiveHeight=g}for(c=0;c<this._stripLineLabels.length;c++)"outside"===this._stripLineLabels[c].stripLine.labelPlacement&&(this._stripLineLabels[c].stripLine.value>=this.viewportMinimum&&this._stripLineLabels[c].stripLine.value<=this.viewportMaximum)&&(d=this._stripLineLabels[c].textBlock,e=d.measureText(),g=0===this.labelAngle?e.height:e.width*
|
|
639
|
+
Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(e.height-d.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)),"inside"===this.tickPlacement&&(g+=this.tickLength),"inside"===this.labelPlacement&&(a+=0<this._index?g:0),a<g&&(a=g),this.stripLineLabelEffectiveHeight=this._stripLineLabels[c].effectiveHeight=g)}return(this.title?this._titleTextBlock.measureText().height+2:0)+a+("inside"===this.tickPlacement?0<this._index?this.tickLength:0:this.tickLength)+b};C.setLayout=function(a,d,c,b,e,g){var p,
|
|
640
|
+
h,l,k,m=a[0]?a[0].chart:d[0].chart,n=m.isNavigator?0:10,q=m._axes;if(a&&0<a.length)for(var f=0;f<a.length;f++)a[f]&&a[f].calculateAxisParameters();if(d&&0<d.length)for(f=0;f<d.length;f++)d[f].calculateAxisParameters();if(c&&0<c.length)for(f=0;f<c.length;f++)c[f].calculateAxisParameters();if(b&&0<b.length)for(f=0;f<b.length;f++)b[f].calculateAxisParameters();for(f=0;f<q.length;f++)if(q[f]&&q[f].scaleBreaks&&q[f].scaleBreaks._appliedBreaks.length)for(var u=q[f].scaleBreaks._appliedBreaks,y=0;y<u.length&&
|
|
641
|
+
!(u[y].startValue>q[f].viewportMaximum);y++)u[y].endValue<q[f].viewportMinimum||(r(q[f].scaleBreaks.firstBreakIndex)&&(q[f].scaleBreaks.firstBreakIndex=y),u[y].startValue>=q[f].viewPortMinimum&&(q[f].scaleBreaks.lastBreakIndex=y));for(var x=y=0,s=0,w=0,v=0,z=0,B=0,C,E,G=h=0,K,L,M,u=K=L=M=!1,f=0;f<q.length;f++)q[f]&&q[f].title&&(q[f]._titleTextBlock=new ka(q[f].ctx,{text:q[f].title,horizontalAlign:"center",fontSize:q[f].titleFontSize,fontFamily:q[f].titleFontFamily,fontWeight:q[f].titleFontWeight,
|
|
642
|
+
fontColor:q[f].titleFontColor,fontStyle:q[f].titleFontStyle,borderColor:q[f].titleBorderColor,borderThickness:q[f].titleBorderThickness,backgroundColor:q[f].titleBackgroundColor,cornerRadius:q[f].titleCornerRadius,textBaseline:"middle"}));for(f=0;f<q.length;f++)if(q[f].title)switch(q[f]._position){case "left":q[f]._titleTextBlock.maxWidth=q[f].titleMaxWidth||g.height;q[f]._titleTextBlock.maxHeight=q[f].titleWrap?0.8*g.width:1.5*q[f].titleFontSize;q[f]._titleTextBlock.angle=-90;break;case "right":q[f]._titleTextBlock.maxWidth=
|
|
643
|
+
q[f].titleMaxWidth||g.height;q[f]._titleTextBlock.maxHeight=q[f].titleWrap?0.8*g.width:1.5*q[f].titleFontSize;q[f]._titleTextBlock.angle=90;break;default:q[f]._titleTextBlock.maxWidth=q[f].titleMaxWidth||g.width,q[f]._titleTextBlock.maxHeight=q[f].titleWrap?0.8*g.height:1.5*q[f].titleFontSize,q[f]._titleTextBlock.angle=0}if("normal"===e){for(var w=[],v=[],z=[],B=[],P=[],S=[],Q=[],R=[];4>y;){var H=0,Z=0,V=0,W=0,X=e=0,O=0,aa=0,Y=0,$=0,T=0,ba=0;if(c&&0<c.length)for(z=[],f=T=0;f<c.length;f++)z.push(Math.ceil(c[f]?
|
|
644
|
+
c[f].createLabelsAndCalculateWidth():0)),T+=z[f],O+=c[f]&&!m.isNavigator?c[f].margin:0;else z.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateWidth():0));Q.push(z);if(b&&0<b.length)for(B=[],f=ba=0;f<b.length;f++)B.push(Math.ceil(b[f]?b[f].createLabelsAndCalculateWidth():0)),ba+=B[f],aa+=b[f]?b[f].margin:0;else B.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateWidth():0));R.push(B);p=Math.round(g.x1+T+O);l=Math.round(g.x2-ba-aa>m.width-n?m.width-n:g.x2-ba-aa);if(a&&0<a.length)for(w=[],f=Y=0;f<a.length;f++)a[f]&&
|
|
645
|
+
(a[f].lineCoordinates={}),a[f].lineCoordinates.width=Math.abs(l-p),a[f].title&&(a[f]._titleTextBlock.maxWidth=0<a[f].titleMaxWidth&&a[f].titleMaxWidth<a[f].lineCoordinates.width?a[f].titleMaxWidth:a[f].lineCoordinates.width),w.push(Math.ceil(a[f]?a[f].createLabelsAndCalculateHeight():0)),Y+=w[f],e+=a[f]&&!m.isNavigator?a[f].margin:0;else w.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateHeight():0));P.push(w);if(d&&0<d.length)for(v=[],f=$=0;f<d.length;f++)d[f]&&(d[f].lineCoordinates={}),d[f].lineCoordinates.width=
|
|
646
|
+
Math.abs(l-p),d[f].title&&(d[f]._titleTextBlock.maxWidth=0<d[f].titleMaxWidth&&d[f].titleMaxWidth<d[f].lineCoordinates.width?d[f].titleMaxWidth:d[f].lineCoordinates.width),v.push(Math.ceil(d[f]?d[f].createLabelsAndCalculateHeight():0)),$+=v[f],X+=d[f]&&!m.isNavigator?d[f].margin:0;else v.push(Math.ceil(d[0]?d[0].createLabelsAndCalculateHeight():0));S.push(v);if(a&&0<a.length)for(f=0;f<a.length;f++)a[f]&&(a[f].lineCoordinates.x1=p,l=Math.round(g.x2-ba-aa>m.width-n?m.width-n:g.x2-ba-aa),a[f]._labels&&
|
|
647
|
+
1<a[f]._labels.length&&(h=k=0,k=a[f]._labels[1],h="dateTime"===a[f].valueType?a[f]._labels[a[f]._labels.length-2]:a[f]._labels[a[f]._labels.length-1],x=k.textBlock.width*Math.cos(Math.PI/180*Math.abs(k.textBlock.angle))+(k.textBlock.height-h.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(k.textBlock.angle)),s=h.textBlock.width*Math.cos(Math.PI/180*Math.abs(h.textBlock.angle))+(h.textBlock.height-h.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(h.textBlock.angle))),!a[f]||(!a[f].labelAutoFit||
|
|
648
|
+
r(C)||r(E)||m.isNavigator||m.stockChart)||(h=0,0<a[f].labelAngle?E+s>l&&(h+=0<a[f].labelAngle?E+s-l-ba:0):0>a[f].labelAngle?C-x<p&&C-x<a[f].viewportMinimum&&(G=p-(O+a[f].tickLength+z+C-x+a[f].labelFontSize/2)):0===a[f].labelAngle&&(E+s>l&&(h=E+s/2-l-ba),C-x<p&&C-x<a[f].viewportMinimum&&(G=p-O-a[f].tickLength-z-C+x/2)),a[f].viewportMaximum===a[f].maximum&&a[f].viewportMinimum===a[f].minimum&&0<a[f].labelAngle&&0<h?l-=h:a[f].viewportMaximum===a[f].maximum&&a[f].viewportMinimum===a[f].minimum&&0>a[f].labelAngle&&
|
|
649
|
+
0<G?p+=G:a[f].viewportMaximum===a[f].maximum&&a[f].viewportMinimum===a[f].minimum&&0===a[f].labelAngle&&(0<G&&(p+=G),0<h&&(l-=h))),m.panEnabled?Y=r(m.sessionVariables.axisX.height)?m.sessionVariables.axisX.height=Y:m.sessionVariables.axisX.height:m.sessionVariables.axisX.height=Y,h=Math.round(g.y2-Y-e+H),k=Math.round(g.y2),a[f].lineCoordinates.x2=l,a[f].lineCoordinates.width=l-p,a[f].lineCoordinates.y1=h,a[f].lineCoordinates.y2=h,"inside"===a[f].labelPlacement&&0<f&&(a[f].lineCoordinates.y1=a[f-1].lineCoordinates.y2+
|
|
650
|
+
H+(a[f].labelEffectiveHeight||0),a[f].lineCoordinates.y2=a[f].lineCoordinates.y1+a[f].lineThickness/2),"inside"===a[f].tickPlacement&&0<f&&(a[f].lineCoordinates.y1+=a[f].tickLength,a[f].lineCoordinates.y2=a[f].lineCoordinates.y1+a[f].lineThickness/2),a[f].bounds={x1:p,y1:h,x2:l,y2:k-(Y+e-w[f]-H),width:l-p},a[f].bounds.height=a[f].bounds.y2-a[f].bounds.y1),H+=w[f]+a[f].margin;if(d&&0<d.length)for(f=0;f<d.length;f++)d[f].lineCoordinates.x1=Math.round(g.x1+T+O),d[f].lineCoordinates.x2=Math.round(g.x2-
|
|
651
|
+
ba-aa>m.width-n?m.width-n:g.x2-ba-aa),d[f].lineCoordinates.width=Math.abs(l-p),d[f]._labels&&1<d[f]._labels.length&&(k=d[f]._labels[1],h="dateTime"===d[f].valueType?d[f]._labels[d[f]._labels.length-2]:d[f]._labels[d[f]._labels.length-1],x=k.textBlock.width*Math.cos(Math.PI/180*Math.abs(k.textBlock.angle))+(k.textBlock.height-h.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(k.textBlock.angle)),s=h.textBlock.width*Math.cos(Math.PI/180*Math.abs(h.textBlock.angle))+(h.textBlock.height-h.textBlock.fontSize/
|
|
652
|
+
2)*Math.sin(Math.PI/180*Math.abs(h.textBlock.angle))),m.panEnabled?$=r(m.sessionVariables.axisX2.height)?m.sessionVariables.axisX2.height=$:m.sessionVariables.axisX2.height:m.sessionVariables.axisX2.height=$,h=Math.round(g.y1),k=d[f].lineCoordinates.y1=h+$+X-Z,d[f].lineCoordinates.y2=h,"inside"===d[f].labelPlacement&&0<f&&(d[f].lineCoordinates.y1=d[f-1].lineCoordinates.y1-Z-(d[f].labelEffectiveHeight||0)),"inside"===d[f].tickPlacement&&0<f&&(d[f].lineCoordinates.y1-=d[f].tickLength),d[f].bounds={x1:p,
|
|
653
|
+
y1:h+($+X-v[f]-Z),x2:l,y2:k,width:l-p},d[f].bounds.height=d[f].bounds.y2-d[f].bounds.y1,Z+=v[f]+d[f].margin;if(c&&0<c.length)for(f=0;f<c.length;f++)O=m.isNavigator?0:10,c[f]&&(p=Math.round(a[0]?a[0].lineCoordinates.x1:d[0].lineCoordinates.x1),O=c[f]._labels&&0<c[f]._labels.length?c[f]._labels[c[f]._labels.length-1].textBlock.height/2:n,h=Math.round(g.y1+$+X<Math.max(O,n)?Math.max(O,n):g.y1+$+X),l=Math.round(a[0]?a[0].lineCoordinates.x1:d[0].lineCoordinates.x1),O=0<a.length?0:c[f]._labels&&0<c[f]._labels.length?
|
|
654
|
+
c[f]._labels[0].textBlock.height/2:n,k=Math.round(g.y2-Y-e-O),c[f].lineCoordinates={x1:p-V,y1:h,x2:l-V,y2:k,height:Math.abs(k-h)},"inside"===c[f].labelPlacement&&0<f&&(c[f].lineCoordinates.x1=c[f-1].lineCoordinates.x1-V-(c[f].labelEffectiveWidth||0),c[f].lineCoordinates.x2=c[f].lineCoordinates.x1+c[f].lineThickness/2),"inside"===c[f].tickPlacement&&0<f&&(c[f].lineCoordinates.x1-=c[f].tickLength,c[f].lineCoordinates.x2=c[f].lineCoordinates.x1+c[f].lineThickness/2),c[f].bounds={x1:p-(z[f]+V),y1:h,x2:l-
|
|
655
|
+
V,y2:k,height:k-h},c[f].bounds.width=c[f].bounds.x2-c[f].bounds.x1,c[f].title&&(c[f]._titleTextBlock.maxWidth=0<c[f].titleMaxWidth&&c[f].titleMaxWidth<c[f].lineCoordinates.height?c[f].titleMaxWidth:c[f].lineCoordinates.height),V+=z[f]+c[f].margin);if(b&&0<b.length)for(f=0;f<b.length;f++)b[f]&&(p=Math.round(a[0]?a[0].lineCoordinates.x2:d[0].lineCoordinates.x2),l=Math.round(p),O=b[f]._labels&&0<b[f]._labels.length?b[f]._labels[b[f]._labels.length-1].textBlock.height/2:0,h=Math.round(g.y1+$+X<Math.max(O,
|
|
656
|
+
n)?Math.max(O,n):g.y1+$+X),O=0<a.length?0:b[f]._labels&&0<b[f]._labels.length?b[f]._labels[0].textBlock.height/2:0,k=Math.round(g.y2-(Y+e+O)),b[f].lineCoordinates={x1:p+W,y1:h,x2:p+W,y2:k,height:Math.abs(k-h)},"inside"===b[f].labelPlacement&&0<f&&(b[f].lineCoordinates.x1=b[f-1].lineCoordinates.x2+W+(b[f].labelEffectiveWidth||0),b[f].lineCoordinates.x2=b[f].lineCoordinates.x1+b[f].lineThickness/2),"inside"===b[f].tickPlacement&&0<f&&(b[f].lineCoordinates.x1+=b[f].tickLength,b[f].lineCoordinates.x2=
|
|
657
|
+
b[f].lineCoordinates.x1+b[f].lineThickness/2),b[f].bounds={x1:p+W,y1:h,x2:l+(B[f]+W),y2:k,height:k-h},b[f].bounds.width=b[f].bounds.x2-b[f].bounds.x1,b[f].title&&(b[f]._titleTextBlock.maxWidth=0<b[f].titleMaxWidth&&b[f].titleMaxWidth<b[f].lineCoordinates.height?b[f].titleMaxWidth:b[f].lineCoordinates.height),W+=B[f]+b[f].margin);if(a&&0<a.length)for(f=0;f<a.length;f++)a[f]&&(a[f].calculateValueToPixelConversionParameters(),a[f].calculateBreaksSizeInValues(),a[f]._labels&&1<a[f]._labels.length&&(C=
|
|
658
|
+
(a[f].logarithmic?Math.log(a[f]._labels[1].position/a[f].viewportMinimum)/a[f].conversionParameters.lnLogarithmBase:a[f]._labels[1].position-a[f].viewportMinimum)*Math.abs(a[f].conversionParameters.pixelPerUnit)+a[f].lineCoordinates.x1,p=a[f]._labels[a[f]._labels.length-("dateTime"===a[f].valueType?2:1)].position,p=a[f].getApparentDifference(a[f].viewportMinimum,p),E=a[f].logarithmic?(1<p?Math.log(p)/a[f].conversionParameters.lnLogarithmBase*Math.abs(a[f].conversionParameters.pixelPerUnit):0)+a[f].lineCoordinates.x1:
|
|
659
|
+
(0<p?p*Math.abs(a[f].conversionParameters.pixelPerUnit):0)+a[f].lineCoordinates.x1));if(d&&0<d.length)for(f=0;f<d.length;f++)d[f].calculateValueToPixelConversionParameters(),d[f].calculateBreaksSizeInValues(),d[f]._labels&&1<d[f]._labels.length&&(C=(d[f].logarithmic?Math.log(d[f]._labels[1].position/d[f].viewportMinimum)/d[f].conversionParameters.lnLogarithmBase:d[f]._labels[1].position-d[f].viewportMinimum)*Math.abs(d[f].conversionParameters.pixelPerUnit)+d[f].lineCoordinates.x1,p=d[f]._labels[d[f]._labels.length-
|
|
660
|
+
("dateTime"===d[f].valueType?2:1)].position,p=d[f].getApparentDifference(d[f].viewportMinimum,p),E=d[f].logarithmic?(1<p?Math.log(p)/d[f].conversionParameters.lnLogarithmBase*Math.abs(d[f].conversionParameters.pixelPerUnit):0)+d[f].lineCoordinates.x1:(0<p?p*Math.abs(d[f].conversionParameters.pixelPerUnit):0)+d[f].lineCoordinates.x1);for(f=0;f<q.length;f++)"axisY"===q[f].type&&(q[f].calculateValueToPixelConversionParameters(),q[f].calculateBreaksSizeInValues());if(0<y){if(a&&0<a.length)for(f=0;f<a.length;f++)u=
|
|
661
|
+
P[y-1][f]===P[y][f]?!0:!1;else u=!0;if(d&&0<d.length)for(f=0;f<d.length;f++)K=S[y-1][f]===S[y][f]?!0:!1;else K=!0;if(c&&0<c.length)for(f=0;f<c.length;f++)L=Q[y-1][f]===Q[y][f]?!0:!1;else L=!0;if(b&&0<b.length)for(f=0;f<b.length;f++)M=R[y-1][f]===R[y][f]?!0:!1;else M=!0}if(u&&K&&L&&M)break;y++}if(a&&0<a.length)for(f=0;f<a.length;f++)a[f].calculateStripLinesThicknessInValues(),a[f].calculateBreaksInPixels();if(d&&0<d.length)for(f=0;f<d.length;f++)d[f].calculateStripLinesThicknessInValues(),d[f].calculateBreaksInPixels();
|
|
662
|
+
if(c&&0<c.length)for(f=0;f<c.length;f++)c[f].calculateStripLinesThicknessInValues(),c[f].calculateBreaksInPixels();if(b&&0<b.length)for(f=0;f<b.length;f++)b[f].calculateStripLinesThicknessInValues(),b[f].calculateBreaksInPixels()}else{n=[];C=[];G=[];x=[];E=[];s=[];P=[];for(S=[];4>y;){Y=W=V=aa=O=X=e=R=Q=H=$=0;if(a&&0<a.length)for(G=[],f=W=0;f<a.length;f++)G.push(Math.ceil(a[f]?a[f].createLabelsAndCalculateWidth():0)),W+=G[f],e+=a[f]&&!m.isNavigator?a[f].margin:0;else G.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateWidth():
|
|
663
|
+
0));P.push(G);if(d&&0<d.length)for(x=[],f=Y=0;f<d.length;f++)x.push(Math.ceil(d[f]?d[f].createLabelsAndCalculateWidth():0)),Y+=x[f],X+=d[f]?d[f].margin:0;else x.push(Math.ceil(d[0]?d[0].createLabelsAndCalculateWidth():0));S.push(x);if(c&&0<c.length)for(f=0;f<c.length;f++)c[f].lineCoordinates={},p=Math.round(g.x1+W+e),l=Math.round(g.x2-Y-X>m.width-10?m.width-10:g.x2-Y-X),c[f].labelAutoFit&&!r(w)&&(0<!a.length&&(p=0>c[f].labelAngle?Math.max(p,w):0===c[f].labelAngle?Math.max(p,w/2):p),0<!d.length&&(l=
|
|
664
|
+
0<c[f].labelAngle?l-v/2:0===c[f].labelAngle?l-v/2:l)),c[f].lineCoordinates.x1=p,c[f].lineCoordinates.x2=l,c[f].lineCoordinates.width=Math.abs(l-p),c[f].title&&(c[f]._titleTextBlock.maxWidth=0<c[f].titleMaxWidth&&c[f].titleMaxWidth<c[f].lineCoordinates.width?c[f].titleMaxWidth:c[f].lineCoordinates.width);if(b&&0<b.length)for(f=0;f<b.length;f++)b[f].lineCoordinates={},p=Math.round(g.x1+W+e),l=Math.round(g.x2-Y-X>b[f].chart.width-10?b[f].chart.width-10:g.x2-Y-X),b[f]&&b[f].labelAutoFit&&!r(z)&&(0<!a.length&&
|
|
665
|
+
(p=0<b[f].labelAngle?Math.max(p,z):0===b[f].labelAngle?Math.max(p,z/2):p),0<!d.length&&(l-=B/2)),b[f].lineCoordinates.x1=p,b[f].lineCoordinates.x2=l,b[f].lineCoordinates.width=Math.abs(l-p),b[f].title&&(b[f]._titleTextBlock.maxWidth=0<b[f].titleMaxWidth&&b[f].titleMaxWidth<b[f].lineCoordinates.width?b[f].titleMaxWidth:b[f].lineCoordinates.width);if(c&&0<c.length)for(n=[],f=V=0;f<c.length;f++)n.push(Math.ceil(c[f]?c[f].createLabelsAndCalculateHeight():0)),V+=n[f]+c[f].margin,O+=c[f].margin;else n.push(Math.ceil(c[0]?
|
|
666
|
+
c[0].createLabelsAndCalculateHeight():0));E.push(n);if(b&&0<b.length)for(C=[],f=0;f<b.length;f++)C.push(Math.ceil(b[f]?b[f].createLabelsAndCalculateHeight():0)),aa+=b[f].margin;else C.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateHeight():0));s.push(C);if(c&&0<c.length)for(f=0;f<c.length;f++)0<c[f]._labels.length&&(k=c[f]._labels[0],h=c[f]._labels[c[f]._labels.length-1],w=k.textBlock.width*Math.cos(Math.PI/180*Math.abs(k.textBlock.angle))+(k.textBlock.height-h.textBlock.fontSize/2)*Math.sin(Math.PI/
|
|
667
|
+
180*Math.abs(k.textBlock.angle)),v=h.textBlock.width*Math.cos(Math.PI/180*Math.abs(h.textBlock.angle))+(h.textBlock.height-h.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(h.textBlock.angle)));if(b&&0<b.length)for(f=0;f<b.length;f++)b[f]&&0<b[f]._labels.length&&(k=b[f]._labels[0],h=b[f]._labels[b[f]._labels.length-1],z=k.textBlock.width*Math.cos(Math.PI/180*Math.abs(k.textBlock.angle))+(k.textBlock.height-h.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(k.textBlock.angle)),B=h.textBlock.width*
|
|
668
|
+
Math.cos(Math.PI/180*Math.abs(h.textBlock.angle))+(h.textBlock.height-h.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(h.textBlock.angle)));if(m.panEnabled)for(f=0;f<c.length;f++)n[f]=r(m.sessionVariables.axisY[f].height)?m.sessionVariables.axisY[f].height=n[f]:m.sessionVariables.axisY[f].height;else for(f=0;f<c.length;f++)m.sessionVariables.axisY[f].height=n[f];if(c&&0<c.length)for(f=c.length-1;0<=f;f--)h=Math.round(g.y2),k=Math.round(g.y2>c[f].chart.height?c[f].chart.height:g.y2),c[f].lineCoordinates.y1=
|
|
669
|
+
h-(n[f]+c[f].margin+$),c[f].lineCoordinates.y2=h-(n[f]+c[f].margin+$),"inside"===c[f].labelPlacement&&0<f&&(c[f].lineCoordinates.y1=c[f].lineCoordinates.y1+n[f]-(c[f]._titleTextBlock?c[f]._titleTextBlock.height:0)-c[f].tickLength-(c[f].stripLineLabelEffectiveHeight||0)-5,c[f].lineCoordinates.y2=c[f].lineCoordinates.y1+c[f].lineThickness/2),"inside"===c[f].tickPlacement&&0<f&&(c[f].lineCoordinates.y1+=c[f].tickLength,c[f].lineCoordinates.y2=c[f].lineCoordinates.y1+c[f].lineThickness/2),c[f].bounds=
|
|
670
|
+
{x1:p,y1:h-(n[f]+$+c[f].margin),x2:l,y2:k-($+c[f].margin),width:l-p,height:n[f]},c[f].title&&(c[f]._titleTextBlock.maxWidth=0<c[f].titleMaxWidth&&c[f].titleMaxWidth<c[f].lineCoordinates.width?c[f].titleMaxWidth:c[f].lineCoordinates.width),$+=n[f]+c[f].margin;if(b&&0<b.length)for(f=b.length-1;0<=f;f--)b[f]&&(h=Math.round(g.y1),k=Math.round(g.y1+(C[f]+b[f].margin+H)),b[f].lineCoordinates.y1=k,b[f].lineCoordinates.y2=k,"inside"===b[f].labelPlacement&&0<f&&(b[f].lineCoordinates.y1=k-C[f]+(b[f]._titleTextBlock?
|
|
671
|
+
b[f]._titleTextBlock.height:0)+b[f].tickLength+(b[f].stripLineLabelEffectiveHeight||0),b[f].lineCoordinates.y2=b[f].lineCoordinates.y1-b[f].lineThickness/2),"inside"===b[f].tickPlacement&&0<f&&(b[f].lineCoordinates.y1-=b[f].tickLength,b[f].lineCoordinates.y2=b[f].lineCoordinates.y1-b[f].lineThickness/2),b[f].bounds={x1:p,y1:h+(b[f].margin+H),x2:l,y2:k,width:l-p},b[f].bounds.height=b[f].bounds.y2-b[f].bounds.y1,b[f].title&&(b[f]._titleTextBlock.maxWidth=0<b[f].titleMaxWidth&&b[f].titleMaxWidth<b[f].lineCoordinates.width?
|
|
672
|
+
b[f].titleMaxWidth:b[f].lineCoordinates.width),H+=C[f]+b[f].margin);if(a&&0<a.length)for(f=0;f<a.length;f++){O=a[f]._labels&&0<a[f]._labels.length?a[f]._labels[0].textBlock.fontSize/2:0;p=Math.round(g.x1+e);h=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y2:g.y1<Math.max(O,10)?Math.max(O,10):g.y1):g.y1<Math.max(O,10)?Math.max(O,10):g.y1;l=Math.round(g.x1+W+e);k=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y1:g.y2-V>m.height-Math.max(O,10)?m.height-Math.max(O,10):g.y2-V):g.y2>m.height-Math.max(O,
|
|
673
|
+
10)?m.height-Math.max(O,10):g.y2;if(c&&0<c.length)for(O=0;O<c.length;O++)c[O]&&c[O].labelAutoFit&&(l=c[O].lineCoordinates.x1,p=0>c[O].labelAngle||0===c[O].labelAngle?l-W:p);if(b&&0<b.length)for(O=0;O<b.length;O++)b[O]&&b[O].labelAutoFit&&(l=b[O].lineCoordinates.x1,p=l-W);a[f].lineCoordinates={x1:l-Q,y1:h,x2:l-Q,y2:k,height:Math.abs(k-h)};"inside"===a[f].labelPlacement&&0<f&&(a[f].lineCoordinates.x1=a[f].lineCoordinates.x1-(G[f]-(a[f]._titleTextBlock?a[f]._titleTextBlock.height:0))+a[f].tickLength+
|
|
674
|
+
(a[f].stripLineLabelEffectiveWidth||0),a[f].lineCoordinates.x2=a[f].lineCoordinates.x1+a[f].lineThickness/2);"inside"===a[f].tickPlacement&&0<f&&(a[f].lineCoordinates.x1-=a[f].tickLength,a[f].lineCoordinates.x2=a[f].lineCoordinates.x1+a[f].lineThickness/2);a[f].bounds={x1:l-(G[f]+Q),y1:h,x2:l-Q,y2:k,height:k-h};a[f].bounds.width=a[f].bounds.x2-a[f].bounds.x1;a[f].title&&(a[f]._titleTextBlock.maxWidth=0<a[f].titleMaxWidth&&a[f].titleMaxWidth<a[f].lineCoordinates.height?a[f].titleMaxWidth:a[f].lineCoordinates.height);
|
|
675
|
+
a[f].calculateValueToPixelConversionParameters();a[f].calculateBreaksSizeInValues();Q+=G[f]+a[f].margin}if(d&&0<d.length)for(f=0;f<d.length;f++){O=d[f]._labels&&0<d[f]._labels.length?d[f]._labels[0].textBlock.fontSize/2:0;p=Math.round(g.x1-e);h=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y2:g.y1<Math.max(O,10)?Math.max(O,10):g.y1):g.y1<Math.max(O,10)?Math.max(O,10):g.y1;l=Math.round(g.x2-Y-X);k=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y1:g.y2-V>m.height-Math.max(O,10)?m.height-Math.max(O,
|
|
676
|
+
10):g.y2-V):g.y2>m.height-Math.max(O,10)?m.height-Math.max(O,10):g.y2;if(c&&0<c.length)for(O=0;O<c.length;O++)c[O]&&c[O].labelAutoFit&&(l=0>c[O].labelAngle?Math.max(l,w):0===c[O].labelAngle?Math.max(l,w/2):l,p=0>c[O].labelAngle||0===c[O].labelAngle?l-Y:p);if(b&&0<b.length)for(O=0;O<b.length;O++)b[O]&&b[O].labelAutoFit&&(l=b[O].lineCoordinates.x2,p=l-Y);d[f].lineCoordinates={x1:l+R,y1:h,x2:l+R,y2:k,height:Math.abs(k-h)};"inside"===d[f].labelPlacement&&0<f&&(d[f].lineCoordinates.x1=d[f].lineCoordinates.x1+
|
|
677
|
+
(x[f]-(d[f]._titleTextBlock?d[f]._titleTextBlock.height:0)-2)-d[f].tickLength-(d[f].stripLineLabelEffectiveWidth||0),d[f].lineCoordinates.x2=d[f].lineCoordinates.x1+d[f].lineThickness/2);"inside"===d[f].tickPlacement&&0<f&&(d[f].lineCoordinates.x1+=d[f].tickLength,d[f].lineCoordinates.x2=d[f].lineCoordinates.x1+d[f].lineThickness/2);d[f].bounds={x1:d[f].lineCoordinates.x1,y1:h,x2:l+x[f]+R,y2:k,width:l-p,height:k-h};d[f].bounds.width=d[f].bounds.x2-d[f].bounds.x1;d[f].title&&(d[f]._titleTextBlock.maxWidth=
|
|
678
|
+
0<d[f].titleMaxWidth&&d[f].titleMaxWidth<d[f].lineCoordinates.height?d[f].titleMaxWidth:d[f].lineCoordinates.height);d[f].calculateValueToPixelConversionParameters();d[f].calculateBreaksSizeInValues();R+=x[f]+d[f].margin}for(f=0;f<q.length;f++)"axisY"===q[f].type&&(q[f].calculateValueToPixelConversionParameters(),q[f].calculateBreaksSizeInValues());if(0<y){if(a&&0<a.length)for(f=0;f<a.length;f++)u=P[y-1][f]===P[y][f]?!0:!1;else u=!0;if(d&&0<d.length)for(f=0;f<d.length;f++)K=S[y-1][f]===S[y][f]?!0:
|
|
679
|
+
!1;else K=!0;if(c&&0<c.length)for(f=0;f<c.length;f++)L=E[y-1][f]===E[y][f]?!0:!1;else L=!0;if(b&&0<b.length)for(f=0;f<b.length;f++)M=s[y-1][f]===s[y][f]?!0:!1;else M=!0}if(u&&K&&L&&M)break;y++}if(c&&0<c.length)for(f=0;f<c.length;f++)c[f].calculateStripLinesThicknessInValues(),c[f].calculateBreaksInPixels();if(b&&0<b.length)for(f=0;f<b.length;f++)b[f].calculateStripLinesThicknessInValues(),b[f].calculateBreaksInPixels();if(a&&0<a.length)for(f=0;f<a.length;f++)a[f].calculateStripLinesThicknessInValues(),
|
|
680
|
+
a[f].calculateBreaksInPixels();if(d&&0<d.length)for(f=0;f<d.length;f++)d[f].calculateStripLinesThicknessInValues(),d[f].calculateBreaksInPixels()}};C.render=function(a,d,c,b,e){var g=a[0]?a[0].chart:d[0].chart;e=g.ctx;g.alignVerticalAxes&&g.alignVerticalAxes();e.save();e.beginPath();a&&a.length&&e.rect(5,a[0].bounds.y1,a[0].chart.width-10,a[a.length-1].bounds.y2);d&&d.length&&e.rect(5,d[d.length-1].bounds.y1,d[0].chart.width-10,d[0].bounds.y2);e.clip();if(a&&0<a.length)for(var h=0;h<a.length;h++)a[h].renderLabelsTicksAndTitle();
|
|
681
|
+
if(d&&0<d.length)for(h=0;h<d.length;h++)d[h].renderLabelsTicksAndTitle();e.restore();if(c&&0<c.length)for(h=0;h<c.length;h++)c[h].renderLabelsTicksAndTitle();if(b&&0<b.length)for(h=0;h<b.length;h++)b[h].renderLabelsTicksAndTitle();g.preparePlotArea();g=g.plotArea;e.save();e.beginPath();e.rect(g.x1,g.y1,Math.abs(g.x2-g.x1),Math.abs(g.y2-g.y1));e.clip();if(a&&0<a.length)for(h=0;h<a.length;h++)a[h].renderStripLinesOfThicknessType("value");if(d&&0<d.length)for(h=0;h<d.length;h++)d[h].renderStripLinesOfThicknessType("value");
|
|
682
|
+
if(c&&0<c.length)for(h=0;h<c.length;h++)c[h].renderStripLinesOfThicknessType("value");if(b&&0<b.length)for(h=0;h<b.length;h++)b[h].renderStripLinesOfThicknessType("value");if(a&&0<a.length)for(h=0;h<a.length;h++)a[h].renderInterlacedColors();if(d&&0<d.length)for(h=0;h<d.length;h++)d[h].renderInterlacedColors();if(c&&0<c.length)for(h=0;h<c.length;h++)c[h].renderInterlacedColors();if(b&&0<b.length)for(h=0;h<b.length;h++)b[h].renderInterlacedColors();e.restore();if(a&&0<a.length)for(h=0;h<a.length;h++)a[h].renderGrid(),
|
|
683
|
+
u&&(a[h].createMask(),a[h].renderBreaksBackground());if(d&&0<d.length)for(h=0;h<d.length;h++)d[h].renderGrid(),u&&(d[h].createMask(),d[h].renderBreaksBackground());if(c&&0<c.length)for(h=0;h<c.length;h++)c[h].renderGrid(),u&&(c[h].createMask(),c[h].renderBreaksBackground());if(b&&0<b.length)for(h=0;h<b.length;h++)b[h].renderGrid(),u&&(b[h].createMask(),b[h].renderBreaksBackground());if(a&&0<a.length)for(h=0;h<a.length;h++)a[h].renderAxisLine();if(d&&0<d.length)for(h=0;h<d.length;h++)d[h].renderAxisLine();
|
|
684
|
+
if(c&&0<c.length)for(h=0;h<c.length;h++)c[h].renderAxisLine();if(b&&0<b.length)for(h=0;h<b.length;h++)b[h].renderAxisLine();if(a&&0<a.length)for(h=0;h<a.length;h++)a[h].renderStripLinesOfThicknessType("pixel");if(d&&0<d.length)for(h=0;h<d.length;h++)d[h].renderStripLinesOfThicknessType("pixel");if(c&&0<c.length)for(h=0;h<c.length;h++)c[h].renderStripLinesOfThicknessType("pixel");if(b&&0<b.length)for(h=0;h<b.length;h++)b[h].renderStripLinesOfThicknessType("pixel")};C.prototype.calculateStripLinesThicknessInValues=
|
|
685
|
+
function(){for(var a=0;a<this.stripLines.length;a++)if(null!==this.stripLines[a].startValue&&null!==this.stripLines[a].endValue){var d=Math.min(this.stripLines[a].startValue,this.stripLines[a].endValue),c=Math.max(this.stripLines[a].startValue,this.stripLines[a].endValue),b=this.getApparentDifference(d,c);this.stripLines[a].value=this.convertPixelToValue(Math.abs(this.convertValueToPixel(d)+this.convertValueToPixel(c))/2);this.stripLines[a].thickness=b;this.stripLines[a]._thicknessType="value"}};
|
|
686
|
+
C.prototype.calculateBreaksSizeInValues=function(){for(var a="left"===this._position||"right"===this._position?this.lineCoordinates.height||this.chart.height:this.lineCoordinates.width||this.chart.width,d=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],c=this.conversionParameters.pixelPerUnit||a/(this.logarithmic?this.conversionParameters.maximum/this.conversionParameters.minimum:this.conversionParameters.maximum-this.conversionParameters.minimum),b=this.scaleBreaks&&!r(this.scaleBreaks.options.spacing),
|
|
687
|
+
e,g=0;g<d.length;g++)e=b||!r(d[g].options.spacing),d[g].spacing=Ua(d[g].spacing,a,8,e?0.1*a:8,e?0:3)<<0,d[g].size=0>d[g].spacing?0:Math.abs(d[g].spacing/c),this.logarithmic&&(d[g].size=Math.pow(this.logarithmBase,d[g].size))};C.prototype.calculateBreaksInPixels=function(){if(!(this.scaleBreaks&&0>=this.scaleBreaks._appliedBreaks.length)){var a=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[];a.length&&(this.scaleBreaks.firstBreakIndex=this.scaleBreaks.lastBreakIndex=null);for(var d=0;d<a.length&&
|
|
688
|
+
!(a[d].startValue>this.conversionParameters.maximum);d++)a[d].endValue<this.conversionParameters.minimum||(r(this.scaleBreaks.firstBreakIndex)&&(this.scaleBreaks.firstBreakIndex=d),a[d].startValue>=this.conversionParameters.minimum&&(a[d].startPixel=this.convertValueToPixel(a[d].startValue),this.scaleBreaks.lastBreakIndex=d),a[d].endValue<=this.conversionParameters.maximum&&(a[d].endPixel=this.convertValueToPixel(a[d].endValue)))}};C.prototype.renderLabelsTicksAndTitle=function(){var a=this,d=!1,
|
|
689
|
+
c=0,b=0,e=1,g=0;0!==this.labelAngle&&360!==this.labelAngle&&(e=1.2);if("undefined"===typeof this.options.interval){if("bottom"===this._position||"top"===this._position)if(this.logarithmic&&!this.equidistantInterval&&this.labelAutoFit){for(var c=[],e=0!==this.labelAngle&&360!==this.labelAngle?1:1.2,h,l=this.viewportMaximum,r=this.lineCoordinates.width/Math.log(this.range),k=this._labels.length-1;0<=k;k--){n=this._labels[k];if(n.position<this.viewportMinimum)break;n.position>this.viewportMaximum||!(k===
|
|
690
|
+
this._labels.length-1||h<Math.log(l/n.position)*r/e)||(c.push(n),l=n.position,h=n.textBlock.width*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+n.textBlock.height*Math.abs(Math.sin(Math.PI/180*this.labelAngle)))}this._labels=c}else{for(k=0;k<this._labels.length;k++)n=this._labels[k],n.position<this.viewportMinimum||(h=n.textBlock.width*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+n.textBlock.height*Math.abs(Math.sin(Math.PI/180*this.labelAngle)),c+=h);c>this.lineCoordinates.width*e&&this.labelAutoFit&&
|
|
691
|
+
(d=!0)}if("left"===this._position||"right"===this._position)if(this.logarithmic&&!this.equidistantInterval&&this.labelAutoFit){for(var c=[],m,l=this.viewportMaximum,r=this.lineCoordinates.height/Math.log(this.range),k=this._labels.length-1;0<=k;k--){n=this._labels[k];if(n.position<this.viewportMinimum)break;n.position>this.viewportMaximum||!(k===this._labels.length-1||m<Math.log(l/n.position)*r)||(c.push(n),l=n.position,m=n.textBlock.height*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+n.textBlock.width*
|
|
692
|
+
Math.abs(Math.sin(Math.PI/180*this.labelAngle)))}this._labels=c}else{for(k=0;k<this._labels.length;k++)n=this._labels[k],n.position<this.viewportMinimum||(m=n.textBlock.height*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+n.textBlock.width*Math.abs(Math.sin(Math.PI/180*this.labelAngle)),b+=m);b>this.lineCoordinates.height*e&&this.labelAutoFit&&(d=!0)}}this.logarithmic&&(!this.equidistantInterval&&this.labelAutoFit)&&this._labels.sort(function(a,b){return a.position-b.position});var k=0,n,q;if("bottom"===
|
|
693
|
+
this._position){for(k=0;k<this._labels.length;k++)n=this._labels[k],n.position<this.viewportMinimum||n.position>this.viewportMaximum||(q=this.getPixelCoordinatesOnAxis(n.position),this.tickThickness&&"inside"!=this.tickPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,b=1===this.ctx.lineWidth%2?(q.x<<0)+0.5:q.x<<0,this.ctx.beginPath(),this.ctx.moveTo(b,q.y<<0),this.ctx.lineTo(b,q.y+this.tickLength<<0),this.ctx.stroke()),d&&0!==g++%2&&this.labelAutoFit||(0===n.textBlock.angle?
|
|
694
|
+
(q.x-=n.textBlock.width/2,q.y="inside"===this.labelPlacement?q.y-(("inside"===this.tickPlacement?this.tickLength:0)+n.textBlock.height-n.textBlock.fontSize/2):q.y+("inside"===this.tickPlacement?0:this.tickLength)+n.textBlock.fontSize/2+5):(q.x="inside"===this.labelPlacement?0>this.labelAngle?q.x:q.x-n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):q.x-(0>this.labelAngle?n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0),q.y="inside"===this.labelPlacement?0>this.labelAngle?q.y-("inside"===
|
|
695
|
+
this.tickPlacement?this.tickLength:0)-5:q.y-("inside"===this.tickPlacement?this.tickLength:0)-Math.abs(n.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)+5):q.y+("inside"===this.tickPlacement?0:this.tickLength)+Math.abs(0>this.labelAngle?n.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)-5:5)),n.textBlock.x=q.x,n.textBlock.y=q.y));"inside"===this.tickPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(k=0;k<a._labels.length;k++)if(n=a._labels[k],!(n.position<
|
|
696
|
+
a.viewportMinimum||n.position>a.viewportMaximum)&&(q=a.getPixelCoordinatesOnAxis(n.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===a.ctx.lineWidth%2?(q.x<<0)+0.5:q.x<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(b,q.y<<0);a.ctx.lineTo(b,q.y-a.tickLength<<0);a.ctx.stroke();a.ctx.restore()}},this);this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+this.lineCoordinates.width/2-this._titleTextBlock.width/
|
|
697
|
+
2,this._titleTextBlock.y=this.bounds.y2-this._titleTextBlock.height+this._titleTextBlock.fontSize/2-1,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("top"===this._position){for(k=0;k<this._labels.length;k++)n=this._labels[k],n.position<this.viewportMinimum||n.position>this.viewportMaximum||(q=this.getPixelCoordinatesOnAxis(n.position),this.tickThickness&&"inside"!=this.tickPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,
|
|
698
|
+
b=1===this.ctx.lineWidth%2?(q.x<<0)+0.5:q.x<<0,this.ctx.beginPath(),this.ctx.moveTo(b,q.y<<0),this.ctx.lineTo(b,q.y-this.tickLength<<0),this.ctx.stroke()),d&&0!==g++%2&&this.labelAutoFit||(0===n.textBlock.angle?(q.x-=n.textBlock.width/2,q.y="inside"===this.labelPlacement?q.y+this.labelFontSize/2+("inside"===this.tickPlacement?this.tickLength:0)+5:q.y-(("inside"===this.tickPlacement?0:this.tickLength)+n.textBlock.height-n.textBlock.fontSize/2)):(q.x="inside"===this.labelPlacement?0<this.labelAngle?
|
|
699
|
+
q.x:q.x-n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):q.x+(n.textBlock.height-this.labelFontSize)*Math.sin(Math.PI/180*this.labelAngle)-(0<this.labelAngle?n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0),q.y="inside"===this.labelPlacement?0<this.labelAngle?q.y+("inside"===this.tickPlacement?this.tickLength:0)+5:q.y-n.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)+("inside"===this.tickPlacement?this.tickLength:0)+5:q.y-(("inside"===this.tickPlacement?0:this.tickLength)+((n.textBlock.height-
|
|
700
|
+
n.textBlock.fontSize/2)*Math.cos(Math.PI/180*this.labelAngle)+(0<this.labelAngle?n.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0)))),n.textBlock.x=q.x,n.textBlock.y=q.y));"inside"===this.tickPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(k=0;k<a._labels.length;k++)if(n=a._labels[k],!(n.position<a.viewportMinimum||n.position>a.viewportMaximum)&&(q=a.getPixelCoordinatesOnAxis(n.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=
|
|
701
|
+
a.tickColor;var b=1===a.ctx.lineWidth%2?(q.x<<0)+0.5:q.x<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(b,q.y<<0);a.ctx.lineTo(b,q.y+a.tickLength<<0);a.ctx.stroke();a.ctx.restore()}},this);this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+this.lineCoordinates.width/2-this._titleTextBlock.width/2,this._titleTextBlock.y=this.bounds.y1+this._titleTextBlock.fontSize/2+1,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("left"===
|
|
702
|
+
this._position){for(k=0;k<this._labels.length;k++)n=this._labels[k],n.position<this.viewportMinimum||n.position>this.viewportMaximum||(q=this.getPixelCoordinatesOnAxis(n.position),this.tickThickness&&"inside"!=this.tickPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,b=1===this.ctx.lineWidth%2?(q.y<<0)+0.5:q.y<<0,this.ctx.beginPath(),this.ctx.moveTo(q.x<<0,b),this.ctx.lineTo(q.x-this.tickLength<<0,b),this.ctx.stroke()),d&&0!==g++%2&&this.labelAutoFit||(0===this.labelAngle?
|
|
703
|
+
(n.textBlock.y=q.y,n.textBlock.x="inside"===this.labelPlacement?q.x+("inside"===this.tickPlacement?this.tickLength:0)+5:q.x-n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-("inside"===this.tickPlacement?0:this.tickLength)-5):(n.textBlock.y="inside"===this.labelPlacement?q.y:q.y-n.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),n.textBlock.x="inside"===this.labelPlacement?q.x+("inside"===this.tickPlacement?this.tickLength:0)+5:0<this.labelAngle?q.x-n.textBlock.width*Math.cos(Math.PI/
|
|
704
|
+
180*this.labelAngle)-("inside"===this.tickPlacement?0:this.tickLength)-5:q.x-n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+(n.textBlock.height-n.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)-("inside"===this.tickPlacement?0:this.tickLength))));"inside"===this.tickPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(k=0;k<a._labels.length;k++)if(n=a._labels[k],!(n.position<a.viewportMinimum||n.position>a.viewportMaximum)&&(q=a.getPixelCoordinatesOnAxis(n.position),
|
|
705
|
+
a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===a.ctx.lineWidth%2?(q.y<<0)+0.5:q.y<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(q.x<<0,b);a.ctx.lineTo(q.x+a.tickLength<<0,b);a.ctx.stroke();a.ctx.restore()}},this);this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.bounds.x1+this._titleTextBlock.fontSize/2+1,this._titleTextBlock.y=this.lineCoordinates.height/2+this._titleTextBlock.width/2+this.lineCoordinates.y1,this.titleMaxWidth=
|
|
706
|
+
this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("right"===this._position){for(k=0;k<this._labels.length;k++)n=this._labels[k],n.position<this.viewportMinimum||n.position>this.viewportMaximum||(q=this.getPixelCoordinatesOnAxis(n.position),this.tickThickness&&"inside"!=this.tickPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,b=1===this.ctx.lineWidth%2?(q.y<<0)+0.5:q.y<<0,this.ctx.beginPath(),this.ctx.moveTo(q.x<<0,b),this.ctx.lineTo(q.x+this.tickLength<<
|
|
707
|
+
0,b),this.ctx.stroke()),d&&0!==g++%2&&this.labelAutoFit||(0===this.labelAngle?(n.textBlock.y=q.y,n.textBlock.x="inside"===this.labelPlacement?q.x-n.textBlock.width-("inside"===this.tickPlacement?this.tickLength:0)-5:q.x+("inside"===this.tickPlacement?0:this.tickLength)+5):(n.textBlock.y="inside"===this.labelPlacement?q.y-n.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0>this.labelAngle?q.y:q.y-(n.textBlock.height-n.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),n.textBlock.x=
|
|
708
|
+
"inside"===this.labelPlacement?q.x-n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-("inside"===this.tickPlacement?this.tickLength:0)-5:0<this.labelAngle?q.x+(n.textBlock.height-n.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)+("inside"===this.tickPlacement?0:this.tickLength):q.x+("inside"===this.tickPlacement?0:this.tickLength)+5)));"inside"===this.tickPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(k=0;k<a._labels.length;k++)if(n=a._labels[k],
|
|
709
|
+
!(n.position<a.viewportMinimum||n.position>a.viewportMaximum)&&(q=a.getPixelCoordinatesOnAxis(n.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===a.ctx.lineWidth%2?(q.y<<0)+0.5:q.y<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(q.x<<0,b);a.ctx.lineTo(q.x-a.tickLength<<0,b);a.ctx.stroke();a.ctx.restore()}},this);this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.bounds.x2-this._titleTextBlock.fontSize/2-1,this._titleTextBlock.y=
|
|
710
|
+
this.lineCoordinates.height/2-this._titleTextBlock.width/2+this.lineCoordinates.y1,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}g=0;if("inside"===this.labelPlacement)this.chart.addEventListener("dataAnimationIterationEnd",function(){for(k=0;k<a._labels.length;k++)n=a._labels[k],n.position<a.viewportMinimum||(n.position>a.viewportMaximum||d&&0!==g++%2&&a.labelAutoFit)||(a.ctx.save(),a.ctx.beginPath(),n.textBlock.render(!0),a.ctx.restore())},this);else for(k=0;k<
|
|
711
|
+
this._labels.length;k++)n=this._labels[k],n.position<this.viewportMinimum||(n.position>this.viewportMaximum||d&&0!==g++%2&&this.labelAutoFit)||n.textBlock.render(!0)};C.prototype.renderInterlacedColors=function(){var a=this.chart.plotArea.ctx,d,c,b=this.chart.plotArea,e=0;d=!0;if(("bottom"===this._position||"top"===this._position)&&this.interlacedColor)for(a.fillStyle=this.interlacedColor,e=0;e<this._labels.length;e++)d?(d=this.getPixelCoordinatesOnAxis(this._labels[e].position),c=e+1>this._labels.length-
|
|
712
|
+
1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[e+1].position),a.fillRect(Math.min(c.x,d.x),b.y1,Math.abs(c.x-d.x),Math.abs(b.y1-b.y2)),d=!1):d=!0;else if(("left"===this._position||"right"===this._position)&&this.interlacedColor)for(a.fillStyle=this.interlacedColor,e=0;e<this._labels.length;e++)d?(c=this.getPixelCoordinatesOnAxis(this._labels[e].position),d=e+1>this._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[e+
|
|
713
|
+
1].position),a.fillRect(b.x1,Math.min(c.y,d.y),Math.abs(b.x1-b.x2),Math.abs(d.y-c.y)),d=!1):d=!0;a.beginPath()};C.prototype.renderStripLinesOfThicknessType=function(a){if(this.stripLines&&0<this.stripLines.length&&a){var d=this,c,b,e=0,g=0,h=!1;b=!1;for(var l=[],u=[],k=!1,e=0;e<this.stripLines.length;e++){var m=this.stripLines[e];m._thicknessType===a&&("pixel"===a&&(m.value<this.viewportMinimum||m.value>this.viewportMaximum||r(m.value)||isNaN(this.range))||"value"===a&&(m.startValue<=this.viewportMinimum&&
|
|
714
|
+
m.endValue<=this.viewportMinimum||m.startValue>=this.viewportMaximum&&m.endValue>=this.viewportMaximum||r(m.startValue)||r(m.endValue)||isNaN(this.range))||l.push(m))}for(e=0;e<this._stripLineLabels.length;e++)if(m=this.stripLines[e],c=this._stripLineLabels[e],!(c.position<this.viewportMinimum||c.position>this.viewportMaximum||isNaN(this.range)))if(b=this.getPixelCoordinatesOnAxis(c.position),"outside"===c.stripLine.labelPlacement){m&&(this.ctx.strokeStyle=m.color,this.ctx.lineWidth="pixel"===m._thicknessType?
|
|
715
|
+
m.thickness:this.tickThickness);if("bottom"===this._position){var n=1===this.ctx.lineWidth%2?(b.x<<0)+0.5:b.x<<0;this.ctx.beginPath();this.ctx.moveTo(n,b.y<<0);this.ctx.lineTo(n,b.y+this.tickLength<<0);this.ctx.stroke();0===this.labelAngle?(b.x-=c.textBlock.width/2,b.y+=this.tickLength+c.textBlock.fontSize/2+5):(b.x-=0>this.labelAngle?c.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,b.y+=this.tickLength+Math.abs(0>this.labelAngle?c.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)-5:
|
|
716
|
+
5))}else"top"===this._position?(n=1===this.ctx.lineWidth%2?(b.x<<0)+0.5:b.x<<0,this.ctx.beginPath(),this.ctx.moveTo(n,b.y<<0),this.ctx.lineTo(n,b.y-this.tickLength<<0),this.ctx.stroke(),0===this.labelAngle?(b.x-=c.textBlock.width/2,b.y-=this.tickLength+c.textBlock.height-c.textBlock.fontSize/2):(b.x+=(c.textBlock.height-this.tickLength-this.labelFontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-(0<this.labelAngle?c.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0),b.y-=this.tickLength+(c.textBlock.height*
|
|
717
|
+
Math.cos(Math.PI/180*this.labelAngle)+(0<this.labelAngle?c.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0)))):"left"===this._position?(n=1===this.ctx.lineWidth%2?(b.y<<0)+0.5:b.y<<0,this.ctx.beginPath(),this.ctx.moveTo(b.x<<0,n),this.ctx.lineTo(b.x-this.tickLength<<0,n),this.ctx.stroke(),0===this.labelAngle?b.x=b.x-c.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5:(b.y-=c.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),b.x=0<this.labelAngle?b.x-c.textBlock.width*
|
|
718
|
+
Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5:b.x-c.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+(c.textBlock.height-c.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)-this.tickLength)):"right"===this._position&&(n=1===this.ctx.lineWidth%2?(b.y<<0)+0.5:b.y<<0,this.ctx.beginPath(),this.ctx.moveTo(b.x<<0,n),this.ctx.lineTo(b.x+this.tickLength<<0,n),this.ctx.stroke(),0===this.labelAngle?b.x=b.x+this.tickLength+5:(b.y=0>this.labelAngle?b.y:b.y-(c.textBlock.height-c.textBlock.fontSize/
|
|
719
|
+
2-5)*Math.cos(Math.PI/180*this.labelAngle),b.x=0<this.labelAngle?b.x+(c.textBlock.height-c.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)+this.tickLength:b.x+this.tickLength+5));c.textBlock.x=b.x;c.textBlock.y=b.y;u.push(c)}else m._thicknessType===a&&(c.textBlock.angle=-90,"bottom"===this._position?(c.textBlock.maxWidth=this.options.stripLines[e].labelMaxWidth?this.options.stripLines[e].labelMaxWidth:this.chart.plotArea.height-3,c.textBlock.measureText(),b.x-c.textBlock.height-m.thickness/
|
|
720
|
+
2>this.chart.plotArea.x1?r(m.startValue)?b.x-=c.textBlock.height-c.textBlock.fontSize/2+m.thickness/2:b.x-=c.textBlock.height/2-c.textBlock.fontSize/2:(c.textBlock.angle=90,r(m.startValue)?b.x+=c.textBlock.height-c.textBlock.fontSize/2+m.thickness/2:b.x+=c.textBlock.height/2-c.textBlock.fontSize/2),b.y=-90===c.textBlock.angle?"near"===c.stripLine.labelAlign?this.chart.plotArea.y2-3:"center"===c.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+c.textBlock.width)/2:this.chart.plotArea.y1+
|
|
721
|
+
c.textBlock.width+3:"near"===c.stripLine.labelAlign?this.chart.plotArea.y2-c.textBlock.width-3:"center"===c.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-c.textBlock.width)/2:this.chart.plotArea.y1+3):"top"===this._position?(c.textBlock.maxWidth=this.options.stripLines[e].labelMaxWidth?this.options.stripLines[e].labelMaxWidth:this.chart.plotArea.height-3,c.textBlock.measureText(),b.x-c.textBlock.height-m.thickness/2>this.chart.plotArea.x1?r(m.startValue)?b.x-=c.textBlock.height-
|
|
722
|
+
c.textBlock.fontSize/2+m.thickness/2:b.x-=c.textBlock.height/2-c.textBlock.fontSize/2:(c.textBlock.angle=90,r(m.startValue)?b.x+=c.textBlock.height-c.textBlock.fontSize/2+m.thickness/2:b.x+=c.textBlock.height/2-c.textBlock.fontSize/2),b.y=-90===c.textBlock.angle?"near"===c.stripLine.labelAlign?this.chart.plotArea.y1+c.textBlock.width+3:"center"===c.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+c.textBlock.width)/2:this.chart.plotArea.y2-3:"near"===c.stripLine.labelAlign?this.chart.plotArea.y1+
|
|
723
|
+
3:"center"===c.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-c.textBlock.width)/2:this.chart.plotArea.y2-c.textBlock.width-3):"left"===this._position?(c.textBlock.maxWidth=this.options.stripLines[e].labelMaxWidth?this.options.stripLines[e].labelMaxWidth:this.chart.plotArea.width-3,c.textBlock.angle=0,c.textBlock.measureText(),b.y-c.textBlock.height-m.thickness/2>this.chart.plotArea.y1?r(m.startValue)?b.y-=c.textBlock.height-c.textBlock.fontSize/2+m.thickness/2:b.y-=c.textBlock.height/
|
|
724
|
+
2-c.textBlock.fontSize/2:r(m.startValue)?b.y+=c.textBlock.height-c.textBlock.fontSize/2+m.thickness/2:b.y+=c.textBlock.height/2-c.textBlock.fontSize+3,b.x="near"===c.stripLine.labelAlign?this.chart.plotArea.x1+3:"center"===c.stripLine.labelAlign?(this.chart.plotArea.x2+this.chart.plotArea.x1)/2-c.textBlock.width/2:this.chart.plotArea.x2-c.textBlock.width-3):"right"===this._position&&(c.textBlock.maxWidth=this.options.stripLines[e].labelMaxWidth?this.options.stripLines[e].labelMaxWidth:this.chart.plotArea.width-
|
|
725
|
+
3,c.textBlock.angle=0,c.textBlock.measureText(),b.y-c.textBlock.height-m.thickness/2>this.chart.plotArea.y1?r(m.startValue)?b.y-=c.textBlock.height-c.textBlock.fontSize/2+m.thickness/2:b.y-=c.textBlock.height/2-c.textBlock.fontSize/2:r(m.startValue)?b.y+=c.textBlock.height-c.textBlock.fontSize/2+m.thickness/2:b.y-=c.textBlock.height/2-c.textBlock.fontSize/2+3,b.x="near"===c.stripLine.labelAlign?this.chart.plotArea.x2-c.textBlock.width-3:"center"===c.stripLine.labelAlign?(this.chart.plotArea.x2+this.chart.plotArea.x1)/
|
|
726
|
+
2-c.textBlock.width/2:this.chart.plotArea.x1+3),c.textBlock.x=b.x,c.textBlock.y=b.y,u.push(c));if(!k){b=!1;this.ctx.save();this.ctx.beginPath();this.ctx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.ctx.clip();for(e=0;e<l.length;e++)m=l[e],m.showOnTop?h||(h=!0,this.chart.addEventListener("dataAnimationIterationEnd",function(){this.ctx.save();this.ctx.beginPath();this.ctx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,
|
|
727
|
+
this.chart.plotArea.height);this.ctx.clip();for(g=0;g<l.length;g++)m=l[g],m.showOnTop&&m.render();this.ctx.restore()},m)):m.render();for(e=0;e<u.length;e++)c=u[e],c.stripLine.showOnTop?b||(b=!0,this.chart.addEventListener("dataAnimationIterationEnd",function(){for(g=0;g<u.length;g++)c=u[g],"inside"===c.stripLine.labelPlacement&&c.stripLine.showOnTop&&(d.ctx.save(),d.ctx.beginPath(),d.ctx.rect(d.chart.plotArea.x1,d.chart.plotArea.y1,d.chart.plotArea.width,d.chart.plotArea.height),d.ctx.clip(),c.textBlock.render(!0),
|
|
728
|
+
d.ctx.restore())},c.textBlock)):"inside"===c.stripLine.labelPlacement&&c.textBlock.render(!0);this.ctx.restore();k=!0}if(k)for(b=!1,e=0;e<u.length;e++)c=u[e],"outside"===c.stripLine.labelPlacement&&c.textBlock.render(!0)}};C.prototype.renderBreaksBackground=function(){this.chart._breaksCanvas&&(this.scaleBreaks&&0<this.scaleBreaks._appliedBreaks.length&&this.maskCanvas)&&(this.chart._breaksCanvasCtx.save(),this.chart._breaksCanvasCtx.beginPath(),this.chart._breaksCanvasCtx.rect(this.chart.plotArea.x1,
|
|
729
|
+
this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height),this.chart._breaksCanvasCtx.clip(),this.chart._breaksCanvasCtx.drawImage(this.maskCanvas,0,0,this.chart.width,this.chart.height),this.chart._breaksCanvasCtx.restore())};C.prototype.createMask=function(){if(this.scaleBreaks&&0<this.scaleBreaks._appliedBreaks.length){var a=this.scaleBreaks._appliedBreaks;u?(this.maskCanvas=va(this.chart.width,this.chart.height),this.maskCtx=this.maskCanvas.getContext("2d")):(this.maskCanvas=
|
|
730
|
+
this.chart.plotArea.canvas,this.maskCtx=this.chart.plotArea.ctx);this.maskCtx.save();this.maskCtx.beginPath();this.maskCtx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.maskCtx.clip();for(var d=0;d<a.length;d++)a[d].endValue<this.viewportMinimum||(a[d].startValue>this.viewportMaximum||isNaN(this.range))||a[d].render(this.maskCtx);this.maskCtx.restore()}};C.prototype.renderCrosshair=function(a,d){isFinite(this.minimum)&&isFinite(this.maximum)&&
|
|
731
|
+
this.crosshair.render(a,d)};C.prototype.showCrosshair=function(a){r(a)||(a<this.viewportMinimum||a>this.viewportMaximum)||("top"===this._position||"bottom"===this._position?this.crosshair.render(this.convertValueToPixel(a),null,a):this.crosshair.render(null,this.convertValueToPixel(a),a))};C.prototype.renderGrid=function(){if(this.gridThickness&&0<this.gridThickness){var a=this.chart.ctx;a.save();var d,c=this.chart.plotArea;a.lineWidth=this.gridThickness;a.strokeStyle=this.gridColor;a.setLineDash&&
|
|
732
|
+
a.setLineDash(K(this.gridDashType,this.gridThickness));if("bottom"===this._position||"top"===this._position)for(b=0;b<this._labels.length;b++)this._labels[b].position<this.viewportMinimum||(this._labels[b].position>this.viewportMaximum||this._labels[b].breaksLabelType)||(a.beginPath(),d=this.getPixelCoordinatesOnAxis(this._labels[b].position),d=1===a.lineWidth%2?(d.x<<0)+0.5:d.x<<0,a.moveTo(d,c.y1<<0),a.lineTo(d,c.y2<<0),a.stroke());else if("left"===this._position||"right"===this._position)for(var b=
|
|
733
|
+
0;b<this._labels.length;b++)this._labels[b].position<this.viewportMinimum||(this._labels[b].position>this.viewportMaximum||this._labels[b].breaksLabelType)||(a.beginPath(),d=this.getPixelCoordinatesOnAxis(this._labels[b].position),d=1===a.lineWidth%2?(d.y<<0)+0.5:d.y<<0,a.moveTo(c.x1<<0,d),a.lineTo(c.x2<<0,d),a.stroke());a.restore()}};C.prototype.renderAxisLine=function(){var a=this.chart.ctx,d=u?this.chart._preRenderCtx:a,c=Math.ceil(this.tickThickness/(this.reversed?-2:2)),b=Math.ceil(this.tickThickness/
|
|
734
|
+
(this.reversed?2:-2)),e,g;d.save();if("bottom"===this._position||"top"===this._position){if(this.lineThickness){this.reversed?(e=this.lineCoordinates.x2,g=this.lineCoordinates.x1):(e=this.lineCoordinates.x1,g=this.lineCoordinates.x2);d.lineWidth=this.lineThickness;d.strokeStyle=this.lineColor?this.lineColor:"black";d.setLineDash&&d.setLineDash(K(this.lineDashType,this.lineThickness));var h=1===this.lineThickness%2?(this.lineCoordinates.y1<<0)+0.5:this.lineCoordinates.y1<<0;d.beginPath();if(this.scaleBreaks&&
|
|
735
|
+
!r(this.scaleBreaks.firstBreakIndex))if(r(this.scaleBreaks.lastBreakIndex))e=this.scaleBreaks._appliedBreaks[this.scaleBreaks.firstBreakIndex].endPixel+b;else for(var l=this.scaleBreaks.firstBreakIndex;l<=this.scaleBreaks.lastBreakIndex;l++)d.moveTo(e,h),d.lineTo(this.scaleBreaks._appliedBreaks[l].startPixel+c,h),e=this.scaleBreaks._appliedBreaks[l].endPixel+b;e&&(d.moveTo(e,h),d.lineTo(g,h));d.stroke()}}else if(("left"===this._position||"right"===this._position)&&this.lineThickness){this.reversed?
|
|
736
|
+
(e=this.lineCoordinates.y1,g=this.lineCoordinates.y2):(e=this.lineCoordinates.y2,g=this.lineCoordinates.y1);d.lineWidth=this.lineThickness;d.strokeStyle=this.lineColor;d.setLineDash&&d.setLineDash(K(this.lineDashType,this.lineThickness));h=1===this.lineThickness%2?(this.lineCoordinates.x1<<0)+0.5:this.lineCoordinates.x1<<0;d.beginPath();if(this.scaleBreaks&&!r(this.scaleBreaks.firstBreakIndex))if(r(this.scaleBreaks.lastBreakIndex))e=this.scaleBreaks._appliedBreaks[this.scaleBreaks.firstBreakIndex].endPixel+
|
|
737
|
+
c;else for(l=this.scaleBreaks.firstBreakIndex;l<=this.scaleBreaks.lastBreakIndex;l++)d.moveTo(h,e),d.lineTo(h,this.scaleBreaks._appliedBreaks[l].startPixel+b),e=this.scaleBreaks._appliedBreaks[l].endPixel+c;e&&(d.moveTo(h,e),d.lineTo(h,g));d.stroke()}u&&(a.drawImage(this.chart._preRenderCanvas,0,0,this.chart.width,this.chart.height),this.chart._breaksCanvasCtx&&this.chart._breaksCanvasCtx.drawImage(this.chart._preRenderCanvas,0,0,this.chart.width,this.chart.height),d.clearRect(0,0,this.chart.width,
|
|
738
|
+
this.chart.height));d.restore()};C.prototype.getPixelCoordinatesOnAxis=function(a){var d={};if("bottom"===this._position||"top"===this._position)d.x=this.convertValueToPixel(a),d.y=this.lineCoordinates.y1;if("left"===this._position||"right"===this._position)d.y=this.convertValueToPixel(a),d.x=this.lineCoordinates.x2;return d};C.prototype.convertPixelToValue=function(a){if("undefined"===typeof a)return null;var d=0,c=0,b,d=!0,e=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],c="number"===typeof a?
|
|
739
|
+
a:"left"===this._position||"right"===this._position?a.y:a.x;if(this.logarithmic){a=b=Math.pow(this.logarithmBase,(c-this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit);if(c<=this.conversionParameters.reference===("left"===this._position||"right"===this._position)!==this.reversed)for(c=0;c<e.length;c++){if(!(e[c].endValue<this.conversionParameters.minimum))if(d)if(e[c].startValue<this.conversionParameters.minimum){if(1<e[c].size&&this.conversionParameters.minimum*Math.pow(e[c].endValue/
|
|
740
|
+
e[c].startValue,Math.log(b)/Math.log(e[c].size))<e[c].endValue){a=Math.pow(e[c].endValue/e[c].startValue,Math.log(b)/Math.log(e[c].size));break}else a*=e[c].endValue/this.conversionParameters.minimum/Math.pow(e[c].size,Math.log(e[c].endValue/this.conversionParameters.minimum)/Math.log(e[c].endValue/e[c].startValue)),b/=Math.pow(e[c].size,Math.log(e[c].endValue/this.conversionParameters.minimum)/Math.log(e[c].endValue/e[c].startValue));d=!1}else if(b>e[c].startValue/this.conversionParameters.minimum){b/=
|
|
741
|
+
e[c].startValue/this.conversionParameters.minimum;if(b<e[c].size){a*=Math.pow(e[c].endValue/e[c].startValue,1===e[c].size?1:Math.log(b)/Math.log(e[c].size))/b;break}else a*=e[c].endValue/e[c].startValue/e[c].size;b/=e[c].size;d=!1}else break;else if(b>e[c].startValue/e[c-1].endValue){b/=e[c].startValue/e[c-1].endValue;if(b<e[c].size){a*=Math.pow(e[c].endValue/e[c].startValue,1===e[c].size?1:Math.log(b)/Math.log(e[c].size))/b;break}else a*=e[c].endValue/e[c].startValue/e[c].size;b/=e[c].size}else break}else for(c=
|
|
742
|
+
e.length-1;0<=c;c--)if(!(e[c].startValue>this.conversionParameters.minimum))if(d)if(e[c].endValue>this.conversionParameters.minimum){if(1<e[c].size&&this.conversionParameters.minimum*Math.pow(e[c].endValue/e[c].startValue,Math.log(b)/Math.log(e[c].size))>e[c].startValue){a=Math.pow(e[c].endValue/e[c].startValue,Math.log(b)/Math.log(e[c].size));break}else a*=e[c].startValue/this.conversionParameters.minimum*Math.pow(e[c].size,Math.log(e[c].startValue/this.conversionParameters.minimum)/Math.log(e[c].endValue/
|
|
743
|
+
e[c].startValue))*b,b*=Math.pow(e[c].size,Math.log(this.conversionParameters.minimum/e[c].startValue)/Math.log(e[c].endValue/e[c].startValue));d=!1}else if(b<e[c].endValue/this.conversionParameters.minimum){b/=e[c].endValue/this.conversionParameters.minimum;if(b>1/e[c].size){a*=Math.pow(e[c].endValue/e[c].startValue,1>=e[c].size?1:Math.log(b)/Math.log(e[c].size))*b;break}else a/=e[c].endValue/e[c].startValue/e[c].size;b*=e[c].size;d=!1}else break;else if(b<e[c].endValue/e[c+1].startValue){b/=e[c].endValue/
|
|
744
|
+
e[c+1].startValue;if(b>1/e[c].size){a*=Math.pow(e[c].endValue/e[c].startValue,1>=e[c].size?1:Math.log(b)/Math.log(e[c].size))*b;break}else a/=e[c].endValue/e[c].startValue/e[c].size;b*=e[c].size}else break;d=a*this.viewportMinimum}else{a=b=(c-this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit;if(c<=this.conversionParameters.reference===("left"===this._position||"right"===this._position)!==this.reversed)for(c=0;c<e.length;c++){if(!(e[c].endValue<this.conversionParameters.minimum))if(d)if(e[c].startValue<
|
|
745
|
+
this.conversionParameters.minimum){if(e[c].size&&this.conversionParameters.minimum+b*(e[c].endValue-e[c].startValue)/e[c].size<e[c].endValue){a=0>=e[c].size?0:b*(e[c].endValue-e[c].startValue)/e[c].size;break}else a+=e[c].endValue-this.conversionParameters.minimum-e[c].size*(e[c].endValue-this.conversionParameters.minimum)/(e[c].endValue-e[c].startValue),b-=e[c].size*(e[c].endValue-this.conversionParameters.minimum)/(e[c].endValue-e[c].startValue);d=!1}else if(b>e[c].startValue-this.conversionParameters.minimum){b-=
|
|
746
|
+
e[c].startValue-this.conversionParameters.minimum;if(b<e[c].size){a+=(e[c].endValue-e[c].startValue)*(0===e[c].size?1:b/e[c].size)-b;break}else a+=e[c].endValue-e[c].startValue-e[c].size;b-=e[c].size;d=!1}else break;else if(b>e[c].startValue-e[c-1].endValue){b-=e[c].startValue-e[c-1].endValue;if(b<e[c].size){a+=(e[c].endValue-e[c].startValue)*(0===e[c].size?1:b/e[c].size)-b;break}else a+=e[c].endValue-e[c].startValue-e[c].size;b-=e[c].size}else break}else for(c=e.length-1;0<=c;c--)if(!(e[c].startValue>
|
|
747
|
+
this.conversionParameters.minimum))if(d)if(e[c].endValue>this.conversionParameters.minimum)if(e[c].size&&this.conversionParameters.minimum+b*(e[c].endValue-e[c].startValue)/e[c].size>e[c].startValue){a=0>=e[c].size?0:b*(e[c].endValue-e[c].startValue)/e[c].size;break}else a+=e[c].startValue-this.conversionParameters.minimum+e[c].size*(this.conversionParameters.minimum-e[c].startValue)/(e[c].endValue-e[c].startValue),b+=e[c].size*(this.conversionParameters.minimum-e[c].startValue)/(e[c].endValue-e[c].startValue),
|
|
748
|
+
d=!1;else if(b<e[c].endValue-this.conversionParameters.minimum){b-=e[c].endValue-this.conversionParameters.minimum;if(b>-1*e[c].size){a+=(e[c].endValue-e[c].startValue)*(0===e[c].size?1:b/e[c].size)+b;break}else a-=e[c].endValue-e[c].startValue-e[c].size;b+=e[c].size;d=!1}else break;else if(b<e[c].endValue-e[c+1].startValue){b-=e[c].endValue-e[c+1].startValue;if(b>-1*e[c].size){a+=(e[c].endValue-e[c].startValue)*(0===e[c].size?1:b/e[c].size)+b;break}else a-=e[c].endValue-e[c].startValue-e[c].size;
|
|
749
|
+
b+=e[c].size}else break;d=this.conversionParameters.minimum+a}return d};C.prototype.convertValueToPixel=function(a){a=this.getApparentDifference(this.conversionParameters.minimum,a,a);return this.logarithmic?this.conversionParameters.reference+this.conversionParameters.pixelPerUnit*Math.log(a/this.conversionParameters.minimum)/this.conversionParameters.lnLogarithmBase+0.5<<0:"axisX"===this.type?this.conversionParameters.reference+this.conversionParameters.pixelPerUnit*(a-this.conversionParameters.minimum)+
|
|
750
|
+
0.5<<0:this.conversionParameters.reference+this.conversionParameters.pixelPerUnit*(a-this.conversionParameters.minimum)+0.5};C.prototype.getApparentDifference=function(a,d,c,b){var e=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[];if(this.logarithmic){c=r(c)?d/a:c;for(var g=0;g<e.length&&!(d<e[g].startValue);g++)a>e[g].endValue||(a<=e[g].startValue&&d>=e[g].endValue?c=c/e[g].endValue*e[g].startValue*e[g].size:a>=e[g].startValue&&d>=e[g].endValue?c=c/e[g].endValue*a*Math.pow(e[g].size,Math.log(e[g].endValue/
|
|
751
|
+
a)/Math.log(e[g].endValue/e[g].startValue)):a<=e[g].startValue&&d<=e[g].endValue?c=c/d*e[g].startValue*Math.pow(e[g].size,Math.log(d/e[g].startValue)/Math.log(e[g].endValue/e[g].startValue)):!b&&(a>e[g].startValue&&d<e[g].endValue)&&(c=a*Math.pow(e[g].size,Math.log(d/a)/Math.log(e[g].endValue/e[g].startValue))))}else for(c=r(c)?Math.abs(d-a):c,g=0;g<e.length&&!(d<e[g].startValue);g++)a>e[g].endValue||(a<=e[g].startValue&&d>=e[g].endValue?c=c-e[g].endValue+e[g].startValue+e[g].size:a>e[g].startValue&&
|
|
752
|
+
d>=e[g].endValue?c=c-e[g].endValue+a+e[g].size*(e[g].endValue-a)/(e[g].endValue-e[g].startValue):a<=e[g].startValue&&d<e[g].endValue?c=c-d+e[g].startValue+e[g].size*(d-e[g].startValue)/(e[g].endValue-e[g].startValue):!b&&(a>e[g].startValue&&d<e[g].endValue)&&(c=a+e[g].size*(d-a)/(e[g].endValue-e[g].startValue)));return c};C.prototype.setViewPortRange=function(a,d){this.sessionVariables.newViewportMinimum=this.viewportMinimum=Math.min(a,d);this.sessionVariables.newViewportMaximum=this.viewportMaximum=
|
|
753
|
+
Math.max(a,d)};C.prototype.getXValueAt=function(a){if(!a)return null;var d=null;"left"===this._position?d=this.convertPixelToValue(a.y):"bottom"===this._position&&(d=this.convertPixelToValue(a.x));return d};C.prototype.calculateValueToPixelConversionParameters=function(a){a=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[];var d={pixelPerUnit:null,minimum:null,reference:null},c=this.lineCoordinates.width,b=this.lineCoordinates.height,c="bottom"===this._position||"top"===this._position?c:b,b=Math.abs(this.range);
|
|
754
|
+
if(this.logarithmic)for(var e=0;e<a.length&&!(this.viewportMaximum<a[e].startValue);e++)this.viewportMinimum>a[e].endValue||(this.viewportMinimum>=a[e].startValue&&this.viewportMaximum<=a[e].endValue?c=0:this.viewportMinimum<=a[e].startValue&&this.viewportMaximum>=a[e].endValue?(b=b/a[e].endValue*a[e].startValue,c=0<a[e].spacing.toString().indexOf("%")?c*(1-parseFloat(a[e].spacing)/100):c-Math.min(a[e].spacing,0.1*c)):this.viewportMinimum>a[e].startValue&&this.viewportMaximum>=a[e].endValue?(b=b/
|
|
755
|
+
a[e].endValue*this.viewportMinimum,c=0<a[e].spacing.toString().indexOf("%")?c*(1-parseFloat(a[e].spacing)/100*Math.log(a[e].endValue/this.viewportMinimum)/Math.log(a[e].endValue/a[e].startValue)):c-Math.min(a[e].spacing,0.1*c)*Math.log(a[e].endValue/this.viewportMinimum)/Math.log(a[e].endValue/a[e].startValue)):this.viewportMinimum<=a[e].startValue&&this.viewportMaximum<a[e].endValue&&(b=b/this.viewportMaximum*a[e].startValue,c=0<a[e].spacing.toString().indexOf("%")?c*(1-parseFloat(a[e].spacing)/
|
|
756
|
+
100*Math.log(this.viewportMaximum/a[e].startValue)/Math.log(a[e].endValue/a[e].startValue)):c-Math.min(a[e].spacing,0.1*c)*Math.log(this.viewportMaximum/a[e].startValue)/Math.log(a[e].endValue/a[e].startValue)));else for(e=0;e<a.length&&!(this.viewportMaximum<a[e].startValue);e++)this.viewportMinimum>a[e].endValue||(this.viewportMinimum>=a[e].startValue&&this.viewportMaximum<=a[e].endValue?c=0:this.viewportMinimum<=a[e].startValue&&this.viewportMaximum>=a[e].endValue?(b=b-a[e].endValue+a[e].startValue,
|
|
757
|
+
c=0<a[e].spacing.toString().indexOf("%")?c*(1-parseFloat(a[e].spacing)/100):c-Math.min(a[e].spacing,0.1*c)):this.viewportMinimum>a[e].startValue&&this.viewportMaximum>=a[e].endValue?(b=b-a[e].endValue+this.viewportMinimum,c=0<a[e].spacing.toString().indexOf("%")?c*(1-parseFloat(a[e].spacing)/100*(a[e].endValue-this.viewportMinimum)/(a[e].endValue-a[e].startValue)):c-Math.min(a[e].spacing,0.1*c)*(a[e].endValue-this.viewportMinimum)/(a[e].endValue-a[e].startValue)):this.viewportMinimum<=a[e].startValue&&
|
|
758
|
+
this.viewportMaximum<a[e].endValue&&(b=b-this.viewportMaximum+a[e].startValue,c=0<a[e].spacing.toString().indexOf("%")?c*(1-parseFloat(a[e].spacing)/100*(this.viewportMaximum-a[e].startValue)/(a[e].endValue-a[e].startValue)):c-Math.min(a[e].spacing,0.1*c)*(this.viewportMaximum-a[e].startValue)/(a[e].endValue-a[e].startValue)));d.minimum=this.viewportMinimum;d.maximum=this.viewportMaximum;d.range=b;if("bottom"===this._position||"top"===this._position)this.logarithmic?(d.lnLogarithmBase=Math.log(this.logarithmBase),
|
|
759
|
+
d.pixelPerUnit=(this.reversed?-1:1)*c*d.lnLogarithmBase/Math.log(Math.abs(b))):d.pixelPerUnit=(this.reversed?-1:1)*c/Math.abs(b),d.reference=this.reversed?this.lineCoordinates.x2:this.lineCoordinates.x1;if("left"===this._position||"right"===this._position)this.logarithmic?(d.lnLogarithmBase=Math.log(this.logarithmBase),d.pixelPerUnit=(this.reversed?1:-1)*c*d.lnLogarithmBase/Math.log(Math.abs(b))):d.pixelPerUnit=(this.reversed?1:-1)*c/Math.abs(b),d.reference=this.reversed?this.lineCoordinates.y1:this.lineCoordinates.y2;
|
|
760
|
+
this.conversionParameters=d};C.prototype.calculateAxisParameters=function(){if(this.logarithmic)this.calculateLogarithmicAxisParameters();else{var a=this.chart.layoutManager.getFreeSpace(),d=!1,c=!1;"bottom"===this._position||"top"===this._position?(this.maxWidth=a.width,this.maxHeight=a.height):(this.maxWidth=a.height,this.maxHeight=a.width);var a="axisX"===this.type?"xySwapped"===this.chart.plotInfo.axisPlacement?62:70:"xySwapped"===this.chart.plotInfo.axisPlacement?50:40,b=4;"axisX"===this.type&&
|
|
761
|
+
(b=600>this.maxWidth?8:6);var a=Math.max(b,Math.floor(this.maxWidth/a)),e,g,h,b=0;!r(this.options.viewportMinimum)&&(!r(this.options.viewportMaximum)&&this.options.viewportMinimum>=this.options.viewportMaximum)&&(this.viewportMinimum=this.viewportMaximum=null);if(r(this.options.viewportMinimum)&&!r(this.sessionVariables.newViewportMinimum)&&!isNaN(this.sessionVariables.newViewportMinimum))this.viewportMinimum=this.sessionVariables.newViewportMinimum;else if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=
|
|
762
|
+
this.minimum;if(r(this.options.viewportMaximum)&&!r(this.sessionVariables.newViewportMaximum)&&!isNaN(this.sessionVariables.newViewportMaximum))this.viewportMaximum=this.sessionVariables.newViewportMaximum;else if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum;if(this.scaleBreaks)for(b=0;b<this.scaleBreaks._appliedBreaks.length;b++)if((!r(this.sessionVariables.newViewportMinimum)&&this.sessionVariables.newViewportMinimum>=this.scaleBreaks._appliedBreaks[b].startValue||
|
|
763
|
+
!r(this.options.minimum)&&this.options.minimum>=this.scaleBreaks._appliedBreaks[b].startValue||!r(this.options.viewportMinimum)&&this.viewportMinimum>=this.scaleBreaks._appliedBreaks[b].startValue)&&(!r(this.sessionVariables.newViewportMaximum)&&this.sessionVariables.newViewportMaximum<=this.scaleBreaks._appliedBreaks[b].endValue||!r(this.options.maximum)&&this.options.maximum<=this.scaleBreaks._appliedBreaks[b].endValue||!r(this.options.viewportMaximum)&&this.viewportMaximum<=this.scaleBreaks._appliedBreaks[b].endValue)){this.scaleBreaks._appliedBreaks.splice(b,
|
|
764
|
+
1);break}if("axisX"===this.type){if(this.dataSeries&&0<this.dataSeries.length)for(e=0;e<this.dataSeries.length;e++)"dateTime"===this.dataSeries[e].xValueType&&(c=!0);e=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin;g=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax;0===g-e&&(b="undefined"===typeof this.options.interval?0.4:this.options.interval,g+=b,e-=b);Infinity!==this.dataInfo.minDiff?h=this.dataInfo.minDiff:1<g-e?h=0.5*Math.abs(g-e):(h=1,c&&
|
|
765
|
+
(d=!0))}else"axisY"===this.type&&(e=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,g=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,isFinite(e)||isFinite(g)?isFinite(e)?isFinite(g)||(g=e):e=g:(g="undefined"===typeof this.options.interval?-Infinity:this.options.interval,e="undefined"!==typeof this.options.interval||isFinite(this.dataInfo.minDiff)?0:Infinity),0===e&&0===g?(g+=9,e=0):0===g-e?(b=Math.min(Math.abs(0.01*Math.abs(g)),5),g+=b,e-=b):
|
|
766
|
+
e>g?(b=Math.min(0.01*Math.abs(this.getApparentDifference(g,e,null,!0)),5),0<=g?e=g-b:g=isFinite(e)?e+b:0):(b=Math.min(0.01*Math.abs(this.getApparentDifference(e,g,null,!0)),0.05),0!==g&&(g+=b),0!==e&&(e-=b)),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1<g-e?0.5*Math.abs(g-e):1,this.includeZero&&(null===this.viewportMinimum||isNaN(this.viewportMinimum))&&0<e&&(e=0),this.includeZero&&(null===this.viewportMaximum||isNaN(this.viewportMaximum))&&0>g&&(g=0));b=this.getApparentDifference(isNaN(this.viewportMinimum)||
|
|
767
|
+
null===this.viewportMinimum?e:this.viewportMinimum,isNaN(this.viewportMaximum)||null===this.viewportMaximum?g:this.viewportMaximum,null,!0);if("axisX"===this.type&&c){this.valueType="dateTime";this.intervalType||(b/1<=a?(this.interval=1,this.intervalType="millisecond"):b/2<=a?(this.interval=2,this.intervalType="millisecond"):b/5<=a?(this.interval=5,this.intervalType="millisecond"):b/10<=a?(this.interval=10,this.intervalType="millisecond"):b/20<=a?(this.interval=20,this.intervalType="millisecond"):
|
|
768
|
+
b/50<=a?(this.interval=50,this.intervalType="millisecond"):b/100<=a?(this.interval=100,this.intervalType="millisecond"):b/200<=a?(this.interval=200,this.intervalType="millisecond"):b/250<=a?(this.interval=250,this.intervalType="millisecond"):b/300<=a?(this.interval=300,this.intervalType="millisecond"):b/400<=a?(this.interval=400,this.intervalType="millisecond"):b/500<=a?(this.interval=500,this.intervalType="millisecond"):b/(1*V.secondDuration)<=a?(this.interval=1,this.intervalType="second"):b/(2*
|
|
769
|
+
V.secondDuration)<=a?(this.interval=2,this.intervalType="second"):b/(5*V.secondDuration)<=a?(this.interval=5,this.intervalType="second"):b/(10*V.secondDuration)<=a?(this.interval=10,this.intervalType="second"):b/(15*V.secondDuration)<=a?(this.interval=15,this.intervalType="second"):b/(20*V.secondDuration)<=a?(this.interval=20,this.intervalType="second"):b/(30*V.secondDuration)<=a?(this.interval=30,this.intervalType="second"):b/(1*V.minuteDuration)<=a?(this.interval=1,this.intervalType="minute"):b/
|
|
770
|
+
(2*V.minuteDuration)<=a?(this.interval=2,this.intervalType="minute"):b/(5*V.minuteDuration)<=a?(this.interval=5,this.intervalType="minute"):b/(10*V.minuteDuration)<=a?(this.interval=10,this.intervalType="minute"):b/(15*V.minuteDuration)<=a?(this.interval=15,this.intervalType="minute"):b/(20*V.minuteDuration)<=a?(this.interval=20,this.intervalType="minute"):b/(30*V.minuteDuration)<=a?(this.interval=30,this.intervalType="minute"):b/(1*V.hourDuration)<=a?(this.interval=1,this.intervalType="hour"):b/
|
|
771
|
+
(2*V.hourDuration)<=a?(this.interval=2,this.intervalType="hour"):b/(3*V.hourDuration)<=a?(this.interval=3,this.intervalType="hour"):b/(6*V.hourDuration)<=a?(this.interval=6,this.intervalType="hour"):b/(1*V.dayDuration)<=a?(this.interval=1,this.intervalType="day"):b/(2*V.dayDuration)<=a?(this.interval=2,this.intervalType="day"):b/(4*V.dayDuration)<=a?(this.interval=4,this.intervalType="day"):b/(1*V.weekDuration)<=a?(this.interval=1,this.intervalType="week"):b/(2*V.weekDuration)<=a?(this.interval=2,
|
|
772
|
+
this.intervalType="week"):b/(3*V.weekDuration)<=a?(this.interval=3,this.intervalType="week"):b/(1*V.monthDuration)<=a?(this.interval=1,this.intervalType="month"):b/(2*V.monthDuration)<=a?(this.interval=2,this.intervalType="month"):b/(3*V.monthDuration)<=a?(this.interval=3,this.intervalType="month"):b/(6*V.monthDuration)<=a?(this.interval=6,this.intervalType="month"):(this.interval=b/(1*V.yearDuration)<=a?1:b/(2*V.yearDuration)<=a?2:b/(4*V.yearDuration)<=a?4:Math.floor(C.getNiceNumber(b/(a-1),!0)/
|
|
773
|
+
V.yearDuration),this.intervalType="year"));if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=e-h/2;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=g+h/2;d?this.autoValueFormatString="MMM DD YYYY HH:mm":"year"===this.intervalType?this.autoValueFormatString="YYYY":"month"===this.intervalType?this.autoValueFormatString="MMM YYYY":"week"===this.intervalType?this.autoValueFormatString="MMM DD YYYY":"day"===this.intervalType?this.autoValueFormatString=
|
|
774
|
+
"MMM DD YYYY":"hour"===this.intervalType?this.autoValueFormatString="hh:mm TT":"minute"===this.intervalType?this.autoValueFormatString="hh:mm TT":"second"===this.intervalType?this.autoValueFormatString="hh:mm:ss TT":"millisecond"===this.intervalType&&(this.autoValueFormatString="fff'ms'");this.valueFormatString||(this.valueFormatString=this.autoValueFormatString)}else{this.intervalType="number";b=C.getNiceNumber(b,!1);this.interval=this.options&&0<this.options.interval?this.options.interval:C.getNiceNumber(b/
|
|
775
|
+
(a-1),!0);if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum="axisX"===this.type?e-h/2:Math.floor(e/this.interval)*this.interval;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum="axisX"===this.type?g+h/2:Math.ceil(g/this.interval)*this.interval;0===this.viewportMaximum&&0===this.viewportMinimum&&(0===this.options.viewportMinimum?this.viewportMaximum+=10:0===this.options.viewportMaximum&&(this.viewportMinimum-=10),this.options&&"undefined"===
|
|
776
|
+
typeof this.options.interval&&(this.interval=C.getNiceNumber((this.viewportMaximum-this.viewportMinimum)/(a-1),!0)))}if(null===this.minimum||null===this.maximum)if("axisX"===this.type?(e=null!==this.minimum?this.minimum:this.dataInfo.min,g=null!==this.maximum?this.maximum:this.dataInfo.max,0===g-e&&(b="undefined"===typeof this.options.interval?0.4:this.options.interval,g+=b,e-=b),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1<g-e?0.5*Math.abs(g-e):1):"axisY"===this.type&&(e=null!==this.minimum?
|
|
777
|
+
this.minimum:this.dataInfo.min,g=null!==this.maximum?this.maximum:this.dataInfo.max,isFinite(e)||isFinite(g)?0===e&&0===g?(g+=9,e=0):0===g-e?(b=Math.min(Math.abs(0.01*Math.abs(g)),5),g+=b,e-=b):e>g?(b=Math.min(0.01*Math.abs(this.getApparentDifference(g,e,null,!0)),5),0<=g?e=g-b:g=isFinite(e)?e+b:0):(b=Math.min(0.01*Math.abs(this.getApparentDifference(e,g,null,!0)),0.05),0!==g&&(g+=b),0!==e&&(e-=b)):(g="undefined"===typeof this.options.interval?-Infinity:this.options.interval,e="undefined"!==typeof this.options.interval||
|
|
778
|
+
isFinite(this.dataInfo.minDiff)?0:Infinity),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1<g-e?0.5*Math.abs(g-e):1,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&0<e&&(e=0),this.includeZero&&(null===this.maximum||isNaN(this.maximum))&&0>g&&(g=0)),Math.abs(this.getApparentDifference(e,g,null,!0)),"axisX"===this.type&&c){this.valueType="dateTime";if(null===this.minimum||isNaN(this.minimum))this.minimum=e-h/2,this.minimum=Math.min(this.minimum,null===this.sessionVariables.viewportMinimum||
|
|
779
|
+
isNaN(this.sessionVariables.viewportMinimum)?Infinity:this.sessionVariables.viewportMinimum);if(null===this.maximum||isNaN(this.maximum))this.maximum=g+h/2,this.maximum=Math.max(this.maximum,null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?-Infinity:this.sessionVariables.viewportMaximum)}else this.intervalType=this.valueType="number",null===this.minimum&&(this.minimum="axisX"===this.type?e-h/2:Math.floor(e/this.interval)*this.interval,this.minimum=Math.min(this.minimum,
|
|
780
|
+
null===this.sessionVariables.viewportMinimum||isNaN(this.sessionVariables.viewportMinimum)?Infinity:this.sessionVariables.viewportMinimum)),null===this.maximum&&(this.maximum="axisX"===this.type?g+h/2:Math.ceil(g/this.interval)*this.interval,this.maximum=Math.max(this.maximum,null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?-Infinity:this.sessionVariables.viewportMaximum)),0===this.maximum&&0===this.minimum&&(0===this.options.minimum?this.maximum+=10:0===
|
|
781
|
+
this.options.maximum&&(this.minimum-=10));r(this.sessionVariables.newViewportMinimum)&&(this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum));r(this.sessionVariables.newViewportMaximum)&&(this.viewportMaximum=Math.min(this.viewportMaximum,this.maximum));this.range=this.viewportMaximum-this.viewportMinimum;this.intervalStartPosition="axisX"===this.type&&c?this.getLabelStartPoint(new Date(this.viewportMinimum),this.intervalType,this.interval):Math.floor((this.viewportMinimum+0.2*this.interval)/
|
|
782
|
+
this.interval)*this.interval;this.valueFormatString||(this.valueFormatString=C.generateValueFormatString(this.range,2))}};C.prototype.calculateLogarithmicAxisParameters=function(){var a=this.chart.layoutManager.getFreeSpace(),d=Math.log(this.logarithmBase),c;"bottom"===this._position||"top"===this._position?(this.maxWidth=a.width,this.maxHeight=a.height):(this.maxWidth=a.height,this.maxHeight=a.width);var a="axisX"===this.type?500>this.maxWidth?7:Math.max(7,Math.floor(this.maxWidth/100)):Math.max(Math.floor(this.maxWidth/
|
|
783
|
+
50),3),b,e,g,h;h=1;if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=this.minimum;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum;if(this.scaleBreaks)for(h=0;h<this.scaleBreaks._appliedBreaks.length;h++)if((!r(this.sessionVariables.newViewportMinimum)&&this.sessionVariables.newViewportMinimum>=this.scaleBreaks._appliedBreaks[h].startValue||!r(this.options.minimum)&&this.options.minimum>=this.scaleBreaks._appliedBreaks[h].startValue||
|
|
784
|
+
!r(this.options.viewportMinimum)&&this.viewportMinimum>=this.scaleBreaks._appliedBreaks[h].startValue)&&(!r(this.sessionVariables.newViewportMaximum)&&this.sessionVariables.newViewportMaximum<=this.scaleBreaks._appliedBreaks[h].endValue||!r(this.options.maximum)&&this.options.maximum<=this.scaleBreaks._appliedBreaks[h].endValue||!r(this.options.viewportMaximum)&&this.viewportMaximum<=this.scaleBreaks._appliedBreaks[h].endValue)){this.scaleBreaks._appliedBreaks.splice(h,1);break}"axisX"===this.type?
|
|
785
|
+
(b=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,e=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,1===e/b&&(h=Math.pow(this.logarithmBase,"undefined"===typeof this.options.interval?0.4:this.options.interval),e*=h,b/=h),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:e/b>this.logarithmBase?e/b*Math.pow(this.logarithmBase,0.5):this.logarithmBase):"axisY"===this.type&&(b=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,
|
|
786
|
+
e=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,0>=b&&!isFinite(e)?(e="undefined"===typeof this.options.interval?0:this.options.interval,b=1):0>=b?b=e:isFinite(e)||(e=b),1===b&&1===e?(e*=this.logarithmBase-1/this.logarithmBase,b=1):1===e/b?(h=Math.min(e*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),e*=h,b/=h):b>e?(h=Math.min(b/e*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),1<=e?b=e/h:e=b*h):(h=Math.min(e/b*Math.pow(this.logarithmBase,
|
|
787
|
+
0.01),Math.pow(this.logarithmBase,0.04)),1!==e&&(e*=h),1!==b&&(b/=h)),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:e/b>this.logarithmBase?e/b*Math.pow(this.logarithmBase,0.5):this.logarithmBase,this.includeZero&&(null===this.viewportMinimum||isNaN(this.viewportMinimum))&&1<b&&(b=1),this.includeZero&&(null===this.viewportMaximum||isNaN(this.viewportMaximum))&&1>e&&(e=1));h=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?e:this.viewportMaximum)/(isNaN(this.viewportMinimum)||null===
|
|
788
|
+
this.viewportMinimum?b:this.viewportMinimum);var l=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?e:this.viewportMaximum)-(isNaN(this.viewportMinimum)||null===this.viewportMinimum?b:this.viewportMinimum);this.intervalType="number";h=Math.pow(this.logarithmBase,C.getNiceNumber(Math.abs(Math.log(h)/d),!1));this.options&&0<this.options.interval?this.interval=this.options.interval:(this.interval=C.getNiceExponent(Math.log(h)/d/(a-1),!0),c=C.getNiceNumber(l/(a-1),!0));if(null===this.viewportMinimum||
|
|
789
|
+
isNaN(this.viewportMinimum))this.viewportMinimum="axisX"===this.type?b/Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.floor(Math.log(b)/d/this.interval));if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum="axisX"===this.type?e*Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.ceil(Math.log(e)/d/this.interval));1===this.viewportMaximum&&1===this.viewportMinimum&&(1===this.options.viewportMinimum?this.viewportMaximum*=this.logarithmBase-1/this.logarithmBase:
|
|
790
|
+
1===this.options.viewportMaximum&&(this.viewportMinimum/=this.logarithmBase-1/this.logarithmBase),this.options&&"undefined"===typeof this.options.interval&&(this.interval=C.getNiceExponent(Math.ceil(Math.log(h)/d)/(a-1)),c=C.getNiceNumber((this.viewportMaximum-this.viewportMinimum)/(a-1),!0)));if(null===this.minimum||null===this.maximum)"axisX"===this.type?(b=null!==this.minimum?this.minimum:this.dataInfo.min,e=null!==this.maximum?this.maximum:this.dataInfo.max,1===e/b&&(h=Math.pow(this.logarithmBase,
|
|
791
|
+
"undefined"===typeof this.options.interval?0.4:this.options.interval),e*=h,b/=h),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:e/b>this.logarithmBase?e/b*Math.pow(this.logarithmBase,0.5):this.logarithmBase):"axisY"===this.type&&(b=null!==this.minimum?this.minimum:this.dataInfo.min,e=null!==this.maximum?this.maximum:this.dataInfo.max,isFinite(b)||isFinite(e)?1===b&&1===e?(e*=this.logarithmBase,b/=this.logarithmBase):1===e/b?(h=Math.pow(this.logarithmBase,this.interval),e*=h,b/=h):b>e?(h=
|
|
792
|
+
Math.min(0.01*(b/e),5),1<=e?b=e/h:e=b*h):(h=Math.min(e/b*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==e&&(e*=h),1!==b&&(b/=h)):(e="undefined"===typeof this.options.interval?0:this.options.interval,b=1),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:e/b>this.logarithmBase?e/b*Math.pow(this.logarithmBase,0.5):this.logarithmBase,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&1<b&&(b=1),this.includeZero&&(null===this.maximum||isNaN(this.maximum))&&
|
|
793
|
+
1>e&&(e=1)),this.intervalType="number",null===this.minimum&&(this.minimum="axisX"===this.type?b/Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.floor(Math.log(b)/d/this.interval)),r(null===this.sessionVariables.viewportMinimum||isNaN(this.sessionVariables.viewportMinimum)?"undefined"===typeof this.sessionVariables.newViewportMinimum?Infinity:this.sessionVariables.newViewportMinimum:this.sessionVariables.viewportMinimum)||(this.minimum=Math.min(this.minimum,null===this.sessionVariables.viewportMinimum||
|
|
794
|
+
isNaN(this.sessionVariables.viewportMinimum)?"undefined"===typeof this.sessionVariables.newViewportMinimum?Infinity:this.sessionVariables.newViewportMinimum:this.sessionVariables.viewportMinimum))),null===this.maximum&&(this.maximum="axisX"===this.type?e*Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.ceil(Math.log(e)/d/this.interval)),r(null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?"undefined"===typeof this.sessionVariables.newViewportMaximum?
|
|
795
|
+
0:this.sessionVariables.newViewportMaximum:this.sessionVariables.viewportMaximum)||(this.maximum=Math.max(this.maximum,null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?"undefined"===typeof this.sessionVariables.newViewportMaximum?0:this.sessionVariables.newViewportMaximum:this.sessionVariables.viewportMaximum))),1===this.maximum&&1===this.minimum&&(1===this.options.minimum?this.maximum*=this.logarithmBase-1/this.logarithmBase:1===this.options.maximum&&(this.minimum/=
|
|
796
|
+
this.logarithmBase-1/this.logarithmBase));this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum);this.viewportMaximum=Math.min(this.viewportMaximum,this.maximum);this.viewportMinimum>this.viewportMaximum&&(!this.options.viewportMinimum&&!this.options.minimum||this.options.viewportMaximum||this.options.maximum?this.options.viewportMinimum||this.options.minimum||!this.options.viewportMaximum&&!this.options.maximum||(this.viewportMinimum=this.minimum=(this.options.viewportMaximum||this.options.maximum)/
|
|
797
|
+
Math.pow(this.logarithmBase,2*Math.ceil(this.interval))):this.viewportMaximum=this.maximum=this.options.viewportMinimum||this.options.minimum);b=Math.pow(this.logarithmBase,Math.floor(Math.log(this.viewportMinimum)/(d*this.interval)+0.2)*this.interval);this.range=this.viewportMaximum/this.viewportMinimum;this.noTicks=a;if(!this.options.interval&&this.range<Math.pow(this.logarithmBase,8>this.viewportMaximum||3>a?2:3)){for(d=Math.floor(this.viewportMinimum/c+0.5)*c;d<this.viewportMinimum;)d+=c;this.equidistantInterval=
|
|
798
|
+
!1;this.intervalStartPosition=d;this.interval=c}else this.options.interval||(c=Math.ceil(this.interval),this.range>this.interval&&(this.interval=c,b=Math.pow(this.logarithmBase,Math.floor(Math.log(this.viewportMinimum)/(d*this.interval)+0.2)*this.interval))),this.equidistantInterval=!0,this.intervalStartPosition=b;if(!this.valueFormatString&&(this.valueFormatString="#,##0.##",1>this.viewportMinimum)){d=Math.floor(Math.abs(Math.log(this.viewportMinimum)/Math.LN10))+2;if(isNaN(d)||!isFinite(d))d=2;
|
|
799
|
+
if(2<d)for(h=0;h<d-2;h++)this.valueFormatString+="#"}};C.generateValueFormatString=function(a,d){var c="#,##0.",b=d;1>a&&(b+=Math.floor(Math.abs(Math.log(a)/Math.LN10)),isNaN(b)||!isFinite(b))&&(b=d);for(var e=0;e<b;e++)c+="#";return c};C.getNiceExponent=function(a,d){var c=Math.floor(Math.log(a)/Math.LN10),b=a/Math.pow(10,c),b=0>c?1>=b?1:5>=b?5:10:Math.max(Math.floor(b),1);return-20>c?Number(b*Math.pow(10,c)):Number((b*Math.pow(10,c)).toFixed(20))};C.getNiceNumber=function(a,d){var c=Math.floor(Math.log(a)/
|
|
800
|
+
Math.LN10),b=a/Math.pow(10,c),b=d?1.5>b?1:3>b?2:7>b?5:10:1>=b?1:2>=b?2:5>=b?5:10;return-20>c?Number(b*Math.pow(10,c)):Number((b*Math.pow(10,c)).toFixed(20))};C.prototype.getLabelStartPoint=function(){var a=V[this.intervalType+"Duration"]*this.interval,a=new Date(Math.floor(this.viewportMinimum/a)*a);if("millisecond"!==this.intervalType)if("second"===this.intervalType)0<a.getMilliseconds()&&(a.setSeconds(a.getSeconds()+1),a.setMilliseconds(0));else if("minute"===this.intervalType){if(0<a.getSeconds()||
|
|
801
|
+
0<a.getMilliseconds())a.setMinutes(a.getMinutes()+1),a.setSeconds(0),a.setMilliseconds(0)}else if("hour"===this.intervalType){if(0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setHours(a.getHours()+1),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("day"===this.intervalType){if(0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setDate(a.getDate()+1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("week"===this.intervalType){if(0<
|
|
802
|
+
a.getDay()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setDate(a.getDate()+(7-a.getDay())),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("month"===this.intervalType){if(1<a.getDate()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setMonth(a.getMonth()+1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else"year"===this.intervalType&&(0<a.getMonth()||1<a.getDate()||0<a.getHours()||
|
|
803
|
+
0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())&&(a.setFullYear(a.getFullYear()+1),a.setMonth(0),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0));return a};pa(ga,L);pa(ba,L);ba.prototype.createUserOptions=function(a){if("undefined"!==typeof a||this.options._isPlaceholder){var d=0;this.parent.options._isPlaceholder&&this.parent.createUserOptions();this.options._isPlaceholder||(Fa(this.parent[this.optionsName]),d=this.parent.options[this.optionsName].indexOf(this.options));
|
|
804
|
+
this.options="undefined"===typeof a?{}:a;this.parent.options[this.optionsName][d]=this.options}};ba.prototype.render=function(a){if(0!==this.spacing||0!==this.options.lineThickness&&("undefined"!==typeof this.options.lineThickness||0!==this.parent.lineThickness)){var d=this.ctx,c=this.ctx.globalAlpha;this.ctx=a||this.ctx;this.ctx.save();this.ctx.beginPath();this.ctx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.ctx.clip();var b=this.scaleBreaks.parent.getPixelCoordinatesOnAxis(this.startValue),
|
|
805
|
+
e=this.scaleBreaks.parent.getPixelCoordinatesOnAxis(this.endValue);this.ctx.strokeStyle=this.lineColor;this.ctx.fillStyle=this.color;this.ctx.beginPath();this.ctx.globalAlpha=1;Z(this.id);var g,h,l,r,k,m;a=Math.max(this.spacing,3);var n=Math.max(0,this.lineThickness);this.ctx.lineWidth=n;this.ctx.setLineDash&&this.ctx.setLineDash(K(this.lineDashType,n));if("bottom"===this.scaleBreaks.parent._position||"top"===this.scaleBreaks.parent._position)if(b=1===n%2?(b.x<<0)+0.5:b.x<<0,h=1===n%2?(e.x<<0)+0.5:
|
|
806
|
+
e.x<<0,"top"===this.scaleBreaks.parent._position?(e=this.chart.plotArea.y1,l=this.chart.plotArea.y2+n/2+0.5<<0):(e=this.chart.plotArea.y2,l=this.chart.plotArea.y1-n/2+0.5<<0,a*=-1),this.bounds={x1:b-n/2,y1:e,x2:h+n/2,y2:l},this.ctx.moveTo(b,e),"straight"===this.type||"top"===this.scaleBreaks.parent._position&&0>=a||"bottom"===this.scaleBreaks.parent._position&&0<=a)this.ctx.lineTo(b,l),this.ctx.lineTo(h,l),this.ctx.lineTo(h,e);else if("wavy"===this.type){r=b;k=e;g=0.5;m=(l-k)/a/3;for(var q=0;q<m;q++)this.ctx.bezierCurveTo(r+
|
|
807
|
+
g*a,k+a,r+g*a,k+2*a,r,k+3*a),k+=3*a,g*=-1;this.ctx.bezierCurveTo(r+g*a,k+a,r+g*a,k+2*a,r,k+3*a);r=h;g*=-1;this.ctx.lineTo(r,k);for(q=0;q<m;q++)this.ctx.bezierCurveTo(r+g*a,k-a,r+g*a,k-2*a,r,k-3*a),k-=3*a,g*=-1}else{if("zigzag"===this.type){g=-1;k=e+a;r=b+a;m=(l-k)/a/2;for(q=0;q<m;q++)this.ctx.lineTo(r,k),r+=2*g*a,k+=2*a,g*=-1;this.ctx.lineTo(r,k);r+=h-b;for(q=0;q<m+1;q++)this.ctx.lineTo(r,k),r+=2*g*a,k-=2*a,g*=-1;this.ctx.lineTo(r+g*a,k+a)}}else if("left"===this.scaleBreaks.parent._position||"right"===
|
|
808
|
+
this.scaleBreaks.parent._position)if(e=1===n%2?(e.y<<0)+0.5:e.y<<0,l=1===n%2?(b.y<<0)+0.5:b.y<<0,"left"===this.scaleBreaks.parent._position?(b=this.chart.plotArea.x1,h=this.chart.plotArea.x2+n/2+0.5<<0):(b=this.chart.plotArea.x2,h=this.chart.plotArea.x1-n/2+0.5<<0,a*=-1),this.bounds={x1:b,y1:e-n/2,x2:h,y2:l+n/2},this.ctx.moveTo(b,e),"straight"===this.type||"left"===this.scaleBreaks.parent._position&&0>=a||"right"===this.scaleBreaks.parent._position&&0<=a)this.ctx.lineTo(h,e),this.ctx.lineTo(h,l),
|
|
809
|
+
this.ctx.lineTo(b,l);else if("wavy"===this.type){r=b;k=e;g=0.5;m=(h-r)/a/3;for(q=0;q<m;q++)this.ctx.bezierCurveTo(r+a,k+g*a,r+2*a,k+g*a,r+3*a,k),r+=3*a,g*=-1;this.ctx.bezierCurveTo(r+a,k+g*a,r+2*a,k+g*a,r+3*a,k);k=l;g*=-1;this.ctx.lineTo(r,k);for(q=0;q<m;q++)this.ctx.bezierCurveTo(r-a,k+g*a,r-2*a,k+g*a,r-3*a,k),r-=3*a,g*=-1}else if("zigzag"===this.type){g=1;k=e-a;r=b+a;m=(h-r)/a/2;for(q=0;q<m;q++)this.ctx.lineTo(r,k),k+=2*g*a,r+=2*a,g*=-1;this.ctx.lineTo(r,k);k+=l-e;for(q=0;q<m+1;q++)this.ctx.lineTo(r,
|
|
810
|
+
k),k+=2*g*a,r-=2*a,g*=-1;this.ctx.lineTo(r+a,k+g*a)}0<n&&this.ctx.stroke();this.ctx.closePath();this.ctx.globalAlpha=this.fillOpacity;this.ctx.globalCompositeOperation="destination-over";this.ctx.fill();this.ctx.restore();this.ctx.globalAlpha=c;this.ctx=d}};pa(Q,L);Q.prototype.createUserOptions=function(a){if("undefined"!==typeof a||this.options._isPlaceholder){var d=0;this.parent.options._isPlaceholder&&this.parent.createUserOptions();this.options._isPlaceholder||(Fa(this.parent.stripLines),d=this.parent.options.stripLines.indexOf(this.options));
|
|
811
|
+
this.options="undefined"===typeof a?{}:a;this.parent.options.stripLines[d]=this.options}};Q.prototype.render=function(){this.ctx.save();var a=this.parent.getPixelCoordinatesOnAxis(this.value),d=Math.abs("pixel"===this._thicknessType?this.thickness:Math.abs(this.parent.convertValueToPixel(this.endValue)-this.parent.convertValueToPixel(this.startValue)));if(0<d){var c=null===this.opacity?1:this.opacity;this.ctx.strokeStyle=this.color;this.ctx.beginPath();var b=this.ctx.globalAlpha;this.ctx.globalAlpha=
|
|
812
|
+
c;Z(this.id);var e,g,h,l;this.ctx.lineWidth=d;this.ctx.setLineDash&&this.ctx.setLineDash(K(this.lineDashType,d));if("bottom"===this.parent._position||"top"===this.parent._position)e=g=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0,h=this.chart.plotArea.y1,l=this.chart.plotArea.y2,this.bounds={x1:e-d/2,y1:h,x2:g+d/2,y2:l};else if("left"===this.parent._position||"right"===this.parent._position)h=l=1===this.ctx.lineWidth%2?(a.y<<0)+0.5:a.y<<0,e=this.chart.plotArea.x1,g=this.chart.plotArea.x2,this.bounds=
|
|
813
|
+
{x1:e,y1:h-d/2,x2:g,y2:l+d/2};this.ctx.moveTo(e,h);this.ctx.lineTo(g,l);this.ctx.stroke();this.ctx.globalAlpha=b}this.ctx.restore()};pa(da,L);da.prototype.showAt=function(a){if(!this.enabled)return!1;var d=this.chart,c=!1;d.resetOverlayedCanvas();d.clearedOverlayedCanvas=this.parent.type;this.chart.renderCrosshairs(this.parent);if("xySwapped"===d.plotInfo.axisPlacement)if("bottom"===this.parent._position)for(var b=0;b<d.axisY.length;b++)this.parent===d.axisY[b]&&(d.axisY[b]._crosshairValue=a>=d.axisY[b].viewportMinimum&&
|
|
813
814
|
a<=d.axisY[b].viewportMaximum?a:null);else if("top"===this.parent._position)for(b=0;b<d.axisY2.length;b++)this.parent===d.axisY2[b]&&(d.axisY2[b]._crosshairValue=a>=d.axisY2[b].viewportMinimum&&a<=d.axisY2[b].viewportMaximum?a:null);else if("left"===this.parent._position)for(b=0;b<d.axisX.length;b++)this.parent===d.axisX[b]&&(d.axisX[b]._crosshairValue=a>=d.axisX[b].viewportMinimum&&a<=d.axisX[b].viewportMaximum?a:null);else{if("right"===this.parent._position)for(b=0;b<d.axisX2.length;b++)this.parent===
|
|
814
815
|
d.axisX2[b]&&(d.axisX2[b]._crosshairValue=a>=d.axisX2[b].viewportMinimum&&a<=d.axisX2[b].viewportMaximum?a:null)}else if("bottom"===this.parent._position)for(b=0;b<d.axisX.length;b++)this.parent===d.axisX[b]&&(d.axisX[b]._crosshairValue=a>=d.axisX[b].viewportMinimum&&a<=d.axisX[b].viewportMaximum?a:null);else if("top"===this.parent._position)for(b=0;b<d.axisX2.length;b++)this.parent===d.axisX2[b]&&(d.axisX2[b]._crosshairValue=a>=d.axisX2[b].viewportMinimum&&a<=d.axisX2[b].viewportMaximum?a:null);
|
|
815
816
|
else if("left"===this.parent._position)for(b=0;b<d.axisY.length;b++)this.parent===d.axisY[b]&&(d.axisY[b]._crosshairValue=a>=d.axisY[b].viewportMinimum&&a<=d.axisY[b].viewportMaximum?a:null);else if("right"===this.parent._position)for(b=0;b<d.axisY2.length;b++)this.parent===d.axisY2[b]&&(d.axisY2[b]._crosshairValue=a>=d.axisY2[b].viewportMinimum&&a<=d.axisY2[b].viewportMaximum?a:null);for(b=0;b<d.axisX.length;b++)a=d.axisX[b]._crosshairValue,d.axisX[b].crosshair&&(d.axisX[b].crosshair.enabled&&!r(a)&&
|
|
@@ -929,7 +930,7 @@ this.chart.requestAnimFrame.call(window,function(){g.animate.call(g)}):this.char
|
|
|
929
930
|
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/ma,c.canvas.height/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,
|
|
930
931
|
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}}},Y={drawMarker:function(a,d,c,b,e,g,h,l){if(c){var r=1;c.fillStyle=g?g:"#000000";c.strokeStyle=h?h:"#000000";c.lineWidth=l?l:0;c.setLineDash&&c.setLineDash(K("solid",l));"circle"===b?(c.moveTo(a,d),c.beginPath(),c.arc(a,d,e/2,0,2*Math.PI,!1),g&&c.fill(),
|
|
931
932
|
l&&(h?c.stroke():(r=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=r))):"square"===b?(c.beginPath(),c.rect(a-e/2,d-e/2,e,e),g&&c.fill(),l&&(h?c.stroke():(r=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=r))):"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(),g&&c.fill(),l&&(h?c.stroke():(r=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=r)),c.beginPath()):
|
|
932
|
-
"cross"===b&&(c.strokeStyle=g,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];Y.drawMarker(c.x,c.y,c.ctx,c.type,c.size,c.color,c.borderColor,c.borderThickness)}}};return l}();E.version="v3.7.
|
|
933
|
+
"cross"===b&&(c.strokeStyle=g,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];Y.drawMarker(c.x,c.y,c.ctx,c.type,c.size,c.color,c.borderColor,c.borderThickness)}}};return l}();E.version="v3.7.38 GA";window.CanvasJS&&(E&&!window.CanvasJS.Chart)&&(window.CanvasJS.Chart=E)})();
|
|
933
934
|
|
|
934
935
|
/*
|
|
935
936
|
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.
|