@canvasjs/charts 3.8.10 → 3.8.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/canvasjs.min.js +488 -486
- package/package.json +1 -1
package/canvasjs.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
CanvasJS Chart - v3.8.
|
|
2
|
+
CanvasJS Chart - v3.8.11 GA - https://canvasjs.com/
|
|
3
3
|
Copyright 2024 fenopix
|
|
4
4
|
|
|
5
5
|
--------------------- License Information --------------------
|
|
@@ -92,9 +92,9 @@ yearDuration:314496E5,monthDuration:2592E6,weekDuration:6048E5,dayDuration:864E5
|
|
|
92
92
|
var hb=function(){var d=!1;try{var m=Object.defineProperty&&Object.defineProperty({},"passive",{get:function(){d=!0;return!1}});window.addEventListener&&(window.addEventListener("test",null,m),window.removeEventListener("test",null,m))}catch(n){d=!1}return d}(),$a={},xa=null,mb=function(){this.ctx.clearRect(0,0,this.width,this.height);this.backgroundColor&&(this.ctx.fillStyle=this.backgroundColor,this.ctx.fillRect(0,0,this.width,this.height))},ya=function(d){d.width=1;d.height=1;d.getContext("2d")&&
|
|
93
93
|
d.getContext("2d").clearRect(0,0,1,1)},nb=function(d,m,n){m=Math.min(this.width,this.height);return Math.max("theme4"===this.theme?0:300<=m?12:11,Math.round(m*(d/400)))},Ca=function(){var d=/D{1,4}|M{1,4}|Y{1,4}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|f{1,3}|t{1,2}|T{1,2}|K|z{1,3}|"[^"]*"|'[^']*'/g,m="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),n="Sun Mon Tue Wed Thu Fri Sat".split(" "),w="January February March April May June July August September October November December".split(" "),
|
|
94
94
|
Y="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,A=/[^-+\dA-Z]/g;return function(B,G,Q){var P=Q?Q.days:m,X=Q?Q.months:w,H=Q?Q.shortDays:n,L=Q?Q.shortMonths:Y;Q="";var O=!1;B=B&&B.getTime?B:B?new Date(B):new Date;if(isNaN(B))throw SyntaxError("invalid date");"UTC:"===G.slice(0,4)&&(G=G.slice(4),O=!0);Q=O?"getUTC":"get";var T=B[Q+"Date"](),K=B[Q+"Day"](),
|
|
95
|
-
W=B[Q+"Month"](),a=B[Q+"FullYear"](),g=B[Q+"Hours"](),c=B[Q+"Minutes"](),b=B[Q+"Seconds"](),e=B[Q+"Milliseconds"](),h=O?0:B.getTimezoneOffset();return Q=G.replace(d,function(
|
|
95
|
+
W=B[Q+"Month"](),a=B[Q+"FullYear"](),g=B[Q+"Hours"](),c=B[Q+"Minutes"](),b=B[Q+"Seconds"](),e=B[Q+"Milliseconds"](),h=O?0:B.getTimezoneOffset();return Q=G.replace(d,function(r){switch(r){case "D":return T;case "DD":return da(T,2);case "DDD":return H[K];case "DDDD":return P[K];case "M":return W+1;case "MM":return da(W+1,2);case "MMM":return L[W];case "MMMM":return X[W];case "Y":return parseInt(String(a).slice(-2));case "YY":return da(String(a).slice(-2),2);case "YYY":return da(String(a).slice(-3),
|
|
96
96
|
3);case "YYYY":return da(a,4);case "h":return g%12||12;case "hh":return da(g%12||12,2);case "H":return g;case "HH":return da(g,2);case "m":return c;case "mm":return da(c,2);case "s":return b;case "ss":return da(b,2);case "f":return da(String(e),3).slice(0,1);case "ff":return da(String(e),3).slice(0,2);case "fff":return da(String(e),3).slice(0,3);case "t":return 12>g?"a":"p";case "tt":return 12>g?"am":"pm";case "T":return 12>g?"A":"P";case "TT":return 12>g?"AM":"PM";case "K":return O?"UTC":(String(B).match(t)||
|
|
97
|
-
[""]).pop().replace(A,"");case "z":return(0<h?"-":"+")+Math.floor(Math.abs(h)/60);case "zz":return(0<h?"-":"+")+da(Math.floor(Math.abs(h)/60),2);case "zzz":return(0<h?"-":"+")+da(Math.floor(Math.abs(h)/60),2)+da(Math.abs(h)%60,2);default:return
|
|
97
|
+
[""]).pop().replace(A,"");case "z":return(0<h?"-":"+")+Math.floor(Math.abs(h)/60);case "zz":return(0<h?"-":"+")+da(Math.floor(Math.abs(h)/60),2);case "zzz":return(0<h?"-":"+")+da(Math.floor(Math.abs(h)/60),2)+da(Math.abs(h)%60,2);default:return r.slice(1,r.length-1)}})}}(),ob=function(d){var m=0>d;if(1>Math.abs(d)){var n=parseInt(d.toString().split("e-")[1]);n&&(d=(m?-1*d:d)*Math.pow(10,n-1),d="0."+Array(n).join("0")+d.toString().substring(2),d=m?"-"+d:d)}else n=parseInt(d.toString().split("+")[1]),
|
|
98
98
|
20<n&&(n-=20,d/=Math.pow(10,n),d=d.toString()+Array(n+1).join("0"));return String(d)},fa=function(d,m,n){if(null===d)return"";if(!isFinite(d))return d;d=Number(d);var w=0>d?!0:!1;w&&(d*=-1);var Y=n?n.decimalSeparator:".",t=n?n.digitGroupSeparator:",",A="";m=String(m);var A=1,B=n="",G=-1,Q=[],P=[],X=0,O=0,H=0,L=!1,T=0,B=m.match(/"[^"]*"|'[^']*'|[eE][+-]*[0]+|[,]+[.]|\u2030|./g);m=null;for(var K=0;B&&K<B.length;K++)if(m=B[K],"."===m&&0>G)G=K;else{if("%"===m)A*=100;else if("\u2030"===m){A*=1E3;continue}else if(","===
|
|
99
99
|
m[0]&&"."===m[m.length-1]){A/=Math.pow(1E3,m.length-1);G=K+m.length-1;continue}else"E"!==m[0]&&"e"!==m[0]||"0"!==m[m.length-1]||(L=!0);0>G?(Q.push(m),"#"===m||"0"===m?X++:","===m&&H++):(P.push(m),"#"!==m&&"0"!==m||O++)}L&&(m=Math.floor(d),B=-Math.floor(Math.log(d)/Math.LN10+1),T=0===d?0:0===m?-(X+B):ob(m).length-X,A/=Math.pow(10,T));0>G&&(G=K);A=(d*A).toFixed(O);m=A.split(".");A=(m[0]+"").split("");d=(m[1]+"").split("");A&&"0"===A[0]&&A.shift();for(L=B=K=O=G=0;0<Q.length;)if(m=Q.pop(),"#"===m||"0"===
|
|
100
100
|
m)if(G++,G===X){var W=A,A=[];if("0"===m)for(m=X-O-(W?W.length:0);0<m;)W.unshift("0"),m--;for(;0<W.length;)n=W.pop()+n,L++,0===L%B&&(K===H&&0<W.length)&&(n=t+n)}else 0<A.length?(n=A.pop()+n,O++,L++):"0"===m&&(n="0"+n,O++,L++),0===L%B&&(K===H&&0<A.length)&&(n=t+n);else"E"!==m[0]&&"e"!==m[0]||"0"!==m[m.length-1]||!/[eE][+-]*[0]+/.test(m)?","===m?(K++,B=L,L=0,0<A.length&&(n=t+n)):n=1<m.length&&('"'===m[0]&&'"'===m[m.length-1]||"'"===m[0]&&"'"===m[m.length-1])?m.slice(1,m.length-1)+n:m+n:(m=0>T?m.replace("+",
|
|
@@ -142,10 +142,10 @@ Ba[this.colorSet]:Ba.colorSet1,this._canvasJSContainer=document.createElement("d
|
|
|
142
142
|
right:"1px",top:"1px"}),this._canvasJSContainer.appendChild(this._toolBar),this.bounds={x1:0,y1:0,x2:this.width,y2:this.height},H(this.overlaidCanvas,"click",function(a){b._mouseEventHandler(a)},this.allDOMEventHandlers),H(this.overlaidCanvas,"mousemove",function(a){b._mouseEventHandler(a)},this.allDOMEventHandlers),H(this.overlaidCanvas,"mouseup",function(a){b._mouseEventHandler(a)},this.allDOMEventHandlers),H(this.overlaidCanvas,"mousedown",function(a){b._mouseEventHandler(a);wa(b._dropdownMenu)},
|
|
143
143
|
this.allDOMEventHandlers),H(this.overlaidCanvas,"mouseout",function(a){b._mouseEventHandler(a)},this.allDOMEventHandlers),H(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerDown":"touchstart",function(a){b._touchEventHandler(a)},this.allDOMEventHandlers),H(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerMove":"touchmove",function(a){b._touchEventHandler(a)},this.allDOMEventHandlers),H(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerUp":"touchend",function(a){b._touchEventHandler(a)},
|
|
144
144
|
this.allDOMEventHandlers),H(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerCancel":"touchcancel",function(a){b._touchEventHandler(a)},this.allDOMEventHandlers),this.toolTip=new na(this,this.options.toolTip),this.data=null,this.axisX=[],this.axisX2=[],this.axisY=[],this.axisY2=[],this.sessionVariables={axisX:[],axisX2:[],axisY:[],axisY2:[]})):window.console&&window.console.log('CanvasJS Error: Chart Container with id "'+this._containerId+'" was not found')}function t(a,g){for(var c=
|
|
145
|
-
[],b,e=0;e<a.length;e++)if(0==e)c.push(a[0]);else{var h,
|
|
146
|
-
c[c.length]=a[y].x>a[h].x&&0<I||a[y].x<a[h].x&&0>I?{x:a[y].x-I/3,y:a[y].y-b/3}:{x:a[y].x,y:a[y].y-b/9};c[c.length]=a[e]}return c}function B(a,g,c,b,e,h,
|
|
147
|
-
a.setLineDash(G(y.dashType,y.thickness));a.beginPath();I&&0<y.thickness?(a.moveTo(b-
|
|
148
|
-
|
|
145
|
+
[],b,e=0;e<a.length;e++)if(0==e)c.push(a[0]);else{var h,r,y;y=e-1;h=0===y?0:y-1;r=y===a.length-1?y:y+1;b=Math.abs((a[r].x-a[h].x)/(0===a[r].x-a[y].x?0.01:a[r].x-a[y].x))*(g-1)/2+1;var I=(a[r].x-a[h].x)/b;b=(a[r].y-a[h].y)/b;c[c.length]=a[y].x>a[h].x&&0<I||a[y].x<a[h].x&&0>I?{x:a[y].x+I/3,y:a[y].y+b/3}:{x:a[y].x,y:a[y].y+(1===c.length?0:b/9)};y=e;h=0===y?0:y-1;r=y===a.length-1?y:y+1;b=Math.abs((a[r].x-a[h].x)/(0===a[y].x-a[h].x?0.01:a[y].x-a[h].x))*(g-1)/2+1;I=(a[r].x-a[h].x)/b;b=(a[r].y-a[h].y)/b;
|
|
146
|
+
c[c.length]=a[y].x>a[h].x&&0<I||a[y].x<a[h].x&&0>I?{x:a[y].x-I/3,y:a[y].y-b/3}:{x:a[y].x,y:a[y].y-b/9};c[c.length]=a[e]}return c}function B(a,g,c,b,e,h,r,y,I,k){var l=0;k?(r.color=h,y.color=h):k=1;l=I?Math.abs(e-c):Math.abs(b-g);l=0<r.trimLength?Math.abs(l*r.trimLength/100):Math.abs(l-r.length);I?(c+=l/2,e-=l/2):(g+=l/2,b-=l/2);var l=1===Math.round(r.thickness)%2?0.5:0,p=1===Math.round(y.thickness)%2?0.5:0;a.save();a.globalAlpha=k;a.strokeStyle=y.color||h;a.lineWidth=y.thickness||2;a.setLineDash&&
|
|
147
|
+
a.setLineDash(G(y.dashType,y.thickness));a.beginPath();I&&0<y.thickness?(a.moveTo(b-r.thickness/2,Math.round((c+e)/2)-p),a.lineTo(g+r.thickness/2,Math.round((c+e)/2)-p)):0<y.thickness&&(a.moveTo(Math.round((g+b)/2)-p,c+r.thickness/2),a.lineTo(Math.round((g+b)/2)-p,e-r.thickness/2));a.stroke();a.strokeStyle=r.color||h;a.lineWidth=r.thickness||2;a.setLineDash&&a.setLineDash(G(r.dashType,r.thickness));a.beginPath();I&&0<r.thickness?(a.moveTo(b-l,c),a.lineTo(b-l,e),a.moveTo(g+l,c),a.lineTo(g+l,e)):0<
|
|
148
|
+
r.thickness&&(a.moveTo(g,c+l),a.lineTo(b,c+l),a.moveTo(g,e-l),a.lineTo(b,e-l));a.stroke();a.restore()}function P(a,g){P.base.constructor.call(this,"Legend","legend",g,null,a);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx;this.ghostCtx=this.chart._eventManager.ghostCtx;this.items=[];this.optionsName="legend";this.height=this.width=0;this.orientation=null;this.dataSeries=[];this.bounds={x1:null,y1:null,x2:null,y2:null};"undefined"===typeof this.options.fontSize&&(this.fontSize=this.chart.getAutoFontSize(this.fontSize));
|
|
149
149
|
this.lineHeight=Za(this.fontFamily,this.fontSize,this.fontWeight);this.horizontalSpacing=this.fontSize}function V(a,g,c,b){V.base.constructor.call(this,"DataSeries","data",g,c,a);this.chart=a;this.canvas=a.canvas;this._ctx=a.canvas.ctx;this.index=c;this.noDataPointsInPlotArea=0;this.id=b;this.chart._eventManager.objectMap[b]={id:b,objectType:"dataSeries",dataSeriesIndex:c};a=g.dataPoints?g.dataPoints.length:0;this.dataPointEOs=[];for(g=0;g<a;g++)this.dataPointEOs[g]={};this.dataPointIds=[];this.plotUnit=
|
|
150
150
|
[];this.axisY=this.axisX=null;this.optionsName="data";this.isOptionsInArray=!0;null===this.fillOpacity&&(this.type.match(/area/i)?this.fillOpacity=0.7:this.fillOpacity=1);this.axisPlacement=this.getDefaultAxisPlacement();"undefined"===typeof this.options.indexLabelFontSize&&(this.indexLabelFontSize=this.chart.getAutoFontSize(this.indexLabelFontSize))}function A(a,g,c,b,e,h){A.base.constructor.call(this,"Axis",g,c,b,a);this.chart=a;this.canvas=a.canvas;this.ctx=a.ctx;this.intervalStartPosition=this.maxHeight=
|
|
151
151
|
this.maxWidth=0;this.labels=[];this.dataSeries=[];this._stripLineLabels=this._ticks=this._labels=null;this.dataInfo={min:Infinity,max:-Infinity,viewPortMin:Infinity,viewPortMax:-Infinity,minDiff:Infinity};this.isOptionsInArray=!0;"axisX"===e?("left"===h||"bottom"===h?(this.optionsName="axisX",n(this.chart.sessionVariables.axisX[b])&&(this.chart.sessionVariables.axisX[b]={}),this.sessionVariables=this.chart.sessionVariables.axisX[b]):(this.optionsName="axisX2",n(this.chart.sessionVariables.axisX2[b])&&
|
|
@@ -175,8 +175,8 @@ color:a.toolbar.fontColor}),0>=navigator.userAgent.search("MSIE")&&this._resetBu
|
|
|
175
175
|
H(this._resetButton,"touchstart",function(a){g=!0},this.allDOMEventHandlers),H(this._resetButton,"click",function(){a.toolTip.hide();a.toolTip&&a.toolTip.enabled&&a.toolTip.dispatchEvent("hidden",{chart:a,toolTip:a.toolTip},a.toolTip);a.zoomEnabled||a.panEnabled?(a.zoomEnabled=!0,a.panEnabled=!1,sa(a,a._zoomButton,"pan"),a._defaultCursor="default",a.overlaidCanvas.style.cursor=a._defaultCursor):(a.zoomEnabled=!1,a.panEnabled=!1);if(a.sessionVariables.axisX)for(var b=0;b<a.sessionVariables.axisX.length;b++)a.sessionVariables.axisX[b].newViewportMinimum=
|
|
176
176
|
null,a.sessionVariables.axisX[b].newViewportMaximum=null;if(a.sessionVariables.axisX2)for(b=0;b<a.sessionVariables.axisX2.length;b++)a.sessionVariables.axisX2[b].newViewportMinimum=null,a.sessionVariables.axisX2[b].newViewportMaximum=null;if(a.sessionVariables.axisY)for(b=0;b<a.sessionVariables.axisY.length;b++)a.sessionVariables.axisY[b].newViewportMinimum=null,a.sessionVariables.axisY[b].newViewportMaximum=null;if(a.sessionVariables.axisY2)for(b=0;b<a.sessionVariables.axisY2.length;b++)a.sessionVariables.axisY2[b].newViewportMinimum=
|
|
177
177
|
null,a.sessionVariables.axisY2[b].newViewportMaximum=null;a.resetOverlayedCanvas();0>=navigator.userAgent.search("MSIE")&&O(a._resetButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"});wa(a._zoomButton,a._resetButton);a.stockChart&&(a.stockChart._rangeEventParameter={stockChart:a.stockChart,source:"chart",index:a.stockChart.charts.indexOf(a),minimum:null,maximum:null});a._dispatchRangeEvent("rangeChanging","reset");a.stockChart&&(a.stockChart._rangeEventParameter.type="rangeChanging",
|
|
178
|
-
a.stockChart.dispatchEvent("rangeChanging",a.stockChart._rangeEventParameter,a.stockChart));a.render();a.syncCharts&&(a.stockChart.rangeUpdatedBy=!a.stockChart.navigator.slider||n(a.stockChart.navigator.slider.options.minimum)&&n(a.stockChart.navigator.slider.options.maximum)?!a.stockChart.rangeSelector.enabled||!a.stockChart.rangeSelector.inputFields.enabled||n(a.stockChart.rangeSelector.inputFields.options.startValue)&&n(a.stockChart.rangeSelector.inputFields.options.endValue)?null:
|
|
179
|
-
"navigator",n(a.stockChart._selectedRangeButtonIndex)||(a.stockChart.rangeUpdatedBy="rangeButton"),a.syncCharts(null,null),"rangeButton"===a.stockChart.rangeUpdatedBy&&a.stockChart.rangeSelector.selectedRangeButtonIndex<a.stockChart.rangeSelector.buttons.length&&(b=a.stockChart.rangeSelector.buttons[a.stockChart.rangeSelector.selectedRangeButtonIndex],b.state="on",b.textBlock.fontWeight="bold",b.textBlock.fontColor=a.stockChart.rangeSelector.buttonStyle.labelFontColorOnHover,b.textBlock.backgroundColor=
|
|
178
|
+
a.stockChart.dispatchEvent("rangeChanging",a.stockChart._rangeEventParameter,a.stockChart));a.render();a.syncCharts&&a.stockChart&&(a.stockChart.rangeUpdatedBy=!a.stockChart.navigator.slider||n(a.stockChart.navigator.slider.options.minimum)&&n(a.stockChart.navigator.slider.options.maximum)?!a.stockChart.rangeSelector.enabled||!a.stockChart.rangeSelector.inputFields.enabled||n(a.stockChart.rangeSelector.inputFields.options.startValue)&&n(a.stockChart.rangeSelector.inputFields.options.endValue)?null:
|
|
179
|
+
"inputFields":"navigator",n(a.stockChart._selectedRangeButtonIndex)||(a.stockChart.rangeUpdatedBy="rangeButton"),a.syncCharts(null,null),"rangeButton"===a.stockChart.rangeUpdatedBy&&a.stockChart.rangeSelector.selectedRangeButtonIndex<a.stockChart.rangeSelector.buttons.length&&(b=a.stockChart.rangeSelector.buttons[a.stockChart.rangeSelector.selectedRangeButtonIndex],b.state="on",b.textBlock.fontWeight="bold",b.textBlock.fontColor=a.stockChart.rangeSelector.buttonStyle.labelFontColorOnHover,b.textBlock.backgroundColor=
|
|
180
180
|
a.stockChart.rangeSelector.buttonStyle.backgroundColorOnSelect,b.render()));a._dispatchRangeEvent("rangeChanged","reset");a.stockChart&&(a.stockChart._rangeEventParameter.type="rangeChanged",a.stockChart.dispatchEvent("rangeChanged",a.stockChart._rangeEventParameter,a.stockChart))},this.allDOMEventHandlers),H(this._resetButton,"mousemove",function(){g||(O(a._resetButton,{backgroundColor:a.toolbar.itemBackgroundColorOnHover,color:a.toolbar.fontColorOnHover,transition:"0.4s",WebkitTransition:"0.4s"}),
|
|
181
181
|
0>=navigator.userAgent.search("MSIE")&&O(a._resetButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"}))},this.allDOMEventHandlers),H(this._resetButton,"mouseout",function(){g||(O(a._resetButton,{backgroundColor:a.toolbar.itemBackgroundColor,color:a.toolbar.fontColor,transition:"0.4s",WebkitTransition:"0.4s"}),0>=navigator.userAgent.search("MSIE")&&O(a._resetButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"}))},this.allDOMEventHandlers),this.overlaidCanvas.style.cursor=
|
|
182
182
|
a._defaultCursor);this.zoomEnabled||this.panEnabled||(this._zoomButton?(a._zoomButton.getAttribute("state")===a._cultureInfo.zoomText?(this.panEnabled=!0,this.zoomEnabled=!1):(this.zoomEnabled=!0,this.panEnabled=!1),La(a._zoomButton,a._resetButton)):(this.zoomEnabled=!0,this.panEnabled=!1))}else this.panEnabled=this.zoomEnabled=!1;ib(this);"none"!==this._toolBar.style.display&&this._zoomButton&&(this.panEnabled?sa(a,a._zoomButton,"zoom"):sa(a,a._zoomButton,"pan"),a._resetButton.getAttribute("state")!==
|
|
@@ -207,7 +207,7 @@ this.options.title&&(this.title=new Aa(this,this.options.title),this.title.dockI
|
|
|
207
207
|
"pyramid"===this.data[g].type)&&this.legend.dataSeries.push(this.data[g]);this.legend.dockInsidePlotArea?a.push(this.legend):this.legend.setLayout();for(g=0;g<this._axes.length;g++)if(this._axes[g].scaleBreaks&&this._axes[g].scaleBreaks._appliedBreaks.length){w?(this._breaksCanvas=ua(this.width,this.height,!0),this._breaksCanvasCtx=this._breaksCanvas.getContext("2d")):(this._breaksCanvas=this.canvas,this._breaksCanvasCtx=this.ctx);break}this._preRenderCanvas=ua(this.width,this.height);this._preRenderCtx=
|
|
208
208
|
this._preRenderCanvas.getContext("2d");"normal"!==this.plotInfo.axisPlacement&&"xySwapped"!==this.plotInfo.axisPlacement||A.setLayout(this.axisX,this.axisX2,this.axisY,this.axisY2,this.plotInfo.axisPlacement,this.layoutManager.getFreeSpace())};m.prototype.renderElements=function(){if(this.height){var a=this._plotAreaElements;this.title&&!this.title.dockInsidePlotArea&&this.title.render();for(var g=0;g<this.subtitles.length;g++)this.subtitles[g].dockInsidePlotArea||this.subtitles[g].render();this.legend.dockInsidePlotArea||
|
|
209
209
|
this.legend.render();if("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)A.render(this.axisX,this.axisX2,this.axisY,this.axisY2,this.plotInfo.axisPlacement);else if("none"===this.plotInfo.axisPlacement)this.preparePlotArea();else return;for(g=0;g<a.length;g++)a[g].setLayout(),a[g].render();var c=[];if(this.animatedRender){var b=ua(this.width,this.height);b.getContext("2d").drawImage(this.canvas,0,0,this.width,this.height)}jb(this);var a=this.ctx.miterLimit,e;this.ctx.miterLimit=
|
|
210
|
-
3;w&&this._breaksCanvas&&(this._preRenderCtx.drawImage(this.canvas,0,0,this.width,this.height),this._preRenderCtx.drawImage(this._breaksCanvas,0,0,this.width,this.height),this._breaksCanvasCtx.globalCompositeOperation="source-atop",this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),this._preRenderCtx.clearRect(0,0,this.width,this.height));for(g=0;g<this.plotInfo.plotTypes.length;g++)for(var h=this.plotInfo.plotTypes[g],
|
|
210
|
+
3;w&&this._breaksCanvas&&(this._preRenderCtx.drawImage(this.canvas,0,0,this.width,this.height),this._preRenderCtx.drawImage(this._breaksCanvas,0,0,this.width,this.height),this._breaksCanvasCtx.globalCompositeOperation="source-atop",this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),this._preRenderCtx.clearRect(0,0,this.width,this.height));for(g=0;g<this.plotInfo.plotTypes.length;g++)for(var h=this.plotInfo.plotTypes[g],r=0;r<h.plotUnits.length;r++){var y=h.plotUnits[r],
|
|
211
211
|
I=null;y.targetCanvas&&ya(y.targetCanvas);y.targetCanvas=null;this.animatedRender&&(y.targetCanvas=ua(this.width,this.height),y.targetCanvasCtx=y.targetCanvas.getContext("2d"),e=y.targetCanvasCtx.miterLimit,y.targetCanvasCtx.miterLimit=3);"line"===y.type?I=this.renderLine(y):"stepLine"===y.type?I=this.renderStepLine(y):"spline"===y.type?I=this.renderSpline(y):"column"===y.type?I=this.renderColumn(y):"bar"===y.type?I=this.renderBar(y):"area"===y.type?I=this.renderArea(y):"stepArea"===y.type?I=this.renderStepArea(y):
|
|
212
212
|
"splineArea"===y.type?I=this.renderSplineArea(y):"stackedColumn"===y.type?I=this.renderStackedColumn(y):"stackedColumn100"===y.type?I=this.renderStackedColumn100(y):"stackedBar"===y.type?I=this.renderStackedBar(y):"stackedBar100"===y.type?I=this.renderStackedBar100(y):"stackedArea"===y.type?I=this.renderStackedArea(y):"stackedArea100"===y.type?I=this.renderStackedArea100(y):"bubble"===y.type?I=I=this.renderBubble(y):"scatter"===y.type?I=this.renderScatter(y):"pie"===y.type?this.renderPie(y):"doughnut"===
|
|
213
213
|
y.type?this.renderPie(y):"funnel"===y.type?I=this.renderFunnel(y):"pyramid"===y.type?I=this.renderFunnel(y):"candlestick"===y.type?I=this.renderCandlestick(y):"ohlc"===y.type?I=this.renderCandlestick(y):"rangeColumn"===y.type?I=this.renderRangeColumn(y):"error"===y.type?I=this.renderError(y):"rangeBar"===y.type?I=this.renderRangeBar(y):"rangeArea"===y.type?I=this.renderRangeArea(y):"rangeSplineArea"===y.type?I=this.renderRangeSplineArea(y):"waterfall"===y.type?I=this.renderWaterfall(y):"boxAndWhisker"===
|
|
@@ -217,406 +217,406 @@ I):I.animationCallback(I.easingFunction(a,0,1,1),I);l.dispatchEvent("dataAnimati
|
|
|
217
217
|
0<l._indexLabels.length&&l.renderIndexLabels();l.dispatchEvent("dataAnimationIterationEnd",{chart:l});l.dispatchEvent("dataAnimationEnd",{chart:l})}this.attachPlotAreaEventHandlers();this.zoomEnabled||(this.panEnabled||!this._zoomButton||"none"===this._zoomButton.style.display)||wa(this._zoomButton,this._resetButton);n(this.toolTip._xValue)||n(this.toolTip._dataSeriesIndex)||this.toolTip.showAtX(this.toolTip._xValue,this.toolTip._dataSeriesIndex);this.toolTip._updateToolTip();this.renderCount++;Ha&&
|
|
218
218
|
(l=this,setTimeout(function(){var a=document.getElementById("ghostCanvasCopy");a&&(Ma(a,l.width,l.height),a.getContext("2d").drawImage(l._eventManager.ghostCanvas,0,0))},2E3));this._breaksCanvas&&(delete this._breaksCanvas,delete this._breaksCanvasCtx);for(k=0;k<this._axes.length;k++)this._axes[k].maskCanvas&&(delete this._axes[k].maskCanvas,delete this._axes[k].maskCtx)}};m.prototype.render=function(a){a&&(this.options=a);this._initialize();this.setLayout();this.renderElements();this._preRenderCanvas&&
|
|
219
219
|
ya(this._preRenderCanvas)};m.prototype.attachPlotAreaEventHandlers=function(){this.attachEvent({context:this,chart:this,mousedown:this._plotAreaMouseDown,mouseup:this._plotAreaMouseUp,mousemove:this._plotAreaMouseMove,cursor:this.panEnabled?"move":"default",capture:!0,bounds:this.plotArea})};m.prototype.categoriseDataSeries=function(){for(var a="",g=0;g<this.data.length;g++)if(a=this.data[g],a.dataPoints&&(0!==a.dataPoints.length&&a.visible)&&0<=m._supportedChartTypes.indexOf(a.type)){for(var c=null,
|
|
220
|
-
b=!1,e=null,h=!1,
|
|
220
|
+
b=!1,e=null,h=!1,r=0;r<this.plotInfo.plotTypes.length;r++)if(this.plotInfo.plotTypes[r].type===a.type){b=!0;c=this.plotInfo.plotTypes[r];break}b||(c={type:a.type,totalDataSeries:0,plotUnits:[]},this.plotInfo.plotTypes.push(c));for(r=0;r<c.plotUnits.length;r++)if(c.plotUnits[r].axisYType===a.axisYType&&c.plotUnits[r].axisXType===a.axisXType&&c.plotUnits[r].axisYIndex===a.axisYIndex&&c.plotUnits[r].axisXIndex===a.axisXIndex){h=!0;e=c.plotUnits[r];break}h||(e={type:a.type,previousDataSeriesCount:0,index:c.plotUnits.length,
|
|
221
221
|
plotType:c,axisXType:a.axisXType,axisYType:a.axisYType,axisYIndex:a.axisYIndex,axisXIndex:a.axisXIndex,axisY:"primary"===a.axisYType?this.axisY[0<=a.axisYIndex&&a.axisYIndex<this.axisY.length?a.axisYIndex:0]:this.axisY2[0<=a.axisYIndex&&a.axisYIndex<this.axisY2.length?a.axisYIndex:0],axisX:"primary"===a.axisXType?this.axisX[0<=a.axisXIndex&&a.axisXIndex<this.axisX.length?a.axisXIndex:0]:this.axisX2[0<=a.axisXIndex&&a.axisXIndex<this.axisX2.length?a.axisXIndex:0],dataSeriesIndexes:[],yTotals:[],yAbsTotals:[]},
|
|
222
|
-
c.plotUnits.push(e));c.totalDataSeries++;e.dataSeriesIndexes.push(g);a.plotUnit=e}for(g=0;g<this.plotInfo.plotTypes.length;g++)for(c=this.plotInfo.plotTypes[g],
|
|
222
|
+
c.plotUnits.push(e));c.totalDataSeries++;e.dataSeriesIndexes.push(g);a.plotUnit=e}for(g=0;g<this.plotInfo.plotTypes.length;g++)for(c=this.plotInfo.plotTypes[g],r=a=0;r<c.plotUnits.length;r++)c.plotUnits[r].previousDataSeriesCount=a,a+=c.plotUnits[r].dataSeriesIndexes.length};m.prototype.assignIdToDataPoints=function(){for(var a=0;a<this.data.length;a++){var g=this.data[a];if(g.dataPoints)for(var c=g.dataPoints.length,b=0;b<c;b++)g.dataPointIds[b]=++this._eventManager.lastObjectId}};m.prototype._processData=
|
|
223
223
|
function(){this.assignIdToDataPoints();this.categoriseDataSeries();for(var a=0;a<this.plotInfo.plotTypes.length;a++)for(var g=this.plotInfo.plotTypes[a],c=0;c<g.plotUnits.length;c++){var b=g.plotUnits[c];"line"===b.type||"stepLine"===b.type||"spline"===b.type||"column"===b.type||"area"===b.type||"stepArea"===b.type||"splineArea"===b.type||"bar"===b.type||"bubble"===b.type||"scatter"===b.type?this._processMultiseriesPlotUnit(b):"stackedColumn"===b.type||"stackedBar"===b.type||"stackedArea"===b.type?
|
|
224
224
|
this._processStackedPlotUnit(b):"stackedColumn100"===b.type||"stackedBar100"===b.type||"stackedArea100"===b.type?this._processStacked100PlotUnit(b):"candlestick"===b.type||"ohlc"===b.type||"rangeColumn"===b.type||"rangeBar"===b.type||"rangeArea"===b.type||"rangeSplineArea"===b.type||"error"===b.type||"boxAndWhisker"===b.type?this._processMultiYPlotUnit(b):"waterfall"===b.type&&this._processSpecificPlotUnit(b)}this.calculateAutoBreaks()};m.prototype._processMultiseriesPlotUnit=function(a){if(a.dataSeriesIndexes&&
|
|
225
|
-
!(1>a.dataSeriesIndexes.length))for(var g=a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,h=!1,
|
|
225
|
+
!(1>a.dataSeriesIndexes.length))for(var g=a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,h=!1,r=0;r<a.dataSeriesIndexes.length;r++){var y=this.data[a.dataSeriesIndexes[r]],I=0,k=!1,l=!1,p;if("normal"===y.axisPlacement||"xySwapped"===y.axisPlacement)var q=a.axisX.sessionVariables.newViewportMinimum?a.axisX.sessionVariables.newViewportMinimum:a.axisX.options&&a.axisX.options.viewportMinimum?a.axisX.options.viewportMinimum:a.axisX.options&&a.axisX.options.minimum?a.axisX.options.minimum:a.axisX.logarithmic?
|
|
226
226
|
0:-Infinity,f=a.axisX.sessionVariables.newViewportMaximum?a.axisX.sessionVariables.newViewportMaximum:a.axisX.options&&a.axisX.options.viewportMaximum?a.axisX.options.viewportMaximum:a.axisX.options&&a.axisX.options.maximum?a.axisX.options.maximum:Infinity;if(y.dataPoints[I].x&&y.dataPoints[I].x.getTime||"dateTime"===y.xValueType)h=!0;for(I=0;I<y.dataPoints.length;I++){"undefined"===typeof y.dataPoints[I].x&&(y.dataPoints[I].x=I+(a.axisX.logarithmic?1:0));y.dataPoints[I].x.getTime?(h=!0,b=y.dataPoints[I].x.getTime()):
|
|
227
227
|
b=y.dataPoints[I].x;e=y.dataPoints[I].y;b<c.min&&(c.min=b);b>c.max&&(c.max=b);e<g.min&&"number"===typeof e&&(g.min=e);e>g.max&&"number"===typeof e&&(g.max=e);if(0<I){if(a.axisX.logarithmic){var d=b/y.dataPoints[I-1].x;1>d&&(d=1/d);c.minDiff>d&&1!==d&&(c.minDiff=d)}else d=b-y.dataPoints[I-1].x,0>d&&(d*=-1),c.minDiff>d&&0!==d&&(c.minDiff=d);null!==e&&null!==y.dataPoints[I-1].y&&(a.axisY.logarithmic?(d=e/y.dataPoints[I-1].y,1>d&&(d=1/d),g.minDiff>d&&1!==d&&(g.minDiff=d)):(d=e-y.dataPoints[I-1].y,0>d&&
|
|
228
|
-
(d*=-1),g.minDiff>d&&0!==d&&(g.minDiff=d)))}if(b<
|
|
229
|
-
m.prototype._processStackedPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var g=a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,h=!1,
|
|
230
|
-
a.axisX.options&&a.axisX.options.minimum?a.axisX.options.minimum:-Infinity,z=a.axisX.sessionVariables.newViewportMaximum?a.axisX.sessionVariables.newViewportMaximum:a.axisX.options&&a.axisX.options.viewportMaximum?a.axisX.options.viewportMaximum:a.axisX.options&&a.axisX.options.maximum?a.axisX.options.maximum:Infinity;if(
|
|
231
|
-
1:0));
|
|
232
|
-
1].y,0>u&&(u*=-1),g.minDiff>u&&0!==u&&(g.minDiff=u)))}if(b<s&&!d)null!==
|
|
233
|
-
(a.yAbsTotals[b]?a.yAbsTotals[b]:0)+Math.abs(e),0<=e?
|
|
234
|
-
!isNaN(f)&&(a=
|
|
235
|
-
a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,h=!1,
|
|
236
|
-
a.axisX.sessionVariables.newViewportMaximum:a.axisX.options&&a.axisX.options.viewportMaximum?a.axisX.options.viewportMaximum:a.axisX.options&&a.axisX.options.maximum?a.axisX.options.maximum:Infinity;if(p.dataPoints[
|
|
237
|
-
null:p.dataPoints[
|
|
238
|
-
2;continue}if(b>s&&!d)d=!0;else if(b>s&&d)continue;p.dataPoints[
|
|
239
|
-
h?"dateTime":"number"}a.axisY.logarithmic?(g.max=n(g.viewPortMax)?99*Math.pow(a.axisY.logarithmBase,-0.05):Math.max(g.viewPortMax,99*Math.pow(a.axisY.logarithmBase,-0.05)),g.min=n(g.viewPortMin)?1:Math.min(g.viewPortMin,1)):
|
|
240
|
-
-1),g.min=n(g.viewPortMin)?-99:Math.min(g.viewPortMin,-99));g.viewPortMin=g.min;g.viewPortMax=g.max;a.dataPointYSums=k}};m.prototype._processMultiYPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var g=a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,h,
|
|
228
|
+
(d*=-1),g.minDiff>d&&0!==d&&(g.minDiff=d)))}if(b<q&&!k)null!==e&&(p=b);else{if(!k&&(k=!0,0<I)){I-=2;continue}if(b>f&&!l)l=!0;else if(b>f&&l)continue;y.dataPoints[I].label&&(a.axisX.labels[b]=y.dataPoints[I].label);b<c.viewPortMin&&(c.viewPortMin=b);b>c.viewPortMax&&(c.viewPortMax=b);null===e?c.viewPortMin===b&&p<b&&(c.viewPortMin=p):(e<g.viewPortMin&&"number"===typeof e&&(g.viewPortMin=e),e>g.viewPortMax&&"number"===typeof e&&(g.viewPortMax=e))}}y.axisX.valueType=y.xValueType=h?"dateTime":"number"}};
|
|
229
|
+
m.prototype._processStackedPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var g=a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,h=!1,r=[],y=[],I=Infinity,k=-Infinity,l={},p=0;p<a.dataSeriesIndexes.length;p++){var q=this.data[a.dataSeriesIndexes[p]],f=0,d=!1,v=!1,x;if("normal"===q.axisPlacement||"xySwapped"===q.axisPlacement)var s=a.axisX.sessionVariables.newViewportMinimum?a.axisX.sessionVariables.newViewportMinimum:a.axisX.options&&a.axisX.options.viewportMinimum?a.axisX.options.viewportMinimum:
|
|
230
|
+
a.axisX.options&&a.axisX.options.minimum?a.axisX.options.minimum:-Infinity,z=a.axisX.sessionVariables.newViewportMaximum?a.axisX.sessionVariables.newViewportMaximum:a.axisX.options&&a.axisX.options.viewportMaximum?a.axisX.options.viewportMaximum:a.axisX.options&&a.axisX.options.maximum?a.axisX.options.maximum:Infinity;if(q.dataPoints[f].x&&q.dataPoints[f].x.getTime||"dateTime"===q.xValueType)h=!0;for(f=0;f<q.dataPoints.length;f++){"undefined"===typeof q.dataPoints[f].x&&(q.dataPoints[f].x=f+(a.axisX.logarithmic?
|
|
231
|
+
1:0));q.dataPoints[f].x.getTime?(h=!0,b=q.dataPoints[f].x.getTime()):b=q.dataPoints[f].x;e=n(q.dataPoints[f].y)?0:q.dataPoints[f].y;b<c.min&&(c.min=b);b>c.max&&(c.max=b);if(0<f){if(a.axisX.logarithmic){var u=b/q.dataPoints[f-1].x;1>u&&(u=1/u);c.minDiff>u&&1!==u&&(c.minDiff=u)}else u=b-q.dataPoints[f-1].x,0>u&&(u*=-1),c.minDiff>u&&0!==u&&(c.minDiff=u);null!==e&&null!==q.dataPoints[f-1].y&&(a.axisY.logarithmic?0<e&&(u=e/q.dataPoints[f-1].y,1>u&&(u=1/u),g.minDiff>u&&1!==u&&(g.minDiff=u)):(u=e-q.dataPoints[f-
|
|
232
|
+
1].y,0>u&&(u*=-1),g.minDiff>u&&0!==u&&(g.minDiff=u)))}if(b<s&&!d)null!==q.dataPoints[f].y&&(x=b);else{if(!d&&(d=!0,0<f)){f-=2;continue}if(b>z&&!v)v=!0;else if(b>z&&v)continue;q.dataPoints[f].label&&(a.axisX.labels[b]=q.dataPoints[f].label);b<c.viewPortMin&&(c.viewPortMin=b);b>c.viewPortMax&&(c.viewPortMax=b);null===q.dataPoints[f].y?c.viewPortMin===b&&x<b&&(c.viewPortMin=x):(l[b]=(l[b]||0)+q.dataPoints[f].y,q.dataPointEOs[f].cumulativeY=l[b],a.yTotals[b]=(a.yTotals[b]?a.yTotals[b]:0)+e,a.yAbsTotals[b]=
|
|
233
|
+
(a.yAbsTotals[b]?a.yAbsTotals[b]:0)+Math.abs(e),0<=e?r[b]?r[b]+=e:(r[b]=e,I=Math.min(e,I)):y[b]?y[b]+=e:(y[b]=e,k=Math.max(e,k)))}}a.axisY.scaleBreaks&&(a.axisY.scaleBreaks.autoCalculate&&1<=a.axisY.scaleBreaks.maxNumberOfAutoBreaks)&&(g.dataPointYPositiveSums?(g.dataPointYPositiveSums.push.apply(g.dataPointYPositiveSums,r),g.dataPointYNegativeSums.push.apply(g.dataPointYPositiveSums,y)):(g.dataPointYPositiveSums=r,g.dataPointYNegativeSums=y));q.axisX.valueType=q.xValueType=h?"dateTime":"number"}for(f in r)r.hasOwnProperty(f)&&
|
|
234
|
+
!isNaN(f)&&(a=r[f],a<g.min&&(g.min=Math.min(a,I)),a>g.max&&(g.max=a),f<c.viewPortMin||f>c.viewPortMax||(a<g.viewPortMin&&(g.viewPortMin=Math.min(a,I)),a>g.viewPortMax&&(g.viewPortMax=a)));for(f in y)y.hasOwnProperty(f)&&!isNaN(f)&&(a=y[f],a<g.min&&(g.min=a),a>g.max&&(g.max=Math.max(a,k)),f<c.viewPortMin||f>c.viewPortMax||(a<g.viewPortMin&&(g.viewPortMin=a),a>g.viewPortMax&&(g.viewPortMax=Math.max(a,k))))}};m.prototype._processStacked100PlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var g=
|
|
235
|
+
a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,h=!1,r=!1,y=!1,I={},k=[],l=0;l<a.dataSeriesIndexes.length;l++){var p=this.data[a.dataSeriesIndexes[l]],q=0,f=!1,d=!1,v;if("normal"===p.axisPlacement||"xySwapped"===p.axisPlacement)var x=a.axisX.sessionVariables.newViewportMinimum?a.axisX.sessionVariables.newViewportMinimum:a.axisX.options&&a.axisX.options.viewportMinimum?a.axisX.options.viewportMinimum:a.axisX.options&&a.axisX.options.minimum?a.axisX.options.minimum:-Infinity,s=a.axisX.sessionVariables.newViewportMaximum?
|
|
236
|
+
a.axisX.sessionVariables.newViewportMaximum:a.axisX.options&&a.axisX.options.viewportMaximum?a.axisX.options.viewportMaximum:a.axisX.options&&a.axisX.options.maximum?a.axisX.options.maximum:Infinity;if(p.dataPoints[q].x&&p.dataPoints[q].x.getTime||"dateTime"===p.xValueType)h=!0;for(q=0;q<p.dataPoints.length;q++){"undefined"===typeof p.dataPoints[q].x&&(p.dataPoints[q].x=q+(a.axisX.logarithmic?1:0));p.dataPoints[q].x.getTime?(h=!0,b=p.dataPoints[q].x.getTime()):b=p.dataPoints[q].x;e=n(p.dataPoints[q].y)?
|
|
237
|
+
null:p.dataPoints[q].y;b<c.min&&(c.min=b);b>c.max&&(c.max=b);if(0<q){if(a.axisX.logarithmic){var z=b/p.dataPoints[q-1].x;1>z&&(z=1/z);c.minDiff>z&&1!==z&&(c.minDiff=z)}else z=b-p.dataPoints[q-1].x,0>z&&(z*=-1),c.minDiff>z&&0!==z&&(c.minDiff=z);n(e)||null===p.dataPoints[q-1].y||(a.axisY.logarithmic?0<e&&(z=e/p.dataPoints[q-1].y,1>z&&(z=1/z),g.minDiff>z&&1!==z&&(g.minDiff=z)):(z=e-p.dataPoints[q-1].y,0>z&&(z*=-1),g.minDiff>z&&0!==z&&(g.minDiff=z)))}if(b<x&&!f)null!==e&&(v=b);else{if(!f&&(f=!0,0<q)){q-=
|
|
238
|
+
2;continue}if(b>s&&!d)d=!0;else if(b>s&&d)continue;p.dataPoints[q].label&&(a.axisX.labels[b]=p.dataPoints[q].label);b<c.viewPortMin&&(c.viewPortMin=b);b>c.viewPortMax&&(c.viewPortMax=b);null===e?c.viewPortMin===b&&v<b&&(c.viewPortMin=v):(I[b]=(I[b]||0)+p.dataPoints[q].y,p.dataPointEOs[q].cumulativeY=I[b],a.yTotals[b]=(a.yTotals[b]?a.yTotals[b]:0)+e,a.yAbsTotals[b]=(a.yAbsTotals[b]?a.yAbsTotals[b]:0)+Math.abs(e),0<=e?r=!0:0>e&&(y=!0),k[b]=k[b]?k[b]+Math.abs(e):Math.abs(e))}}p.axisX.valueType=p.xValueType=
|
|
239
|
+
h?"dateTime":"number"}a.axisY.logarithmic?(g.max=n(g.viewPortMax)?99*Math.pow(a.axisY.logarithmBase,-0.05):Math.max(g.viewPortMax,99*Math.pow(a.axisY.logarithmBase,-0.05)),g.min=n(g.viewPortMin)?1:Math.min(g.viewPortMin,1)):r&&!y?(g.max=n(g.viewPortMax)?99:Math.max(g.viewPortMax,99),g.min=n(g.viewPortMin)?1:Math.min(g.viewPortMin,1)):r&&y?(g.max=n(g.viewPortMax)?99:Math.max(g.viewPortMax,99),g.min=n(g.viewPortMin)?-99:Math.min(g.viewPortMin,-99)):!r&&y&&(g.max=n(g.viewPortMax)?-1:Math.max(g.viewPortMax,
|
|
240
|
+
-1),g.min=n(g.viewPortMin)?-99:Math.min(g.viewPortMin,-99));g.viewPortMin=g.min;g.viewPortMax=g.max;a.dataPointYSums=k}};m.prototype._processMultiYPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var g=a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,h,r,y=!1,I=0;I<a.dataSeriesIndexes.length;I++){var k=this.data[a.dataSeriesIndexes[I]],l=0,p=!1,q=!1,f,d,n;if("normal"===k.axisPlacement||"xySwapped"===k.axisPlacement)var x=a.axisX.sessionVariables.newViewportMinimum?a.axisX.sessionVariables.newViewportMinimum:
|
|
241
241
|
a.axisX.options&&a.axisX.options.viewportMinimum?a.axisX.options.viewportMinimum:a.axisX.options&&a.axisX.options.minimum?a.axisX.options.minimum:a.axisX.logarithmic?0:-Infinity,s=a.axisX.sessionVariables.newViewportMaximum?a.axisX.sessionVariables.newViewportMaximum:a.axisX.options&&a.axisX.options.viewportMaximum?a.axisX.options.viewportMaximum:a.axisX.options&&a.axisX.options.maximum?a.axisX.options.maximum:Infinity;if(k.dataPoints[l].x&&k.dataPoints[l].x.getTime||"dateTime"===k.xValueType)y=!0;
|
|
242
|
-
for(l=0;l<k.dataPoints.length;l++){"undefined"===typeof k.dataPoints[l].x&&(k.dataPoints[l].x=l+(a.axisX.logarithmic?1:0));k.dataPoints[l].x.getTime?(y=!0,b=k.dataPoints[l].x.getTime()):b=k.dataPoints[l].x;if((e=k.dataPoints[l].y)&&e.length){h=Math.min.apply(null,e);
|
|
243
|
-
c.minDiff>d&&1!==d&&(c.minDiff=d)):(d=b-k.dataPoints[l-1].x,0>d&&(d*=-1),c.minDiff>d&&0!==d&&(c.minDiff=d)),e&&(null!==e[0]&&k.dataPoints[l-1].y&&null!==k.dataPoints[l-1].y[0])&&(a.axisY.logarithmic?(d=e[0]/k.dataPoints[l-1].y[0],1>d&&(d=1/d),g.minDiff>d&&1!==d&&(g.minDiff=d)):(d=e[0]-k.dataPoints[l-1].y[0],0>d&&(d*=-1),g.minDiff>d&&0!==d&&(g.minDiff=d))));if(!(b<x)||p){if(!p&&(p=!0,0<l)){l-=2;f=n;continue}if(b>s&&!
|
|
244
|
-
b<c.viewPortMin&&(c.viewPortMin=b);b>c.viewPortMax&&(c.viewPortMax=b);if(c.viewPortMin===b&&e)for(z=0;z<e.length;z++)if(null===e[z]&&f<b){c.viewPortMin=f;break}null===e?c.viewPortMin===b&&f<b&&(c.viewPortMin=f):(h<g.viewPortMin&&(g.viewPortMin=h),
|
|
245
|
-
b,e,h=!1,
|
|
242
|
+
for(l=0;l<k.dataPoints.length;l++){"undefined"===typeof k.dataPoints[l].x&&(k.dataPoints[l].x=l+(a.axisX.logarithmic?1:0));k.dataPoints[l].x.getTime?(y=!0,b=k.dataPoints[l].x.getTime()):b=k.dataPoints[l].x;if((e=k.dataPoints[l].y)&&e.length){h=Math.min.apply(null,e);r=Math.max.apply(null,e);d=!0;for(var z=0;z<e.length;z++)null===e.k&&(d=!1);d&&(p||(n=f),f=b)}b<c.min&&(c.min=b);b>c.max&&(c.max=b);h<g.min&&(g.min=h);r>g.max&&(g.max=r);0<l&&(a.axisX.logarithmic?(d=b/k.dataPoints[l-1].x,1>d&&(d=1/d),
|
|
243
|
+
c.minDiff>d&&1!==d&&(c.minDiff=d)):(d=b-k.dataPoints[l-1].x,0>d&&(d*=-1),c.minDiff>d&&0!==d&&(c.minDiff=d)),e&&(null!==e[0]&&k.dataPoints[l-1].y&&null!==k.dataPoints[l-1].y[0])&&(a.axisY.logarithmic?(d=e[0]/k.dataPoints[l-1].y[0],1>d&&(d=1/d),g.minDiff>d&&1!==d&&(g.minDiff=d)):(d=e[0]-k.dataPoints[l-1].y[0],0>d&&(d*=-1),g.minDiff>d&&0!==d&&(g.minDiff=d))));if(!(b<x)||p){if(!p&&(p=!0,0<l)){l-=2;f=n;continue}if(b>s&&!q)q=!0;else if(b>s&&q)continue;k.dataPoints[l].label&&(a.axisX.labels[b]=k.dataPoints[l].label);
|
|
244
|
+
b<c.viewPortMin&&(c.viewPortMin=b);b>c.viewPortMax&&(c.viewPortMax=b);if(c.viewPortMin===b&&e)for(z=0;z<e.length;z++)if(null===e[z]&&f<b){c.viewPortMin=f;break}null===e?c.viewPortMin===b&&f<b&&(c.viewPortMin=f):(h<g.viewPortMin&&(g.viewPortMin=h),r>g.viewPortMax&&(g.viewPortMax=r))}}k.axisX.valueType=k.xValueType=y?"dateTime":"number"}};m.prototype._processSpecificPlotUnit=function(a){if("waterfall"===a.type&&a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var g=a.axisY.dataInfo,c=a.axisX.dataInfo,
|
|
245
|
+
b,e,h=!1,r=0;r<a.dataSeriesIndexes.length;r++){var y=this.data[a.dataSeriesIndexes[r]],d=0,k=!1,l=!1,p=b=0;if("normal"===y.axisPlacement||"xySwapped"===y.axisPlacement)var q=a.axisX.sessionVariables.newViewportMinimum?a.axisX.sessionVariables.newViewportMinimum:a.axisX.options&&a.axisX.options.viewportMinimum?a.axisX.options.viewportMinimum:a.axisX.options&&a.axisX.options.minimum?a.axisX.options.minimum:a.axisX.logarithmic?0:-Infinity,f=a.axisX.sessionVariables.newViewportMaximum?a.axisX.sessionVariables.newViewportMaximum:
|
|
246
246
|
a.axisX.options&&a.axisX.options.viewportMaximum?a.axisX.options.viewportMaximum:a.axisX.options&&a.axisX.options.maximum?a.axisX.options.maximum:Infinity;if(y.dataPoints[d].x&&y.dataPoints[d].x.getTime||"dateTime"===y.xValueType)h=!0;for(d=0;d<y.dataPoints.length;d++)"undefined"!==typeof y.dataPoints[d].isCumulativeSum&&!0===y.dataPoints[d].isCumulativeSum?(y.dataPointEOs[d].cumulativeSumYStartValue=0,y.dataPointEOs[d].cumulativeSum=0===d?0:y.dataPointEOs[d-1].cumulativeSum,y.dataPoints[d].y=0===
|
|
247
247
|
d?0:y.dataPointEOs[d-1].cumulativeSum):"undefined"!==typeof y.dataPoints[d].isIntermediateSum&&!0===y.dataPoints[d].isIntermediateSum?(y.dataPointEOs[d].cumulativeSumYStartValue=p,y.dataPointEOs[d].cumulativeSum=0===d?0:y.dataPointEOs[d-1].cumulativeSum,y.dataPoints[d].y=0===d?0:b,p=0===d?0:y.dataPointEOs[d-1].cumulativeSum,b=0):(e="number"!==typeof y.dataPoints[d].y?0:y.dataPoints[d].y,y.dataPointEOs[d].cumulativeSumYStartValue=0===d?0:y.dataPointEOs[d-1].cumulativeSum,y.dataPointEOs[d].cumulativeSum=
|
|
248
248
|
0===d?e:y.dataPointEOs[d-1].cumulativeSum+e,b+=e);for(d=0;d<y.dataPoints.length;d++)if("undefined"===typeof y.dataPoints[d].x&&(y.dataPoints[d].x=d+(a.axisX.logarithmic?1:0)),y.dataPoints[d].x.getTime?(h=!0,b=y.dataPoints[d].x.getTime()):b=y.dataPoints[d].x,e=y.dataPoints[d].y,b<c.min&&(c.min=b),b>c.max&&(c.max=b),y.dataPointEOs[d].cumulativeSum<g.min&&(g.min=y.dataPointEOs[d].cumulativeSum),y.dataPointEOs[d].cumulativeSum>g.max&&(g.max=y.dataPointEOs[d].cumulativeSum),0<d&&(a.axisX.logarithmic?(p=
|
|
249
|
-
b/y.dataPoints[d-1].x,1>p&&(p=1/p),c.minDiff>p&&1!==p&&(c.minDiff=p)):(p=b-y.dataPoints[d-1].x,0>p&&(p*=-1),c.minDiff>p&&0!==p&&(c.minDiff=p)),null!==e&&null!==y.dataPoints[d-1].y&&(a.axisY.logarithmic?(e=y.dataPointEOs[d].cumulativeSum/y.dataPointEOs[d-1].cumulativeSum,1>e&&(e=1/e),g.minDiff>e&&1!==e&&(g.minDiff=e)):(e=y.dataPointEOs[d].cumulativeSum-y.dataPointEOs[d-1].cumulativeSum,0>e&&(e*=-1),g.minDiff>e&&0!==e&&(g.minDiff=e)))),!(b<
|
|
249
|
+
b/y.dataPoints[d-1].x,1>p&&(p=1/p),c.minDiff>p&&1!==p&&(c.minDiff=p)):(p=b-y.dataPoints[d-1].x,0>p&&(p*=-1),c.minDiff>p&&0!==p&&(c.minDiff=p)),null!==e&&null!==y.dataPoints[d-1].y&&(a.axisY.logarithmic?(e=y.dataPointEOs[d].cumulativeSum/y.dataPointEOs[d-1].cumulativeSum,1>e&&(e=1/e),g.minDiff>e&&1!==e&&(g.minDiff=e)):(e=y.dataPointEOs[d].cumulativeSum-y.dataPointEOs[d-1].cumulativeSum,0>e&&(e*=-1),g.minDiff>e&&0!==e&&(g.minDiff=e)))),!(b<q)||k){if(!k&&(k=!0,0<d)){d-=2;continue}if(b>f&&!l)l=!0;else if(b>
|
|
250
250
|
f&&l)continue;y.dataPoints[d].label&&(a.axisX.labels[b]=y.dataPoints[d].label);b<c.viewPortMin&&(c.viewPortMin=b);b>c.viewPortMax&&(c.viewPortMax=b);0<d&&(y.dataPointEOs[d-1].cumulativeSum<g.viewPortMin&&(g.viewPortMin=y.dataPointEOs[d-1].cumulativeSum),y.dataPointEOs[d-1].cumulativeSum>g.viewPortMax&&(g.viewPortMax=y.dataPointEOs[d-1].cumulativeSum));y.dataPointEOs[d].cumulativeSum<g.viewPortMin&&(g.viewPortMin=y.dataPointEOs[d].cumulativeSum);y.dataPointEOs[d].cumulativeSum>g.viewPortMax&&(g.viewPortMax=
|
|
251
251
|
y.dataPointEOs[d].cumulativeSum)}y.axisX.valueType=y.xValueType=h?"dateTime":"number"}};m.prototype.calculateAutoBreaks=function(){function a(a,b,c,e){if(e)return c=Math.pow(Math.min(c*a/b,b/a),0.2),1>=c&&(c=Math.pow(1>a?1/a:Math.min(b/a,a),0.25)),{startValue:a*c,endValue:b/c};c=0.2*Math.min(c-b+a,b-a);0>=c&&(c=0.25*Math.min(b-a,Math.abs(a)));return{startValue:a+c,endValue:b-c}}function g(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){var b=a.axisX.scaleBreaks&&a.axisX.scaleBreaks.autoCalculate&&
|
|
252
|
-
1<=a.axisX.scaleBreaks.maxNumberOfAutoBreaks,c=a.axisY.scaleBreaks&&a.axisY.scaleBreaks.autoCalculate&&1<=a.axisY.scaleBreaks.maxNumberOfAutoBreaks;if(b||c)for(var f=a.axisY.dataInfo,g=a.axisX.dataInfo,h,
|
|
253
|
-
h=I.dataPoints[y].x.getTime?I.dataPoints[y].x.getTime():I.dataPoints[y].x,
|
|
254
|
-
f[
|
|
255
|
-
l.dataPoints[
|
|
256
|
-
0;
|
|
257
|
-
b.type?g(b):0<=b.type.indexOf("stacked")&&c(b);for(
|
|
258
|
-
d)/b);p<l[f].min&&(l[f].min=p);p>l[f].max&&(l[f].max=p)}delete this._axes[
|
|
259
|
-
l;p>b&&h.push({diff:p,start:l,end:d});break}else y++;if(this._axes[
|
|
260
|
-
this._axes[
|
|
261
|
-
this._axes[
|
|
252
|
+
1<=a.axisX.scaleBreaks.maxNumberOfAutoBreaks,c=a.axisY.scaleBreaks&&a.axisY.scaleBreaks.autoCalculate&&1<=a.axisY.scaleBreaks.maxNumberOfAutoBreaks;if(b||c)for(var f=a.axisY.dataInfo,g=a.axisX.dataInfo,h,r=g.min,k=g.max,l=f.min,p=f.max,g=g._dataRanges,f=f._dataRanges,q,y=0,d=0;d<a.dataSeriesIndexes.length;d++){var I=e.data[a.dataSeriesIndexes[d]];if(!(4>I.dataPoints.length))for(y=0;y<I.dataPoints.length;y++)if(b&&(q=(k+1-r)*Math.max(parseFloat(a.axisX.scaleBreaks.collapsibleThreshold)||10,10)/100,
|
|
253
|
+
h=I.dataPoints[y].x.getTime?I.dataPoints[y].x.getTime():I.dataPoints[y].x,q=Math.floor((h-r)/q),h<g[q].min&&(g[q].min=h),h>g[q].max&&(g[q].max=h)),c){var w=(p+1-l)*Math.max(parseFloat(a.axisY.scaleBreaks.collapsibleThreshold)||10,10)/100;if((h="waterfall"===a.type?I.dataPointEOs[y].cumulativeSum:I.dataPoints[y].y)&&h.length)for(var m=0;m<h.length;m++)q=Math.floor((h[m]-l)/w),h[m]<f[q].min&&(f[q].min=h[m]),h[m]>f[q].max&&(f[q].max=h[m]);else n(h)||(q=Math.floor((h-l)/w),h<f[q].min&&(f[q].min=h),h>
|
|
254
|
+
f[q].max&&(f[q].max=h))}}}}function c(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)&&a.axisX.scaleBreaks&&a.axisX.scaleBreaks.autoCalculate&&1<=a.axisX.scaleBreaks.maxNumberOfAutoBreaks)for(var b=a.axisX.dataInfo,c=b.min,f=b.max,g=b._dataRanges,h,r=0,k=0;k<a.dataSeriesIndexes.length;k++){var l=e.data[a.dataSeriesIndexes[k]];if(!(4>l.dataPoints.length))for(r=0;r<l.dataPoints.length;r++)h=(f+1-c)*Math.max(parseFloat(a.axisX.scaleBreaks.collapsibleThreshold)||10,10)/100,b=l.dataPoints[r].x.getTime?
|
|
255
|
+
l.dataPoints[r].x.getTime():l.dataPoints[r].x,h=Math.floor((b-c)/h),b<g[h].min&&(g[h].min=b),b>g[h].max&&(g[h].max=b)}}for(var b,e=this,h=!1,r=0;r<this._axes.length;r++)if(this._axes[r].scaleBreaks&&this._axes[r].scaleBreaks.autoCalculate&&1<=this._axes[r].scaleBreaks.maxNumberOfAutoBreaks){h=!0;this._axes[r].dataInfo._dataRanges=[];for(var y=0;y<100/Math.max(parseFloat(this._axes[r].scaleBreaks.collapsibleThreshold)||10,10);y++)this._axes[r].dataInfo._dataRanges.push({min:Infinity,max:-Infinity})}if(h){for(r=
|
|
256
|
+
0;r<this.plotInfo.plotTypes.length;r++)for(h=this.plotInfo.plotTypes[r],y=0;y<h.plotUnits.length;y++)b=h.plotUnits[y],"line"===b.type||"stepLine"===b.type||"spline"===b.type||"column"===b.type||"area"===b.type||"stepArea"===b.type||"splineArea"===b.type||"bar"===b.type||"bubble"===b.type||"scatter"===b.type||"candlestick"===b.type||"ohlc"===b.type||"rangeColumn"===b.type||"rangeBar"===b.type||"rangeArea"===b.type||"rangeSplineArea"===b.type||"waterfall"===b.type||"error"===b.type||"boxAndWhisker"===
|
|
257
|
+
b.type?g(b):0<=b.type.indexOf("stacked")&&c(b);for(r=0;r<this._axes.length;r++)if(this._axes[r].dataInfo._dataRanges){var d=this._axes[r].dataInfo.min;b=(this._axes[r].dataInfo.max+1-d)*Math.max(parseFloat(this._axes[r].scaleBreaks.collapsibleThreshold)||10,10)/100;var k=this._axes[r].dataInfo._dataRanges,l,p,h=[];if(this._axes[r].dataInfo.dataPointYPositiveSums){var q=this._axes[r].dataInfo.dataPointYPositiveSums;l=k;for(y in q)if(q.hasOwnProperty(y)&&!isNaN(y)&&(p=q[y],!n(p))){var f=Math.floor((p-
|
|
258
|
+
d)/b);p<l[f].min&&(l[f].min=p);p>l[f].max&&(l[f].max=p)}delete this._axes[r].dataInfo.dataPointYPositiveSums}if(this._axes[r].dataInfo.dataPointYNegativeSums){q=this._axes[r].dataInfo.dataPointYNegativeSums;l=k;for(y in q)q.hasOwnProperty(y)&&!isNaN(y)&&(p=-1*q[y],n(p)||(f=Math.floor((p-d)/b),p<l[f].min&&(l[f].min=p),p>l[f].max&&(l[f].max=p)));delete this._axes[r].dataInfo.dataPointYNegativeSums}for(y=0;y<k.length-1;y++)if(l=k[y].max,isFinite(l))for(;y<k.length-1;)if(d=k[y+1].min,isFinite(d)){p=d-
|
|
259
|
+
l;p>b&&h.push({diff:p,start:l,end:d});break}else y++;if(this._axes[r].scaleBreaks.customBreaks)for(y=0;y<this._axes[r].scaleBreaks.customBreaks.length;y++)for(b=0;b<h.length;b++)if(this._axes[r].scaleBreaks.customBreaks[y].startValue<=h[b].start&&h[b].start<=this._axes[r].scaleBreaks.customBreaks[y].endValue||this._axes[r].scaleBreaks.customBreaks[y].startValue<=h[b].start&&h[b].start<=this._axes[r].scaleBreaks.customBreaks[y].endValue||h[b].start<=this._axes[r].scaleBreaks.customBreaks[y].startValue&&
|
|
260
|
+
this._axes[r].scaleBreaks.customBreaks[y].startValue<=h[b].end||h[b].start<=this._axes[r].scaleBreaks.customBreaks[y].endValue&&this._axes[r].scaleBreaks.customBreaks[y].endValue<=h[b].end)h.splice(b,1),b--;h.sort(function(a,b){return b.diff-a.diff});for(y=0;y<Math.min(h.length,this._axes[r].scaleBreaks.maxNumberOfAutoBreaks);y++)b=a(h[y].start,h[y].end,this._axes[r].logarithmic?this._axes[r].dataInfo.max/this._axes[r].dataInfo.min:this._axes[r].dataInfo.max-this._axes[r].dataInfo.min,this._axes[r].logarithmic),
|
|
261
|
+
this._axes[r].scaleBreaks.autoBreaks.push(new ca(this,"autoBreaks",b,y,++this._eventManager.lastObjectId,this._axes[r].scaleBreaks)),this._axes[r].scaleBreaks._appliedBreaks.push(this._axes[r].scaleBreaks.autoBreaks[this._axes[r].scaleBreaks.autoBreaks.length-1]);this._axes[r].scaleBreaks._appliedBreaks.sort(function(a,b){return a.startValue-b.startValue})}}};m.prototype.renderCrosshairs=function(a){for(var g=0;g<this.axisX.length;g++)this.axisX[g]!=a&&(this.axisX[g].crosshair&&this.axisX[g].crosshair.enabled&&
|
|
262
262
|
!this.axisX[g].crosshair._hidden)&&this.axisX[g].showCrosshair(this.axisX[g].crosshair._updatedValue);for(g=0;g<this.axisX2.length;g++)this.axisX2[g]!=a&&(this.axisX2[g].crosshair&&this.axisX2[g].crosshair.enabled&&!this.axisX2[g].crosshair._hidden)&&this.axisX2[g].showCrosshair(this.axisX2[g].crosshair._updatedValue);for(g=0;g<this.axisY.length;g++)this.axisY[g]!=a&&(this.axisY[g].crosshair&&this.axisY[g].crosshair.enabled&&!this.axisY[g].crosshair._hidden)&&this.axisY[g].showCrosshair(this.axisY[g].crosshair._updatedValue);
|
|
263
263
|
for(g=0;g<this.axisY2.length;g++)this.axisY2[g]!=a&&(this.axisY2[g].crosshair&&this.axisY2[g].crosshair.enabled&&!this.axisY2[g].crosshair._hidden)&&this.axisY2[g].showCrosshair(this.axisY2[g].crosshair._updatedValue)};m.prototype.getDataPointAtXY=function(a,g,c){c=c||!1;for(var b=[],e=this._dataInRenderedOrder.length-1;0<=e;e--){var h=null;(h=this._dataInRenderedOrder[e].getDataPointAtXY(a,g,c))&&b.push(h)}a=null;g=!1;for(c=0;c<b.length;c++)if("line"===b[c].dataSeries.type||"stepLine"===b[c].dataSeries.type||
|
|
264
264
|
"area"===b[c].dataSeries.type||"stepArea"===b[c].dataSeries.type)if(e=ma("markerSize",b[c].dataPoint,b[c].dataSeries)||8,b[c].distance<=e/2){g=!0;break}for(c=0;c<b.length;c++)g&&"line"!==b[c].dataSeries.type&&"stepLine"!==b[c].dataSeries.type&&"area"!==b[c].dataSeries.type&&"stepArea"!==b[c].dataSeries.type||(a?b[c].distance<=a.distance&&(a=b[c]):a=b[c]);return a};m.prototype.getObjectAtXY=function(a,g,c){var b=null;if(c=this.getDataPointAtXY(a,g,c||!1))b=c.dataSeries.dataPointIds[c.dataPointIndex];
|
|
265
265
|
else if(w)b=ab(a,g,this._eventManager.ghostCtx);else for(c=0;c<this.legend.items.length;c++){var e=this.legend.items[c];a>=e.x1&&(a<=e.x2&&g>=e.y1&&g<=e.y2)&&(b=e.id)}return b};m.prototype.getAutoFontSize=nb;m.prototype.resetOverlayedCanvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)};m.prototype.clearCanvas=mb;m.prototype.attachEvent=function(a){this._events.push(a)};m.prototype._touchEventHandler=function(a){if(a.changedTouches&&this.interactivityEnabled){var g=[],c=
|
|
266
266
|
a.changedTouches,b=c?c[0]:a,e=null;switch(a.type){case "touchstart":case "MSPointerDown":g=["mousemove","mousedown"];this._lastTouchData=Pa(b);this._lastTouchData.time=new Date;break;case "touchmove":case "MSPointerMove":g=["mousemove"];break;case "touchend":case "MSPointerUp":var h=this._lastTouchData&&this._lastTouchData.time?new Date-this._lastTouchData.time:0,g="touchstart"===this._lastTouchEventType||"MSPointerDown"===this._lastTouchEventType||300>h?["mouseup","click"]:["mouseup"];break;default:return}if(!(c&&
|
|
267
|
-
1<c.length)){e=Pa(b);e.time=new Date;try{var
|
|
268
|
-
!1,!1,!1,0,null),b.target.dispatchEvent(
|
|
267
|
+
1<c.length)){e=Pa(b);e.time=new Date;try{var r=e.y-this._lastTouchData.y,h=e.time-this._lastTouchData.time;if(1<Math.abs(r)&&this._lastTouchData.scroll||5<Math.abs(r)&&250>h)this._lastTouchData.scroll=!0}catch(y){}this._lastTouchEventType=a.type;if(this._lastTouchData.scroll&&this.zoomEnabled)this.isDrag&&this.resetOverlayedCanvas(),this.isDrag=!1;else for(c=0;c<g.length;c++)if(e=g[c],r=document.createEvent("MouseEvent"),r.initMouseEvent(e,!0,!0,window,1,b.screenX,b.screenY,b.clientX,b.clientY,!1,
|
|
268
|
+
!1,!1,!1,0,null),b.target.dispatchEvent(r),!n(this._lastTouchData.scroll)&&!this._lastTouchData.scroll||!this._lastTouchData.scroll&&250<h||"click"===e)a.preventManipulation&&a.preventManipulation(),a.preventDefault&&a.cancelable&&a.preventDefault()}}};m.prototype._dispatchRangeEvent=function(a,g){var c={chart:this};c.type=a;c.trigger=g;var b=[];this.axisX&&0<this.axisX.length&&b.push("axisX");this.axisX2&&0<this.axisX2.length&&b.push("axisX2");this.axisY&&0<this.axisY.length&&b.push("axisY");this.axisY2&&
|
|
269
269
|
0<this.axisY2.length&&b.push("axisY2");for(var e=0;e<b.length;e++)if(n(c[b[e]])&&(c[b[e]]=[]),"axisY"===b[e])for(var h=0;h<this.axisY.length;h++)c[b[e]].push({viewportMinimum:this[b[e]][h].sessionVariables.newViewportMinimum,viewportMaximum:this[b[e]][h].sessionVariables.newViewportMaximum});else if("axisY2"===b[e])for(h=0;h<this.axisY2.length;h++)c[b[e]].push({viewportMinimum:this[b[e]][h].sessionVariables.newViewportMinimum,viewportMaximum:this[b[e]][h].sessionVariables.newViewportMaximum});else if("axisX"===
|
|
270
270
|
b[e])for(h=0;h<this.axisX.length;h++)c[b[e]].push({viewportMinimum:this[b[e]][h].sessionVariables.newViewportMinimum,viewportMaximum:this[b[e]][h].sessionVariables.newViewportMaximum});else if("axisX2"===b[e])for(h=0;h<this.axisX2.length;h++)c[b[e]].push({viewportMinimum:this[b[e]][h].sessionVariables.newViewportMinimum,viewportMaximum:this[b[e]][h].sessionVariables.newViewportMaximum});this.dispatchEvent(a,c,this)};m.prototype._mouseEventHandler=function(a){function g(){m.capturedEventParam&&(e=
|
|
271
|
-
m.capturedEventParam,
|
|
272
|
-
var c=Pa(a),b=a.type,e,h;a.which?h=3==a.which:a.button&&(h=2==a.button);if(this._ignoreNextEvent)g(),this._ignoreNextEvent=!1;else if(g(),this.interactivityEnabled){a.preventManipulation&&a.preventManipulation();a.preventDefault&&a.preventDefault();var
|
|
273
|
-
this._events[h],
|
|
271
|
+
m.capturedEventParam,r=e.bounds,"mouseup"===b&&(m.capturedEventParam=null,e.chart.overlaidCanvas.releaseCapture?e.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEventListener("mouseup",e.chart._mouseEventHandler,!1)),e.hasOwnProperty(b)&&("mouseup"!==b||e.chart.overlaidCanvas.releaseCapture?a.target!==e.chart.overlaidCanvas&&w||e[b].call(e.context,c.x,c.y):a.target!==e.chart.overlaidCanvas&&(e.chart.isDrag=!1)))}"undefined"===typeof a.target&&a.srcElement&&(a.target=a.srcElement);
|
|
272
|
+
var c=Pa(a),b=a.type,e,h;a.which?h=3==a.which:a.button&&(h=2==a.button);if(this._ignoreNextEvent)g(),this._ignoreNextEvent=!1;else if(g(),this.interactivityEnabled){a.preventManipulation&&a.preventManipulation();a.preventDefault&&a.preventDefault();var r;Ha&&window.console&&(window.console.log(b+" --\x3e x: "+c.x+"; y:"+c.y),h&&window.console.log(a.which),"mouseup"===b&&window.console.log("mouseup"));if(!h){if(!m.capturedEventParam&&this._events){for(h=0;h<this._events.length;h++)if(this._events[h].hasOwnProperty(b))if(e=
|
|
273
|
+
this._events[h],r=e.bounds,c.x>=r.x1&&c.x<=r.x2&&c.y>=r.y1&&c.y<=r.y2){e[b].call(e.context,c.x,c.y);"mousedown"===b&&!0===e.capture?(m.capturedEventParam=e,this.overlaidCanvas.setCapture?this.overlaidCanvas.setCapture():document.documentElement.addEventListener("mouseup",this._mouseEventHandler,!1)):"mouseup"===b&&(e.chart.overlaidCanvas.releaseCapture?e.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEventListener("mouseup",this._mouseEventHandler,!1));break}else e=null;a.target.style.cursor=
|
|
274
274
|
e&&e.cursor?e.cursor:this._defaultCursor}h=this.plotArea;if(c.x<h.x1||c.x>h.x2||c.y<h.y1||c.y>h.y2){this.toolTip&&this.toolTip.enabled?(this.toolTip.hide(),this.toolTip.dispatchEvent("hidden",{chart:this,toolTip:this.toolTip},this.toolTip)):this.resetOverlayedCanvas();for(h=0;h<this.axisX.length;h++)this.axisX[h].crosshair&&this.axisX[h].crosshair.enabled&&(this.axisX[h].crosshair.hide(),this.axisX[h].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisX[h].options},this.axisX[h].crosshair));
|
|
275
275
|
for(h=0;h<this.axisX2.length;h++)this.axisX2[h].crosshair&&this.axisX2[h].crosshair.enabled&&(this.axisX2[h].crosshair.hide(),this.axisX2[h].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisX2[h].options},this.axisX2[h].crosshair));for(h=0;h<this.axisY.length;h++)this.axisY[h].crosshair&&this.axisY[h].crosshair.enabled&&(this.axisY[h].crosshair.hide(),this.axisY[h].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY[h].options},this.axisY[h].crosshair));for(h=0;h<this.axisY2.length;h++)this.axisY2[h].crosshair&&
|
|
276
276
|
this.axisY2[h].crosshair.enabled&&(this.axisY2[h].crosshair.hide(),this.axisY2[h].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY2[h].options},this.axisY2[h].crosshair))}this.isDrag&&this.zoomEnabled||!this._eventManager||this._eventManager.mouseEventHandler(a)}}};m.prototype._plotAreaMouseDown=function(a,g){this.isDrag=!0;this.dragStartPoint={x:a,y:g}};m.prototype._plotAreaMouseUp=function(a,g){if(("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)&&this.isDrag){var c=
|
|
277
|
-
g-this.dragStartPoint.y,b=a-this.dragStartPoint.x,e=0<=this.zoomType.indexOf("x"),h=0<=this.zoomType.indexOf("y"),
|
|
278
|
-
h,
|
|
279
|
-
c.viewportMaximum-h,
|
|
277
|
+
g-this.dragStartPoint.y,b=a-this.dragStartPoint.x,e=0<=this.zoomType.indexOf("x"),h=0<=this.zoomType.indexOf("y"),r=!1;this.resetOverlayedCanvas();if("xySwapped"===this.plotInfo.axisPlacement)var y=h,h=e,e=y;if(this.panEnabled||this.zoomEnabled){if(this.panEnabled)for(e=h=0;e<this._axes.length;e++)c=this._axes[e],c.logarithmic?c.viewportMinimum<c.minimum?(h=c.minimum/c.viewportMinimum,c.sessionVariables.newViewportMinimum=c.viewportMinimum*h,c.sessionVariables.newViewportMaximum=c.viewportMaximum*
|
|
278
|
+
h,r=!0):c.viewportMaximum>c.maximum&&(h=c.viewportMaximum/c.maximum,c.sessionVariables.newViewportMinimum=c.viewportMinimum/h,c.sessionVariables.newViewportMaximum=c.viewportMaximum/h,r=!0):c.viewportMinimum<c.minimum?(h=c.minimum-c.viewportMinimum,c.sessionVariables.newViewportMinimum=c.viewportMinimum+h,c.sessionVariables.newViewportMaximum=c.viewportMaximum+h,r=!0):c.viewportMaximum>c.maximum&&(h=c.viewportMaximum-c.maximum,c.sessionVariables.newViewportMinimum=c.viewportMinimum-h,c.sessionVariables.newViewportMaximum=
|
|
279
|
+
c.viewportMaximum-h,r=!0);else if((!e||2<Math.abs(b))&&(!h||2<Math.abs(c))&&this.zoomEnabled){if(!this.dragStartPoint)return;c=e?this.dragStartPoint.x:this.plotArea.x1;b=h?this.dragStartPoint.y:this.plotArea.y1;e=e?a:this.plotArea.x2;h=h?g:this.plotArea.y2;2<Math.abs(c-e)&&2<Math.abs(b-h)&&this._zoomPanToSelectedRegion(c,b,e,h)&&(r=!0)}r&&(this._ignoreNextEvent=!0,this._dispatchRangeEvent("rangeChanging","zoom"),this.stockChart&&(this.stockChart.navigator&&this.stockChart.navigator.enabled)&&(this.stockChart._rangeEventParameter||
|
|
280
280
|
(this.stockChart._rangeEventParameter={stockChart:this.stockChart,source:"chart",index:this.stockChart.charts.indexOf(this),minimum:this.stockChart.sessionVariables._axisXMin,maximum:this.stockChart.sessionVariables._axisXMax}),this.stockChart._rangeEventParameter.type="rangeChanging",this.stockChart.dispatchEvent("rangeChanging",this.stockChart._rangeEventParameter,this.stockChart)),this.render(),this._dispatchRangeEvent("rangeChanged","zoom"),this.stockChart&&(this.stockChart.rangeUpdatedBy="chart",
|
|
281
|
-
this.stockChart.navigator&&this.stockChart.navigator.enabled&&(this.stockChart._rangeEventParameter.type="rangeChanged",this.stockChart.dispatchEvent("rangeChanged",this.stockChart._rangeEventParameter,this.stockChart))),
|
|
282
|
-
0;
|
|
283
|
-
this.axisY2[
|
|
284
|
-
this.axisY[
|
|
281
|
+
this.stockChart.navigator&&this.stockChart.navigator.enabled&&(this.stockChart._rangeEventParameter.type="rangeChanged",this.stockChart.dispatchEvent("rangeChanged",this.stockChart._rangeEventParameter,this.stockChart))),r&&(this.zoomEnabled&&"none"===this._zoomButton.style.display)&&(La(this._zoomButton,this._resetButton),sa(this,this._zoomButton,"pan"),sa(this,this._resetButton,"reset")))}}this.isDrag=!1;if("none"!==this.plotInfo.axisPlacement){this.resetOverlayedCanvas();if(this.axisX&&0<this.axisX.length)for(r=
|
|
282
|
+
0;r<this.axisX.length;r++)this.axisX[r].crosshair&&this.axisX[r].crosshair.enabled&&this.axisX[r].renderCrosshair(a,g);if(this.axisX2&&0<this.axisX2.length)for(r=0;r<this.axisX2.length;r++)this.axisX2[r].crosshair&&this.axisX2[r].crosshair.enabled&&this.axisX2[r].renderCrosshair(a,g);if(this.axisY&&0<this.axisY.length)for(r=0;r<this.axisY.length;r++)this.axisY[r].crosshair&&this.axisY[r].crosshair.enabled&&this.axisY[r].renderCrosshair(a,g);if(this.axisY2&&0<this.axisY2.length)for(r=0;r<this.axisY2.length;r++)this.axisY2[r].crosshair&&
|
|
283
|
+
this.axisY2[r].crosshair.enabled&&this.axisY2[r].renderCrosshair(a,g);if(this.axisX&&0<this.axisX.length)for(r=0;r<this.axisX.length;r++)this.axisX[r].crosshair&&this.axisX[r].crosshair.enabled&&this.axisX[r].crosshair.renderLabel();if(this.axisX2&&0<this.axisX2.length)for(r=0;r<this.axisX2.length;r++)this.axisX2[r].crosshair&&this.axisX2[r].crosshair.enabled&&this.axisX2[r].crosshair.renderLabel();if(this.axisY&&0<this.axisY.length)for(r=0;r<this.axisY.length;r++)this.axisY[r].crosshair&&this.axisY[r].crosshair.enabled&&
|
|
284
|
+
this.axisY[r].crosshair.renderLabel();if(this.axisY2&&0<this.axisY2.length)for(r=0;r<this.axisY2.length;r++)this.axisY2[r].crosshair&&this.axisY2[r].crosshair.enabled&&this.axisY2[r].crosshair.renderLabel()}};m.prototype._plotAreaMouseMove=function(a,g){if(this.isDrag&&"none"!==this.plotInfo.axisPlacement){var c=0,b=0,e=c=null,e=0<=this.zoomType.indexOf("x"),h=0<=this.zoomType.indexOf("y"),r=this;"xySwapped"===this.plotInfo.axisPlacement&&(c=h,h=e,e=c);c=this.dragStartPoint.x-a;b=this.dragStartPoint.y-
|
|
285
285
|
g;if(2<Math.abs(c)&&8>Math.abs(c)&&(this.panEnabled||this.zoomEnabled)){this.toolTip.hide();this.toolTip&&this.toolTip.enabled&&this.toolTip.dispatchEvent("hidden",{chart:this,toolTip:this.toolTip},this.toolTip);for(var y=0;y<this.axisX.length;y++)this.axisX[y].crosshair&&this.axisX[y].crosshair.enabled&&(this.axisX[y].crosshair.hide(),this.axisX[y].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisX[y].options},this.axisX[y].crosshair));for(y=0;y<this.axisX2.length;y++)this.axisX2[y].crosshair&&
|
|
286
286
|
this.axisX2[y].crosshair.enabled&&(this.axisX2[y].crosshair.hide(),this.axisX2[y].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisX2[y].options},this.axisX2[y].crosshair));for(y=0;y<this.axisY.length;y++)this.axisY[y].crosshair&&this.axisY[y].crosshair.enabled&&(this.axisY[y].crosshair.hide(),this.axisY[y].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY[y].options},this.axisY[y].crosshair));for(y=0;y<this.axisY2.length;y++)this.axisY2[y].crosshair&&this.axisY2[y].crosshair.enabled&&
|
|
287
|
-
(this.axisY2[y].crosshair.hide(),this.axisY2[y].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY2[y].options},this.axisY2[y].crosshair))}else this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,g);if((!e||2<Math.abs(c)||!h||2<Math.abs(b))&&(this.panEnabled||this.zoomEnabled))if(this.panEnabled)e={x1:e?this.plotArea.x1+c:this.plotArea.x1,y1:h?this.plotArea.y1+b:this.plotArea.y1,x2:e?this.plotArea.x2+c:this.plotArea.x2,y2:h?this.plotArea.y2+b:this.plotArea.y2},clearTimeout(
|
|
288
|
-
|
|
289
|
-
"rangeChanged",
|
|
287
|
+
(this.axisY2[y].crosshair.hide(),this.axisY2[y].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY2[y].options},this.axisY2[y].crosshair))}else this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,g);if((!e||2<Math.abs(c)||!h||2<Math.abs(b))&&(this.panEnabled||this.zoomEnabled))if(this.panEnabled)e={x1:e?this.plotArea.x1+c:this.plotArea.x1,y1:h?this.plotArea.y1+b:this.plotArea.y1,x2:e?this.plotArea.x2+c:this.plotArea.x2,y2:h?this.plotArea.y2+b:this.plotArea.y2},clearTimeout(r._panTimerId),
|
|
288
|
+
r._panTimerId=setTimeout(function(b,c,e,f){return function(){r._zoomPanToSelectedRegion(b,c,e,f,!0)&&(r._dispatchRangeEvent("rangeChanging","pan"),r.stockChart&&(r.stockChart.navigator&&r.stockChart.navigator.enabled)&&(r.stockChart._rangeEventParameter.type="rangeChanging",r.stockChart.dispatchEvent("rangeChanging",r.stockChart._rangeEventParameter,r.stockChart)),r.render(),r._dispatchRangeEvent("rangeChanged","pan"),r.stockChart&&(r.stockChart.navigator&&r.stockChart.navigator.enabled)&&(r.stockChart._rangeEventParameter.type=
|
|
289
|
+
"rangeChanged",r.stockChart.dispatchEvent("rangeChanged",r.stockChart._rangeEventParameter,r.stockChart)),r.dragStartPoint.x=a,r.dragStartPoint.y=g)}}(e.x1,e.y1,e.x2,e.y2),0);else if(this.zoomEnabled){this.resetOverlayedCanvas();c=this.overlaidCanvasCtx.globalAlpha;this.overlaidCanvasCtx.fillStyle="#A89896";var b=e?this.dragStartPoint.x:this.plotArea.x1,y=h?this.dragStartPoint.y:this.plotArea.y1,d=e?a-this.dragStartPoint.x:this.plotArea.x2-this.plotArea.x1,k=h?g-this.dragStartPoint.y:this.plotArea.y2-
|
|
290
290
|
this.plotArea.y1;this.validateRegion(b,y,e?a:this.plotArea.x2-this.plotArea.x1,h?g:this.plotArea.y2-this.plotArea.y1,"xy"!==this.zoomType).isValid&&(this.resetOverlayedCanvas(),this.overlaidCanvasCtx.fillStyle="#99B2B5");this.overlaidCanvasCtx.globalAlpha=0.7;this.overlaidCanvasCtx.fillRect(b,y,d,k);this.overlaidCanvasCtx.globalAlpha=c}}else if(this.toolTip.mouseMoveHandler(a,g),"none"!==this.plotInfo.axisPlacement){if(this.axisX&&0<this.axisX.length)for(e=0;e<this.axisX.length;e++)this.axisX[e].crosshair&&
|
|
291
291
|
this.axisX[e].crosshair.enabled&&this.axisX[e].renderCrosshair(a,g);if(this.axisX2&&0<this.axisX2.length)for(e=0;e<this.axisX2.length;e++)this.axisX2[e].crosshair&&this.axisX2[e].crosshair.enabled&&this.axisX2[e].renderCrosshair(a,g);if(this.axisY&&0<this.axisY.length)for(e=0;e<this.axisY.length;e++)this.axisY[e].crosshair&&this.axisY[e].crosshair.enabled&&this.axisY[e].renderCrosshair(a,g);if(this.axisY2&&0<this.axisY2.length)for(e=0;e<this.axisY2.length;e++)this.axisY2[e].crosshair&&this.axisY2[e].crosshair.enabled&&
|
|
292
292
|
this.axisY2[e].renderCrosshair(a,g);if(this.axisX&&0<this.axisX.length)for(e=0;e<this.axisX.length;e++)this.axisX[e].crosshair&&this.axisX[e].crosshair.enabled&&this.axisX[e].crosshair.renderLabel();if(this.axisX2&&0<this.axisX2.length)for(e=0;e<this.axisX2.length;e++)this.axisX2[e].crosshair&&this.axisX2[e].crosshair.enabled&&this.axisX2[e].crosshair.renderLabel();if(this.axisY&&0<this.axisY.length)for(e=0;e<this.axisY.length;e++)this.axisY[e].crosshair&&this.axisY[e].crosshair.enabled&&this.axisY[e].crosshair.renderLabel();
|
|
293
293
|
if(this.axisY2&&0<this.axisY2.length)for(e=0;e<this.axisY2.length;e++)this.axisY2[e].crosshair&&this.axisY2[e].crosshair.enabled&&this.axisY2[e].crosshair.renderLabel()}};m.prototype._zoomPanToSelectedRegion=function(a,g,c,b,e){a=this.validateRegion(a,g,c,b,e);g=a.axesWithValidRange;c=a.axesRanges;if(a.isValid)for(b=0;b<g.length;b++)e=c[b],g[b].setViewPortRange(e.val1,e.val2),this.syncCharts&&"y"!=this.zoomType&&this.syncCharts(e.val1,e.val2),this.stockChart&&(this.stockChart._rangeEventParameter=
|
|
294
|
-
{stockChart:this.stockChart,source:"chart",index:this.stockChart.charts.indexOf(this),minimum:e.val1,maximum:e.val2});return a.isValid};m.prototype.validateRegion=function(a,g,c,b,e){e=e||!1;for(var h=0<=this.zoomType.indexOf("x"),
|
|
295
|
-
y:b});if(
|
|
294
|
+
{stockChart:this.stockChart,source:"chart",index:this.stockChart.charts.indexOf(this),minimum:e.val1,maximum:e.val2});return a.isValid};m.prototype.validateRegion=function(a,g,c,b,e){e=e||!1;for(var h=0<=this.zoomType.indexOf("x"),r=0<=this.zoomType.indexOf("y"),y=!1,d=[],k=[],l=[],p=0;p<this._axes.length;p++)("axisX"===this._axes[p].type&&h||"axisY"===this._axes[p].type&&r)&&k.push(this._axes[p]);for(r=0;r<k.length;r++){var p=k[r],h=!1,q=p.convertPixelToValue({x:a,y:g}),f=p.convertPixelToValue({x:c,
|
|
295
|
+
y:b});if(q>f)var n=f,f=q,q=n;if(p.scaleBreaks)for(n=0;!h&&n<p.scaleBreaks._appliedBreaks.length;n++)h=p.scaleBreaks._appliedBreaks[n].startValue<=q&&p.scaleBreaks._appliedBreaks[n].endValue>=f;if(isFinite(p.dataInfo.minDiff))if(n=p.getApparentDifference(q,f,null,!0),!(h||!(this.panEnabled&&p.scaleBreaks&&p.scaleBreaks._appliedBreaks.length)&&(p.logarithmic&&n<Math.pow(p.dataInfo.minDiff,3)||!p.logarithmic&&n<3*Math.abs(p.dataInfo.minDiff))||q<p.minimum||f>p.maximum))d.push(p),l.push({val1:q,val2:f}),
|
|
296
296
|
y=!0;else if(!e){y=!1;break}}return{isValid:y,axesWithValidRange:d,axesRanges:l}};m.prototype.preparePlotArea=function(){var a=this.plotArea;!w&&(0<a.x1||0<a.y1)&&a.ctx.translate(a.x1,a.y1);if((this.axisX[0]||this.axisX2[0])&&(this.axisY[0]||this.axisY2[0])){var g=this.axisX[0]?this.axisX[0].lineCoordinates:this.axisX2[0].lineCoordinates;if(this.axisY&&0<this.axisY.length&&this.axisY[0]){var c=this.axisY[0];a.x1=g.x1<g.x2?g.x1:c.lineCoordinates.x1;a.y1=g.y1<c.lineCoordinates.y1?g.y1:c.lineCoordinates.y1;
|
|
297
297
|
a.x2=g.x2>c.lineCoordinates.x2?g.x2:c.lineCoordinates.x2;a.y2=g.y1>c.lineCoordinates.y2?g.y1:c.lineCoordinates.y2;a.width=a.x2-a.x1;a.height=a.y2-a.y1}this.axisY2&&0<this.axisY2.length&&this.axisY2[0]&&(c=this.axisY2[0],a.x1=g.x1<g.x2?g.x1:c.lineCoordinates.x1,a.y1=g.y1<c.lineCoordinates.y1?g.y1:c.lineCoordinates.y1,a.x2=g.x2>c.lineCoordinates.x2?g.x2:c.lineCoordinates.x2,a.y2=g.y2>c.lineCoordinates.y2?g.y2:c.lineCoordinates.y2,a.width=a.x2-a.x1,a.height=a.y2-a.y1)}else g=this.layoutManager.getFreeSpace(),
|
|
298
|
-
a.x1=g.x1,a.x2=g.x2,a.y1=g.y1,a.y2=g.y2,a.width=g.width,a.height=g.height;w||(a.canvas.width=a.width,a.canvas.height=a.height,a.canvas.style.left=a.x1+"px",a.canvas.style.top=a.y1+"px",(0<a.x1||0<a.y1)&&a.ctx.translate(-a.x1,-a.y1));a.layoutManager=new Ea(a.x1,a.y1,a.x2,a.y2,2)};m.prototype.renderIndexLabels=function(a){var g=a||this.plotArea.ctx,c=this.plotArea,b=0,e=0,h=0,
|
|
299
|
-
l.dataPoint,l.dataSeries),Ra=ma("indexLabelFontSize",l.dataPoint,l.dataSeries),d=ma("indexLabelFontFamily",l.dataPoint,l.dataSeries),k=ma("indexLabelFontStyle",l.dataPoint,l.dataSeries);
|
|
298
|
+
a.x1=g.x1,a.x2=g.x2,a.y1=g.y1,a.y2=g.y2,a.width=g.width,a.height=g.height;w||(a.canvas.width=a.width,a.canvas.height=a.height,a.canvas.style.left=a.x1+"px",a.canvas.style.top=a.y1+"px",(0<a.x1||0<a.y1)&&a.ctx.translate(-a.x1,-a.y1));a.layoutManager=new Ea(a.x1,a.y1,a.x2,a.y2,2)};m.prototype.renderIndexLabels=function(a){var g=a||this.plotArea.ctx,c=this.plotArea,b=0,e=0,h=0,r=e=h=0,y=0,d=b=0,k=0;for(a=0;a<this._indexLabels.length;a++){var l=this._indexLabels[a],p=l.chartType.toLowerCase(),q,f,y=ma("indexLabelFontColor",
|
|
299
|
+
l.dataPoint,l.dataSeries),Ra=ma("indexLabelFontSize",l.dataPoint,l.dataSeries),d=ma("indexLabelFontFamily",l.dataPoint,l.dataSeries),k=ma("indexLabelFontStyle",l.dataPoint,l.dataSeries);q=ma("indexLabelFontWeight",l.dataPoint,l.dataSeries);var v=ma("indexLabelBackgroundColor",l.dataPoint,l.dataSeries);f=ma("indexLabelMaxWidth",l.dataPoint,l.dataSeries);var h=ma("indexLabelWrap",l.dataPoint,l.dataSeries),x=ma("indexLabelLineDashType",l.dataPoint,l.dataSeries),s=ma("indexLabelLineColor",l.dataPoint,
|
|
300
300
|
l.dataSeries),z=n(l.dataPoint.indexLabelLineThickness)?n(l.dataSeries.options.indexLabelLineThickness)?0:l.dataSeries.options.indexLabelLineThickness:l.dataPoint.indexLabelLineThickness,b=0<z?Math.min(10,("normal"===this.plotInfo.axisPlacement?this.plotArea.height:this.plotArea.width)<<0):0,u={percent:null,total:null},m=null;if(0<=l.dataSeries.type.indexOf("stacked")||"pie"===l.dataSeries.type||"doughnut"===l.dataSeries.type)u=this.getPercentAndTotal(l.dataSeries,l.dataPoint);if(l.dataSeries.indexLabelFormatter||
|
|
301
301
|
l.dataPoint.indexLabelFormatter)m={chart:this,dataSeries:l.dataSeries,dataPoint:l.dataPoint,index:l.indexKeyword,total:u.total,percent:u.percent};var C=l.dataPoint.indexLabelFormatter?l.dataPoint.indexLabelFormatter(m):l.dataPoint.indexLabel?this.replaceKeywordsWithValue(l.dataPoint.indexLabel,l.dataPoint,l.dataSeries,null,l.indexKeyword):l.dataSeries.indexLabelFormatter?l.dataSeries.indexLabelFormatter(m):l.dataSeries.indexLabel?this.replaceKeywordsWithValue(l.dataSeries.indexLabel,l.dataPoint,l.dataSeries,
|
|
302
|
-
null,l.indexKeyword):null;if(null!==C&&""!==C){var u=ma("indexLabelPlacement",l.dataPoint,l.dataSeries),m=ma("indexLabelOrientation",l.dataPoint,l.dataSeries),D=ma("indexLabelTextAlign",l.dataPoint,l.dataSeries),t=l.direction,e=l.dataSeries.axisX,
|
|
303
|
-
v.measureText();l.dataSeries.indexLabelMaxWidth=v.maxWidth;if("stackedarea100"===p){if(l.point.x<c.x1||l.point.x>c.x2||l.point.y<c.y1-1||l.point.y>c.y2+1)continue}else if("rangearea"===p||"rangesplinearea"===p){if(l.dataPoint.x<e.viewportMinimum||l.dataPoint.x>e.viewportMaximum||Math.max.apply(null,l.dataPoint.y)<
|
|
304
|
-
e.viewportMinimum||l.dataPoint.x>e.viewportMaximum||l.dataPoint.y<
|
|
305
|
-
p){if(l.dataPoint.x<e.viewportMinimum||l.dataPoint.x>e.viewportMaximum||Math.max.apply(null,l.dataPoint.y)<
|
|
306
|
-
p||"scatter"===p)u="inside";
|
|
302
|
+
null,l.indexKeyword):null;if(null!==C&&""!==C){var u=ma("indexLabelPlacement",l.dataPoint,l.dataSeries),m=ma("indexLabelOrientation",l.dataPoint,l.dataSeries),D=ma("indexLabelTextAlign",l.dataPoint,l.dataSeries),t=l.direction,e=l.dataSeries.axisX,r=l.dataSeries.axisY,B=!1,v=new ja(g,{x:0,y:0,maxWidth:f?f:0.5*this.width,maxHeight:h?5*Ra:1.5*Ra,angle:"horizontal"===m?0:-90,text:C,padding:0,backgroundColor:v,textAlign:D,fontSize:Ra,fontFamily:d,fontWeight:q,fontColor:y,fontStyle:k,textBaseline:"middle"});
|
|
303
|
+
v.measureText();l.dataSeries.indexLabelMaxWidth=v.maxWidth;if("stackedarea100"===p){if(l.point.x<c.x1||l.point.x>c.x2||l.point.y<c.y1-1||l.point.y>c.y2+1)continue}else if("rangearea"===p||"rangesplinearea"===p){if(l.dataPoint.x<e.viewportMinimum||l.dataPoint.x>e.viewportMaximum||Math.max.apply(null,l.dataPoint.y)<r.viewportMinimum||Math.min.apply(null,l.dataPoint.y)>r.viewportMaximum)continue}else if(0<=p.indexOf("line")||0<=p.indexOf("area")||0<=p.indexOf("bubble")||0<=p.indexOf("scatter")){if(l.dataPoint.x<
|
|
304
|
+
e.viewportMinimum||l.dataPoint.x>e.viewportMaximum||l.dataPoint.y<r.viewportMinimum||l.dataPoint.y>r.viewportMaximum)continue}else if(0<=p.indexOf("column")||"waterfall"===p||"error"===p&&!l.axisSwapped){if(l.dataPoint.x<e.viewportMinimum||l.dataPoint.x>e.viewportMaximum||l.bounds.y1>c.y2||l.bounds.y2<c.y1)continue}else if(0<=p.indexOf("bar")||"error"===p){if(l.dataPoint.x<e.viewportMinimum||l.dataPoint.x>e.viewportMaximum||l.bounds.x1>c.x2||l.bounds.x2<c.x1)continue}else if("candlestick"===p||"ohlc"===
|
|
305
|
+
p){if(l.dataPoint.x<e.viewportMinimum||l.dataPoint.x>e.viewportMaximum||Math.max.apply(null,l.dataPoint.y)<r.viewportMinimum||Math.min.apply(null,l.dataPoint.y)>r.viewportMaximum)continue}else if(l.dataPoint.x<e.viewportMinimum||l.dataPoint.x>e.viewportMaximum)continue;r=y=2;"horizontal"===m?(d=v.width,k=v.height):(k=v.width,d=v.height);if("normal"===this.plotInfo.axisPlacement){if(0<=p.indexOf("line")||0<=p.indexOf("area"))u="auto",y=4;else if(0<=p.indexOf("stacked"))"auto"===u&&(u="inside");else if("bubble"===
|
|
306
|
+
p||"scatter"===p)u="inside";q=l.point.x-d/2+("horizontal"===m?0:v._lineHeight/2);if("inside"!==u)e=c.y1,h=c.y2,0<t?(f=l.point.y+v._lineHeight/2-k-y-b,f<e&&(f="auto"===u?Math.max(l.point.y,e)+v._lineHeight/2+y+b:e+v._lineHeight/2+y+b,B=f+("horizontal"===m?k-v._lineHeight/2:0)>l.point.y,!B||(0<=p.indexOf("line")||0<=p.indexOf("area"))||(f-=b))):(f=l.point.y+v._lineHeight/2+y+b,f>h-k+v._lineHeight/2-y&&(f="auto"===u?Math.min(l.point.y,h)+v._lineHeight/2-k-y-b:h+v._lineHeight/2-k-y-b,B=f-("horizontal"===
|
|
307
307
|
m?v._lineHeight/2:k)<l.point.y,!B||(0<=p.indexOf("line")||0<=p.indexOf("area"))||(f+=b)));else{Math.max(l.bounds.y1,c.y1);h=Math.min(l.bounds.y2,c.y2)-k+v._lineHeight/2;b=0<=p.indexOf("range")||"error"===p?0<t?Math.max(l.bounds.y1,c.y1)+v._lineHeight/2+y:Math.min(l.bounds.y2,c.y2)+v._lineHeight/2-k-y:(Math.max(l.bounds.y1,c.y1)+Math.min(l.bounds.y2,c.y2))/2-k/2+v._lineHeight/2;if(0<t){if(f=b,"bubble"===p||"scatter"===p)f=l.point.y-k/2+v._lineHeight/2,k>l.bounds.y2-l.bounds.y1&&(f-=k/2+y),0>f-v._lineHeight/
|
|
308
|
-
2&&(f+=Math.abs(f-v._lineHeight/2)<=(l.bounds.y2-l.bounds.y1)/2+y?Math.abs(f-v._lineHeight/2):(l.bounds.y2-l.bounds.y1)/2+y)}else f=Math.min(l.point.y,b),f>h-k-y&&("bubble"===p||"scatter"===p)&&(f=Math.min(l.point.y+y,c.y2-k-y));f=Math.min(f,h)}}else 0<=p.indexOf("line")||0<=p.indexOf("area")||0<=p.indexOf("scatter")?(u="auto",
|
|
309
|
-
m?0:v._lineHeight/2)-
|
|
310
|
-
2)<l.point.x)&&(
|
|
311
|
-
(B=0<t?f+("horizontal"===m?k-v._lineHeight/2:0)>l.point.y:f-("horizontal"===m?v._lineHeight/2:k)<l.point.y),"bubble"===p||"scatter"===p)&&(
|
|
312
|
-
s?s:"gray",g.setLineDash&&g.setLineDash(G(x,z)),g.beginPath(),g.moveTo(l.point.x,l.point.y),0<=p.indexOf("bar")||"error"===p&&l.axisSwapped?g.lineTo(
|
|
313
|
-
m?0:v._lineHeight/2),"vertical"===m?0<t&&f<l.point.y?f:0>t&&f-k>l.point.y?f-k:l.point.y:0<t&&f+k-v._lineHeight/2<l.point.y?f+k-v._lineHeight/2:0>t&&f-v._lineHeight/2>l.point.y?f-v._lineHeight/2:l.point.y):g.lineTo(
|
|
314
|
-
for(a=0;a<this._indexLabels.length;a++)l=this._indexLabels[a],v=ma("indexLabelBackgroundColor",l.dataPoint,l.dataSeries),l.dataSeries.indexLabelBackgroundColor=n(v)?w?"transparent":null:v;return g};m.prototype.renderLine=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;c.save();var e=this.plotArea;c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();for(var h=[],
|
|
315
|
-
a.dataSeriesIndexes[y],k=this.data[d];c.lineWidth=k.lineThickness;var l=k.dataPoints,p="solid";if(c.setLineDash){var
|
|
308
|
+
2&&(f+=Math.abs(f-v._lineHeight/2)<=(l.bounds.y2-l.bounds.y1)/2+y?Math.abs(f-v._lineHeight/2):(l.bounds.y2-l.bounds.y1)/2+y)}else f=Math.min(l.point.y,b),f>h-k-y&&("bubble"===p||"scatter"===p)&&(f=Math.min(l.point.y+y,c.y2-k-y));f=Math.min(f,h)}}else 0<=p.indexOf("line")||0<=p.indexOf("area")||0<=p.indexOf("scatter")?(u="auto",r=4):0<=p.indexOf("stacked")?"auto"===u&&(u="inside"):"bubble"===p&&(u="inside"),f=l.point.y+v._lineHeight/2-k/2,"inside"!==u?(h=c.x1,e=c.x2,0>t?(q=l.point.x-d+("horizontal"===
|
|
309
|
+
m?0:v._lineHeight/2)-r-b,("horizontal"===m?q:q-v._lineHeight/2)<h&&(q="auto"===u?Math.max(l.point.x,h)+("horizontal"===m?0:v._lineHeight/2)+y+b:h+("horizontal"===m?0:v._lineHeight/2)+r,(B=q+d-("horizontal"===m?0:v._lineHeight/2)>l.point.x)&&(q-=b))):(q=l.point.x+("horizontal"===m?0:v._lineHeight/2)+r+b,("horizontal"===m?q:q-v._lineHeight/2)>e-d-r-b&&(q="auto"===u?Math.min(l.point.x,e)-("horizontal"===m?d:d-v._lineHeight/2)-r-b:e-d-r+("horizontal"===m?0:v._lineHeight/2),(B=q-("horizontal"===m?0:v._lineHeight/
|
|
310
|
+
2)<l.point.x)&&(q+=b)))):(h=Math.max(l.bounds.x1,c.x1),Math.min(l.bounds.x2,c.x2),b=0<=p.indexOf("range")||"error"===p?0>t?Math.max(l.bounds.x1,c.x1):Math.min(l.bounds.x2,c.x2)-d-r+("horizontal"===m?0:v._lineHeight/2):(Math.max(l.bounds.x1,c.x1)+Math.min(l.bounds.x2,c.x2))/2-d/2+("horizontal"===m?0:v._lineHeight/2),q=0>t?b:Math.min(l.point.x,b),q=Math.max(q,h+("horizontal"===m?0:v._lineHeight/2+y)));"vertical"===m&&(f+=k-v._lineHeight/2,0<="ohlc candlestick boxandwhisker column rangecolumn stackedcolumn stackedcolumn100 error".split(" ").indexOf(p)&&
|
|
311
|
+
(B=0<t?f+("horizontal"===m?k-v._lineHeight/2:0)>l.point.y:f-("horizontal"===m?v._lineHeight/2:k)<l.point.y),"bubble"===p||"scatter"===p)&&(q+=v._lineHeight/2-Ra/2);v.x=q;v.y=f;v.render(!0);z&&("inside"!==u&&(0>p.indexOf("bar")&&("error"!==p||!l.axisSwapped)&&l.point.x>c.x1&&l.point.x<c.x2||!B)&&(-1==="ohlc candlestick boxandwhisker column rangecolumn stackedcolumn stackedcolumn100 error".split(" ").indexOf(p)&&("error"!==p||l.axisSwapped)&&l.point.y>c.y1&&l.point.y<c.y2||!B))&&(g.lineWidth=z,g.strokeStyle=
|
|
312
|
+
s?s:"gray",g.setLineDash&&g.setLineDash(G(x,z)),g.beginPath(),g.moveTo(l.point.x,l.point.y),0<=p.indexOf("bar")||"error"===p&&l.axisSwapped?g.lineTo(q+(0<l.direction?0:d)+("vertical"===m?-v._lineHeight/2:0),f+("vertical"===m?-k/2:k/2-v._lineHeight/2)):0<=p.indexOf("column")||"error"===p&&!l.axisSwapped?g.lineTo(q+d/2-("horizontal"===m?0:v._lineHeight/2),f+("vertical"===m?f-k<l.point.y?0:-k:(f-v._lineHeight/2<l.point.y?k:0)-v._lineHeight/2)):0<=p.indexOf("waterfall")?g.lineTo(q+d/2-("horizontal"===
|
|
313
|
+
m?0:v._lineHeight/2),"vertical"===m?0<t&&f<l.point.y?f:0>t&&f-k>l.point.y?f-k:l.point.y:0<t&&f+k-v._lineHeight/2<l.point.y?f+k-v._lineHeight/2:0>t&&f-v._lineHeight/2>l.point.y?f-v._lineHeight/2:l.point.y):g.lineTo(q+d/2-("horizontal"===m?0:v._lineHeight/2),f+("vertical"===m?f-k<l.point.y?0:-k:(f+k-v._lineHeight/2<l.point.y?k:0)-v._lineHeight/2)),g.stroke())}}g={source:g,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0,startTimePercent:0.7};
|
|
314
|
+
for(a=0;a<this._indexLabels.length;a++)l=this._indexLabels[a],v=ma("indexLabelBackgroundColor",l.dataPoint,l.dataSeries),l.dataSeries.indexLabelBackgroundColor=n(v)?w?"transparent":null:v;return g};m.prototype.renderLine=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;c.save();var e=this.plotArea;c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();for(var h=[],r,y=0;y<a.dataSeriesIndexes.length;y++){var d=
|
|
315
|
+
a.dataSeriesIndexes[y],k=this.data[d];c.lineWidth=k.lineThickness;var l=k.dataPoints,p="solid";if(c.setLineDash){var q=G(k.nullDataLineDashType,k.lineThickness),p=k.lineDashType,f=G(p,k.lineThickness);c.setLineDash(f)}var n=k.id;this._eventManager.objectMap[n]={objectType:"dataSeries",dataSeriesIndex:d};n=X(n);b.strokeStyle=n;b.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var n=k._colorSet,v=n=k.lineColor=k.options.lineColor?k.options.lineColor:n[0];c.strokeStyle=n;var x=!0,s=0,z,u;c.beginPath();
|
|
316
316
|
if(0<l.length){for(var m=!1,s=0;s<l.length;s++)if(z=l[s].x.getTime?l[s].x.getTime():l[s].x,!(z<a.axisX.dataInfo.viewPortMin||z>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!m)))if("number"!==typeof l[s].y)0<s&&!(k.connectNullData||m||x)&&(c.stroke(),w&&b.stroke()),m=!0;else{z=a.axisX.convertValueToPixel(z);u=a.axisY.convertValueToPixel(l[s].y);var C=k.dataPointIds[s];this._eventManager.objectMap[C]={id:C,objectType:"dataPoint",dataSeriesIndex:d,dataPointIndex:s,x1:z,y1:u};x||m?(!x&&k.connectNullData?
|
|
317
|
-
(c.setLineDash&&(k.options.nullDataLineDashType||p===k.lineDashType&&k.lineDashType!==k.nullDataLineDashType)&&(c.stroke(),c.beginPath(),c.moveTo(
|
|
317
|
+
(c.setLineDash&&(k.options.nullDataLineDashType||p===k.lineDashType&&k.lineDashType!==k.nullDataLineDashType)&&(c.stroke(),c.beginPath(),c.moveTo(r.x,r.y),p=k.nullDataLineDashType,c.setLineDash(q)),c.lineTo(z,u),w&&b.lineTo(z,u)):(c.beginPath(),c.moveTo(z,u),w&&(b.beginPath(),b.moveTo(z,u))),m=x=!1):(c.lineTo(z,u),w&&b.lineTo(z,u),0==s%500&&(c.stroke(),c.beginPath(),c.moveTo(z,u),w&&(b.stroke(),b.beginPath(),b.moveTo(z,u))));r={x:z,y:u};s<l.length-1&&(v!==(l[s].lineColor||n)||p!==(l[s].lineDashType||
|
|
318
318
|
k.lineDashType))&&(c.stroke(),c.beginPath(),c.moveTo(z,u),v=l[s].lineColor||n,c.strokeStyle=v,c.setLineDash&&(l[s].lineDashType?(p=l[s].lineDashType,c.setLineDash(G(p,k.lineThickness))):(p=k.lineDashType,c.setLineDash(f))));if(0!==l[s].markerSize&&(0<l[s].markerSize||0<k.markerSize)){var D=k.getMarkerProperties(s,z,u,c);h.push(D);C=X(C);w&&h.push({x:z,y:u,ctx:b,type:D.type,size:D.size,color:C,borderColor:C,borderThickness:D.borderThickness})}(l[s].indexLabel||k.indexLabel||l[s].indexLabelFormatter||
|
|
319
319
|
k.indexLabelFormatter)&&this._indexLabels.push({chartType:"line",dataPoint:l[s],dataSeries:k,point:{x:z,y:u},direction:0>l[s].y===a.axisY.reversed?1:-1,color:n})}c.stroke();w&&b.stroke()}}W.drawMarkers(h);w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,
|
|
320
320
|
0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),b.beginPath());c.restore();c.beginPath();return{source:g,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};m.prototype.renderStepLine=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;c.save();var e=this.plotArea;c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();for(var h=
|
|
321
|
-
[],
|
|
321
|
+
[],r,y=0;y<a.dataSeriesIndexes.length;y++){var d=a.dataSeriesIndexes[y],k=this.data[d];c.lineWidth=k.lineThickness;var l=k.dataPoints,p="solid";if(c.setLineDash){var q=G(k.nullDataLineDashType,k.lineThickness),p=k.lineDashType,f=G(p,k.lineThickness);c.setLineDash(f)}var n=k.id;this._eventManager.objectMap[n]={objectType:"dataSeries",dataSeriesIndex:d};n=X(n);b.strokeStyle=n;b.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var n=k._colorSet,v=n=k.lineColor=k.options.lineColor?k.options.lineColor:
|
|
322
322
|
n[0];c.strokeStyle=n;var x=!0,s=0,z,u;c.beginPath();if(0<l.length){for(var m=!1,s=0;s<l.length;s++)if(z=l[s].getTime?l[s].x.getTime():l[s].x,!(z<a.axisX.dataInfo.viewPortMin||z>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!m)))if("number"!==typeof l[s].y)0<s&&!(k.connectNullData||m||x)&&(c.stroke(),w&&b.stroke()),m=!0;else{var C=u;z=a.axisX.convertValueToPixel(z);u=a.axisY.convertValueToPixel(l[s].y);var D=k.dataPointIds[s];this._eventManager.objectMap[D]={id:D,objectType:"dataPoint",dataSeriesIndex:d,
|
|
323
|
-
dataPointIndex:s,x1:z,y1:u};x||m?(!x&&k.connectNullData?(c.setLineDash&&(k.options.nullDataLineDashType||p===k.lineDashType&&k.lineDashType!==k.nullDataLineDashType)&&(c.stroke(),c.beginPath(),c.moveTo(
|
|
324
|
-
(b.stroke(),b.beginPath(),b.moveTo(z,u))));
|
|
323
|
+
dataPointIndex:s,x1:z,y1:u};x||m?(!x&&k.connectNullData?(c.setLineDash&&(k.options.nullDataLineDashType||p===k.lineDashType&&k.lineDashType!==k.nullDataLineDashType)&&(c.stroke(),c.beginPath(),c.moveTo(r.x,r.y),p=k.nullDataLineDashType,c.setLineDash(q)),c.lineTo(z,C),c.lineTo(z,u),w&&(b.lineTo(z,C),b.lineTo(z,u))):(c.beginPath(),c.moveTo(z,u),w&&(b.beginPath(),b.moveTo(z,u))),m=x=!1):(c.lineTo(z,C),w&&b.lineTo(z,C),c.lineTo(z,u),w&&b.lineTo(z,u),0==s%500&&(c.stroke(),c.beginPath(),c.moveTo(z,u),w&&
|
|
324
|
+
(b.stroke(),b.beginPath(),b.moveTo(z,u))));r={x:z,y:u};s<l.length-1&&(v!==(l[s].lineColor||n)||p!==(l[s].lineDashType||k.lineDashType))&&(c.stroke(),c.beginPath(),c.moveTo(z,u),v=l[s].lineColor||n,c.strokeStyle=v,c.setLineDash&&(l[s].lineDashType?(p=l[s].lineDashType,c.setLineDash(G(p,k.lineThickness))):(p=k.lineDashType,c.setLineDash(f))));0!==l[s].markerSize&&(0<l[s].markerSize||0<k.markerSize)&&(C=k.getMarkerProperties(s,z,u,c),h.push(C),D=X(D),w&&h.push({x:z,y:u,ctx:b,type:C.type,size:C.size,
|
|
325
325
|
color:D,borderColor:D,borderThickness:C.borderThickness}));(l[s].indexLabel||k.indexLabel||l[s].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepLine",dataPoint:l[s],dataSeries:k,point:{x:z,y:u},direction:0>l[s].y===a.axisY.reversed?1:-1,color:n})}c.stroke();w&&b.stroke()}}W.drawMarkers(h);w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),
|
|
326
326
|
a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),b.beginPath());c.restore();c.beginPath();return{source:g,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};m.prototype.renderSpline=function(a){function g(a){a=t(a,2);if(0<a.length){b.beginPath();w&&e.beginPath();b.moveTo(a[0].x,
|
|
327
327
|
a[0].y);a[0].newStrokeStyle&&(b.strokeStyle=a[0].newStrokeStyle);a[0].newLineDashArray&&b.setLineDash(a[0].newLineDashArray);w&&e.moveTo(a[0].x,a[0].y);for(var c=0;c<a.length-3;c+=3)if(b.bezierCurveTo(a[c+1].x,a[c+1].y,a[c+2].x,a[c+2].y,a[c+3].x,a[c+3].y),w&&e.bezierCurveTo(a[c+1].x,a[c+1].y,a[c+2].x,a[c+2].y,a[c+3].x,a[c+3].y),0<c&&0===c%3E3||a[c+3].newStrokeStyle||a[c+3].newLineDashArray)b.stroke(),b.beginPath(),b.moveTo(a[c+3].x,a[c+3].y),a[c+3].newStrokeStyle&&(b.strokeStyle=a[c+3].newStrokeStyle),
|
|
328
|
-
a[c+3].newLineDashArray&&b.setLineDash(a[c+3].newLineDashArray),w&&(e.stroke(),e.beginPath(),e.moveTo(a[c+3].x,a[c+3].y));b.stroke();w&&e.stroke()}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx;b.save();var h=this.plotArea;b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();for(var
|
|
329
|
-
k.dataPoints,p="solid";if(b.setLineDash){var
|
|
330
|
-
l[x].x.getTime():l[x].x,!(s<a.axisX.dataInfo.viewPortMin||s>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!z)))if("number"!==typeof l[x].y)0<x&&!z&&(k.connectNullData?b.setLineDash&&(0<u.length&&(k.options.nullDataLineDashType||!l[x-1].lineDashType))&&(u[u.length-1].newLineDashArray=
|
|
331
|
-
dataPointIndex:x,x1:s,y1:z};u[u.length]={x:s,y:z};x<l.length-1&&(v!==(l[x].lineColor||n)||p!==(l[x].lineDashType||k.lineDashType))&&(v=l[x].lineColor||n,u[u.length-1].newStrokeStyle=v,b.setLineDash&&(l[x].lineDashType?(p=l[x].lineDashType,u[u.length-1].newLineDashArray=G(p,k.lineThickness)):(p=k.lineDashType,u[u.length-1].newLineDashArray=f)));if(0!==l[x].markerSize&&(0<l[x].markerSize||0<k.markerSize)){var C=k.getMarkerProperties(x,s,z,b);
|
|
332
|
-
color:m,borderColor:m,borderThickness:C.borderThickness})}(l[x].indexLabel||k.indexLabel||l[x].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"spline",dataPoint:l[x],dataSeries:k,point:{x:s,y:z},direction:0>l[x].y===a.axisY.reversed?1:-1,color:n});z=!1}g(u)}W.drawMarkers(
|
|
328
|
+
a[c+3].newLineDashArray&&b.setLineDash(a[c+3].newLineDashArray),w&&(e.stroke(),e.beginPath(),e.moveTo(a[c+3].x,a[c+3].y));b.stroke();w&&e.stroke()}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx;b.save();var h=this.plotArea;b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();for(var r=[],y=0;y<a.dataSeriesIndexes.length;y++){var d=a.dataSeriesIndexes[y],k=this.data[d];b.lineWidth=k.lineThickness;var l=
|
|
329
|
+
k.dataPoints,p="solid";if(b.setLineDash){var q=G(k.nullDataLineDashType,k.lineThickness),p=k.lineDashType,f=G(p,k.lineThickness);b.setLineDash(f)}var n=k.id;this._eventManager.objectMap[n]={objectType:"dataSeries",dataSeriesIndex:d};n=X(n);e.strokeStyle=n;e.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var n=k._colorSet,v=n=k.lineColor=k.options.lineColor?k.options.lineColor:n[0];b.strokeStyle=n;var x=0,s,z,u=[];b.beginPath();if(0<l.length)for(z=!1,x=0;x<l.length;x++)if(s=l[x].getTime?
|
|
330
|
+
l[x].x.getTime():l[x].x,!(s<a.axisX.dataInfo.viewPortMin||s>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!z)))if("number"!==typeof l[x].y)0<x&&!z&&(k.connectNullData?b.setLineDash&&(0<u.length&&(k.options.nullDataLineDashType||!l[x-1].lineDashType))&&(u[u.length-1].newLineDashArray=q,p=k.nullDataLineDashType):(g(u),u=[])),z=!0;else{s=a.axisX.convertValueToPixel(s);z=a.axisY.convertValueToPixel(l[x].y);var m=k.dataPointIds[x];this._eventManager.objectMap[m]={id:m,objectType:"dataPoint",dataSeriesIndex:d,
|
|
331
|
+
dataPointIndex:x,x1:s,y1:z};u[u.length]={x:s,y:z};x<l.length-1&&(v!==(l[x].lineColor||n)||p!==(l[x].lineDashType||k.lineDashType))&&(v=l[x].lineColor||n,u[u.length-1].newStrokeStyle=v,b.setLineDash&&(l[x].lineDashType?(p=l[x].lineDashType,u[u.length-1].newLineDashArray=G(p,k.lineThickness)):(p=k.lineDashType,u[u.length-1].newLineDashArray=f)));if(0!==l[x].markerSize&&(0<l[x].markerSize||0<k.markerSize)){var C=k.getMarkerProperties(x,s,z,b);r.push(C);m=X(m);w&&r.push({x:s,y:z,ctx:e,type:C.type,size:C.size,
|
|
332
|
+
color:m,borderColor:m,borderThickness:C.borderThickness})}(l[x].indexLabel||k.indexLabel||l[x].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"spline",dataPoint:l[x],dataSeries:k,point:{x:s,y:z},direction:0>l[x].y===a.axisY.reversed?1:-1,color:n});z=!1}g(u)}W.drawMarkers(r);w&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&
|
|
333
333
|
b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(h.x1,h.y1,h.width,h.height),e.beginPath());b.restore();b.beginPath();return{source:c,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};m.prototype.renderColumn=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=
|
|
334
|
-
null,e=this.plotArea,h=0,
|
|
334
|
+
null,e=this.plotArea,h=0,r,y,d,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,l=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.width,0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth=this.options.dataPointWidth?
|
|
335
335
|
this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&h>l&&(h=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,l));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&l<h)&&(l=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,h));p<h&&(p=h);p>l&&(p=l);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);
|
|
336
|
-
c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(l=0;l<a.dataSeriesIndexes.length;l++){var
|
|
337
|
-
|
|
338
|
-
{id:b,objectType:"dataPoint",dataSeriesIndex:
|
|
336
|
+
c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(l=0;l<a.dataSeriesIndexes.length;l++){var q=a.dataSeriesIndexes[l],f=this.data[q],n=f.dataPoints;if(0<n.length)for(var v=5<p&&f.bevelEnabled?!0:!1,h=0;h<n.length;h++)if(n[h].getTime?d=n[h].x.getTime():d=n[h].x,!(d<a.axisX.dataInfo.viewPortMin||d>a.axisX.dataInfo.viewPortMax)&&"number"===typeof n[h].y){r=a.axisX.convertValueToPixel(d);y=a.axisY.convertValueToPixel(n[h].y);
|
|
337
|
+
r=a.axisX.reversed?r+a.plotType.totalDataSeries*p/2-(a.previousDataSeriesCount+l)*p<<0:r-a.plotType.totalDataSeries*p/2+(a.previousDataSeriesCount+l)*p<<0;var x=a.axisX.reversed?r-p<<0:r+p<<0,s;0<=n[h].y?s=k:(s=y,y=k);y>s&&(b=y,y=s,s=b);b=n[h].color?n[h].color:f._colorSet[h%f._colorSet.length];aa(c,a.axisX.reversed?x:r,y,a.axisX.reversed?r:x,s,b,0,null,v&&(a.axisY.reversed?0>n[h].y:0<=n[h].y),(a.axisY.reversed?0<=n[h].y:0>n[h].y)&&v,!1,!1,f.fillOpacity);b=f.dataPointIds[h];this._eventManager.objectMap[b]=
|
|
338
|
+
{id:b,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:r,y1:y,x2:x,y2:s};b=X(b);w&&aa(this._eventManager.ghostCtx,a.axisX.reversed?x:r,y,a.axisX.reversed?r:x,s,b,0,null,!1,!1,!1,!1);(n[h].indexLabel||f.indexLabel||n[h].indexLabelFormatter||f.indexLabelFormatter)&&this._indexLabels.push({chartType:"column",dataPoint:n[h],dataSeries:f,point:{x:r+(x-r)/2,y:0>n[h].y===a.axisY.reversed?y:s},direction:0>n[h].y===a.axisY.reversed?1:-1,bounds:{x1:r,y1:Math.min(y,s),x2:x,y2:Math.max(y,s)},color:b})}}w&&
|
|
339
339
|
(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.yScaleAnimation,
|
|
340
|
-
easingFunction:K.easing.easeOutQuart,animationBase:k<a.axisY.bounds.y1?a.axisY.bounds.y1:k>a.axisY.bounds.y2?a.axisY.bounds.y2:k}}};m.prototype.renderStackedColumn=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=[],
|
|
340
|
+
easingFunction:K.easing.easeOutQuart,animationBase:k<a.axisY.bounds.y1?a.axisY.bounds.y1:k>a.axisY.bounds.y2?a.axisY.bounds.y2:k}}};m.prototype.renderStackedColumn=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=[],r=[],y=[],d=[],k=0,l,p,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),k=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:
|
|
341
341
|
1,f=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.width<<0,n=a.axisX.dataInfo.minDiff;isFinite(n)||(n=0.3*Math.abs(a.axisX.range));n=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(n)/Math.log(a.axisX.range):Math.abs(n)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&k>f&&(k=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,f));!this.dataPointMaxWidth&&
|
|
342
342
|
(this.dataPointMinWidth&&f<k)&&(f=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,k));n<k&&(n=k);n>f&&(n=f);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(f=0;f<a.dataSeriesIndexes.length;f++){var v=a.dataSeriesIndexes[f],x=this.data[v],s=x.dataPoints;if(0<s.length){var z=5<n&&x.bevelEnabled?
|
|
343
|
-
!0:!1;c.strokeStyle="#4572A7 ";for(k=0;k<s.length;k++)if(b=s[k].x.getTime?s[k].x.getTime():s[k].x,!(b<a.axisX.dataInfo.viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===typeof s[k].y){l=a.axisX.convertValueToPixel(b);l=l-a.plotType.plotUnits.length*n/2+a.index*n<<0;var u=l+n<<0,m;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0<s[k].y)y[b]=s[k].y+(y[b]?y[b]:0),0<y[b]&&(p=a.axisY.convertValueToPixel(y[b]),m="undefined"!==typeof h[b]?h[b]:
|
|
344
|
-
else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=s[k].y)d[b]=s[k].y+(d[b]?d[b]:0),m=a.axisY.convertValueToPixel(d[b]),p="undefined"!==typeof
|
|
343
|
+
!0:!1;c.strokeStyle="#4572A7 ";for(k=0;k<s.length;k++)if(b=s[k].x.getTime?s[k].x.getTime():s[k].x,!(b<a.axisX.dataInfo.viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===typeof s[k].y){l=a.axisX.convertValueToPixel(b);l=l-a.plotType.plotUnits.length*n/2+a.index*n<<0;var u=l+n<<0,m;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0<s[k].y)y[b]=s[k].y+(y[b]?y[b]:0),0<y[b]&&(p=a.axisY.convertValueToPixel(y[b]),m="undefined"!==typeof h[b]?h[b]:q,h[b]=p);
|
|
344
|
+
else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=s[k].y)d[b]=s[k].y+(d[b]?d[b]:0),m=a.axisY.convertValueToPixel(d[b]),p="undefined"!==typeof r[b]?r[b]:q,r[b]=m;else if(p=a.axisY.convertValueToPixel(s[k].y),0<=s[k].y){var C="undefined"!==typeof h[b]?h[b]:0;p-=C;m=q-C;h[b]=C+(m-p)}else C=r[b]?r[b]:0,m=p+C,p=q+C,r[b]=C+(m-p);b=s[k].color?s[k].color:x._colorSet[k%x._colorSet.length];aa(c,l,a.axisY.reversed?m:p,u,a.axisY.reversed?p:m,b,0,null,z&&(a.axisY.reversed?0>s[k].y:0<=
|
|
345
345
|
s[k].y),(a.axisY.reversed?0<=s[k].y:0>s[k].y)&&z,!1,!1,x.fillOpacity);b=x.dataPointIds[k];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:v,dataPointIndex:k,x1:l,y1:p,x2:u,y2:m};b=X(b);w&&aa(this._eventManager.ghostCtx,l,p,u,m,b,0,null,!1,!1,!1,!1);(s[k].indexLabel||x.indexLabel||s[k].indexLabelFormatter||x.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn",dataPoint:s[k],dataSeries:x,point:{x:l+(u-l)/2,y:0<=s[k].y?p:m},direction:0>s[k].y===a.axisY.reversed?
|
|
346
346
|
1:-1,bounds:{x1:l,y1:Math.min(p,m),x2:u,y2:Math.max(p,m)},color:b})}}}w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());
|
|
347
|
-
c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.yScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:
|
|
347
|
+
c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.yScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:q<a.axisY.bounds.y1?a.axisY.bounds.y1:q>a.axisY.bounds.y2?a.axisY.bounds.y2:q}}};m.prototype.renderStackedColumn100=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=[],r=[],y=[],d=[],k=0,l,p,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),
|
|
348
348
|
k=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,f=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.width<<0,n=a.axisX.dataInfo.minDiff;isFinite(n)||(n=0.3*Math.abs(a.axisX.range));n=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(n)/Math.log(a.axisX.range):Math.abs(n)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&
|
|
349
349
|
k>f&&(k=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,f));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&f<k)&&(f=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,k));n<k&&(n=k);n>f&&(n=f);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(f=0;f<a.dataSeriesIndexes.length;f++){var v=
|
|
350
350
|
a.dataSeriesIndexes[f],x=this.data[v],s=x.dataPoints;if(0<s.length)for(var m=5<n&&x.bevelEnabled?!0:!1,k=0;k<s.length;k++)if(b=s[k].x.getTime?s[k].x.getTime():s[k].x,!(b<a.axisX.dataInfo.viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===typeof s[k].y){l=a.axisX.convertValueToPixel(b);p=0!==a.dataPointYSums[b]?100*(s[k].y/a.dataPointYSums[b]):0;l=l-a.plotType.plotUnits.length*n/2+a.index*n<<0;var u=l+n<<0,t;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&
|
|
351
|
-
0<s[k].y){y[b]=p+("undefined"!==typeof y[b]?y[b]:0);if(0>=y[b])continue;p=a.axisY.convertValueToPixel(y[b]);t=h[b]?h[b]:
|
|
352
|
-
typeof
|
|
351
|
+
0<s[k].y){y[b]=p+("undefined"!==typeof y[b]?y[b]:0);if(0>=y[b])continue;p=a.axisY.convertValueToPixel(y[b]);t=h[b]?h[b]:q;h[b]=p}else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=s[k].y)d[b]=p+("undefined"!==typeof d[b]?d[b]:0),t=a.axisY.convertValueToPixel(d[b]),p=r[b]?r[b]:q,r[b]=t;else if(p=a.axisY.convertValueToPixel(p),0<=s[k].y){var C="undefined"!==typeof h[b]?h[b]:0;p-=C;t=q-C;a.dataSeriesIndexes.length-1===f&&1>=Math.abs(e.y1-p)&&(p=e.y1);h[b]=C+(t-p)}else C="undefined"!==
|
|
352
|
+
typeof r[b]?r[b]:0,t=p+C,p=q+C,a.dataSeriesIndexes.length-1===f&&1>=Math.abs(e.y2-t)&&(t=e.y2),r[b]=C+(t-p);b=s[k].color?s[k].color:x._colorSet[k%x._colorSet.length];aa(c,l,a.axisY.reversed?t:p,u,a.axisY.reversed?p:t,b,0,null,m&&(a.axisY.reversed?0>s[k].y:0<=s[k].y),(a.axisY.reversed?0<=s[k].y:0>s[k].y)&&m,!1,!1,x.fillOpacity);b=x.dataPointIds[k];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:v,dataPointIndex:k,x1:l,y1:p,x2:u,y2:t};b=X(b);w&&aa(this._eventManager.ghostCtx,
|
|
353
353
|
l,p,u,t,b,0,null,!1,!1,!1,!1);(s[k].indexLabel||x.indexLabel||s[k].indexLabelFormatter||x.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn100",dataPoint:s[k],dataSeries:x,point:{x:l+(u-l)/2,y:0<=s[k].y?p:t},direction:0>s[k].y===a.axisY.reversed?1:-1,bounds:{x1:l,y1:Math.min(p,t),x2:u,y2:Math.max(p,t)},color:b})}}w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,
|
|
354
|
-
this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.yScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:
|
|
355
|
-
function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=0,
|
|
354
|
+
this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.yScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:q<a.axisY.bounds.y1?a.axisY.bounds.y1:q>a.axisY.bounds.y2?a.axisY.bounds.y2:q}}};m.prototype.renderBar=
|
|
355
|
+
function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=0,r,d,n,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,l=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<
|
|
356
356
|
0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&h>l&&(h=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,l));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&l<h)&&(l=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,h));p<h&&(p=
|
|
357
|
-
h);p>l&&(p=l);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(l=0;l<a.dataSeriesIndexes.length;l++){var
|
|
358
|
-
a.axisX.dataInfo.viewPortMin||n>a.axisX.dataInfo.viewPortMax)&&"number"===typeof m[h].y){d=a.axisX.convertValueToPixel(n);
|
|
359
|
-
|
|
360
|
-
m[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(s,
|
|
361
|
-
this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.xScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:k<a.axisY.bounds.x1?a.axisY.bounds.x1:k>a.axisY.bounds.x2?a.axisY.bounds.x2:k}}};m.prototype.renderStackedBar=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=[],
|
|
357
|
+
h);p>l&&(p=l);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(l=0;l<a.dataSeriesIndexes.length;l++){var q=a.dataSeriesIndexes[l],f=this.data[q],m=f.dataPoints;if(0<m.length){var v=5<p&&f.bevelEnabled?!0:!1;c.strokeStyle="#4572A7 ";for(h=0;h<m.length;h++)if(m[h].getTime?n=m[h].x.getTime():n=m[h].x,!(n<
|
|
358
|
+
a.axisX.dataInfo.viewPortMin||n>a.axisX.dataInfo.viewPortMax)&&"number"===typeof m[h].y){d=a.axisX.convertValueToPixel(n);r=a.axisY.convertValueToPixel(m[h].y);d=a.axisX.reversed?d+a.plotType.totalDataSeries*p/2-(a.previousDataSeriesCount+l)*p<<0:d-a.plotType.totalDataSeries*p/2+(a.previousDataSeriesCount+l)*p<<0;var x=a.axisX.reversed?d-p<<0:d+p<<0,s;0<=m[h].y?s=k:(s=r,r=k);b=m[h].color?m[h].color:f._colorSet[h%f._colorSet.length];aa(c,a.axisY.reversed?r:s,a.axisX.reversed?x:d,a.axisY.reversed?s:
|
|
359
|
+
r,a.axisX.reversed?d:x,b,0,null,v,!1,!1,!1,f.fillOpacity);b=f.dataPointIds[h];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:s,y1:d,x2:r,y2:x};b=X(b);w&&aa(this._eventManager.ghostCtx,s,a.axisX.reversed?x:d,r,a.axisX.reversed?d:x,b,0,null,!1,!1,!1,!1);(m[h].indexLabel||f.indexLabel||m[h].indexLabelFormatter||f.indexLabelFormatter)&&this._indexLabels.push({chartType:"bar",dataPoint:m[h],dataSeries:f,point:{x:0<=m[h].y?r:s,y:d+(x-d)/2},direction:0>
|
|
360
|
+
m[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(s,r),y1:d,x2:Math.max(s,r),y2:x},color:b})}}}w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),
|
|
361
|
+
this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.xScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:k<a.axisY.bounds.x1?a.axisY.bounds.x1:k>a.axisY.bounds.x2?a.axisY.bounds.x2:k}}};m.prototype.renderStackedBar=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=[],r=[],d=[],n=[],k=0,l,p,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?
|
|
362
362
|
a.axisY.viewportMinimum:0),k=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,f=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.height<<0,m=a.axisX.dataInfo.minDiff;isFinite(m)||(m=0.3*Math.abs(a.axisX.range));m=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(m)/Math.log(a.axisX.range):Math.abs(m)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<
|
|
363
363
|
0;this.dataPointMaxWidth&&k>f&&(k=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,f));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&f<k)&&(f=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,k));m<k&&(m=k);m>f&&(m=f);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());
|
|
364
364
|
for(f=0;f<a.dataSeriesIndexes.length;f++){var v=a.dataSeriesIndexes[f],x=this.data[v],s=x.dataPoints;if(0<s.length){var z=5<m&&x.bevelEnabled?!0:!1;c.strokeStyle="#4572A7 ";for(k=0;k<s.length;k++)if(b=s[k].x.getTime?s[k].x.getTime():s[k].x,!(b<a.axisX.dataInfo.viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===typeof s[k].y){p=a.axisX.convertValueToPixel(b);p=p-a.plotType.plotUnits.length*m/2+a.index*m<<0;var u=p+m<<0,t;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&
|
|
365
|
-
0<s[k].y)d[b]=s[k].y+(d[b]?d[b]:0),0<d[b]&&(t=h[b]?h[b]:
|
|
365
|
+
0<s[k].y)d[b]=s[k].y+(d[b]?d[b]:0),0<d[b]&&(t=h[b]?h[b]:q,h[b]=l=a.axisY.convertValueToPixel(d[b]));else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=s[k].y)n[b]=s[k].y+(n[b]?n[b]:0),l=r[b]?r[b]:q,r[b]=t=a.axisY.convertValueToPixel(n[b]);else if(l=a.axisY.convertValueToPixel(s[k].y),0<=s[k].y){var C=h[b]?h[b]:0;t=q+C;l+=C;h[b]=C+(l-t)}else C=r[b]?r[b]:0,t=l-C,l=q-C,r[b]=C+(l-t);b=s[k].color?s[k].color:x._colorSet[k%x._colorSet.length];aa(c,a.axisY.reversed?l:t,p,a.axisY.reversed?
|
|
366
366
|
t:l,u,b,0,null,z,!1,!1,!1,x.fillOpacity);b=x.dataPointIds[k];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:v,dataPointIndex:k,x1:t,y1:p,x2:l,y2:u};b=X(b);w&&aa(this._eventManager.ghostCtx,t,p,l,u,b,0,null,!1,!1,!1,!1);(s[k].indexLabel||x.indexLabel||s[k].indexLabelFormatter||x.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar",dataPoint:s[k],dataSeries:x,point:{x:0<=s[k].y?l:t,y:p+(u-p)/2},direction:0>s[k].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(t,
|
|
367
367
|
l),y1:p,x2:Math.max(t,l),y2:u},color:b})}}}w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();
|
|
368
|
-
return{source:g,dest:this.plotArea.ctx,animationCallback:K.xScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:
|
|
368
|
+
return{source:g,dest:this.plotArea.ctx,animationCallback:K.xScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:q<a.axisY.bounds.x1?a.axisY.bounds.x1:q>a.axisY.bounds.x2?a.axisY.bounds.x2:q}}};m.prototype.renderStackedBar100=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=[],r=[],d=[],n=[],k=0,l,p,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),k=this.options.dataPointMinWidth?
|
|
369
369
|
this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,f=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.height<<0,m=a.axisX.dataInfo.minDiff;isFinite(m)||(m=0.3*Math.abs(a.axisX.range));m=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(m)/Math.log(a.axisX.range):Math.abs(m)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&k>f&&(k=Math.min(this.options.dataPointWidth?
|
|
370
370
|
this.dataPointWidth:Infinity,f));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&f<k)&&(f=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,k));m<k&&(m=k);m>f&&(m=f);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(f=0;f<a.dataSeriesIndexes.length;f++){var v=a.dataSeriesIndexes[f],
|
|
371
371
|
x=this.data[v],s=x.dataPoints;if(0<s.length){var z=5<m&&x.bevelEnabled?!0:!1;c.strokeStyle="#4572A7 ";for(k=0;k<s.length;k++)if(b=s[k].x.getTime?s[k].x.getTime():s[k].x,!(b<a.axisX.dataInfo.viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===typeof s[k].y){p=a.axisX.convertValueToPixel(b);var u;u=0!==a.dataPointYSums[b]?100*(s[k].y/a.dataPointYSums[b]):0;p=p-a.plotType.plotUnits.length*m/2+a.index*m<<0;var t=p+m<<0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&
|
|
372
|
-
0<s[k].y){d[b]=u+(d[b]?d[b]:0);if(0>=d[b])continue;u=h[b]?h[b]:
|
|
373
|
-
u)&&(u=e.x1),
|
|
372
|
+
0<s[k].y){d[b]=u+(d[b]?d[b]:0);if(0>=d[b])continue;u=h[b]?h[b]:q;h[b]=l=a.axisY.convertValueToPixel(d[b])}else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=s[k].y)n[b]=u+(n[b]?n[b]:0),l=r[b]?r[b]:q,r[b]=u=a.axisY.convertValueToPixel(n[b]);else if(l=a.axisY.convertValueToPixel(u),0<=s[k].y){var C=h[b]?h[b]:0;u=q+C;l+=C;a.dataSeriesIndexes.length-1===f&&1>=Math.abs(e.x2-l)&&(l=e.x2);h[b]=C+(l-u)}else C=r[b]?r[b]:0,u=l-C,l=q-C,a.dataSeriesIndexes.length-1===f&&1>=Math.abs(e.x1-
|
|
373
|
+
u)&&(u=e.x1),r[b]=C+(l-u);b=s[k].color?s[k].color:x._colorSet[k%x._colorSet.length];aa(c,a.axisY.reversed?l:u,p,a.axisY.reversed?u:l,t,b,0,null,z,!1,!1,!1,x.fillOpacity);b=x.dataPointIds[k];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:v,dataPointIndex:k,x1:u,y1:p,x2:l,y2:t};b=X(b);w&&aa(this._eventManager.ghostCtx,u,p,l,t,b,0,null,!1,!1,!1,!1);(s[k].indexLabel||x.indexLabel||s[k].indexLabelFormatter||x.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar100",
|
|
374
374
|
dataPoint:s[k],dataSeries:x,point:{x:0<=s[k].y?l:u,y:p+(t-p)/2},direction:0>s[k].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(u,l),y1:p,x2:Math.max(u,l),y2:t},color:b})}}}w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,
|
|
375
|
-
0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.xScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:
|
|
376
|
-
t=d.y1:0<a.axisY.viewportMinimum&&(t=u),h.lineTo(x,t),h.lineTo(C.x,t),h.closePath(),h.globalAlpha=f.fillOpacity,h.fill(),h.globalAlpha=1,w&&(
|
|
377
|
-
k.width,k.height);h.clip();w&&(
|
|
375
|
+
0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.xScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:q<a.axisY.bounds.x1?a.axisY.bounds.x1:q>a.axisY.bounds.x2?a.axisY.bounds.x2:q}}};m.prototype.renderArea=function(a){var g,c;function b(){C&&(0<f.lineThickness&&h.stroke(),a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?t=u:0>a.axisY.viewportMaximum?
|
|
376
|
+
t=d.y1:0<a.axisY.viewportMinimum&&(t=u),h.lineTo(x,t),h.lineTo(C.x,t),h.closePath(),h.globalAlpha=f.fillOpacity,h.fill(),h.globalAlpha=1,w&&(r.lineTo(x,t),r.lineTo(C.x,t),r.closePath(),r.fill()),h.beginPath(),h.moveTo(x,s),r.beginPath(),r.moveTo(x,s),C={x:x,y:s})}var e=a.targetCanvasCtx||this.plotArea.ctx,h=w?this._preRenderCtx:e;if(!(0>=a.dataSeriesIndexes.length)){var r=this._eventManager.ghostCtx,d=a.axisY.lineCoordinates,n=[],k=this.plotArea,l;h.save();w&&r.save();h.beginPath();h.rect(k.x1,k.y1,
|
|
377
|
+
k.width,k.height);h.clip();w&&(r.beginPath(),r.rect(k.x1,k.y1,k.width,k.height),r.clip());for(var p=0;p<a.dataSeriesIndexes.length;p++){var q=a.dataSeriesIndexes[p],f=this.data[q],m=f.dataPoints,n=f.id;this._eventManager.objectMap[n]={objectType:"dataSeries",dataSeriesIndex:q};n=X(n);r.fillStyle=n;n=[];g=!0;var v=0,x,s,z,u=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),t,C=null;if(0<m.length){var D=f._colorSet[v%f._colorSet.length],B=f.lineColor=f.options.lineColor||D,
|
|
378
378
|
A=B;h.fillStyle=D;h.strokeStyle=B;h.lineWidth=f.lineThickness;c="solid";if(h.setLineDash){var J=G(f.nullDataLineDashType,f.lineThickness);c=f.lineDashType;var U=G(c,f.lineThickness);h.setLineDash(U)}for(var ba=!0;v<m.length;v++)if(z=m[v].x.getTime?m[v].x.getTime():m[v].x,!(z<a.axisX.dataInfo.viewPortMin||z>a.axisX.dataInfo.viewPortMax&&(!f.connectNullData||!ba)))if("number"!==typeof m[v].y)f.connectNullData||(ba||g)||b(),ba=!0;else{x=a.axisX.convertValueToPixel(z);s=a.axisY.convertValueToPixel(m[v].y);
|
|
379
|
-
g||ba?(!g&&f.connectNullData?(h.setLineDash&&(f.options.nullDataLineDashType||c===f.lineDashType&&f.lineDashType!==f.nullDataLineDashType)&&(g=x,c=s,x=l.x,s=l.y,b(),h.moveTo(l.x,l.y),x=g,s=c,C=l,c=f.nullDataLineDashType,h.setLineDash(J)),h.lineTo(x,s),w&&
|
|
380
|
-
m[v].lineColor||B,h.strokeStyle=A,h.setLineDash&&(m[v].lineDashType?(c=m[v].lineDashType,h.setLineDash(G(c,f.lineThickness))):(c=f.lineDashType,h.setLineDash(U))));var Z=f.dataPointIds[v];this._eventManager.objectMap[Z]={id:Z,objectType:"dataPoint",dataSeriesIndex:
|
|
379
|
+
g||ba?(!g&&f.connectNullData?(h.setLineDash&&(f.options.nullDataLineDashType||c===f.lineDashType&&f.lineDashType!==f.nullDataLineDashType)&&(g=x,c=s,x=l.x,s=l.y,b(),h.moveTo(l.x,l.y),x=g,s=c,C=l,c=f.nullDataLineDashType,h.setLineDash(J)),h.lineTo(x,s),w&&r.lineTo(x,s)):(h.beginPath(),h.moveTo(x,s),w&&(r.beginPath(),r.moveTo(x,s)),C={x:x,y:s}),ba=g=!1):(h.lineTo(x,s),w&&r.lineTo(x,s),0==v%250&&b());l={x:x,y:s};v<m.length-1&&(A!==(m[v].lineColor||B)||c!==(m[v].lineDashType||f.lineDashType))&&(b(),A=
|
|
380
|
+
m[v].lineColor||B,h.strokeStyle=A,h.setLineDash&&(m[v].lineDashType?(c=m[v].lineDashType,h.setLineDash(G(c,f.lineThickness))):(c=f.lineDashType,h.setLineDash(U))));var Z=f.dataPointIds[v];this._eventManager.objectMap[Z]={id:Z,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:v,x1:x,y1:s};0!==m[v].markerSize&&(0<m[v].markerSize||0<f.markerSize)&&(z=f.getMarkerProperties(v,x,s,h),n.push(z),Z=X(Z),w&&n.push({x:x,y:s,ctx:r,type:z.type,size:z.size,color:Z,borderColor:Z,borderThickness:z.borderThickness}));
|
|
381
381
|
(m[v].indexLabel||f.indexLabel||m[v].indexLabelFormatter||f.indexLabelFormatter)&&this._indexLabels.push({chartType:"area",dataPoint:m[v],dataSeries:f,point:{x:x,y:s},direction:0>m[v].y===a.axisY.reversed?1:-1,color:D})}b();W.drawMarkers(n)}}w&&(e.drawImage(this._preRenderCanvas,0,0,this.width,this.height),h.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&h.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&h.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),
|
|
382
382
|
this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),h.clearRect(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.restore());h.restore();return{source:e,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};m.prototype.renderSplineArea=function(a){function g(){var c=t(z,2);if(0<c.length){if(0<l.lineThickness){b.beginPath();b.moveTo(c[0].x,c[0].y);c[0].newStrokeStyle&&(b.strokeStyle=c[0].newStrokeStyle);
|
|
383
383
|
c[0].newLineDashArray&&b.setLineDash(c[0].newLineDashArray);for(var f=0;f<c.length-3;f+=3)if(b.bezierCurveTo(c[f+1].x,c[f+1].y,c[f+2].x,c[f+2].y,c[f+3].x,c[f+3].y),w&&e.bezierCurveTo(c[f+1].x,c[f+1].y,c[f+2].x,c[f+2].y,c[f+3].x,c[f+3].y),c[f+3].newStrokeStyle||c[f+3].newLineDashArray)b.stroke(),b.beginPath(),b.moveTo(c[f+3].x,c[f+3].y),c[f+3].newStrokeStyle&&(b.strokeStyle=c[f+3].newStrokeStyle),c[f+3].newLineDashArray&&b.setLineDash(c[f+3].newLineDashArray);b.stroke()}b.beginPath();b.moveTo(c[0].x,
|
|
384
384
|
c[0].y);w&&(e.beginPath(),e.moveTo(c[0].x,c[0].y));for(f=0;f<c.length-3;f+=3)b.bezierCurveTo(c[f+1].x,c[f+1].y,c[f+2].x,c[f+2].y,c[f+3].x,c[f+3].y),w&&e.bezierCurveTo(c[f+1].x,c[f+1].y,c[f+2].x,c[f+2].y,c[f+3].x,c[f+3].y);a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?x=v:0>a.axisY.viewportMaximum?x=h.y1:0<a.axisY.viewportMinimum&&(x=v);s={x:c[0].x,y:c[0].y};b.lineTo(c[c.length-1].x,x);b.lineTo(s.x,x);b.closePath();b.globalAlpha=l.fillOpacity;b.fill();b.globalAlpha=1;
|
|
385
|
-
w&&(e.lineTo(c[c.length-1].x,x),e.lineTo(s.x,x),e.closePath(),e.fill())}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,h=a.axisY.lineCoordinates,
|
|
386
|
-
|
|
387
|
-
!1;
|
|
388
|
-
{id:J,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:
|
|
389
|
-
J=X(J);w&&
|
|
385
|
+
w&&(e.lineTo(c[c.length-1].x,x),e.lineTo(s.x,x),e.closePath(),e.fill())}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,h=a.axisY.lineCoordinates,r=[],d=this.plotArea;b.save();w&&e.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(e.beginPath(),e.rect(d.x1,d.y1,d.width,d.height),e.clip());for(var n=0;n<a.dataSeriesIndexes.length;n++){var k=a.dataSeriesIndexes[n],l=this.data[k],p=l.dataPoints,
|
|
386
|
+
r=l.id;this._eventManager.objectMap[r]={objectType:"dataSeries",dataSeriesIndex:k};r=X(r);e.fillStyle=r;var r=[],q=0,f,m,v=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),x,s=null,z=[];if(0<p.length){var u=l._colorSet[q%l._colorSet.length],B=l.lineColor=l.options.lineColor||u,C=B;b.fillStyle=u;b.strokeStyle=B;b.lineWidth=l.lineThickness;var D="solid";if(b.setLineDash){var A=G(l.nullDataLineDashType,l.lineThickness),D=l.lineDashType,db=G(D,l.lineThickness);b.setLineDash(db)}for(m=
|
|
387
|
+
!1;q<p.length;q++)if(f=p[q].x.getTime?p[q].x.getTime():p[q].x,!(f<a.axisX.dataInfo.viewPortMin||f>a.axisX.dataInfo.viewPortMax&&(!l.connectNullData||!m)))if("number"!==typeof p[q].y)0<q&&!m&&(l.connectNullData?b.setLineDash&&(0<z.length&&(l.options.nullDataLineDashType||!p[q-1].lineDashType))&&(z[z.length-1].newLineDashArray=A,D=l.nullDataLineDashType):(g(),z=[])),m=!0;else{f=a.axisX.convertValueToPixel(f);m=a.axisY.convertValueToPixel(p[q].y);var J=l.dataPointIds[q];this._eventManager.objectMap[J]=
|
|
388
|
+
{id:J,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:q,x1:f,y1:m};z[z.length]={x:f,y:m};q<p.length-1&&(C!==(p[q].lineColor||B)||D!==(p[q].lineDashType||l.lineDashType))&&(C=p[q].lineColor||B,z[z.length-1].newStrokeStyle=C,b.setLineDash&&(p[q].lineDashType?(D=p[q].lineDashType,z[z.length-1].newLineDashArray=G(D,l.lineThickness)):(D=l.lineDashType,z[z.length-1].newLineDashArray=db)));if(0!==p[q].markerSize&&(0<p[q].markerSize||0<l.markerSize)){var U=l.getMarkerProperties(q,f,m,b);r.push(U);
|
|
389
|
+
J=X(J);w&&r.push({x:f,y:m,ctx:e,type:U.type,size:U.size,color:J,borderColor:J,borderThickness:U.borderThickness})}(p[q].indexLabel||l.indexLabel||p[q].indexLabelFormatter||l.indexLabelFormatter)&&this._indexLabels.push({chartType:"splineArea",dataPoint:p[q],dataSeries:l,point:{x:f,y:m},direction:0>p[q].y===a.axisY.reversed?1:-1,color:u});m=!1}g();W.drawMarkers(r)}}w&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,
|
|
390
390
|
0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};m.prototype.renderStepArea=function(a){var g,c;function b(){C&&(0<f.lineThickness&&
|
|
391
|
-
h.stroke(),a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?t=u:0>a.axisY.viewportMaximum?t=d.y1:0<a.axisY.viewportMinimum&&(t=u),h.lineTo(x,t),h.lineTo(C.x,t),h.closePath(),h.globalAlpha=f.fillOpacity,h.fill(),h.globalAlpha=1,w&&(
|
|
392
|
-
d=a.axisY.lineCoordinates,n=[],k=this.plotArea,l;h.save();w&&
|
|
391
|
+
h.stroke(),a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?t=u:0>a.axisY.viewportMaximum?t=d.y1:0<a.axisY.viewportMinimum&&(t=u),h.lineTo(x,t),h.lineTo(C.x,t),h.closePath(),h.globalAlpha=f.fillOpacity,h.fill(),h.globalAlpha=1,w&&(r.lineTo(x,t),r.lineTo(C.x,t),r.closePath(),r.fill()),h.beginPath(),h.moveTo(x,s),r.beginPath(),r.moveTo(x,s),C={x:x,y:s})}var e=a.targetCanvasCtx||this.plotArea.ctx,h=w?this._preRenderCtx:e;if(!(0>=a.dataSeriesIndexes.length)){var r=this._eventManager.ghostCtx,
|
|
392
|
+
d=a.axisY.lineCoordinates,n=[],k=this.plotArea,l;h.save();w&&r.save();h.beginPath();h.rect(k.x1,k.y1,k.width,k.height);h.clip();w&&(r.beginPath(),r.rect(k.x1,k.y1,k.width,k.height),r.clip());for(var p=0;p<a.dataSeriesIndexes.length;p++){var q=a.dataSeriesIndexes[p],f=this.data[q],m=f.dataPoints,n=f.id;this._eventManager.objectMap[n]={objectType:"dataSeries",dataSeriesIndex:q};n=X(n);r.fillStyle=n;n=[];g=!0;var v=0,x,s,z,u=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),
|
|
393
393
|
t,C=null;c=!1;if(0<m.length){var D=f._colorSet[v%f._colorSet.length],B=f.lineColor=f.options.lineColor||D,A=B;h.fillStyle=D;h.strokeStyle=B;h.lineWidth=f.lineThickness;var J="solid";if(h.setLineDash){var U=G(f.nullDataLineDashType,f.lineThickness),J=f.lineDashType,ba=G(J,f.lineThickness);h.setLineDash(ba)}for(;v<m.length;v++)if(z=m[v].x.getTime?m[v].x.getTime():m[v].x,!(z<a.axisX.dataInfo.viewPortMin||z>a.axisX.dataInfo.viewPortMax&&(!f.connectNullData||!c))){var Z=s;"number"!==typeof m[v].y?(f.connectNullData||
|
|
394
|
-
(c||g)||b(),c=!0):(x=a.axisX.convertValueToPixel(z),s=a.axisY.convertValueToPixel(m[v].y),g||c?(!g&&f.connectNullData?(h.setLineDash&&(f.options.nullDataLineDashType||J===f.lineDashType&&f.lineDashType!==f.nullDataLineDashType)&&(g=x,c=s,x=l.x,s=l.y,b(),h.moveTo(l.x,l.y),x=g,s=c,C=l,J=f.nullDataLineDashType,h.setLineDash(U)),h.lineTo(x,Z),h.lineTo(x,s),w&&(
|
|
395
|
-
Z),h.lineTo(x,s),w&&
|
|
396
|
-
f.getMarkerProperties(v,x,s,h),n.push(Z),z=X(z),w&&n.push({x:x,y:s,ctx:
|
|
394
|
+
(c||g)||b(),c=!0):(x=a.axisX.convertValueToPixel(z),s=a.axisY.convertValueToPixel(m[v].y),g||c?(!g&&f.connectNullData?(h.setLineDash&&(f.options.nullDataLineDashType||J===f.lineDashType&&f.lineDashType!==f.nullDataLineDashType)&&(g=x,c=s,x=l.x,s=l.y,b(),h.moveTo(l.x,l.y),x=g,s=c,C=l,J=f.nullDataLineDashType,h.setLineDash(U)),h.lineTo(x,Z),h.lineTo(x,s),w&&(r.lineTo(x,Z),r.lineTo(x,s))):(h.beginPath(),h.moveTo(x,s),w&&(r.beginPath(),r.moveTo(x,s)),C={x:x,y:s}),c=g=!1):(h.lineTo(x,Z),w&&r.lineTo(x,
|
|
395
|
+
Z),h.lineTo(x,s),w&&r.lineTo(x,s),0==v%250&&b()),l={x:x,y:s},v<m.length-1&&(A!==(m[v].lineColor||B)||J!==(m[v].lineDashType||f.lineDashType))&&(b(),A=m[v].lineColor||B,h.strokeStyle=A,h.setLineDash&&(m[v].lineDashType?(J=m[v].lineDashType,h.setLineDash(G(J,f.lineThickness))):(J=f.lineDashType,h.setLineDash(ba)))),z=f.dataPointIds[v],this._eventManager.objectMap[z]={id:z,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:v,x1:x,y1:s},0!==m[v].markerSize&&(0<m[v].markerSize||0<f.markerSize)&&(Z=
|
|
396
|
+
f.getMarkerProperties(v,x,s,h),n.push(Z),z=X(z),w&&n.push({x:x,y:s,ctx:r,type:Z.type,size:Z.size,color:z,borderColor:z,borderThickness:Z.borderThickness})),(m[v].indexLabel||f.indexLabel||m[v].indexLabelFormatter||f.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepArea",dataPoint:m[v],dataSeries:f,point:{x:x,y:s},direction:0>m[v].y===a.axisY.reversed?1:-1,color:D}))}b();W.drawMarkers(n)}}w&&(e.drawImage(this._preRenderCanvas,0,0,this.width,this.height),h.globalCompositeOperation="source-atop",
|
|
397
397
|
a.axisX.maskCanvas&&h.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&h.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),h.clearRect(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.restore());h.restore();return{source:e,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};m.prototype.renderStackedArea=
|
|
398
|
-
function(a){function g(){if(!(1>k.length)){for(0<D.lineThickness&&b.stroke();0<k.length;){var a=k.pop();b.lineTo(a.x,a.y);w&&x.lineTo(a.x,a.y)}b.closePath();b.globalAlpha=D.fillOpacity;b.fill();b.globalAlpha=1;b.beginPath();w&&(x.closePath(),x.fill(),x.beginPath());k=[]}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=null,h=null,
|
|
399
|
-
0),x=this._eventManager.ghostCtx,s,z,u;w&&x.beginPath();b.save();w&&x.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(x.beginPath(),x.rect(d.x1,d.y1,d.width,d.height),x.clip());for(var e=[],t=0;t<a.dataSeriesIndexes.length;t++){var C=a.dataSeriesIndexes[t],D=this.data[C],B=D.dataPoints;D.dataPointIndexes=[];for(
|
|
400
|
-
D=this.data[C];B=D.dataPoints;z=!0;k=[];
|
|
398
|
+
function(a){function g(){if(!(1>k.length)){for(0<D.lineThickness&&b.stroke();0<k.length;){var a=k.pop();b.lineTo(a.x,a.y);w&&x.lineTo(a.x,a.y)}b.closePath();b.globalAlpha=D.fillOpacity;b.fill();b.globalAlpha=1;b.beginPath();w&&(x.closePath(),x.fill(),x.beginPath());k=[]}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=null,h=null,r=[],d=this.plotArea,n=[],k=[],l=[],p=[],q=0,f,m,v=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:
|
|
399
|
+
0),x=this._eventManager.ghostCtx,s,z,u;w&&x.beginPath();b.save();w&&x.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(x.beginPath(),x.rect(d.x1,d.y1,d.width,d.height),x.clip());for(var e=[],t=0;t<a.dataSeriesIndexes.length;t++){var C=a.dataSeriesIndexes[t],D=this.data[C],B=D.dataPoints;D.dataPointIndexes=[];for(q=0;q<B.length;q++)C=B[q].x.getTime?B[q].x.getTime():B[q].x,D.dataPointIndexes[C]=q,e[C]||(l.push(C),e[C]=!0);l.sort(Sa)}for(t=0;t<a.dataSeriesIndexes.length;t++){C=a.dataSeriesIndexes[t];
|
|
400
|
+
D=this.data[C];B=D.dataPoints;z=!0;k=[];q=D.id;this._eventManager.objectMap[q]={objectType:"dataSeries",dataSeriesIndex:C};q=X(q);x.fillStyle=q;if(0<l.length){var e=D._colorSet[0],A=D.lineColor=D.options.lineColor||e,J=A;b.fillStyle=e;b.strokeStyle=A;b.lineWidth=D.lineThickness;u="solid";if(b.setLineDash){var U=G(D.nullDataLineDashType,D.lineThickness);u=D.lineDashType;var ba=G(u,D.lineThickness);b.setLineDash(ba)}for(var Z=!0,q=0;q<l.length;q++){var h=l[q],ga=null,ga=0<=D.dataPointIndexes[h]?B[D.dataPointIndexes[h]]:
|
|
401
401
|
{x:h,y:null};if(!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax&&(!D.connectNullData||!Z)))if("number"!==typeof ga.y)D.connectNullData||(Z||z)||g(),Z=!0;else{f=a.axisX.convertValueToPixel(h);var oa=n[h]?n[h]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length){p[h]=ga.y+(p[h]?p[h]:0);if(0>=p[h]&&a.axisY.logarithmic)continue;m=a.axisY.convertValueToPixel(p[h])}else m=a.axisY.convertValueToPixel(ga.y),m-=oa;k.push({x:f,y:v-oa});n[h]=v-m;z||Z?(!z&&
|
|
402
|
-
D.connectNullData?(b.setLineDash&&(D.options.nullDataLineDashType||u===D.lineDashType&&D.lineDashType!==D.nullDataLineDashType)&&(z=k.pop(),u=k[k.length-1],g(),b.moveTo(s.x,s.y),k.push(u),k.push(z),u=D.nullDataLineDashType,b.setLineDash(U)),b.lineTo(f,m),w&&x.lineTo(f,m)):(b.beginPath(),b.moveTo(f,m),w&&(x.beginPath(),x.moveTo(f,m))),Z=z=!1):(b.lineTo(f,m),w&&x.lineTo(f,m),0==
|
|
403
|
-
(B[
|
|
404
|
-
(0<ga.markerSize||0<D.markerSize)&&(oa=D.getMarkerProperties(D.dataPointIndexes[h],f,m,b),
|
|
402
|
+
D.connectNullData?(b.setLineDash&&(D.options.nullDataLineDashType||u===D.lineDashType&&D.lineDashType!==D.nullDataLineDashType)&&(z=k.pop(),u=k[k.length-1],g(),b.moveTo(s.x,s.y),k.push(u),k.push(z),u=D.nullDataLineDashType,b.setLineDash(U)),b.lineTo(f,m),w&&x.lineTo(f,m)):(b.beginPath(),b.moveTo(f,m),w&&(x.beginPath(),x.moveTo(f,m))),Z=z=!1):(b.lineTo(f,m),w&&x.lineTo(f,m),0==q%250&&(g(),b.moveTo(f,m),w&&x.moveTo(f,m),k.push({x:f,y:v-oa})));s={x:f,y:m};q<B.length-1&&(J!==(B[q].lineColor||A)||u!==
|
|
403
|
+
(B[q].lineDashType||D.lineDashType))&&(g(),b.beginPath(),b.moveTo(f,m),k.push({x:f,y:v-oa}),J=B[q].lineColor||A,b.strokeStyle=J,b.setLineDash&&(B[q].lineDashType?(u=B[q].lineDashType,b.setLineDash(G(u,D.lineThickness))):(u=D.lineDashType,b.setLineDash(ba))));if(0<=D.dataPointIndexes[h]){var ka=D.dataPointIds[D.dataPointIndexes[h]];this._eventManager.objectMap[ka]={id:ka,objectType:"dataPoint",dataSeriesIndex:C,dataPointIndex:D.dataPointIndexes[h],x1:f,y1:m}}0<=D.dataPointIndexes[h]&&0!==ga.markerSize&&
|
|
404
|
+
(0<ga.markerSize||0<D.markerSize)&&(oa=D.getMarkerProperties(D.dataPointIndexes[h],f,m,b),r.push(oa),h=X(ka),w&&r.push({x:f,y:m,ctx:x,type:oa.type,size:oa.size,color:h,borderColor:h,borderThickness:oa.borderThickness}));(ga.indexLabel||D.indexLabel||ga.indexLabelFormatter||D.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedArea",dataPoint:ga,dataSeries:D,point:{x:f,y:m},direction:0>ga.y===a.axisY.reversed?1:-1,color:e})}}g();b.moveTo(f,m);w&&x.moveTo(f,m)}delete D.dataPointIndexes}W.drawMarkers(r);
|
|
405
405
|
w&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(d.x1,d.y1,d.width,d.height),x.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,
|
|
406
|
-
easingFunction:K.easing.linear,animationBase:0}}};m.prototype.renderStackedArea100=function(a){function g(){for(0<D.lineThickness&&b.stroke();0<k.length;){var a=k.pop();b.lineTo(a.x,a.y);w&&u.lineTo(a.x,a.y)}b.closePath();b.globalAlpha=D.fillOpacity;b.fill();b.globalAlpha=1;b.beginPath();w&&(u.closePath(),u.fill(),u.beginPath());k=[]}var c=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=null,h=null,
|
|
407
|
-
0,f,m,v,x,s,z=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),u=this._eventManager.ghostCtx;b.save();w&&u.save();b.beginPath();b.rect(
|
|
408
|
-
!0);l.sort(Sa)}for(t=0;t<a.dataSeriesIndexes.length;t++){C=a.dataSeriesIndexes[t];D=this.data[C];B=D.dataPoints;x=!0;e=D.id;this._eventManager.objectMap[e]={objectType:"dataSeries",dataSeriesIndex:C};e=X(e);u.fillStyle=e;k=[];if(0<l.length){var e=D._colorSet[
|
|
409
|
-
b.setLineDash(ba)}for(var Z=!0,
|
|
406
|
+
easingFunction:K.easing.linear,animationBase:0}}};m.prototype.renderStackedArea100=function(a){function g(){for(0<D.lineThickness&&b.stroke();0<k.length;){var a=k.pop();b.lineTo(a.x,a.y);w&&u.lineTo(a.x,a.y)}b.closePath();b.globalAlpha=D.fillOpacity;b.fill();b.globalAlpha=1;b.beginPath();w&&(u.closePath(),u.fill(),u.beginPath());k=[]}var c=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=null,h=null,r=this.plotArea,d=[],n=[],k=[],l=[],p=[],q=
|
|
407
|
+
0,f,m,v,x,s,z=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),u=this._eventManager.ghostCtx;b.save();w&&u.save();b.beginPath();b.rect(r.x1,r.y1,r.width,r.height);b.clip();w&&(u.beginPath(),u.rect(r.x1,r.y1,r.width,r.height),u.clip());for(var e=[],t=0;t<a.dataSeriesIndexes.length;t++){var C=a.dataSeriesIndexes[t],D=this.data[C],B=D.dataPoints;D.dataPointIndexes=[];for(q=0;q<B.length;q++)C=B[q].x.getTime?B[q].x.getTime():B[q].x,D.dataPointIndexes[C]=q,e[C]||(l.push(C),e[C]=
|
|
408
|
+
!0);l.sort(Sa)}for(t=0;t<a.dataSeriesIndexes.length;t++){C=a.dataSeriesIndexes[t];D=this.data[C];B=D.dataPoints;x=!0;e=D.id;this._eventManager.objectMap[e]={objectType:"dataSeries",dataSeriesIndex:C};e=X(e);u.fillStyle=e;k=[];if(0<l.length){var e=D._colorSet[q%D._colorSet.length],A=D.lineColor=D.options.lineColor||e,J=A;b.fillStyle=e;b.strokeStyle=A;b.lineWidth=D.lineThickness;s="solid";if(b.setLineDash){var U=G(D.nullDataLineDashType,D.lineThickness);s=D.lineDashType;var ba=G(s,D.lineThickness);
|
|
409
|
+
b.setLineDash(ba)}for(var Z=!0,q=0;q<l.length;q++){var h=l[q],ga=null,ga=0<=D.dataPointIndexes[h]?B[D.dataPointIndexes[h]]:{x:h,y:null};if(!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax&&(!D.connectNullData||!Z)))if("number"!==typeof ga.y)D.connectNullData||(Z||x)||g(),Z=!0;else{var oa;oa=0!==a.dataPointYSums[h]?100*(ga.y/a.dataPointYSums[h]):0;f=a.axisX.convertValueToPixel(h);var ka=n[h]?n[h]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length){p[h]=
|
|
410
410
|
oa+(p[h]?p[h]:0);if(0>=p[h]&&a.axisY.logarithmic)continue;m=a.axisY.convertValueToPixel(p[h])}else m=a.axisY.convertValueToPixel(oa),m-=ka;k.push({x:f,y:z-ka});n[h]=z-m;x||Z?(!x&&D.connectNullData?(b.setLineDash&&(D.options.nullDataLineDashType||s===D.lineDashType&&D.lineDashType!==D.nullDataLineDashType)&&(x=k.pop(),s=k[k.length-1],g(),b.moveTo(v.x,v.y),k.push(s),k.push(x),s=D.nullDataLineDashType,b.setLineDash(U)),b.lineTo(f,m),w&&u.lineTo(f,m)):(b.beginPath(),b.moveTo(f,m),w&&(u.beginPath(),u.moveTo(f,
|
|
411
|
-
m))),Z=x=!1):(b.lineTo(f,m),w&&u.lineTo(f,m),0==
|
|
411
|
+
m))),Z=x=!1):(b.lineTo(f,m),w&&u.lineTo(f,m),0==q%250&&(g(),b.moveTo(f,m),w&&u.moveTo(f,m),k.push({x:f,y:z-ka})));v={x:f,y:m};q<B.length-1&&(J!==(B[q].lineColor||A)||s!==(B[q].lineDashType||D.lineDashType))&&(g(),b.beginPath(),b.moveTo(f,m),k.push({x:f,y:z-ka}),J=B[q].lineColor||A,b.strokeStyle=J,b.setLineDash&&(B[q].lineDashType?(s=B[q].lineDashType,b.setLineDash(G(s,D.lineThickness))):(s=D.lineDashType,b.setLineDash(ba))));if(0<=D.dataPointIndexes[h]){var E=D.dataPointIds[D.dataPointIndexes[h]];
|
|
412
412
|
this._eventManager.objectMap[E]={id:E,objectType:"dataPoint",dataSeriesIndex:C,dataPointIndex:D.dataPointIndexes[h],x1:f,y1:m}}0<=D.dataPointIndexes[h]&&0!==ga.markerSize&&(0<ga.markerSize||0<D.markerSize)&&(ka=D.getMarkerProperties(D.dataPointIndexes[h],f,m,b),d.push(ka),h=X(E),w&&d.push({x:f,y:m,ctx:u,type:ka.type,size:ka.size,color:h,borderColor:h,borderThickness:ka.borderThickness}));(ga.indexLabel||D.indexLabel||ga.indexLabelFormatter||D.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedArea100",
|
|
413
413
|
dataPoint:ga,dataSeries:D,point:{x:f,y:m},direction:0>ga.y===a.axisY.reversed?1:-1,color:e})}}g();b.moveTo(f,m);w&&u.moveTo(f,m)}delete D.dataPointIndexes}W.drawMarkers(d);w&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,
|
|
414
|
-
0,0,this.width,this.height),b.clearRect(
|
|
415
|
-
this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var d=-Infinity,n=Infinity,k=0;k<a.dataSeriesIndexes.length;k++)for(var l=a.dataSeriesIndexes[k],p=this.data[l],
|
|
416
|
-
m),k=0;k<a.dataSeriesIndexes.length;k++)if(l=a.dataSeriesIndexes[k],p=this.data[l],
|
|
417
|
-
p.fillOpacity;W.drawMarker(h,
|
|
418
|
-
direction:1,bounds:{x1:h-f.size/2,y1:
|
|
419
|
-
c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};m.prototype.renderScatter=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,e=0,h,
|
|
420
|
-
b.width,b.height),this._eventManager.ghostCtx.clip());for(var d=0;d<a.dataSeriesIndexes.length;d++){var n=a.dataSeriesIndexes[d],k=this.data[n],l=k.dataPoints;if(0<l.length){c.strokeStyle="#4572A7 ";Math.pow(0.3*Math.min(b.height,b.width)/2,2);for(var p=0,
|
|
421
|
-
h,
|
|
422
|
-
l[e].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:l[e],dataSeries:k,point:{x:h,y:
|
|
414
|
+
0,0,this.width,this.height),b.clearRect(r.x1,r.y1,r.width,r.height),u.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};m.prototype.renderBubble=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,e=0,h,r;c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(b.x1,b.y1,b.width,b.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),
|
|
415
|
+
this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var d=-Infinity,n=Infinity,k=0;k<a.dataSeriesIndexes.length;k++)for(var l=a.dataSeriesIndexes[k],p=this.data[l],q=p.dataPoints,f=0,e=0;e<q.length;e++)h=q[e].getTime?h=q[e].x.getTime():h=q[e].x,h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax||"undefined"===typeof q[e].z||(f=q[e].z,f>d&&(d=f),f<n&&(n=f));for(var m=25*Math.PI,v=Math.max(Math.pow(0.25*Math.min(b.height,b.width)/2,2)*Math.PI,
|
|
416
|
+
m),k=0;k<a.dataSeriesIndexes.length;k++)if(l=a.dataSeriesIndexes[k],p=this.data[l],q=p.dataPoints,0<q.length)for(c.strokeStyle="#4572A7 ",e=0;e<q.length;e++)if(h=q[e].getTime?h=q[e].x.getTime():h=q[e].x,!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax)&&"number"===typeof q[e].y){h=a.axisX.convertValueToPixel(h);r=a.axisY.convertValueToPixel(q[e].y);var f=q[e].z,x=2*Math.max(Math.sqrt((d===n?v/2:m+(v-m)/(d-n)*(f-n))/Math.PI)<<0,1),f=p.getMarkerProperties(e,c);f.size=x;c.globalAlpha=
|
|
417
|
+
p.fillOpacity;W.drawMarker(h,r,c,f.type,f.size,f.color,f.borderColor,f.borderThickness);c.globalAlpha=1;var s=p.dataPointIds[e];this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:e,x1:h,y1:r,size:x};x=X(s);w&&W.drawMarker(h,r,this._eventManager.ghostCtx,f.type,f.size,x,x,f.borderThickness);(q[e].indexLabel||p.indexLabel||q[e].indexLabelFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"bubble",dataPoint:q[e],dataSeries:p,point:{x:h,y:r},
|
|
418
|
+
direction:1,bounds:{x1:h-f.size/2,y1:r-f.size/2,x2:h+f.size/2,y2:r+f.size/2},color:null})}w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.restore());
|
|
419
|
+
c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};m.prototype.renderScatter=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,e=0,h,r;c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(b.x1,b.y1,b.width,b.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(b.x1,b.y1,
|
|
420
|
+
b.width,b.height),this._eventManager.ghostCtx.clip());for(var d=0;d<a.dataSeriesIndexes.length;d++){var n=a.dataSeriesIndexes[d],k=this.data[n],l=k.dataPoints;if(0<l.length){c.strokeStyle="#4572A7 ";Math.pow(0.3*Math.min(b.height,b.width)/2,2);for(var p=0,q=0,e=0;e<l.length;e++)if(h=l[e].getTime?h=l[e].x.getTime():h=l[e].x,!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax)&&"number"===typeof l[e].y){h=a.axisX.convertValueToPixel(h);r=a.axisY.convertValueToPixel(l[e].y);var f=k.getMarkerProperties(e,
|
|
421
|
+
h,r,c);c.globalAlpha=k.fillOpacity;W.drawMarker(f.x,f.y,f.ctx,f.type,f.size,f.color,f.borderColor,f.borderThickness);c.globalAlpha=1;Math.sqrt((p-h)*(p-h)+(q-r)*(q-r))<Math.min(f.size,5)&&l.length>Math.min(this.plotArea.width,this.plotArea.height)||(p=k.dataPointIds[e],this._eventManager.objectMap[p]={id:p,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:e,x1:h,y1:r},p=X(p),w&&W.drawMarker(f.x,f.y,this._eventManager.ghostCtx,f.type,f.size,p,p,f.borderThickness),(l[e].indexLabel||k.indexLabel||
|
|
422
|
+
l[e].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:l[e],dataSeries:k,point:{x:h,y:r},direction:1,bounds:{x1:h-f.size/2,y1:r-f.size/2,x2:h+f.size/2,y2:r+f.size/2},color:null}),p=h,q=r)}}}w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),
|
|
423
423
|
this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};m.prototype.renderCandlestick=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g,b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var e=
|
|
424
|
-
null,h=null,
|
|
425
|
-
this.dataPointMaxWidth&&e>h&&(e=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,h));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&h<e)&&(h=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,e));t<e&&(t=e);t>h&&(t=h);c.save();w&&b.save();c.beginPath();c.rect(
|
|
426
|
-
if(0<z.length)for(var u=5<t&&s.bevelEnabled?!0:!1,d=0;d<z.length;d++)if(z[d].getTime?f=z[d].x.getTime():f=z[d].x,!(f<a.axisX.dataInfo.viewPortMin||f>a.axisX.dataInfo.viewPortMax)&&!n(z[d].y)&&z[d].y.length&&"number"===typeof z[d].y[0]&&"number"===typeof z[d].y[1]&&"number"===typeof z[d].y[2]&&"number"===typeof z[d].y[3]){m=a.axisX.convertValueToPixel(f);k=a.axisY.convertValueToPixel(z[d].y[0]);l=a.axisY.convertValueToPixel(z[d].y[1]);p=a.axisY.convertValueToPixel(z[d].y[2]);
|
|
427
|
-
var B=m-t/2<<0,C=B+t<<0,h=s.options.fallingColor?s.fallingColor:s._colorSet[0],e=z[d].color?z[d].color:s._colorSet[0],D=Math.round(Math.max(1,0.15*t)),A=0===D%2?0:0.5,G=s.dataPointIds[d];this._eventManager.objectMap[G]={id:G,objectType:"dataPoint",dataSeriesIndex:x,dataPointIndex:d,x1:B,y1:k,x2:C,y2:l,x3:m,y3:p,x4:m,y4:
|
|
428
|
-
A,Math.max(k,
|
|
429
|
-
c.stroke(),w&&(e=X(G),b.strokeStyle=e,b.moveTo(m-A,l),b.lineTo(m-A,p),b.stroke(),b.beginPath(),b.moveTo(m,k),b.lineTo(B,k),b.stroke(),b.beginPath(),b.moveTo(m,
|
|
430
|
-
this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(
|
|
431
|
-
animationBase:0}}};m.prototype.renderBoxAndWhisker=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g,b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var e=null,h=this.plotArea,
|
|
432
|
-
(t=0.3*Math.abs(a.axisX.range));t=this.options.dataPointWidth?this.dataPointWidth:0.7*h.width*(a.axisX.logarithmic?Math.log(t)/Math.log(a.axisX.range):Math.abs(t)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&e>
|
|
433
|
-
h.height);c.clip();w&&(b.beginPath(),b.rect(h.x1,h.y1,h.width,h.height),b.clip());for(var v=!1,v=!!a.axisY.reversed,x=0;x<a.dataSeriesIndexes.length;x++){var s=a.dataSeriesIndexes[x],z=this.data[s],u=z.dataPoints;if(0<u.length)for(var B=5<t&&z.bevelEnabled?!0:!1,
|
|
434
|
-
"number"===typeof u[
|
|
435
|
-
u[
|
|
436
|
-
z.stemColor:u[
|
|
437
|
-
z.lineDashType,M=1===Math.round(Q)%2?0.5:0,N=z.upperBoxColor,S=z.lowerBoxColor,ta=n(z.options.fillOpacity)?1:z.fillOpacity,R=z.dataPointIds[
|
|
438
|
-
ka)),c.moveTo(d-E,k),c.lineTo(d-E,m),c.stroke(),c.moveTo(d-E,p),c.lineTo(d-E,l),c.stroke());c.restore();b.lineWidth=Math.max(A,4);c.beginPath();aa(c,C,Math.min(
|
|
439
|
-
O,c.lineWidth=Q,c.moveTo(C,
|
|
440
|
-
l),e,0,null,!1,!1,!1,!1),0<U&&(b.beginPath(),b.lineWidth=U,b.moveTo(d+Z/2,p-ga),b.lineTo(d-Z/2,p-ga),b.stroke(),b.moveTo(d+Z/2,m+ga),b.lineTo(d-Z/2,m+ga),b.stroke()));(u[
|
|
424
|
+
null,h=null,r=this.plotArea,d=0,m,k,l,p,q,f,e=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,h=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.015*this.width,t=a.axisX.dataInfo.minDiff;isFinite(t)||(t=0.3*Math.abs(a.axisX.range));t=this.options.dataPointWidth?this.dataPointWidth:0.7*r.width*(a.axisX.logarithmic?Math.log(t)/Math.log(a.axisX.range):Math.abs(t)/Math.abs(a.axisX.range))<<0;
|
|
425
|
+
this.dataPointMaxWidth&&e>h&&(e=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,h));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&h<e)&&(h=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,e));t<e&&(t=e);t>h&&(t=h);c.save();w&&b.save();c.beginPath();c.rect(r.x1,r.y1,r.width,r.height);c.clip();w&&(b.beginPath(),b.rect(r.x1,r.y1,r.width,r.height),b.clip());for(var v=0;v<a.dataSeriesIndexes.length;v++){var x=a.dataSeriesIndexes[v],s=this.data[x],z=s.dataPoints;
|
|
426
|
+
if(0<z.length)for(var u=5<t&&s.bevelEnabled?!0:!1,d=0;d<z.length;d++)if(z[d].getTime?f=z[d].x.getTime():f=z[d].x,!(f<a.axisX.dataInfo.viewPortMin||f>a.axisX.dataInfo.viewPortMax)&&!n(z[d].y)&&z[d].y.length&&"number"===typeof z[d].y[0]&&"number"===typeof z[d].y[1]&&"number"===typeof z[d].y[2]&&"number"===typeof z[d].y[3]){m=a.axisX.convertValueToPixel(f);k=a.axisY.convertValueToPixel(z[d].y[0]);l=a.axisY.convertValueToPixel(z[d].y[1]);p=a.axisY.convertValueToPixel(z[d].y[2]);q=a.axisY.convertValueToPixel(z[d].y[3]);
|
|
427
|
+
var B=m-t/2<<0,C=B+t<<0,h=s.options.fallingColor?s.fallingColor:s._colorSet[0],e=z[d].color?z[d].color:s._colorSet[0],D=Math.round(Math.max(1,0.15*t)),A=0===D%2?0:0.5,G=s.dataPointIds[d];this._eventManager.objectMap[G]={id:G,objectType:"dataPoint",dataSeriesIndex:x,dataPointIndex:d,x1:B,y1:k,x2:C,y2:l,x3:m,y3:p,x4:m,y4:q,borderThickness:D,color:e};c.strokeStyle=e;c.beginPath();c.lineWidth=D;b.lineWidth=Math.max(D,4);"candlestick"===s.type?(c.moveTo(m-A,l),c.lineTo(m-A,Math.min(k,q)),c.stroke(),c.moveTo(m-
|
|
428
|
+
A,Math.max(k,q)),c.lineTo(m-A,p),c.stroke(),aa(c,B,Math.min(k,q),C,Math.max(k,q),z[d].y[0]<=z[d].y[3]?s.risingColor:h,D,e,u,u,!1,!1,s.fillOpacity),w&&(e=X(G),b.strokeStyle=e,b.moveTo(m-A,l),b.lineTo(m-A,Math.min(k,q)),b.stroke(),b.moveTo(m-A,Math.max(k,q)),b.lineTo(m-A,p),b.stroke(),aa(b,B,Math.min(k,q),C,Math.max(k,q),e,0,null,!1,!1,!1,!1))):"ohlc"===s.type&&(c.moveTo(m-A,l),c.lineTo(m-A,p),c.stroke(),c.beginPath(),c.moveTo(m,k),c.lineTo(B,k),c.stroke(),c.beginPath(),c.moveTo(m,q),c.lineTo(C,q),
|
|
429
|
+
c.stroke(),w&&(e=X(G),b.strokeStyle=e,b.moveTo(m-A,l),b.lineTo(m-A,p),b.stroke(),b.beginPath(),b.moveTo(m,k),b.lineTo(B,k),b.stroke(),b.beginPath(),b.moveTo(m,q),b.lineTo(C,q),b.stroke()));(z[d].indexLabel||s.indexLabel||z[d].indexLabelFormatter||s.indexLabelFormatter)&&this._indexLabels.push({chartType:s.type,dataPoint:z[d],dataSeries:s,point:{x:B+(C-B)/2,y:a.axisY.reversed?p:l},direction:1,bounds:{x1:B,y1:Math.min(l,p),x2:C,y2:Math.max(l,p)},color:e})}}w&&(g.drawImage(this._preRenderCanvas,0,0,
|
|
430
|
+
this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(r.x1,r.y1,r.width,r.height),b.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,
|
|
431
|
+
animationBase:0}}};m.prototype.renderBoxAndWhisker=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g,b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var e=null,h=this.plotArea,r=0,d,m,k,l,p,q,f,e=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,r=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.015*this.width,t=a.axisX.dataInfo.minDiff;isFinite(t)||
|
|
432
|
+
(t=0.3*Math.abs(a.axisX.range));t=this.options.dataPointWidth?this.dataPointWidth:0.7*h.width*(a.axisX.logarithmic?Math.log(t)/Math.log(a.axisX.range):Math.abs(t)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&e>r&&(e=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&r<e)&&(r=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,e));t<e&&(t=e);t>r&&(t=r);c.save();w&&b.save();c.beginPath();c.rect(h.x1,h.y1,h.width,
|
|
433
|
+
h.height);c.clip();w&&(b.beginPath(),b.rect(h.x1,h.y1,h.width,h.height),b.clip());for(var v=!1,v=!!a.axisY.reversed,x=0;x<a.dataSeriesIndexes.length;x++){var s=a.dataSeriesIndexes[x],z=this.data[s],u=z.dataPoints;if(0<u.length)for(var B=5<t&&z.bevelEnabled?!0:!1,r=0;r<u.length;r++)if(u[r].getTime?f=u[r].x.getTime():f=u[r].x,!(f<a.axisX.dataInfo.viewPortMin||f>a.axisX.dataInfo.viewPortMax)&&!n(u[r].y)&&u[r].y.length&&"number"===typeof u[r].y[0]&&"number"===typeof u[r].y[1]&&"number"===typeof u[r].y[2]&&
|
|
434
|
+
"number"===typeof u[r].y[3]&&"number"===typeof u[r].y[4]&&5===u[r].y.length){d=a.axisX.convertValueToPixel(f);m=a.axisY.convertValueToPixel(u[r].y[0]);k=a.axisY.convertValueToPixel(u[r].y[1]);l=a.axisY.convertValueToPixel(u[r].y[2]);p=a.axisY.convertValueToPixel(u[r].y[3]);q=a.axisY.convertValueToPixel(u[r].y[4]);var C=d-t/2<<0,D=d+t/2<<0,e=u[r].color?u[r].color:z._colorSet[0],A=Math.round(Math.max(1,0.15*t)),H=0===A%2?0:0.5,J=u[r].whiskerColor?u[r].whiskerColor:u[r].color?z.whiskerColor?z.whiskerColor:
|
|
435
|
+
u[r].color:z.whiskerColor?z.whiskerColor:e,U="number"===typeof u[r].whiskerThickness?u[r].whiskerThickness:"number"===typeof z.options.whiskerThickness?z.whiskerThickness:A,ba=u[r].whiskerDashType?u[r].whiskerDashType:z.whiskerDashType,Z=n(u[r].whiskerLength)?n(z.options.whiskerLength)?t:z.whiskerLength:u[r].whiskerLength,Z="number"===typeof Z?0>=Z?0:Z>=t?t:Z:"string"===typeof Z?parseInt(Z)*t/100>t?t:parseInt(Z)*t/100:t,ga=1===Math.round(U)%2?0.5:0,oa=u[r].stemColor?u[r].stemColor:u[r].color?z.stemColor?
|
|
436
|
+
z.stemColor:u[r].color:z.stemColor?z.stemColor:e,ka="number"===typeof u[r].stemThickness?u[r].stemThickness:"number"===typeof z.options.stemThickness?z.stemThickness:A,E=1===Math.round(ka)%2?0.5:0,L=u[r].stemDashType?u[r].stemDashType:z.stemDashType,O=u[r].lineColor?u[r].lineColor:u[r].color?z.lineColor?z.lineColor:u[r].color:z.lineColor?z.lineColor:e,Q="number"===typeof u[r].lineThickness?u[r].lineThickness:"number"===typeof z.options.lineThickness?z.lineThickness:A,P=u[r].lineDashType?u[r].lineDashType:
|
|
437
|
+
z.lineDashType,M=1===Math.round(Q)%2?0.5:0,N=z.upperBoxColor,S=z.lowerBoxColor,ta=n(z.options.fillOpacity)?1:z.fillOpacity,R=z.dataPointIds[r];this._eventManager.objectMap[R]={id:R,objectType:"dataPoint",dataSeriesIndex:s,dataPointIndex:r,x1:C,y1:m,x2:D,y2:k,x3:d,y3:l,x4:d,y4:p,y5:q,borderThickness:A,color:e,stemThickness:ka,stemColor:oa,whiskerThickness:U,whiskerLength:Z,whiskerColor:J,lineThickness:Q,lineColor:O};c.save();0<ka&&(c.beginPath(),c.strokeStyle=oa,c.lineWidth=ka,c.setLineDash&&c.setLineDash(G(L,
|
|
438
|
+
ka)),c.moveTo(d-E,k),c.lineTo(d-E,m),c.stroke(),c.moveTo(d-E,p),c.lineTo(d-E,l),c.stroke());c.restore();b.lineWidth=Math.max(A,4);c.beginPath();aa(c,C,Math.min(q,k),D,Math.max(k,q),S,0,e,v?B:!1,v?!1:B,!1,!1,ta);c.beginPath();aa(c,C,Math.min(l,q),D,Math.max(q,l),N,0,e,v?!1:B,v?B:!1,!1,!1,ta);c.beginPath();c.lineWidth=A;c.strokeStyle=e;c.rect(C-H,Math.min(k,l)-H,D-C+2*H,Math.max(k,l)-Math.min(k,l)+2*H);c.stroke();c.save();0<Q&&(c.beginPath(),c.globalAlpha=1,c.setLineDash&&c.setLineDash(G(P,Q)),c.strokeStyle=
|
|
439
|
+
O,c.lineWidth=Q,c.moveTo(C,q-M),c.lineTo(D,q-M),c.stroke());c.restore();c.save();0<U&&(c.beginPath(),c.setLineDash&&c.setLineDash(G(ba,U)),c.strokeStyle=J,c.lineWidth=U,c.moveTo(d-Z/2<<0,p-ga),c.lineTo(d+Z/2<<0,p-ga),c.stroke(),c.moveTo(d-Z/2<<0,m+ga),c.lineTo(d+Z/2<<0,m+ga),c.stroke());c.restore();w&&(e=X(R),b.strokeStyle=e,b.lineWidth=ka,0<ka&&(b.moveTo(d-H-E,k),b.lineTo(d-H-E,Math.max(m,p)),b.stroke(),b.moveTo(d-H-E,Math.min(m,p)),b.lineTo(d-H-E,l),b.stroke()),aa(b,C,Math.max(k,l),D,Math.min(k,
|
|
440
|
+
l),e,0,null,!1,!1,!1,!1),0<U&&(b.beginPath(),b.lineWidth=U,b.moveTo(d+Z/2,p-ga),b.lineTo(d-Z/2,p-ga),b.stroke(),b.moveTo(d+Z/2,m+ga),b.lineTo(d-Z/2,m+ga),b.stroke()));(u[r].indexLabel||z.indexLabel||u[r].indexLabelFormatter||z.indexLabelFormatter)&&this._indexLabels.push({chartType:z.type,dataPoint:u[r],dataSeries:z,point:{x:C+(D-C)/2,y:a.axisY.reversed?m:p},direction:1,bounds:{x1:C,y1:Math.min(m,p),x2:D,y2:Math.max(m,p)},color:e})}}w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),
|
|
441
441
|
c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(h.x1,h.y1,h.width,h.height),b.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};m.prototype.renderRangeColumn=
|
|
442
|
-
function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=0,
|
|
443
|
-
0.9*(e.width*(a.axisX.logarithmic?Math.log(k)/Math.log(a.axisX.range):Math.abs(k)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&h>
|
|
444
|
-
this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var l=0;l<a.dataSeriesIndexes.length;l++){var p=a.dataSeriesIndexes[l],
|
|
445
|
-
a.axisY.convertValueToPixel(f[h].y[0]);d=a.axisY.convertValueToPixel(f[h].y[1]);var v=a.axisX.reversed?b+a.plotType.totalDataSeries*k/2-(a.previousDataSeriesCount+l)*k<<0:b-a.plotType.totalDataSeries*k/2+(a.previousDataSeriesCount+l)*k<<0,x=a.axisX.reversed?v-k<<0:v+k<<0,b=f[h].color?f[h].color:
|
|
446
|
-
x:v,
|
|
447
|
-
dataPoint:f[h],dataSeries:
|
|
448
|
-
0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};m.prototype.renderError=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g,b=a.axisY._position?"left"===a.axisY._position||"right"===a.axisY._position?!1:!0:!1;if(!(0>=a.dataSeriesIndexes.length)){var e=null,h=!1,
|
|
449
|
-
d=0,m,k,l,p,
|
|
442
|
+
function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=0,r,d,m,h=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;r=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.03*this.width;var k=a.axisX.dataInfo.minDiff;isFinite(k)||(k=0.3*Math.abs(a.axisX.range));k=this.options.dataPointWidth?this.dataPointWidth:
|
|
443
|
+
0.9*(e.width*(a.axisX.logarithmic?Math.log(k)/Math.log(a.axisX.range):Math.abs(k)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&h>r&&(h=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&r<h)&&(r=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,h));k<h&&(k=h);k>r&&(k=r);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),
|
|
444
|
+
this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var l=0;l<a.dataSeriesIndexes.length;l++){var p=a.dataSeriesIndexes[l],q=this.data[p],f=q.dataPoints;if(0<f.length)for(var t=5<k&&q.bevelEnabled?!0:!1,h=0;h<f.length;h++)if(f[h].getTime?m=f[h].x.getTime():m=f[h].x,!(m<a.axisX.dataInfo.viewPortMin||m>a.axisX.dataInfo.viewPortMax)&&!n(f[h].y)&&f[h].y.length&&"number"===typeof f[h].y[0]&&"number"===typeof f[h].y[1]){b=a.axisX.convertValueToPixel(m);r=
|
|
445
|
+
a.axisY.convertValueToPixel(f[h].y[0]);d=a.axisY.convertValueToPixel(f[h].y[1]);var v=a.axisX.reversed?b+a.plotType.totalDataSeries*k/2-(a.previousDataSeriesCount+l)*k<<0:b-a.plotType.totalDataSeries*k/2+(a.previousDataSeriesCount+l)*k<<0,x=a.axisX.reversed?v-k<<0:v+k<<0,b=f[h].color?f[h].color:q._colorSet[h%q._colorSet.length];if(r>d){var s=r;r=d;d=s}s=q.dataPointIds[h];this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:p,dataPointIndex:h,x1:v,y1:r,x2:x,y2:d};aa(c,a.axisX.reversed?
|
|
446
|
+
x:v,r,a.axisX.reversed?v:x,d,b,0,b,t,t,!1,!1,q.fillOpacity);b=X(s);w&&aa(this._eventManager.ghostCtx,a.axisX.reversed?x:v,r,a.axisX.reversed?v:x,d,b,0,null,!1,!1,!1,!1);if(f[h].indexLabel||q.indexLabel||f[h].indexLabelFormatter||q.indexLabelFormatter)this._indexLabels.push({chartType:"rangeColumn",dataPoint:f[h],dataSeries:q,indexKeyword:0,point:{x:v+(x-v)/2,y:f[h].y[1]>=f[h].y[0]?d:r},direction:f[h].y[1]>=f[h].y[0]?-1:1,bounds:{x1:v,y1:Math.min(r,d),x2:x,y2:Math.max(r,d)},color:b}),this._indexLabels.push({chartType:"rangeColumn",
|
|
447
|
+
dataPoint:f[h],dataSeries:q,indexKeyword:1,point:{x:v+(x-v)/2,y:f[h].y[1]>=f[h].y[0]?r:d},direction:f[h].y[1]>=f[h].y[0]?1:-1,bounds:{x1:v,y1:Math.min(r,d),x2:x,y2:Math.max(r,d)},color:b})}}w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,
|
|
448
|
+
0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};m.prototype.renderError=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g,b=a.axisY._position?"left"===a.axisY._position||"right"===a.axisY._position?!1:!0:!1;if(!(0>=a.dataSeriesIndexes.length)){var e=null,h=!1,r=this.plotArea,
|
|
449
|
+
d=0,m,k,l,p,q,f,t,v=a.axisX.dataInfo.minDiff;isFinite(v)||(v=0.3*Math.abs(a.axisX.range));c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(r.x1,r.y1,r.width,r.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(r.x1,r.y1,r.width,r.height),this._eventManager.ghostCtx.clip());for(var x=0,s=0;s<this.data.length;s++)!this.data[s].type.match(/(bar|column)/ig)||!this.data[s].visible||this.data[s].type.match(/(stacked)/ig)&&x||x++;for(var z=0;z<
|
|
450
450
|
a.dataSeriesIndexes.length;z++){var u=a.dataSeriesIndexes[z],A=this.data[u],C=A.dataPoints,D=n(A._linkedSeries)?!1:A._linkedSeries.type.match(/(bar|column)/ig)&&A._linkedSeries.visible?!0:!1,G=0;if(D)for(e=A._linkedSeries.id,s=0;s<e;s++)!this.data[s].type.match(/(bar|column)/ig)||!this.data[s].visible||this.data[s].type.match(/(stacked)/ig)&&G||(this.data[s].type.match(/(range)/ig)&&(h=!0),G++);e=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:
|
|
451
|
-
1;d=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:b?Math.min(0.15*this.height,0.9*(this.plotArea.height/(D?x:1)))<<0:0.3*this.width;h&&(d=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:b?Math.min(0.15*this.height,0.9*(this.plotArea.height/(D?x:1)))<<0:0.03*this.width);s=this.options.dataPointWidth?this.dataPointWidth:0.9*((b?
|
|
451
|
+
1;d=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:b?Math.min(0.15*this.height,0.9*(this.plotArea.height/(D?x:1)))<<0:0.3*this.width;h&&(d=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:b?Math.min(0.15*this.height,0.9*(this.plotArea.height/(D?x:1)))<<0:0.03*this.width);s=this.options.dataPointWidth?this.dataPointWidth:0.9*((b?r.height:r.width)*(a.axisX.logarithmic?Math.log(v)/Math.log(a.axisX.range):
|
|
452
452
|
Math.abs(v)/Math.abs(a.axisX.range))/(D?x:1))<<0;this.dataPointMaxWidth&&e>d&&(e=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,d));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&d<e)&&(d=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,e));s<e&&(s=e);s>d&&(s=d);if(0<C.length)for(var H=A._colorSet,d=0;d<C.length;d++){var e=A.lineColor=A.options.color?A.options.color:H[0],J={color:C[d].whiskerColor?C[d].whiskerColor:C[d].color?A.whiskerColor?A.whiskerColor:C[d].color:
|
|
453
453
|
A.whiskerColor?A.whiskerColor:e,thickness:n(C[d].whiskerThickness)?A.whiskerThickness:C[d].whiskerThickness,dashType:C[d].whiskerDashType?C[d].whiskerDashType:A.whiskerDashType,length:n(C[d].whiskerLength)?n(A.options.whiskerLength)?s:A.options.whiskerLength:C[d].whiskerLength,trimLength:n(C[d].whiskerLength)?n(A.options.whiskerLength)?50:0:0};J.length="number"===typeof J.length?0>=J.length?0:J.length>=s?s:J.length:"string"===typeof J.length?parseInt(J.length)*s/100>s?s:parseInt(J.length)*s/100>s:
|
|
454
454
|
s;J.thickness="number"===typeof J.thickness?0>J.thickness?0:Math.round(J.thickness):2;var U={color:C[d].stemColor?C[d].stemColor:C[d].color?A.stemColor?A.stemColor:C[d].color:A.stemColor?A.stemColor:e,thickness:C[d].stemThickness?C[d].stemThickness:A.stemThickness,dashType:C[d].stemDashType?C[d].stemDashType:A.stemDashType};U.thickness="number"===typeof U.thickness?0>U.thickness?0:Math.round(U.thickness):2;C[d].getTime?t=C[d].x.getTime():t=C[d].x;if(!(t<a.axisX.dataInfo.viewPortMin||t>a.axisX.dataInfo.viewPortMax)&&
|
|
455
|
-
!n(C[d].y)&&C[d].y.length&&"number"===typeof C[d].y[0]&&"number"===typeof C[d].y[1]){var ba=a.axisX.convertValueToPixel(t);b?k=ba:m=ba;ba=a.axisY.convertValueToPixel(C[d].y[0]);b?l=ba:
|
|
456
|
-
(ba=l,l=p,p=ba);ba=A.dataPointIds[d];this._eventManager.objectMap[ba]={id:ba,objectType:"dataPoint",dataSeriesIndex:u,dataPointIndex:d,x1:Math.min(l,p),y1:Math.min(
|
|
457
|
-
dataSeries:A,indexKeyword:0,point:{x:b?C[d].y[1]>=C[d].y[0]?l:p:l+(p-l)/2,y:b?
|
|
458
|
-
l,y1:b?
|
|
459
|
-
this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};m.prototype.renderRangeBar=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=0,
|
|
460
|
-
this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0;var l=a.axisX.dataInfo.minDiff;isFinite(l)||(l=0.3*Math.abs(a.axisX.range));l=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(l)/Math.log(a.axisX.range):Math.abs(l)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&h>
|
|
461
|
-
Infinity,
|
|
462
|
-
t=f.dataPoints;if(0<t.length){var v=5<l&&f.bevelEnabled?!0:!1;c.strokeStyle="#4572A7 ";for(h=0;h<t.length;h++)if(t[h].getTime?k=t[h].x.getTime():k=t[h].x,!(k<a.axisX.dataInfo.viewPortMin||k>a.axisX.dataInfo.viewPortMax)&&!n(t[h].y)&&t[h].y.length&&"number"===typeof t[h].y[0]&&"number"===typeof t[h].y[1]){
|
|
463
|
-
l<<0:m-a.plotType.totalDataSeries*l/2+(a.previousDataSeriesCount+p)*l<<0;var x=a.axisX.reversed?m-l<<0:m+l<<0;
|
|
464
|
-
null,!1,!1,!1,!1);if(t[h].indexLabel||f.indexLabel||t[h].indexLabelFormatter||f.indexLabelFormatter)this._indexLabels.push({chartType:"rangeBar",dataPoint:t[h],dataSeries:f,indexKeyword:0,point:{x:t[h].y[1]>=t[h].y[0]?
|
|
465
|
-
-1,bounds:{x1:Math.min(
|
|
455
|
+
!n(C[d].y)&&C[d].y.length&&"number"===typeof C[d].y[0]&&"number"===typeof C[d].y[1]){var ba=a.axisX.convertValueToPixel(t);b?k=ba:m=ba;ba=a.axisY.convertValueToPixel(C[d].y[0]);b?l=ba:q=ba;ba=a.axisY.convertValueToPixel(C[d].y[1]);b?p=ba:f=ba;b?(q=a.axisX.reversed?k+(D?x:1)*s/2-(D?G-1:0)*s<<0:k-(D?x:1)*s/2+(D?G-1:0)*s<<0,f=a.axisX.reversed?q-s<<0:q+s<<0):(l=a.axisX.reversed?m+(D?x:1)*s/2-(D?G-1:0)*s<<0:m-(D?x:1)*s/2+(D?G-1:0)*s<<0,p=a.axisX.reversed?l-s<<0:l+s<<0);!b&&q>f&&(ba=q,q=f,f=ba);b&&l>p&&
|
|
456
|
+
(ba=l,l=p,p=ba);ba=A.dataPointIds[d];this._eventManager.objectMap[ba]={id:ba,objectType:"dataPoint",dataSeriesIndex:u,dataPointIndex:d,x1:Math.min(l,p),y1:Math.min(q,f),x2:Math.max(p,l),y2:Math.max(f,q),isXYSwapped:b,stemProperties:U,whiskerProperties:J};B(c,Math.min(l,p),Math.min(q,f),Math.max(p,l),Math.max(f,q),e,J,U,b);w&&B(this._eventManager.ghostCtx,l,q,p,f,e,J,U,b);if(C[d].indexLabel||A.indexLabel||C[d].indexLabelFormatter||A.indexLabelFormatter)this._indexLabels.push({chartType:"error",dataPoint:C[d],
|
|
457
|
+
dataSeries:A,indexKeyword:0,point:{x:b?C[d].y[1]>=C[d].y[0]?l:p:l+(p-l)/2,y:b?q+(f-q)/2:C[d].y[1]>=C[d].y[0]?f:q},direction:C[d].y[1]>=C[d].y[0]?-1:1,bounds:{x1:b?Math.min(l,p):l,y1:b?q:Math.min(q,f),x2:b?Math.max(l,p):p,y2:b?f:Math.max(q,f)},color:e,axisSwapped:b}),this._indexLabels.push({chartType:"error",dataPoint:C[d],dataSeries:A,indexKeyword:1,point:{x:b?C[d].y[1]>=C[d].y[0]?p:l:l+(p-l)/2,y:b?q+(f-q)/2:C[d].y[1]>=C[d].y[0]?q:f},direction:C[d].y[1]>=C[d].y[0]?1:-1,bounds:{x1:b?Math.min(l,p):
|
|
458
|
+
l,y1:b?q:Math.min(q,f),x2:b?Math.max(l,p):p,y2:b?f:Math.max(q,f)},color:e,axisSwapped:b})}}}w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(r.x1,r.y1,r.width,r.height),
|
|
459
|
+
this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};m.prototype.renderRangeBar=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=0,r,d,m,k,h=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;r=this.options.dataPointMaxWidth?
|
|
460
|
+
this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0;var l=a.axisX.dataInfo.minDiff;isFinite(l)||(l=0.3*Math.abs(a.axisX.range));l=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(l)/Math.log(a.axisX.range):Math.abs(l)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&h>r&&(h=Math.min(this.options.dataPointWidth?this.dataPointWidth:
|
|
461
|
+
Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&r<h)&&(r=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,h));l<h&&(l=h);l>r&&(l=r);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var p=0;p<a.dataSeriesIndexes.length;p++){var q=a.dataSeriesIndexes[p],f=this.data[q],
|
|
462
|
+
t=f.dataPoints;if(0<t.length){var v=5<l&&f.bevelEnabled?!0:!1;c.strokeStyle="#4572A7 ";for(h=0;h<t.length;h++)if(t[h].getTime?k=t[h].x.getTime():k=t[h].x,!(k<a.axisX.dataInfo.viewPortMin||k>a.axisX.dataInfo.viewPortMax)&&!n(t[h].y)&&t[h].y.length&&"number"===typeof t[h].y[0]&&"number"===typeof t[h].y[1]){r=a.axisY.convertValueToPixel(t[h].y[0]);d=a.axisY.convertValueToPixel(t[h].y[1]);m=a.axisX.convertValueToPixel(k);m=a.axisX.reversed?m+a.plotType.totalDataSeries*l/2-(a.previousDataSeriesCount+p)*
|
|
463
|
+
l<<0:m-a.plotType.totalDataSeries*l/2+(a.previousDataSeriesCount+p)*l<<0;var x=a.axisX.reversed?m-l<<0:m+l<<0;r>d&&(b=r,r=d,d=b);b=t[h].color?t[h].color:f._colorSet[h%f._colorSet.length];aa(c,r,a.axisX.reversed?x:m,d,a.axisX.reversed?m:x,b,0,null,v,!1,!1,!1,f.fillOpacity);b=f.dataPointIds[h];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:r,y1:m,x2:d,y2:x};b=X(b);w&&aa(this._eventManager.ghostCtx,r,a.axisX.reversed?x:m,d,a.axisX.reversed?m:x,b,0,
|
|
464
|
+
null,!1,!1,!1,!1);if(t[h].indexLabel||f.indexLabel||t[h].indexLabelFormatter||f.indexLabelFormatter)this._indexLabels.push({chartType:"rangeBar",dataPoint:t[h],dataSeries:f,indexKeyword:0,point:{x:t[h].y[1]>=t[h].y[0]?r:d,y:m+(x-m)/2},direction:t[h].y[1]>=t[h].y[0]?-1:1,bounds:{x1:Math.min(r,d),y1:m,x2:Math.max(r,d),y2:x},color:b}),this._indexLabels.push({chartType:"rangeBar",dataPoint:t[h],dataSeries:f,indexKeyword:1,point:{x:t[h].y[1]>=t[h].y[0]?d:r,y:m+(x-m)/2},direction:t[h].y[1]>=t[h].y[0]?1:
|
|
465
|
+
-1,bounds:{x1:Math.min(r,d),y1:m,x2:Math.max(r,d),y2:x},color:b})}}}w&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());
|
|
466
466
|
c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};m.prototype.renderRangeArea=function(a){function g(){if(z){for(var a=null,c=n.length-1;0<=c;c--)a=n[c],b.lineTo(a.x,a.y2),e.lineTo(a.x,a.y2);b.closePath();b.globalAlpha=l.fillOpacity;b.fill();b.globalAlpha=1;e.fill();if(0<l.lineThickness){b.beginPath();b.moveTo(a.x,a.y2);for(c=0;c<n.length;c++)a=n[c],b.lineTo(a.x,a.y2);b.moveTo(n[0].x,n[0].y1);for(c=0;c<n.length;c++)a=
|
|
467
|
-
n[c],b.lineTo(a.x,a.y1);b.stroke()}b.beginPath();b.moveTo(m,v);e.beginPath();e.moveTo(m,v);z={x:m,y:v};n=[];n.push({x:m,y1:v,y2:x})}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,h=[],
|
|
468
|
-
l=this.data[k],p=l.dataPoints,h=l.id;this._eventManager.objectMap[h]={objectType:"dataSeries",dataSeriesIndex:k};h=X(h);e.fillStyle=h;var h=[],
|
|
469
|
-
p[f].x.getTime():p[f].x,!(s<a.axisX.dataInfo.viewPortMin||s>a.axisX.dataInfo.viewPortMax&&(!l.connectNullData||!J)))if(null!==p[f].y&&p[f].y.length&&"number"===typeof p[f].y[0]&&"number"===typeof p[f].y[1]){m=a.axisX.convertValueToPixel(s);v=a.axisY.convertValueToPixel(p[f].y[0]);x=a.axisY.convertValueToPixel(p[f].y[1]);
|
|
470
|
-
b.setLineDash(B)),b.lineTo(m,v),w&&e.lineTo(m,v),n.push({x:m,y1:v,y2:x})):(b.beginPath(),b.moveTo(m,v),z={x:m,y:v},n=[],n.push({x:m,y1:v,y2:x}),w&&(e.beginPath(),e.moveTo(m,v))),J=
|
|
467
|
+
n[c],b.lineTo(a.x,a.y1);b.stroke()}b.beginPath();b.moveTo(m,v);e.beginPath();e.moveTo(m,v);z={x:m,y:v};n=[];n.push({x:m,y1:v,y2:x})}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,h=[],r=this.plotArea;b.save();w&&e.save();b.beginPath();b.rect(r.x1,r.y1,r.width,r.height);b.clip();w&&(e.beginPath(),e.rect(r.x1,r.y1,r.width,r.height),e.clip());for(var d=0;d<a.dataSeriesIndexes.length;d++){var n=[],k=a.dataSeriesIndexes[d],
|
|
468
|
+
l=this.data[k],p=l.dataPoints,h=l.id;this._eventManager.objectMap[h]={objectType:"dataSeries",dataSeriesIndex:k};h=X(h);e.fillStyle=h;var h=[],q=!0,f=0,m,v,x,s,z=null;if(0<p.length){var u=l._colorSet[f%l._colorSet.length],t=l.lineColor=l.options.lineColor||u,C=t;b.fillStyle=u;b.strokeStyle=t;b.lineWidth=l.lineThickness;var D="solid";if(b.setLineDash){var B=G(l.nullDataLineDashType,l.lineThickness),D=l.lineDashType,A=G(D,l.lineThickness);b.setLineDash(A)}for(var J=!0;f<p.length;f++)if(s=p[f].x.getTime?
|
|
469
|
+
p[f].x.getTime():p[f].x,!(s<a.axisX.dataInfo.viewPortMin||s>a.axisX.dataInfo.viewPortMax&&(!l.connectNullData||!J)))if(null!==p[f].y&&p[f].y.length&&"number"===typeof p[f].y[0]&&"number"===typeof p[f].y[1]){m=a.axisX.convertValueToPixel(s);v=a.axisY.convertValueToPixel(p[f].y[0]);x=a.axisY.convertValueToPixel(p[f].y[1]);q||J?(l.connectNullData&&!q?(b.setLineDash&&(l.options.nullDataLineDashType||D===l.lineDashType&&l.lineDashType!==l.nullDataLineDashType)&&(n[n.length-1].newLineDashArray=A,D=l.nullDataLineDashType,
|
|
470
|
+
b.setLineDash(B)),b.lineTo(m,v),w&&e.lineTo(m,v),n.push({x:m,y1:v,y2:x})):(b.beginPath(),b.moveTo(m,v),z={x:m,y:v},n=[],n.push({x:m,y1:v,y2:x}),w&&(e.beginPath(),e.moveTo(m,v))),J=q=!1):(b.lineTo(m,v),n.push({x:m,y1:v,y2:x}),w&&e.lineTo(m,v),0==f%250&&g());s=l.dataPointIds[f];this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:f,x1:m,y1:v,y2:x};f<p.length-1&&(C!==(p[f].lineColor||t)||D!==(p[f].lineDashType||l.lineDashType))&&(g(),C=p[f].lineColor||t,n[n.length-
|
|
471
471
|
1].newStrokeStyle=C,b.strokeStyle=C,b.setLineDash&&(p[f].lineDashType?(D=p[f].lineDashType,n[n.length-1].newLineDashArray=G(D,l.lineThickness),b.setLineDash(n[n.length-1].newLineDashArray)):(D=l.lineDashType,n[n.length-1].newLineDashArray=A,b.setLineDash(A))));if(0!==p[f].markerSize&&(0<p[f].markerSize||0<l.markerSize)){var U=l.getMarkerProperties(f,m,x,b);h.push(U);var ba=X(s);w&&h.push({x:m,y:x,ctx:e,type:U.type,size:U.size,color:ba,borderColor:ba,borderThickness:U.borderThickness});U=l.getMarkerProperties(f,
|
|
472
472
|
m,v,b);h.push(U);ba=X(s);w&&h.push({x:m,y:v,ctx:e,type:U.type,size:U.size,color:ba,borderColor:ba,borderThickness:U.borderThickness})}if(p[f].indexLabel||l.indexLabel||p[f].indexLabelFormatter||l.indexLabelFormatter)this._indexLabels.push({chartType:"rangeArea",dataPoint:p[f],dataSeries:l,indexKeyword:0,point:{x:m,y:v},direction:p[f].y[0]>p[f].y[1]===a.axisY.reversed?-1:1,color:u}),this._indexLabels.push({chartType:"rangeArea",dataPoint:p[f],dataSeries:l,indexKeyword:1,point:{x:m,y:x},direction:p[f].y[0]>
|
|
473
|
-
p[f].y[1]===a.axisY.reversed?1:-1,color:u})}else J||
|
|
473
|
+
p[f].y[1]===a.axisY.reversed?1:-1,color:u})}else J||q||g(),J=!0;g();W.drawMarkers(h)}}w&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(r.x1,r.y1,r.width,r.height),this._eventManager.ghostCtx.restore());
|
|
474
474
|
b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};m.prototype.renderRangeSplineArea=function(a){function g(a,c){var f=t(v,2);if(0<f.length){if(0<k.lineThickness){b.strokeStyle=c;b.setLineDash&&b.setLineDash(a);b.beginPath();b.moveTo(f[0].x,f[0].y);for(var g=0;g<f.length-3;g+=3){if(f[g].newStrokeStyle||f[g].newLineDashArray)b.stroke(),b.beginPath(),b.moveTo(f[g].x,f[g].y),f[g].newStrokeStyle&&(b.strokeStyle=f[g].newStrokeStyle),
|
|
475
475
|
f[g].newLineDashArray&&b.setLineDash(f[g].newLineDashArray);b.bezierCurveTo(f[g+1].x,f[g+1].y,f[g+2].x,f[g+2].y,f[g+3].x,f[g+3].y)}}b.beginPath();b.moveTo(f[0].x,f[0].y);w&&(e.beginPath(),e.moveTo(f[0].x,f[0].y));for(g=0;g<f.length-3;g+=3)b.bezierCurveTo(f[g+1].x,f[g+1].y,f[g+2].x,f[g+2].y,f[g+3].x,f[g+3].y),w&&e.bezierCurveTo(f[g+1].x,f[g+1].y,f[g+2].x,f[g+2].y,f[g+3].x,f[g+3].y);f=t(x,2);b.lineTo(x[x.length-1].x,x[x.length-1].y);for(g=f.length-1;2<g;g-=3)b.bezierCurveTo(f[g-1].x,f[g-1].y,f[g-2].x,
|
|
476
476
|
f[g-2].y,f[g-3].x,f[g-3].y),w&&e.bezierCurveTo(f[g-1].x,f[g-1].y,f[g-2].x,f[g-2].y,f[g-3].x,f[g-3].y);b.closePath();b.globalAlpha=k.fillOpacity;b.fill();w&&(e.closePath(),e.fill());b.globalAlpha=1;if(0<k.lineThickness){b.strokeStyle=c;b.setLineDash&&b.setLineDash(a);b.beginPath();b.moveTo(f[0].x,f[0].y);for(var h=g=0;g<f.length-3;g+=3,h++){if(v[h].newStrokeStyle||v[h].newLineDashArray)b.stroke(),b.beginPath(),b.moveTo(f[g].x,f[g].y),v[h].newStrokeStyle&&(b.strokeStyle=v[h].newStrokeStyle),v[h].newLineDashArray&&
|
|
477
477
|
b.setLineDash(v[h].newLineDashArray);b.bezierCurveTo(f[g+1].x,f[g+1].y,f[g+2].x,f[g+2].y,f[g+3].x,f[g+3].y)}f=t(v,2);b.moveTo(f[0].x,f[0].y);for(h=g=0;g<f.length-3;g+=3,h++){if(v[h].newStrokeStyle||v[h].newLineDashArray)b.stroke(),b.beginPath(),b.moveTo(f[g].x,f[g].y),v[h].newStrokeStyle&&(b.strokeStyle=v[h].newStrokeStyle),v[h].newLineDashArray&&b.setLineDash(v[h].newLineDashArray);b.bezierCurveTo(f[g+1].x,f[g+1].y,f[g+2].x,f[g+2].y,f[g+3].x,f[g+3].y)}b.stroke()}b.beginPath()}}var c=a.targetCanvasCtx||
|
|
478
|
-
this.plotArea.ctx,b=w?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,h=[],
|
|
479
|
-
f,m,v=[],x=[];if(0<l.length){var s=k._colorSet[p%k._colorSet.length],z=k.lineColor=k.options.lineColor||s,u=z;b.fillStyle=s;b.lineWidth=k.lineThickness;var A="solid",C;if(b.setLineDash){var D=G(k.nullDataLineDashType,k.lineThickness),A=k.lineDashType;C=G(A,k.lineThickness)}for(f=!1;p<l.length;p++)if(
|
|
480
|
-
typeof l[p].y[1]){
|
|
481
|
-
v[v.length-1].newLineDashArray=G(A,k.lineThickness)):(A=k.lineDashType,v[v.length-1].newLineDashArray=C)));if(0!==l[p].markerSize&&(0<l[p].markerSize||0<k.markerSize)){var H=k.getMarkerProperties(p,
|
|
482
|
-
k.indexLabel||l[p].indexLabelFormatter||k.indexLabelFormatter)this._indexLabels.push({chartType:"rangeSplineArea",dataPoint:l[p],dataSeries:k,indexKeyword:0,point:{x:
|
|
483
|
-
1].newLineDashArray=D,A=k.nullDataLineDashType):(g(C,z),v=[],x=[])),f=!0;g(C,z);W.drawMarkers(h)}}w&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(
|
|
484
|
-
this._eventManager.ghostCtx.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};m.prototype.renderWaterfall=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx,e=null,h=this.plotArea,
|
|
485
|
-
this.options.dataPointWidth?this.dataPointWidth:1;n=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.width,0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0;var
|
|
486
|
-
|
|
487
|
-
a.dataSeriesIndexes[f],v=this.data[m],x=v.dataPoints,e=v._colorSet[0];v.risingColor=v.options.risingColor?v.options.risingColor:e;v.fallingColor=v.options.fallingColor?v.options.fallingColor:"#e40a0a";var s="number"===typeof v.options.lineThickness?Math.round(v.lineThickness):1,z=1===Math.round(s)%2?-0.5:0;if(0<x.length)for(var u=5<
|
|
488
|
-
v.options.nullDataLineDashType||!x[
|
|
489
|
-
f)*
|
|
490
|
-
B,k,e,0,null,!1,!1,!1,!1);var U,J=d;U="undefined"!==typeof x[
|
|
491
|
-
"shortDash";c.strokeStyle=x[
|
|
478
|
+
this.plotArea.ctx,b=w?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,h=[],r=this.plotArea;b.save();w&&e.save();b.beginPath();b.rect(r.x1,r.y1,r.width,r.height);b.clip();w&&(e.beginPath(),e.rect(r.x1,r.y1,r.width,r.height),e.clip());for(var d=0;d<a.dataSeriesIndexes.length;d++){var n=a.dataSeriesIndexes[d],k=this.data[n],l=k.dataPoints,h=k.id;this._eventManager.objectMap[h]={objectType:"dataSeries",dataSeriesIndex:n};h=X(h);e.fillStyle=h;var h=[],p=0,q,
|
|
479
|
+
f,m,v=[],x=[];if(0<l.length){var s=k._colorSet[p%k._colorSet.length],z=k.lineColor=k.options.lineColor||s,u=z;b.fillStyle=s;b.lineWidth=k.lineThickness;var A="solid",C;if(b.setLineDash){var D=G(k.nullDataLineDashType,k.lineThickness),A=k.lineDashType;C=G(A,k.lineThickness)}for(f=!1;p<l.length;p++)if(q=l[p].x.getTime?l[p].x.getTime():l[p].x,!(q<a.axisX.dataInfo.viewPortMin||q>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!f)))if(null!==l[p].y&&l[p].y.length&&"number"===typeof l[p].y[0]&&"number"===
|
|
480
|
+
typeof l[p].y[1]){q=a.axisX.convertValueToPixel(q);f=a.axisY.convertValueToPixel(l[p].y[0]);m=a.axisY.convertValueToPixel(l[p].y[1]);var B=k.dataPointIds[p];this._eventManager.objectMap[B]={id:B,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:p,x1:q,y1:f,y2:m};v[v.length]={x:q,y:f};x[x.length]={x:q,y:m};p<l.length-1&&(u!==(l[p].lineColor||z)||A!==(l[p].lineDashType||k.lineDashType))&&(u=l[p].lineColor||z,v[v.length-1].newStrokeStyle=u,b.setLineDash&&(l[p].lineDashType?(A=l[p].lineDashType,
|
|
481
|
+
v[v.length-1].newLineDashArray=G(A,k.lineThickness)):(A=k.lineDashType,v[v.length-1].newLineDashArray=C)));if(0!==l[p].markerSize&&(0<l[p].markerSize||0<k.markerSize)){var H=k.getMarkerProperties(p,q,f,b);h.push(H);var J=X(B);w&&h.push({x:q,y:f,ctx:e,type:H.type,size:H.size,color:J,borderColor:J,borderThickness:H.borderThickness});H=k.getMarkerProperties(p,q,m,b);h.push(H);J=X(B);w&&h.push({x:q,y:m,ctx:e,type:H.type,size:H.size,color:J,borderColor:J,borderThickness:H.borderThickness})}if(l[p].indexLabel||
|
|
482
|
+
k.indexLabel||l[p].indexLabelFormatter||k.indexLabelFormatter)this._indexLabels.push({chartType:"rangeSplineArea",dataPoint:l[p],dataSeries:k,indexKeyword:0,point:{x:q,y:f},direction:l[p].y[0]<=l[p].y[1]?-1:1,color:s}),this._indexLabels.push({chartType:"rangeSplineArea",dataPoint:l[p],dataSeries:k,indexKeyword:1,point:{x:q,y:m},direction:l[p].y[0]<=l[p].y[1]?1:-1,color:s});f=!1}else 0<p&&!f&&(k.connectNullData?b.setLineDash&&(0<v.length&&(k.options.nullDataLineDashType||!l[p-1].lineDashType))&&(v[v.length-
|
|
483
|
+
1].newLineDashArray=D,A=k.nullDataLineDashType):(g(C,z),v=[],x=[])),f=!0;g(C,z);W.drawMarkers(h)}}w&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(r.x1,r.y1,r.width,r.height),
|
|
484
|
+
this._eventManager.ghostCtx.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};m.prototype.renderWaterfall=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx,e=null,h=this.plotArea,r=0,d,n,k,l,p=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),r=this.options.dataPointMinWidth?this.dataPointMinWidth:
|
|
485
|
+
this.options.dataPointWidth?this.dataPointWidth:1;n=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.width,0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0;var q=a.axisX.dataInfo.minDiff;isFinite(q)||(q=0.3*Math.abs(a.axisX.range));q=this.options.dataPointWidth?this.dataPointWidth:0.6*(h.width*(a.axisX.logarithmic?Math.log(q)/Math.log(a.axisX.range):Math.abs(q)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&
|
|
486
|
+
r>n&&(r=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&n<r)&&(n=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,r));q<r&&(q=r);q>n&&(q=n);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(h.x1,h.y1,h.width,h.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(h.x1,h.y1,h.width,h.height),this._eventManager.ghostCtx.clip());for(var f=0;f<a.dataSeriesIndexes.length;f++){var m=
|
|
487
|
+
a.dataSeriesIndexes[f],v=this.data[m],x=v.dataPoints,e=v._colorSet[0];v.risingColor=v.options.risingColor?v.options.risingColor:e;v.fallingColor=v.options.fallingColor?v.options.fallingColor:"#e40a0a";var s="number"===typeof v.options.lineThickness?Math.round(v.lineThickness):1,z=1===Math.round(s)%2?-0.5:0;if(0<x.length)for(var u=5<q&&v.bevelEnabled?!0:!1,t=!1,C=null,D=null,r=0;r<x.length;r++)if(x[r].getTime?l=x[r].x.getTime():l=x[r].x,"number"!==typeof x[r].y){if(0<r&&!t&&v.connectNullData)var A=
|
|
488
|
+
v.options.nullDataLineDashType||!x[r-1].lineDashType?v.nullDataLineDashType:x[r-1].lineDashType;t=!0}else{d=a.axisX.convertValueToPixel(l);n=0===v.dataPointEOs[r].cumulativeSum?p:a.axisY.convertValueToPixel(v.dataPointEOs[r].cumulativeSum);k=0===v.dataPointEOs[r].cumulativeSumYStartValue?p:a.axisY.convertValueToPixel(v.dataPointEOs[r].cumulativeSumYStartValue);d=a.axisX.reversed?d+a.plotType.totalDataSeries*q/2-(a.previousDataSeriesCount+f)*q<<0:d-a.plotType.totalDataSeries*q/2+(a.previousDataSeriesCount+
|
|
489
|
+
f)*q<<0;var B=a.axisX.reversed?d-q<<0:d+q<<0;n>k&&(e=n,n=k,k=e);a.axisY.reversed&&(e=n,n=k,k=e);e=v.dataPointIds[r];this._eventManager.objectMap[e]={id:e,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:r,x1:d,y1:n,x2:B,y2:k};var J=x[r].color?x[r].color:0<x[r].y?v.risingColor:v.fallingColor;aa(c,a.axisX.reversed?B:d,a.axisY.reversed?k:n,a.axisX.reversed?d:B,a.axisY.reversed?n:k,J,0,J,u,u,!1,!1,v.fillOpacity);e=X(e);w&&aa(this._eventManager.ghostCtx,a.axisX.reversed?B:d,n,a.axisX.reversed?d:
|
|
490
|
+
B,k,e,0,null,!1,!1,!1,!1);var U,J=d;U="undefined"!==typeof x[r].isIntermediateSum&&!0===x[r].isIntermediateSum||"undefined"!==typeof x[r].isCumulativeSum&&!0===x[r].isCumulativeSum?0<x[r].y?n:k:0<x[r].y?k:n;0<r&&C&&(!t||v.connectNullData)&&(t&&c.setLineDash&&c.setLineDash(G(A,s)),c.beginPath(),c.moveTo(C,D-z),c.lineTo(J,U-z),0<s&&c.stroke(),w&&(b.beginPath(),b.moveTo(C,D-z),b.lineTo(J,U-z),0<s&&b.stroke()));t=!1;C=B;D=0<x[r].y?n:k;J=x[r].lineDashType?x[r].lineDashType:v.options.lineDashType?v.options.lineDashType:
|
|
491
|
+
"shortDash";c.strokeStyle=x[r].lineColor?x[r].lineColor:v.options.lineColor?v.options.lineColor:"#9e9e9e";c.lineWidth=s;c.setLineDash&&(J=G(J,s),c.setLineDash(J));(x[r].indexLabel||v.indexLabel||x[r].indexLabelFormatter||v.indexLabelFormatter)&&this._indexLabels.push({chartType:"waterfall",dataPoint:x[r],dataSeries:v,point:{x:d+(B-d)/2,y:0<=x[r].y?n:k},direction:0>x[r].y===a.axisY.reversed?1:-1,bounds:{x1:d,y1:Math.min(n,k),x2:B,y2:Math.max(n,k)},color:e})}}w&&(g.drawImage(this._preRenderCanvas,0,
|
|
492
492
|
0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(h.x1,h.y1,h.width,h.height),this._eventManager.ghostCtx.restore());c.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,
|
|
493
|
-
animationBase:0}}};var ia=function(a,g,c,b,e,h,
|
|
494
|
-
2,a.fill());a.globalAlpha=1;a.restore()}};m.prototype.renderPie=function(a){function g(){if(k&&l){var a=0,b=0,c=0,e=0;n(k.options.indexLabelMaxWidth)&&(k.indexLabelMaxWidth=0.33*
|
|
495
|
-
percent:p.percent};p=h.indexLabelFormatter?h.indexLabelFormatter(y):h.indexLabel?m.replaceKeywordsWithValue(h.indexLabel,h,k,g):k.indexLabelFormatter?k.indexLabelFormatter(y):k.indexLabel?m.replaceKeywordsWithValue(k.indexLabel,h,k,g):h.label?h.label:"";m._eventManager.objectMap[
|
|
493
|
+
animationBase:0}}};var ia=function(a,g,c,b,e,h,r,d,n){if(!(0>c)){"undefined"===typeof d&&(d=1);if(!w){var k=Number((r%(2*Math.PI)).toFixed(8));Number((h%(2*Math.PI)).toFixed(8))===k&&(r-=1E-4)}a.save();a.globalAlpha=d;"pie"===e?(a.beginPath(),a.moveTo(g.x,g.y),a.arc(g.x,g.y,c,h,r,!1),a.fillStyle=b,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.fill()):"doughnut"===e&&(a.beginPath(),a.arc(g.x,g.y,c,h,r,!1),0<=n&&a.arc(g.x,g.y,n*c,r,h,!0),a.closePath(),a.fillStyle=b,a.strokeStyle="white",a.lineWidth=
|
|
494
|
+
2,a.fill());a.globalAlpha=1;a.restore()}};m.prototype.renderPie=function(a){function g(){if(k&&l){var a=0,b=0,c=0,e=0;n(k.options.indexLabelMaxWidth)&&(k.indexLabelMaxWidth=0.33*q.width);for(var g=0;g<l.length;g++){var h=l[g],r=k.dataPointIds[g];f[g].id=r;f[g].objectType="dataPoint";f[g].dataPointIndex=g;f[g].dataSeriesIndex=0;var d=f[g],p={percent:null,total:null},y=null,p=m.getPercentAndTotal(k,h);if(k.indexLabelFormatter||h.indexLabelFormatter)y={chart:m.options,dataSeries:k,dataPoint:h,total:p.total,
|
|
495
|
+
percent:p.percent};p=h.indexLabelFormatter?h.indexLabelFormatter(y):h.indexLabel?m.replaceKeywordsWithValue(h.indexLabel,h,k,g):k.indexLabelFormatter?k.indexLabelFormatter(y):k.indexLabel?m.replaceKeywordsWithValue(k.indexLabel,h,k,g):h.label?h.label:"";m._eventManager.objectMap[r]=d;d.center={x:u.x,y:u.y};d.y=h.y;d.radius=B;d.percentInnerRadius=H;d.indexLabelText=p;d.indexLabelPlacement=k.indexLabelPlacement;d.indexLabelLineColor=h.indexLabelLineColor?h.indexLabelLineColor:k.options.indexLabelLineColor?
|
|
496
496
|
k.options.indexLabelLineColor:h.color?h.color:k._colorSet[g%k._colorSet.length];d.indexLabelLineThickness=n(h.indexLabelLineThickness)?k.indexLabelLineThickness:h.indexLabelLineThickness;d.indexLabelLineDashType=h.indexLabelLineDashType?h.indexLabelLineDashType:k.indexLabelLineDashType;d.indexLabelFontColor=h.indexLabelFontColor?h.indexLabelFontColor:k.indexLabelFontColor;d.indexLabelFontStyle=h.indexLabelFontStyle?h.indexLabelFontStyle:k.indexLabelFontStyle;d.indexLabelFontWeight=h.indexLabelFontWeight?
|
|
497
497
|
h.indexLabelFontWeight:k.indexLabelFontWeight;d.indexLabelFontSize=n(h.indexLabelFontSize)?k.indexLabelFontSize:h.indexLabelFontSize;d.indexLabelFontFamily=h.indexLabelFontFamily?h.indexLabelFontFamily:k.indexLabelFontFamily;d.indexLabelBackgroundColor=h.indexLabelBackgroundColor?h.indexLabelBackgroundColor:k.options.indexLabelBackgroundColor?k.options.indexLabelBackgroundColor:k.indexLabelBackgroundColor;d.indexLabelMaxWidth=h.indexLabelMaxWidth?h.indexLabelMaxWidth:k.indexLabelMaxWidth;d.indexLabelWrap=
|
|
498
498
|
"undefined"!==typeof h.indexLabelWrap?h.indexLabelWrap:k.indexLabelWrap;d.indexLabelTextAlign=h.indexLabelTextAlign?h.indexLabelTextAlign:k.indexLabelTextAlign?k.indexLabelTextAlign:"left";d.startAngle=0===g?k.startAngle?k.startAngle/180*Math.PI:0:f[g-1].endAngle;d.startAngle=(d.startAngle+2*Math.PI)%(2*Math.PI);d.endAngle=d.startAngle+2*Math.PI/t*Math.abs(h.y);h=(d.endAngle+d.startAngle)/2;h=(h+2*Math.PI)%(2*Math.PI);d.midAngle=h;if(d.midAngle>Math.PI/2-s&&d.midAngle<Math.PI/2+s){if(0===a||f[c].midAngle>
|
|
499
499
|
d.midAngle)c=g;a++}else if(d.midAngle>3*Math.PI/2-s&&d.midAngle<3*Math.PI/2+s){if(0===b||f[e].midAngle>d.midAngle)e=g;b++}d.hemisphere=h>Math.PI/2&&h<=3*Math.PI/2?"left":"right";d.indexLabelTextBlock=new ja(m.plotArea.ctx,{fontSize:d.indexLabelFontSize,fontFamily:d.indexLabelFontFamily,fontColor:d.indexLabelFontColor,fontStyle:d.indexLabelFontStyle,fontWeight:d.indexLabelFontWeight,textAlign:d.indexLabelTextAlign,backgroundColor:d.indexLabelBackgroundColor,maxWidth:d.indexLabelMaxWidth,maxHeight:d.indexLabelWrap?
|
|
500
|
-
5*d.indexLabelFontSize:1.5*d.indexLabelFontSize,text:d.indexLabelText,padding:0,textBaseline:"middle"});d.indexLabelTextBlock.measureText()}
|
|
501
|
-
b){var c=m.plotArea.ctx;c.clearRect(
|
|
502
|
-
u.x+h*(1-a),f[c].center.y=u.y+d*(1-a),
|
|
500
|
+
5*d.indexLabelFontSize:1.5*d.indexLabelFontSize,text:d.indexLabelText,padding:0,textBaseline:"middle"});d.indexLabelTextBlock.measureText()}r=h=0;p=!1;for(g=0;g<l.length;g++)d=f[(c+g)%l.length],1<a&&(d.midAngle>Math.PI/2-s&&d.midAngle<Math.PI/2+s)&&(h<=a/2&&!p?(d.hemisphere="right",h++):(d.hemisphere="left",p=!0));p=!1;for(g=0;g<l.length;g++)d=f[(e+g)%l.length],1<b&&(d.midAngle>3*Math.PI/2-s&&d.midAngle<3*Math.PI/2+s)&&(r<=b/2&&!p?(d.hemisphere="left",r++):(d.hemisphere="right",p=!0))}}function c(a,
|
|
501
|
+
b){var c=m.plotArea.ctx;c.clearRect(q.x1,q.y1,q.width,q.height);c.fillStyle=m.backgroundColor;c.fillRect(q.x1,q.y1,q.width,q.height);for(c=0;c<l.length;c++){var g=f[c].startAngle,e=f[c].endAngle;if(e>g){var h=0.07*B*Math.cos(f[c].midAngle),d=0.07*B*Math.sin(f[c].midAngle),r=!1;if(l[c].exploded){if(1E-9<Math.abs(f[c].center.x-(u.x+h))||1E-9<Math.abs(f[c].center.y-(u.y+d)))f[c].center.x=u.x+h*a,f[c].center.y=u.y+d*a,r=!0}else if(0<Math.abs(f[c].center.x-u.x)||0<Math.abs(f[c].center.y-u.y))f[c].center.x=
|
|
502
|
+
u.x+h*(1-a),f[c].center.y=u.y+d*(1-a),r=!0;r&&b&&(h={},h.dataSeries=k,h.dataPoint=k.dataPoints[c],h.index=c,m.toolTip.highlightObjects([h]));ia(m.plotArea.ctx,f[c].center,f[c].radius,l[c].color?l[c].color:k._colorSet[c%k._colorSet.length],k.type,g,e,k.fillOpacity,f[c].percentInnerRadius)}}c=m.plotArea.ctx;c.save();c.fillStyle="black";c.strokeStyle="grey";c.textBaseline="middle";c.lineJoin="round";for(g=g=0;g<l.length;g++)e=f[g],e.indexLabelText&&(e.indexLabelTextBlock.y-=e.indexLabelTextBlock.height/
|
|
503
503
|
2-e.indexLabelTextBlock.fontSize/2,h=0,h="left"===e.hemisphere?"inside"!==k.indexLabelPlacement?-(e.indexLabelTextBlock.width+p):-e.indexLabelTextBlock.width/2:"inside"!==k.indexLabelPlacement?p:-e.indexLabelTextBlock.width/2,e.indexLabelTextBlock.x+=h,e.indexLabelTextBlock.render(!0),e.indexLabelTextBlock.x-=h,e.indexLabelTextBlock.y+=e.indexLabelTextBlock.height/2-e.indexLabelTextBlock.fontSize/2,"inside"!==e.indexLabelPlacement&&0<e.indexLabelLineThickness&&(h=e.center.x+B*Math.cos(e.midAngle),
|
|
504
504
|
d=e.center.y+B*Math.sin(e.midAngle),c.strokeStyle=e.indexLabelLineColor,c.lineWidth=e.indexLabelLineThickness,c.setLineDash&&c.setLineDash(G(e.indexLabelLineDashType,e.indexLabelLineThickness)),c.beginPath(),c.moveTo(h,d),c.lineTo(e.indexLabelTextBlock.x,e.indexLabelTextBlock.y),c.lineTo(e.indexLabelTextBlock.x+("left"===e.hemisphere?-p:p),e.indexLabelTextBlock.y),c.stroke()),c.lineJoin="miter");c.save()}function b(a,b){var c=0,c=a.indexLabelTextBlock.y-a.indexLabelTextBlock.height/2,e=a.indexLabelTextBlock.y+
|
|
505
505
|
a.indexLabelTextBlock.height/2,f=b.indexLabelTextBlock.y-b.indexLabelTextBlock.height/2,g=b.indexLabelTextBlock.y+b.indexLabelTextBlock.height/2;return c=b.indexLabelTextBlock.y>a.indexLabelTextBlock.y?f-e:c-g}function e(a){for(var c=null,e=1;e<l.length;e++)if(c=(a+e+f.length)%f.length,f[c].hemisphere!==f[a].hemisphere){c=null;break}else if(f[c].indexLabelText&&c!==a&&(0>b(f[c],f[a])||("right"===f[a].hemisphere?f[c].indexLabelTextBlock.y>=f[a].indexLabelTextBlock.y:f[c].indexLabelTextBlock.y<=f[a].indexLabelTextBlock.y)))break;
|
|
506
|
-
else c=null;return c}function h(a,c,g){g=(g||0)+1;if(1E3<g)return 0;c=c||0;var d=0,
|
|
507
|
-
p.indexLabelTextBlock.height/2+c>k&&(c=p.indexLabelTextBlock.y+p.indexLabelTextBlock.height/2+c-k);c=p.indexLabelTextBlock.y+c;
|
|
508
|
-
f[a].hemisphere){
|
|
509
|
-
+
|
|
510
|
-
1+f.length)%f.length,
|
|
511
|
-
("right"===a.hemisphere&&c>a.indexLabelTextBlock.x)&&(c=a.indexLabelTextBlock.x-15)),p.indexLabelTextBlock.y=g,p.indexLabelTextBlock.x=c,p.indexLabelAngle=Math.atan2(p.indexLabelTextBlock.y-u.y,p.indexLabelTextBlock.x-u.x))}return d}function
|
|
512
|
-
g);g=0;if("inside"!==k.indexLabelPlacement){v=B*x;for(a=0;a<l.length;a++){var
|
|
513
|
-
var C=-1*(t-s),K=G=0;"right"===
|
|
514
|
-
y.height&&0!==y.width)y=y=0,"right"===
|
|
515
|
-
|
|
516
|
-
u.x)<B&&(y/=Math.abs(Math.sin(
|
|
517
|
-
t=b(n,k);var
|
|
506
|
+
else c=null;return c}function h(a,c,g){g=(g||0)+1;if(1E3<g)return 0;c=c||0;var d=0,r=u.y-1*v,k=u.y+1*v;if(0<=a&&a<l.length){var p=f[a];if(0>c&&p.indexLabelTextBlock.y<r||0<c&&p.indexLabelTextBlock.y>k)return 0;var q=0,n=0,n=q=q=0;0>c?p.indexLabelTextBlock.y-p.indexLabelTextBlock.height/2>r&&p.indexLabelTextBlock.y-p.indexLabelTextBlock.height/2+c<r&&(c=-(r-(p.indexLabelTextBlock.y-p.indexLabelTextBlock.height/2+c))):p.indexLabelTextBlock.y+p.indexLabelTextBlock.height/2<r&&p.indexLabelTextBlock.y+
|
|
507
|
+
p.indexLabelTextBlock.height/2+c>k&&(c=p.indexLabelTextBlock.y+p.indexLabelTextBlock.height/2+c-k);c=p.indexLabelTextBlock.y+c;r=0;r="right"===p.hemisphere?u.x+Math.sqrt(Math.pow(v,2)-Math.pow(c-u.y,2)):u.x-Math.sqrt(Math.pow(v,2)-Math.pow(c-u.y,2));n=u.x+B*Math.cos(p.midAngle);q=u.y+B*Math.sin(p.midAngle);q=Math.sqrt(Math.pow(r-n,2)+Math.pow(c-q,2));n=Math.acos(B/v);q=Math.acos((v*v+B*B-q*q)/(2*B*v));c=q<n?c-p.indexLabelTextBlock.y:0;r=null;for(k=1;k<l.length;k++)if(r=(a-k+f.length)%f.length,f[r].hemisphere!==
|
|
508
|
+
f[a].hemisphere){r=null;break}else if(f[r].indexLabelText&&f[r].hemisphere===f[a].hemisphere&&r!==a&&(0>b(f[r],f[a])||("right"===f[a].hemisphere?f[r].indexLabelTextBlock.y<=f[a].indexLabelTextBlock.y:f[r].indexLabelTextBlock.y>=f[a].indexLabelTextBlock.y)))break;else r=null;n=r;q=e(a);k=r=0;0>c?(k="right"===p.hemisphere?n:q,d=c,null!==k&&(n=-c,c=p.indexLabelTextBlock.y-p.indexLabelTextBlock.height/2-(f[k].indexLabelTextBlock.y+f[k].indexLabelTextBlock.height/2),c-n<w&&(r=-n,k=h(k,r,g+1),+k.toFixed(z)>
|
|
509
|
+
+r.toFixed(z)&&(d=c>w?-(c-w):-(n-(k-r)))))):0<c&&(k="right"===p.hemisphere?q:n,d=c,null!==k&&(n=c,c=f[k].indexLabelTextBlock.y-f[k].indexLabelTextBlock.height/2-(p.indexLabelTextBlock.y+p.indexLabelTextBlock.height/2),c-n<w&&(r=n,k=h(k,r,g+1),+k.toFixed(z)<+r.toFixed(z)&&(d=c>w?c-w:n-(r-k)))));d&&(g=p.indexLabelTextBlock.y+d,c=0,c="right"===p.hemisphere?u.x+Math.sqrt(Math.pow(v,2)-Math.pow(g-u.y,2)):u.x-Math.sqrt(Math.pow(v,2)-Math.pow(g-u.y,2)),p.midAngle>Math.PI/2-s&&p.midAngle<Math.PI/2+s?(r=(a-
|
|
510
|
+
1+f.length)%f.length,r=f[r],a=f[(a+1+f.length)%f.length],"left"===p.hemisphere&&"right"===r.hemisphere&&c>r.indexLabelTextBlock.x?c=r.indexLabelTextBlock.x-15:"right"===p.hemisphere&&("left"===a.hemisphere&&c<a.indexLabelTextBlock.x)&&(c=a.indexLabelTextBlock.x+15)):p.midAngle>3*Math.PI/2-s&&p.midAngle<3*Math.PI/2+s&&(r=(a-1+f.length)%f.length,r=f[r],a=f[(a+1+f.length)%f.length],"right"===p.hemisphere&&"left"===r.hemisphere&&c<r.indexLabelTextBlock.x?c=r.indexLabelTextBlock.x+15:"left"===p.hemisphere&&
|
|
511
|
+
("right"===a.hemisphere&&c>a.indexLabelTextBlock.x)&&(c=a.indexLabelTextBlock.x-15)),p.indexLabelTextBlock.y=g,p.indexLabelTextBlock.x=c,p.indexLabelAngle=Math.atan2(p.indexLabelTextBlock.y-u.y,p.indexLabelTextBlock.x-u.x))}return d}function r(){var a=m.plotArea.ctx;a.fillStyle="grey";a.strokeStyle="grey";a.font="16px Arial";a.textBaseline="middle";for(var c=a=0,g=0,d=!0,c=0;10>c&&(1>c||0<g);c++){if(k.radius||!k.radius&&"undefined"!==typeof k.innerRadius&&null!==k.innerRadius&&B-g<=A)d=!1;d&&(B-=
|
|
512
|
+
g);g=0;if("inside"!==k.indexLabelPlacement){v=B*x;for(a=0;a<l.length;a++){var r=f[a];r.indexLabelTextBlock.x=u.x+v*Math.cos(r.midAngle);r.indexLabelTextBlock.y=u.y+v*Math.sin(r.midAngle);r.indexLabelAngle=r.midAngle;r.radius=B;r.percentInnerRadius=H}for(var n,s,a=0;a<l.length;a++){var r=f[a],y=e(a);if(null!==y){n=f[a];s=f[y];var t=0,t=b(n,s)-w;if(0>t){for(var C=s=0,G=0;G<l.length;G++)G!==a&&f[G].hemisphere===r.hemisphere&&(f[G].indexLabelTextBlock.y<r.indexLabelTextBlock.y?s++:C++);s=t/(s+C||1)*C;
|
|
513
|
+
var C=-1*(t-s),K=G=0;"right"===r.hemisphere?(G=h(a,s),C=-1*(t-G),K=h(y,C),+K.toFixed(z)<+C.toFixed(z)&&+G.toFixed(z)<=+s.toFixed(z)&&h(a,-(C-K))):(G=h(y,s),C=-1*(t-G),K=h(a,C),+K.toFixed(z)<+C.toFixed(z)&&+G.toFixed(z)<=+s.toFixed(z)&&h(y,-(C-K)))}}}}else for(a=0;a<l.length;a++)r=f[a],v="pie"===k.type?0.7*B:0.85*B,y=u.x+v*Math.cos(r.midAngle),s=u.y+v*Math.sin(r.midAngle),r.indexLabelTextBlock.x=y,r.indexLabelTextBlock.y=s;for(a=0;a<l.length;a++)if(r=f[a],y=r.indexLabelTextBlock.measureText(),0!==
|
|
514
|
+
y.height&&0!==y.width)y=y=0,"right"===r.hemisphere?(y=q.x2-(r.indexLabelTextBlock.x+r.indexLabelTextBlock.width+p),y*=-1):y=q.x1-(r.indexLabelTextBlock.x-r.indexLabelTextBlock.width-p),0<y&&(!d&&r.indexLabelText&&(s="right"===r.hemisphere?q.x2-r.indexLabelTextBlock.x:r.indexLabelTextBlock.x-q.x1,0.3*r.indexLabelTextBlock.maxWidth>s?r.indexLabelText="":r.indexLabelTextBlock.maxWidth=0.85*s,0.3*r.indexLabelTextBlock.maxWidth<s&&(r.indexLabelTextBlock.x-="right"===r.hemisphere?2:-2)),Math.abs(r.indexLabelTextBlock.y-
|
|
515
|
+
r.indexLabelTextBlock.height/2-u.y)<B||Math.abs(r.indexLabelTextBlock.y+r.indexLabelTextBlock.height/2-u.y)<B)&&(y/=Math.abs(Math.cos(r.indexLabelAngle)),9<y&&(y*=0.3),y>g&&(g=y)),y=y=0,0<r.indexLabelAngle&&r.indexLabelAngle<Math.PI?(y=q.y2-(r.indexLabelTextBlock.y+r.indexLabelTextBlock.height/2+5),y*=-1):y=q.y1-(r.indexLabelTextBlock.y-r.indexLabelTextBlock.height/2-5),0<y&&(!d&&r.indexLabelText&&(s=0<r.indexLabelAngle&&r.indexLabelAngle<Math.PI?-1:1,0===h(a,y*s)&&h(a,2*s)),Math.abs(r.indexLabelTextBlock.x-
|
|
516
|
+
u.x)<B&&(y/=Math.abs(Math.sin(r.indexLabelAngle)),9<y&&(y*=0.3),y>g&&(g=y)));var M=function(a,b,c){for(var e=[],g=0;e.push(f[b]),b!==c;b=(b+1+l.length)%l.length);e.sort(function(a,b){return a.y-b.y});for(b=0;b<e.length;b++)if(c=e[b],g<0.7*a)g+=c.indexLabelTextBlock.height,c.indexLabelTextBlock.text="",c.indexLabelText="",c.indexLabelTextBlock.measureText();else break};(function(){for(var a=-1,c=-1,g=0,h=!1,r=0;r<l.length;r++)if(h=!1,n=f[r],n.indexLabelText){var d=e(r);if(null!==d){var k=f[d];t=0;
|
|
517
|
+
t=b(n,k);var q;if(q=0>t){q=n.indexLabelTextBlock.x;var m=n.indexLabelTextBlock.y-n.indexLabelTextBlock.height/2,s=n.indexLabelTextBlock.y+n.indexLabelTextBlock.height/2,y=k.indexLabelTextBlock.y-k.indexLabelTextBlock.height/2,u=k.indexLabelTextBlock.x+k.indexLabelTextBlock.width,v=k.indexLabelTextBlock.y+k.indexLabelTextBlock.height/2;q=n.indexLabelTextBlock.x+n.indexLabelTextBlock.width<k.indexLabelTextBlock.x-p||q>u+p||m>v+p||s<y-p?!1:!0}q?(0>a&&(a=r),d!==a&&(c=d,g+=-t),0===r%Math.max(l.length/
|
|
518
518
|
10,3)&&(h=!0)):h=!0;h&&(0<g&&0<=a&&0<=c)&&(M(g,a,c),c=a=-1,g=0)}}0<g&&M(g,a,c)})()}}function d(){m.plotArea.layoutManager.reset();m.title&&(m.title.dockInsidePlotArea||"center"===m.title.horizontalAlign&&"center"===m.title.verticalAlign)&&m.title.render();if(m.subtitles)for(var a=0;a<m.subtitles.length;a++){var b=m.subtitles[a];(b.dockInsidePlotArea||"center"===b.horizontalAlign&&"center"===b.verticalAlign)&&b.render()}m.legend&&(m.legend.dockInsidePlotArea||"center"===m.legend.horizontalAlign&&"center"===
|
|
519
|
-
m.legend.verticalAlign)&&(m.legend.setLayout(),m.legend.render())}var m=this;if(!(0>=a.dataSeriesIndexes.length)){var k=this.data[a.dataSeriesIndexes[0]],l=k.dataPoints,p=10,
|
|
520
|
-
0<l[C].label.toString().length)&&(a=!0);if(0!==t){a=a||"undefined"!==typeof k.indexLabel&&null!==k.indexLabel&&0<k.indexLabel.toString().length;var B="inside"!==k.indexLabelPlacement&&a?0.75*Math.min(
|
|
521
|
-
!n(this.explodeOnClick)&&!this.explodeOnClick||(a=a.dataPoint,a.exploded=a.exploded?!1:!0,1<this.dataPoints.length&&m._animator.animate(0,500,function(a){c(a,!0);d();m.dispatchEvent("dataAnimationIterationEnd",{chart:m});m.dispatchEvent("dataAnimationEnd",{chart:m})}))};g();
|
|
522
|
-
|
|
519
|
+
m.legend.verticalAlign)&&(m.legend.setLayout(),m.legend.render())}var m=this;if(!(0>=a.dataSeriesIndexes.length)){var k=this.data[a.dataSeriesIndexes[0]],l=k.dataPoints,p=10,q=this.plotArea,f=k.dataPointEOs,w=2,v,x=1.3,s=20/180*Math.PI,z=6,u={x:(q.x2+q.x1)/2,y:(q.y2+q.y1)/2},t=0;a=!1;for(var C=0;C<l.length;C++)t+=Math.abs(l[C].y),!a&&("undefined"!==typeof l[C].indexLabel&&null!==l[C].indexLabel&&0<l[C].indexLabel.toString().length)&&(a=!0),!a&&("undefined"!==typeof l[C].label&&null!==l[C].label&&
|
|
520
|
+
0<l[C].label.toString().length)&&(a=!0);if(0!==t){a=a||"undefined"!==typeof k.indexLabel&&null!==k.indexLabel&&0<k.indexLabel.toString().length;var B="inside"!==k.indexLabelPlacement&&a?0.75*Math.min(q.width,q.height)/2:0.92*Math.min(q.width,q.height)/2;k.radius&&(B=Ua(k.radius,B));var A="undefined"!==typeof k.innerRadius&&null!==k.innerRadius?Ua(k.innerRadius,B):0.7*B;k.radius=B;"doughnut"===k.type&&(k.innerRadius=A);var H=Math.min(A/B,(B-1)/B);this.pieDoughnutClickHandler=function(a){m.isAnimating||
|
|
521
|
+
!n(this.explodeOnClick)&&!this.explodeOnClick||(a=a.dataPoint,a.exploded=a.exploded?!1:!0,1<this.dataPoints.length&&m._animator.animate(0,500,function(a){c(a,!0);d();m.dispatchEvent("dataAnimationIterationEnd",{chart:m});m.dispatchEvent("dataAnimationEnd",{chart:m})}))};g();r();r();r();r();this.disableToolTip=!0;this._animator.animate(0,this.animatedRender?this.animationDuration:0,function(a){var b=m.plotArea.ctx;b.clearRect(q.x1,q.y1,q.width,q.height);b.fillStyle=m.backgroundColor;b.fillRect(q.x1,
|
|
522
|
+
q.y1,q.width,q.height);for(var b=f[0].startAngle+2*Math.PI*a,c=0;c<l.length;c++){var g=0===c?f[c].startAngle:e,e=g+(f[c].endAngle-f[c].startAngle),h=!1;e>b&&(e=b,h=!0);var r=l[c].color?l[c].color:k._colorSet[c%k._colorSet.length];e>g&&ia(m.plotArea.ctx,f[c].center,f[c].radius,r,k.type,g,e,k.fillOpacity,f[c].percentInnerRadius);if(h)break}d();m.dispatchEvent("dataAnimationIterationEnd",{chart:m});1<=a&&m.dispatchEvent("dataAnimationEnd",{chart:m})},function(){m.disableToolTip=!1;m._animator.animate(0,
|
|
523
523
|
m.animatedRender?500:0,function(a){c(a,!1);d();m.dispatchEvent("dataAnimationIterationEnd",{chart:m})});m.dispatchEvent("dataAnimationEnd",{chart:m})})}}};var qa=function(a,g,c,b){"undefined"===typeof c&&(c=1);0>=Math.round(g.y4-g.y1)||(a.save(),a.globalAlpha=c,a.beginPath(),a.moveTo(Math.round(g.x1),Math.round(g.y1)),a.lineTo(Math.round(g.x2),Math.round(g.y2)),a.lineTo(Math.round(g.x3),Math.round(g.y3)),a.lineTo(Math.round(g.x4),Math.round(g.y4)),"undefined"!==g.x5&&(a.lineTo(Math.round(g.x5),Math.round(g.y5)),
|
|
524
|
-
a.lineTo(Math.round(g.x6),Math.round(g.y6))),a.closePath(),a.fillStyle=b?b:g.color,a.fill(),a.globalAplha=1,a.restore())};m.prototype.renderFunnel=function(a){function g(){for(var a=0,b=[],c=0;c<z.length;c++){if("undefined"===typeof z[c].y)return-1;z[c].y="number"===typeof z[c].y?z[c].y:0;a+=Math.abs(z[c].y)}if(0===a)return-1;for(c=b[0]=0;c<z.length;c++)b.push(Math.abs(z[c].y)*H/a);return b}function c(){var a=S,b=V,c=M,
|
|
525
|
-
f=
|
|
526
|
-
b=p)),
|
|
527
|
-
s.indexLabelTextAlign||"left";
|
|
528
|
-
b.indexLabelLineThickness:"number"===typeof s.indexLabelLineThickness?s.indexLabelLineThickness:2;p=b.indexLabelLineDashType||s.indexLabelLineDashType||"solid";
|
|
529
|
-
R[A].x3-R[A].x4:R[A].x3-R[A].x6,20>v[A]&&(v[A]=A!==da?s.reversed?R[A].x3-R[A].x4:R[A].x2-R[A].x1:R[A].x2-R[A].x1,v[A]/=2));m=b.indexLabelMaxWidth?b.indexLabelMaxWidth:s.options.indexLabelMaxWidth?s.indexLabelMaxWidth:v[A];if(m>v[A]||0>m)m=v[A];t[A]="inside"===s.indexLabelPlacement?
|
|
530
|
-
b.indexLabel?x.replaceKeywordsWithValue(b.indexLabel,b,s,A):s.indexLabelFormatter?s.indexLabelFormatter(B):s.indexLabel?x.replaceKeywordsWithValue(s.indexLabel,b,s,A):b.label?b.label:"";0>=l&&(l=0);1E3>m&&1E3-m<u&&(m+=1E3-m);n(s.options.indexLabelMaxWidth)&&(s.indexLabelMaxWidth=n(s.indexLabelMaxWidth)?m:Math.max(m,s.indexLabelMaxWidth));P.roundRect||za(P);c=new ja(P,{fontSize:h,fontFamily:d,fontColor:
|
|
531
|
-
t[A]?
|
|
532
|
-
d=F.length-1;0<=d;d--){h=z[F[d].id];c=F[d];
|
|
533
|
-
Q-
|
|
524
|
+
a.lineTo(Math.round(g.x6),Math.round(g.y6))),a.closePath(),a.fillStyle=b?b:g.color,a.fill(),a.globalAplha=1,a.restore())};m.prototype.renderFunnel=function(a){function g(){for(var a=0,b=[],c=0;c<z.length;c++){if("undefined"===typeof z[c].y)return-1;z[c].y="number"===typeof z[c].y?z[c].y:0;a+=Math.abs(z[c].y)}if(0===a)return-1;for(c=b[0]=0;c<z.length;c++)b.push(Math.abs(z[c].y)*H/a);return b}function c(){var a=S,b=V,c=M,e=Y,g,f;g=Z;f=O-N;e=Math.abs((f-g)*(b-a+(e-c))/2);c=Y-M;g=f-g;f=c*(f-O);f=Math.abs(f);
|
|
525
|
+
f=e+f;for(var e=[],h=0,r=0;r<z.length;r++){if("undefined"===typeof z[r].y)return-1;z[r].y="number"===typeof z[r].y?z[r].y:0;h+=Math.abs(z[r].y)}if(0===h)return-1;for(var d=e[0]=0,k=0,l,p,b=b-a,d=!1,r=0;r<z.length;r++)a=Math.abs(z[r].y)*f/h,d?l=0==Number(c.toFixed(3))?0:a/c:(p=ca*ca*b*b-4*Math.abs(ca)*a,0>p?(p=c,d=(b+p)*(g-k)/2,a-=d,l=g-k,k+=g-k,l+=0==p?0:a/p,k+=a/p,d=!0):(l=(Math.abs(ca)*b-Math.sqrt(p))/2,p=b-2*l/Math.abs(ca),k+=l,k>g&&(k-=l,p=c,d=(b+p)*(g-k)/2,a-=d,l=g-k,k+=g-k,l+=a/p,k+=a/p,d=!0),
|
|
526
|
+
b=p)),e.push(l);return e}function b(){if(s&&z){for(var a,b,c,g,e,h,r,d,k,l,p,q,m,y,u,v=[],t=[],I={percent:null,total:null},B=null,A=0;A<z.length;A++)u=R[A],u="undefined"!==typeof u.x5?(u.y2+u.y4)/2:(u.y2+u.y3)/2,u=f(u).x2+1,v[A]=Q-u-X;u=0.5*X;for(var A=0,C=z.length-1;A<z.length||0<=C;A++,C--){b=s.reversed?z[C]:z[A];a=b.color?b.color:s.reversed?s._colorSet[(z.length-1-A)%s._colorSet.length]:s._colorSet[A%s._colorSet.length];c=b.indexLabelPlacement||s.indexLabelPlacement||"outside";y=b.indexLabelTextAlign||
|
|
527
|
+
s.indexLabelTextAlign||"left";g=b.indexLabelBackgroundColor||s.indexLabelBackgroundColor||(w?"transparent":null);e=b.indexLabelFontColor||s.indexLabelFontColor||"#979797";h=n(b.indexLabelFontSize)?s.indexLabelFontSize:b.indexLabelFontSize;r=b.indexLabelFontStyle||s.indexLabelFontStyle||"normal";d=b.indexLabelFontFamily||s.indexLabelFontFamily||"arial";k=b.indexLabelFontWeight||s.indexLabelFontWeight||"normal";a=b.indexLabelLineColor||s.options.indexLabelLineColor||a;l="number"===typeof b.indexLabelLineThickness?
|
|
528
|
+
b.indexLabelLineThickness:"number"===typeof s.indexLabelLineThickness?s.indexLabelLineThickness:2;p=b.indexLabelLineDashType||s.indexLabelLineDashType||"solid";q="undefined"!==typeof b.indexLabelWrap?b.indexLabelWrap:"undefined"!==typeof s.indexLabelWrap?s.indexLabelWrap:!0;m=s.dataPointIds[A];x._eventManager.objectMap[m]={id:m,objectType:"dataPoint",dataPointIndex:A,dataSeriesIndex:0,funnelSection:R[s.reversed?z.length-1-A:A]};"inside"===s.indexLabelPlacement&&(v[A]=A!==da?s.reversed?R[A].x2-R[A].x1:
|
|
529
|
+
R[A].x3-R[A].x4:R[A].x3-R[A].x6,20>v[A]&&(v[A]=A!==da?s.reversed?R[A].x3-R[A].x4:R[A].x2-R[A].x1:R[A].x2-R[A].x1,v[A]/=2));m=b.indexLabelMaxWidth?b.indexLabelMaxWidth:s.options.indexLabelMaxWidth?s.indexLabelMaxWidth:v[A];if(m>v[A]||0>m)m=v[A];t[A]="inside"===s.indexLabelPlacement?q?Math.max(R[A].height,h):1.5*h:!1;I=x.getPercentAndTotal(s,b);if(s.indexLabelFormatter||b.indexLabelFormatter)B={chart:x.options,dataSeries:s,dataPoint:b,total:I.total,percent:I.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(B):
|
|
530
|
+
b.indexLabel?x.replaceKeywordsWithValue(b.indexLabel,b,s,A):s.indexLabelFormatter?s.indexLabelFormatter(B):s.indexLabel?x.replaceKeywordsWithValue(s.indexLabel,b,s,A):b.label?b.label:"";0>=l&&(l=0);1E3>m&&1E3-m<u&&(m+=1E3-m);n(s.options.indexLabelMaxWidth)&&(s.indexLabelMaxWidth=n(s.indexLabelMaxWidth)?m:Math.max(m,s.indexLabelMaxWidth));P.roundRect||za(P);c=new ja(P,{fontSize:h,fontFamily:d,fontColor:e,fontStyle:r,fontWeight:k,horizontalAlign:c,textAlign:y,backgroundColor:g,maxWidth:m,maxHeight:!1===
|
|
531
|
+
t[A]?q?4.28571429*h:1.5*h:t[A],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;F.push({textBlock:c,id:s.reversed?C:A,isDirty:!1,lineColor:a,lineThickness:l,lineDashType:p,height:c.height<c.maxHeight?c.height:c.maxHeight,width:c.width<c.maxWidth?c.width:c.maxWidth})}}}function e(){var a,b,c,g,e,f=[];e=!1;c=0;for(var h,r=Q-V-X/2,r=s.options.indexLabelMaxWidth?s.indexLabelMaxWidth>r?r:s.indexLabelMaxWidth:r,
|
|
532
|
+
d=F.length-1;0<=d;d--){h=z[F[d].id];c=F[d];g=c.textBlock;b=(a=q(d)<R.length?F[q(d)]:null)?a.textBlock:null;c=c.height;a&&g.y+c+ea>b.y&&(e=!0);c=h.indexLabelMaxWidth||r;if(c>r||0>c)c=r;f.push(c)}if(e)for(d=F.length-1;0<=d;d--)a=R[d],F[d].textBlock.maxWidth=f[f.length-(d+1)],F[d].textBlock.measureText(),F[d].textBlock.height=F[d].textBlock.height===2*F[d].textBlock.padding?0:F[d].textBlock.height,F[d].textBlock.width=F[d].textBlock.width===2*F[d].textBlock.padding?0:F[d].textBlock.width,F[d].textBlock.x=
|
|
533
|
+
Q-r,c=F[d].textBlock.height<F[d].textBlock.maxHeight?F[d].textBlock.height:F[d].textBlock.maxHeight,e=F[d].textBlock.width<F[d].textBlock.maxWidth?F[d].textBlock.width:F[d].textBlock.maxWidth,F[d].height=c,F[d].width=e,c="undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,F[d].textBlock.y=c-F[d].height/2,s.reversed?(F[d].textBlock.y+F[d].height>T+B&&(F[d].textBlock.y=T+B-F[d].height),F[d].textBlock.y<ta-B&&(F[d].textBlock.y=ta-B)):(F[d].textBlock.y<T-B&&(F[d].textBlock.y=T-B),F[d].textBlock.y+F[d].height>
|
|
534
534
|
ta+B&&(F[d].textBlock.y=ta+B-F[d].height))}function h(){var a,b,c,g;if("inside"!==s.indexLabelPlacement)for(var e=0;e<R.length;e++)0==F[e].textBlock.text.length?F[e].isDirty=!0:(a=R[e],c="undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,b=s.reversed?"undefined"!==typeof a.x5?c>W?f(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?c<W?f(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,F[e].textBlock.x=b+X,F[e].textBlock.y=c-F[e].height/2,s.reversed?(F[e].textBlock.y+F[e].height>T+B&&(F[e].textBlock.y=
|
|
535
|
-
T+B-F[e].height),F[e].textBlock.y<ta-B&&(F[e].textBlock.y=ta-B)):(F[e].textBlock.y<T-B&&(F[e].textBlock.y=T-B),F[e].textBlock.y+F[e].height>ta+B&&(F[e].textBlock.y=ta+B-F[e].height)));else for(e=0;e<R.length;e++)0==F[e].textBlock.text.length?F[e].isDirty=!0:(a=R[e],b=a.height,c=F[e].height,g=F[e].width,b>=c?(b=e!=da?(a.x4+a.x3)/2-g/2:(a.x5+a.x4)/2-g/2,c=e!=da?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,F[e].textBlock.x=b,F[e].textBlock.y=c):F[e].isDirty=!0)}function
|
|
536
|
-
var g,f=F[b].textBlock;if(0>c){c*=-1;g=p(b);e=d(g,b);if(e>=c)return f.y-=c,c;if(0==b)return 0<e&&(f.y-=e),e;e+=a(g,-(c-e));0<e&&(f.y-=e);return e}g=
|
|
537
|
-
(F[n].textBlock.y=F[n].textBlock.y+F[n].height-g>g-F[n].textBlock.y?g+1:g-F[n].height-1))}for(d=R.length-1;0<d;d--)if(!F[d].isDirty){g=p(d);if(0>g&&(g=0,F[g].isDirty))break;if(F[d].textBlock.y<F[g].textBlock.y+F[g].height){e=e||d;f=d;for(
|
|
538
|
-
b,e){var g=[],f=0,h=0;for(a=Math.abs(a);e<=b;e++)g.push(R[e]);g.sort(function(a,b){return a.height-b.height});for(e=0;e<g.length;e++)if(b=g[e],f<a)h++,f+=F[b.id].height+ea,F[b.id].textBlock.text="",F[b.id].indexLabelText="",F[b.id].isDirty=!0,F[b.id].textBlock.measureText();else break;return h}for(var e,g,f,h,
|
|
539
|
-
(
|
|
540
|
-
0==$[0]){if(0===
|
|
535
|
+
T+B-F[e].height),F[e].textBlock.y<ta-B&&(F[e].textBlock.y=ta-B)):(F[e].textBlock.y<T-B&&(F[e].textBlock.y=T-B),F[e].textBlock.y+F[e].height>ta+B&&(F[e].textBlock.y=ta+B-F[e].height)));else for(e=0;e<R.length;e++)0==F[e].textBlock.text.length?F[e].isDirty=!0:(a=R[e],b=a.height,c=F[e].height,g=F[e].width,b>=c?(b=e!=da?(a.x4+a.x3)/2-g/2:(a.x5+a.x4)/2-g/2,c=e!=da?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,F[e].textBlock.x=b,F[e].textBlock.y=c):F[e].isDirty=!0)}function r(){function a(b,c){var e;if(0>b||b>=F.length)return 0;
|
|
536
|
+
var g,f=F[b].textBlock;if(0>c){c*=-1;g=p(b);e=d(g,b);if(e>=c)return f.y-=c,c;if(0==b)return 0<e&&(f.y-=e),e;e+=a(g,-(c-e));0<e&&(f.y-=e);return e}g=q(b);e=d(b,g);if(e>=c)return f.y+=c,c;if(b==R.length-1)return 0<e&&(f.y+=e),e;e+=a(g,c-e);0<e&&(f.y+=e);return e}function b(){var a,e,g,f,h=0,r;f=(O-Z+2*B)/l;r=l;for(var d,k=1;k<r;k++){g=k*f;for(var n=F.length-1;0<=n;n--)!F[n].isDirty&&(F[n].textBlock.y<g&&F[n].textBlock.y+F[n].height>g)&&(d=q(n),!(d>=F.length-1)&&F[n].textBlock.y+F[n].height+ea>F[d].textBlock.y&&
|
|
537
|
+
(F[n].textBlock.y=F[n].textBlock.y+F[n].height-g>g-F[n].textBlock.y?g+1:g-F[n].height-1))}for(d=R.length-1;0<d;d--)if(!F[d].isDirty){g=p(d);if(0>g&&(g=0,F[g].isDirty))break;if(F[d].textBlock.y<F[g].textBlock.y+F[g].height){e=e||d;f=d;for(r=0;F[f].textBlock.y<F[g].textBlock.y+F[g].height+ea;){a=a||F[f].textBlock.y+F[f].height;r+=F[f].height;r+=ea;f=g;if(0>=f){f=0;r+=F[f].height;break}g=p(f);if(0>g){f=0;r+=F[f].height;break}}if(f!=d){h=F[f].textBlock.y;a-=h;a=r-a;h=c(a,e,f);break}}}return h}function c(a,
|
|
538
|
+
b,e){var g=[],f=0,h=0;for(a=Math.abs(a);e<=b;e++)g.push(R[e]);g.sort(function(a,b){return a.height-b.height});for(e=0;e<g.length;e++)if(b=g[e],f<a)h++,f+=F[b.id].height+ea,F[b.id].textBlock.text="",F[b.id].indexLabelText="",F[b.id].isDirty=!0,F[b.id].textBlock.measureText();else break;return h}for(var e,g,f,h,r,k,l=1,n=0;n<2*l;n++){for(var m=F.length-1;0<=m&&!(0<=p(m)&&p(m),f=F[m],h=f.textBlock,k=(r=q(m)<R.length?F[q(m)]:null)?r.textBlock:null,e=+f.height.toFixed(6),g=+h.y.toFixed(6),!f.isDirty&&
|
|
539
|
+
(r&&g+e+ea>+k.y.toFixed(6))&&(e=h.y+e+ea-k.y,g=a(m,-e),g<e&&(0<g&&(e-=g),g=a(q(m),e),g!=e)));m--);b()}}function d(a,b){return(b<R.length?F[b].textBlock.y:s.reversed?T+B:ta+B)-(0>a?s.reversed?ta-B:T-B:F[a].textBlock.y+F[a].height+ea)}function m(a,b,c){var e,g,f,r=[],d=B,p=[];-1!==b&&(0<=$.indexOf(b)?(g=$.indexOf(b),$.splice(g,1)):($.push(b),$=$.sort(function(a,b){return a-b})));if(0===$.length)r=ia;else{g=B*(1!=$.length||0!=$[0]&&$[0]!=R.length-1?2:1)/k();for(var q=0;q<R.length;q++){if(1==$.length&&
|
|
540
|
+
0==$[0]){if(0===q){r.push(ia[q]);e=d;continue}}else 0===q&&(e=-1*d);r.push(ia[q]+e);if(0<=$.indexOf(q)||q<R.length&&0<=$.indexOf(q+1))e+=g}}f=function(){for(var a=[],b=0;b<R.length;b++)a.push(r[b]-R[b].y1);return a}();var n={startTime:(new Date).getTime(),duration:c||500,easingFunction:function(a,b,c,e){return K.easing.easeOutQuart(a,b,c,e)},changeSection:function(a){for(var b,c,e=0;e<R.length;e++)b=f[e],c=R[e],b*=a,"undefined"===typeof p[e]&&(p[e]=0),0>p&&(p*=-1),c.y1+=b-p[e],c.y2+=b-p[e],c.y3+=
|
|
541
541
|
b-p[e],c.y4+=b-p[e],c.y5&&(c.y5+=b-p[e],c.y6+=b-p[e]),p[e]=b}};a._animator.animate(0,c,function(c){var e=a.plotArea.ctx||a.ctx;ha=!0;e.clearRect(u.x1,u.y1,u.x2-u.x1,u.y2-u.y1);e.fillStyle=a.backgroundColor;e.fillRect(u.x1,u.y1,u.width,u.height);n.changeSection(c,b);var g={};g.dataSeries=s;g.dataPoint=s.reversed?s.dataPoints[z.length-1-b]:s.dataPoints[b];g.index=s.reversed?z.length-1-b:b;a.toolTip.highlightObjects([g]);for(g=0;g<R.length;g++)qa(e,R[g],s.fillOpacity);v(e);J&&("inside"!==s.indexLabelPlacement?
|
|
542
542
|
l(e):h(),t(e));1<=c&&(ha=!1)},null,K.easing.easeOutQuart)}function k(){for(var a=0,b=0;b<R.length-1;b++)(0<=$.indexOf(b)||0<=$.indexOf(b+1))&&a++;return a}function l(a){for(var b,c,e,g,h=0;h<R.length;h++)g=1===F[h].lineThickness%2?0.5:0,c=((R[h].y2+R[h].y4)/2<<0)+g,b=f(c).x2-1,e=F[h].textBlock.x,g=(F[h].textBlock.y+F[h].height/2<<0)+g,F[h].isDirty||0==F[h].lineThickness||(a.strokeStyle=F[h].lineColor,a.lineWidth=F[h].lineThickness,a.setLineDash&&a.setLineDash(G(F[h].lineDashType,F[h].lineThickness)),
|
|
543
|
-
a.beginPath(),a.moveTo(b,c),a.lineTo(e,g),a.stroke())}function p(a){for(a-=1;-1<=a&&-1!=a&&F[a].isDirty;a--);return a}function
|
|
543
|
+
a.beginPath(),a.moveTo(b,c),a.lineTo(e,g),a.stroke())}function p(a){for(a-=1;-1<=a&&-1!=a&&F[a].isDirty;a--);return a}function q(a){for(a+=1;a<=R.length&&a!=R.length&&F[a].isDirty;a++);return a}function f(a){for(var b,c=0;c<z.length;c++)if(R[c].y1<a&&R[c].y4>a){b=R[c];break}return b?(a=b.y6?a>b.y6?b.x3+(b.x4-b.x3)/(b.y4-b.y3)*(a-b.y3):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2),{x1:a,x2:a}):-1}function t(a){for(var b=0;b<R.length;b++)F[b].isDirty||(a&&(F[b].textBlock.ctx=
|
|
544
544
|
a),F[b].textBlock.y+=F[b].textBlock._lineHeight/2,F[b].textBlock.render(!0),F[b].textBlock.y-=F[b].textBlock._lineHeight/2)}function v(a){x.plotArea.layoutManager.reset();a.roundRect||za(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&&"center"===c.verticalAlign)x.subtitles.ctx=
|
|
545
545
|
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());va.fNg&&va.fNg(x)}var x=this;if(!(0>=a.dataSeriesIndexes.length)){for(var s=this.data[a.dataSeriesIndexes[0]],z=s.dataPoints,u=this.plotArea,B=0.025*u.width,C=0.01*u.width,A=0,H=u.height-2*B,L=Math.min(u.width-2*C,2.8*u.height),J=!1,U=0;U<z.length;U++)if(!J&&("undefined"!==typeof z[U].indexLabel&&null!==z[U].indexLabel&&
|
|
546
546
|
0<z[U].indexLabel.toString().length)&&(J=!0),!J&&("undefined"!==typeof z[U].label&&null!==z[U].label&&0<z[U].label.toString().length)&&(J=!0),!J&&"function"===typeof s.indexLabelFormatter||"function"===typeof z[U].indexLabelFormatter)J=!0;J=J||"undefined"!==typeof s.indexLabel&&null!==s.indexLabel&&0<s.indexLabel.toString().length;"inside"!==s.indexLabelPlacement&&J||(C=(u.width-0.75*L)/2);var U=u.x1+C,Q=u.x2-C,Z=u.y1+B,O=u.y2-B,P=a.targetCanvasCtx||this.plotArea.ctx||this.ctx;if(0!=s.length&&(s.dataPoints&&
|
|
547
547
|
s.visible)&&0!==z.length){var N,E;a=75*L/100;var X=30*(Q-a)/100;"funnel"===s.type?(N=n(s.options.neckHeight)?0.35*H:s.neckHeight,E=n(s.options.neckWidth)?0.25*a:s.neckWidth,"string"===typeof N&&N.match(/%$/)?(N=parseInt(N),N=N*H/100):N=parseInt(N),"string"===typeof E&&E.match(/%$/)?(E=parseInt(E),E=E*a/100):E=parseInt(E),N>H?N=H:0>=N&&(N=0),E>a?E=a-0.5:0>=E&&(E=0)):"pyramid"===s.type&&(E=N=0,s.reversed=s.reversed?!1:!0);var C=U+a/2,S=U,V=U+a,T=s.reversed?O:Z,M=C-E/2,Y=C+E/2,W=s.reversed?Z+N:O-N,ta=
|
|
548
548
|
s.reversed?Z:O;E=s.valueRepresents=s.valueRepresents?s.valueRepresents:"height";U=[];a=[];var R=[],C=[],aa=Z,da,ca=(W-T)/(M-S),fa=-ca,L="area"===E?c():g();if(-1!==L){if(s.reversed)for(C.push(aa),E=L.length-1;0<E;E--)aa+=L[E],C.push(aa);else for(E=0;E<L.length;E++)aa+=L[E],C.push(aa);if(s.reversed)for(E=0;E<L.length;E++)C[E]<W?(U.push(M),a.push(Y),da=E):(U.push((C[E]-T+ca*S)/ca),a.push((C[E]-T+fa*V)/fa));else for(E=0;E<L.length;E++)C[E]<W?(U.push((C[E]-T+ca*S)/ca),a.push((C[E]-T+fa*V)/fa),da=E):(U.push(M),
|
|
549
549
|
a.push(Y));for(E=0;E<L.length-1;E++)aa=s.reversed?z[z.length-1-E].color?z[z.length-1-E].color:s._colorSet[(z.length-1-E)%s._colorSet.length]:z[E].color?z[E].color:s._colorSet[E%s._colorSet.length],E===da?R.push({x1:U[E],y1:C[E],x2:a[E],y2:C[E],x3:Y,y3:W,x4:a[E+1],y4:C[E+1],x5:U[E+1],y5:C[E+1],x6:M,y6:W,id:E,height:C[E+1]-C[E],color:aa}):R.push({x1:U[E],y1:C[E],x2:a[E],y2:C[E],x3:a[E+1],y3:C[E+1],x4:U[E+1],y4:C[E+1],id:E,height:C[E+1]-C[E],color:aa});var ea=2,F=[],ha=!1,$=[],ia=[],U=!1;a=a=0;Da($);
|
|
550
|
-
for(E=0;E<z.length;E++)z[E].exploded&&(U=!0,s.reversed?$.push(z.length-1-E):$.push(E));P.clearRect(u.x1,u.y1,u.width,u.height);P.fillStyle=x.backgroundColor;P.fillRect(u.x1,u.y1,u.width,u.height);if(J&&s.visible&&(b(),h(),"inside"!==s.indexLabelPlacement)){e();
|
|
550
|
+
for(E=0;E<z.length;E++)z[E].exploded&&(U=!0,s.reversed?$.push(z.length-1-E):$.push(E));P.clearRect(u.x1,u.y1,u.width,u.height);P.fillStyle=x.backgroundColor;P.fillRect(u.x1,u.y1,u.width,u.height);if(J&&s.visible&&(b(),h(),"inside"!==s.indexLabelPlacement)){e();r();for(E=0;E<z.length;E++)F[E].isDirty||(a=F[E].textBlock.x+F[E].width,a=(Q-a)/2,0==E&&(A=a),A>a&&(A=a));for(E=0;E<R.length;E++)R[E].x1+=A,R[E].x2+=A,R[E].x3+=A,R[E].x4+=A,R[E].x5&&(R[E].x5+=A,R[E].x6+=A),F[E].textBlock.x+=A}for(E=0;E<R.length;E++)A=
|
|
551
551
|
R[E],qa(P,A,s.fillOpacity),ia.push(A.y1);v(P);J&&s.visible&&("inside"===s.indexLabelPlacement||x.animationEnabled||l(P),x.animationEnabled||t());if(!J)for(E=0;E<z.length;E++)A=s.dataPointIds[E],a={id:A,objectType:"dataPoint",dataPointIndex:E,dataSeriesIndex:0,funnelSection:R[s.reversed?z.length-1-E:E]},x._eventManager.objectMap[A]=a;!x.animationEnabled&&U?m(x,-1,0):x.animationEnabled&&!x.animatedRender&&m(x,-1,0);this.funnelPyramidClickHandler=function(a){var b=-1;if(!ha&&!x.isAnimating&&(n(a.dataSeries.explodeOnClick)||
|
|
552
552
|
a.dataSeries.explodeOnClick)&&(b=s.reversed?z.length-1-a.dataPointIndex:a.dataPointIndex,0<=b)){a=b;if("funnel"===s.type||"pyramid"===s.type)s.reversed?z[z.length-1-a].exploded=z[z.length-1-a].exploded?!1:!0:z[a].exploded=z[a].exploded?!1:!0;m(x,b,500)}};return{source:P,dest:this.plotArea.ctx,animationCallback:function(a,b){K.fadeInAnimation(a,b);1<=a&&(m(x,-1,500),v(x.plotArea.ctx||x.ctx))},easingFunction:K.easing.easeInQuad,animationBase:0}}}}};m.prototype.requestAnimFrame=function(){return window.requestAnimationFrame||
|
|
553
553
|
window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();m.prototype.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;m.prototype.set=function(a,g,c){c="undefined"===typeof c?!0:c;"options"===a?(this.options=g,
|
|
554
|
-
c&&this.render()):m.base.set.call(this,a,g,c)};m.prototype.exportChart=function(a){a="undefined"===typeof a?{}:a;var g=a.format?a.format:"png",c=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+g);var b=this.canvas;if(b&&g&&c){c=c+"."+g;a="image/"+g;var b=b.toDataURL(a),e=!1,h=document.createElement("a");h.download=c;h.href=b;if("undefined"!==typeof Blob&&new Blob){for(var
|
|
555
|
-
d=new Uint8Array(d),n=0;n<
|
|
554
|
+
c&&this.render()):m.base.set.call(this,a,g,c)};m.prototype.exportChart=function(a){a="undefined"===typeof a?{}:a;var g=a.format?a.format:"png",c=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+g);var b=this.canvas;if(b&&g&&c){c=c+"."+g;a="image/"+g;var b=b.toDataURL(a),e=!1,h=document.createElement("a");h.download=c;h.href=b;if("undefined"!==typeof Blob&&new Blob){for(var r=b.replace(/^data:[a-z\/]*;base64,/,""),r=atob(r),d=new ArrayBuffer(r.length),
|
|
555
|
+
d=new Uint8Array(d),n=0;n<r.length;n++)d[n]=r.charCodeAt(n);g=new Blob([d.buffer],{type:"image/"+g});try{window.navigator.msSaveBlob(g,c),e=!0}catch(k){h.dataset.downloadurl=[a,h.download,h.href].join(":"),h.href=window.URL.createObjectURL(g)}}if(!e)try{event=document.createEvent("MouseEvents"),event.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),h.dispatchEvent?h.dispatchEvent(event):h.fireEvent&&h.fireEvent("onclick")}catch(l){g=window.open(),g.document.write("<img src='"+b+"'></img><div>Please right click on the image and save it to your device</div>"),
|
|
556
556
|
g.document.close()}}};m.prototype.print=function(){var a=this.exportChart({toDataURL:!0}),g=document.createElement("iframe");g.setAttribute("class","canvasjs-chart-print-frame");O(g,{position:"absolute",width:"100%",border:"0px",margin:"0px 0px 0px 0px",padding:"0px 0px 0px 0px"});g.style.height=this.height+"px";this._canvasJSContainer.appendChild(g);var c=this,b=g.contentWindow||g.contentDocument.document||g.contentDocument;b.document.open();b.document.write('<!DOCTYPE HTML>\n<html><body><img src="'+
|
|
557
557
|
a+'"/><body/></html>');b.document.body&&b.document.body.style&&(b.document.body.style.margin="0px 0px 0px 0px",b.document.body.style.padding="0px 0px 0px 0px");b.document.close();setTimeout(function(){b.focus();b.print();setTimeout(function(){c._canvasJSContainer.removeChild(g)},1E3)},500)};m.prototype.getPercentAndTotal=function(a,g){var c=null,b=null,e=c=null;if(0<=a.type.indexOf("stacked"))b=0,c=g.x.getTime?g.x.getTime():g.x,c in a.plotUnit.yTotals&&(b=a.plotUnit.yTotals[c],c=a.plotUnit.yAbsTotals[c],
|
|
558
|
-
e=isNaN(g.y)?0:0===c?0:100*(g.y/c));else if("pie"===a.type||"doughnut"===a.type||"funnel"===a.type||"pyramid"===a.type){for(c=b=0;c<a.dataPoints.length;c++)isNaN(a.dataPoints[c].y)||(b+=a.dataPoints[c].y);e=isNaN(g.y)?0:100*(g.y/b)}return{percent:e,total:b}};m.prototype.replaceKeywordsWithValue=function(a,g,c,b,e){var h=this;e="undefined"===typeof e?0:e;if((0<=c.type.indexOf("stacked")||"pie"===c.type||"doughnut"===c.type||"funnel"===c.type||"pyramid"===c.type)&&(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))){var
|
|
559
|
-
"#percent",d="#total",n=this.getPercentAndTotal(c,g),d=isNaN(n.total)?d:n.total,
|
|
560
|
-
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=Ga(a.slice(1,a.length-1));a=a.replace("#index",e);var
|
|
561
|
-
g.color?g.color:c.color?c.color:c._colorSet[b%c._colorSet.length];if(g.hasOwnProperty(a))f=g;else if(c.hasOwnProperty(a))f=c;else return"";f=f[a];null!==
|
|
558
|
+
e=isNaN(g.y)?0:0===c?0:100*(g.y/c));else if("pie"===a.type||"doughnut"===a.type||"funnel"===a.type||"pyramid"===a.type){for(c=b=0;c<a.dataPoints.length;c++)isNaN(a.dataPoints[c].y)||(b+=a.dataPoints[c].y);e=isNaN(g.y)?0:100*(g.y/b)}return{percent:e,total:b}};m.prototype.replaceKeywordsWithValue=function(a,g,c,b,e){var h=this;e="undefined"===typeof e?0:e;if((0<=c.type.indexOf("stacked")||"pie"===c.type||"doughnut"===c.type||"funnel"===c.type||"pyramid"===c.type)&&(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))){var r=
|
|
559
|
+
"#percent",d="#total",n=this.getPercentAndTotal(c,g),d=isNaN(n.total)?d:n.total,r=isNaN(n.percent)?r:n.percent;do{n="";if(c.percentFormatString)n=c.percentFormatString;else{var n="#,##0.",k=Math.max(Math.ceil(Math.log(1/Math.abs(r))/Math.LN10),2);if(isNaN(k)||!isFinite(k))k=2;for(var l=0;l<k;l++)n+="#";c.percentFormatString=n}a=a.replace("#percent",fa(r,n,h._cultureInfo));a=a.replace("#total",fa(d,c.yValueFormatString?c.yValueFormatString:"#,##0.########",h._cultureInfo))}while(0<=a.indexOf("#percent")||
|
|
560
|
+
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=Ga(a.slice(1,a.length-1));a=a.replace("#index",e);var r=null;try{var f=a.match(/(.*?)\s*\[\s*(.*?)\s*\]/);f&&0<f.length&&(r=Ga(f[2]),a=Ga(f[1]))}catch(d){}f=null;if("color"===a)return"waterfall"===c.type?g.color?g.color:0<g.y?c.risingColor:c.fallingColor:"error"===c.type?c.color?c.color:c._colorSet[r%c._colorSet.length]:
|
|
561
|
+
g.color?g.color:c.color?c.color:c._colorSet[b%c._colorSet.length];if(g.hasOwnProperty(a))f=g;else if(c.hasOwnProperty(a))f=c;else return"";f=f[a];null!==r&&(f=f[r]);return"x"===a?(c.axisX&&"dateTime"===c.axisX.valueType||"dateTime"===c.xValueType||g.x&&g.x.getTime)&&!c.axisX.logarithmic?Ca(f,g.xValueFormatString?g.xValueFormatString:c.xValueFormatString?c.xValueFormatString:c.xValueFormatString=h.axisX&&h.axisX.autoValueFormatString?h.axisX.autoValueFormatString:"DD MMM YY",h._cultureInfo):fa(f,g.xValueFormatString?
|
|
562
562
|
g.xValueFormatString:c.xValueFormatString?c.xValueFormatString:c.xValueFormatString="#,##0.########",h._cultureInfo):"y"===a?fa(f,g.yValueFormatString?g.yValueFormatString:c.yValueFormatString?c.yValueFormatString:c.yValueFormatString="#,##0.########",h._cultureInfo):"z"===a?fa(f,g.zValueFormatString?g.zValueFormatString:c.zValueFormatString?c.zValueFormatString:c.zValueFormatString="#,##0.########",h._cultureInfo):f})};pa(P,T);P.prototype.setLayout=function(){var a=this.dockInsidePlotArea?this.chart.plotArea:
|
|
563
|
-
this.chart,g=a.layoutManager.getFreeSpace(),c=null,b=0,e=0,h=0,
|
|
564
|
-
"vertical";if("left"===this.horizontalAlign||"center"===this.horizontalAlign||"right"===this.horizontalAlign)c=this.horizontalAlign;h=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*g.width;
|
|
563
|
+
this.chart,g=a.layoutManager.getFreeSpace(),c=null,b=0,e=0,h=0,r=0,d=this.markerMargin=this.chart.options.legend&&!n(this.chart.options.legend.markerMargin)?this.chart.options.legend.markerMargin:0.3*this.fontSize;this.height=0;var m=[],k=[];if("top"===this.verticalAlign||"bottom"===this.verticalAlign)this.orientation="horizontal",c=this.verticalAlign,h=this.maxWidth=null!==this.maxWidth?this.maxWidth:g.width,r=this.maxHeight=null!==this.maxHeight?this.maxHeight:0.5*g.height;else if("center"===this.verticalAlign){this.orientation=
|
|
564
|
+
"vertical";if("left"===this.horizontalAlign||"center"===this.horizontalAlign||"right"===this.horizontalAlign)c=this.horizontalAlign;h=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*g.width;r=this.maxHeight=null!==this.maxHeight?this.maxHeight:g.height}this.errorMarkerColor=[];for(var l=0;l<this.dataSeries.length;l++){var p=this.dataSeries[l];if(p.dataPoints&&p.dataPoints.length){if("pie"!==p.type&&"doughnut"!==p.type&&"funnel"!==p.type&&"pyramid"!==p.type){var q=p.legendMarkerType=p.legendMarkerType?
|
|
565
565
|
p.legendMarkerType:"line"!==p.type&&"stepLine"!==p.type&&"spline"!==p.type&&"scatter"!==p.type&&"bubble"!==p.type||!p.markerType?"error"===p.type&&p._linkedSeries?p._linkedSeries.legendMarkerType?p._linkedSeries.legendMarkerType:V.getDefaultLegendMarker(p._linkedSeries.type):V.getDefaultLegendMarker(p.type):p.markerType,f=p.legendText?p.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:p,dataPoint:null}):p.name,w=p.legendMarkerColor=p.legendMarkerColor?
|
|
566
566
|
p.legendMarkerColor:p.markerColor?p.markerColor:"error"===p.type?n(p.whiskerColor)?p._colorSet[0]:p.whiskerColor:p._colorSet[0],v=p.markerSize||"line"!==p.type&&"stepLine"!==p.type&&"spline"!==p.type?0.75*this.lineHeight:0,x=p.legendMarkerBorderColor?p.legendMarkerBorderColor:p.markerBorderColor,s=p.legendMarkerBorderThickness?p.legendMarkerBorderThickness:p.markerBorderThickness?Math.max(1,Math.round(0.2*v)):0;"error"===p.type&&this.errorMarkerColor.push(w);f=p.legendText=this.chart.replaceKeywordsWithValue(f,
|
|
567
|
-
p.dataPoints[0],p,l);
|
|
567
|
+
p.dataPoints[0],p,l);q={markerType:q,markerColor:w,text:f,textBlock:null,chartType:p.type,markerSize:v,lineColor:p._colorSet[0],dataSeriesIndex:p.index,dataPointIndex:null,markerBorderColor:x,markerBorderThickness:s};m.push(q)}else for(var z=0;z<p.dataPoints.length;z++){var u=p.dataPoints[z],q=u.legendMarkerType?u.legendMarkerType:p.legendMarkerType?p.legendMarkerType:V.getDefaultLegendMarker(p.type),f=u.legendText?u.legendText:p.legendText?p.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,
|
|
568
568
|
legend:this.options,dataSeries:p,dataPoint:u}):u.name?u.name:"DataPoint: "+(z+1),w=u.legendMarkerColor?u.legendMarkerColor:p.legendMarkerColor?p.legendMarkerColor:u.color?u.color:p.color?p.color:p._colorSet[z%p._colorSet.length],v=0.75*this.lineHeight,x=u.legendMarkerBorderColor?u.legendMarkerBorderColor:p.legendMarkerBorderColor?p.legendMarkerBorderColor:u.markerBorderColor?u.markerBorderColor:p.markerBorderColor,s=u.legendMarkerBorderThickness?u.legendMarkerBorderThickness:p.legendMarkerBorderThickness?
|
|
569
|
-
p.legendMarkerBorderThickness:u.markerBorderThickness||p.markerBorderThickness?Math.max(1,Math.round(0.2*v)):0,f=this.chart.replaceKeywordsWithValue(f,u,p,z),
|
|
570
|
-
null!==this.itemMaxWidth?Math.min(this.itemWidth,this.itemMaxWidth,h):this.itemMaxWidth=Math.min(this.itemWidth,h):null!==this.itemMaxWidth?Math.min(this.itemMaxWidth,h):this.itemMaxWidth=h;v=0===v?0.75*this.lineHeight:v;u=(this.itemMaxWidth?this.itemMaxWidth:u)-(v+d);for(l=0;l<m.length;l++){
|
|
571
|
-
new ja(this.ctx,{x:0,y:0,maxWidth:w,maxHeight:this.itemWrap?
|
|
572
|
-
v+d+(0===p.width?0:this.horizontalSpacing)+("line"===
|
|
573
|
-
Math.max(p.width,this.width)}else
|
|
574
|
-
0))),this.height<
|
|
575
|
-
f;this.height=Math.min(
|
|
576
|
-
this.width:g.x1+g.width/2-this.width/2,b=g.y2-this.height);this.items=m;for(l=0;l<this.items.length;l++)
|
|
577
|
-
function(){var a=this.bounds.x1,g=this.bounds.y1,c=this.markerMargin,b=this.maxWidth,e=this.maxHeight,h=this.markerSize,
|
|
578
|
-
(this.ctx.globalAlpha=0.5);this.ctx.save();this.ctx.beginPath();this.ctx.rect(a,g,b,Math.max(e-e%this.lineHeight,0));this.ctx.clip();if("line"===
|
|
569
|
+
p.legendMarkerBorderThickness:u.markerBorderThickness||p.markerBorderThickness?Math.max(1,Math.round(0.2*v)):0,f=this.chart.replaceKeywordsWithValue(f,u,p,z),q={markerType:q,markerColor:w,text:f,textBlock:null,chartType:p.type,markerSize:v,dataSeriesIndex:l,dataPointIndex:z,markerBorderColor:x,markerBorderThickness:s};(u.showInLegend||p.showInLegend&&!1!==u.showInLegend)&&m.push(q)}n(p.legendText)&&(p.legendText=p.name)}}!0===this.reversed&&m.reverse();if(0<m.length){p=null;f=u=z=0;u=null!==this.itemWidth?
|
|
570
|
+
null!==this.itemMaxWidth?Math.min(this.itemWidth,this.itemMaxWidth,h):this.itemMaxWidth=Math.min(this.itemWidth,h):null!==this.itemMaxWidth?Math.min(this.itemMaxWidth,h):this.itemMaxWidth=h;v=0===v?0.75*this.lineHeight:v;u=(this.itemMaxWidth?this.itemMaxWidth:u)-(v+d);for(l=0;l<m.length;l++){q=m[l];w=u;if("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType)w-=2*0.1*this.lineHeight;if(!(0>=r||"undefined"===typeof r||0>=w||"undefined"===typeof w))if("horizontal"===this.orientation){q.textBlock=
|
|
571
|
+
new ja(this.ctx,{x:0,y:0,maxWidth:w,maxHeight:this.itemWrap?r: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-(v+d+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0)));if(!p||p.width+Math.round(q.textBlock.width+
|
|
572
|
+
v+d+(0===p.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))>h)p={items:[],width:0},k.push(p),this.height+=f,f=0;f=Math.max(f,q.textBlock.height?q.textBlock.height:this.lineHeight);q.textBlock.x=p.width;q.textBlock.y=0;p.width+=Math.round(q.textBlock.width+v+d+(0===p.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0));p.items.push(q);this.width=
|
|
573
|
+
Math.max(p.width,this.width)}else q.textBlock=new ja(this.ctx,{x:0,y:0,maxWidth:u,maxHeight:!0===this.itemWrap?r:1.5*this.fontSize,angle:0,text:q.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),q.textBlock.measureText(),null!==this.itemWidth&&(q.textBlock.width=this.itemWidth-(v+d+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:
|
|
574
|
+
0))),this.height<r-this.lineHeight?(p={items:[],width:0},k.push(p)):(p=k[z],z=(z+1)%k.length),p&&(this.height+=q.textBlock.height?q.textBlock.height:this.lineHeight,q.textBlock.x=p.width,q.textBlock.y=0,p.width+=Math.round(q.textBlock.width+v+d+(0===p.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0)),p.items.push(q),this.width=Math.max(p.width,this.width))}this.height=!1===this.itemWrap?k.length*this.lineHeight:this.height+
|
|
575
|
+
f;this.height=Math.min(r,this.height);this.width=Math.min(h,this.width)}"top"===this.verticalAlign?(e="left"===this.horizontalAlign?g.x1:"right"===this.horizontalAlign?g.x2-this.width:g.x1+g.width/2-this.width/2,b=g.y1):"center"===this.verticalAlign?(e="left"===this.horizontalAlign?g.x1:"right"===this.horizontalAlign?g.x2-this.width:g.x1+g.width/2-this.width/2,b=g.y1+g.height/2-this.height/2):"bottom"===this.verticalAlign&&(e="left"===this.horizontalAlign?g.x1:"right"===this.horizontalAlign?g.x2-
|
|
576
|
+
this.width:g.x1+g.width/2-this.width/2,b=g.y2-this.height);this.items=m;for(l=0;l<this.items.length;l++)q=m[l],q.id=++this.chart._eventManager.lastObjectId,this.chart._eventManager.objectMap[q.id]={id:q.id,objectType:"legendItem",legendItemIndex:l,dataSeriesIndex:q.dataSeriesIndex,dataPointIndex:q.dataPointIndex};this.markerSize=v;this.rows=k;0<m.length&&a.layoutManager.registerSpace(c,{width:this.width+2+2,height:this.height+5+5});this.bounds={x1:e,y1:b,x2:e+this.width,y2:b+this.height}};P.prototype.render=
|
|
577
|
+
function(){var a=this.bounds.x1,g=this.bounds.y1,c=this.markerMargin,b=this.maxWidth,e=this.maxHeight,h=this.markerSize,r=this.rows;(0<this.borderThickness&&this.borderColor||this.backgroundColor)&&this.ctx.roundRect(a,g,this.width,this.height,this.cornerRadius,this.borderThickness,this.backgroundColor,this.borderColor);for(var d=0,n=0;n<r.length;n++){for(var k=r[n],l=0,p=0;p<k.items.length;p++){var q=k.items[p],f=q.textBlock.x+a+(0===p?0.2*h:this.horizontalSpacing),m=g+d,v=f;this.chart.data[q.dataSeriesIndex].visible||
|
|
578
|
+
(this.ctx.globalAlpha=0.5);this.ctx.save();this.ctx.beginPath();this.ctx.rect(a,g,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,m+this.lineHeight/2),this.ctx.lineTo(f+0.85*this.lineHeight,m+this.lineHeight/2),this.ctx.stroke(),v-=0.1*this.lineHeight;if("error"===q.chartType){this.ctx.strokeStyle=
|
|
579
579
|
this.errorMarkerColor[0];this.ctx.lineWidth=h/8;this.ctx.beginPath();var x=f-0.08*this.lineHeight+0.1*this.lineHeight,s=m+0.15*this.lineHeight,w=0.7*this.lineHeight,u=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+u);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(x,s+u);this.ctx.lineTo(x+w,s+u);this.ctx.stroke();this.errorMarkerColor.shift()}W.drawMarker(f+h/2,m+this.lineHeight/2,this.ctx,
|
|
580
|
-
|
|
581
|
-
this.chart.data[
|
|
582
|
-
|
|
580
|
+
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+h;if("line"===q.chartType||"stepLine"===q.chartType||"spline"===q.chartType)q.textBlock.x+=0.1*this.lineHeight;q.textBlock.y=Math.round(m+this.lineHeight/2);q.textBlock.render(!0);this.ctx.restore();l=0<p?Math.max(l,q.textBlock.height?q.textBlock.height:this.lineHeight):q.textBlock.height?q.textBlock.height:this.lineHeight;
|
|
581
|
+
this.chart.data[q.dataSeriesIndex].visible||(this.ctx.globalAlpha=1);f=X(q.id);this.ghostCtx.fillStyle=f;this.ghostCtx.beginPath();this.ghostCtx.fillRect(v,q.textBlock.y-this.lineHeight/2,q.textBlock.x+q.textBlock.width-v,q.textBlock.height?q.textBlock.height:this.lineHeight);q.x1=this.chart._eventManager.objectMap[q.id].x1=v;q.y1=this.chart._eventManager.objectMap[q.id].y1=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=
|
|
582
|
+
q.textBlock.y+(q.textBlock.height?q.textBlock.height:this.lineHeight)-this.lineHeight/2}d+=l}};pa(V,T);V.prototype.getDefaultAxisPlacement=function(){var a=this.type;if("column"===a||"line"===a||"stepLine"===a||"spline"===a||"area"===a||"stepArea"===a||"splineArea"===a||"stackedColumn"===a||"stackedLine"===a||"bubble"===a||"scatter"===a||"stackedArea"===a||"stackedColumn100"===a||"stackedLine100"===a||"stackedArea100"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeArea"===a||"rangeSplineArea"===
|
|
583
583
|
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};V.getDefaultLegendMarker=function(a){if("column"===a||"stackedColumn"===a||"stackedLine"===a||"bar"===a||"stackedBar"===a||"stackedBar100"===a||"bubble"===a||"scatter"===a||"stackedColumn100"===a||"stackedLine100"===a||
|
|
584
584
|
"stepArea"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeBar"===a||"rangeArea"===a||"rangeSplineArea"===a||"boxAndWhisker"===a||"waterfall"===a)return"square";if("line"===a||"stepLine"===a||"spline"===a||"pie"===a||"doughnut"===a)return"circle";if("area"===a||"splineArea"===a||"stackedArea"===a||"stackedArea100"===a||"funnel"===a||"pyramid"===a)return"triangle";if("error"===a)return"none";window.console.log("Unknown Chart Type: "+a);return null};V.prototype.getDataPointAtX=function(a,
|
|
585
585
|
g){if(!this.dataPoints||0===this.dataPoints.length)return null;var c={dataPoint:null,distance:Infinity,index:NaN},b=null,e=0,h=0,d=1,n=Infinity,m=0,k=0,l=0;"none"!==this.chart.plotInfo.axisPlacement&&(this.axisX.logarithmic?(l=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),l=1<l?Math.min(Math.max((this.dataPoints.length-1)/l*Math.log(a/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0):(l=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,l=0<l?Math.min(Math.max((this.dataPoints.length-
|
|
586
586
|
1)/l*(a-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0));for(;;){h=0<d?l+e:l-e;if(0<=h&&h<this.dataPoints.length){var b=this.dataPoints[h],p=this.axisX.logarithmic?b.x>a?b.x/a:a/b.x:Math.abs(b.x-a);p<c.distance&&(c.dataPoint=b,c.distance=p,c.index=h);b=p;b<=n?n=b:0<d?m++:k++;if(1E3<m&&1E3<k)break}else if(0>l-e&&l+e>=this.dataPoints.length)break;-1===d?(e++,d=1):d=-1}return g||(c.dataPoint.x.getTime?c.dataPoint.x.getTime():c.dataPoint.x)!==(a.getTime?a.getTime():a)?g&&null!==c.dataPoint?c:null:
|
|
587
|
-
c};V.prototype.getDataPointAtXY=function(a,g,c){if(!this.dataPoints||0===this.dataPoints.length||a<this.chart.plotArea.x1||a>this.chart.plotArea.x2||g<this.chart.plotArea.y1||g>this.chart.plotArea.y2)return null;c=c||!1;var b=[],e=0,h=0,d=1,m=!1,w=Infinity,k=0,l=0,p=0;if("none"!==this.chart.plotInfo.axisPlacement)if(p=(this.chart.axisX[0]?this.chart.axisX[0]:this.chart.axisX2[0]).getXValueAt({x:a,y:g}),this.axisX.logarithmic)var
|
|
588
|
-
p=1<
|
|
589
|
-
|
|
590
|
-
Math.abs(
|
|
591
|
-
distance:t}),m=!0);break;case "pie":case "doughnut":v=
|
|
592
|
-
(b.push({dataPoint:f,dataPointIndex:h,dataSeries:this,distance:0}),m=!0));break;case "funnel":case "pyramid":t=
|
|
593
|
-
break;case "boxAndWhisker":if(a>=
|
|
594
|
-
a+
|
|
595
|
-
a),Math.abs(
|
|
587
|
+
c};V.prototype.getDataPointAtXY=function(a,g,c){if(!this.dataPoints||0===this.dataPoints.length||a<this.chart.plotArea.x1||a>this.chart.plotArea.x2||g<this.chart.plotArea.y1||g>this.chart.plotArea.y2)return null;c=c||!1;var b=[],e=0,h=0,d=1,m=!1,w=Infinity,k=0,l=0,p=0;if("none"!==this.chart.plotInfo.axisPlacement)if(p=(this.chart.axisX[0]?this.chart.axisX[0]:this.chart.axisX2[0]).getXValueAt({x:a,y:g}),this.axisX.logarithmic)var q=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),
|
|
588
|
+
p=1<q?Math.min(Math.max((this.dataPoints.length-1)/q*Math.log(p/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;else q=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0<q?Math.min(Math.max((this.dataPoints.length-1)/q*(p-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;for(;;){h=0<d?p+e:p-e;if(0<=h&&h<this.dataPoints.length){var q=this.chart._eventManager.objectMap[this.dataPointIds[h]],f=this.dataPoints[h],t=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>=
|
|
589
|
+
q.x1&&(a<=q.x2&&g>=q.y1&&g<=q.y2)&&(b.push({dataPoint:f,dataPointIndex:h,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y1-g),Math.abs(q.y2-g))}),m=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var v=ma("markerSize",f,this)||4,x=c?20:v,t=Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-g,2));t<=x&&b.push({dataPoint:f,dataPointIndex:h,dataSeries:this,distance:t});q=
|
|
590
|
+
Math.abs(q.x1-a);q<=w?w=q:0<d?k++:l++;t<=v/2&&(m=!0);break;case "rangeArea":case "rangeSplineArea":v=ma("markerSize",f,this)||4;x=c?20:v;t=Math.min(Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-g,2)),Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y2-g,2)));t<=x&&b.push({dataPoint:f,dataPointIndex:h,dataSeries:this,distance:t});q=Math.abs(q.x1-a);q<=w?w=q:0<d?k++:l++;t<=v/2&&(m=!0);break;case "bubble":v=q.size;t=Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-g,2));t<=v/2&&(b.push({dataPoint:f,dataPointIndex:h,dataSeries:this,
|
|
591
|
+
distance:t}),m=!0);break;case "pie":case "doughnut":v=q.center;x="doughnut"===this.type?q.percentInnerRadius*q.radius:0;t=Math.sqrt(Math.pow(v.x-a,2)+Math.pow(v.y-g,2));t<q.radius&&t>x&&(t=Math.atan2(g-v.y,a-v.x),0>t&&(t+=2*Math.PI),t=Number(((180*(t/Math.PI)%360+360)%360).toFixed(12)),v=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),v>=x&&(0!==f.y&&!n(f.y))&&(x+=360,t<v&&(t+=360)),t>v&&t<x&&
|
|
592
|
+
(b.push({dataPoint:f,dataPointIndex:h,dataSeries:this,distance:0}),m=!0));break;case "funnel":case "pyramid":t=q.funnelSection;g>t.y1&&g<t.y4&&(t.y6?g>t.y6?(h=t.x6+(t.x5-t.x6)/(t.y5-t.y6)*(g-t.y6),t=t.x3+(t.x4-t.x3)/(t.y4-t.y3)*(g-t.y3)):(h=t.x1+(t.x6-t.x1)/(t.y6-t.y1)*(g-t.y1),t=t.x2+(t.x3-t.x2)/(t.y3-t.y2)*(g-t.y2)):(h=t.x1+(t.x4-t.x1)/(t.y4-t.y1)*(g-t.y1),t=t.x2+(t.x3-t.x2)/(t.y3-t.y2)*(g-t.y2)),a>h&&a<t&&(b.push({dataPoint:f,dataPointIndex:q.dataPointIndex,dataSeries:this,distance:0}),m=!0));
|
|
593
|
+
break;case "boxAndWhisker":if(a>=q.x1-q.borderThickness/2&&a<=q.x2+q.borderThickness/2&&g>=q.y4-q.borderThickness/2&&g<=q.y1+q.borderThickness/2||Math.abs(q.x2-a+q.x1-a)<q.borderThickness&&g>=q.y1&&g<=q.y4)b.push({dataPoint:f,dataPointIndex:h,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y2-g),Math.abs(q.y3-g))}),m=!0;break;case "candlestick":if(a>=q.x1-q.borderThickness/2&&a<=q.x2+q.borderThickness/2&&g>=q.y2-q.borderThickness/2&&g<=q.y3+q.borderThickness/2||Math.abs(q.x2-
|
|
594
|
+
a+q.x1-a)<q.borderThickness&&g>=q.y1&&g<=q.y4)b.push({dataPoint:f,dataPointIndex:h,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y2-g),Math.abs(q.y3-g))}),m=!0;break;case "ohlc":if(Math.abs(q.x2-a+q.x1-a)<q.borderThickness&&g>=q.y2&&g<=q.y3||a>=q.x1&&a<=(q.x2+q.x1)/2&&g>=q.y1-q.borderThickness/2&&g<=q.y1+q.borderThickness/2||a>=(q.x1+q.x2)/2&&a<=q.x2&&g>=q.y4-q.borderThickness/2&&g<=q.y4+q.borderThickness/2)b.push({dataPoint:f,dataPointIndex:h,dataSeries:this,distance:Math.min(Math.abs(q.x1-
|
|
595
|
+
a),Math.abs(q.x2-a),Math.abs(q.y2-g),Math.abs(q.y3-g))}),m=!0}if(m||1E3<k&&1E3<l)break}}else if(0>p-e&&p+e>=this.dataPoints.length)break;-1===d?(e++,d=1):d=-1}a=null;for(g=0;g<b.length;g++)a?b[g].distance<=a.distance&&(a=b[g]):a=b[g];return a};V.prototype.getMarkerProperties=function(a,g,c,b){var e=this.dataPoints,h=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],d=e[a].markerBorderColor?e[a].markerBorderColor:
|
|
596
596
|
this.markerBorderColor?this.markerBorderColor:null,m=n(e[a].markerBorderThickness)?this.markerBorderThickness?this.markerBorderThickness:null:e[a].markerBorderThickness,t=e[a].markerType?e[a].markerType:this.markerType;a=n(e[a].markerSize)?this.markerSize:e[a].markerSize;return{x:g,y:c,ctx:b,type:t,size:a,color:h,borderColor:d,borderThickness:m}};pa(A,T);A.prototype.createExtraLabelsForLog=function(a){a=(a||0)+1;if(!(5<a)){var g=this.logLabelValues[0]||this.intervalStartPosition;if(Math.log(this.range)/
|
|
597
597
|
Math.log(g/this.viewportMinimum)<this.noTicks-1){for(var c=A.getNiceNumber((g-this.viewportMinimum)/Math.min(Math.max(2,this.noTicks-this.logLabelValues.length),3),!0),b=Math.ceil(this.viewportMinimum/c)*c;b<g;b+=c)b<this.viewportMinimum||this.logLabelValues.push(b);this.logLabelValues.sort(Sa);this.createExtraLabelsForLog(a)}}};A.prototype.createLabels=function(){var a,g,c=0,b=0,e,h=0,d=0,b=0,b=this.interval,m=0,t,k=0.6*this.chart.height,l;a=!1;var p=this.scaleBreaks?this.scaleBreaks._appliedBreaks:
|
|
598
|
-
[],
|
|
599
|
-
b=0,f=
|
|
600
|
-
text:this.prefix+a+this.suffix,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,cornerRadius:this.labelCornerRadius,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:l,textBlock:a,effectiveHeight:null}))}f=
|
|
598
|
+
[],q=p.length?n(this.scaleBreaks.firstBreakIndex)?0:this.scaleBreaks.firstBreakIndex:0;if("axisX"!==this.type||"dateTime"!==this.valueType||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()),
|
|
599
|
+
b=0,f=q;b<this.logLabelValues.length;b++)if(c=this.logLabelValues[b],c<this.viewportMinimum)b++;else{for(;f<p.length&&c>p[f].endValue;f++);a=f<p.length&&c>=p[f].startValue&&c<=p[f].endValue;l=c;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:l,label:this.labels[l]?this.labels[l]:null}):"axisX"===this.type&&this.labels[l]?this.labels[l]:fa(l,this.valueFormatString,this.chart._cultureInfo),a=new ja(this.ctx,{x:0,y:0,maxWidth:h,maxHeight:d,angle:this.labelAngle,
|
|
600
|
+
text:this.prefix+a+this.suffix,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,cornerRadius:this.labelCornerRadius,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:l,textBlock:a,effectiveHeight:null}))}f=q;for(c=this.intervalStartPosition;c<=e;c=parseFloat(1E-12>this.interval?
|
|
601
601
|
this.logarithmic&&this.equidistantInterval?c*Math.pow(this.logarithmBase,this.interval):c+this.interval:(this.logarithmic&&this.equidistantInterval?c*Math.pow(this.logarithmBase,this.interval):c+this.interval).toFixed(12))){for(;f<p.length&&c>p[f].endValue;f++);a=f<p.length&&c>=p[f].startValue&&c<=p[f].endValue;l=c;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:l,label:this.labels[l]?this.labels[l]:null}):"axisX"===this.type&&this.labels[l]?this.labels[l]:
|
|
602
602
|
fa(l,this.valueFormatString,this.chart._cultureInfo),a=new ja(this.ctx,{x:0,y:0,maxWidth:h,maxHeight:d,angle:this.labelAngle,text:this.prefix+a+this.suffix,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"}),
|
|
603
|
-
this._labels.push({position:l,textBlock:a,effectiveHeight:null}))}}else for(this.intervalStartPosition=this.getLabelStartPoint(new Date(this.viewportMinimum),this.intervalType,this.interval),e=Ya(new Date(this.viewportMaximum),this.interval,this.intervalType),f=
|
|
603
|
+
this._labels.push({position:l,textBlock:a,effectiveHeight:null}))}}else for(this.intervalStartPosition=this.getLabelStartPoint(new Date(this.viewportMinimum),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<p.length&&a>p[f].endValue;f++);l=a;a=f<p.length&&a>=p[f].startValue&&a<=p[f].endValue;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,
|
|
604
604
|
value:new Date(l),label:this.labels[l]?this.labels[l]:null}):"axisX"===this.type&&this.labels[l]?this.labels[l]:Ca(l,this.valueFormatString,this.chart._cultureInfo),a=new ja(this.ctx,{x:0,y:0,maxWidth:h,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,maxHeight:d,angle:this.labelAngle,text:this.prefix+a+this.suffix,textAlign:this.labelTextAlign,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,
|
|
605
605
|
fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"}),this._labels.push({position:l,textBlock:a,effectiveHeight:null,breaksLabelType:void 0}))}if("bottom"===this._position||"top"===this._position)m=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))/
|
|
606
606
|
Math.log(this.range):this.lineCoordinates.width/(this.logarithmic&&this.equidistantInterval?Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*L[this.intervalType+"Duration"]*this.interval,h="undefined"===typeof this.options.labelMaxWidth?0.5*this.chart.width>>0:this.options.labelMaxWidth,this.chart.panEnabled||(d="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)m=
|
|
607
607
|
this.logarithmic&&!this.equidistantInterval&&2<=this._labels.length?this.lineCoordinates.height*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.height/(this.logarithmic&&this.equidistantInterval?Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*L[this.intervalType+"Duration"]*this.interval,this.chart.panEnabled||(h="undefined"===
|
|
608
|
-
typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),d="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize;for(b=0;b<this._labels.length;b++){a=this._labels[b].textBlock;a.maxWidth=h;a.maxHeight=d;var A=a.measureText();t=A.height}e=[];
|
|
609
|
-
180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360)),"bottom"===this._position||"top"===this._position)if(h=0.9*m>>0,
|
|
610
|
-
for(var v,f=a.text.split(" "),b=0;b<f.length;b++)l=f[b],this.ctx.font=a.fontStyle+" "+a.fontWeight+" "+a.fontSize+"px "+a.fontFamily,l=this.ctx.measureText(l),l.width>
|
|
608
|
+
typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),d="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize;for(b=0;b<this._labels.length;b++){a=this._labels[b].textBlock;a.maxWidth=h;a.maxHeight=d;var A=a.measureText();t=A.height}e=[];q=p=0;if(this.labelAutoFit||this.options.labelAutoFit)if(n(this.labelAngle)||(this.labelAngle=(this.labelAngle%360+360)%360,90<this.labelAngle&&270>this.labelAngle?this.labelAngle-=
|
|
609
|
+
180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360)),"bottom"===this._position||"top"===this._position)if(h=0.9*m>>0,q=0,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=h;this.sessionVariables.labelMaxHeight=d;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;
|
|
610
|
+
for(var v,f=a.text.split(" "),b=0;b<f.length;b++)l=f[b],this.ctx.font=a.fontStyle+" "+a.fontWeight+" "+a.fontSize+"px "+a.fontFamily,l=this.ctx.measureText(l),l.width>q&&(v=c,q=l.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;A=a.measureText();for(f=c+1;f<this._labels.length;f++)if(!this._labels[f].breaksLabelType){g=this._labels[f].textBlock;g=g.measureText();break}e.push(a.height);this.sessionVariables.labelMaxHeight=
|
|
611
611
|
Math.max.apply(Math,e);Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.sin(Math.PI/180*Math.abs(this.labelAngle));b=h*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(d-a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));if(n(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle)if(this.sessionVariables.labelMaxHeight=0===this.labelAngle?d:Math.min((b-h*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),b),
|
|
612
|
-
l=(k-(t+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(-25)))/Math.sin(Math.PI/180*Math.abs(-25)),!n(this.options.labelWrap))this.labelWrap?n(this.options.labelMaxWidth)?(this.sessionVariables.labelMaxWidth=Math.min(Math.max(h,
|
|
612
|
+
l=(k-(t+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(-25)))/Math.sin(Math.PI/180*Math.abs(-25)),!n(this.options.labelWrap))this.labelWrap?n(this.options.labelMaxWidth)?(this.sessionVariables.labelMaxWidth=Math.min(Math.max(h,q),l),this.sessionVariables.labelWrap=this.labelWrap,g&&A.width+g.width>>0>2*h&&(this.sessionVariables.labelAngle=-25)):(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>
|
|
613
613
|
h?-25:this.sessionVariables.labelAngle):n(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelMaxWidth=h,g&&A.width+g.width>>0>2*h&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>h?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=
|
|
614
|
-
d,this.sessionVariables.labelWrap=this.labelWrap);else{if(n(this.options.labelWrap))if(!n(this.options.labelMaxWidth))this.options.labelMaxWidth<h?(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=b):(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=d);else if(!n(g))if(b=A.width+g.width>>0,f=this.labelFontSize,
|
|
615
|
-
h,n(this.options.labelFontSize)&&12<f&&(f=Math.floor(12/13*f),a.measureText()),this.sessionVariables.labelFontSize=n(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelAngle=this.labelAngle):b>=2.2*h&&b<2.8*h?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelFontSize=f):b>=2.8*h&&b<3.2*h?(this.sessionVariables.labelMaxWidth=Math.max(h,
|
|
614
|
+
d,this.sessionVariables.labelWrap=this.labelWrap);else{if(n(this.options.labelWrap))if(!n(this.options.labelMaxWidth))this.options.labelMaxWidth<h?(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=b):(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=d);else if(!n(g))if(b=A.width+g.width>>0,f=this.labelFontSize,q<h)b-2*h>p&&(p=b-2*h,b>=2*h&&b<2.2*h?(this.sessionVariables.labelMaxWidth=
|
|
615
|
+
h,n(this.options.labelFontSize)&&12<f&&(f=Math.floor(12/13*f),a.measureText()),this.sessionVariables.labelFontSize=n(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelAngle=this.labelAngle):b>=2.2*h&&b<2.8*h?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelFontSize=f):b>=2.8*h&&b<3.2*h?(this.sessionVariables.labelMaxWidth=Math.max(h,q),this.sessionVariables.labelWrap=!0,n(this.options.labelFontSize)&&12<this.labelFontSize&&
|
|
616
616
|
(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=n(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelAngle=this.labelAngle):b>=3.2*h&&b<3.6*h?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelFontSize=this.labelFontSize):b>3.6*h&&b<5*h?(n(this.options.labelFontSize)&&12<f&&(f=Math.floor(12/13*f),a.measureText()),this.sessionVariables.labelFontSize=
|
|
617
|
-
n(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l):b>5*h&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=h,this.sessionVariables.labelFontSize=f,this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelAngle=this.labelAngle));else if(v===c&&(0===v&&
|
|
618
|
-
1].textBlock.measureText().width-2*h>p||0<v&&v<this._labels.length-1&&
|
|
619
|
-
l;else if(0===p)for(this.sessionVariables.labelFontSize=n(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.sessionVariables.labelMaxWidth=Math.min(Math.max(h,
|
|
617
|
+
n(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l):b>5*h&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=h,this.sessionVariables.labelFontSize=f,this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelAngle=this.labelAngle));else if(v===c&&(0===v&&q+this._labels[v+1].textBlock.measureText().width-2*h>p||v===this._labels.length-1&&q+this._labels[v-
|
|
618
|
+
1].textBlock.measureText().width-2*h>p||0<v&&v<this._labels.length-1&&q+this._labels[v+1].textBlock.measureText().width-2*h>p&&q+this._labels[v-1].textBlock.measureText().width-2*h>p))p=0===v?q+this._labels[v+1].textBlock.measureText().width-2*h:q+this._labels[v-1].textBlock.measureText().width-2*h,this.sessionVariables.labelFontSize=n(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=
|
|
619
|
+
l;else if(0===p)for(this.sessionVariables.labelFontSize=n(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.sessionVariables.labelMaxWidth=Math.min(Math.max(h,q),l),A=a.measureText(),b<this._labels.length-1&&(f=b+1,g=this._labels[f].textBlock,g.maxWidth=this.sessionVariables.labelMaxWidth=Math.min(Math.max(h,q),l),g=g.measureText(),A.width+g.width>>0>2*h&&(this.sessionVariables.labelAngle=
|
|
620
620
|
-25))}else(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxHeight=0===this.labelAngle?d:Math.min((b-h*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),b),l=0!=this.labelAngle?(k-(t+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)):h,this.sessionVariables.labelMaxHeight=this.labelWrap?(k-l*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)):
|
|
621
621
|
1.5*this.labelFontSize,n(this.options.labelWrap))?n(this.options.labelWrap)&&(this.labelWrap&&!n(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:l,this.sessionVariables.labelMaxHeight=d):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelMaxHeight=b<0.9*m?0.9*m:b,this.sessionVariables.labelWrap=this.labelWrap)):(this.options.labelWrap?
|
|
622
622
|
(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:l):(n(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:l,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight=d)}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,
|
|
@@ -624,7 +624,7 @@ a.angle=this.labelAngle=this.sessionVariables.labelAngle,a.wrap=this.labelWrap=t
|
|
|
624
624
|
n(this.sessionVariables.labelFontSize)?this.sessionVariables.labelFontSize=this.labelFontSize:this.sessionVariables.labelFontSize:this.options.labelFontSize,a.angle=this.labelAngle=n(this.options.labelAngle)?n(this.sessionVariables.labelAngle)?this.sessionVariables.labelAngle=this.labelAngle:this.sessionVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=n(this.options.labelWrap)?n(this.sessionVariables.labelWrap)?this.sessionVariables.labelWrap=this.labelWrap:this.sessionVariables.labelWrap:
|
|
625
625
|
this.options.labelWrap,a.maxHeight=n(this.sessionVariables.labelMaxHeight)?this.sessionVariables.labelMaxHeight=d:this.sessionVariables.labelMaxHeight,a.measureText();else if("left"===this._position||"right"===this._position)if(h=n(this.options.labelMaxWidth)?0.3*this.chart.width>>0:this.options.labelMaxWidth,d="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=
|
|
626
626
|
this.labelFontSize;this.sessionVariables.labelMaxWidth=h;this.sessionVariables.labelMaxHeight=d;this.sessionVariables.labelAngle=n(this.sessionVariables.labelAngle)?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;A=a.measureText();for(f=c+1;f<this._labels.length;f++)if(!this._labels[f].breaksLabelType){g=this._labels[f].textBlock;g=g.measureText();break}e.push(a.height);
|
|
627
|
-
this.sessionVariables.labelMaxHeight=Math.max.apply(Math,e);b=h*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(d-a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.sin(Math.PI/180*Math.abs(this.labelAngle));n(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle?n(this.options.labelWrap)?n(this.options.labelWrap)&&(n(this.options.labelMaxWidth)?n(g)||(m=A.height+g.height>>0,m-2*d>
|
|
627
|
+
this.sessionVariables.labelMaxHeight=Math.max.apply(Math,e);b=h*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(d-a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.sin(Math.PI/180*Math.abs(this.labelAngle));n(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle?n(this.options.labelWrap)?n(this.options.labelWrap)&&(n(this.options.labelMaxWidth)?n(g)||(m=A.height+g.height>>0,m-2*d>q&&(q=m-2*d,m>=2*d&&
|
|
628
628
|
m<2.4*d?(n(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelFontSize=n(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize):m>=2.4*d&&m<2.8*d?(this.sessionVariables.labelMaxHeight=b,this.sessionVariables.labelFontSize=this.labelFontSize,this.sessionVariables.labelWrap=!0):m>=2.8*d&&m<3.2*d?(this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelWrap=
|
|
629
629
|
!0,n(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=n(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelAngle=n(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):m>=3.2*d&&m<3.6*d?(this.sessionVariables.labelMaxHeight=b,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelFontSize=this.labelFontSize):m>3.6*
|
|
630
630
|
d&&m<10*d?(n(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=n(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelMaxWidth=h,this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelAngle=n(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):m>10*d&&m<50*d&&(n(this.options.labelFontSize)&&12<this.labelFontSize&&
|
|
@@ -639,57 +639,57 @@ if("bottom"===this._position||"top"===this._position)n(h.options.labelWrap)&&!n(
|
|
|
639
639
|
x=h.labelWrap?0.8*this.chart.width>>0:1.5*this.labelFontSize;n(h.labelBackgroundColor)&&(h.labelBackgroundColor="#EEEEEE")}else d="bottom"===this._position||"top"===this._position?0.9*this.chart.width>>0:0.9*this.chart.height>>0,x=n(h.options.labelWrap)||h.labelWrap?"bottom"===this._position||"top"===this._position?0.8*this.chart.width>>0:0.8*this.chart.height>>0:1.5*this.labelFontSize,n(h.labelBackgroundColor)&&(n(h.startValue)&&0!==h.startValue?h.labelBackgroundColor=w?"transparent":null:h.labelBackgroundColor=
|
|
640
640
|
"#EEEEEE");a=new ja(this.ctx,{x:0,y:0,backgroundColor:h.labelBackgroundColor,borderColor:h.labelBorderColor,borderThickness:h.labelBorderThickness,cornerRadius:h.labelCornerRadius,maxWidth:h.options.labelMaxWidth?h.options.labelMaxWidth:d,maxHeight:x,angle:this.labelAngle,text:h.labelFormatter?h.labelFormatter({chart:this.chart,axis:this,stripLine:h}):h.label,textAlign:this.labelTextAlign,fontSize:"outside"===h.labelPlacement?h.options.labelFontSize?h.labelFontSize:this.labelFontSize:h.labelFontSize,
|
|
641
641
|
fontFamily:"outside"===h.labelPlacement?h.options.labelFontFamily?h.labelFontFamily:this.labelFontFamily:h.labelFontFamily,fontWeight:"outside"===h.labelPlacement?h.options.labelFontWeight?h.labelFontWeight:this.labelFontWeight:h.labelFontWeight,fontColor:h.labelFontColor||h.color,fontStyle:"outside"===h.labelPlacement?h.options.labelFontStyle?h.labelFontStyle:this.fontWeight:h.labelFontStyle,textBaseline:"middle"});this._stripLineLabels.push({position:h.value,textBlock:a,effectiveHeight:null,stripLine:h})}};
|
|
642
|
-
A.prototype.createLabelsAndCalculateWidth=function(){var a=0,g=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(g=0;g<this._labels.length;g++){var b=this._labels[g].textBlock,
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
0;f<
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
a[f].
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
A
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
b[f].
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
b[f].lineCoordinates.
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
if(
|
|
691
|
-
|
|
692
|
-
|
|
642
|
+
A.prototype.createLabelsAndCalculateWidth=function(){var a=0,g=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(g=0;g<this._labels.length;g++){var b=this._labels[g].textBlock,b=b.measureText(),e=0,e=0===this.labelAngle?b.width:b.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+b.height*Math.sin(Math.PI/180*Math.abs(this.labelAngle));
|
|
643
|
+
a<e&&(this.labelEffectiveWidth=a=e);this._labels[g].effectiveWidth=e}for(g=0;g<this._stripLineLabels.length;g++)"outside"===this._stripLineLabels[g].stripLine.labelPlacement&&(this._stripLineLabels[g].stripLine.value>=this.viewportMinimum&&this._stripLineLabels[g].stripLine.value<=this.viewportMaximum)&&(b=this._stripLineLabels[g].textBlock,b=b.measureText(),e=0===this.labelAngle?b.width:b.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+b.height*Math.sin(Math.PI/180*Math.abs(this.labelAngle)),
|
|
644
|
+
"inside"===this.tickPlacement&&(e+=this.tickLength),"inside"===this.labelPlacement&&(a+=0<this._index?e:0),a<e&&(a=e),this.stripLineLabelEffectiveWidth=this._stripLineLabels[g].effectiveWidth=e)}return(this.title?this._titleTextBlock.measureText().height+2:0)+a+("inside"===this.tickPlacement?0<this._index?this.tickLength:0:this.tickLength)+c};A.prototype.createLabelsAndCalculateHeight=function(){var a=0;this._labels=[];this._stripLineLabels=[];var g,c=0,b=this.chart.isNavigator?0:5;if("bottom"===
|
|
645
|
+
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++){g=this._labels[c].textBlock;g=g.measureText();var e=0,e=0===this.labelAngle?g.height:g.width*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+g.height*Math.cos(Math.PI/180*Math.abs(this.labelAngle));a<e&&(this.labelEffectiveHeight=a=e);this._labels[c].effectiveHeight=e}for(c=0;c<this._stripLineLabels.length;c++)"outside"===this._stripLineLabels[c].stripLine.labelPlacement&&
|
|
646
|
+
(this._stripLineLabels[c].stripLine.value>=this.viewportMinimum&&this._stripLineLabels[c].stripLine.value<=this.viewportMaximum)&&(g=this._stripLineLabels[c].textBlock,g=g.measureText(),e=0===this.labelAngle?g.height:g.width*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+g.height*Math.cos(Math.PI/180*Math.abs(this.labelAngle)),"inside"===this.tickPlacement&&(e+=this.tickLength),"inside"===this.labelPlacement&&(a+=0<this._index?e:0),a<e&&(a=e),this.stripLineLabelEffectiveHeight=this._stripLineLabels[c].effectiveHeight=
|
|
647
|
+
e)}return(this.title?this._titleTextBlock.measureText().height+2:0)+a+("inside"===this.tickPlacement?0<this._index?this.tickLength:0:this.tickLength)+b};A.setLayout=function(a,g,c,b,e,h){var d,m,t,k,l=a[0]?a[0].chart:g[0].chart,p=l.isNavigator?0:10,q=l._axes;if(a&&0<a.length)for(var f=0;f<a.length;f++)a[f]&&a[f].calculateAxisParameters();if(g&&0<g.length)for(f=0;f<g.length;f++)g[f].calculateAxisParameters();if(c&&0<c.length)for(f=0;f<c.length;f++)c[f].calculateAxisParameters();if(b&&0<b.length)for(f=
|
|
648
|
+
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 w=q[f].scaleBreaks._appliedBreaks,v=0;v<w.length&&!(w[v].startValue>q[f].viewportMaximum);v++)w[v].endValue<q[f].viewportMinimum||(n(q[f].scaleBreaks.firstBreakIndex)&&(q[f].scaleBreaks.firstBreakIndex=v),w[v].startValue>=q[f].viewPortMinimum&&(q[f].scaleBreaks.lastBreakIndex=v));for(var x=v=0,s=0,z=0,u=0,A=0,B=0,D,G,H=m=0,J,K,L,w=J=K=L=!1,f=0;f<q.length;f++)q[f]&&
|
|
649
|
+
q[f].title&&(q[f]._titleTextBlock=new ja(q[f].ctx,{text:q[f].title,horizontalAlign:"center",fontSize:q[f].titleFontSize,fontFamily:q[f].titleFontFamily,fontWeight:q[f].titleFontWeight,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=
|
|
650
|
+
q[f].titleMaxWidth||h.height;q[f]._titleTextBlock.maxHeight=q[f].titleWrap?0.8*h.width:1.5*q[f].titleFontSize;q[f]._titleTextBlock.angle=-90;break;case "right":q[f]._titleTextBlock.maxWidth=q[f].titleMaxWidth||h.height;q[f]._titleTextBlock.maxHeight=q[f].titleWrap?0.8*h.width:1.5*q[f].titleFontSize;q[f]._titleTextBlock.angle=90;break;default:q[f]._titleTextBlock.maxWidth=q[f].titleMaxWidth||h.width,q[f]._titleTextBlock.maxHeight=q[f].titleWrap?0.8*h.height:1.5*q[f].titleFontSize,q[f]._titleTextBlock.angle=
|
|
651
|
+
0}if("normal"===e){for(var z=[],u=[],A=[],B=[],N=[],Q=[],O=[],P=[];4>v;){var E=0,X=0,T=0,S=0,V=e=0,M=0,$=0,W=0,Y=0,R=0,aa=0;if(c&&0<c.length)for(A=[],f=R=0;f<c.length;f++)A.push(Math.ceil(c[f]?c[f].createLabelsAndCalculateWidth():0)),R+=A[f],M+=c[f]&&!l.isNavigator?c[f].margin:0;else A.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateWidth():0));O.push(A);if(b&&0<b.length)for(B=[],f=aa=0;f<b.length;f++)B.push(Math.ceil(b[f]?b[f].createLabelsAndCalculateWidth():0)),aa+=B[f],$+=b[f]?b[f].margin:0;else B.push(Math.ceil(b[0]?
|
|
652
|
+
b[0].createLabelsAndCalculateWidth():0));P.push(B);d=Math.round(h.x1+R+M);t=Math.round(h.x2-aa-$>l.width-p?l.width-p:h.x2-aa-$);if(a&&0<a.length)for(z=[],f=W=0;f<a.length;f++)a[f]&&(a[f].lineCoordinates={}),a[f].lineCoordinates.width=Math.abs(t-d),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),z.push(Math.ceil(a[f]?a[f].createLabelsAndCalculateHeight():0)),W+=z[f],e+=a[f]&&!l.isNavigator?
|
|
653
|
+
a[f].margin:0;else z.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateHeight():0));N.push(z);if(g&&0<g.length)for(u=[],f=Y=0;f<g.length;f++)g[f]&&(g[f].lineCoordinates={}),g[f].lineCoordinates.width=Math.abs(t-d),g[f].title&&(g[f]._titleTextBlock.maxWidth=0<g[f].titleMaxWidth&&g[f].titleMaxWidth<g[f].lineCoordinates.width?g[f].titleMaxWidth:g[f].lineCoordinates.width),u.push(Math.ceil(g[f]?g[f].createLabelsAndCalculateHeight():0)),Y+=u[f],V+=g[f]&&!l.isNavigator?g[f].margin:0;else u.push(Math.ceil(g[0]?
|
|
654
|
+
g[0].createLabelsAndCalculateHeight():0));Q.push(u);if(a&&0<a.length)for(f=0;f<a.length;f++)a[f]&&(a[f].lineCoordinates.x1=d,t=Math.round(h.x2-aa-$>l.width-p?l.width-p:h.x2-aa-$),a[f]._labels&&1<a[f]._labels.length&&(m=k=0,k=a[f]._labels[1],m="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-m.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(k.textBlock.angle)),
|
|
655
|
+
s=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock.height-m.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle))),!a[f]||(!a[f].labelAutoFit||n(D)||n(G)||l.isNavigator||l.stockChart)||(m=0,0<a[f].labelAngle?G+s>t&&(m+=0<a[f].labelAngle?G+s-t-aa:0):0>a[f].labelAngle?D-x<d&&D-x<a[f].viewportMinimum&&(H=d-(M+a[f].tickLength+A+D-x+a[f].labelFontSize/2)):0===a[f].labelAngle&&(G+s>t&&(m=G+s/2-t-aa),D-x<d&&D-x<a[f].viewportMinimum&&(H=d-M-a[f].tickLength-
|
|
656
|
+
A-D+x/2)),a[f].viewportMaximum===a[f].maximum&&a[f].viewportMinimum===a[f].minimum&&0<a[f].labelAngle&&0<m?t-=m:a[f].viewportMaximum===a[f].maximum&&a[f].viewportMinimum===a[f].minimum&&0>a[f].labelAngle&&0<H?d+=H:a[f].viewportMaximum===a[f].maximum&&a[f].viewportMinimum===a[f].minimum&&0===a[f].labelAngle&&(0<H&&(d+=H),0<m&&(t-=m))),l.panEnabled?W=n(l.sessionVariables.axisX.height)||l.stockChart?l.sessionVariables.axisX.height=W:l.sessionVariables.axisX.height:l.sessionVariables.axisX.height=W,m=
|
|
657
|
+
Math.round(h.y2-W-e+E),k=Math.round(h.y2),a[f].lineCoordinates.x2=t,a[f].lineCoordinates.width=t-d,a[f].lineCoordinates.y1=m,a[f].lineCoordinates.y2=m,"inside"===a[f].labelPlacement&&0<f&&(a[f].lineCoordinates.y1=a[f-1].lineCoordinates.y2+E+(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=
|
|
658
|
+
{x1:d,y1:m,x2:t,y2:k-(W+e-z[f]-E),width:t-d},a[f].bounds.height=a[f].bounds.y2-a[f].bounds.y1),E+=z[f]+a[f].margin;if(g&&0<g.length)for(f=0;f<g.length;f++)g[f].lineCoordinates.x1=Math.round(h.x1+R+M),g[f].lineCoordinates.x2=Math.round(h.x2-aa-$>l.width-p?l.width-p:h.x2-aa-$),g[f].lineCoordinates.width=Math.abs(t-d),g[f]._labels&&1<g[f]._labels.length&&(k=g[f]._labels[1],m="dateTime"===g[f].valueType?g[f]._labels[g[f]._labels.length-2]:g[f]._labels[g[f]._labels.length-1],x=k.textBlock.width*Math.cos(Math.PI/
|
|
659
|
+
180*Math.abs(k.textBlock.angle))+(k.textBlock.height-m.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(k.textBlock.angle)),s=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock.height-m.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle))),l.panEnabled?Y=n(l.sessionVariables.axisX2.height)||l.stockChart?l.sessionVariables.axisX2.height=Y:l.sessionVariables.axisX2.height:l.sessionVariables.axisX2.height=Y,m=Math.round(h.y1),k=g[f].lineCoordinates.y1=
|
|
660
|
+
m+Y+V-X,g[f].lineCoordinates.y2=m,"inside"===g[f].labelPlacement&&0<f&&(g[f].lineCoordinates.y1=g[f-1].lineCoordinates.y1-X-(g[f].labelEffectiveHeight||0)),"inside"===g[f].tickPlacement&&0<f&&(g[f].lineCoordinates.y1-=g[f].tickLength),g[f].bounds={x1:d,y1:m+(Y+V-u[f]-X),x2:t,y2:k,width:t-d},g[f].bounds.height=g[f].bounds.y2-g[f].bounds.y1,X+=u[f]+g[f].margin;if(c&&0<c.length)for(f=0;f<c.length;f++)M=l.isNavigator?0:10,c[f]&&(d=Math.round(a[0]?a[0].lineCoordinates.x1:g[0].lineCoordinates.x1),M=c[f]._labels&&
|
|
661
|
+
0<c[f]._labels.length?c[f]._labels[c[f]._labels.length-1].textBlock.height/2:p,m=Math.round(h.y1+Y+V<Math.max(M,p)?Math.max(M,p):h.y1+Y+V),t=Math.round(a[0]?a[0].lineCoordinates.x1:g[0].lineCoordinates.x1),M=0<a.length?0:c[f]._labels&&0<c[f]._labels.length?c[f]._labels[0].textBlock.height/2:p,k=Math.round(h.y2-W-e-M),c[f].lineCoordinates={x1:d-T,y1:m,x2:t-T,y2:k,height:Math.abs(k-m)},"inside"===c[f].labelPlacement&&0<f&&(c[f].lineCoordinates.x1=c[f-1].lineCoordinates.x1-T-(c[f].labelEffectiveWidth||
|
|
662
|
+
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:d-(A[f]+T),y1:m,x2:t-T,y2:k,height:k-m},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),T+=A[f]+c[f].margin);
|
|
663
|
+
if(b&&0<b.length)for(f=0;f<b.length;f++)b[f]&&(d=Math.round(a[0]?a[0].lineCoordinates.x2:g[0].lineCoordinates.x2),t=Math.round(d),M=b[f]._labels&&0<b[f]._labels.length?b[f]._labels[b[f]._labels.length-1].textBlock.height/2:0,m=Math.round(h.y1+Y+V<Math.max(M,p)?Math.max(M,p):h.y1+Y+V),M=0<a.length?0:b[f]._labels&&0<b[f]._labels.length?b[f]._labels[0].textBlock.height/2:0,k=Math.round(h.y2-(W+e+M)),b[f].lineCoordinates={x1:d+S,y1:m,x2:d+S,y2:k,height:Math.abs(k-m)},"inside"===b[f].labelPlacement&&0<
|
|
664
|
+
f&&(b[f].lineCoordinates.x1=b[f-1].lineCoordinates.x2+S+(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=b[f].lineCoordinates.x1+b[f].lineThickness/2),b[f].bounds={x1:d+S,y1:m,x2:t+(B[f]+S),y2:k,height:k-m},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?
|
|
665
|
+
b[f].titleMaxWidth:b[f].lineCoordinates.height),S+=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&&(D=(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,d=a[f]._labels[a[f]._labels.length-
|
|
666
|
+
("dateTime"===a[f].valueType?2:1)].position,d=a[f].getApparentDifference(a[f].viewportMinimum,d),G=a[f].logarithmic?(1<d?Math.log(d)/a[f].conversionParameters.lnLogarithmBase*Math.abs(a[f].conversionParameters.pixelPerUnit):0)+a[f].lineCoordinates.x1:(0<d?d*Math.abs(a[f].conversionParameters.pixelPerUnit):0)+a[f].lineCoordinates.x1));if(g&&0<g.length)for(f=0;f<g.length;f++)g[f].calculateValueToPixelConversionParameters(),g[f].calculateBreaksSizeInValues(),g[f]._labels&&1<g[f]._labels.length&&(D=(g[f].logarithmic?
|
|
667
|
+
Math.log(g[f]._labels[1].position/g[f].viewportMinimum)/g[f].conversionParameters.lnLogarithmBase:g[f]._labels[1].position-g[f].viewportMinimum)*Math.abs(g[f].conversionParameters.pixelPerUnit)+g[f].lineCoordinates.x1,d=g[f]._labels[g[f]._labels.length-("dateTime"===g[f].valueType?2:1)].position,d=g[f].getApparentDifference(g[f].viewportMinimum,d),G=g[f].logarithmic?(1<d?Math.log(d)/g[f].conversionParameters.lnLogarithmBase*Math.abs(g[f].conversionParameters.pixelPerUnit):0)+g[f].lineCoordinates.x1:
|
|
668
|
+
(0<d?d*Math.abs(g[f].conversionParameters.pixelPerUnit):0)+g[f].lineCoordinates.x1);for(f=0;f<q.length;f++)"axisY"===q[f].type&&(q[f].calculateValueToPixelConversionParameters(),q[f].calculateBreaksSizeInValues());if(0<v){if(a&&0<a.length)for(f=0;f<a.length;f++)w=N[v-1][f]===N[v][f]?!0:!1;else w=!0;if(g&&0<g.length)for(f=0;f<g.length;f++)J=Q[v-1][f]===Q[v][f]?!0:!1;else J=!0;if(c&&0<c.length)for(f=0;f<c.length;f++)K=O[v-1][f]===O[v][f]?!0:!1;else K=!0;if(b&&0<b.length)for(f=0;f<b.length;f++)L=P[v-
|
|
669
|
+
1][f]===P[v][f]?!0:!1;else L=!0}if(w&&J&&K&&L)break;v++}if(a&&0<a.length)for(f=0;f<a.length;f++)a[f].calculateStripLinesThicknessInValues(),a[f].calculateBreaksInPixels();if(g&&0<g.length)for(f=0;f<g.length;f++)g[f].calculateStripLinesThicknessInValues(),g[f].calculateBreaksInPixels();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{p=
|
|
670
|
+
[];D=[];H=[];x=[];G=[];s=[];N=[];for(Q=[];4>v;){W=S=T=$=M=V=e=P=O=E=Y=0;if(a&&0<a.length)for(H=[],f=S=0;f<a.length;f++)H.push(Math.ceil(a[f]?a[f].createLabelsAndCalculateWidth():0)),S+=H[f],e+=a[f]&&!l.isNavigator?a[f].margin:0;else H.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateWidth():0));N.push(H);if(g&&0<g.length)for(x=[],f=W=0;f<g.length;f++)x.push(Math.ceil(g[f]?g[f].createLabelsAndCalculateWidth():0)),W+=x[f],V+=g[f]?g[f].margin:0;else x.push(Math.ceil(g[0]?g[0].createLabelsAndCalculateWidth():
|
|
671
|
+
0));Q.push(x);if(c&&0<c.length)for(f=0;f<c.length;f++)c[f].lineCoordinates={},d=Math.round(h.x1+S+e),t=Math.round(h.x2-W-V>l.width-10?l.width-10:h.x2-W-V),c[f].labelAutoFit&&!n(z)&&(0<!a.length&&(d=0>c[f].labelAngle?Math.max(d,z):0===c[f].labelAngle?Math.max(d,z/2):d),0<!g.length&&(t=0<c[f].labelAngle?t-u/2:0===c[f].labelAngle?t-u/2:t)),c[f].lineCoordinates.x1=d,c[f].lineCoordinates.x2=t,c[f].lineCoordinates.width=Math.abs(t-d),c[f].title&&(c[f]._titleTextBlock.maxWidth=0<c[f].titleMaxWidth&&c[f].titleMaxWidth<
|
|
672
|
+
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={},d=Math.round(h.x1+S+e),t=Math.round(h.x2-W-V>b[f].chart.width-10?b[f].chart.width-10:h.x2-W-V),b[f]&&b[f].labelAutoFit&&!n(A)&&(0<!a.length&&(d=0<b[f].labelAngle?Math.max(d,A):0===b[f].labelAngle?Math.max(d,A/2):d),0<!g.length&&(t-=B/2)),b[f].lineCoordinates.x1=d,b[f].lineCoordinates.x2=t,b[f].lineCoordinates.width=Math.abs(t-d),b[f].title&&(b[f]._titleTextBlock.maxWidth=
|
|
673
|
+
0<b[f].titleMaxWidth&&b[f].titleMaxWidth<b[f].lineCoordinates.width?b[f].titleMaxWidth:b[f].lineCoordinates.width);if(c&&0<c.length)for(p=[],f=T=0;f<c.length;f++)p.push(Math.ceil(c[f]?c[f].createLabelsAndCalculateHeight():0)),T+=p[f]+c[f].margin,M+=c[f].margin;else p.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateHeight():0));G.push(p);if(b&&0<b.length)for(D=[],f=0;f<b.length;f++)D.push(Math.ceil(b[f]?b[f].createLabelsAndCalculateHeight():0)),$+=b[f].margin;else D.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateHeight():
|
|
674
|
+
0));s.push(D);if(c&&0<c.length)for(f=0;f<c.length;f++)0<c[f]._labels.length&&(k=c[f]._labels[0],m=c[f]._labels[c[f]._labels.length-1],z=k.textBlock.width*Math.cos(Math.PI/180*Math.abs(k.textBlock.angle))+(k.textBlock.height-m.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(k.textBlock.angle)),u=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock.height-m.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)));if(b&&0<b.length)for(f=0;f<b.length;f++)b[f]&&
|
|
675
|
+
0<b[f]._labels.length&&(k=b[f]._labels[0],m=b[f]._labels[b[f]._labels.length-1],A=k.textBlock.width*Math.cos(Math.PI/180*Math.abs(k.textBlock.angle))+(k.textBlock.height-m.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(k.textBlock.angle)),B=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock.height-m.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)));if(l.panEnabled)for(f=0;f<c.length;f++)p[f]=n(l.sessionVariables.axisY[f].height)?l.sessionVariables.axisY[f].height=
|
|
676
|
+
p[f]:l.sessionVariables.axisY[f].height;else for(f=0;f<c.length;f++)l.sessionVariables.axisY[f].height=p[f];if(c&&0<c.length)for(f=c.length-1;0<=f;f--)m=Math.round(h.y2),k=Math.round(h.y2>c[f].chart.height?c[f].chart.height:h.y2),c[f].lineCoordinates.y1=m-(p[f]+c[f].margin+Y),c[f].lineCoordinates.y2=m-(p[f]+c[f].margin+Y),"inside"===c[f].labelPlacement&&0<f&&(c[f].lineCoordinates.y1=c[f].lineCoordinates.y1+p[f]-(c[f]._titleTextBlock?c[f]._titleTextBlock.height:0)-c[f].tickLength-(c[f].stripLineLabelEffectiveHeight||
|
|
677
|
+
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={x1:d,y1:m-(p[f]+Y+c[f].margin),x2:t,y2:k-(Y+c[f].margin),width:t-d,height:p[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),Y+=p[f]+c[f].margin;if(b&&0<
|
|
678
|
+
b.length)for(f=b.length-1;0<=f;f--)b[f]&&(m=Math.round(h.y1),k=Math.round(h.y1+(D[f]+b[f].margin+E)),b[f].lineCoordinates.y1=k,b[f].lineCoordinates.y2=k,"inside"===b[f].labelPlacement&&0<f&&(b[f].lineCoordinates.y1=k-D[f]+(b[f]._titleTextBlock?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=
|
|
679
|
+
b[f].lineCoordinates.y1-b[f].lineThickness/2),b[f].bounds={x1:d,y1:m+(b[f].margin+E),x2:t,y2:k,width:t-d},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?b[f].titleMaxWidth:b[f].lineCoordinates.width),E+=D[f]+b[f].margin);if(a&&0<a.length)for(f=0;f<a.length;f++){M=a[f]._labels&&0<a[f]._labels.length?a[f]._labels[0].textBlock.fontSize/2:0;d=Math.round(h.x1+e);m=b&&0<b.length?Math.round(b[0]?
|
|
680
|
+
b[0].lineCoordinates.y2:h.y1<Math.max(M,10)?Math.max(M,10):h.y1):h.y1<Math.max(M,10)?Math.max(M,10):h.y1;t=Math.round(h.x1+S+e);k=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y1:h.y2-T>l.height-Math.max(M,10)?l.height-Math.max(M,10):h.y2-T):h.y2>l.height-Math.max(M,10)?l.height-Math.max(M,10):h.y2;if(c&&0<c.length)for(M=0;M<c.length;M++)c[M]&&c[M].labelAutoFit&&(t=c[M].lineCoordinates.x1,d=0>c[M].labelAngle||0===c[M].labelAngle?t-S:d);if(b&&0<b.length)for(M=0;M<b.length;M++)b[M]&&b[M].labelAutoFit&&
|
|
681
|
+
(t=b[M].lineCoordinates.x1,d=t-S);a[f].lineCoordinates={x1:t-O,y1:m,x2:t-O,y2:k,height:Math.abs(k-m)};"inside"===a[f].labelPlacement&&0<f&&(a[f].lineCoordinates.x1=a[f].lineCoordinates.x1-(H[f]-(a[f]._titleTextBlock?a[f]._titleTextBlock.height:0))+a[f].tickLength+(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/
|
|
682
|
+
2);a[f].bounds={x1:t-(H[f]+O),y1:m,x2:t-O,y2:k,height:k-m};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);a[f].calculateValueToPixelConversionParameters();a[f].calculateBreaksSizeInValues();O+=H[f]+a[f].margin}if(g&&0<g.length)for(f=0;f<g.length;f++){M=g[f]._labels&&0<g[f]._labels.length?g[f]._labels[0].textBlock.fontSize/2:0;d=Math.round(h.x1-
|
|
683
|
+
e);m=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y2:h.y1<Math.max(M,10)?Math.max(M,10):h.y1):h.y1<Math.max(M,10)?Math.max(M,10):h.y1;t=Math.round(h.x2-W-V);k=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y1:h.y2-T>l.height-Math.max(M,10)?l.height-Math.max(M,10):h.y2-T):h.y2>l.height-Math.max(M,10)?l.height-Math.max(M,10):h.y2;if(c&&0<c.length)for(M=0;M<c.length;M++)c[M]&&c[M].labelAutoFit&&(t=0>c[M].labelAngle?Math.max(t,z):0===c[M].labelAngle?Math.max(t,z/2):t,d=0>c[M].labelAngle||0===
|
|
684
|
+
c[M].labelAngle?t-W:d);if(b&&0<b.length)for(M=0;M<b.length;M++)b[M]&&b[M].labelAutoFit&&(t=b[M].lineCoordinates.x2,d=t-W);g[f].lineCoordinates={x1:t+P,y1:m,x2:t+P,y2:k,height:Math.abs(k-m)};"inside"===g[f].labelPlacement&&0<f&&(g[f].lineCoordinates.x1=g[f].lineCoordinates.x1+(x[f]-(g[f]._titleTextBlock?g[f]._titleTextBlock.height:0)-2)-g[f].tickLength-(g[f].stripLineLabelEffectiveWidth||0),g[f].lineCoordinates.x2=g[f].lineCoordinates.x1+g[f].lineThickness/2);"inside"===g[f].tickPlacement&&0<f&&(g[f].lineCoordinates.x1+=
|
|
685
|
+
g[f].tickLength,g[f].lineCoordinates.x2=g[f].lineCoordinates.x1+g[f].lineThickness/2);g[f].bounds={x1:g[f].lineCoordinates.x1,y1:m,x2:t+x[f]+P,y2:k,width:t-d,height:k-m};g[f].bounds.width=g[f].bounds.x2-g[f].bounds.x1;g[f].title&&(g[f]._titleTextBlock.maxWidth=0<g[f].titleMaxWidth&&g[f].titleMaxWidth<g[f].lineCoordinates.height?g[f].titleMaxWidth:g[f].lineCoordinates.height);g[f].calculateValueToPixelConversionParameters();g[f].calculateBreaksSizeInValues();P+=x[f]+g[f].margin}for(f=0;f<q.length;f++)"axisY"===
|
|
686
|
+
q[f].type&&(q[f].calculateValueToPixelConversionParameters(),q[f].calculateBreaksSizeInValues());if(0<v){if(a&&0<a.length)for(f=0;f<a.length;f++)w=N[v-1][f]===N[v][f]?!0:!1;else w=!0;if(g&&0<g.length)for(f=0;f<g.length;f++)J=Q[v-1][f]===Q[v][f]?!0:!1;else J=!0;if(c&&0<c.length)for(f=0;f<c.length;f++)K=G[v-1][f]===G[v][f]?!0:!1;else K=!0;if(b&&0<b.length)for(f=0;f<b.length;f++)L=s[v-1][f]===s[v][f]?!0:!1;else L=!0}if(w&&J&&K&&L)break;v++}if(c&&0<c.length)for(f=0;f<c.length;f++)c[f].calculateStripLinesThicknessInValues(),
|
|
687
|
+
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(),a[f].calculateBreaksInPixels();if(g&&0<g.length)for(f=0;f<g.length;f++)g[f].calculateStripLinesThicknessInValues(),g[f].calculateBreaksInPixels()}};A.render=function(a,g,c,b,e){var h=a[0]?a[0].chart:g[0].chart;e=h.ctx;h.alignVerticalAxes&&h.alignVerticalAxes();e.save();e.beginPath();
|
|
688
|
+
a&&a.length&&e.rect(5,a[0].bounds.y1,a[0].chart.width-10,a[a.length-1].bounds.y2);g&&g.length&&e.rect(5,g[g.length-1].bounds.y1,g[0].chart.width-10,g[0].bounds.y2);e.clip();if(a&&0<a.length)for(var d=0;d<a.length;d++)a[d].renderLabelsTicksAndTitle();if(g&&0<g.length)for(d=0;d<g.length;d++)g[d].renderLabelsTicksAndTitle();e.restore();if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderLabelsTicksAndTitle();if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderLabelsTicksAndTitle();h.preparePlotArea();
|
|
689
|
+
h=h.plotArea;e.save();e.beginPath();e.rect(h.x1,h.y1,Math.abs(h.x2-h.x1),Math.abs(h.y2-h.y1));e.clip();if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderStripLinesOfThicknessType("value");if(g&&0<g.length)for(d=0;d<g.length;d++)g[d].renderStripLinesOfThicknessType("value");if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderStripLinesOfThicknessType("value");if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderStripLinesOfThicknessType("value");if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderInterlacedColors();
|
|
690
|
+
if(g&&0<g.length)for(d=0;d<g.length;d++)g[d].renderInterlacedColors();if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderInterlacedColors();if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderInterlacedColors();e.restore();if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderGrid(),w&&(a[d].createMask(),a[d].renderBreaksBackground());if(g&&0<g.length)for(d=0;d<g.length;d++)g[d].renderGrid(),w&&(g[d].createMask(),g[d].renderBreaksBackground());if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderGrid(),
|
|
691
|
+
w&&(c[d].createMask(),c[d].renderBreaksBackground());if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderGrid(),w&&(b[d].createMask(),b[d].renderBreaksBackground());if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderAxisLine();if(g&&0<g.length)for(d=0;d<g.length;d++)g[d].renderAxisLine();if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderAxisLine();if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderAxisLine();if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderStripLinesOfThicknessType("pixel");if(g&&
|
|
692
|
+
0<g.length)for(d=0;d<g.length;d++)g[d].renderStripLinesOfThicknessType("pixel");if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderStripLinesOfThicknessType("pixel");if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderStripLinesOfThicknessType("pixel")};A.prototype.calculateStripLinesThicknessInValues=function(){for(var a=0;a<this.stripLines.length;a++)if(null!==this.stripLines[a].startValue&&null!==this.stripLines[a].endValue){var g=Math.min(this.stripLines[a].startValue,this.stripLines[a].endValue),
|
|
693
693
|
c=Math.max(this.stripLines[a].startValue,this.stripLines[a].endValue),b=this.getApparentDifference(g,c);this.stripLines[a].value=this.convertPixelToValue(Math.abs(this.convertValueToPixel(g)+this.convertValueToPixel(c))/2);this.stripLines[a].thickness=b;this.stripLines[a]._thicknessType="value"}};A.prototype.calculateBreaksSizeInValues=function(){for(var a="left"===this._position||"right"===this._position?this.lineCoordinates.height||this.chart.height:this.lineCoordinates.width||this.chart.width,
|
|
694
694
|
g=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&&!n(this.scaleBreaks.options.spacing),e,h=0;h<g.length;h++)e=b||!n(g[h].options.spacing),g[h].spacing=Ua(g[h].spacing,a,8,e?0.1*a:8,e?0:3)<<0,g[h].size=0>g[h].spacing?0:Math.abs(g[h].spacing/c),this.logarithmic&&(g[h].size=Math.pow(this.logarithmBase,
|
|
695
695
|
g[h].size))};A.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 g=0;g<a.length&&!(a[g].startValue>this.conversionParameters.maximum);g++)a[g].endValue<this.conversionParameters.minimum||(n(this.scaleBreaks.firstBreakIndex)&&(this.scaleBreaks.firstBreakIndex=g),a[g].startValue>=this.conversionParameters.minimum&&
|
|
@@ -697,136 +697,138 @@ g[h].size))};A.prototype.calculateBreaksInPixels=function(){if(!(this.scaleBreak
|
|
|
697
697
|
[],e=0!==this.labelAngle&&360!==this.labelAngle?1:1.2,d,n=this.viewportMaximum,m=this.lineCoordinates.width/Math.log(this.range),k=this._labels.length-1;0<=k;k--){p=this._labels[k];if(p.position<this.viewportMinimum)break;p.position>this.viewportMaximum||!(k===this._labels.length-1||d<Math.log(n/p.position)*m/e)||(c.push(p),n=p.position,d=p.textBlock.width*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.height*Math.abs(Math.sin(Math.PI/180*this.labelAngle)))}this._labels=c}else{for(k=
|
|
698
698
|
0;k<this._labels.length;k++)p=this._labels[k],p.position<this.viewportMinimum||(d=p.textBlock.width*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.height*Math.abs(Math.sin(Math.PI/180*this.labelAngle)),c+=d);c>this.lineCoordinates.width*e&&this.labelAutoFit&&(g=!0)}if("left"===this._position||"right"===this._position)if(this.logarithmic&&!this.equidistantInterval&&this.labelAutoFit){for(var c=[],l,n=this.viewportMaximum,m=this.lineCoordinates.height/Math.log(this.range),k=this._labels.length-
|
|
699
699
|
1;0<=k;k--){p=this._labels[k];if(p.position<this.viewportMinimum)break;p.position>this.viewportMaximum||!(k===this._labels.length-1||l<Math.log(n/p.position)*m)||(c.push(p),n=p.position,l=p.textBlock.height*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.width*Math.abs(Math.sin(Math.PI/180*this.labelAngle)))}this._labels=c}else{for(k=0;k<this._labels.length;k++)p=this._labels[k],p.position<this.viewportMinimum||(l=p.textBlock.height*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.width*
|
|
700
|
-
Math.abs(Math.sin(Math.PI/180*this.labelAngle)),b+=l);b>this.lineCoordinates.height*e&&this.labelAutoFit&&(g=!0)}}this.logarithmic&&(!this.equidistantInterval&&this.labelAutoFit)&&this._labels.sort(function(a,b){return a.position-b.position});var k=0,p,
|
|
701
|
-
this.tickThickness,this.ctx.strokeStyle=this.tickColor,b=1===this.ctx.lineWidth%2?(
|
|
702
|
-
5):(
|
|
703
|
-
p.textBlock.width*Math.
|
|
704
|
-
a.ctx.moveTo(b,
|
|
705
|
-
this.
|
|
706
|
-
this.
|
|
707
|
-
0
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
this.
|
|
711
|
-
|
|
712
|
-
this.
|
|
713
|
-
(this.
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
this.
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
this.
|
|
726
|
-
2?(b.
|
|
727
|
-
|
|
728
|
-
c.textBlock.
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
this.
|
|
732
|
-
|
|
733
|
-
2:
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
this.
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
this.
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
if(
|
|
750
|
-
Math.log(b)/Math.log(e[c].size));break}else a*=e[c].
|
|
751
|
-
e[c].startValue,1
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
e[c
|
|
755
|
-
e[c].
|
|
756
|
-
g=!1}else break;else if(b
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
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
|
|
765
|
-
c*(1-parseFloat(a[e].spacing)/100*(a[e].endValue
|
|
766
|
-
a[e].startValue)/(a[e].endValue
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
this.
|
|
772
|
-
this.
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
"
|
|
776
|
-
|
|
777
|
-
this.
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
2,this.intervalType="
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
this.
|
|
793
|
-
|
|
794
|
-
this.options.
|
|
795
|
-
|
|
796
|
-
null
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
Math.
|
|
808
|
-
|
|
809
|
-
0<
|
|
810
|
-
|
|
811
|
-
a.setSeconds(0),a.setMilliseconds(0))
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
this.
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
700
|
+
Math.abs(Math.sin(Math.PI/180*this.labelAngle)),b+=l);b>this.lineCoordinates.height*e&&this.labelAutoFit&&(g=!0)}}this.logarithmic&&(!this.equidistantInterval&&this.labelAutoFit)&&this._labels.sort(function(a,b){return a.position-b.position});var k=0,p,q;if("bottom"===this._position){for(k=0;k<this._labels.length;k++)p=this._labels[k],p.position<this.viewportMinimum||p.position>this.viewportMaximum||(q=this.getPixelCoordinatesOnAxis(p.position),this.tickThickness&&"inside"!=this.tickPlacement&&(this.ctx.lineWidth=
|
|
701
|
+
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()),g&&0!==h++%2&&this.labelAutoFit||(0===p.textBlock.angle?(q.x-=p.textBlock.width/2,q.y="inside"===this.labelPlacement?q.y-(("inside"===this.tickPlacement?this.tickLength:0)+p.textBlock.height-p.textBlock.fontSize/2):q.y+("inside"===this.tickPlacement?0:this.tickLength)+p.textBlock.fontSize/2+
|
|
702
|
+
5):0>this.labelAngle?(q.x-="inside"===this.labelPlacement?0:p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle),q.y="inside"===this.labelPlacement?q.y-("inside"===this.tickPlacement?this.tickLength:0)-5-(p.textBlock.height-p.textBlock.fontSize/2)*Math.cos(Math.PI/180*this.labelAngle):q.y+("inside"===this.tickPlacement?0:this.tickLength)+5+Math.abs(p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)-p.textBlock.fontSize/2*Math.cos(Math.PI/180*this.labelAngle))):(q.x-="inside"===this.labelPlacement?
|
|
703
|
+
p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,q.y="inside"===this.labelPlacement?q.y-("inside"===this.tickPlacement?this.tickLength:0)-5-p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)-(p.textBlock.height-p.textBlock.fontSize/2)*Math.cos(Math.PI/180*this.labelAngle):q.y+("inside"===this.tickPlacement?0:this.tickLength)+5+Math.abs(p.textBlock.fontSize/2*Math.cos(Math.PI/180*this.labelAngle))),p.textBlock.x=q.x,p.textBlock.y=q.y));"inside"===this.tickPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",
|
|
704
|
+
function(){for(k=0;k<a._labels.length;k++)if(p=a._labels[k],!(p.position<a.viewportMinimum||p.position>a.viewportMaximum)&&(q=a.getPixelCoordinatesOnAxis(p.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+
|
|
705
|
+
this.lineCoordinates.width/2-this._titleTextBlock.width/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++)p=this._labels[k],p.position<this.viewportMinimum||p.position>this.viewportMaximum||(q=this.getPixelCoordinatesOnAxis(p.position),this.tickThickness&&"inside"!=this.tickPlacement&&(this.ctx.lineWidth=
|
|
706
|
+
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()),g&&0!==h++%2&&this.labelAutoFit||(0===p.textBlock.angle?(q.x-=p.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)+p.textBlock.height-p.textBlock.fontSize/2)):
|
|
707
|
+
0>this.labelAngle?(q.x-="inside"===this.labelPlacement?p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,q.y="inside"===this.labelPlacement?q.y+("inside"===this.tickPlacement?this.tickLength:0)+5-p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)+p.textBlock.fontSize/2*Math.cos(Math.PI/180*this.labelAngle):q.y-("inside"===this.tickPlacement?0:this.tickLength)-2-(p.textBlock.height-p.textBlock.fontSize/2)*Math.cos(Math.PI/180*this.labelAngle)):(q.x-="inside"===this.labelPlacement?0:p.textBlock.width*
|
|
708
|
+
Math.cos(Math.PI/180*this.labelAngle),q.y="inside"===this.labelPlacement?q.y+("inside"===this.tickPlacement?this.tickLength:0)+5+p.textBlock.fontSize/2*Math.cos(Math.PI/180*this.labelAngle):q.y-("inside"===this.tickPlacement?0:this.tickLength)-2-((p.textBlock.height-p.textBlock.fontSize/2)*Math.cos(Math.PI/180*this.labelAngle)+p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle))),p.textBlock.x=q.x,p.textBlock.y=q.y));"inside"===this.tickPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",
|
|
709
|
+
function(){for(k=0;k<a._labels.length;k++)if(p=a._labels[k],!(p.position<a.viewportMinimum||p.position>a.viewportMaximum)&&(q=a.getPixelCoordinatesOnAxis(p.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+
|
|
710
|
+
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"===this._position){for(k=0;k<this._labels.length;k++)p=this._labels[k],p.position<this.viewportMinimum||p.position>this.viewportMaximum||(q=this.getPixelCoordinatesOnAxis(p.position),this.tickThickness&&"inside"!=this.tickPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=
|
|
711
|
+
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()),g&&0!==h++%2&&this.labelAutoFit||(0===this.labelAngle?(p.textBlock.y=q.y,p.textBlock.x="inside"===this.labelPlacement?q.x+("inside"===this.tickPlacement?this.tickLength:0)+5:q.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-("inside"===this.tickPlacement?0:this.tickLength)-5):0>this.labelAngle?(p.textBlock.y="inside"===
|
|
712
|
+
this.labelPlacement?q.y:q.y-p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),p.textBlock.x="inside"===this.labelPlacement?q.x-p.textBlock.fontSize/2*Math.sin(Math.PI/180*this.labelAngle)+("inside"===this.tickPlacement?this.tickLength:0)+5:q.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+(p.textBlock.height-p.textBlock.fontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-("inside"===this.tickPlacement?0:this.tickLength)-5):(p.textBlock.y="inside"===this.labelPlacement?q.y:q.y-p.textBlock.width*
|
|
713
|
+
Math.sin(Math.PI/180*this.labelAngle),p.textBlock.x="inside"===this.labelPlacement?q.x+(p.textBlock.height-p.textBlock.fontSize/2)*Math.sin(Math.PI/180*this.labelAngle)+("inside"===this.tickPlacement?this.tickLength:0)+5:q.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-p.textBlock.fontSize/2*Math.sin(Math.PI/180*this.labelAngle)-("inside"===this.tickPlacement?0:this.tickLength)-5)));"inside"===this.tickPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(k=
|
|
714
|
+
0;k<a._labels.length;k++)if(p=a._labels[k],!(p.position<a.viewportMinimum||p.position>a.viewportMaximum)&&(q=a.getPixelCoordinatesOnAxis(p.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.x1+this._titleTextBlock.fontSize/
|
|
715
|
+
2+1,this._titleTextBlock.y=this.lineCoordinates.height/2+this._titleTextBlock.width/2+this.lineCoordinates.y1,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("right"===this._position){for(k=0;k<this._labels.length;k++)p=this._labels[k],p.position<this.viewportMinimum||p.position>this.viewportMaximum||(q=this.getPixelCoordinatesOnAxis(p.position),this.tickThickness&&"inside"!=this.tickPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,
|
|
716
|
+
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()),g&&0!==h++%2&&this.labelAutoFit||(0===this.labelAngle?(p.textBlock.y=q.y,p.textBlock.x="inside"===this.labelPlacement?q.x-p.textBlock.width-("inside"===this.tickPlacement?this.tickLength:0)-5:q.x+("inside"===this.tickPlacement?0:this.tickLength)+5):0>this.labelAngle?(p.textBlock.y="inside"===this.labelPlacement?q.y-p.textBlock.width*Math.sin(Math.PI/
|
|
717
|
+
180*this.labelAngle):q.y,p.textBlock.x="inside"===this.labelPlacement?q.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+(p.textBlock.height-p.textBlock.fontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-("inside"===this.tickPlacement?this.tickLength:0)-5:q.x-p.textBlock.fontSize/2*Math.sin(Math.PI/180*this.labelAngle)+("inside"===this.tickPlacement?0:this.tickLength)+5):(p.textBlock.y="inside"===this.labelPlacement?q.y-p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):q.y,p.textBlock.x=
|
|
718
|
+
"inside"===this.labelPlacement?q.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-p.textBlock.fontSize/2*Math.sin(Math.PI/180*this.labelAngle)-("inside"===this.tickPlacement?this.tickLength:0)-5:q.x+(p.textBlock.height-p.textBlock.fontSize/2)*Math.sin(Math.PI/180*this.labelAngle)+("inside"===this.tickPlacement?0:this.tickLength)+5)));"inside"===this.tickPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(k=0;k<a._labels.length;k++)if(p=a._labels[k],!(p.position<
|
|
719
|
+
a.viewportMinimum||p.position>a.viewportMaximum)&&(q=a.getPixelCoordinatesOnAxis(p.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=this.lineCoordinates.height/
|
|
720
|
+
2-this._titleTextBlock.width/2+this.lineCoordinates.y1,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}h=0;if("inside"===this.labelPlacement)this.chart.addEventListener("dataAnimationIterationEnd",function(){for(k=0;k<a._labels.length;k++)p=a._labels[k],p.position<a.viewportMinimum||(p.position>a.viewportMaximum||g&&0!==h++%2&&a.labelAutoFit)||(a.ctx.save(),a.ctx.beginPath(),p.textBlock.render(!0),a.ctx.restore())},this);else for(k=0;k<this._labels.length;k++)p=this._labels[k],
|
|
721
|
+
p.position<this.viewportMinimum||(p.position>this.viewportMaximum||g&&0!==h++%2&&this.labelAutoFit)||p.textBlock.render(!0)};A.prototype.renderInterlacedColors=function(){var a=this.chart.plotArea.ctx,g,c,b=this.chart.plotArea,e=0;g=!0;if(("bottom"===this._position||"top"===this._position)&&this.interlacedColor)for(a.fillStyle=this.interlacedColor,e=0;e<this._labels.length;e++)g?(g=this.getPixelCoordinatesOnAxis(this._labels[e].position),c=e+1>this._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):
|
|
722
|
+
this.getPixelCoordinatesOnAxis(this._labels[e+1].position),a.fillRect(Math.min(c.x,g.x),b.y1,Math.abs(c.x-g.x),Math.abs(b.y1-b.y2)),g=!1):g=!0;else if(("left"===this._position||"right"===this._position)&&this.interlacedColor)for(a.fillStyle=this.interlacedColor,e=0;e<this._labels.length;e++)g?(c=this.getPixelCoordinatesOnAxis(this._labels[e].position),g=e+1>this._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[e+1].position),a.fillRect(b.x1,
|
|
723
|
+
Math.min(c.y,g.y),Math.abs(b.x1-b.x2),Math.abs(g.y-c.y)),g=!1):g=!0;a.beginPath()};A.prototype.renderStripLinesOfThicknessType=function(a){if(this.stripLines&&0<this.stripLines.length&&a){var g=this,c,b,e=0,h=0,d=!1;b=!1;for(var m=[],t=[],k=!1,e=0;e<this.stripLines.length;e++){var l=this.stripLines[e];l._thicknessType===a&&("pixel"===a&&(l.value<this.viewportMinimum||l.value>this.viewportMaximum||n(l.value)||isNaN(this.range))||"value"===a&&(l.startValue<=this.viewportMinimum&&l.endValue<=this.viewportMinimum||
|
|
724
|
+
l.startValue>=this.viewportMaximum&&l.endValue>=this.viewportMaximum||n(l.startValue)||n(l.endValue)||isNaN(this.range))||m.push(l))}for(e=0;e<this._stripLineLabels.length;e++)if(l=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){l&&(this.ctx.strokeStyle=l.color,this.ctx.lineWidth="pixel"===l._thicknessType?l.thickness:this.tickThickness);
|
|
725
|
+
if("bottom"===this._position){var p=1===this.ctx.lineWidth%2?(b.x<<0)+0.5:b.x<<0;this.ctx.beginPath();this.ctx.moveTo(p,b.y<<0);this.ctx.lineTo(p,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+5+(0>this.labelAngle?Math.abs(c.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)-c.textBlock.fontSize/2*Math.cos(Math.PI/
|
|
726
|
+
180*this.labelAngle)):Math.abs(c.textBlock.fontSize/2*Math.cos(Math.PI/180*this.labelAngle))))}else"top"===this._position?(p=1===this.ctx.lineWidth%2?(b.x<<0)+0.5:b.x<<0,this.ctx.beginPath(),this.ctx.moveTo(p,b.y<<0),this.ctx.lineTo(p,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-=0<this.labelAngle?c.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,b.y-=this.tickLength+2+(0<this.labelAngle?
|
|
727
|
+
(c.textBlock.height-c.textBlock.fontSize/2)*Math.cos(Math.PI/180*this.labelAngle)+c.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):(c.textBlock.height-c.textBlock.fontSize/2)*Math.cos(Math.PI/180*this.labelAngle)))):"left"===this._position?(p=1===this.ctx.lineWidth%2?(b.y<<0)+0.5:b.y<<0,this.ctx.beginPath(),this.ctx.moveTo(b.x<<0,p),this.ctx.lineTo(b.x-this.tickLength<<0,p),this.ctx.stroke(),0===this.labelAngle?b.x=b.x-c.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-
|
|
728
|
+
5:(b.y-=c.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),b.x-=this.tickLength+5+(0<this.labelAngle?c.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+c.textBlock.fontSize/2*Math.sin(Math.PI/180*this.labelAngle):c.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-(c.textBlock.height-c.textBlock.fontSize/2)*Math.sin(Math.PI/180*this.labelAngle)))):"right"===this._position&&(p=1===this.ctx.lineWidth%2?(b.y<<0)+0.5:b.y<<0,this.ctx.beginPath(),this.ctx.moveTo(b.x<<0,p),this.ctx.lineTo(b.x+
|
|
729
|
+
this.tickLength<<0,p),this.ctx.stroke(),b.x=0===this.labelAngle?b.x+this.tickLength+5:this.tickLength+5+(0<this.labelAngle?b.x+(c.textBlock.height-c.textBlock.fontSize/2)*Math.sin(Math.PI/180*this.labelAngle):b.x-c.textBlock.fontSize/2*Math.sin(Math.PI/180*this.labelAngle)));c.textBlock.x=b.x;c.textBlock.y=b.y;t.push(c)}else l._thicknessType===a&&(c.textBlock.angle=-90,"bottom"===this._position?(c.textBlock.maxWidth=this.options.stripLines[e].labelMaxWidth?this.options.stripLines[e].labelMaxWidth:
|
|
730
|
+
this.chart.plotArea.height-3,c.textBlock.measureText(),b.x-c.textBlock.height-l.thickness/2>this.chart.plotArea.x1?n(l.startValue)?b.x-=c.textBlock.height-c.textBlock.fontSize/2+l.thickness/2:b.x-=c.textBlock.height/2-c.textBlock.fontSize/2:(c.textBlock.angle=90,n(l.startValue)?b.x+=c.textBlock.height-c.textBlock.fontSize/2+l.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?
|
|
731
|
+
(this.chart.plotArea.y2+this.chart.plotArea.y1+c.textBlock.width)/2:this.chart.plotArea.y1+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-
|
|
732
|
+
l.thickness/2>this.chart.plotArea.x1?n(l.startValue)?b.x-=c.textBlock.height-c.textBlock.fontSize/2+l.thickness/2:b.x-=c.textBlock.height/2-c.textBlock.fontSize/2:(c.textBlock.angle=90,n(l.startValue)?b.x+=c.textBlock.height-c.textBlock.fontSize/2+l.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)/
|
|
733
|
+
2:this.chart.plotArea.y2-3:"near"===c.stripLine.labelAlign?this.chart.plotArea.y1+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-l.thickness/2>this.chart.plotArea.y1?n(l.startValue)?
|
|
734
|
+
b.y-=c.textBlock.height-c.textBlock.fontSize/2+l.thickness/2:b.y-=c.textBlock.height/2-c.textBlock.fontSize/2:n(l.startValue)?b.y+=c.textBlock.height-c.textBlock.fontSize/2+l.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?
|
|
735
|
+
this.options.stripLines[e].labelMaxWidth:this.chart.plotArea.width-3,c.textBlock.angle=0,c.textBlock.measureText(),b.y-c.textBlock.height-l.thickness/2>this.chart.plotArea.y1?n(l.startValue)?b.y-=c.textBlock.height-c.textBlock.fontSize/2+l.thickness/2:b.y-=c.textBlock.height/2-c.textBlock.fontSize/2:n(l.startValue)?b.y+=c.textBlock.height-c.textBlock.fontSize/2+l.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-
|
|
736
|
+
3:"center"===c.stripLine.labelAlign?(this.chart.plotArea.x2+this.chart.plotArea.x1)/2-c.textBlock.width/2:this.chart.plotArea.x1+3),c.textBlock.x=b.x,c.textBlock.y=b.y,t.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<m.length;e++)l=m[e],l.showOnTop?d||(d=!0,this.chart.addEventListener("dataAnimationIterationEnd",function(){this.ctx.save();this.ctx.beginPath();
|
|
737
|
+
this.ctx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.ctx.clip();for(h=0;h<m.length;h++)l=m[h],l.showOnTop&&l.render();this.ctx.restore()},l)):l.render();for(e=0;e<t.length;e++)c=t[e],c.stripLine.showOnTop?b||(b=!0,this.chart.addEventListener("dataAnimationIterationEnd",function(){for(h=0;h<t.length;h++)c=t[h],"inside"===c.stripLine.labelPlacement&&c.stripLine.showOnTop&&(g.ctx.save(),g.ctx.beginPath(),g.ctx.rect(g.chart.plotArea.x1,
|
|
738
|
+
g.chart.plotArea.y1,g.chart.plotArea.width,g.chart.plotArea.height),g.ctx.clip(),c.textBlock.render(!0),g.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<t.length;e++)c=t[e],"outside"===c.stripLine.labelPlacement&&c.textBlock.render(!0)}};A.prototype.renderBreaksBackground=function(){this.chart._breaksCanvas&&(this.scaleBreaks&&0<this.scaleBreaks._appliedBreaks.length&&this.maskCanvas)&&(this.chart._breaksCanvasCtx.save(),
|
|
739
|
+
this.chart._breaksCanvasCtx.beginPath(),this.chart._breaksCanvasCtx.rect(this.chart.plotArea.x1,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())};A.prototype.createMask=function(){if(this.scaleBreaks&&0<this.scaleBreaks._appliedBreaks.length){var a=this.scaleBreaks._appliedBreaks;w?(this.maskCanvas=ua(this.chart.width,
|
|
740
|
+
this.chart.height),this.maskCtx=this.maskCanvas.getContext("2d")):(this.maskCanvas=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 g=0;g<a.length;g++)a[g].endValue<this.viewportMinimum||(a[g].startValue>this.viewportMaximum||isNaN(this.range))||a[g].render(this.maskCtx);this.maskCtx.restore()}};
|
|
741
|
+
A.prototype.renderCrosshair=function(a,g){isFinite(this.minimum)&&isFinite(this.maximum)&&this.crosshair.render(a,g)};A.prototype.showCrosshair=function(a){n(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))};A.prototype.renderGrid=function(){if(this.gridThickness&&0<this.gridThickness){var a=this.chart.ctx;a.save();var g,c=this.chart.plotArea;
|
|
742
|
+
a.lineWidth=this.gridThickness;a.strokeStyle=this.gridColor;a.setLineDash&&a.setLineDash(G(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(),g=this.getPixelCoordinatesOnAxis(this._labels[b].position),g=1===a.lineWidth%2?(g.x<<0)+0.5:g.x<<0,a.moveTo(g,c.y1<<0),a.lineTo(g,c.y2<<0),a.stroke());
|
|
743
|
+
else if("left"===this._position||"right"===this._position)for(var 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(),g=this.getPixelCoordinatesOnAxis(this._labels[b].position),g=1===a.lineWidth%2?(g.y<<0)+0.5:g.y<<0,a.moveTo(c.x1<<0,g),a.lineTo(c.x2<<0,g),a.stroke());a.restore()}};A.prototype.renderAxisLine=function(){var a=this.chart.ctx,g=w?this.chart._preRenderCtx:a,c=Math.ceil(this.tickThickness/
|
|
744
|
+
(this.reversed?-2:2)),b=Math.ceil(this.tickThickness/(this.reversed?2:-2)),e,h;g.save();if("bottom"===this._position||"top"===this._position){if(this.lineThickness){this.reversed?(e=this.lineCoordinates.x2,h=this.lineCoordinates.x1):(e=this.lineCoordinates.x1,h=this.lineCoordinates.x2);g.lineWidth=this.lineThickness;g.strokeStyle=this.lineColor?this.lineColor:"black";g.setLineDash&&g.setLineDash(G(this.lineDashType,this.lineThickness));var d=1===this.lineThickness%2?(this.lineCoordinates.y1<<0)+0.5:
|
|
745
|
+
this.lineCoordinates.y1<<0;g.beginPath();if(this.scaleBreaks&&!n(this.scaleBreaks.firstBreakIndex))if(n(this.scaleBreaks.lastBreakIndex))e=this.scaleBreaks._appliedBreaks[this.scaleBreaks.firstBreakIndex].endPixel+b;else for(var m=this.scaleBreaks.firstBreakIndex;m<=this.scaleBreaks.lastBreakIndex;m++)g.moveTo(e,d),g.lineTo(this.scaleBreaks._appliedBreaks[m].startPixel+c,d),e=this.scaleBreaks._appliedBreaks[m].endPixel+b;e&&(g.moveTo(e,d),g.lineTo(h,d));g.stroke()}}else if(("left"===this._position||
|
|
746
|
+
"right"===this._position)&&this.lineThickness){this.reversed?(e=this.lineCoordinates.y1,h=this.lineCoordinates.y2):(e=this.lineCoordinates.y2,h=this.lineCoordinates.y1);g.lineWidth=this.lineThickness;g.strokeStyle=this.lineColor;g.setLineDash&&g.setLineDash(G(this.lineDashType,this.lineThickness));d=1===this.lineThickness%2?(this.lineCoordinates.x1<<0)+0.5:this.lineCoordinates.x1<<0;g.beginPath();if(this.scaleBreaks&&!n(this.scaleBreaks.firstBreakIndex))if(n(this.scaleBreaks.lastBreakIndex))e=this.scaleBreaks._appliedBreaks[this.scaleBreaks.firstBreakIndex].endPixel+
|
|
747
|
+
c;else for(m=this.scaleBreaks.firstBreakIndex;m<=this.scaleBreaks.lastBreakIndex;m++)g.moveTo(d,e),g.lineTo(d,this.scaleBreaks._appliedBreaks[m].startPixel+b),e=this.scaleBreaks._appliedBreaks[m].endPixel+c;e&&(g.moveTo(d,e),g.lineTo(d,h));g.stroke()}w&&(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),g.clearRect(0,0,this.chart.width,
|
|
748
|
+
this.chart.height));g.restore()};A.prototype.getPixelCoordinatesOnAxis=function(a){var g={};if("bottom"===this._position||"top"===this._position)g.x=this.convertValueToPixel(a),g.y=this.lineCoordinates.y1;if("left"===this._position||"right"===this._position)g.y=this.convertValueToPixel(a),g.x=this.lineCoordinates.x2;return g};A.prototype.convertPixelToValue=function(a){if("undefined"===typeof a)return null;var g=0,c=0,b,g=!0,e=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],c="number"===typeof a?
|
|
749
|
+
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(g)if(e[c].startValue<this.conversionParameters.minimum){if(1<e[c].size&&this.conversionParameters.minimum*Math.pow(e[c].endValue/
|
|
750
|
+
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));g=!1}else if(b>e[c].startValue/this.conversionParameters.minimum){b/=
|
|
751
|
+
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;g=!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=
|
|
752
|
+
e.length-1;0<=c;c--)if(!(e[c].startValue>this.conversionParameters.minimum))if(g)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/
|
|
753
|
+
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));g=!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;g=!1}else break;else if(b<e[c].endValue/e[c+1].startValue){b/=e[c].endValue/
|
|
754
|
+
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;g=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(g)if(e[c].startValue<
|
|
755
|
+
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);g=!1}else if(b>e[c].startValue-this.conversionParameters.minimum){b-=
|
|
756
|
+
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;g=!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>
|
|
757
|
+
this.conversionParameters.minimum))if(g)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),
|
|
758
|
+
g=!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;g=!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;
|
|
759
|
+
b+=e[c].size}else break;g=this.conversionParameters.minimum+a}return g};A.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)+
|
|
760
|
+
0.5<<0:this.conversionParameters.reference+this.conversionParameters.pixelPerUnit*(a-this.conversionParameters.minimum)+0.5};A.prototype.getApparentDifference=function(a,g,c,b){var e=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[];if(this.logarithmic){c=n(c)?g/a:c;for(var h=0;h<e.length&&!(g<e[h].startValue);h++)a>e[h].endValue||(a<=e[h].startValue&&g>=e[h].endValue?c=c/e[h].endValue*e[h].startValue*e[h].size:a>=e[h].startValue&&g>=e[h].endValue?c=c/e[h].endValue*a*Math.pow(e[h].size,Math.log(e[h].endValue/
|
|
761
|
+
a)/Math.log(e[h].endValue/e[h].startValue)):a<=e[h].startValue&&g<=e[h].endValue?c=c/g*e[h].startValue*Math.pow(e[h].size,Math.log(g/e[h].startValue)/Math.log(e[h].endValue/e[h].startValue)):!b&&(a>e[h].startValue&&g<e[h].endValue)&&(c=a*Math.pow(e[h].size,Math.log(g/a)/Math.log(e[h].endValue/e[h].startValue))))}else for(c=n(c)?Math.abs(g-a):c,h=0;h<e.length&&!(g<e[h].startValue);h++)a>e[h].endValue||(a<=e[h].startValue&&g>=e[h].endValue?c=c-e[h].endValue+e[h].startValue+e[h].size:a>e[h].startValue&&
|
|
762
|
+
g>=e[h].endValue?c=c-e[h].endValue+a+e[h].size*(e[h].endValue-a)/(e[h].endValue-e[h].startValue):a<=e[h].startValue&&g<e[h].endValue?c=c-g+e[h].startValue+e[h].size*(g-e[h].startValue)/(e[h].endValue-e[h].startValue):!b&&(a>e[h].startValue&&g<e[h].endValue)&&(c=a+e[h].size*(g-a)/(e[h].endValue-e[h].startValue)));return c};A.prototype.setViewPortRange=function(a,g){this.sessionVariables.newViewportMinimum=this.viewportMinimum=Math.min(a,g);this.sessionVariables.newViewportMaximum=this.viewportMaximum=
|
|
763
|
+
Math.max(a,g)};A.prototype.getXValueAt=function(a){if(!a)return null;var g=null;"left"===this._position?g=this.convertPixelToValue(a.y):"bottom"===this._position&&(g=this.convertPixelToValue(a.x));return g};A.prototype.calculateValueToPixelConversionParameters=function(a){a=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[];var g={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);
|
|
764
|
+
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/
|
|
765
|
+
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)/
|
|
766
|
+
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,
|
|
767
|
+
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&&
|
|
768
|
+
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)));g.minimum=this.viewportMinimum;g.maximum=this.viewportMaximum;g.range=b;if("bottom"===this._position||"top"===this._position)this.logarithmic?(g.lnLogarithmBase=Math.log(this.logarithmBase),
|
|
769
|
+
g.pixelPerUnit=(this.reversed?-1:1)*c*g.lnLogarithmBase/Math.log(Math.abs(b))):g.pixelPerUnit=(this.reversed?-1:1)*c/Math.abs(b),g.reference=this.reversed?this.lineCoordinates.x2:this.lineCoordinates.x1;if("left"===this._position||"right"===this._position)this.logarithmic?(g.lnLogarithmBase=Math.log(this.logarithmBase),g.pixelPerUnit=(this.reversed?1:-1)*c*g.lnLogarithmBase/Math.log(Math.abs(b))):g.pixelPerUnit=(this.reversed?1:-1)*c/Math.abs(b),g.reference=this.reversed?this.lineCoordinates.y1:this.lineCoordinates.y2;
|
|
770
|
+
this.conversionParameters=g};A.prototype.calculateAxisParameters=function(){if(this.logarithmic)this.calculateLogarithmicAxisParameters();else{var a=this.chart.layoutManager.getFreeSpace(),g=!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&&
|
|
771
|
+
(b=600>this.maxWidth?8:6);var a=Math.max(b,Math.floor(this.maxWidth/a)),e,h,d,b=0;!n(this.options.viewportMinimum)&&(!n(this.options.viewportMaximum)&&this.options.viewportMinimum>=this.options.viewportMaximum)&&(this.viewportMinimum=this.viewportMaximum=null);if(n(this.options.viewportMinimum)&&!n(this.sessionVariables.newViewportMinimum)&&!isNaN(this.sessionVariables.newViewportMinimum))this.viewportMinimum=this.sessionVariables.newViewportMinimum;else if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=
|
|
772
|
+
this.minimum;if(n(this.options.viewportMaximum)&&!n(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((!n(this.sessionVariables.newViewportMinimum)&&this.sessionVariables.newViewportMinimum>=this.scaleBreaks._appliedBreaks[b].startValue||
|
|
773
|
+
!n(this.options.minimum)&&this.options.minimum>=this.scaleBreaks._appliedBreaks[b].startValue||!n(this.options.viewportMinimum)&&this.viewportMinimum>=this.scaleBreaks._appliedBreaks[b].startValue)&&(!n(this.sessionVariables.newViewportMaximum)&&this.sessionVariables.newViewportMaximum<=this.scaleBreaks._appliedBreaks[b].endValue||!n(this.options.maximum)&&this.options.maximum<=this.scaleBreaks._appliedBreaks[b].endValue||!n(this.options.viewportMaximum)&&this.viewportMaximum<=this.scaleBreaks._appliedBreaks[b].endValue)){this.scaleBreaks._appliedBreaks.splice(b,
|
|
774
|
+
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;h=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax;0===h-e&&(b="undefined"===typeof this.options.interval?0.4:this.options.interval,h+=b,e-=b);Infinity!==this.dataInfo.minDiff?d=this.dataInfo.minDiff:1<h-e?d=0.5*Math.abs(h-e):(d=1,c&&
|
|
775
|
+
(g=!0))}else"axisY"===this.type&&(e=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,h=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,isFinite(e)||isFinite(h)?isFinite(e)?isFinite(h)||(h=e):e=h:(h="undefined"===typeof this.options.interval?-Infinity:this.options.interval,e="undefined"!==typeof this.options.interval||isFinite(this.dataInfo.minDiff)?0:Infinity),0===e&&0===h?(h+=9,e=0):0===h-e?(b=Math.min(Math.abs(0.01*Math.abs(h)),5),h+=b,e-=b):
|
|
776
|
+
e>h?(b=Math.min(0.01*Math.abs(this.getApparentDifference(h,e,null,!0)),5),0<=h?e=h-b:h=isFinite(e)?e+b:0):(b=Math.min(0.01*Math.abs(this.getApparentDifference(e,h,null,!0)),0.05),0!==h&&(h+=b),0!==e&&(e-=b)),d=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1<h-e?0.5*Math.abs(h-e):1,this.includeZero&&(null===this.viewportMinimum||isNaN(this.viewportMinimum))&&0<e&&(e=0),this.includeZero&&(null===this.viewportMaximum||isNaN(this.viewportMaximum))&&0>h&&(h=0));b=this.getApparentDifference(isNaN(this.viewportMinimum)||
|
|
777
|
+
null===this.viewportMinimum?e:this.viewportMinimum,isNaN(this.viewportMaximum)||null===this.viewportMaximum?h: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"):
|
|
778
|
+
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*L.secondDuration)<=a?(this.interval=1,this.intervalType="second"):b/(2*
|
|
779
|
+
L.secondDuration)<=a?(this.interval=2,this.intervalType="second"):b/(5*L.secondDuration)<=a?(this.interval=5,this.intervalType="second"):b/(10*L.secondDuration)<=a?(this.interval=10,this.intervalType="second"):b/(15*L.secondDuration)<=a?(this.interval=15,this.intervalType="second"):b/(20*L.secondDuration)<=a?(this.interval=20,this.intervalType="second"):b/(30*L.secondDuration)<=a?(this.interval=30,this.intervalType="second"):b/(1*L.minuteDuration)<=a?(this.interval=1,this.intervalType="minute"):b/
|
|
780
|
+
(2*L.minuteDuration)<=a?(this.interval=2,this.intervalType="minute"):b/(5*L.minuteDuration)<=a?(this.interval=5,this.intervalType="minute"):b/(10*L.minuteDuration)<=a?(this.interval=10,this.intervalType="minute"):b/(15*L.minuteDuration)<=a?(this.interval=15,this.intervalType="minute"):b/(20*L.minuteDuration)<=a?(this.interval=20,this.intervalType="minute"):b/(30*L.minuteDuration)<=a?(this.interval=30,this.intervalType="minute"):b/(1*L.hourDuration)<=a?(this.interval=1,this.intervalType="hour"):b/
|
|
781
|
+
(2*L.hourDuration)<=a?(this.interval=2,this.intervalType="hour"):b/(3*L.hourDuration)<=a?(this.interval=3,this.intervalType="hour"):b/(6*L.hourDuration)<=a?(this.interval=6,this.intervalType="hour"):b/(1*L.dayDuration)<=a?(this.interval=1,this.intervalType="day"):b/(2*L.dayDuration)<=a?(this.interval=2,this.intervalType="day"):b/(4*L.dayDuration)<=a?(this.interval=4,this.intervalType="day"):b/(1*L.weekDuration)<=a?(this.interval=1,this.intervalType="week"):b/(2*L.weekDuration)<=a?(this.interval=2,
|
|
782
|
+
this.intervalType="week"):b/(3*L.weekDuration)<=a?(this.interval=3,this.intervalType="week"):b/(1*L.monthDuration)<=a?(this.interval=1,this.intervalType="month"):b/(2*L.monthDuration)<=a?(this.interval=2,this.intervalType="month"):b/(3*L.monthDuration)<=a?(this.interval=3,this.intervalType="month"):b/(6*L.monthDuration)<=a?(this.interval=6,this.intervalType="month"):(this.interval=b/(1*L.yearDuration)<=a?1:b/(2*L.yearDuration)<=a?2:b/(4*L.yearDuration)<=a?4:Math.floor(A.getNiceNumber(b/(a-1),!0)/
|
|
783
|
+
L.yearDuration),this.intervalType="year"));if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=e-d/2;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=h+d/2;g?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=
|
|
784
|
+
"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=A.getNiceNumber(b,!1);this.interval=this.options&&0<this.options.interval?this.options.interval:A.getNiceNumber(b/
|
|
785
|
+
(a-1),!0);if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum="axisX"===this.type?e-d/2:Math.floor(e/this.interval)*this.interval;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum="axisX"===this.type?h+d/2:Math.ceil(h/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"===
|
|
786
|
+
typeof this.options.interval&&(this.interval=A.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,h=null!==this.maximum?this.maximum:this.dataInfo.max,0===h-e&&(b="undefined"===typeof this.options.interval?0.4:this.options.interval,h+=b,e-=b),d=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1<h-e?0.5*Math.abs(h-e):1):"axisY"===this.type&&(e=null!==this.minimum?
|
|
787
|
+
this.minimum:this.dataInfo.min,h=null!==this.maximum?this.maximum:this.dataInfo.max,isFinite(e)||isFinite(h)?0===e&&0===h?(h+=9,e=0):0===h-e?(b=Math.min(Math.abs(0.01*Math.abs(h)),5),h+=b,e-=b):e>h?(b=Math.min(0.01*Math.abs(this.getApparentDifference(h,e,null,!0)),5),0<=h?e=h-b:h=isFinite(e)?e+b:0):(b=Math.min(0.01*Math.abs(this.getApparentDifference(e,h,null,!0)),0.05),0!==h&&(h+=b),0!==e&&(e-=b)):(h="undefined"===typeof this.options.interval?-Infinity:this.options.interval,e="undefined"!==typeof this.options.interval||
|
|
788
|
+
isFinite(this.dataInfo.minDiff)?0:Infinity),d=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1<h-e?0.5*Math.abs(h-e):1,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&0<e&&(e=0),this.includeZero&&(null===this.maximum||isNaN(this.maximum))&&0>h&&(h=0)),Math.abs(this.getApparentDifference(e,h,null,!0)),"axisX"===this.type&&c){this.valueType="dateTime";if(null===this.minimum||isNaN(this.minimum))this.minimum=e-d/2,this.minimum=Math.min(this.minimum,null===this.sessionVariables.viewportMinimum||
|
|
789
|
+
isNaN(this.sessionVariables.viewportMinimum)?Infinity:this.sessionVariables.viewportMinimum);if(null===this.maximum||isNaN(this.maximum))this.maximum=h+d/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-d/2:Math.floor(e/this.interval)*this.interval,this.minimum=Math.min(this.minimum,
|
|
790
|
+
null===this.sessionVariables.viewportMinimum||isNaN(this.sessionVariables.viewportMinimum)?Infinity:this.sessionVariables.viewportMinimum)),null===this.maximum&&(this.maximum="axisX"===this.type?h+d/2:Math.ceil(h/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===
|
|
791
|
+
this.options.maximum&&(this.minimum-=10));n(this.sessionVariables.newViewportMinimum)&&(this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum));n(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)/
|
|
792
|
+
this.interval)*this.interval;this.valueFormatString||(this.valueFormatString=A.generateValueFormatString(this.range,2))}};A.prototype.calculateLogarithmicAxisParameters=function(){var a=this.chart.layoutManager.getFreeSpace(),g=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/
|
|
793
|
+
50),3),b,e,h,d;d=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(d=0;d<this.scaleBreaks._appliedBreaks.length;d++)if((!n(this.sessionVariables.newViewportMinimum)&&this.sessionVariables.newViewportMinimum>=this.scaleBreaks._appliedBreaks[d].startValue||!n(this.options.minimum)&&this.options.minimum>=this.scaleBreaks._appliedBreaks[d].startValue||
|
|
794
|
+
!n(this.options.viewportMinimum)&&this.viewportMinimum>=this.scaleBreaks._appliedBreaks[d].startValue)&&(!n(this.sessionVariables.newViewportMaximum)&&this.sessionVariables.newViewportMaximum<=this.scaleBreaks._appliedBreaks[d].endValue||!n(this.options.maximum)&&this.options.maximum<=this.scaleBreaks._appliedBreaks[d].endValue||!n(this.options.viewportMaximum)&&this.viewportMaximum<=this.scaleBreaks._appliedBreaks[d].endValue)){this.scaleBreaks._appliedBreaks.splice(d,1);break}"axisX"===this.type?
|
|
795
|
+
(b=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,e=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,1===e/b&&(d=Math.pow(this.logarithmBase,"undefined"===typeof this.options.interval?0.4:this.options.interval),e*=d,b/=d),h=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,
|
|
796
|
+
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?(d=Math.min(e*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),e*=d,b/=d):b>e?(d=Math.min(b/e*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),1<=e?b=e/d:e=b*d):(d=Math.min(e/b*Math.pow(this.logarithmBase,
|
|
797
|
+
0.01),Math.pow(this.logarithmBase,0.04)),1!==e&&(e*=d),1!==b&&(b/=d)),h=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));d=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?e:this.viewportMaximum)/(isNaN(this.viewportMinimum)||null===
|
|
798
|
+
this.viewportMinimum?b:this.viewportMinimum);var m=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?e:this.viewportMaximum)-(isNaN(this.viewportMinimum)||null===this.viewportMinimum?b:this.viewportMinimum);this.intervalType="number";d=Math.pow(this.logarithmBase,A.getNiceNumber(Math.abs(Math.log(d)/g),!1));this.options&&0<this.options.interval?this.interval=this.options.interval:(this.interval=A.getNiceExponent(Math.log(d)/g/(a-1),!0),c=A.getNiceNumber(m/(a-1),!0));if(null===this.viewportMinimum||
|
|
799
|
+
isNaN(this.viewportMinimum))this.viewportMinimum="axisX"===this.type?b/Math.sqrt(h):Math.pow(this.logarithmBase,this.interval*Math.floor(Math.log(b)/g/this.interval));if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum="axisX"===this.type?e*Math.sqrt(h):Math.pow(this.logarithmBase,this.interval*Math.ceil(Math.log(e)/g/this.interval));1===this.viewportMaximum&&1===this.viewportMinimum&&(1===this.options.viewportMinimum?this.viewportMaximum*=this.logarithmBase-1/this.logarithmBase:
|
|
800
|
+
1===this.options.viewportMaximum&&(this.viewportMinimum/=this.logarithmBase-1/this.logarithmBase),this.options&&"undefined"===typeof this.options.interval&&(this.interval=A.getNiceExponent(Math.ceil(Math.log(d)/g)/(a-1)),c=A.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&&(d=Math.pow(this.logarithmBase,
|
|
801
|
+
"undefined"===typeof this.options.interval?0.4:this.options.interval),e*=d,b/=d),h=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?(d=Math.pow(this.logarithmBase,this.interval),e*=d,b/=d):b>e?(d=
|
|
802
|
+
Math.min(0.01*(b/e),5),1<=e?b=e/d:e=b*d):(d=Math.min(e/b*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==e&&(e*=d),1!==b&&(b/=d)):(e="undefined"===typeof this.options.interval?0:this.options.interval,b=1),h=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))&&
|
|
803
|
+
1>e&&(e=1)),this.intervalType="number",null===this.minimum&&(this.minimum="axisX"===this.type?b/Math.sqrt(h):Math.pow(this.logarithmBase,this.interval*Math.floor(Math.log(b)/g/this.interval)),n(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||
|
|
804
|
+
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(h):Math.pow(this.logarithmBase,this.interval*Math.ceil(Math.log(e)/g/this.interval)),n(null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?"undefined"===typeof this.sessionVariables.newViewportMaximum?
|
|
805
|
+
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/=
|
|
806
|
+
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)/
|
|
807
|
+
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)/(g*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(g=Math.floor(this.viewportMinimum/c+0.5)*c;g<this.viewportMinimum;)g+=c;this.equidistantInterval=
|
|
808
|
+
!1;this.intervalStartPosition=g;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)/(g*this.interval)+0.2)*this.interval))),this.equidistantInterval=!0,this.intervalStartPosition=b;if(!this.valueFormatString&&(this.valueFormatString="#,##0.##",1>this.viewportMinimum)){g=Math.floor(Math.abs(Math.log(this.viewportMinimum)/Math.LN10))+2;if(isNaN(g)||!isFinite(g))g=2;
|
|
809
|
+
if(2<g)for(d=0;d<g-2;d++)this.valueFormatString+="#"}};A.generateValueFormatString=function(a,g){var c="#,##0.",b=g;1>a&&(b+=Math.floor(Math.abs(Math.log(a)/Math.LN10)),isNaN(b)||!isFinite(b))&&(b=g);for(var e=0;e<b;e++)c+="#";return c};A.getNiceExponent=function(a,g){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))};A.getNiceNumber=function(a,g){var c=Math.floor(Math.log(a)/
|
|
810
|
+
Math.LN10),b=a/Math.pow(10,c),b=g?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))};A.prototype.getLabelStartPoint=function(){var a=L[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()||
|
|
811
|
+
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<
|
|
812
|
+
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()||
|
|
813
|
+
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(ea,T);pa(ca,T);ca.prototype.createUserOptions=function(a){if("undefined"!==typeof a||this.options._isPlaceholder){var g=0;this.parent.options._isPlaceholder&&this.parent.createUserOptions();this.options._isPlaceholder||(Da(this.parent[this.optionsName]),g=this.parent.options[this.optionsName].indexOf(this.options));
|
|
814
|
+
this.options="undefined"===typeof a?{}:a;this.parent.options[this.optionsName][g]=this.options}};ca.prototype.render=function(a){if(0!==this.spacing||0!==this.options.lineThickness&&("undefined"!==typeof this.options.lineThickness||0!==this.parent.lineThickness)){var g=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),
|
|
815
|
+
e=this.scaleBreaks.parent.getPixelCoordinatesOnAxis(this.endValue);this.ctx.strokeStyle=this.lineColor;this.ctx.fillStyle=this.color;this.ctx.beginPath();this.ctx.globalAlpha=1;X(this.id);var d,r,m,n,k,l;a=Math.max(this.spacing,3);var p=Math.max(0,this.lineThickness);this.ctx.lineWidth=p;this.ctx.setLineDash&&this.ctx.setLineDash(G(this.lineDashType,p));if("bottom"===this.scaleBreaks.parent._position||"top"===this.scaleBreaks.parent._position)if(b=1===p%2?(b.x<<0)+0.5:b.x<<0,r=1===p%2?(e.x<<0)+0.5:
|
|
816
|
+
e.x<<0,"top"===this.scaleBreaks.parent._position?(e=this.chart.plotArea.y1,m=this.chart.plotArea.y2+p/2+0.5<<0):(e=this.chart.plotArea.y2,m=this.chart.plotArea.y1-p/2+0.5<<0,a*=-1),this.bounds={x1:b-p/2,y1:e,x2:r+p/2,y2:m},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,m),this.ctx.lineTo(r,m),this.ctx.lineTo(r,e);else if("wavy"===this.type){n=b;k=e;d=0.5;l=(m-k)/a/3;for(var q=0;q<l;q++)this.ctx.bezierCurveTo(n+
|
|
817
|
+
d*a,k+a,n+d*a,k+2*a,n,k+3*a),k+=3*a,d*=-1;this.ctx.bezierCurveTo(n+d*a,k+a,n+d*a,k+2*a,n,k+3*a);n=r;d*=-1;this.ctx.lineTo(n,k);for(q=0;q<l;q++)this.ctx.bezierCurveTo(n+d*a,k-a,n+d*a,k-2*a,n,k-3*a),k-=3*a,d*=-1}else{if("zigzag"===this.type){d=-1;k=e+a;n=b+a;l=(m-k)/a/2;for(q=0;q<l;q++)this.ctx.lineTo(n,k),n+=2*d*a,k+=2*a,d*=-1;this.ctx.lineTo(n,k);n+=r-b;for(q=0;q<l+1;q++)this.ctx.lineTo(n,k),n+=2*d*a,k-=2*a,d*=-1;this.ctx.lineTo(n+d*a,k+a)}}else if("left"===this.scaleBreaks.parent._position||"right"===
|
|
818
|
+
this.scaleBreaks.parent._position)if(e=1===p%2?(e.y<<0)+0.5:e.y<<0,m=1===p%2?(b.y<<0)+0.5:b.y<<0,"left"===this.scaleBreaks.parent._position?(b=this.chart.plotArea.x1,r=this.chart.plotArea.x2+p/2+0.5<<0):(b=this.chart.plotArea.x2,r=this.chart.plotArea.x1-p/2+0.5<<0,a*=-1),this.bounds={x1:b,y1:e-p/2,x2:r,y2:m+p/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(r,e),this.ctx.lineTo(r,m),
|
|
819
|
+
this.ctx.lineTo(b,m);else if("wavy"===this.type){n=b;k=e;d=0.5;l=(r-n)/a/3;for(q=0;q<l;q++)this.ctx.bezierCurveTo(n+a,k+d*a,n+2*a,k+d*a,n+3*a,k),n+=3*a,d*=-1;this.ctx.bezierCurveTo(n+a,k+d*a,n+2*a,k+d*a,n+3*a,k);k=m;d*=-1;this.ctx.lineTo(n,k);for(q=0;q<l;q++)this.ctx.bezierCurveTo(n-a,k+d*a,n-2*a,k+d*a,n-3*a,k),n-=3*a,d*=-1}else if("zigzag"===this.type){d=1;k=e-a;n=b+a;l=(r-n)/a/2;for(q=0;q<l;q++)this.ctx.lineTo(n,k),k+=2*d*a,n+=2*a,d*=-1;this.ctx.lineTo(n,k);k+=m-e;for(q=0;q<l+1;q++)this.ctx.lineTo(n,
|
|
820
|
+
k),k+=2*d*a,n-=2*a,d*=-1;this.ctx.lineTo(n+a,k+d*a)}0<p&&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=g}};pa(Q,T);Q.prototype.createUserOptions=function(a){if("undefined"!==typeof a||this.options._isPlaceholder){var g=0;this.parent.options._isPlaceholder&&this.parent.createUserOptions();this.options._isPlaceholder||(Da(this.parent.stripLines),g=this.parent.options.stripLines.indexOf(this.options));
|
|
821
|
+
this.options="undefined"===typeof a?{}:a;this.parent.options.stripLines[g]=this.options}};Q.prototype.render=function(){this.ctx.save();var a=this.parent.getPixelCoordinatesOnAxis(this.value),g=Math.abs("pixel"===this._thicknessType?this.thickness:Math.abs(this.parent.convertValueToPixel(this.endValue)-this.parent.convertValueToPixel(this.startValue)));if(0<g){var c=null===this.opacity?1:this.opacity;this.ctx.strokeStyle=this.color;this.ctx.beginPath();var b=this.ctx.globalAlpha;this.ctx.globalAlpha=
|
|
822
|
+
c;X(this.id);var e,d,n,m;this.ctx.lineWidth=g;this.ctx.setLineDash&&this.ctx.setLineDash(G(this.lineDashType,g));if("bottom"===this.parent._position||"top"===this.parent._position)e=d=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0,n=this.chart.plotArea.y1,m=this.chart.plotArea.y2,this.bounds={x1:e-g/2,y1:n,x2:d+g/2,y2:m};else if("left"===this.parent._position||"right"===this.parent._position)n=m=1===this.ctx.lineWidth%2?(a.y<<0)+0.5:a.y<<0,e=this.chart.plotArea.x1,d=this.chart.plotArea.x2,this.bounds=
|
|
823
|
+
{x1:e,y1:n-g/2,x2:d,y2:m+g/2};this.ctx.moveTo(e,n);this.ctx.lineTo(d,m);this.ctx.stroke();this.ctx.globalAlpha=b}this.ctx.restore()};pa(da,T);da.prototype.showAt=function(a){if(!this.enabled)return!1;var g=this.chart,c=!1;g.resetOverlayedCanvas();g.clearedOverlayedCanvas=this.parent.type;this.chart.renderCrosshairs(this.parent);if("xySwapped"===g.plotInfo.axisPlacement)if("bottom"===this.parent._position)for(var b=0;b<g.axisY.length;b++)this.parent===g.axisY[b]&&(g.axisY[b]._crosshairValue=a>=g.axisY[b].viewportMinimum&&
|
|
822
824
|
a<=g.axisY[b].viewportMaximum?a:null);else if("top"===this.parent._position)for(b=0;b<g.axisY2.length;b++)this.parent===g.axisY2[b]&&(g.axisY2[b]._crosshairValue=a>=g.axisY2[b].viewportMinimum&&a<=g.axisY2[b].viewportMaximum?a:null);else if("left"===this.parent._position)for(b=0;b<g.axisX.length;b++)this.parent===g.axisX[b]&&(g.axisX[b]._crosshairValue=a>=g.axisX[b].viewportMinimum&&a<=g.axisX[b].viewportMaximum?a:null);else{if("right"===this.parent._position)for(b=0;b<g.axisX2.length;b++)this.parent===
|
|
823
825
|
g.axisX2[b]&&(g.axisX2[b]._crosshairValue=a>=g.axisX2[b].viewportMinimum&&a<=g.axisX2[b].viewportMaximum?a:null)}else if("bottom"===this.parent._position)for(b=0;b<g.axisX.length;b++)this.parent===g.axisX[b]&&(g.axisX[b]._crosshairValue=a>=g.axisX[b].viewportMinimum&&a<=g.axisX[b].viewportMaximum?a:null);else if("top"===this.parent._position)for(b=0;b<g.axisX2.length;b++)this.parent===g.axisX2[b]&&(g.axisX2[b]._crosshairValue=a>=g.axisX2[b].viewportMinimum&&a<=g.axisX2[b].viewportMaximum?a:null);
|
|
824
826
|
else if("left"===this.parent._position)for(b=0;b<g.axisY.length;b++)this.parent===g.axisY[b]&&(g.axisY[b]._crosshairValue=a>=g.axisY[b].viewportMinimum&&a<=g.axisY[b].viewportMaximum?a:null);else if("right"===this.parent._position)for(b=0;b<g.axisY2.length;b++)this.parent===g.axisY2[b]&&(g.axisY2[b]._crosshairValue=a>=g.axisY2[b].viewportMinimum&&a<=g.axisY2[b].viewportMaximum?a:null);for(b=0;b<g.axisX.length;b++)a=g.axisX[b]._crosshairValue,g.axisX[b].crosshair&&(g.axisX[b].crosshair.enabled&&!n(a)&&
|
|
825
827
|
a>=g.axisX[b].viewportMinimum&&a<=g.axisX[b].viewportMaximum)&&(g.axisX[b].showCrosshair(a),g.axisX[b].crosshair._updatedValue=a,this===g.axisX[b].crosshair&&(c=!0));for(b=0;b<g.axisX2.length;b++)a=g.axisX2[b]._crosshairValue,g.axisX2[b].crosshair&&(g.axisX2[b].crosshair.enabled&&!n(a)&&a>=g.axisX2[b].viewportMinimum&&a<=g.axisX2[b].viewportMaximum)&&(g.axisX2[b].showCrosshair(a),g.axisX2[b].crosshair._updatedValue=a,this===g.axisX2[b].crosshair&&(c=!0));for(b=0;b<g.axisY.length;b++)a=g.axisY[b]._crosshairValue,
|
|
826
828
|
g.axisY[b].crosshair&&(g.axisY[b].crosshair.enabled&&!n(a)&&a>=g.axisY[b].viewportMinimum&&a<=g.axisY[b].viewportMaximum)&&(g.axisY[b].showCrosshair(a),g.axisY[b].crosshair._updatedValue=a,this===g.axisY[b].crosshair&&(c=!0));for(b=0;b<g.axisY2.length;b++)a=g.axisY2[b]._crosshairValue,g.axisY2[b].crosshair&&(g.axisY2[b].crosshair.enabled&&!n(a)&&a>=g.axisY2[b].viewportMinimum&&a<=g.axisY2[b].viewportMaximum)&&(g.axisY2[b].showCrosshair(a),g.axisY2[b].crosshair._updatedValue=a,this===g.axisY2[b].crosshair&&
|
|
827
|
-
(c=!0));this.chart.toolTip&&this.chart.toolTip._entries&&this.chart.toolTip.highlightObjects(this.chart.toolTip._entries);return c};da.prototype.hide=function(){this.chart.resetOverlayedCanvas();this.chart.renderCrosshairs(this.parent);this._hidden=!0};da.prototype.render=function(a,g,c){var b,e,d,
|
|
828
|
-
0:500<this.chart.width&&25>this.parent.range?2:Math.floor(Math.abs(Math.log(this.parent.range)/Math.LN10))+(5>this.parent.range?2:10>this.parent.range?1:0):50<this.parent.range?0:Math.floor(Math.abs(Math.log(this.parent.range)/Math.LN10))+(5>this.parent.range?2:10>this.parent.range?1:0),this.valueFormatString=A.generateValueFormatString(this.parent.range,k)));var p=null===this.opacity?1:this.opacity,
|
|
829
|
-
this.thickness),f=this.chart.overlaidCanvasCtx,w=f.globalAlpha;f.beginPath();f.strokeStyle=this.color;f.lineWidth=
|
|
829
|
+
(c=!0));this.chart.toolTip&&this.chart.toolTip._entries&&this.chart.toolTip.highlightObjects(this.chart.toolTip._entries);return c};da.prototype.hide=function(){this.chart.resetOverlayedCanvas();this.chart.renderCrosshairs(this.parent);this._hidden=!0};da.prototype.render=function(a,g,c){var b,e,d,r,m=null,t=null,k=null,l="";this.valueFormatString||("dateTime"===this.parent.valueType?this.valueFormatString=this.parent.valueFormatString:(k=0,k="xySwapped"===this.chart.plotInfo.axisPlacement?50<this.parent.range?
|
|
830
|
+
0:500<this.chart.width&&25>this.parent.range?2:Math.floor(Math.abs(Math.log(this.parent.range)/Math.LN10))+(5>this.parent.range?2:10>this.parent.range?1:0):50<this.parent.range?0:Math.floor(Math.abs(Math.log(this.parent.range)/Math.LN10))+(5>this.parent.range?2:10>this.parent.range?1:0),this.valueFormatString=A.generateValueFormatString(this.parent.range,k)));var p=null===this.opacity?1:this.opacity,q=Math.abs("pixel"===this._thicknessType?this.thickness:this.parent.conversionParameters.pixelPerUnit*
|
|
831
|
+
this.thickness),f=this.chart.overlaidCanvasCtx,w=f.globalAlpha;f.beginPath();f.strokeStyle=this.color;f.lineWidth=q;f.save();this.labelFontSize=Math.abs(n(this.options.labelFontSize)?this.parent.labelFontSize:this.labelFontSize);this.labelMaxWidth=n(this.options.labelMaxWidth)?0.3*this.chart.width:this.labelMaxWidth;this.labelMaxHeight=n(this.options.labelWrap)||this.labelWrap?0.3*this.chart.height:2*this.labelFontSize;0<q&&f.setLineDash&&f.setLineDash(G(this.lineDashType,q));k=new ja(f,{x:0,y:0,
|
|
830
832
|
padding:{top:2,right:3,bottom:2,left:4},backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,maxWidth:this.labelMaxWidth,maxHeight:this.labelMaxHeight,angle:this.labelAngle,text:l,horizontalAlign:"left",fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"});if(this.snapToDataPoint){var v=
|
|
831
833
|
0,l=[];if("xySwapped"===this.chart.plotInfo.axisPlacement){var x=null;if("bottom"===this.parent._position||"top"===this.parent._position)v=this.parent.dataSeries[0].axisX.convertPixelToValue({y:g});else if("left"===this.parent._position||"right"===this.parent._position)v=this.parent.convertPixelToValue({y:g});for(var s=0;s<this.parent.dataSeries.length;s++)(x=this.parent.dataSeries[s].getDataPointAtX(v,!0))&&0<=x.index&&(x.dataSeries=this.parent.dataSeries[s],null!==x.dataPoint.y&&x.dataSeries.visible&&
|
|
832
834
|
l.push(x));x=null;if(0===l.length)return;l.sort(function(a,b){return a.distance-b.distance});var z=x=0;yPercent=cumulativeY=0;for(var v=Infinity,u,s=0;s<l.length;s++){if("rangeBar"===l[s].dataSeries.type||"error"===l[s].dataSeries.type){if(l[s].dataPoint.y)for(var B=0;B<l[s].dataPoint.y.length;B++)z=Math.abs(a-this.parent.convertValueToPixel(l[s].dataPoint.y[B])),z<=v&&(v=z,x=s)}else"stackedBar"===l[s].dataSeries.type?(cumulativeY=l[s].dataSeries.dataPointEOs[l[s].index].cumulativeY,z=Math.abs(a-
|
|
@@ -835,13 +837,13 @@ z=Math.abs(a-this.parent.convertValueToPixel(yPercent)),z<=u&&(u=z,x=s)):(z=Math
|
|
|
835
837
|
1===f.lineWidth%2?(this.parent.convertValueToPixel(u.dataPoint.y[s])<<0)+0.5:this.parent.convertValueToPixel(u.dataPoint.y[s])<<0;this.value=u.dataPoint.y[s];k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:u.dataPoint.y[s]}):n(this.options.label)?fa(n(c)?u.dataPoint.y[s]:c,this.valueFormatString,this.chart._cultureInfo):this.label}else"stackedBar"===u.dataSeries.type?(v=Math.abs(a-this.parent.convertValueToPixel(l[0].dataPoint.y)),
|
|
836
838
|
cumulativeY=u.dataSeries.dataPointEOs[u.index].cumulativeY,m=1===f.lineWidth%2?(this.parent.convertValueToPixel(cumulativeY)<<0)+0.5:this.parent.convertValueToPixel(cumulativeY)<<0,this.value=cumulativeY,k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:cumulativeY}):n(this.options.label)?fa(n(c)?cumulativeY:c,this.valueFormatString,this.chart._cultureInfo):this.label):"stackedBar100"===u.dataSeries.type?(v=Math.abs(a-this.parent.convertValueToPixel(l[0].dataPoint.y)),
|
|
837
839
|
cumulativeY=u.dataSeries.dataPointEOs[u.index].cumulativeY,z=u.dataPoint.x.getTime?u.dataPoint.x.getTime():u.dataPoint.x,yPercent=100*(cumulativeY/u.dataSeries.plotUnit.dataPointYSums[z]),m=1===f.lineWidth%2?(this.parent.convertValueToPixel(yPercent)<<0)+0.5:this.parent.convertValueToPixel(yPercent)<<0,this.value=yPercent,k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:yPercent}):n(this.options.label)?fa(n(c)?yPercent:c,this.valueFormatString,
|
|
838
|
-
this.chart._cultureInfo):this.label):(m=1===f.lineWidth%2?(this.parent.convertValueToPixel(u.dataPoint.y)<<0)+0.5:this.parent.convertValueToPixel(u.dataPoint.y)<<0,this.value=u.dataPoint.y,k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:u.dataPoint.y}):n(this.options.label)?fa(n(c)?u.dataPoint.y:c,this.valueFormatString,this.chart._cultureInfo):this.label);b=e=m;d=this.chart.plotArea.y1;
|
|
839
|
-
|
|
840
|
-
2?(this.parent.convertValueToPixel(u.dataPoint.x)<<0)+0.5:this.parent.convertValueToPixel(u.dataPoint.x)<<0;b=this.chart.plotArea.x1;e=this.chart.plotArea.x2;this.bounds={x1:b,y1:d-
|
|
840
|
+
this.chart._cultureInfo):this.label):(m=1===f.lineWidth%2?(this.parent.convertValueToPixel(u.dataPoint.y)<<0)+0.5:this.parent.convertValueToPixel(u.dataPoint.y)<<0,this.value=u.dataPoint.y,k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:u.dataPoint.y}):n(this.options.label)?fa(n(c)?u.dataPoint.y:c,this.valueFormatString,this.chart._cultureInfo):this.label);b=e=m;d=this.chart.plotArea.y1;r=this.chart.plotArea.y2;this.bounds={x1:b-
|
|
841
|
+
q/2,y1:d,x2:e+q/2,y2:r};k.x=b-k.measureText().width/2;k.x+k.width>this.chart.bounds.x2?k.x=this.chart.bounds.x2-k.width:k.x<this.chart.bounds.x1&&(k.x=this.chart.bounds.x1);k.y=this.parent.lineCoordinates.y2+("top"===this.parent._position?-k.height+this.parent.tickLength:k.fontSize/2)+2;k.y+k.height>this.chart.bounds.y2?k.y=this.chart.bounds.y2-k.height:k.y<this.chart.bounds.y1&&(k.y=this.chart.bounds.y1)}else if("left"===this.parent._position||"right"===this.parent._position){d=r=t=1===f.lineWidth%
|
|
842
|
+
2?(this.parent.convertValueToPixel(u.dataPoint.x)<<0)+0.5:this.parent.convertValueToPixel(u.dataPoint.x)<<0;b=this.chart.plotArea.x1;e=this.chart.plotArea.x2;this.bounds={x1:b,y1:d-q/2,x2:e,y2:r+q/2};s=!1;if(this.parent.labels)for(v=Math.ceil(this.parent.interval),l=0;l<this.parent.viewportMaximum;l+=v)if(this.parent.labels[l])s=!0;else{s=!1;break}if(s){if("axisX"===this.parent.type)for(v=this.parent.convertPixelToValue({y:g}),x=null,s=0;s<this.parent.dataSeries.length;s++)(x=this.parent.dataSeries[s].getDataPointAtX(v,
|
|
841
843
|
!0))&&0<=x.index&&(k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:u.dataPoint.x}):n(this.options.label)?x.dataPoint.label:this.label)}else k.text="dateTime"!==this.parent.valueType||this.parent.logarithmic?this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:u.dataPoint.x}):n(this.options.label)?fa(u.dataPoint.x,this.valueFormatString,this.chart._cultureInfo):this.label:
|
|
842
|
-
this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:u.dataPoint.x}):n(this.options.label)?Ca(u.dataPoint.x,this.valueFormatString,this.chart._cultureInfo):this.label;this.value=u.dataPoint.x;k.y=
|
|
844
|
+
this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:u.dataPoint.x}):n(this.options.label)?Ca(u.dataPoint.x,this.valueFormatString,this.chart._cultureInfo):this.label;this.value=u.dataPoint.x;k.y=r+k.fontSize/2-k.measureText().height/2+2;k.y-k.fontSize/2<this.chart.bounds.y1?k.y=this.chart.bounds.y1+k.fontSize/2+2:k.y+k.measureText().height-k.fontSize/2>this.chart.bounds.y2&&(k.y=this.chart.bounds.y2-k.measureText().height+k.fontSize/2);"left"===
|
|
843
845
|
this.parent._position?k.x=this.parent.lineCoordinates.x2-k.measureText().width:"right"===this.parent._position&&(k.x=this.parent.lineCoordinates.x2)}}else if("bottom"===this.parent._position||"top"===this.parent._position){v=this.parent.convertPixelToValue({x:a});for(s=0;s<this.parent.dataSeries.length;s++)(x=this.parent.dataSeries[s].getDataPointAtX(v,!0))&&0<=x.index&&(x.dataSeries=this.parent.dataSeries[s],null!==x.dataPoint.y&&x.dataSeries.visible&&l.push(x));if(0===l.length)return;l.sort(function(a,
|
|
844
|
-
b){return a.distance-b.distance});u=l[0];b=e=m=1===f.lineWidth%2?(this.parent.convertValueToPixel(u.dataPoint.x)<<0)+0.5:this.parent.convertValueToPixel(u.dataPoint.x)<<0;d=this.chart.plotArea.y1;
|
|
846
|
+
b){return a.distance-b.distance});u=l[0];b=e=m=1===f.lineWidth%2?(this.parent.convertValueToPixel(u.dataPoint.x)<<0)+0.5:this.parent.convertValueToPixel(u.dataPoint.x)<<0;d=this.chart.plotArea.y1;r=this.chart.plotArea.y2;this.bounds={x1:b-q/2,y1:d,x2:e+q/2,y2:r};s=!1;if(this.parent.labels)for(v=Math.ceil(this.parent.interval),l=0;l<this.parent.viewportMaximum;l+=v)if(this.parent.labels[l])s=!0;else{s=!1;break}if(s){if("axisX"===this.parent.type)for(v=this.parent.convertPixelToValue({x:a}),x=null,
|
|
845
847
|
s=0;s<this.parent.dataSeries.length;s++)(x=this.parent.dataSeries[s].getDataPointAtX(v,!0))&&0<=x.index&&(k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:u.dataPoint.x}):n(this.options.label)?x.dataPoint.label:this.label)}else k.text="dateTime"!==this.parent.valueType||this.parent.logarithmic?this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:u.dataPoint.x}):n(this.options.label)?
|
|
846
848
|
fa(u.dataPoint.x,this.valueFormatString,this.chart._cultureInfo):this.label:this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:u.dataPoint.x}):n(this.options.label)?Ca(u.dataPoint.x,this.valueFormatString,this.chart._cultureInfo):this.label;this.value=u.dataPoint.x;k.x=b-k.measureText().width/2;k.x+k.width>this.chart.bounds.x2&&(k.x=this.chart.bounds.x2-k.width);k.x<this.chart.bounds.x1&&(k.x=this.chart.bounds.x1);"bottom"===this.parent._position?
|
|
847
849
|
k.y=this.parent.lineCoordinates.y2+k.fontSize/2+2:"top"===this.parent._position&&(k.y=this.parent.lineCoordinates.y1-k.height+k.fontSize/2+2)}else if("left"===this.parent._position||"right"===this.parent._position){!n(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&(v=this.parent.dataSeries[0].axisX.convertPixelToValue({x:a}));for(s=0;s<this.parent.dataSeries.length;s++)(x=this.parent.dataSeries[s].getDataPointAtX(v,!0))&&0<=x.index&&(x.dataSeries=this.parent.dataSeries[s],null!==x.dataPoint.y&&
|
|
@@ -856,11 +858,11 @@ b:c,this.valueFormatString,this.chart._cultureInfo):this.label,this.value=b):"st
|
|
|
856
858
|
n(this.options.label)?fa(n(c)?b:c,this.valueFormatString,this.chart._cultureInfo):this.label,this.value=b):"stackedArea100"===u.dataSeries.type?(t=u.dataSeries.dataPointEOs[u.index].cumulativeY,z=u.dataPoint.x.getTime?u.dataPoint.x.getTime():u.dataPoint.x,b=100*(t/u.dataSeries.plotUnit.dataPointYSums[z]),t=1===f.lineWidth%2?(this.parent.convertValueToPixel(b)<<0)+0.5:this.parent.convertValueToPixel(b)<<0,k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,
|
|
857
859
|
value:b}):n(this.options.label)?fa(n(c)?b:c,this.valueFormatString,this.chart._cultureInfo):this.label,this.value=b):"waterfall"===u.dataSeries.type?(t=1===f.lineWidth%2?(this.parent.convertValueToPixel(u.dataSeries.dataPointEOs[u.index].cumulativeSum)<<0)+0.5:this.parent.convertValueToPixel(u.dataSeries.dataPointEOs[u.index].cumulativeSum)<<0,k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:u.dataSeries.dataPointEOs[u.index].cumulativeSum}):
|
|
858
860
|
n(this.options.label)?fa(n(c)?u.dataSeries.dataPointEOs[u.index].cumulativeSum:c,this.valueFormatString,this.chart._cultureInfo):this.label,this.value=u.dataSeries.dataPointEOs[u.index].cumulativeSum):(t=1===f.lineWidth%2?(n(a)?g:this.parent.convertValueToPixel(u.dataPoint.y)<<0)+0.5:n(a)?g:this.parent.convertValueToPixel(u.dataPoint.y)<<0,k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n(c)?u.dataPoint.y:c}):n(this.options.label)?
|
|
859
|
-
fa(n(c)?u.dataPoint.y:c,this.valueFormatString,this.chart._cultureInfo):this.label,this.value=u.dataPoint.y);d=
|
|
861
|
+
fa(n(c)?u.dataPoint.y:c,this.valueFormatString,this.chart._cultureInfo):this.label,this.value=u.dataPoint.y);d=r=t;b=this.chart.plotArea.x1;e=this.chart.plotArea.x2;this.bounds={x1:b,y1:d-q/2,x2:e,y2:r+q/2};k.y=r+k.fontSize/2-k.measureText().height/2+2;k.y-k.fontSize/2<this.chart.bounds.y1?k.y=this.chart.bounds.y1+k.fontSize/2+2:k.y+k.measureText().height-k.fontSize/2>this.chart.bounds.y2&&(k.y=this.chart.bounds.y2-k.measureText().height+k.fontSize/2);"left"===this.parent._position?k.x=this.parent.lineCoordinates.x2-
|
|
860
862
|
k.measureText().width:"right"===this.parent._position&&(k.x=this.parent.lineCoordinates.x2)}l=null;f.globalAlpha=p;if("bottom"===this.parent._position||"top"===this.parent._position)"top"===this.parent._position&&k.y-k.fontSize/2<this.chart.bounds.y1&&(k.y=this.chart.bounds.y1+k.fontSize/2),"bottom"===this.parent._position&&this.parent.lineCoordinates.y2-k.fontSize/2+k.measureText().height>this.chart.bounds.y2&&(k.y=this.chart.bounds.y2-k.height+k.fontSize/2+2),this.value>=Math.min(this.parent.viewportMinimum,
|
|
861
|
-
this.parent.viewportMaximum)&&this.value<=Math.max(this.parent.viewportMinimum,this.parent.viewportMaximum)&&0<
|
|
862
|
-
this.parent.viewportMaximum)&&this.value<=Math.max(this.parent.viewportMinimum,this.parent.viewportMaximum)&&0<
|
|
863
|
-
e=this.chart.plotArea.x2,this.bounds={x1:b,y1:d-
|
|
863
|
+
this.parent.viewportMaximum)&&this.value<=Math.max(this.parent.viewportMinimum,this.parent.viewportMaximum)&&0<q&&(f.moveTo(b,d),f.lineTo(e,r),f.stroke(),this._hidden=!1);if("left"===this.parent._position||"right"===this.parent._position)"left"===this.parent._position&&k.x<this.chart.bounds.x1&&(k.x=this.chart.bounds.x1),"right"===this.parent._position&&k.x+k.measureText().width>this.chart.bounds.x2&&(k.x=this.chart.bounds.x2-k.measureText().width),this.value>=Math.min(this.parent.viewportMinimum,
|
|
864
|
+
this.parent.viewportMaximum)&&this.value<=Math.max(this.parent.viewportMinimum,this.parent.viewportMaximum)&&0<q&&(f.moveTo(b,d),f.lineTo(e,r),f.stroke(),this._hidden=!1)}else{if("bottom"===this.parent._position||"top"===this.parent._position)b=e=m=1===f.lineWidth%2?(a<<0)+0.5:a<<0,d=this.chart.plotArea.y1,r=this.chart.plotArea.y2,this.bounds={x1:b-q/2,y1:d,x2:e+q/2,y2:r};else if("left"===this.parent._position||"right"===this.parent._position)d=r=t=1===f.lineWidth%2?(g<<0)+0.5:g<<0,b=this.chart.plotArea.x1,
|
|
865
|
+
e=this.chart.plotArea.x2,this.bounds={x1:b,y1:d-q/2,x2:e,y2:r+q/2};if("xySwapped"===this.chart.plotInfo.axisPlacement)if("left"===this.parent._position||"right"===this.parent._position){s=!1;if(this.parent.labels)for(v=Math.ceil(this.parent.interval),l=0;l<this.parent.viewportMaximum;l+=v)if(this.parent.labels[l])s=!0;else{s=!1;break}if(s){if("axisX"===this.parent.type)for(v=this.parent.convertPixelToValue({y:g}),x=null,s=0;s<this.parent.dataSeries.length;s++)(x=this.parent.dataSeries[s].getDataPointAtX(v,
|
|
864
866
|
!0))&&0<=x.index&&(k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n(c)?this.parent.convertPixelToValue(a):c}):n(this.options.label)?x.dataPoint.label:this.label)}else k.text="dateTime"!==this.parent.valueType||this.parent.logarithmic?this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n(c)?this.parent.convertPixelToValue(g):c}):n(this.options.label)?fa(n(c)?this.parent.convertPixelToValue(g):
|
|
865
867
|
c,this.valueFormatString,this.chart._cultureInfo):this.label:this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n(c)?this.parent.convertPixelToValue(g):c}):n(this.options.label)?Ca(n(c)?this.parent.convertPixelToValue(g):c,this.valueFormatString,this.chart._cultureInfo):this.label;k.y=g+k.fontSize/2-k.measureText().height/2+2;k.y-k.fontSize/2<this.chart.bounds.y1?k.y=this.chart.bounds.y1+k.fontSize/2+2:k.y+k.measureText().height-k.fontSize/
|
|
866
868
|
2>this.chart.bounds.y2&&(k.y=this.chart.bounds.y2-k.measureText().height+k.fontSize/2);"left"===this.parent._position?k.x=this.parent.lineCoordinates.x1-k.measureText().width:"right"===this.parent._position&&(k.x=this.parent.lineCoordinates.x2)}else{if("bottom"===this.parent._position||"top"===this.parent._position)k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n(c)?this.parent.convertPixelToValue(a):c}):n(this.options.label)?
|
|
@@ -870,7 +872,7 @@ c}):n(this.options.label)?n(c)?x.dataPoint.label:c:this.label)}else k.text="date
|
|
|
870
872
|
axis:this.parent.options,crosshair:this.options,value:n(c)?this.parent.convertPixelToValue(a):c}):n(this.options.label)?Ca(n(c)?this.parent.convertPixelToValue(a):c,this.valueFormatString,this.chart._cultureInfo):this.label;k.x=b-k.measureText().width/2;k.x+k.width>this.chart.bounds.x2&&(k.x=this.chart.bounds.x2-k.width);k.x<this.chart.bounds.x1&&(k.x=this.chart.bounds.x1);"bottom"===this.parent._position?k.y=this.parent.lineCoordinates.y2+k.fontSize/2+2:"top"===this.parent._position&&(k.y=this.parent.lineCoordinates.y1-
|
|
871
873
|
k.height+k.fontSize/2+2)}else if("left"===this.parent._position||"right"===this.parent._position)k.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n(c)?this.parent.convertPixelToValue(g):c}):n(this.options.label)?fa(n(c)?this.parent.convertPixelToValue(g):c,this.valueFormatString,this.chart._cultureInfo):this.label,k.y=g+k.fontSize/2-k.measureText().height/2+2,k.y-k.fontSize/2<this.chart.bounds.y1?k.y=this.chart.bounds.y1+k.fontSize/
|
|
872
874
|
2+2:k.y+k.measureText().height-k.fontSize/2>this.chart.bounds.y2&&(k.y=this.chart.bounds.y2-k.measureText().height+k.fontSize/2),"left"===this.parent._position?k.x=this.parent.lineCoordinates.x2-k.measureText().width:"right"===this.parent._position&&(k.x=this.parent.lineCoordinates.x2);"left"===this.parent._position&&k.x<this.chart.bounds.x1?k.x=this.chart.bounds.x1:"right"===this.parent._position&&k.x+k.measureText().width>this.chart.bounds.x2?k.x=this.chart.bounds.x2-k.measureText().width:"top"===
|
|
873
|
-
this.parent._position&&k.y-k.fontSize/2<this.chart.bounds.y1?k.y=this.chart.bounds.y1+k.fontSize/2:"bottom"===this.parent._position&&this.parent.lineCoordinates.y2-k.fontSize/2+k.measureText().height>this.chart.bounds.y2&&(k.y=this.chart.bounds.y2-k.height+k.fontSize/2+2);f.globalAlpha=p;0<
|
|
875
|
+
this.parent._position&&k.y-k.fontSize/2<this.chart.bounds.y1?k.y=this.chart.bounds.y1+k.fontSize/2:"bottom"===this.parent._position&&this.parent.lineCoordinates.y2-k.fontSize/2+k.measureText().height>this.chart.bounds.y2&&(k.y=this.chart.bounds.y2-k.height+k.fontSize/2+2);f.globalAlpha=p;0<q&&(f.moveTo(b,d),f.lineTo(e,r),f.stroke(),this._hidden=!1);this.value="bottom"===this.parent._position||"top"===this.parent._position?this.parent.convertPixelToValue(a):this.parent.convertPixelToValue(g)}if("bottom"===
|
|
874
876
|
this.parent._position||"top"===this.parent._position)this._updatedValue=this.parent.convertPixelToValue(m);if("left"===this.parent._position||"right"===this.parent._position)this._updatedValue=this.parent.convertPixelToValue(t);this._textBlock=k;this._label=c;n(c)||this.renderLabel();f.restore();f.globalAlpha=w};da.prototype.renderLabel=function(){this.value>=Math.min(this.parent.viewportMinimum,this.parent.viewportMaximum)&&this.value<=Math.max(this.parent.viewportMinimum,this.parent.viewportMaximum)&&
|
|
875
877
|
(n(this._textBlock)||(n(this._textBlock.text)||!("number"===typeof this._textBlock.text.valueOf()||0<this._textBlock.text.length)||this._hidden)||this._textBlock.render(!0),n(this._label)&&this.dispatchEvent("updated",{chart:this.chart,crosshair:this.options,axis:this.parent,value:this.value},this.parent))};pa(na,T);na.prototype._updateOptions=function(){this.updateOption("enabled");this.updateOption("shared");this.updateOption("animationEnabled");this.updateOption("content");this.updateOption("contentFormatter");
|
|
876
878
|
this.updateOption("reversed");this.updateOption("backgroundColor");this.updateOption("borderColor");this.updateOption("borderThickness");this.updateOption("cornerRadius");this.updateOption("fontSize");this.updateOption("fontColor");this.updateOption("fontFamily");this.updateOption("fontWeight");this.updateOption("fontStyle")};na.prototype._initialize=function(){this.updateOption("updated");this.updateOption("hidden");if(this.enabled){this.container=document.createElement("div");this.container.setAttribute("class",
|
|
@@ -878,21 +880,21 @@ this.updateOption("reversed");this.updateOption("backgroundColor");this.updateOp
|
|
|
878
880
|
a.style.fontWeight="normal";a.style.fontStyle=w?"italic":"normal";a.style.fontSize="14px";a.style.color="#000000";a.style.textShadow="1px 1px 1px rgba(0, 0, 0, 0.1)";a.style.textAlign="left";a.style.border="2px solid gray";a.style.background=w?"rgba(255,255,255,.9)":"rgb(255,255,255)";a.style.textIndent="0px";a.style.whiteSpace="nowrap";a.style.borderRadius="5px";a.style.MozUserSelect="none";a.style.WebkitUserSelect="none";a.style.msUserSelect="none";a.style.userSelect="none";w||(a.style.filter="alpha(opacity = 90)",
|
|
879
881
|
a.style.filter="progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=135, Color='#666666')");a.innerText="Sample Tooltip";this.container.appendChild(a);this.contentDiv=this.container.firstChild;this.container.style.borderRadius=this.contentDiv.style.borderRadius;this.chart._canvasJSContainer.appendChild(this.container)}};na.prototype.mouseMoveHandler=function(a,g){this._lastUpdated&&4>(new Date).getTime()-this._lastUpdated||(this._lastUpdated=(new Date).getTime(),this.chart.resetOverlayedCanvas(),
|
|
880
882
|
this._updateToolTip(a,g),this.enabled&&(this._updatedEventParameters&&!isNaN(this._prevX)&&!isNaN(this._prevY))&&this.dispatchEvent("updated",this._updatedEventParameters,this))};na.prototype._updateToolTip=function(a,g,c){c="undefined"===typeof c?!0:c;this._updateOptions();this.container||this._initialize();this.enabled||this.hide();if(!this.chart.disableToolTip){if("undefined"===typeof a||"undefined"===typeof g){if(isNaN(this._prevX)||isNaN(this._prevY))return;a=this._prevX;g=this._prevY}else this._prevX=
|
|
881
|
-
a,this._prevY=g;var b=null,e=null,d=[],
|
|
882
|
-
null!==k.dataPoint.y&&k.dataSeries.visible&&m.push(k));k=null}if(this.chart.axisX2)for(t=0;t<this.chart.axisX2.length;t++){
|
|
883
|
+
a,this._prevY=g;var b=null,e=null,d=[],r=0;if(this.shared&&this.enabled&&"none"!==this.chart.plotInfo.axisPlacement){var m=[];if(this.chart.axisX)for(var t=0;t<this.chart.axisX.length;t++){for(var r="xySwapped"===this.chart.plotInfo.axisPlacement?this.chart.axisX[t].convertPixelToValue({y:g}):this.chart.axisX[t].convertPixelToValue({x:a}),k=null,b=0;b<this.chart.axisX[t].dataSeries.length;b++)(k=this.chart.axisX[t].dataSeries[b].getDataPointAtX(r,c))&&0<=k.index&&(k.dataSeries=this.chart.axisX[t].dataSeries[b],
|
|
884
|
+
null!==k.dataPoint.y&&k.dataSeries.visible&&m.push(k));k=null}if(this.chart.axisX2)for(t=0;t<this.chart.axisX2.length;t++){r="xySwapped"===this.chart.plotInfo.axisPlacement?this.chart.axisX2[t].convertPixelToValue({y:g}):this.chart.axisX2[t].convertPixelToValue({x:a});k=null;for(b=0;b<this.chart.axisX2[t].dataSeries.length;b++)(k=this.chart.axisX2[t].dataSeries[b].getDataPointAtX(r,c))&&0<=k.index&&(k.dataSeries=this.chart.axisX2[t].dataSeries[b],null!==k.dataPoint.y&&k.dataSeries.visible&&m.push(k));
|
|
883
885
|
k=null}if(0===m.length)return;m.sort(function(a,b){return a.dataSeries.axisX.logarithmic||b.dataSeries.axisX.logarithmic?a.distance-b.distance:a.distance/a.dataSeries.axisX.range-b.distance/b.dataSeries.axisX.range});c=m[0];for(b=0;b<m.length;b++)m[b].dataPoint.x.valueOf()===c.dataPoint.x.valueOf()&&d.push(m[b]);m=null}else{if(b=this.chart.getDataPointAtXY(a,g,c))this.currentDataPointIndex=b.dataPointIndex,this.currentSeriesIndex=b.dataSeries.index;else if(w)if(b=ab(a,g,this.chart._eventManager.ghostCtx),
|
|
884
886
|
0<b&&"undefined"!==typeof this.chart._eventManager.objectMap[b]){b=this.chart._eventManager.objectMap[b];if("legendItem"===b.objectType)return;this.currentSeriesIndex=b.dataSeriesIndex;this.currentDataPointIndex=0<=b.dataPointIndex?b.dataPointIndex:-1}else this.currentDataPointIndex=-1;else this.currentDataPointIndex=-1;if(0<=this.currentSeriesIndex){e=this.chart.data[this.currentSeriesIndex];k={};if(0<=this.currentDataPointIndex)b=e.dataPoints[this.currentDataPointIndex],k.dataSeries=e,k.dataPoint=
|
|
885
|
-
b,k.index=this.currentDataPointIndex,k.distance=Math.abs(b.x-
|
|
886
|
-
"candlestick"===e.type||"ohlc"===e.type||"boxAndWhisker"===e.type))
|
|
887
|
+
b,k.index=this.currentDataPointIndex,k.distance=Math.abs(b.x-r),"waterfall"===e.type&&(k.cumulativeSumYStartValue=e.dataPointEOs[this.currentDataPointIndex].cumulativeSumYStartValue,k.cumulativeSum=e.dataPointEOs[this.currentDataPointIndex].cumulativeSum);else if(this.enabled&&e&&("line"===e.type||"stepLine"===e.type||"spline"===e.type||"area"===e.type||"stepArea"===e.type||"splineArea"===e.type||"stackedArea"===e.type||"stackedArea100"===e.type||"rangeArea"===e.type||"rangeSplineArea"===e.type||
|
|
888
|
+
"candlestick"===e.type||"ohlc"===e.type||"boxAndWhisker"===e.type))r=e.axisX.convertPixelToValue({x:a}),k=e.getDataPointAtX(r,c),n(k)||(k.dataSeries=e,this.currentDataPointIndex=k.index,b=k.dataPoint);else{"toolTip"===this.chart.clearedOverlayedCanvas&&(this.chart.resetOverlayedCanvas(),this.chart.clearedOverlayedCanvas=null);return}if(!n(k)&&!n(k.dataPoint)&&!n(k.dataPoint.y))if(k.dataSeries.axisY)if(0<k.dataPoint.y.length){for(b=c=0;b<k.dataPoint.y.length;b++)k.dataPoint.y[b]<k.dataSeries.axisY.viewportMinimum?
|
|
887
889
|
c--:k.dataPoint.y[b]>k.dataSeries.axisY.viewportMaximum&&c++;c<k.dataPoint.y.length&&c>-k.dataPoint.y.length&&d.push(k)}else"column"===e.type||"bar"===e.type?0>k.dataPoint.y?0>k.dataSeries.axisY.viewportMinimum&&k.dataSeries.axisY.viewportMaximum>=k.dataPoint.y&&d.push(k):k.dataSeries.axisY.viewportMinimum<=k.dataPoint.y&&0<=k.dataSeries.axisY.viewportMaximum&&d.push(k):"bubble"===e.type?(c=this.chart._eventManager.objectMap[e.dataPointIds[k.index]].size/2,k.dataPoint.y>=k.dataSeries.axisY.viewportMinimum-
|
|
888
890
|
c&&k.dataPoint.y<=k.dataSeries.axisY.viewportMaximum+c&&d.push(k)):"waterfall"===e.type?(c=0,k.cumulativeSumYStartValue<k.dataSeries.axisY.viewportMinimum?c--:k.cumulativeSumYStartValue>k.dataSeries.axisY.viewportMaximum&&c++,k.cumulativeSum<k.dataSeries.axisY.viewportMinimum?c--:k.cumulativeSum>k.dataSeries.axisY.viewportMaximum&&c++,2>c&&-2<c&&d.push(k)):(0<=k.dataSeries.type.indexOf("100")||"stackedColumn"===e.type||"stackedBar"===e.type||k.dataPoint.y>=k.dataSeries.axisY.viewportMinimum&&k.dataPoint.y<=
|
|
889
|
-
k.dataSeries.axisY.viewportMaximum)&&d.push(k);else d.push(k)}}if(0<d.length){if(this.highlightObjects(d),this.enabled){c="";c=this.getToolTipInnerHTML({entries:d});if(null!==c){this.contentDiv.innerHTML=c;if(this.isToolTipDefinedInData&&n(this.options.content)&&n(this.options.contentFormatter))for(
|
|
891
|
+
k.dataSeries.axisY.viewportMaximum)&&d.push(k);else d.push(k)}}if(0<d.length){if(this.highlightObjects(d),this.enabled){c="";c=this.getToolTipInnerHTML({entries:d});if(null!==c){this.contentDiv.innerHTML=c;if(this.isToolTipDefinedInData&&n(this.options.content)&&n(this.options.contentFormatter))for(r=this.contentDiv.getElementsByTagName("span"),b=0;b<r.length;b++)r[b]&&(r[b].style.color=r[b].getAttribute("data-color"));r=!1;"none"===this.container.style.display&&(r=!0,this.container.style.display=
|
|
890
892
|
"block");try{this.contentDiv.style.background=this.backgroundColor?this.backgroundColor:w?"rgba(255,255,255,.9)":"rgb(255,255,255)",this.borderColor="waterfall"===d[0].dataSeries.type?this.contentDiv.style.borderRightColor=this.contentDiv.style.borderLeftColor=this.contentDiv.style.borderColor=this.options.borderColor?this.options.borderColor:d[0].dataPoint.color?d[0].dataPoint.color:0<d[0].dataPoint.y?d[0].dataSeries.risingColor:d[0].dataSeries.fallingColor:"error"===d[0].dataSeries.type?this.contentDiv.style.borderRightColor=
|
|
891
893
|
this.contentDiv.style.borderLeftColor=this.contentDiv.style.borderColor=this.options.borderColor?this.options.borderColor:d[0].dataSeries.color?d[0].dataSeries.color:d[0].dataSeries._colorSet[e.index%d[0].dataSeries._colorSet.length]:this.contentDiv.style.borderRightColor=this.contentDiv.style.borderLeftColor=this.contentDiv.style.borderColor=this.options.borderColor?this.options.borderColor:d[0].dataPoint.color?d[0].dataPoint.color:d[0].dataSeries.color?d[0].dataSeries.color:d[0].dataSeries._colorSet[d[0].index%
|
|
892
894
|
d[0].dataSeries._colorSet.length],this.contentDiv.style.borderWidth=this.borderThickness||0===this.borderThickness?this.borderThickness+"px":"2px",this.contentDiv.style.borderRadius=this.cornerRadius||0===this.cornerRadius?this.cornerRadius+"px":"5px",this.container.style.borderRadius=this.contentDiv.style.borderRadius,this.contentDiv.style.fontSize=this.fontSize||0===this.fontSize?this.fontSize+"px":"14px",this.contentDiv.style.color=this.fontColor?this.fontColor:"#000000",this.contentDiv.style.fontFamily=
|
|
893
895
|
this.fontFamily?this.fontFamily:"Calibri, Arial, Georgia, serif;",this.contentDiv.style.fontWeight=this.fontWeight?this.fontWeight:"normal",this.contentDiv.style.fontStyle=this.fontStyle?this.fontStyle:w?"italic":"normal"}catch(l){}"pie"===d[0].dataSeries.type||"doughnut"===d[0].dataSeries.type||"funnel"===d[0].dataSeries.type||"pyramid"===d[0].dataSeries.type||"bar"===d[0].dataSeries.type||"rangeBar"===d[0].dataSeries.type||"stackedBar"===d[0].dataSeries.type||"stackedBar100"===d[0].dataSeries.type?
|
|
894
896
|
a=a-10-this.container.clientWidth:(a=d[0].dataSeries.axisX.convertValueToPixel(d[0].dataPoint.x)-this.container.clientWidth<<0,a-=10);0>a&&(a+=this.container.clientWidth+20);a+this.container.clientWidth>Math.max(this.chart.container.clientWidth,this.chart.width)&&(a=Math.max(0,Math.max(this.chart.container.clientWidth,this.chart.width)-this.container.clientWidth));g=1!==d.length||this.shared||"line"!==d[0].dataSeries.type&&"stepLine"!==d[0].dataSeries.type&&"spline"!==d[0].dataSeries.type&&"area"!==
|
|
895
|
-
d[0].dataSeries.type&&"stepArea"!==d[0].dataSeries.type&&"splineArea"!==d[0].dataSeries.type?"bar"===d[0].dataSeries.type||"rangeBar"===d[0].dataSeries.type||"stackedBar"===d[0].dataSeries.type||"stackedBar100"===d[0].dataSeries.type?d[0].dataSeries.axisX.convertValueToPixel(d[0].dataPoint.x):g:d[0].dataSeries.axisY.convertValueToPixel(d[0].dataPoint.y);g=-g+10;0<g+this.container.clientHeight+5&&(g-=g+this.container.clientHeight+5-0);this.fixMozTransitionDelay(a,g);!this.animationEnabled||
|
|
897
|
+
d[0].dataSeries.type&&"stepArea"!==d[0].dataSeries.type&&"splineArea"!==d[0].dataSeries.type?"bar"===d[0].dataSeries.type||"rangeBar"===d[0].dataSeries.type||"stackedBar"===d[0].dataSeries.type||"stackedBar100"===d[0].dataSeries.type?d[0].dataSeries.axisX.convertValueToPixel(d[0].dataPoint.x):g:d[0].dataSeries.axisY.convertValueToPixel(d[0].dataPoint.y);g=-g+10;0<g+this.container.clientHeight+5&&(g-=g+this.container.clientHeight+5-0);this.fixMozTransitionDelay(a,g);!this.animationEnabled||r?this.disableAnimation():
|
|
896
898
|
(this.enableAnimation(),this.container.style.MozTransition=this.mozContainerTransition);this.positionLeft=a;this.positionBottom=g;this.container.style.left=a+"px";this.container.style.bottom=g+"px"}else this.hide(!1),this.enabled&&this.dispatchEvent("hidden",{chart:this.chart,toolTip:this},this);g=[];for(b=0;b<d.length;b++)g.push({xValue:d[b].dataPoint.x,dataPoint:d[b].dataPoint,dataSeries:d[b].dataSeries,dataPointIndex:d[b].index,dataSeriesIndex:d[b].dataSeries._index});this._updatedEventParameters=
|
|
897
899
|
{chart:this.chart,toolTip:this.options,content:c,entries:g};this._entries=d}}else this.hide(),this.enabled&&this.dispatchEvent("hidden",{chart:this.chart,toolTip:this},this);this._dataSeriesIndex=this._xValue=null}};na.prototype.highlightObjects=function(a){var g=this.chart.overlaidCanvasCtx;n(this.chart.clearedOverlayedCanvas)||"toolTip"===this.chart.clearedOverlayedCanvas?(this.chart.resetOverlayedCanvas(),g.clearRect(0,0,this.chart.width,this.chart.height),this.chart.clearedOverlayedCanvas="toolTip"):
|
|
898
900
|
this.chart.clearedOverlayedCanvas=null;g.save();var c=this.chart.plotArea,b=0;g.beginPath();g.rect(c.x1,c.y1,c.x2-c.x1,c.y2-c.y1);g.clip();for(c=0;c<a.length;c++){var e=a[c];if((e=this.chart._eventManager.objectMap[e.dataSeries.dataPointIds[e.index]])&&e.objectType&&"dataPoint"===e.objectType){var b=this.chart.data[e.dataSeriesIndex],d=b.dataPoints[e.dataPointIndex],m=e.dataPointIndex;!1===d.highlightEnabled||!0!==b.highlightEnabled&&!0!==d.highlightEnabled||("line"===b.type||"stepLine"===b.type||
|
|
@@ -902,21 +904,21 @@ d.size=Math.max(1.5*d.size<<0,10),d.borderColor=d.borderColor||"#FFFFFF",d.borde
|
|
|
902
904
|
g.stroke(),g.beginPath(),g.moveTo(e.x3-b,Math.max(e.y1,e.y4)),g.lineTo(e.x3-b,Math.max(e.y2,e.y3)),g.stroke(),aa(g,e.x1,Math.min(e.y1,e.y4),e.x2,Math.max(e.y1,e.y4),"transparent",2*e.borderThickness,e.color,!1,!1,!1,!1),g.globalAlpha=1):"ohlc"===b.type?(g.globalAlpha=1,g.strokeStyle=e.color,g.lineWidth=2*e.borderThickness,b=0===g.lineWidth%2?0:0.5,g.beginPath(),g.moveTo(e.x3-b,e.y2),g.lineTo(e.x3-b,e.y3),g.stroke(),g.beginPath(),g.moveTo(e.x3,e.y1),g.lineTo(e.x1,e.y1),g.stroke(),g.beginPath(),g.moveTo(e.x3,
|
|
903
905
|
e.y4),g.lineTo(e.x2,e.y4),g.stroke(),g.globalAlpha=1):"boxAndWhisker"===b.type?(g.save(),g.globalAlpha=1,g.strokeStyle=e.stemColor,g.lineWidth=2*e.stemThickness,0<e.stemThickness&&(g.beginPath(),g.moveTo(e.x3,e.y2+e.borderThickness/2),g.lineTo(e.x3,e.y1+e.whiskerThickness/2),g.stroke(),g.beginPath(),g.moveTo(e.x3,e.y4-e.whiskerThickness/2),g.lineTo(e.x3,e.y3-e.borderThickness/2),g.stroke()),g.beginPath(),aa(g,e.x1,Math.max(e.y2,e.y3),e.x2,Math.min(e.y2,e.y3),"transparent",2*e.borderThickness,e.color,
|
|
904
906
|
!1,!1,!1,!1),g.globalAlpha=1,g.strokeStyle=e.whiskerColor,g.lineWidth=2*e.whiskerThickness,0<e.whiskerThickness&&(g.beginPath(),g.moveTo(Math.floor(e.x3-e.whiskerLength/2),e.y4),g.lineTo(Math.ceil(e.x3+e.whiskerLength/2),e.y4),g.stroke(),g.beginPath(),g.moveTo(Math.floor(e.x3-e.whiskerLength/2),e.y1),g.lineTo(Math.ceil(e.x3+e.whiskerLength/2),e.y1),g.stroke()),g.globalAlpha=1,g.strokeStyle=e.lineColor,g.lineWidth=2*e.lineThickness,0<e.lineThickness&&(g.beginPath(),g.moveTo(e.x1,e.y5),g.lineTo(e.x2,
|
|
905
|
-
e.y5),g.stroke()),g.restore(),g.globalAlpha=1):"error"===b.type&&B(g,e.x1,e.y1,e.x2,e.y2,"white",e.whiskerProperties,e.stemProperties,e.isXYSwapped,0.3))}}g.restore();g.globalAlpha=1;g.beginPath()};na.prototype.getToolTipInnerHTML=function(a){a=a.entries;var
|
|
906
|
-
typeof this.content||this.contentFormatter))a={chart:this.chart,toolTip:this.options,entries:a},
|
|
907
|
+
e.y5),g.stroke()),g.restore(),g.globalAlpha=1):"error"===b.type&&B(g,e.x1,e.y1,e.x2,e.y2,"white",e.whiskerProperties,e.stemProperties,e.isXYSwapped,0.3))}}g.restore();g.globalAlpha=1;g.beginPath()};na.prototype.getToolTipInnerHTML=function(a){a=a.entries;var g=null,c=null,b=null,e=0,d="";this.isToolTipDefinedInData=!0;for(var n=0;n<a.length;n++)if(a[n].dataSeries.toolTipContent||a[n].dataPoint.toolTipContent){this.isToolTipDefinedInData=!1;break}if(this.isToolTipDefinedInData&&(this.content&&"function"===
|
|
908
|
+
typeof this.content||this.contentFormatter))a={chart:this.chart,toolTip:this.options,entries:a},g=this.contentFormatter?this.contentFormatter(a):this.content(a);else if(this.shared&&"none"!==this.chart.plotInfo.axisPlacement){for(var m=null,t="",n=0;n<a.length;n++){c=a[n].dataSeries;b=a[n].dataPoint;e=a[n].index;d="";if(0===n&&this.isToolTipDefinedInData&&!this.content){this.chart.axisX&&0<this.chart.axisX.length?t+="undefined"!==typeof this.chart.axisX[0].labels[b.x]?this.chart.axisX[0].labels[b.x]:
|
|
907
909
|
"{x}":this.chart.axisX2&&0<this.chart.axisX2.length&&(t+="undefined"!==typeof this.chart.axisX2[0].labels[b.x]?this.chart.axisX2[0].labels[b.x]:"{x}");t+="</br>";if(!c.visible)continue;t=this.chart.replaceKeywordsWithValue(t,b,c,e)}null===b.toolTipContent||"undefined"===typeof b.toolTipContent&&null===c.options.toolTipContent||("line"===c.type||"stepLine"===c.type||"spline"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"column"===c.type||"bar"===c.type||"scatter"===c.type||
|
|
908
|
-
"stackedColumn"===c.type||"stackedColumn100"===c.type||"stackedBar"===c.type||"stackedBar100"===c.type||"stackedArea"===c.type||"stackedArea100"===c.type||"waterfall"===c.type?(this.chart.axisX&&1<this.chart.axisX.length&&(
|
|
909
|
-
m=c.axisXIndex):"bubble"===c.type?(this.chart.axisX&&1<this.chart.axisX.length&&(
|
|
910
|
-
"error"===c.type?(this.chart.axisX&&1<this.chart.axisX.length&&(
|
|
911
|
-
c.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),
|
|
912
|
-
"<br/>":"X:{axisXIndex}<br/>":""),
|
|
913
|
-
null===
|
|
914
|
-
"column"===c.type||"bar"===c.type||"scatter"===c.type||"stackedColumn"===c.type||"stackedColumn100"===c.type||"stackedBar"===c.type||"stackedBar100"===c.type||"stackedArea"===c.type||"stackedArea100"===c.type||"waterfall"===c.type?
|
|
915
|
-
|
|
916
|
-
"":"'{color}'")+"\"'>"+(b.name?"{name}:</span> ":b.label?"{label}:</span> ":"</span>")+"{y}":"rangeColumn"===c.type||"rangeBar"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type||"error"===c.type?
|
|
917
|
-
c.type||"ohlc"===c.type?
|
|
918
|
-
"function"!==typeof this.content?this.content:"<span data-color='\""+(this.options.fontColor?"":"'{color}'")+"\"'>"+(b.label?"{label}":"{x}")+"</span><br/>Minimum: {y[0]}<br/>Q1: {y[1]}<br/>Q2: {y[4]}<br/>Q3: {y[2]}<br/>Maximum: {y[3]}");null===
|
|
919
|
-
b,c,e)}return
|
|
910
|
+
"stackedColumn"===c.type||"stackedColumn100"===c.type||"stackedBar"===c.type||"stackedBar100"===c.type||"stackedArea"===c.type||"stackedArea100"===c.type||"waterfall"===c.type?(this.chart.axisX&&1<this.chart.axisX.length&&(d+=m!=c.axisXIndex?c.axisX.title?c.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),d+=b.toolTipContent?b.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span data-color='\""+(this.options.fontColor?"":"'{color}'")+"\"'>{name}:</span> {y}",
|
|
911
|
+
m=c.axisXIndex):"bubble"===c.type?(this.chart.axisX&&1<this.chart.axisX.length&&(d+=m!=c.axisXIndex?c.axisX.title?c.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),d+=b.toolTipContent?b.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span data-color='\""+(this.options.fontColor?"":"'{color}'")+"\"'>{name}:</span> {y}, {z}"):"rangeColumn"===c.type||"rangeBar"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type||
|
|
912
|
+
"error"===c.type?(this.chart.axisX&&1<this.chart.axisX.length&&(d+=m!=c.axisXIndex?c.axisX.title?c.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),d+=b.toolTipContent?b.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span data-color='\""+(this.options.fontColor?"":"'{color}'")+"\"'>{name}:</span> {y[0]}, {y[1]}"):"candlestick"===c.type||"ohlc"===c.type?(this.chart.axisX&&1<this.chart.axisX.length&&(d+=m!=c.axisXIndex?c.axisX.title?
|
|
913
|
+
c.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),d+=b.toolTipContent?b.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span data-color='\""+(this.options.fontColor?"":"'{color}'")+"\"'>{name}:</span><br/>Open: {y[0]}<br/>High: {y[1]}<br/>Low: {y[2]}<br/>Close: {y[3]}"):"boxAndWhisker"===c.type&&(this.chart.axisX&&1<this.chart.axisX.length&&(d+=m!=c.axisXIndex?c.axisX.title?c.axisX.title+
|
|
914
|
+
"<br/>":"X:{axisXIndex}<br/>":""),d+=b.toolTipContent?b.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span data-color='\""+(this.options.fontColor?"":"'{color}'")+"\"'>{name}:</span><br/>Minimum: {y[0]}<br/>Q1: {y[1]}<br/>Q2: {y[4]}<br/>Q3: {y[2]}<br/>Maximum: {y[3]}"),
|
|
915
|
+
null===g&&(g=""),c.visible&&(!0===this.reversed?(g=this.chart.replaceKeywordsWithValue(d,b,c,e)+g,n<a.length-1&&(g="</br>"+g)):(g+=this.chart.replaceKeywordsWithValue(d,b,c,e),n<a.length-1&&(g+="</br>"))))}null!==g&&(g=t+g)}else{c=a[0].dataSeries;b=a[0].dataPoint;e=a[0].index;if(null===b.toolTipContent||"undefined"===typeof b.toolTipContent&&null===c.options.toolTipContent)return null;"line"===c.type||"stepLine"===c.type||"spline"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||
|
|
916
|
+
"column"===c.type||"bar"===c.type||"scatter"===c.type||"stackedColumn"===c.type||"stackedColumn100"===c.type||"stackedBar"===c.type||"stackedBar100"===c.type||"stackedArea"===c.type||"stackedArea100"===c.type||"waterfall"===c.type?d=b.toolTipContent?b.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span data-color='\""+(this.options.fontColor?"":"'{color}'")+"\"'>"+(b.label?"{label}":"{x}")+":</span> {y}":"bubble"===c.type?
|
|
917
|
+
d=b.toolTipContent?b.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span data-color='\""+(this.options.fontColor?"":"'{color}'")+"\"'>"+(b.label?"{label}":"{x}")+":</span> {y}, {z}":"pie"===c.type||"doughnut"===c.type||"funnel"===c.type||"pyramid"===c.type?d=b.toolTipContent?b.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span data-color='\""+(this.options.fontColor?
|
|
918
|
+
"":"'{color}'")+"\"'>"+(b.name?"{name}:</span> ":b.label?"{label}:</span> ":"</span>")+"{y}":"rangeColumn"===c.type||"rangeBar"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type||"error"===c.type?d=b.toolTipContent?b.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span data-color='\""+(this.options.fontColor?"":"'{color}'")+"\"'>"+(b.label?"{label}":"{x}")+" :</span> {y[0]}, {y[1]}":"candlestick"===
|
|
919
|
+
c.type||"ohlc"===c.type?d=b.toolTipContent?b.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span data-color='\""+(this.options.fontColor?"":"'{color}'")+"\"'>"+(b.label?"{label}":"{x}")+"</span><br/>Open: {y[0]}<br/>High: {y[1]}<br/>Low: {y[2]}<br/>Close: {y[3]}":"boxAndWhisker"===c.type&&(d=b.toolTipContent?b.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&
|
|
920
|
+
"function"!==typeof this.content?this.content:"<span data-color='\""+(this.options.fontColor?"":"'{color}'")+"\"'>"+(b.label?"{label}":"{x}")+"</span><br/>Minimum: {y[0]}<br/>Q1: {y[1]}<br/>Q2: {y[4]}<br/>Q3: {y[2]}<br/>Maximum: {y[3]}");null===g&&(g="");g+=this.chart.replaceKeywordsWithValue(d,
|
|
921
|
+
b,c,e)}return g};na.prototype.enableAnimation=function(){if(!this.container.style.WebkitTransition){var a=this.getContainerTransition(this.containerTransitionDuration);this.container.style.WebkitTransition=a;this.container.style.MsTransition=a;this.container.style.transition=a;this.container.style.MozTransition=this.mozContainerTransition}};na.prototype.disableAnimation=function(){this.container.style.WebkitTransition&&(this.container.style.WebkitTransition="",this.container.style.MozTransition="",
|
|
920
922
|
this.container.style.MsTransition="",this.container.style.transition="")};na.prototype.hide=function(a){this.container&&(this.container.style.display="none",this.currentSeriesIndex=-1,this._entries=this._dataSeriesIndex=this._xValue=null,this._prevY=this._prevX=NaN,this._updatedEventParameters=null,("undefined"===typeof a||a)&&this.chart.resetOverlayedCanvas())};na.prototype.show=function(a,d,c){this._updateToolTip(a,d,"undefined"===typeof c?!1:c)};na.prototype.showAtIndex=function(a,d){};na.prototype.showAtX=
|
|
921
923
|
function(a,d){if(!this.enabled)return!1;this.chart.clearedOverlayedCanvas=null;this._updateOptions();var c,b,e,h=[];e=!1;d=!n(d)&&0<=d&&d<this.chart.data.length?d:0;if(this.shared)for(var m=0;m<this.chart.data.length;m++)c=this.chart.data[m],(b=c.getDataPointAtX(a,!1))&&(b.dataPoint&&!n(b.dataPoint.y)&&c.visible)&&(b.dataSeries=c,this.chart.data[d].axisX.convertValueToPixel(a)===c.axisX.convertValueToPixel(b.dataPoint.x)&&h.push(b));else c=this.chart.data[d],(b=c.getDataPointAtX(a,!1))&&(b.dataPoint&&
|
|
922
924
|
!n(b.dataPoint.y)&&c.visible)&&(b.dataSeries=c,h.push(b));if(0<h.length){for(m=0;m<h.length;m++)if(b=h[m],(this.shared||0<=b.dataSeries.type.indexOf("100"))&&b.dataPoint.x>=b.dataSeries.axisX.viewportMinimum&&b.dataPoint.x<=b.dataSeries.axisX.viewportMaximum){e=!1;break}else if(b.dataPoint.x<b.dataSeries.axisX.viewportMinimum||b.dataPoint.x>b.dataSeries.axisX.viewportMaximum||b.dataPoint.y<b.dataSeries.axisY.viewportMinimum||b.dataPoint.y>b.dataSeries.axisY.viewportMaximum)e=!0;else{e=!1;break}if(e)return this.hide(),
|
|
@@ -940,7 +942,7 @@ function(){this.animations=[];this.animationRequestId&&this.chart.cancelRequestA
|
|
|
940
942
|
la,c.canvas.height/la)}},xClipAnimation:function(a,d){if(0!==a){var c=d.dest,b=d.source.canvas;c.save();0<a&&c.drawImage(b,0,0,b.width*a,b.height,0,0,b.width*a/la,b.height/la);c.restore()}},fadeInAnimation:function(a,d){if(0!==a){var c=d.dest,b=d.source.canvas;c.save();c.globalAlpha=a;c.drawImage(b,0,0,b.width,b.height,0,0,c.canvas.width/la,c.canvas.height/la);c.restore()}},easing:{linear:function(a,d,c,b){return c*a/b+d},easeOutQuad:function(a,d,c,b){return-c*(a/=b)*(a-2)+d},easeOutQuart:function(a,
|
|
941
943
|
d,c,b){return-c*((a=a/b-1)*a*a*a-1)+d},easeInQuad:function(a,d,c,b){return c*(a/=b)*a+d},easeInQuart:function(a,d,c,b){return c*(a/=b)*a*a*a+d}}},W={drawMarker:function(a,d,c,b,e,h,m,n){if(c){var t=1;c.fillStyle=h?h:"#000000";c.strokeStyle=m?m:"#000000";c.lineWidth=n?n:0;c.setLineDash&&c.setLineDash(G("solid",n));"circle"===b?(c.moveTo(a,d),c.beginPath(),c.arc(a,d,e/2,0,2*Math.PI,!1),h&&c.fill(),n&&(m?c.stroke():(t=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=t))):
|
|
942
944
|
"square"===b?(c.beginPath(),c.rect(a-e/2,d-e/2,e,e),h&&c.fill(),n&&(m?c.stroke():(t=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=t))):"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(),h&&c.fill(),n&&(m?c.stroke():(t=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=t)),c.beginPath()):"cross"===b&&(c.strokeStyle=h,c.lineWidth=e/4,c.beginPath(),c.moveTo(a-e/2,d-e/2),c.lineTo(a+e/
|
|
943
|
-
2,d+e/2),c.stroke(),c.moveTo(a+e/2,d-e/2),c.lineTo(a-e/2,d+e/2),c.stroke())}},drawMarkers:function(a){for(var d=0;d<a.length;d++){var c=a[d];W.drawMarker(c.x,c.y,c.ctx,c.type,c.size,c.color,c.borderColor,c.borderThickness)}}};return m}();t.version="v3.8.
|
|
945
|
+
2,d+e/2),c.stroke(),c.moveTo(a+e/2,d-e/2),c.lineTo(a-e/2,d+e/2),c.stroke())}},drawMarkers:function(a){for(var d=0;d<a.length;d++){var c=a[d];W.drawMarker(c.x,c.y,c.ctx,c.type,c.size,c.color,c.borderColor,c.borderThickness)}}};return m}();t.version="v3.8.11 GA";window.CanvasJS&&(t&&!window.CanvasJS.Chart)&&(window.CanvasJS.Chart=t)})();
|
|
944
946
|
|
|
945
947
|
/*
|
|
946
948
|
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.
|