@canvasjs/charts 3.12.18 → 3.12.19
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 +228 -227
- package/package.json +1 -1
package/canvasjs.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
CanvasJS Chart - v3.12.
|
|
2
|
+
CanvasJS Chart - v3.12.19 GA - https://canvasjs.com/
|
|
3
3
|
Copyright 2025 fenopix
|
|
4
4
|
|
|
5
5
|
--------------------- License Information --------------------
|
|
@@ -17,27 +17,27 @@
|
|
|
17
17
|
/*tslint:disable*/
|
|
18
18
|
/*eslint-disable*/
|
|
19
19
|
/*jshint ignore:start*/
|
|
20
|
-
(function(){function qa(h,m){h.prototype=fb(m.prototype);h.prototype.constructor=h;h.base=m.prototype}function fb(h){function m(){}m.prototype=h;return new m}function Ya(h,m,
|
|
21
|
-
1*m);return h}function ha(h,m){var
|
|
22
|
-
p,
|
|
23
|
-
0,p=Number(m)||0,p=0>p?Math.ceil(p):Math.floor(p);for(0>p&&(p+=
|
|
24
|
-
document.createTextNode("Mpgyi");sa.appendChild(A);pa.appendChild(sa)}sa.style.display="";
|
|
25
|
-
dot:[1,2],dash:[4,2],dashDot:[4,2,1,2],longDash:[8,2],longDashDot:[8,2,1,2],longDashDotDot:[8,2,1,2,1,2]}[h||"solid"])for(var u=0;u<p.length;u++)p[u]*=m;else p=[];return p}function S(h,m,
|
|
26
|
-
m)},h.attachEvent("on"+m,u),u):!1}function jb(h){if(h._menuButton)h.exportEnabled?(
|
|
27
|
-
S(h._menuButton,"touchstart",function(h){m=!0},h.allDOMEventHandlers);S(h._menuButton,"click",function(){"none"!==h._dropdownMenu.style.display||h._dropDownCloseTime&&500>=(new Date).getTime()-h._dropDownCloseTime.getTime()||(h._dropdownMenu.style.display="block",h._menuButton.blur(),h._dropdownMenu.focus())},h.allDOMEventHandlers,!0);S(h._menuButton,"mousemove",function(){m||(
|
|
28
|
-
|
|
29
|
-
{backgroundColor:h.toolbar.itemBackgroundColor,color:h.toolbar.fontColor,boxShadow:"2px 2px 10px "+p});for(var p=h._dropdownMenu.childNodes,Y=[h._cultureInfo.printText,h._cultureInfo.saveJPGText,h._cultureInfo.savePNGText],V=0;V<Y.length;V++)
|
|
30
|
-
"black":"#888888",
|
|
31
|
-
"blur",function(){wa(h._dropdownMenu);h._dropDownCloseTime=new Date},h.allDOMEventHandlers,!0),p=document.createElement("div"),
|
|
32
|
-
h.allDOMEventHandlers,!0),S(p,"mouseout",function(){m||(this.style.backgroundColor=h.toolbar.itemBackgroundColor,this.style.color=h.toolbar.fontColor)},h.allDOMEventHandlers,!0),S(p,"click",function(){h.print();wa(h._dropdownMenu)},h.allDOMEventHandlers,!0),p=document.createElement("div"),
|
|
20
|
+
(function(){function qa(h,m){h.prototype=fb(m.prototype);h.prototype.constructor=h;h.base=m.prototype}function fb(h){function m(){}m.prototype=h;return new m}function Ya(h,m,X){"millisecond"===X?h.setMilliseconds(h.getMilliseconds()+1*m):"second"===X?h.setSeconds(h.getSeconds()+1*m):"minute"===X?h.setMinutes(h.getMinutes()+1*m):"hour"===X?h.setHours(h.getHours()+1*m):"day"===X?h.setDate(h.getDate()+1*m):"week"===X?h.setDate(h.getDate()+7*m):"month"===X?h.setMonth(h.getMonth()+1*m):"year"===X&&h.setFullYear(h.getFullYear()+
|
|
21
|
+
1*m);return h}function ha(h,m){var X=!1;0>h&&(X=!0,h*=-1);h=""+h;for(m=m?m:1;h.length<m;)h="0"+h;return X?"-"+h:h}function Ga(h){if(!h)return h;h=h.replace(/^\s\s*/,"");for(var m=/\s/,X=h.length;m.test(h.charAt(--X)););return h.slice(0,X+1)}function ya(h){h.roundRect=function(h,X,p,u,pa,A,t,C){t&&(this.fillStyle=t);C&&(this.strokeStyle=C);"undefined"===typeof pa&&(pa=5);pa=Math.min(pa,Math.min(p,u)/2);this.lineWidth=A;this.beginPath();this.moveTo(h+pa,X);this.lineTo(h+p-pa,X);this.quadraticCurveTo(h+
|
|
22
|
+
p,X,h+p,X+pa);this.lineTo(h+p,X+u-pa);this.quadraticCurveTo(h+p,X+u,h+p-pa,X+u);this.lineTo(h+pa,X+u);this.quadraticCurveTo(h,X+u,h,X+u-pa);this.lineTo(h,X+pa);this.quadraticCurveTo(h,X,h+pa,X);this.closePath();t&&this.fill();C&&0<A&&this.stroke()}}function Sa(h,m){return h-m}function Q(h){var m=((h&16711680)>>16).toString(16),X=((h&65280)>>8).toString(16);h=((h&255)>>0).toString(16);m=2>m.length?"0"+m:m;X=2>X.length?"0"+X:X;h=2>h.length?"0"+h:h;return"#"+m+X+h}function gb(h,m){var X=this.length>>>
|
|
23
|
+
0,p=Number(m)||0,p=0>p?Math.ceil(p):Math.floor(p);for(0>p&&(p+=X);p<X;p++)if(p in this&&this[p]===h)return p;return-1}function p(h){return null===h||"undefined"===typeof h}function Ca(h){h.indexOf||(h.indexOf=gb);return h}function hb(h){if(va.fSDec)h[la("`eeDwdouMhrudods")](la("e`u`@ohl`uhnoHuds`uhnoDoe"),function(){va._fTWm&&va._fTWm(h)})}function Za(h,m,p){p=p||"normal";var u=h+"_"+m+"_"+p,V=$a[u];if(isNaN(V)){try{if(!sa){var pa=document.body;sa=document.createElement("span");sa.innerHTML="";var A=
|
|
24
|
+
document.createTextNode("Mpgyi");sa.appendChild(A);pa.appendChild(sa)}sa.style.display="";U(sa,{position:"absolute",left:"0px",top:"-20000px",padding:"0px",margin:"0px",border:"none",whiteSpace:"pre",lineHeight:"normal",fontFamily:h,fontSize:m+"px",fontWeight:p});V=Math.round(sa.offsetHeight);sa.style.display="none"}catch(t){V=Math.ceil(1.1*m)}V=Math.max(V,m);$a[u]=V}return V}function I(h,m){var p=[];if(p={solid:[],shortDash:[3,1],shortDot:[1,1],shortDashDot:[3,1,1,1],shortDashDotDot:[3,1,1,1,1,1],
|
|
25
|
+
dot:[1,2],dash:[4,2],dashDot:[4,2,1,2],longDash:[8,2],longDashDot:[8,2,1,2],longDashDotDot:[8,2,1,2,1,2]}[h||"solid"])for(var u=0;u<p.length;u++)p[u]*=m;else p=[];return p}function S(h,m,X,u,V){u=u||[];V=p(V)?ib?{passive:!1,capture:!1}:!1:V;u.push([h,m,X,V]);return h.addEventListener?(h.addEventListener(m,X,V),X):h.attachEvent?(u=function(m){m=m||window.event;m.preventDefault=m.preventDefault||function(){m.returnValue=!1};m.stopPropagation=m.stopPropagation||function(){m.cancelBubble=!0};X.call(h,
|
|
26
|
+
m)},h.attachEvent("on"+m,u),u):!1}function jb(h){if(h._menuButton)h.exportEnabled?(U(h._menuButton,{backgroundColor:h.toolbar.itemBackgroundColor,color:h.toolbar.fontColor}),La(h._menuButton),ta(h,h._menuButton,"menu"),0>=navigator.userAgent.search("MSIE")&&h._menuButton.childNodes[0]&&U(h._menuButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"})):wa(h._menuButton);else if(h.exportEnabled&&u){var m=!1;h._menuButton=document.createElement("button");ta(h,h._menuButton,"menu");h._toolBar.appendChild(h._menuButton);
|
|
27
|
+
S(h._menuButton,"touchstart",function(h){m=!0},h.allDOMEventHandlers);S(h._menuButton,"click",function(){"none"!==h._dropdownMenu.style.display||h._dropDownCloseTime&&500>=(new Date).getTime()-h._dropDownCloseTime.getTime()||(h._dropdownMenu.style.display="block",h._menuButton.blur(),h._dropdownMenu.focus())},h.allDOMEventHandlers,!0);S(h._menuButton,"mousemove",function(){m||(U(h._menuButton,{backgroundColor:h.toolbar.itemBackgroundColorOnHover,color:h.toolbar.fontColorOnHover}),0>=navigator.userAgent.search("MSIE")&&
|
|
28
|
+
U(h._menuButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"}))},h.allDOMEventHandlers,!0);S(h._menuButton,"mouseout",function(){m||(U(h._menuButton,{backgroundColor:h.toolbar.itemBackgroundColor,color:h.toolbar.fontColor}),0>=navigator.userAgent.search("MSIE")&&U(h._menuButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"}))},h.allDOMEventHandlers,!0)}if(h.exportEnabled&&h._dropdownMenu){var p=h.theme&&-1!==h.theme.indexOf("dark")?"black":"#888888";U(h._dropdownMenu,
|
|
29
|
+
{backgroundColor:h.toolbar.itemBackgroundColor,color:h.toolbar.fontColor,boxShadow:"2px 2px 10px "+p});for(var p=h._dropdownMenu.childNodes,Y=[h._cultureInfo.printText,h._cultureInfo.saveJPGText,h._cultureInfo.savePNGText],V=0;V<Y.length;V++)U(p[V],{backgroundColor:h.toolbar.itemBackgroundColor,color:h.toolbar.fontColor}),p[V].innerHTML=Y[V]}else!h._dropdownMenu&&(h.exportEnabled&&u)&&(m=!1,h._dropdownMenu=document.createElement("div"),h._dropdownMenu.setAttribute("tabindex",-1),p=h.theme&&-1!==h.theme.indexOf("dark")?
|
|
30
|
+
"black":"#888888",U(h._dropdownMenu,{position:"absolute",zIndex:1,userSelect:"none",MozUserSeelct:"none",WebkitUserSelect:"none",msUserSelect:"none",cursor:"pointer",right:"0px",top:"25px",minWidth:"120px",outline:0,fontSize:"14px",fontFamily:"Arial, Helvetica, sans-serif",padding:"5px 0px 5px 0px",textAlign:"left",lineHeight:"10px",backgroundColor:h.toolbar.itemBackgroundColor,boxShadow:"2px 2px 10px "+p}),h._dropdownMenu.style.display="none",h._toolBar.appendChild(h._dropdownMenu),S(h._dropdownMenu,
|
|
31
|
+
"blur",function(){wa(h._dropdownMenu);h._dropDownCloseTime=new Date},h.allDOMEventHandlers,!0),p=document.createElement("div"),U(p,{padding:"12px 8px 12px 8px"}),p.innerHTML=h._cultureInfo.printText,p.style.backgroundColor=h.toolbar.itemBackgroundColor,p.style.color=h.toolbar.fontColor,h._dropdownMenu.appendChild(p),S(p,"touchstart",function(h){m=!0},h.allDOMEventHandlers),S(p,"mousemove",function(){m||(this.style.backgroundColor=h.toolbar.itemBackgroundColorOnHover,this.style.color=h.toolbar.fontColorOnHover)},
|
|
32
|
+
h.allDOMEventHandlers,!0),S(p,"mouseout",function(){m||(this.style.backgroundColor=h.toolbar.itemBackgroundColor,this.style.color=h.toolbar.fontColor)},h.allDOMEventHandlers,!0),S(p,"click",function(){h.print();wa(h._dropdownMenu)},h.allDOMEventHandlers,!0),p=document.createElement("div"),U(p,{padding:"12px 8px 12px 8px"}),p.innerHTML=h._cultureInfo.saveJPGText,p.style.backgroundColor=h.toolbar.itemBackgroundColor,p.style.color=h.toolbar.fontColor,h._dropdownMenu.appendChild(p),S(p,"touchstart",function(h){m=
|
|
33
33
|
!0},h.allDOMEventHandlers),S(p,"mousemove",function(){m||(this.style.backgroundColor=h.toolbar.itemBackgroundColorOnHover,this.style.color=h.toolbar.fontColorOnHover)},h.allDOMEventHandlers,!0),S(p,"mouseout",function(){m||(this.style.backgroundColor=h.toolbar.itemBackgroundColor,this.style.color=h.toolbar.fontColor)},h.allDOMEventHandlers,!0),S(p,"click",function(){h.exportChart({format:"jpeg",fileName:h.exportFileName});wa(h._dropdownMenu)},h.allDOMEventHandlers,!0),p=document.createElement("div"),
|
|
34
|
-
|
|
35
|
-
this.style.color=h.toolbar.fontColor)},h.allDOMEventHandlers,!0),S(p,"click",function(){h.exportChart({format:"png",fileName:h.exportFileName});wa(h._dropdownMenu)},h.allDOMEventHandlers,!0))}function ab(h,m,p){h*=ma;m*=ma;h=p.getImageData(h,m,2,2).data;m=!0;for(p=0;4>p;p++)if(h[p]!==h[p+4]|h[p]!==h[p+8]|h[p]!==h[p+12]){m=!1;break}return m?h[0]<<16|h[1]<<8|h[2]:0}function ka(h,m,p){return h in m?m[h]:p[h]}function Ma(h,m,
|
|
36
|
-
Na=Y.webkitBackingStorePixelRatio||Y.mozBackingStorePixelRatio||Y.msBackingStorePixelRatio||Y.oBackingStorePixelRatio||Y.backingStorePixelRatio||1,ma=Ta/Na,h.width=m*ma,h.height=
|
|
37
|
-
h.creditText){h._creditLink||(h._creditLink=document.createElement("a"),h._creditLink.setAttribute("class","canvasjs-chart-credit"),h._creditLink.setAttribute("title","JavaScript Charts"),
|
|
34
|
+
U(p,{padding:"12px 8px 12px 8px"}),p.innerHTML=h._cultureInfo.savePNGText,p.style.backgroundColor=h.toolbar.itemBackgroundColor,p.style.color=h.toolbar.fontColor,h._dropdownMenu.appendChild(p),S(p,"touchstart",function(h){m=!0},h.allDOMEventHandlers),S(p,"mousemove",function(){m||(this.style.backgroundColor=h.toolbar.itemBackgroundColorOnHover,this.style.color=h.toolbar.fontColorOnHover)},h.allDOMEventHandlers,!0),S(p,"mouseout",function(){m||(this.style.backgroundColor=h.toolbar.itemBackgroundColor,
|
|
35
|
+
this.style.color=h.toolbar.fontColor)},h.allDOMEventHandlers,!0),S(p,"click",function(){h.exportChart({format:"png",fileName:h.exportFileName});wa(h._dropdownMenu)},h.allDOMEventHandlers,!0))}function ab(h,m,p){h*=ma;m*=ma;h=p.getImageData(h,m,2,2).data;m=!0;for(p=0;4>p;p++)if(h[p]!==h[p+4]|h[p]!==h[p+8]|h[p]!==h[p+12]){m=!1;break}return m?h[0]<<16|h[1]<<8|h[2]:0}function ka(h,m,p){return h in m?m[h]:p[h]}function Ma(h,m,X,Y){u&&bb?(Y=!p(Y)&&Y?h.getContext("2d",{willReadFrequently:!0}):h.getContext("2d"),
|
|
36
|
+
Na=Y.webkitBackingStorePixelRatio||Y.mozBackingStorePixelRatio||Y.msBackingStorePixelRatio||Y.oBackingStorePixelRatio||Y.backingStorePixelRatio||1,ma=Ta/Na,h.width=m*ma,h.height=X*ma,Ta!==Na&&(h.style.width=m+"px",h.style.height=X+"px",Y.scale(ma,ma))):(h.width=m,h.height=X)}function kb(h){if(!lb){var m=!1,p=!1;"undefined"===typeof ra.Chart.creditHref?(h.creditHref=la("iuuqr;..b`ow`rkr/bnl."),h.creditText=la("B`ow`rKR/bnl")):(m=h.updateOption("creditText"),p=h.updateOption("creditHref"));if(h.creditHref&&
|
|
37
|
+
h.creditText){h._creditLink||(h._creditLink=document.createElement("a"),h._creditLink.setAttribute("class","canvasjs-chart-credit"),h._creditLink.setAttribute("title","JavaScript Charts"),U(h._creditLink,{outline:"none",margin:"0px",position:"absolute",right:"2px",top:h.height-14+"px",color:"dimgrey",textDecoration:"none",fontSize:"11px",fontFamily:"Calibri, Lucida Grande, Lucida Sans Unicode, Arial, sans-serif"}),h._creditLink.setAttribute("tabIndex",-1),h._creditLink.setAttribute("target","_blank"));
|
|
38
38
|
if(0===h.renderCount||m||p)h._creditLink.setAttribute("href",h.creditHref),h._creditLink.innerHTML=h.creditText;h._creditLink&&h.creditHref&&h.creditText?(h._creditLink.parentElement||h._canvasJSContainer.appendChild(h._creditLink),h._creditLink.style.top=h.height-14+"px"):h._creditLink.parentElement&&h._canvasJSContainer.removeChild(h._creditLink)}}}function ua(h,m,p){Ha&&(this.canvasCount|=0,window.console.log(++this.canvasCount));var Y=document.createElement("canvas");Y.setAttribute("class","canvasjs-chart-canvas");
|
|
39
|
-
Ma(Y,h,m,p);u||"undefined"===typeof G_vmlCanvasManager||G_vmlCanvasManager.initElement(Y);return Y}function
|
|
40
|
-
m.getAttribute("state")!==p&&(m.setAttribute("state",p),m.setAttribute("type","button"),
|
|
39
|
+
Ma(Y,h,m,p);u||"undefined"===typeof G_vmlCanvasManager||G_vmlCanvasManager.initElement(Y);return Y}function U(h,m){for(var p in m)h.style[p]=m[p]}function cb(h){return h.currentStyle?h.currentStyle:window&&window.getComputedStyle?window.getComputedStyle(h,null):h.style}function ta(h,m,p){m.getAttribute("state")||(m.style.backgroundColor=h.toolbar.itemBackgroundColor,m.style.color=h.toolbar.fontColor,m.style.border="none",U(m,{WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"}));
|
|
40
|
+
m.getAttribute("state")!==p&&(m.setAttribute("state",p),m.setAttribute("type","button"),U(m,{padding:"5px 12px",cursor:"pointer","float":"left",width:"40px",height:"25px",outline:"0px",verticalAlign:"baseline",lineHeight:"0"}),m.innerHTML="<img src='"+mb[p].image+"' alt='"+h._cultureInfo[p+"Text"]+"' />",U(m.childNodes[0],{height:"95%",pointerEvents:"none"}));m.setAttribute("title",h._cultureInfo[p+"Text"])}function La(){for(var h=null,m=0;m<arguments.length;m++)h=arguments[m],h.style&&(h.style.display=
|
|
41
41
|
"inline")}function wa(){for(var h=null,m=0;m<arguments.length;m++)(h=arguments[m])&&h.style&&(h.style.display="none")}function Ua(h,m,p,u,V){if(null===h||"undefined"===typeof h)return"undefined"===typeof p?m:p;h=parseFloat(h.toString())*(0<=h.toString().indexOf("%")?m/100:1);"undefined"!==typeof u&&(h=Math.min(u,h),"undefined"!==typeof V&&(h=Math.max(V,h)));return!isNaN(h)&&h<=m&&0<=h?h:"undefined"===typeof p?m:p}function P(h,m,u,Y,V){this._defaultsKey=h;this._themeOptionsKey=m;this._index=Y;this.parent=
|
|
42
42
|
V;this._eventListeners=[];h={};this.theme&&p(this.parent)&&p(m)&&p(Y)?h=p(this.predefinedThemes[this.theme])?this.predefinedThemes.light1:this.predefinedThemes[this.theme]:this.parent&&(this.parent.themeOptions&&this.parent.themeOptions[m])&&(null===Y?h=this.parent.themeOptions[m]:0<this.parent.themeOptions[m].length&&(Y=Math.min(this.parent.themeOptions[m].length-1,Y),h=this.parent.themeOptions[m][Y]));this.themeOptions=h;this.options=u?u:{_isPlaceholder:!0};this.setOptions(this.options,h)}function Da(h,
|
|
43
43
|
m,p,u,V){"undefined"===typeof V&&(V=0);this._padding=V;this._x1=h;this._y1=m;this._x2=p;this._y2=u;this._rightOccupied=this._leftOccupied=this._bottomOccupied=this._topOccupied=this._padding}function ja(h,m){ja.base.constructor.call(this,"TextBlock",null,m,null,null);this.ctx=h;this._isDirty=!0;this._wrappedText=null;this._initialize()}function Va(h,m){Va.base.constructor.call(this,"Toolbar","toolbar",m,null,h);this.chart=h;this.canvas=h.canvas;this.ctx=this.chart.ctx;this.optionsName="toolbar"}function za(h,
|
|
@@ -91,17 +91,17 @@ lineColor:D,tickThickness:1,tickColor:D,gridThickness:1,gridColor:D,stripLines:[
|
|
|
91
91
|
fontSize:14,fontColor:ca,fontWeight:"bold",verticalAlign:"bottom",horizontalAlign:"center"},toolTip:{fontFamily:t,fontSize:14,fontStyle:"normal",cornerRadius:0,borderThickness:1,fontColor:O,backgroundColor:"rgba(0, 0, 0, .7)"}},theme1:Xa,theme2:db,theme3:Xa},K={numberDuration:1,yearDuration:314496E5,monthDuration:2592E6,weekDuration:6048E5,dayDuration:864E5,hourDuration:36E5,minuteDuration:6E4,secondDuration:1E3,millisecondDuration:1,dayOfWeekFromInt:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")};
|
|
92
92
|
(function(){va.fSDec=function(h){for(var m="",p=0;p<h.length;p++)m+=String.fromCharCode(Math.ceil(h.length/57/5)^h.charCodeAt(p));return m};delete ra[va.fSDec("Bi`su")][va.fSDec("bsdehuIsdg")];va.pro={sCH:ra[va.fSDec("Bi`su")][va.fSDec("bsdehuIsdg")]}})();var ib=function(){var h=!1;try{var m=Object.defineProperty&&Object.defineProperty({},"passive",{get:function(){h=!0;return!1}});window.addEventListener&&(window.addEventListener("test",null,m),window.removeEventListener("test",null,m))}catch(p){h=
|
|
93
93
|
!1}return h}(),$a={},sa=null,nb=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))},xa=function(h){h.width=1;h.height=1;h.getContext("2d")&&h.getContext("2d").clearRect(0,0,1,1)},ob=function(h,m,p){m=Math.min(this.width,this.height);return Math.max("theme4"===this.theme?0:300<=m?12:11,Math.round(m*(h/400)))},Ba=function(){var h=/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,
|
|
94
|
-
m="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="Sun Mon Tue Wed Thu Fri Sat".split(" "),u="January February March April May June July August September October November December".split(" "),V="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(C,I,D){var Q=D?D.days:m,
|
|
95
|
-
p,K=D?D.shortMonths:V;D="";var P=!1;C=C&&C.getTime?C:C?new Date(C):new Date;if(isNaN(C))throw SyntaxError("invalid date");"UTC:"===I.slice(0,4)&&(I=I.slice(4),P=!0);D=P?"getUTC":"get";var O=C[D+"Date"](),M=C[D+"Day"]()
|
|
96
|
-
1;case "MM":return ha(
|
|
94
|
+
m="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="Sun Mon Tue Wed Thu Fri Sat".split(" "),u="January February March April May June July August September October November December".split(" "),V="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(C,I,D){var Q=D?D.days:m,U=D?D.months:u,S=D?D.shortDays:
|
|
95
|
+
p,K=D?D.shortMonths:V;D="";var P=!1;C=C&&C.getTime?C:C?new Date(C):new Date;if(isNaN(C))throw SyntaxError("invalid date");"UTC:"===I.slice(0,4)&&(I=I.slice(4),P=!0);D=P?"getUTC":"get";var O=C[D+"Date"](),M=C[D+"Day"](),aa=C[D+"Month"](),a=C[D+"FullYear"](),g=C[D+"Hours"](),b=C[D+"Minutes"](),c=C[D+"Seconds"](),d=C[D+"Milliseconds"](),e=P?0:C.getTimezoneOffset();return D=I.replace(h,function(s){switch(s){case "D":return O;case "DD":return ha(O,2);case "DDD":return S[M];case "DDDD":return Q[M];case "M":return aa+
|
|
96
|
+
1;case "MM":return ha(aa+1,2);case "MMM":return K[aa];case "MMMM":return U[aa];case "Y":return parseInt(String(a).slice(-2));case "YY":return ha(String(a).slice(-2),2);case "YYY":return ha(String(a).slice(-3),3);case "YYYY":return ha(a,4);case "h":return g%12||12;case "hh":return ha(g%12||12,2);case "H":return g;case "HH":return ha(g,2);case "m":return b;case "mm":return ha(b,2);case "s":return c;case "ss":return ha(c,2);case "f":return ha(String(d),3).slice(0,1);case "ff":return ha(String(d),3).slice(0,
|
|
97
97
|
2);case "fff":return ha(String(d),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 P?"UTC":(String(C).match(t)||[""]).pop().replace(A,"");case "z":return(0<e?"-":"+")+Math.floor(Math.abs(e)/60);case "zz":return(0<e?"-":"+")+ha(Math.floor(Math.abs(e)/60),2);case "zzz":return(0<e?"-":"+")+ha(Math.floor(Math.abs(e)/60),2)+ha(Math.abs(e)%60,2);default:return s.slice(1,s.length-1)}})}}(),pb=function(h){var m=
|
|
98
98
|
0>h;if(1>Math.abs(h)){var p=parseInt(h.toString().split("e-")[1]);p&&(h=(m?-1*h:h)*Math.pow(10,p-1),h="0."+Array(p).join("0")+h.toString().substring(2),h=m?"-"+h:h)}else p=parseInt(h.toString().split("+")[1]),20<p&&(p-=20,h/=Math.pow(10,p),h=h.toString()+Array(p+1).join("0"));return String(h)},fa=function(h,m,p){if(null===h)return"";if(!isFinite(h))return h;h=Number(h);var u=0>h?!0:!1;u&&(h*=-1);var V=p?p.decimalSeparator:".",t=p?p.digitGroupSeparator:",",A="";m=String(m);var A=1,C=p="",D=-1,I=[],
|
|
99
|
-
Q=[],
|
|
100
|
-
1),O=0===h?0:0===m?-(
|
|
99
|
+
Q=[],U=0,S=0,K=0,P=!1,O=0,C=m.match(/"[^"]*"|'[^']*'|[eE][+-]*[0]+|[,]+[.]|\u2030|./g);m=null;for(var M=0;C&&M<C.length;M++)if(m=C[M],"."===m&&0>D)D=M;else{if("%"===m)A*=100;else if("\u2030"===m){A*=1E3;continue}else if(","===m[0]&&"."===m[m.length-1]){A/=Math.pow(1E3,m.length-1);D=M+m.length-1;continue}else"E"!==m[0]&&"e"!==m[0]||"0"!==m[m.length-1]||(P=!0);0>D?(I.push(m),"#"===m||"0"===m?U++:","===m&&K++):(Q.push(m),"#"!==m&&"0"!==m||S++)}P&&(m=Math.floor(h),C=-Math.floor(Math.log(h)/Math.LN10+
|
|
100
|
+
1),O=0===h?0:0===m?-(U+C):pb(m).length-U,A/=Math.pow(10,O));0>D&&(D=M);A=(h*A).toFixed(S);m=A.split(".");A=(m[0]+"").split("");h=(m[1]+"").split("");A&&"0"===A[0]&&A.shift();for(P=C=M=S=D=0;0<I.length;)if(m=I.pop(),"#"===m||"0"===m)if(D++,D===U){var aa=A,A=[];if("0"===m)for(m=U-S-(aa?aa.length:0);0<m;)aa.unshift("0"),m--;for(;0<aa.length;)p=aa.pop()+p,P++,0===P%C&&(M===K&&0<aa.length)&&(p=t+p)}else 0<A.length?(p=A.pop()+p,S++,P++):"0"===m&&(p="0"+p,S++,P++),0===P%C&&(M===K&&0<A.length)&&(p=t+p);else"E"!==
|
|
101
101
|
m[0]&&"e"!==m[0]||"0"!==m[m.length-1]||!/[eE][+-]*[0]+/.test(m)?","===m?(M++,C=P,P=0,0<A.length&&(p=t+p)):p=1<m.length&&('"'===m[0]&&'"'===m[m.length-1]||"'"===m[0]&&"'"===m[m.length-1])?m.slice(1,m.length-1)+p:m+p:(m=0>O?m.replace("+","").replace("-",""):m.replace("-",""),p+=m.replace(/[0]+/,function(a){return ha(O,a.length)}));t="";for(I=!1;0<Q.length;)m=Q.shift(),"#"===m||"0"===m?0<h.length&&0!==Number(h.join(""))?(t+=h.shift(),I=!0):"0"===m&&(t+="0",I=!0):1<m.length&&('"'===m[0]&&'"'===m[m.length-
|
|
102
102
|
1]||"'"===m[0]&&"'"===m[m.length-1])?t+=m.slice(1,m.length-1):"E"!==m[0]&&"e"!==m[0]||"0"!==m[m.length-1]||!/[eE][+-]*[0]+/.test(m)?t+=m:(m=0>O?m.replace("+","").replace("-",""):m.replace("-",""),t+=m.replace(/[0]+/,function(a){return ha(O,a.length)}));p+=(I?V:"")+t;return u?"-"+p:p},Pa=function(h){var m=0,p=0;h=h||window.event;h.offsetX||0===h.offsetX?(m=h.offsetX,p=h.offsetY):h.layerX||0==h.layerX?(m=h.layerX,p=h.layerY):(m=h.pageX-h.target.offsetLeft,p=h.pageY-h.target.offsetTop);return{x:m,y:p}},
|
|
103
|
-
bb=!0,Ta=window.devicePixelRatio||1,Na=1,ma=bb?Ta/Na:1,da=function(h,m,p,u,t,C,A,D,I,Q,
|
|
104
|
-
K,p+K),h.lineTo(u,p),h.closePath(),A=h.createLinearGradient((u+m)/2,p+K,(u+m)/2,p),A.addColorStop(0,C),A.addColorStop(1,"rgba(255, 255, 255, .4)"),h.fillStyle=A,h.fill(),h.restore());!0===Q&&(h.save(),h.beginPath(),h.moveTo(m,t),h.lineTo(m+K,t-K),h.lineTo(u-K,t-K),h.lineTo(u,t),h.closePath(),A=h.createLinearGradient((u+m)/2,t-K,(u+m)/2,t),A.addColorStop(0,C),A.addColorStop(1,"rgba(255, 255, 255, .4)"),h.fillStyle=A,h.fill(),h.restore());!0===
|
|
103
|
+
bb=!0,Ta=window.devicePixelRatio||1,Na=1,ma=bb?Ta/Na:1,da=function(h,m,p,u,t,C,A,D,I,Q,U,S,P){"undefined"===typeof P&&(P=1);A=A||0;D=D||"black";var K=15<u-m&&15<t-p?8:0.35*Math.min(u-m,t-p);h.beginPath();h.moveTo(m,p);h.save();h.fillStyle=C;h.globalAlpha=P;h.fillRect(m,p,u-m,t-p);h.globalAlpha=1;0<A&&(P=0===A%2?0:0.5,h.beginPath(),h.lineWidth=A,h.strokeStyle=D,h.moveTo(m,p),h.rect(m-P,p-P,u-m+2*P,t-p+2*P),h.stroke());h.restore();!0===I&&(h.save(),h.beginPath(),h.moveTo(m,p),h.lineTo(m+K,p+K),h.lineTo(u-
|
|
104
|
+
K,p+K),h.lineTo(u,p),h.closePath(),A=h.createLinearGradient((u+m)/2,p+K,(u+m)/2,p),A.addColorStop(0,C),A.addColorStop(1,"rgba(255, 255, 255, .4)"),h.fillStyle=A,h.fill(),h.restore());!0===Q&&(h.save(),h.beginPath(),h.moveTo(m,t),h.lineTo(m+K,t-K),h.lineTo(u-K,t-K),h.lineTo(u,t),h.closePath(),A=h.createLinearGradient((u+m)/2,t-K,(u+m)/2,t),A.addColorStop(0,C),A.addColorStop(1,"rgba(255, 255, 255, .4)"),h.fillStyle=A,h.fill(),h.restore());!0===U&&(h.save(),h.beginPath(),h.moveTo(m,p),h.lineTo(m+K,p+
|
|
105
105
|
K),h.lineTo(m+K,t-K),h.lineTo(m,t),h.closePath(),A=h.createLinearGradient(m+K,(t+p)/2,m,(t+p)/2),A.addColorStop(0,C),A.addColorStop(1,"rgba(255, 255, 255, 0.1)"),h.fillStyle=A,h.fill(),h.restore());!0===S&&(h.save(),h.beginPath(),h.moveTo(u,p),h.lineTo(u-K,p+K),h.lineTo(u-K,t-K),h.lineTo(u,t),A=h.createLinearGradient(u-K,(t+p)/2,u,(t+p)/2),A.addColorStop(0,C),A.addColorStop(1,"rgba(255, 255, 255, 0.1)"),h.fillStyle=A,A.addColorStop(0,C),A.addColorStop(1,"rgba(255, 255, 255, 0.1)"),h.fillStyle=A,h.fill(),
|
|
106
106
|
h.closePath(),h.restore())},la=function(h){for(var p="",u=0;u<h.length;u++)p+=String.fromCharCode(Math.ceil(h.length/57/5)^h.charCodeAt(u));return p},lb=window&&(window[la("mnb`uhno")]&&window[la("mnb`uhno")].href&&window[la("mnb`uhno")].href.indexOf&&(-1!==window[la("mnb`uhno")].href.indexOf(la("b`ow`rkr/bnl"))||-1!==window[la("mnb`uhno")].href.indexOf(la("gdonqhy/bnl"))||-1!==window[la("mnb`uhno")].href.indexOf(la("gheemd"))))&&-1===window[la("mnb`uhno")].href.indexOf(la("gheemd")),mb={reset:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAeCAYAAABJ/8wUAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAPjSURBVFhHxVdJaFNRFP1J/jwkP5MxsbaC1WJEglSxOFAXIsFpVRE3ggi1K90obioRRBA33XXnQnciirhQcMCdorgQxBkXWlREkFKsWkv5npvckp/XnzRpKh64kLw733fffe9L/wrL0+mVUdO8uTSZ3MBL/we2qg4rkuSpodCELstXE46ziVkLQ6FQcGOmeSSq6wd4aV50d3drWjj8kQKZJTUc9kxFGenv79dZrDksTSTWWJp2QYtEPiErysyzdX0LsxsCQR8keX8gs6RHIk8ysdgKFg2G53mhuOPsshTlBjKaFo1g7SqLNoShKLdFXT8huQ/paLSbxatYnc2mHMM4hr18Vi8TIvCmXF3vYrW6cF23gGTOk0M1wA4RKvOmq6vLZRVJipvmSWT6tZ6CSEYkco5V50VPT4+D7RwOqi6RiSZm0fJ+vggSqkeoypdsNmuyelNwbXsbgvkWYMtzDWNvWaijoyOBqE+hVK8abcssUeXQ/YfKyi0gFYv1Ipgfoj34fYGTJLOYJA0ODirok32GLN8XhUWCwSes1hIwBg6LydJ/tEeRRapAdUp+wSAiZchtZZWWgAZ+JNpD8peYXQVK9UwUxNpzOK8pq97kURZhYTCKBwPD7h2zK+js7Myi7D8Fod+0TkMI8+EMAngLGc/WtBFWawkFHFnoj/t9KLgGmF0B3QfkxC+EarxkdhnFYlFLY06USqUwL7UMjICHfh/wOc2sCqhpxGbCkLvL7EUDbF73+6DkmVWB6zi7xUDQSLeYvWjAILvm9zEnkJhlbRcDQZcv6Kg2AipyT/Axw6wKlqVSqxDdjF8Izfod13qURdrG/nxehY+xGh+h0CSzKygGvSNQIcc097BI24jb9hax6kj2E7OrMFX1il+ICEf2NrPbhiXLl+fYl+U7zK4iYdsDcyLGf+ofFlkwcN+s10KhmpuYhhtm0hCLVIFL0MDsqNlDIqy9x2CLs1jL6OvrI7vPRbtohXG6eFmsFnHDGAp6n9AgyuVySRZrGvROxRgIfLXhzjrNYnNBUxNX/dMgRWT1mt4XLDovaApD53E9W3ilNX5M55LJHpRtIsgAvciR4WWcgK2Dvb1YqgXevmF8z2zEBTcKG39EfSKsT9EbhVUaI2FZO+oZIqImxol6j66/hcAu4sSN4vc1ZPoKeoE6RGhYL2YYA+ymOSSi0Z0wWntbtkGUWCvfSDXIxONraZ/FY90KUfNTpfC5spnNLgxoYNnR9RO4F8ofXEHOgogCQE99w+fF2Xw+b7O59rEOsyRqGEfpVoaDMQQ1CZrG46bcM6AZ0C/wPqNfHliqejyTySxh9TqQpL+xmbIlkB9SlAAAAABJRU5ErkJggg=="},
|
|
107
107
|
pan:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAICSURBVEhLxZbPahNRGMUn/5MpuAiBEAIufQGfzr5E40YptBXajYzudCEuGqS+gGlrFwquDGRTutBdYfydzJ3LzeQmJGZue+Dw/Z17Mnfmu5Pof9Hr9Z61Wq0bWZMKj263O6xWq99wU9lOpzPMKgEhEcRucNOcioOK+0RzBhNvt9tPV4nmVF19+OWhVqt9xXgFXZq+8lCv119UKpUJ7iX2FmvFTKz8RH34YdBsNk8wVtjE4fGYwm8wrrDi3WBG5oKXZGRSS9hGuNFojLTe2lFz5xThWZIktayyiE2FdT3rzXBXz7krKiL8c17wAKFDjCus2AvW+YGZ9y2JF0VFRuMPfI//rsCE/C+s26s4gQu9ul7r4NteKx7H8XOC724xNNGbaNu++IrBqbOV7Tj3FgMRvc/YKOr3+3sE47wgEt/Bl/gaK5cHbNU11vYSXylfpK7XOvjuumPp4Wcoipu30Qsez2uMXYz4lfI+mOmwothY+SLiXJy7mKVpWs3Si0CoOMfeI9Od43Wic+jO+ZVv+crsm9QSNhUW9LXSeoPBYLXopthGuFQgdIxxhY+UDwlt1x5CZ1hX+NTUdt/OIvjKaDSmuOJfaIVNPKX+W18j/PLA2/kR44p5Sd8HbHngT/yTfNRWUXX14ZcL3wmX0+TLf8YO7CGT8yFE5zB3/gney25/OETRP9CtPDFe5jShAAAAAElFTkSuQmCC"},
|
|
@@ -140,7 +140,7 @@ Aa.colorSet1,this._canvasJSContainer=document.createElement("div"),this._canvasJ
|
|
|
140
140
|
"absolute",this.canvas.style.WebkitUserSelect="none",this.canvas.style.MozUserSelect="none",this.canvas.style.msUserSelect="none",this.canvas.style.userSelect="none",this.canvas.getContext&&(this._canvasJSContainer.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.ctx.textBaseline="top",ya(this.ctx),this._preRenderCtx=this._preRenderCanvas.getContext("2d"),this._preRenderCtx.textBaseline="top",ya(this._preRenderCtx),u?this.plotArea.ctx=this.ctx:(this.plotArea.canvas=ua(a,g),this.plotArea.canvas.style.position=
|
|
141
141
|
"absolute",this.plotArea.canvas.setAttribute("class","plotAreaCanvas"),this._canvasJSContainer.appendChild(this.plotArea.canvas),this.plotArea.ctx=this.plotArea.canvas.getContext("2d")),this.overlaidCanvas=ua(a,g),this.overlaidCanvas.style.position="absolute",this.overlaidCanvas.style.webkitTapHighlightColor="transparent",this.overlaidCanvas.style.WebkitUserSelect="none",this.overlaidCanvas.style.MozUserSelect="none",this.overlaidCanvas.style.msUserSelect="none",this.overlaidCanvas.style.userSelect=
|
|
142
142
|
"none",this.overlaidCanvas.getContext&&(this._canvasJSContainer.appendChild(this.overlaidCanvas),this.overlaidCanvasCtx=this.overlaidCanvas.getContext("2d"),this.overlaidCanvasCtx.textBaseline="top",ya(this.overlaidCanvasCtx)),this._eventManager=new ia(this),this.windowResizeHandler=S(window,"resize",function(){c._updateSize()&&(c.render(),c.isNavigator&&(c.stockChart&&c.stockChart.navigator&&c.stockChart.navigator.enabled)&&c.stockChart.navigator._updateSlider(c.stockChart._axisXMin,c.stockChart._axisXMax))},
|
|
143
|
-
this.allDOMEventHandlers),this._toolBar=document.createElement("div"),this._toolBar.setAttribute("class","canvasjs-chart-toolbar"),
|
|
143
|
+
this.allDOMEventHandlers),this._toolBar=document.createElement("div"),this._toolBar.setAttribute("class","canvasjs-chart-toolbar"),U(this._toolBar,{position:"absolute",right:"1px",top:"1px",webkitTapHighlightColor:"transparent"}),this._canvasJSContainer.appendChild(this._toolBar),this.bounds={x1:0,y1:0,x2:this.width,y2:this.height},S(this.overlaidCanvas,"click",function(a){c._mouseEventHandler(a)},this.allDOMEventHandlers),S(this.overlaidCanvas,"mousemove",function(a){c._mouseEventHandler(a)},this.allDOMEventHandlers),
|
|
144
144
|
S(this.overlaidCanvas,"mouseup",function(a){c._mouseEventHandler(a)},this.allDOMEventHandlers),S(this.overlaidCanvas,"mousedown",function(a){c._mouseEventHandler(a);wa(c._dropdownMenu)},this.allDOMEventHandlers),S(this.overlaidCanvas,"mouseout",function(a){c._mouseEventHandler(a)},this.allDOMEventHandlers),S(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerDown":"touchstart",function(a){c._touchEventHandler(a)},this.allDOMEventHandlers),S(this.overlaidCanvas,window.navigator.msPointerEnabled?
|
|
145
145
|
"MSPointerMove":"touchmove",function(a){c._touchEventHandler(a)},this.allDOMEventHandlers),S(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerUp":"touchend",function(a){c._touchEventHandler(a)},this.allDOMEventHandlers),S(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerCancel":"touchcancel",function(a){c._touchEventHandler(a)},this.allDOMEventHandlers),this.toolTip=new na(this,this.options.toolTip),this.data=null,this.axisX=[],this.axisX2=[],this.axisY=[],this.axisY2=
|
|
146
146
|
[],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 b=[],c,d=0;d<a.length;d++)if(0==d)b.push(a[0]);else{var e,s,w;w=d-1;e=0===w?0:w-1;s=w===a.length-1?w:w+1;c=Math.abs((a[s].x-a[e].x)/(0===a[s].x-a[w].x?0.01:a[s].x-a[w].x))*(g-1)/2+1;var H=(a[s].x-a[e].x)/c;c=(a[s].y-a[e].y)/c;b[b.length]=a[w].x>a[e].x&&0<H||a[w].x<a[e].x&&0>H?{x:a[w].x+H/3,y:a[w].y+
|
|
@@ -169,19 +169,19 @@ for(;this.container&&this.container.hasChildNodes();)this.container.removeChild(
|
|
|
169
169
|
xa(this._eventManager.ghostCanvas);this._toolBar=this._dropdownMenu=this._menuButton=this._resetButton=this._zoomButton=null};m.prototype._updateOptions=function(){var a=this;this.updateOption("width");this.updateOption("height");this.updateOption("dataPointWidth");this.updateOption("dataPointMinWidth");this.updateOption("dataPointMaxWidth");this.updateOption("interactivityEnabled");this.updateOption("theme");this.stockChart&&this.stockChart.options&&"undefined"!==typeof this.stockChart.options.theme&&
|
|
170
170
|
p(this.options.theme)?this.theme=this.stockChart.theme:p(this.stockChart)&&p(this.theme)&&(this.theme="light1");this.updateOption("colorSet")&&(this.selectedColorSet="undefined"!==typeof Aa[this.colorSet]?Aa[this.colorSet]:Aa.colorSet1);this.updateOption("backgroundColor");this.stockChart&&(this.stockChart.options&&"undefined"!==typeof this.stockChart.options.backgroundColor&&p(this.options.backgroundColor))&&(this.backgroundColor=this.stockChart.backgroundColor);this.backgroundColor||(this.backgroundColor=
|
|
171
171
|
"rgba(0,0,0,0)");this.updateOption("culture");this.stockChart&&p(this.options.culture)&&(this.culture=this.stockChart.culture);this._cultureInfo=new Ja(this.culture);this.updateOption("animationEnabled");this.animationEnabled=this.animationEnabled&&u;this.updateOption("animationDuration");this.updateOption("rangeChanging");this.updateOption("rangeChanged");this.updateOption("exportEnabled");this.updateOption("exportFileName");this.updateOption("zoomType");this.toolbar=new Va(this,this.options.toolbar);
|
|
172
|
-
if(this.stockChart&&this.stockChart.options&&this.stockChart.options.toolbar&&!this.options.toolbar)for(var g in this.stockChart.options.toolbar)this.toolbar[g]=this.stockChart.options.toolbar[g];if(this.options.zoomEnabled||this.panEnabled){if(this._zoomButton)
|
|
173
|
-
color:a.toolbar.fontColor}),0>=navigator.userAgent.search("MSIE")&&this._zoomButton.childNodes[0]&&
|
|
174
|
-
40+"px",backgroundClip:"padding-box"});S(this._zoomButton,"touchstart",function(a){b=!0},this.allDOMEventHandlers);S(this._zoomButton,"click",function(){a.zoomEnabled?(a.zoomEnabled=!1,a.panEnabled=!0,ta(a,a._zoomButton,"zoom")):(a.zoomEnabled=!0,a.panEnabled=!1,ta(a,a._zoomButton,"pan"));a.render()},this.allDOMEventHandlers);S(this._zoomButton,"mousemove",function(){b?b=!1:(
|
|
175
|
-
0>=navigator.userAgent.search("MSIE")&&
|
|
176
|
-
{border:this.toolbar.buttonBorderThickness+"px solid "+this.toolbar.buttonBorderColor,borderLeft:"none",height:2*this.toolbar.buttonBorderThickness+25+"px",width:this.toolbar.buttonBorderThickness+40+"px",backgroundColor:a.toolbar.itemBackgroundColor,color:a.toolbar.fontColor}),0>=navigator.userAgent.search("MSIE")&&this._resetButton.childNodes[0]&&
|
|
177
|
-
document.createElement("button")),ta(this,this._resetButton,"reset"),
|
|
172
|
+
if(this.stockChart&&this.stockChart.options&&this.stockChart.options.toolbar&&!this.options.toolbar)for(var g in this.stockChart.options.toolbar)this.toolbar[g]=this.stockChart.options.toolbar[g];if(this.options.zoomEnabled||this.panEnabled){if(this._zoomButton)U(this._zoomButton,{border:this.toolbar.buttonBorderThickness+"px solid "+this.toolbar.buttonBorderColor,height:2*this.toolbar.buttonBorderThickness+25+"px",width:2*this.toolbar.buttonBorderThickness+40+"px",backgroundColor:a.toolbar.itemBackgroundColor,
|
|
173
|
+
color:a.toolbar.fontColor}),0>=navigator.userAgent.search("MSIE")&&this._zoomButton.childNodes[0]&&U(this._zoomButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"});else{var b=!1;wa(this._zoomButton=document.createElement("button"));ta(this,this._zoomButton,"pan");this._toolBar.appendChild(this._zoomButton);U(this._zoomButton,{border:this.toolbar.buttonBorderThickness+"px solid "+this.toolbar.buttonBorderColor,height:2*this.toolbar.buttonBorderThickness+25+"px",width:2*this.toolbar.buttonBorderThickness+
|
|
174
|
+
40+"px",backgroundClip:"padding-box"});S(this._zoomButton,"touchstart",function(a){b=!0},this.allDOMEventHandlers);S(this._zoomButton,"click",function(){a.zoomEnabled?(a.zoomEnabled=!1,a.panEnabled=!0,ta(a,a._zoomButton,"zoom")):(a.zoomEnabled=!0,a.panEnabled=!1,ta(a,a._zoomButton,"pan"));a.render()},this.allDOMEventHandlers);S(this._zoomButton,"mousemove",function(){b?b=!1:(U(a._zoomButton,{backgroundColor:a.toolbar.itemBackgroundColorOnHover,color:a.toolbar.fontColorOnHover,transition:"0.4s",WebkitTransition:"0.4s"}),
|
|
175
|
+
0>=navigator.userAgent.search("MSIE")&&U(a._zoomButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"}))},this.allDOMEventHandlers);S(this._zoomButton,"mouseout",function(){b||(U(a._zoomButton,{backgroundColor:a.toolbar.itemBackgroundColor,color:a.toolbar.fontColor,transition:"0.4s",WebkitTransition:"0.4s"}),0>=navigator.userAgent.search("MSIE")&&U(a._zoomButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"}))},this.allDOMEventHandlers)}this._resetButton?(U(this._resetButton,
|
|
176
|
+
{border:this.toolbar.buttonBorderThickness+"px solid "+this.toolbar.buttonBorderColor,borderLeft:"none",height:2*this.toolbar.buttonBorderThickness+25+"px",width:this.toolbar.buttonBorderThickness+40+"px",backgroundColor:a.toolbar.itemBackgroundColor,color:a.toolbar.fontColor}),0>=navigator.userAgent.search("MSIE")&&this._resetButton.childNodes[0]&&U(this._resetButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"}),this._resetButton.title=this._cultureInfo.resetText):(b=!1,wa(this._resetButton=
|
|
177
|
+
document.createElement("button")),ta(this,this._resetButton,"reset"),U(this._resetButton,{border:this.toolbar.buttonBorderThickness+"px solid "+this.toolbar.buttonBorderColor,borderLeft:"none",height:2*this.toolbar.buttonBorderThickness+25+"px",width:this.toolbar.buttonBorderThickness+40+"px",backgroundClip:"padding-box"}),this._toolBar.appendChild(this._resetButton),S(this._resetButton,"touchstart",function(a){b=!0},this.allDOMEventHandlers),S(this._resetButton,"click",function(){a.toolTip.hide();
|
|
178
178
|
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,ta(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 c=0;c<a.sessionVariables.axisX.length;c++)a.sessionVariables.axisX[c].newViewportMinimum=null,a.sessionVariables.axisX[c].newViewportMaximum=null;if(a.sessionVariables.axisX2)for(c=
|
|
179
179
|
0;c<a.sessionVariables.axisX2.length;c++)a.sessionVariables.axisX2[c].newViewportMinimum=null,a.sessionVariables.axisX2[c].newViewportMaximum=null;if(a.sessionVariables.axisY)for(c=0;c<a.sessionVariables.axisY.length;c++)a.sessionVariables.axisY[c].newViewportMinimum=null,a.sessionVariables.axisY[c].newViewportMaximum=null;if(a.sessionVariables.axisY2)for(c=0;c<a.sessionVariables.axisY2.length;c++)a.sessionVariables.axisY2[c].newViewportMinimum=null,a.sessionVariables.axisY2[c].newViewportMaximum=
|
|
180
|
-
null;a.resetOverlayedCanvas();0>=navigator.userAgent.search("MSIE")&&
|
|
180
|
+
null;a.resetOverlayedCanvas();0>=navigator.userAgent.search("MSIE")&&U(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",a.stockChart.dispatchEvent("rangeChanging",a.stockChart._rangeEventParameter,
|
|
181
181
|
a.stockChart));a.render();a.syncCharts&&a.stockChart&&(a.stockChart.rangeUpdatedBy=!a.stockChart.navigator.slider||p(a.stockChart.navigator.slider.options.minimum)&&p(a.stockChart.navigator.slider.options.maximum)?!a.stockChart.rangeSelector.enabled||!a.stockChart.rangeSelector.inputFields.enabled||p(a.stockChart.rangeSelector.inputFields.options.startValue)&&p(a.stockChart.rangeSelector.inputFields.options.endValue)?null:"inputFields":"navigator",p(a.stockChart._selectedRangeButtonIndex)||(a.stockChart.rangeUpdatedBy=
|
|
182
182
|
"rangeButton"),a.syncCharts(null,null),a.stockChart.rangeSelector&&a.stockChart.rangeSelector.enabled&&a.stockChart.rangeSelector.render(),"rangeButton"===a.stockChart.rangeUpdatedBy&&a.stockChart.rangeSelector.selectedRangeButtonIndex<a.stockChart.rangeSelector.buttons.length&&(c=a.stockChart.rangeSelector.buttons[a.stockChart._selectedRangeButtonIndex],c.enabled&&(c.state="on",c.textBlock.fontWeight="bold",c.textBlock.fontColor=a.stockChart.rangeSelector.buttonStyle.labelFontColorOnHover,c.textBlock.backgroundColor=
|
|
183
|
-
a.stockChart.rangeSelector.buttonStyle.backgroundColorOnSelect,a.stockChart.rangeSelector.sessionVariables._clickedRangeButtonIndex=null,c.render())));a._dispatchRangeEvent("rangeChanged","reset");a.stockChart&&(a.stockChart._rangeEventParameter.type="rangeChanged",a.stockChart.dispatchEvent("rangeChanged",a.stockChart._rangeEventParameter,a.stockChart))},this.allDOMEventHandlers),S(this._resetButton,"mousemove",function(){b||(
|
|
184
|
-
color:a.toolbar.fontColorOnHover,transition:"0.4s",WebkitTransition:"0.4s"}),0>=navigator.userAgent.search("MSIE")&&
|
|
183
|
+
a.stockChart.rangeSelector.buttonStyle.backgroundColorOnSelect,a.stockChart.rangeSelector.sessionVariables._clickedRangeButtonIndex=null,c.render())));a._dispatchRangeEvent("rangeChanged","reset");a.stockChart&&(a.stockChart._rangeEventParameter.type="rangeChanged",a.stockChart.dispatchEvent("rangeChanged",a.stockChart._rangeEventParameter,a.stockChart))},this.allDOMEventHandlers),S(this._resetButton,"mousemove",function(){b||(U(a._resetButton,{backgroundColor:a.toolbar.itemBackgroundColorOnHover,
|
|
184
|
+
color:a.toolbar.fontColorOnHover,transition:"0.4s",WebkitTransition:"0.4s"}),0>=navigator.userAgent.search("MSIE")&&U(a._resetButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"}))},this.allDOMEventHandlers),S(this._resetButton,"mouseout",function(){b||(U(a._resetButton,{backgroundColor:a.toolbar.itemBackgroundColor,color:a.toolbar.fontColor,transition:"0.4s",WebkitTransition:"0.4s"}),0>=navigator.userAgent.search("MSIE")&&U(a._resetButton.childNodes[0],{WebkitFilter:"invert(0%)",
|
|
185
185
|
filter:"invert(0%)"}))},this.allDOMEventHandlers),this.overlaidCanvas.style.cursor=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;jb(this);"none"!==this._toolBar.style.display&&this._zoomButton&&(this.panEnabled?ta(a,
|
|
186
186
|
a._zoomButton,"zoom"):ta(a,a._zoomButton,"pan"),a._resetButton.getAttribute("state")!==a._cultureInfo.resetText&&ta(a,a._resetButton,"reset"));this.options.toolTip&&this.toolTip.options!==this.options.toolTip&&(this.toolTip.options=this.options.toolTip);for(g in this.toolTip.options)this.toolTip.options.hasOwnProperty(g)&&this.toolTip.updateOption(g)};m.prototype._updateSize=function(){var a;a=[this.canvas,this.overlaidCanvas,this._eventManager.ghostCanvas];var g=0,b=0,c=cb(this.container);this.options.width?
|
|
187
187
|
g=this.width:this.width=g=0<this.container.clientWidth-parseFloat(c.paddingLeft)-parseFloat(c.paddingRight)?this.container.clientWidth-parseFloat(c.paddingLeft)-parseFloat(c.paddingRight):this.width;p(this.stockChart)||p(this.index)?this.options.height?b=this.height:this.height=b=0<this.container.clientHeight-parseFloat(c.paddingTop)-parseFloat(c.paddingBottom)?this.container.clientHeight-parseFloat(c.paddingTop)-parseFloat(c.paddingBottom):this.height:b=this.height=this.stockChart._chartsHeight[this.index];
|
|
@@ -205,8 +205,8 @@ new A(this,"axisX2",this.options.axisX2[b],b,"axisX","top")):"xySwapped"===this.
|
|
|
205
205
|
this.plotInfo.axisPlacement?this._axes.push(this.axisX2[0]=new A(this,"axisX2",this.options.axisX2,0,"axisX","top")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisX2[0]=new A(this,"axisX2",this.options.axisX2,0,"axisX","right"))),this.data[g].axisX=this.axisX2[0],this.axisX2[0].dataSeries.push(this.data[g])}if(this.axisY){for(b=1;b<this.axisY.length;b++)"undefined"===typeof this.axisY[b].options.gridThickness&&(this.axisY[b].gridThickness=0);for(b=0;b<this.axisY.length-1;b++)"undefined"===
|
|
206
206
|
typeof this.axisY[b].options.margin&&(this.axisY[b].margin=10)}if(this.axisY2){for(b=1;b<this.axisY2.length;b++)"undefined"===typeof this.axisY2[b].options.gridThickness&&(this.axisY2[b].gridThickness=0);for(b=0;b<this.axisY2.length-1;b++)"undefined"===typeof this.axisY2[b].options.margin&&(this.axisY2[b].margin=10)}this.axisY&&0<this.axisY.length&&(this.axisY2&&0<this.axisY2.length)&&(0<this.axisY[0].gridThickness&&"undefined"===typeof this.axisY2[0].options.gridThickness?this.axisY2[0].gridThickness=
|
|
207
207
|
0:0<this.axisY2[0].gridThickness&&"undefined"===typeof this.axisY[0].options.gridThickness&&(this.axisY[0].gridThickness=0));if(this.axisX)for(b=0;b<this.axisX.length;b++)"undefined"===typeof this.axisX[b].options.gridThickness&&(this.axisX[b].gridThickness=0);if(this.axisX2)for(b=0;b<this.axisX2.length;b++)"undefined"===typeof this.axisX2[b].options.gridThickness&&(this.axisX2[b].gridThickness=0);this.axisX&&0<this.axisX.length&&(this.axisX2&&0<this.axisX2.length)&&(0<this.axisX[0].gridThickness&&
|
|
208
|
-
"undefined"===typeof this.axisX2[0].options.gridThickness?this.axisX2[0].gridThickness=0:0<this.axisX2[0].gridThickness&&"undefined"===typeof this.axisX[0].options.gridThickness&&(this.axisX[0].gridThickness=0));b=!1;if(0<this._axes.length&&this.options.zoomEnabled&&(this.zoomEnabled||this.panEnabled))for(g=0;g<this._axes.length;g++)if(!p(this._axes[g].viewportMinimum)||!p(this._axes[g].viewportMaximum)){b=!0;break}b?(this._menuButton&&
|
|
209
|
-
"px solid "+this.toolbar.buttonBorderColor,borderLeft:"none",height:2*this.toolbar.buttonBorderThickness+25+"px",width:this.toolbar.buttonBorderThickness+40+"px",backgroundClip:"padding-box"}),La(this._zoomButton,this._resetButton),this._toolBar.style.border="none"):(this._menuButton&&
|
|
208
|
+
"undefined"===typeof this.axisX2[0].options.gridThickness?this.axisX2[0].gridThickness=0:0<this.axisX2[0].gridThickness&&"undefined"===typeof this.axisX[0].options.gridThickness&&(this.axisX[0].gridThickness=0));b=!1;if(0<this._axes.length&&this.options.zoomEnabled&&(this.zoomEnabled||this.panEnabled))for(g=0;g<this._axes.length;g++)if(!p(this._axes[g].viewportMinimum)||!p(this._axes[g].viewportMaximum)){b=!0;break}b?(this._menuButton&&U(this._menuButton,{border:this.toolbar.buttonBorderThickness+
|
|
209
|
+
"px solid "+this.toolbar.buttonBorderColor,borderLeft:"none",height:2*this.toolbar.buttonBorderThickness+25+"px",width:this.toolbar.buttonBorderThickness+40+"px",backgroundClip:"padding-box"}),La(this._zoomButton,this._resetButton),this._toolBar.style.border="none"):(this._menuButton&&U(this._menuButton,{border:"none",height:"25px",width:"40px"}),wa(this._zoomButton,this._resetButton),this._toolBar.style.border=this.toolbar.buttonBorderThickness+"px solid transparent",this.options.zoomEnabled&&(this.zoomEnabled=
|
|
210
210
|
!0,this.panEnabled=!1));hb(this);this._processData();this.options.title&&(this.title=new za(this,this.options.title),this.title.dockInsidePlotArea?a.push(this.title):this.title.setLayout());if(this.options.subtitles)for(g=0;g<this.options.subtitles.length;g++)b=new Ia(this,this.options.subtitles[g],g),this.subtitles.push(b),b.dockInsidePlotArea?a.push(b):b.setLayout();this.legend=new D(this,this.options.legend);for(g=0;g<this.data.length;g++)(this.data[g].showInLegend||"pie"===this.data[g].type||
|
|
211
211
|
"doughnut"===this.data[g].type||"funnel"===this.data[g].type||"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){u?(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=
|
|
212
212
|
ua(this.width,this.height);this._preRenderCtx=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&&this.width){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||
|
|
@@ -327,20 +327,20 @@ a.dataSeriesIndexes[w],k=this.data[h];b.lineWidth=k.lineThickness;var n=k.dataPo
|
|
|
327
327
|
if(0<n.length){for(var m=!1,r=0;r<n.length;r++)if(x=n[r].x.getTime?n[r].x.getTime():n[r].x,!(x<a.axisX.dataInfo.viewPortMin||x>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!m)))if("number"!==typeof n[r].y)0<r&&!(k.connectNullData||m||z)&&(b.stroke(),u&&c.stroke()),m=!0;else{x=a.axisX.convertValueToPixel(x);v=a.axisY.convertValueToPixel(n[r].y);var B=k.dataPointIds[r];this._eventManager.objectMap[B]={id:B,objectType:"dataPoint",dataSeriesIndex:h,dataPointIndex:r,x1:x,y1:v};z||m?(!z&&k.connectNullData?
|
|
328
328
|
(b.setLineDash&&(k.options.nullDataLineDashType||l===k.lineDashType&&k.lineDashType!==k.nullDataLineDashType)&&(b.stroke(),b.beginPath(),b.moveTo(s.x,s.y),l=k.nullDataLineDashType,b.setLineDash(q)),b.lineTo(x,v),u&&c.lineTo(x,v)):(b.beginPath(),b.moveTo(x,v),u&&(c.beginPath(),c.moveTo(x,v))),m=z=!1):(b.lineTo(x,v),u&&c.lineTo(x,v),0==r%500&&(b.stroke(),b.beginPath(),b.moveTo(x,v),u&&(c.stroke(),c.beginPath(),c.moveTo(x,v))));s={x:x,y:v};r<n.length-1&&(y!==(n[r].lineColor||p)||l!==(n[r].lineDashType||
|
|
329
329
|
k.lineDashType))&&(b.stroke(),b.beginPath(),b.moveTo(x,v),y=n[r].lineColor||p,b.strokeStyle=y,b.setLineDash&&(n[r].lineDashType?(l=n[r].lineDashType,b.setLineDash(I(l,k.lineThickness))):(l=k.lineDashType,b.setLineDash(f))));if(0!==n[r].markerSize&&(0<n[r].markerSize||0<k.markerSize)){var E=k.getMarkerProperties(r,x,v,b);e.push(E);B=Q(B);u&&e.push({x:x,y:v,ctx:c,type:E.type,size:E.size,color:B,borderColor:B,borderThickness:E.borderThickness})}(n[r].indexLabel||k.indexLabel||n[r].indexLabelFormatter||
|
|
330
|
-
k.indexLabelFormatter)&&this._indexLabels.push({chartType:"line",dataPoint:n[r],dataSeries:k,point:{x:x,y:v},direction:0>n[r].y===a.axisY.reversed?1:-1,color:p})}b.stroke();u&&c.stroke()}}
|
|
330
|
+
k.indexLabelFormatter)&&this._indexLabels.push({chartType:"line",dataPoint:n[r],dataSeries:k,point:{x:x,y:v},direction:0>n[r].y===a.axisY.reversed?1:-1,color:p})}b.stroke();u&&c.stroke()}}aa.drawMarkers(e);u&&(g.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,
|
|
331
331
|
0,0,this.width,this.height),b.clearRect(d.x1,d.y1,d.width,d.height),c.beginPath());b.restore();b.beginPath();return{source:g,dest:this.plotArea.ctx,animationCallback:M.xClipAnimation,easingFunction:M.easing.linear,animationBase:0}}};m.prototype.renderStepLine=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,b=u?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx;b.save();var d=this.plotArea;b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();for(var e=
|
|
332
332
|
[],s,w=0;w<a.dataSeriesIndexes.length;w++){var h=a.dataSeriesIndexes[w],k=this.data[h];b.lineWidth=k.lineThickness;var n=k.dataPoints,l="solid";if(b.setLineDash){var q=I(k.nullDataLineDashType,k.lineThickness),l=k.lineDashType,f=I(l,k.lineThickness);b.setLineDash(f)}var p=k.id;this._eventManager.objectMap[p]={objectType:"dataSeries",dataSeriesIndex:h};p=Q(p);c.strokeStyle=p;c.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var p=k._colorSet,y=p=k.lineColor=k.options.lineColor?k.options.lineColor:
|
|
333
333
|
p[0];b.strokeStyle=p;var z=!0,r=0,x,v;b.beginPath();if(0<n.length){for(var m=!1,r=0;r<n.length;r++)if(x=n[r].getTime?n[r].x.getTime():n[r].x,!(x<a.axisX.dataInfo.viewPortMin||x>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!m)))if("number"!==typeof n[r].y)0<r&&!(k.connectNullData||m||z)&&(b.stroke(),u&&c.stroke()),m=!0;else{var B=v;x=a.axisX.convertValueToPixel(x);v=a.axisY.convertValueToPixel(n[r].y);var E=k.dataPointIds[r];this._eventManager.objectMap[E]={id:E,objectType:"dataPoint",dataSeriesIndex:h,
|
|
334
334
|
dataPointIndex:r,x1:x,y1:v};z||m?(!z&&k.connectNullData?(b.setLineDash&&(k.options.nullDataLineDashType||l===k.lineDashType&&k.lineDashType!==k.nullDataLineDashType)&&(b.stroke(),b.beginPath(),b.moveTo(s.x,s.y),l=k.nullDataLineDashType,b.setLineDash(q)),b.lineTo(x,B),b.lineTo(x,v),u&&(c.lineTo(x,B),c.lineTo(x,v))):(b.beginPath(),b.moveTo(x,v),u&&(c.beginPath(),c.moveTo(x,v))),m=z=!1):(b.lineTo(x,B),u&&c.lineTo(x,B),b.lineTo(x,v),u&&c.lineTo(x,v),0==r%500&&(b.stroke(),b.beginPath(),b.moveTo(x,v),u&&
|
|
335
335
|
(c.stroke(),c.beginPath(),c.moveTo(x,v))));s={x:x,y:v};r<n.length-1&&(y!==(n[r].lineColor||p)||l!==(n[r].lineDashType||k.lineDashType))&&(b.stroke(),b.beginPath(),b.moveTo(x,v),y=n[r].lineColor||p,b.strokeStyle=y,b.setLineDash&&(n[r].lineDashType?(l=n[r].lineDashType,b.setLineDash(I(l,k.lineThickness))):(l=k.lineDashType,b.setLineDash(f))));0!==n[r].markerSize&&(0<n[r].markerSize||0<k.markerSize)&&(B=k.getMarkerProperties(r,x,v,b),e.push(B),E=Q(E),u&&e.push({x:x,y:v,ctx:c,type:B.type,size:B.size,
|
|
336
|
-
color:E,borderColor:E,borderThickness:B.borderThickness}));(n[r].indexLabel||k.indexLabel||n[r].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepLine",dataPoint:n[r],dataSeries:k,point:{x:x,y:v},direction:0>n[r].y===a.axisY.reversed?1:-1,color:p})}b.stroke();u&&c.stroke()}}
|
|
336
|
+
color:E,borderColor:E,borderThickness:B.borderThickness}));(n[r].indexLabel||k.indexLabel||n[r].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepLine",dataPoint:n[r],dataSeries:k,point:{x:x,y:v},direction:0>n[r].y===a.axisY.reversed?1:-1,color:p})}b.stroke();u&&c.stroke()}}aa.drawMarkers(e);u&&(g.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),
|
|
337
337
|
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),c.beginPath());b.restore();b.beginPath();return{source:g,dest:this.plotArea.ctx,animationCallback:M.xClipAnimation,easingFunction:M.easing.linear,animationBase:0}}};m.prototype.renderSpline=function(a){function g(a){a=t(a,2);if(0<a.length){c.beginPath();u&&d.beginPath();c.moveTo(a[0].x,
|
|
338
338
|
a[0].y);a[0].newStrokeStyle&&(c.strokeStyle=a[0].newStrokeStyle);a[0].newLineDashArray&&c.setLineDash(a[0].newLineDashArray);u&&d.moveTo(a[0].x,a[0].y);for(var b=0;b<a.length-3;b+=3)if(c.bezierCurveTo(a[b+1].x,a[b+1].y,a[b+2].x,a[b+2].y,a[b+3].x,a[b+3].y),u&&d.bezierCurveTo(a[b+1].x,a[b+1].y,a[b+2].x,a[b+2].y,a[b+3].x,a[b+3].y),0<b&&0===b%3E3||a[b+3].newStrokeStyle||a[b+3].newLineDashArray)c.stroke(),c.beginPath(),c.moveTo(a[b+3].x,a[b+3].y),a[b+3].newStrokeStyle&&(c.strokeStyle=a[b+3].newStrokeStyle),
|
|
339
339
|
a[b+3].newLineDashArray&&c.setLineDash(a[b+3].newLineDashArray),u&&(d.stroke(),d.beginPath(),d.moveTo(a[b+3].x,a[b+3].y));c.stroke();u&&d.stroke()}}var b=a.targetCanvasCtx||this.plotArea.ctx,c=u?this._preRenderCtx:b;if(!(0>=a.dataSeriesIndexes.length)){var d=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 s=[],w=0;w<a.dataSeriesIndexes.length;w++){var h=a.dataSeriesIndexes[w],k=this.data[h];c.lineWidth=k.lineThickness;var n=
|
|
340
340
|
k.dataPoints,l="solid";if(c.setLineDash){var q=I(k.nullDataLineDashType,k.lineThickness),l=k.lineDashType,f=I(l,k.lineThickness);c.setLineDash(f)}var p=k.id;this._eventManager.objectMap[p]={objectType:"dataSeries",dataSeriesIndex:h};p=Q(p);d.strokeStyle=p;d.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var p=k._colorSet,y=p=k.lineColor=k.options.lineColor?k.options.lineColor:p[0];c.strokeStyle=p;var m=0,r,x,v=[];c.beginPath();if(0<n.length)for(x=!1,m=0;m<n.length;m++)if(r=n[m].getTime?
|
|
341
341
|
n[m].x.getTime():n[m].x,!(r<a.axisX.dataInfo.viewPortMin||r>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!x)))if("number"!==typeof n[m].y)0<m&&!x&&(k.connectNullData?c.setLineDash&&(0<v.length&&(k.options.nullDataLineDashType||!n[m-1].lineDashType))&&(v[v.length-1].newLineDashArray=q,l=k.nullDataLineDashType):(g(v),v=[])),x=!0;else{r=a.axisX.convertValueToPixel(r);x=a.axisY.convertValueToPixel(n[m].y);var Fa=k.dataPointIds[m];this._eventManager.objectMap[Fa]={id:Fa,objectType:"dataPoint",dataSeriesIndex:h,
|
|
342
342
|
dataPointIndex:m,x1:r,y1:x};v[v.length]={x:r,y:x};m<n.length-1&&(y!==(n[m].lineColor||p)||l!==(n[m].lineDashType||k.lineDashType))&&(y=n[m].lineColor||p,v[v.length-1].newStrokeStyle=y,c.setLineDash&&(n[m].lineDashType?(l=n[m].lineDashType,v[v.length-1].newLineDashArray=I(l,k.lineThickness)):(l=k.lineDashType,v[v.length-1].newLineDashArray=f)));if(0!==n[m].markerSize&&(0<n[m].markerSize||0<k.markerSize)){var B=k.getMarkerProperties(m,r,x,c);s.push(B);Fa=Q(Fa);u&&s.push({x:r,y:x,ctx:d,type:B.type,size:B.size,
|
|
343
|
-
color:Fa,borderColor:Fa,borderThickness:B.borderThickness})}(n[m].indexLabel||k.indexLabel||n[m].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"spline",dataPoint:n[m],dataSeries:k,point:{x:r,y:x},direction:0>n[m].y===a.axisY.reversed?1:-1,color:p});x=!1}g(v)}
|
|
343
|
+
color:Fa,borderColor:Fa,borderThickness:B.borderThickness})}(n[m].indexLabel||k.indexLabel||n[m].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"spline",dataPoint:n[m],dataSeries:k,point:{x:r,y:x},direction:0>n[m].y===a.axisY.reversed?1:-1,color:p});x=!1}g(v)}aa.drawMarkers(s);u&&(b.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&&
|
|
344
344
|
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),d.beginPath());c.restore();c.beginPath();return{source:b,dest:this.plotArea.ctx,animationCallback:M.xClipAnimation,easingFunction:M.easing.linear,animationBase:0}}};m.prototype.renderColumn=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,b=u?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var c=
|
|
345
345
|
null,d=this.plotArea,e=0,s,w,h,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),e=this.options.dataPointMinWidth?this.dataPointMinWidth: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,l=a.axisX.dataInfo.minDiff;isFinite(l)||(l=0.3*Math.abs(a.axisX.range));l=this.dataPointWidth=this.options.dataPointWidth?
|
|
346
346
|
this.dataPointWidth:0.9*(d.width*(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&&e>n&&(e=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&n<e)&&(n=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,e));l<e&&(l=e);l>n&&(l=n);b.save();u&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);
|
|
@@ -389,7 +389,7 @@ h=[],k=this.plotArea,n;e.save();u&&s.save();e.beginPath();e.rect(k.x1,k.y1,k.wid
|
|
|
389
389
|
f._colorSet[m%f._colorSet.length],A=f.lineColor=f.options.lineColor||E,C=A;e.fillStyle=E;e.strokeStyle=A;e.lineWidth=f.lineThickness;b="solid";if(e.setLineDash){var J=I(f.nullDataLineDashType,f.lineThickness);b=f.lineDashType;var N=I(b,f.lineThickness);e.setLineDash(N)}for(var Z=!0;m<p.length;m++)if(x=p[m].x.getTime?p[m].x.getTime():p[m].x,!(x<a.axisX.dataInfo.viewPortMin||x>a.axisX.dataInfo.viewPortMax&&(!f.connectNullData||!Z)))if("number"!==typeof p[m].y)f.connectNullData||(Z||g)||c(),Z=!0;else{z=
|
|
390
390
|
a.axisX.convertValueToPixel(x);r=a.axisY.convertValueToPixel(p[m].y);g||Z?(!g&&f.connectNullData?(e.setLineDash&&(f.options.nullDataLineDashType||b===f.lineDashType&&f.lineDashType!==f.nullDataLineDashType)&&(g=z,b=r,z=n.x,r=n.y,c(),e.moveTo(n.x,n.y),z=g,r=b,B=n,b=f.nullDataLineDashType,e.setLineDash(J)),e.lineTo(z,r),u&&s.lineTo(z,r)):(e.beginPath(),e.moveTo(z,r),u&&(s.beginPath(),s.moveTo(z,r)),B={x:z,y:r}),Z=g=!1):(e.lineTo(z,r),u&&s.lineTo(z,r),0==m%250&&c());n={x:z,y:r};m<p.length-1&&(C!==(p[m].lineColor||
|
|
391
391
|
A)||b!==(p[m].lineDashType||f.lineDashType))&&(c(),C=p[m].lineColor||A,e.strokeStyle=C,e.setLineDash&&(p[m].lineDashType?(b=p[m].lineDashType,e.setLineDash(I(b,f.lineThickness))):(b=f.lineDashType,e.setLineDash(N))));var R=f.dataPointIds[m];this._eventManager.objectMap[R]={id:R,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:m,x1:z,y1:r};0!==p[m].markerSize&&(0<p[m].markerSize||0<f.markerSize)&&(x=f.getMarkerProperties(m,z,r,e),h.push(x),R=Q(R),u&&h.push({x:z,y:r,ctx:s,type:x.type,size:x.size,
|
|
392
|
-
color:R,borderColor:R,borderThickness:x.borderThickness}));(p[m].indexLabel||f.indexLabel||p[m].indexLabelFormatter||f.indexLabelFormatter)&&this._indexLabels.push({chartType:"area",dataPoint:p[m],dataSeries:f,point:{x:z,y:r},direction:0>p[m].y===a.axisY.reversed?1:-1,color:E})}c()
|
|
392
|
+
color:R,borderColor:R,borderThickness:x.borderThickness}));(p[m].indexLabel||f.indexLabel||p[m].indexLabelFormatter||f.indexLabelFormatter)&&this._indexLabels.push({chartType:"area",dataPoint:p[m],dataSeries:f,point:{x:z,y:r},direction:0>p[m].y===a.axisY.reversed?1:-1,color:E})}c();aa.drawMarkers(h)}}u&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),e.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&e.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&
|
|
393
393
|
e.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),e.clearRect(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.restore());e.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:M.xClipAnimation,easingFunction:M.easing.linear,animationBase:0}}};m.prototype.renderSplineArea=function(a){function g(){var b=t(x,2);if(0<b.length){if(0<n.lineThickness){c.beginPath();c.moveTo(b[0].x,
|
|
394
394
|
b[0].y);b[0].newStrokeStyle&&(c.strokeStyle=b[0].newStrokeStyle);b[0].newLineDashArray&&c.setLineDash(b[0].newLineDashArray);for(var f=0;f<b.length-3;f+=3)if(c.bezierCurveTo(b[f+1].x,b[f+1].y,b[f+2].x,b[f+2].y,b[f+3].x,b[f+3].y),u&&d.bezierCurveTo(b[f+1].x,b[f+1].y,b[f+2].x,b[f+2].y,b[f+3].x,b[f+3].y),b[f+3].newStrokeStyle||b[f+3].newLineDashArray)c.stroke(),c.beginPath(),c.moveTo(b[f+3].x,b[f+3].y),b[f+3].newStrokeStyle&&(c.strokeStyle=b[f+3].newStrokeStyle),b[f+3].newLineDashArray&&c.setLineDash(b[f+
|
|
395
395
|
3].newLineDashArray);c.stroke()}c.beginPath();c.moveTo(b[0].x,b[0].y);u&&(d.beginPath(),d.moveTo(b[0].x,b[0].y));for(f=0;f<b.length-3;f+=3)c.bezierCurveTo(b[f+1].x,b[f+1].y,b[f+2].x,b[f+2].y,b[f+3].x,b[f+3].y),u&&d.bezierCurveTo(b[f+1].x,b[f+1].y,b[f+2].x,b[f+2].y,b[f+3].x,b[f+3].y);a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?z=m:0>a.axisY.viewportMaximum?z=e.y1:0<a.axisY.viewportMinimum&&(z=m);r={x:b[0].x,y:b[0].y};c.lineTo(b[b.length-1].x,z);c.lineTo(r.x,z);c.closePath();
|
|
@@ -397,14 +397,14 @@ c.globalAlpha=n.fillOpacity;c.fill();c.globalAlpha=1;u&&(d.lineTo(b[b.length-1].
|
|
|
397
397
|
a.dataSeriesIndexes[h],n=this.data[k],l=n.dataPoints,s=n.id;this._eventManager.objectMap[s]={objectType:"dataSeries",dataSeriesIndex:k};s=Q(s);d.fillStyle=s;var s=[],q=0,f,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),z,r=null,x=[];if(0<l.length){var v=n._colorSet[q%n._colorSet.length],A=n.lineColor=n.options.lineColor||v,B=A;c.fillStyle=v;c.strokeStyle=A;c.lineWidth=n.lineThickness;var E="solid";if(c.setLineDash){var C=I(n.nullDataLineDashType,n.lineThickness),E=
|
|
398
398
|
n.lineDashType,D=I(E,n.lineThickness);c.setLineDash(D)}for(p=!1;q<l.length;q++)if(f=l[q].x.getTime?l[q].x.getTime():l[q].x,!(f<a.axisX.dataInfo.viewPortMin||f>a.axisX.dataInfo.viewPortMax&&(!n.connectNullData||!p)))if("number"!==typeof l[q].y)0<q&&!p&&(n.connectNullData?c.setLineDash&&(0<x.length&&(n.options.nullDataLineDashType||!l[q-1].lineDashType))&&(x[x.length-1].newLineDashArray=C,E=n.nullDataLineDashType):(g(),x=[])),p=!0;else{f=a.axisX.convertValueToPixel(f);p=a.axisY.convertValueToPixel(l[q].y);
|
|
399
399
|
var J=n.dataPointIds[q];this._eventManager.objectMap[J]={id:J,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:q,x1:f,y1:p};x[x.length]={x:f,y:p};q<l.length-1&&(B!==(l[q].lineColor||A)||E!==(l[q].lineDashType||n.lineDashType))&&(B=l[q].lineColor||A,x[x.length-1].newStrokeStyle=B,c.setLineDash&&(l[q].lineDashType?(E=l[q].lineDashType,x[x.length-1].newLineDashArray=I(E,n.lineThickness)):(E=n.lineDashType,x[x.length-1].newLineDashArray=D)));if(0!==l[q].markerSize&&(0<l[q].markerSize||0<n.markerSize)){var N=
|
|
400
|
-
n.getMarkerProperties(q,f,p,c);s.push(N);J=Q(J);u&&s.push({x:f,y:p,ctx:d,type:N.type,size:N.size,color:J,borderColor:J,borderThickness:N.borderThickness})}(l[q].indexLabel||n.indexLabel||l[q].indexLabelFormatter||n.indexLabelFormatter)&&this._indexLabels.push({chartType:"splineArea",dataPoint:l[q],dataSeries:n,point:{x:f,y:p},direction:0>l[q].y===a.axisY.reversed?1:-1,color:v});p=!1}g()
|
|
400
|
+
n.getMarkerProperties(q,f,p,c);s.push(N);J=Q(J);u&&s.push({x:f,y:p,ctx:d,type:N.type,size:N.size,color:J,borderColor:J,borderThickness:N.borderThickness})}(l[q].indexLabel||n.indexLabel||l[q].indexLabelFormatter||n.indexLabelFormatter)&&this._indexLabels.push({chartType:"splineArea",dataPoint:l[q],dataSeries:n,point:{x:f,y:p},direction:0>l[q].y===a.axisY.reversed?1:-1,color:v});p=!1}g();aa.drawMarkers(s)}}u&&(b.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation=
|
|
401
401
|
"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(w.x1,w.y1,w.width,w.height),this._eventManager.ghostCtx.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:M.xClipAnimation,easingFunction:M.easing.linear,animationBase:0}}};m.prototype.renderStepArea=
|
|
402
402
|
function(a){var g,b;function c(){B&&(0<f.lineThickness&&e.stroke(),a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?t=v:0>a.axisY.viewportMaximum?t=h.y1:0<a.axisY.viewportMinimum&&(t=v),e.lineTo(z,t),e.lineTo(B.x,t),e.closePath(),e.globalAlpha=f.fillOpacity,e.fill(),e.globalAlpha=1,u&&(s.lineTo(z,t),s.lineTo(B.x,t),s.closePath(),s.fill()),e.beginPath(),e.moveTo(z,r),s.beginPath(),s.moveTo(z,r),B={x:z,y:r})}var d=a.targetCanvasCtx||this.plotArea.ctx,e=u?this._preRenderCtx:
|
|
403
403
|
d;if(!(0>=a.dataSeriesIndexes.length)){var s=this._eventManager.ghostCtx,h=a.axisY.lineCoordinates,p=[],k=this.plotArea,n;e.save();u&&s.save();e.beginPath();e.rect(k.x1,k.y1,k.width,k.height);e.clip();u&&(s.beginPath(),s.rect(k.x1,k.y1,k.width,k.height),s.clip());for(var l=0;l<a.dataSeriesIndexes.length;l++){var q=a.dataSeriesIndexes[l],f=this.data[q],m=f.dataPoints,p=f.id;this._eventManager.objectMap[p]={objectType:"dataSeries",dataSeriesIndex:q};p=Q(p);s.fillStyle=p;p=[];g=!0;var y=0,z,r,x,v=a.axisY.convertValueToPixel(a.axisY.logarithmic?
|
|
404
404
|
a.axisY.viewportMinimum:0),t,B=null;b=!1;if(0<m.length){var E=f._colorSet[y%f._colorSet.length],A=f.lineColor=f.options.lineColor||E,C=A;e.fillStyle=E;e.strokeStyle=A;e.lineWidth=f.lineThickness;var J="solid";if(e.setLineDash){var N=I(f.nullDataLineDashType,f.lineThickness),J=f.lineDashType,Z=I(J,f.lineThickness);e.setLineDash(Z)}for(;y<m.length;y++)if(x=m[y].x.getTime?m[y].x.getTime():m[y].x,!(x<a.axisX.dataInfo.viewPortMin||x>a.axisX.dataInfo.viewPortMax&&(!f.connectNullData||!b))){var R=r;"number"!==
|
|
405
405
|
typeof m[y].y?(f.connectNullData||(b||g)||c(),b=!0):(z=a.axisX.convertValueToPixel(x),r=a.axisY.convertValueToPixel(m[y].y),g||b?(!g&&f.connectNullData?(e.setLineDash&&(f.options.nullDataLineDashType||J===f.lineDashType&&f.lineDashType!==f.nullDataLineDashType)&&(g=z,b=r,z=n.x,r=n.y,c(),e.moveTo(n.x,n.y),z=g,r=b,B=n,J=f.nullDataLineDashType,e.setLineDash(N)),e.lineTo(z,R),e.lineTo(z,r),u&&(s.lineTo(z,R),s.lineTo(z,r))):(e.beginPath(),e.moveTo(z,r),u&&(s.beginPath(),s.moveTo(z,r)),B={x:z,y:r}),b=g=
|
|
406
406
|
!1):(e.lineTo(z,R),u&&s.lineTo(z,R),e.lineTo(z,r),u&&s.lineTo(z,r),0==y%250&&c()),n={x:z,y:r},y<m.length-1&&(C!==(m[y].lineColor||A)||J!==(m[y].lineDashType||f.lineDashType))&&(c(),C=m[y].lineColor||A,e.strokeStyle=C,e.setLineDash&&(m[y].lineDashType?(J=m[y].lineDashType,e.setLineDash(I(J,f.lineThickness))):(J=f.lineDashType,e.setLineDash(Z)))),x=f.dataPointIds[y],this._eventManager.objectMap[x]={id:x,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:y,x1:z,y1:r},0!==m[y].markerSize&&(0<m[y].markerSize||
|
|
407
|
-
0<f.markerSize)&&(R=f.getMarkerProperties(y,z,r,e),p.push(R),x=Q(x),u&&p.push({x:z,y:r,ctx:s,type:R.type,size:R.size,color:x,borderColor:x,borderThickness:R.borderThickness})),(m[y].indexLabel||f.indexLabel||m[y].indexLabelFormatter||f.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepArea",dataPoint:m[y],dataSeries:f,point:{x:z,y:r},direction:0>m[y].y===a.axisY.reversed?1:-1,color:E}))}c()
|
|
407
|
+
0<f.markerSize)&&(R=f.getMarkerProperties(y,z,r,e),p.push(R),x=Q(x),u&&p.push({x:z,y:r,ctx:s,type:R.type,size:R.size,color:x,borderColor:x,borderThickness:R.borderThickness})),(m[y].indexLabel||f.indexLabel||m[y].indexLabelFormatter||f.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepArea",dataPoint:m[y],dataSeries:f,point:{x:z,y:r},direction:0>m[y].y===a.axisY.reversed?1:-1,color:E}))}c();aa.drawMarkers(p)}}u&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),e.globalCompositeOperation=
|
|
408
408
|
"source-atop",a.axisX.maskCanvas&&e.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&e.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),e.clearRect(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.restore());e.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:M.xClipAnimation,easingFunction:M.easing.linear,animationBase:0}}};m.prototype.renderStackedArea=
|
|
409
409
|
function(a){function g(){if(!(1>k.length)){for(0<E.lineThickness&&c.stroke();0<k.length;){var a=k.pop();c.lineTo(a.x,a.y);u&&z.lineTo(a.x,a.y)}c.closePath();c.globalAlpha=E.fillOpacity;c.fill();c.globalAlpha=1;c.beginPath();u&&(z.closePath(),z.fill(),z.beginPath());k=[]}}var b=a.targetCanvasCtx||this.plotArea.ctx,c=u?this._preRenderCtx:b;if(!(0>=a.dataSeriesIndexes.length)){var d=null,e=null,s=[],h=this.plotArea,p=[],k=[],n=[],l=[],q=0,f,m,y=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:
|
|
410
410
|
0),z=this._eventManager.ghostCtx,r,x,v;u&&z.beginPath();c.save();u&&z.save();c.beginPath();c.rect(h.x1,h.y1,h.width,h.height);c.clip();u&&(z.beginPath(),z.rect(h.x1,h.y1,h.width,h.height),z.clip());for(var d=[],t=0;t<a.dataSeriesIndexes.length;t++){var B=a.dataSeriesIndexes[t],E=this.data[B],A=E.dataPoints;E.dataPointIndexes=[];for(q=0;q<A.length;q++)B=A[q].x.getTime?A[q].x.getTime():A[q].x,E.dataPointIndexes[B]=q,d[B]||(n.push(B),d[B]=!0);n.sort(Sa)}for(t=0;t<a.dataSeriesIndexes.length;t++){B=a.dataSeriesIndexes[t];
|
|
@@ -412,7 +412,7 @@ E=this.data[B];A=E.dataPoints;x=!0;k=[];q=E.id;this._eventManager.objectMap[q]={
|
|
|
412
412
|
{x:e,y:null};if(!(e<a.axisX.dataInfo.viewPortMin||e>a.axisX.dataInfo.viewPortMax&&(!E.connectNullData||!R)))if("number"!==typeof ga.y)E.connectNullData||(R||x)||g(),R=!0;else{f=a.axisX.convertValueToPixel(e);var oa=p[e]?p[e]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length){l[e]=ga.y+(l[e]?l[e]:0);if(0>=l[e]&&a.axisY.logarithmic)continue;m=a.axisY.convertValueToPixel(l[e])}else m=a.axisY.convertValueToPixel(ga.y),m-=oa;k.push({x:f,y:y-oa});p[e]=y-m;x||R?(!x&&
|
|
413
413
|
E.connectNullData?(c.setLineDash&&(E.options.nullDataLineDashType||v===E.lineDashType&&E.lineDashType!==E.nullDataLineDashType)&&(x=k.pop(),v=k[k.length-1],g(),c.moveTo(r.x,r.y),k.push(v),k.push(x),v=E.nullDataLineDashType,c.setLineDash(N)),c.lineTo(f,m),u&&z.lineTo(f,m)):(c.beginPath(),c.moveTo(f,m),u&&(z.beginPath(),z.moveTo(f,m))),R=x=!1):(c.lineTo(f,m),u&&z.lineTo(f,m),0==q%250&&(g(),c.moveTo(f,m),u&&z.moveTo(f,m),k.push({x:f,y:y-oa})));r={x:f,y:m};q<A.length-1&&(J!==(A[q].lineColor||C)||v!==
|
|
414
414
|
(A[q].lineDashType||E.lineDashType))&&(g(),c.beginPath(),c.moveTo(f,m),k.push({x:f,y:y-oa}),J=A[q].lineColor||C,c.strokeStyle=J,c.setLineDash&&(A[q].lineDashType?(v=A[q].lineDashType,c.setLineDash(I(v,E.lineThickness))):(v=E.lineDashType,c.setLineDash(Z))));if(0<=E.dataPointIndexes[e]){var ba=E.dataPointIds[E.dataPointIndexes[e]];this._eventManager.objectMap[ba]={id:ba,objectType:"dataPoint",dataSeriesIndex:B,dataPointIndex:E.dataPointIndexes[e],x1:f,y1:m}}0<=E.dataPointIndexes[e]&&0!==ga.markerSize&&
|
|
415
|
-
(0<ga.markerSize||0<E.markerSize)&&(oa=E.getMarkerProperties(E.dataPointIndexes[e],f,m,c),s.push(oa),e=Q(ba),u&&s.push({x:f,y:m,ctx:z,type:oa.type,size:oa.size,color:e,borderColor:e,borderThickness:oa.borderThickness}));(ga.indexLabel||E.indexLabel||ga.indexLabelFormatter||E.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedArea",dataPoint:ga,dataSeries:E,point:{x:f,y:m},direction:0>ga.y===a.axisY.reversed?1:-1,color:d})}}g();c.moveTo(f,m);u&&z.moveTo(f,m)}delete E.dataPointIndexes}
|
|
415
|
+
(0<ga.markerSize||0<E.markerSize)&&(oa=E.getMarkerProperties(E.dataPointIndexes[e],f,m,c),s.push(oa),e=Q(ba),u&&s.push({x:f,y:m,ctx:z,type:oa.type,size:oa.size,color:e,borderColor:e,borderThickness:oa.borderThickness}));(ga.indexLabel||E.indexLabel||ga.indexLabelFormatter||E.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedArea",dataPoint:ga,dataSeries:E,point:{x:f,y:m},direction:0>ga.y===a.axisY.reversed?1:-1,color:d})}}g();c.moveTo(f,m);u&&z.moveTo(f,m)}delete E.dataPointIndexes}aa.drawMarkers(s);
|
|
416
416
|
u&&(b.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(h.x1,h.y1,h.width,h.height),z.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:M.xClipAnimation,
|
|
417
417
|
easingFunction:M.easing.linear,animationBase:0}}};m.prototype.renderStackedArea100=function(a){function g(){for(0<E.lineThickness&&c.stroke();0<k.length;){var a=k.pop();c.lineTo(a.x,a.y);u&&v.lineTo(a.x,a.y)}c.closePath();c.globalAlpha=E.fillOpacity;c.fill();c.globalAlpha=1;c.beginPath();u&&(v.closePath(),v.fill(),v.beginPath());k=[]}var b=a.targetCanvasCtx||this.plotArea.ctx,c=u?this._preRenderCtx:b;if(!(0>=a.dataSeriesIndexes.length)){var d=null,e=null,s=this.plotArea,h=[],p=[],k=[],n=[],l=[],q=
|
|
418
418
|
0,f,m,y,z,r,x=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),v=this._eventManager.ghostCtx;c.save();u&&v.save();c.beginPath();c.rect(s.x1,s.y1,s.width,s.height);c.clip();u&&(v.beginPath(),v.rect(s.x1,s.y1,s.width,s.height),v.clip());for(var d=[],t=0;t<a.dataSeriesIndexes.length;t++){var B=a.dataSeriesIndexes[t],E=this.data[B],A=E.dataPoints;E.dataPointIndexes=[];for(q=0;q<A.length;q++)B=A[q].x.getTime?A[q].x.getTime():A[q].x,E.dataPointIndexes[B]=q,d[B]||(n.push(B),d[B]=
|
|
@@ -421,15 +421,15 @@ easingFunction:M.easing.linear,animationBase:0}}};m.prototype.renderStackedArea1
|
|
|
421
421
|
if(0>=l[e]&&a.axisY.logarithmic)continue;m=a.axisY.convertValueToPixel(l[e])}else m=a.axisY.convertValueToPixel(oa),m-=ba;k.push({x:f,y:x-ba});p[e]=x-m;z||R?(!z&&E.connectNullData?(c.setLineDash&&(E.options.nullDataLineDashType||r===E.lineDashType&&E.lineDashType!==E.nullDataLineDashType)&&(z=k.pop(),r=k[k.length-1],g(),c.moveTo(y.x,y.y),k.push(r),k.push(z),r=E.nullDataLineDashType,c.setLineDash(N)),c.lineTo(f,m),u&&v.lineTo(f,m)):(c.beginPath(),c.moveTo(f,m),u&&(v.beginPath(),v.moveTo(f,m))),R=z=
|
|
422
422
|
!1):(c.lineTo(f,m),u&&v.lineTo(f,m),0==q%250&&(g(),c.moveTo(f,m),u&&v.moveTo(f,m),k.push({x:f,y:x-ba})));y={x:f,y:m};q<A.length-1&&(J!==(A[q].lineColor||C)||r!==(A[q].lineDashType||E.lineDashType))&&(g(),c.beginPath(),c.moveTo(f,m),k.push({x:f,y:x-ba}),J=A[q].lineColor||C,c.strokeStyle=J,c.setLineDash&&(A[q].lineDashType?(r=A[q].lineDashType,c.setLineDash(I(r,E.lineThickness))):(r=E.lineDashType,c.setLineDash(Z))));if(0<=E.dataPointIndexes[e]){var F=E.dataPointIds[E.dataPointIndexes[e]];this._eventManager.objectMap[F]=
|
|
423
423
|
{id:F,objectType:"dataPoint",dataSeriesIndex:B,dataPointIndex:E.dataPointIndexes[e],x1:f,y1:m}}0<=E.dataPointIndexes[e]&&0!==ga.markerSize&&(0<ga.markerSize||0<E.markerSize)&&(ba=E.getMarkerProperties(E.dataPointIndexes[e],f,m,c),h.push(ba),e=Q(F),u&&h.push({x:f,y:m,ctx:v,type:ba.type,size:ba.size,color:e,borderColor:e,borderThickness:ba.borderThickness}));(ga.indexLabel||E.indexLabel||ga.indexLabelFormatter||E.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedArea100",dataPoint:ga,
|
|
424
|
-
dataSeries:E,point:{x:f,y:m},direction:0>ga.y===a.axisY.reversed?1:-1,color:d})}}g();c.moveTo(f,m);u&&v.moveTo(f,m)}delete E.dataPointIndexes}
|
|
424
|
+
dataSeries:E,point:{x:f,y:m},direction:0>ga.y===a.axisY.reversed?1:-1,color:d})}}g();c.moveTo(f,m);u&&v.moveTo(f,m)}delete E.dataPointIndexes}aa.drawMarkers(h);u&&(b.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,
|
|
425
425
|
0,0,this.width,this.height),c.clearRect(s.x1,s.y1,s.width,s.height),v.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:M.xClipAnimation,easingFunction:M.easing.linear,animationBase:0}}};m.prototype.renderBubble=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,b=u?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var c=this.plotArea,d=0,e,s;b.save();u&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(c.x1,c.y1,c.width,c.height);b.clip();u&&(this._eventManager.ghostCtx.beginPath(),
|
|
426
426
|
this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var h=-Infinity,p=Infinity,k=0;k<a.dataSeriesIndexes.length;k++)for(var n=a.dataSeriesIndexes[k],l=this.data[n],q=l.dataPoints,f=0,d=0;d<q.length;d++)e=q[d].getTime?e=q[d].x.getTime():e=q[d].x,e<a.axisX.dataInfo.viewPortMin||e>a.axisX.dataInfo.viewPortMax||"undefined"===typeof q[d].z||(f=q[d].z,f>h&&(h=f),f<p&&(p=f));for(var m=25*Math.PI,y=Math.max(Math.pow(0.25*Math.min(c.height,c.width)/2,2)*Math.PI,
|
|
427
427
|
m),k=0;k<a.dataSeriesIndexes.length;k++)if(n=a.dataSeriesIndexes[k],l=this.data[n],q=l.dataPoints,0<q.length)for(b.strokeStyle="#4572A7 ",d=0;d<q.length;d++)if(e=q[d].getTime?e=q[d].x.getTime():e=q[d].x,!(e<a.axisX.dataInfo.viewPortMin||e>a.axisX.dataInfo.viewPortMax)&&"number"===typeof q[d].y){e=a.axisX.convertValueToPixel(e);s=a.axisY.convertValueToPixel(q[d].y);var f=q[d].z,z=2*Math.max(Math.sqrt((h===p?y/2:m+(y-m)/(h-p)*(f-p))/Math.PI)<<0,1),f=l.getMarkerProperties(d,b);f.size=z;b.globalAlpha=
|
|
428
|
-
l.fillOpacity
|
|
428
|
+
l.fillOpacity;aa.drawMarker(e,s,b,f.type,f.size,f.color,f.borderColor,f.borderThickness);b.globalAlpha=1;var r=l.dataPointIds[d];this._eventManager.objectMap[r]={id:r,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:d,x1:e,y1:s,size:z};z=Q(r);u&&aa.drawMarker(e,s,this._eventManager.ghostCtx,f.type,f.size,z,z,f.borderThickness);(q[d].indexLabel||l.indexLabel||q[d].indexLabelFormatter||l.indexLabelFormatter)&&this._indexLabels.push({chartType:"bubble",dataPoint:q[d],dataSeries:l,point:{x:e,y:s},
|
|
429
429
|
direction:1,bounds:{x1:e-f.size/2,y1:s-f.size/2,x2:e+f.size/2,y2:s+f.size/2},color:null})}u&&(g.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(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.restore());
|
|
430
430
|
b.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:M.fadeInAnimation,easingFunction:M.easing.easeInQuad,animationBase:0}}};m.prototype.renderScatter=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,b=u?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var c=this.plotArea,d=0,e,s;b.save();u&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(c.x1,c.y1,c.width,c.height);b.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,
|
|
431
431
|
c.width,c.height),this._eventManager.ghostCtx.clip());for(var h=0;h<a.dataSeriesIndexes.length;h++){var p=a.dataSeriesIndexes[h],k=this.data[p],n=k.dataPoints;if(0<n.length){b.strokeStyle="#4572A7 ";Math.pow(0.3*Math.min(c.height,c.width)/2,2);for(var l=0,q=0,d=0;d<n.length;d++)if(e=n[d].getTime?e=n[d].x.getTime():e=n[d].x,!(e<a.axisX.dataInfo.viewPortMin||e>a.axisX.dataInfo.viewPortMax)&&"number"===typeof n[d].y){e=a.axisX.convertValueToPixel(e);s=a.axisY.convertValueToPixel(n[d].y);var f=k.getMarkerProperties(d,
|
|
432
|
-
e,s,b);b.globalAlpha=k.fillOpacity
|
|
432
|
+
e,s,b);b.globalAlpha=k.fillOpacity;aa.drawMarker(f.x,f.y,f.ctx,f.type,f.size,f.color,f.borderColor,f.borderThickness);b.globalAlpha=1;Math.sqrt((l-e)*(l-e)+(q-s)*(q-s))<Math.min(f.size,5)&&n.length>Math.min(this.plotArea.width,this.plotArea.height)||(l=k.dataPointIds[d],this._eventManager.objectMap[l]={id:l,objectType:"dataPoint",dataSeriesIndex:p,dataPointIndex:d,x1:e,y1:s},l=Q(l),u&&aa.drawMarker(f.x,f.y,this._eventManager.ghostCtx,f.type,f.size,l,l,f.borderThickness),(n[d].indexLabel||k.indexLabel||
|
|
433
433
|
n[d].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:n[d],dataSeries:k,point:{x:e,y:s},direction:1,bounds:{x1:e-f.size/2,y1:s-f.size/2,x2:e+f.size/2,y2:s+f.size/2},color:null}),l=e,q=s)}}}u&&(g.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),
|
|
434
434
|
this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.restore());b.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:M.fadeInAnimation,easingFunction:M.easing.easeInQuad,animationBase:0}}};m.prototype.renderCandlestick=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,b=u?this._preRenderCtx:g,c=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var d=
|
|
435
435
|
null,e=null,s=this.plotArea,h=0,m,k,n,l,q,f,d=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,e=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*s.width*(a.axisX.logarithmic?Math.log(t)/Math.log(a.axisX.range):Math.abs(t)/Math.abs(a.axisX.range))<<0;
|
|
@@ -444,10 +444,10 @@ animationBase:0}}};m.prototype.renderBoxAndWhisker=function(a){var g=a.targetCan
|
|
|
444
444
|
e.height);b.clip();u&&(c.beginPath(),c.rect(e.x1,e.y1,e.width,e.height),c.clip());for(var y=!1,y=!!a.axisY.reversed,z=0;z<a.dataSeriesIndexes.length;z++){var r=a.dataSeriesIndexes[z],x=this.data[r],v=x.dataPoints;if(0<v.length)for(var A=5<t&&x.bevelEnabled?!0:!1,s=0;s<v.length;s++)if(v[s].getTime?f=v[s].x.getTime():f=v[s].x,!(f<a.axisX.dataInfo.viewPortMin||f>a.axisX.dataInfo.viewPortMax)&&!p(v[s].y)&&v[s].y.length&&"number"===typeof v[s].y[0]&&"number"===typeof v[s].y[1]&&"number"===typeof v[s].y[2]&&
|
|
445
445
|
"number"===typeof v[s].y[3]&&"number"===typeof v[s].y[4]&&5===v[s].y.length){h=a.axisX.convertValueToPixel(f);m=a.axisY.convertValueToPixel(v[s].y[0]);k=a.axisY.convertValueToPixel(v[s].y[1]);n=a.axisY.convertValueToPixel(v[s].y[2]);l=a.axisY.convertValueToPixel(v[s].y[3]);q=a.axisY.convertValueToPixel(v[s].y[4]);var B=h-t/2<<0,E=h+t/2<<0,d=v[s].color?v[s].color:x._colorSet[0],C=Math.round(Math.max(1,0.15*t)),D=0===C%2?0:0.5,J=v[s].whiskerColor?v[s].whiskerColor:v[s].color?x.whiskerColor?x.whiskerColor:
|
|
446
446
|
v[s].color:x.whiskerColor?x.whiskerColor:d,N="number"===typeof v[s].whiskerThickness?v[s].whiskerThickness:"number"===typeof x.options.whiskerThickness?x.whiskerThickness:C,Z=v[s].whiskerDashType?v[s].whiskerDashType:x.whiskerDashType,R=p(v[s].whiskerLength)?p(x.options.whiskerLength)?t:x.whiskerLength:v[s].whiskerLength,R="number"===typeof R?0>=R?0:R>=t?t:R:"string"===typeof R?parseInt(R)*t/100>t?t:parseInt(R)*t/100:t,ga=1===Math.round(N)%2?0.5:0,oa=v[s].stemColor?v[s].stemColor:v[s].color?x.stemColor?
|
|
447
|
-
x.stemColor:v[s].color:x.stemColor?x.stemColor:d,ba="number"===typeof v[s].stemThickness?v[s].stemThickness:"number"===typeof x.options.stemThickness?x.stemThickness:C,F=1===Math.round(ba)%2?0.5:0,K=v[s].stemDashType?v[s].stemDashType:x.stemDashType,P=v[s].lineColor?v[s].lineColor:v[s].color?x.lineColor?x.lineColor:v[s].color:x.lineColor?x.lineColor:d,O="number"===typeof v[s].lineThickness?v[s].lineThickness:"number"===typeof x.options.lineThickness?x.lineThickness:C,
|
|
448
|
-
x.lineDashType
|
|
449
|
-
ba)),b.moveTo(h-F,k),b.lineTo(h-F,m),b.stroke(),b.moveTo(h-F,l),b.lineTo(h-F,n),b.stroke());b.restore();c.lineWidth=Math.max(C,4);b.beginPath();da(b,B,Math.min(q,k),E,Math.max(k,q),S,0,d,y?A:!1,y?!1:A,!1,!1,eb);b.beginPath();da(b,B,Math.min(n,q),E,Math.max(q,n),
|
|
450
|
-
P,b.lineWidth=O,b.moveTo(B,q
|
|
447
|
+
x.stemColor:v[s].color:x.stemColor?x.stemColor:d,ba="number"===typeof v[s].stemThickness?v[s].stemThickness:"number"===typeof x.options.stemThickness?x.stemThickness:C,F=1===Math.round(ba)%2?0.5:0,K=v[s].stemDashType?v[s].stemDashType:x.stemDashType,P=v[s].lineColor?v[s].lineColor:v[s].color?x.lineColor?x.lineColor:v[s].color:x.lineColor?x.lineColor:d,O="number"===typeof v[s].lineThickness?v[s].lineThickness:"number"===typeof x.options.lineThickness?x.lineThickness:C,X=v[s].lineDashType?v[s].lineDashType:
|
|
448
|
+
x.lineDashType,$=1===Math.round(O)%2?0.5:0,U=x.upperBoxColor,S=x.lowerBoxColor,eb=p(x.options.fillOpacity)?1:x.fillOpacity,L=x.dataPointIds[s];this._eventManager.objectMap[L]={id:L,objectType:"dataPoint",dataSeriesIndex:r,dataPointIndex:s,x1:B,y1:m,x2:E,y2:k,x3:h,y3:n,x4:h,y4:l,y5:q,borderThickness:C,color:d,stemThickness:ba,stemColor:oa,whiskerThickness:N,whiskerLength:R,whiskerColor:J,lineThickness:O,lineColor:P};b.save();0<ba&&(b.beginPath(),b.strokeStyle=oa,b.lineWidth=ba,b.setLineDash&&b.setLineDash(I(K,
|
|
449
|
+
ba)),b.moveTo(h-F,k),b.lineTo(h-F,m),b.stroke(),b.moveTo(h-F,l),b.lineTo(h-F,n),b.stroke());b.restore();c.lineWidth=Math.max(C,4);b.beginPath();da(b,B,Math.min(q,k),E,Math.max(k,q),S,0,d,y?A:!1,y?!1:A,!1,!1,eb);b.beginPath();da(b,B,Math.min(n,q),E,Math.max(q,n),U,0,d,y?!1:A,y?A:!1,!1,!1,eb);b.beginPath();b.lineWidth=C;b.strokeStyle=d;b.rect(B-D,Math.min(k,n)-D,E-B+2*D,Math.max(k,n)-Math.min(k,n)+2*D);b.stroke();b.save();0<O&&(b.beginPath(),b.globalAlpha=1,b.setLineDash&&b.setLineDash(I(X,O)),b.strokeStyle=
|
|
450
|
+
P,b.lineWidth=O,b.moveTo(B,q-$),b.lineTo(E,q-$),b.stroke());b.restore();b.save();0<N&&(b.beginPath(),b.setLineDash&&b.setLineDash(I(Z,N)),b.strokeStyle=J,b.lineWidth=N,b.moveTo(h-R/2<<0,l-ga),b.lineTo(h+R/2<<0,l-ga),b.stroke(),b.moveTo(h-R/2<<0,m+ga),b.lineTo(h+R/2<<0,m+ga),b.stroke());b.restore();u&&(d=Q(L),c.strokeStyle=d,c.lineWidth=ba,0<ba&&(c.moveTo(h-D-F,k),c.lineTo(h-D-F,Math.max(m,l)),c.stroke(),c.moveTo(h-D-F,Math.min(m,l)),c.lineTo(h-D-F,n),c.stroke()),da(c,B,Math.max(k,n),E,Math.min(k,
|
|
451
451
|
n),d,0,null,!1,!1,!1,!1),0<N&&(c.beginPath(),c.lineWidth=N,c.moveTo(h+R/2,l-ga),c.lineTo(h-R/2,l-ga),c.stroke(),c.moveTo(h+R/2,m+ga),c.lineTo(h-R/2,m+ga),c.stroke()));(v[s].indexLabel||x.indexLabel||v[s].indexLabelFormatter||x.indexLabelFormatter)&&this._indexLabels.push({chartType:x.type,dataPoint:v[s],dataSeries:x,point:{x:B+(E-B)/2,y:a.axisY.reversed?m:l},direction:1,bounds:{x1:B,y1:Math.min(m,l),x2:E,y2:Math.max(m,l)},color:d})}}u&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),
|
|
452
452
|
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(e.x1,e.y1,e.width,e.height),c.restore());b.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:M.fadeInAnimation,easingFunction:M.easing.easeInQuad,animationBase:0}}};m.prototype.renderRangeColumn=
|
|
453
453
|
function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,b=u?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,e=0,s,h,m,e=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;s=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:
|
|
@@ -480,7 +480,7 @@ this.plotArea.ctx,c=u?this._preRenderCtx:b;if(!(0>=a.dataSeriesIndexes.length)){
|
|
|
480
480
|
"number"===typeof l[f].y[0]&&"number"===typeof l[f].y[1]){t=a.axisX.convertValueToPixel(r);y=a.axisY.convertValueToPixel(l[f].y[0]);z=a.axisY.convertValueToPixel(l[f].y[1]);q||J?(n.connectNullData&&!q?(c.setLineDash&&(n.options.nullDataLineDashType||E===n.lineDashType&&n.lineDashType!==n.nullDataLineDashType)&&(m[m.length-1].newLineDashArray=D,E=n.nullDataLineDashType,c.setLineDash(C)),c.lineTo(t,y),u&&d.lineTo(t,y),m.push({x:t,y1:y,y2:z})):(c.beginPath(),c.moveTo(t,y),x={x:t,y:y},m=[],m.push({x:t,
|
|
481
481
|
y1:y,y2:z}),u&&(d.beginPath(),d.moveTo(t,y))),J=q=!1):(c.lineTo(t,y),m.push({x:t,y1:y,y2:z}),u&&d.lineTo(t,y),0==f%250&&g());r=n.dataPointIds[f];this._eventManager.objectMap[r]={id:r,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:f,x1:t,y1:y,y2:z};f<l.length-1&&(B!==(l[f].lineColor||A)||E!==(l[f].lineDashType||n.lineDashType))&&(g(),B=l[f].lineColor||A,m[m.length-1].newStrokeStyle=B,c.strokeStyle=B,c.setLineDash&&(l[f].lineDashType?(E=l[f].lineDashType,m[m.length-1].newLineDashArray=I(E,
|
|
482
482
|
n.lineThickness),c.setLineDash(m[m.length-1].newLineDashArray)):(E=n.lineDashType,m[m.length-1].newLineDashArray=D,c.setLineDash(D))));if(0!==l[f].markerSize&&(0<l[f].markerSize||0<n.markerSize)){var N=n.getMarkerProperties(f,t,z,c);e.push(N);var Z=Q(r);u&&e.push({x:t,y:z,ctx:d,type:N.type,size:N.size,color:Z,borderColor:Z,borderThickness:N.borderThickness});N=n.getMarkerProperties(f,t,y,c);e.push(N);Z=Q(r);u&&e.push({x:t,y:y,ctx:d,type:N.type,size:N.size,color:Z,borderColor:Z,borderThickness:N.borderThickness})}if(l[f].indexLabel||
|
|
483
|
-
n.indexLabel||l[f].indexLabelFormatter||n.indexLabelFormatter)this._indexLabels.push({chartType:"rangeArea",dataPoint:l[f],dataSeries:n,indexKeyword:0,point:{x:t,y:y},direction:l[f].y[0]>l[f].y[1]===a.axisY.reversed?-1:1,color:v}),this._indexLabels.push({chartType:"rangeArea",dataPoint:l[f],dataSeries:n,indexKeyword:1,point:{x:t,y:z},direction:l[f].y[0]>l[f].y[1]===a.axisY.reversed?1:-1,color:v})}else J||q||g(),J=!0;g()
|
|
483
|
+
n.indexLabel||l[f].indexLabelFormatter||n.indexLabelFormatter)this._indexLabels.push({chartType:"rangeArea",dataPoint:l[f],dataSeries:n,indexKeyword:0,point:{x:t,y:y},direction:l[f].y[0]>l[f].y[1]===a.axisY.reversed?-1:1,color:v}),this._indexLabels.push({chartType:"rangeArea",dataPoint:l[f],dataSeries:n,indexKeyword:1,point:{x:t,y:z},direction:l[f].y[0]>l[f].y[1]===a.axisY.reversed?1:-1,color:v})}else J||q||g(),J=!0;g();aa.drawMarkers(e)}}u&&(b.drawImage(this._preRenderCanvas,0,0,this.width,this.height),
|
|
484
484
|
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:b,dest:this.plotArea.ctx,animationCallback:M.xClipAnimation,easingFunction:M.easing.linear,animationBase:0}}};
|
|
485
485
|
m.prototype.renderRangeSplineArea=function(a){function g(a,b){var f=t(y,2);if(0<f.length){if(0<k.lineThickness){c.strokeStyle=b;c.setLineDash&&c.setLineDash(a);c.beginPath();c.moveTo(f[0].x,f[0].y);for(var e=0;e<f.length-3;e+=3){if(f[e].newStrokeStyle||f[e].newLineDashArray)c.stroke(),c.beginPath(),c.moveTo(f[e].x,f[e].y),f[e].newStrokeStyle&&(c.strokeStyle=f[e].newStrokeStyle),f[e].newLineDashArray&&c.setLineDash(f[e].newLineDashArray);c.bezierCurveTo(f[e+1].x,f[e+1].y,f[e+2].x,f[e+2].y,f[e+3].x,
|
|
486
486
|
f[e+3].y)}}c.beginPath();c.moveTo(f[0].x,f[0].y);u&&(d.beginPath(),d.moveTo(f[0].x,f[0].y));for(e=0;e<f.length-3;e+=3)c.bezierCurveTo(f[e+1].x,f[e+1].y,f[e+2].x,f[e+2].y,f[e+3].x,f[e+3].y),u&&d.bezierCurveTo(f[e+1].x,f[e+1].y,f[e+2].x,f[e+2].y,f[e+3].x,f[e+3].y);f=t(z,2);c.lineTo(z[z.length-1].x,z[z.length-1].y);for(e=f.length-1;2<e;e-=3)c.bezierCurveTo(f[e-1].x,f[e-1].y,f[e-2].x,f[e-2].y,f[e-3].x,f[e-3].y),u&&d.bezierCurveTo(f[e-1].x,f[e-1].y,f[e-2].x,f[e-2].y,f[e-3].x,f[e-3].y);c.closePath();c.globalAlpha=
|
|
@@ -490,7 +490,7 @@ e=[],h=this.plotArea;c.save();u&&d.save();c.beginPath();c.rect(h.x1,h.y1,h.width
|
|
|
490
490
|
r;c.lineWidth=k.lineThickness;var C="solid",B;if(c.setLineDash){var E=I(k.nullDataLineDashType,k.lineThickness),C=k.lineDashType;B=I(C,k.lineThickness)}for(f=!1;l<n.length;l++)if(q=n[l].x.getTime?n[l].x.getTime():n[l].x,!(q<a.axisX.dataInfo.viewPortMin||q>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!f)))if(null!==n[l].y&&n[l].y.length&&"number"===typeof n[l].y[0]&&"number"===typeof n[l].y[1]){q=a.axisX.convertValueToPixel(q);f=a.axisY.convertValueToPixel(n[l].y[0]);A=a.axisY.convertValueToPixel(n[l].y[1]);
|
|
491
491
|
var D=k.dataPointIds[l];this._eventManager.objectMap[D]={id:D,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:l,x1:q,y1:f,y2:A};y[y.length]={x:q,y:f};z[z.length]={x:q,y:A};l<n.length-1&&(v!==(n[l].lineColor||x)||C!==(n[l].lineDashType||k.lineDashType))&&(v=n[l].lineColor||x,y[y.length-1].newStrokeStyle=v,c.setLineDash&&(n[l].lineDashType?(C=n[l].lineDashType,y[y.length-1].newLineDashArray=I(C,k.lineThickness)):(C=k.lineDashType,y[y.length-1].newLineDashArray=B)));if(0!==n[l].markerSize&&(0<
|
|
492
492
|
n[l].markerSize||0<k.markerSize)){var K=k.getMarkerProperties(l,q,f,c);e.push(K);var J=Q(D);u&&e.push({x:q,y:f,ctx:d,type:K.type,size:K.size,color:J,borderColor:J,borderThickness:K.borderThickness});K=k.getMarkerProperties(l,q,A,c);e.push(K);J=Q(D);u&&e.push({x:q,y:A,ctx:d,type:K.type,size:K.size,color:J,borderColor:J,borderThickness:K.borderThickness})}if(n[l].indexLabel||k.indexLabel||n[l].indexLabelFormatter||k.indexLabelFormatter)this._indexLabels.push({chartType:"rangeSplineArea",dataPoint:n[l],
|
|
493
|
-
dataSeries:k,indexKeyword:0,point:{x:q,y:f},direction:n[l].y[0]<=n[l].y[1]?-1:1,color:r}),this._indexLabels.push({chartType:"rangeSplineArea",dataPoint:n[l],dataSeries:k,indexKeyword:1,point:{x:q,y:A},direction:n[l].y[0]<=n[l].y[1]?1:-1,color:r});f=!1}else 0<l&&!f&&(k.connectNullData?c.setLineDash&&(0<y.length&&(k.options.nullDataLineDashType||!n[l-1].lineDashType))&&(y[y.length-1].newLineDashArray=E,C=k.nullDataLineDashType):(g(B,x),y=[],z=[])),f=!0;g(B,x)
|
|
493
|
+
dataSeries:k,indexKeyword:0,point:{x:q,y:f},direction:n[l].y[0]<=n[l].y[1]?-1:1,color:r}),this._indexLabels.push({chartType:"rangeSplineArea",dataPoint:n[l],dataSeries:k,indexKeyword:1,point:{x:q,y:A},direction:n[l].y[0]<=n[l].y[1]?1:-1,color:r});f=!1}else 0<l&&!f&&(k.connectNullData?c.setLineDash&&(0<y.length&&(k.options.nullDataLineDashType||!n[l-1].lineDashType))&&(y[y.length-1].newLineDashArray=E,C=k.nullDataLineDashType):(g(B,x),y=[],z=[])),f=!0;g(B,x);aa.drawMarkers(e)}}u&&(b.drawImage(this._preRenderCanvas,
|
|
494
494
|
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(h.x1,h.y1,h.width,h.height),this._eventManager.ghostCtx.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:M.xClipAnimation,easingFunction:M.easing.linear,
|
|
495
495
|
animationBase:0}}};m.prototype.renderWaterfall=function(a){var g=a.targetCanvasCtx||this.plotArea.ctx,b=u?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,d=null,e=this.plotArea,h=0,p,m,k,n,l=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;m=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:
|
|
496
496
|
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*(e.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&&h>m&&(h=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&m<h)&&
|
|
@@ -533,178 +533,179 @@ var E="inside"!==k.indexLabelPlacement&&a?0.75*Math.min(q.width,q.height)/2:0.92
|
|
|
533
533
|
{chart:u});u.dispatchEvent("dataAnimationEnd",{chart:u})}))};g();h();h();h();h();this.disableToolTip=!0;this._animator.animate(0,this.animatedRender?this.animationDuration:0,function(a){var b=u.plotArea.ctx;b.clearRect(q.x1,q.y1,q.width,q.height);b.fillStyle=u.backgroundColor;b.fillRect(q.x1,q.y1,q.width,q.height);for(var b=f[0].startAngle+2*Math.PI*a,c=0;c<n.length;c++){var d=0===c?f[c].startAngle:e,e=d+(f[c].endAngle-f[c].startAngle),g=!1;e>b&&(e=b,g=!0);var h=n[c].color?n[c].color:k._colorSet[c%
|
|
534
534
|
k._colorSet.length];e>d&&ra(u.plotArea.ctx,f[c].center,f[c].radius,h,k.type,d,e,k.fillOpacity,f[c].percentInnerRadius);if(g)break}m();u.dispatchEvent("dataAnimationIterationEnd",{chart:u});1<=a&&u.dispatchEvent("dataAnimationEnd",{chart:u})},function(){u.disableToolTip=!1;u._animator.animate(0,u.animatedRender?500:0,function(a){b(a,!1);m();u.dispatchEvent("dataAnimationIterationEnd",{chart:u})});u.dispatchEvent("dataAnimationEnd",{chart:u})});k.radius=E;"doughnut"===k.type&&(k.innerRadius=C)}}};var sa=
|
|
535
535
|
function(a,g,b,c){"undefined"===typeof b&&(b=1);0>=Math.round(g.y4-g.y1)||(a.save(),a.globalAlpha=b,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)),a.lineTo(Math.round(g.x6),Math.round(g.y6))),a.closePath(),a.fillStyle=c?c:g.color,a.fill(),a.globalAplha=1,a.restore())};m.prototype.renderFunnel=
|
|
536
|
-
function(a){function g(){for(var a=0,b=[],c=0;c<x.length;c++){if("undefined"===typeof x[c].y)return-1;x[c].y="number"===typeof x[c].y?x[c].y:0;a+=Math.abs(x[c].y)}if(0===a)return-1;for(c=b[0]=0;c<x.length;c++)b.push(Math.abs(x[c].y)*D/a);return b}function b(){var a=
|
|
536
|
+
function(a){function g(){for(var a=0,b=[],c=0;c<x.length;c++){if("undefined"===typeof x[c].y)return-1;x[c].y="number"===typeof x[c].y?x[c].y:0;a+=Math.abs(x[c].y)}if(0===a)return-1;for(c=b[0]=0;c<x.length;c++)b.push(Math.abs(x[c].y)*D/a);return b}function b(){var a=U,b=S,c=$,d=Y,e,f;e=R;f=P-ba;d=Math.abs((f-e)*(b-a+(d-c))/2);c=Y-$;e=f-e;f=c*(f-P);f=Math.abs(f);f=d+f;for(var d=[],g=0,h=0;h<x.length;h++){if("undefined"===typeof x[h].y)return-1;x[h].y="number"===typeof x[h].y?x[h].y:0;g+=Math.abs(x[h].y)}if(0===
|
|
537
537
|
g)return-1;for(var k=d[0]=0,l=0,n,s,b=b-a,k=!1,h=0;h<x.length;h++)a=Math.abs(x[h].y)*f/g,k?n=0==Number(c.toFixed(3))?0:a/c:(s=ca*ca*b*b-4*Math.abs(ca)*a,0>s?(s=c,k=(b+s)*(e-l)/2,a-=k,n=e-l,l+=e-l,n+=0==s?0:a/s,l+=a/s,k=!0):(n=(Math.abs(ca)*b-Math.sqrt(s))/2,s=b-2*n/Math.abs(ca),l+=n,l>e&&(l-=n,s=c,k=(b+s)*(e-l)/2,a-=k,n=e-l,l+=e-l,n+=a/s,l+=a/s,k=!0),b=s)),d.push(n);return d}function c(){if(r&&x){for(var a,b,c,d,e,g,h,k,l,n,s,q,m,w,v,t,y,H,A=[],B=[],C={percent:null,total:null},E=null,D=0;D<x.length;D++)H=
|
|
538
|
-
L[D],H="undefined"!==typeof H.x5?(H.y2+H.y4)/2:(H.y2+H.y3)/2,H=f(H).x2+1,A[D]=Z-(isNaN(H)?0:H)-
|
|
538
|
+
L[D],H="undefined"!==typeof H.x5?(H.y2+H.y4)/2:(H.y2+H.y3)/2,H=f(H).x2+1,A[D]=Z-(isNaN(H)?0:H)-X;H=0.5*X;for(var D=0,F=x.length-1;D<x.length||0<=F;D++,F--){b=r.reversed?x[F]:x[D];a=b.color?b.color:r.reversed?r._colorSet[(x.length-1-D)%r._colorSet.length]:r._colorSet[D%r._colorSet.length];c=b.indexLabelPlacement||r.indexLabelPlacement||"outside";y=b.indexLabelTextAlign||r.indexLabelTextAlign||"left";d=b.indexLabelBackgroundColor||r.indexLabelBackgroundColor||(u?"transparent":null);e=b.indexLabelBorderColor||
|
|
539
539
|
r.indexLabelBorderColor||(u?"transparent":null);g=p(b.indexLabelBorderThickness)?r.indexLabelBorderThickness:b.indexLabelBorderThickness;h=p(b.indexLabelPadding)?r.options.indexLabelPadding?r.options.indexLabelPadding:r.indexLabelPadding:b.indexLabelPadding;k=b.indexLabelFontColor||r.indexLabelFontColor||"#979797";l=p(b.indexLabelFontSize)?r.indexLabelFontSize:b.indexLabelFontSize;n=b.indexLabelFontStyle||r.indexLabelFontStyle||"normal";s=b.indexLabelFontFamily||r.indexLabelFontFamily||"arial";q=
|
|
540
540
|
b.indexLabelFontWeight||r.indexLabelFontWeight||"normal";a=b.indexLabelLineColor||r.options.indexLabelLineColor||a;m="number"===typeof b.indexLabelLineThickness?b.indexLabelLineThickness:"number"===typeof r.indexLabelLineThickness?r.indexLabelLineThickness:2;w=b.indexLabelLineDashType||r.indexLabelLineDashType||"solid";v="undefined"!==typeof b.indexLabelWrap?b.indexLabelWrap:"undefined"!==typeof r.indexLabelWrap?r.indexLabelWrap:!0;t=r.dataPointIds[D];z._eventManager.objectMap[t]={id:t,objectType:"dataPoint",
|
|
541
541
|
dataPointIndex:D,dataSeriesIndex:0,funnelSection:L[r.reversed?x.length-1-D:D]};"inside"===r.indexLabelPlacement&&(A[D]=D!==da?r.reversed?L[D].x2-L[D].x1:L[D].x3-L[D].x4:L[D].x3-L[D].x6,20>A[D]&&(A[D]=D!==da?r.reversed?L[D].x3-L[D].x4:L[D].x2-L[D].x1:L[D].x2-L[D].x1,A[D]/=2));t=b.indexLabelMaxWidth?b.indexLabelMaxWidth:r.options.indexLabelMaxWidth?r.indexLabelMaxWidth:A[D];if(t>A[D]||0>t)t=A[D];B[D]="inside"===r.indexLabelPlacement?v?Math.max(L[D].height,l):1.5*l+("object"===typeof h?(h.top||0)+(h.bottom||
|
|
542
542
|
0):2*h):!1;C=z.getPercentAndTotal(r,b);if(r.indexLabelFormatter||b.indexLabelFormatter)E={chart:z.options,dataSeries:r,dataPoint:b,total:C.total,percent:C.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(E):b.indexLabel?z.replaceKeywordsWithValue(b.indexLabel,b,r,D):r.indexLabelFormatter?r.indexLabelFormatter(E):r.indexLabel?z.replaceKeywordsWithValue(r.indexLabel,b,r,D):b.label?b.label:"";0>=m&&(m=0);1E3>t&&1E3-t<H&&(t+=1E3-t);p(r.options.indexLabelMaxWidth)&&(r.indexLabelMaxWidth=p(r.indexLabelMaxWidth)?
|
|
543
543
|
t:Math.max(t,r.indexLabelMaxWidth));O.roundRect||ya(O);c=new ja(O,{fontSize:l,fontFamily:s,fontColor:k,fontStyle:n,fontWeight:q,horizontalAlign:c,textAlign:y,backgroundColor:d,borderColor:e,borderThickness:g,maxWidth:t,maxHeight:!1===B[D]?(v?4.28571429*l:1.5*l)+("object"===typeof h?(h.top||0)+(h.bottom||0):2*h):B[D],text:b,padding:h,textBaseline:"middle"});c.measureText();c.height=c.height===2*c.padding?0:c.height;c.width=c.width===2*c.padding?0:c.width;G.push({textBlock:c,id:r.reversed?F:D,isDirty:!1,
|
|
544
|
-
lineColor:a,lineThickness:m,lineDashType:w,height:c.height<c.maxHeight?c.height:c.maxHeight,width:c.width<c.maxWidth?c.width:c.maxWidth})}}}function d(){var a,b,c,d,e,f=[];e=!1;c=0;for(var g,h=Z-S-
|
|
544
|
+
lineColor:a,lineThickness:m,lineDashType:w,height:c.height<c.maxHeight?c.height:c.maxHeight,width:c.width<c.maxWidth?c.width:c.maxWidth})}}}function d(){var a,b,c,d,e,f=[];e=!1;c=0;for(var g,h=Z-S-X/2,h=r.options.indexLabelMaxWidth?r.indexLabelMaxWidth>h?h:r.indexLabelMaxWidth:h,k=G.length-1;0<=k;k--){g=x[G[k].id];c=G[k];d=c.textBlock;b=(a=q(k)<L.length?G[q(k)]:null)?a.textBlock:null;c=c.height;a&&d.y+c+ea>b.y&&(e=!0);c=g.indexLabelMaxWidth||h;if(c>h||0>c)c=h;f.push(c)}if(e)for(k=G.length-1;0<=k;k--)a=
|
|
545
545
|
L[k],G[k].textBlock.maxWidth=f[f.length-(k+1)],G[k].textBlock.measureText(),G[k].textBlock.height=G[k].textBlock.height===2*G[k].textBlock.padding?0:G[k].textBlock.height,G[k].textBlock.width=G[k].textBlock.width===2*G[k].textBlock.padding?0:G[k].textBlock.width,G[k].textBlock.x=Z-h,c=G[k].textBlock.height<G[k].textBlock.maxHeight?G[k].textBlock.height:G[k].textBlock.maxHeight,e=G[k].textBlock.width<G[k].textBlock.maxWidth?G[k].textBlock.width:G[k].textBlock.maxWidth,G[k].height=c,G[k].width=e,c=
|
|
546
|
-
"undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,G[k].textBlock.y=c-G[k].height/2,r.reversed?(G[k].textBlock.y+G[k].height>Q+C&&(G[k].textBlock.y=Q+C-G[k].height),G[k].textBlock.y
|
|
547
|
-
a.y4)/2:(a.y2+a.y3)/2,b=r.reversed?"undefined"!==typeof a.x5?c>V?f(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?c<V?f(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,G[e].textBlock.x=b+
|
|
548
|
-
G[e].textBlock.text.length?G[e].isDirty=!0:(a=L[e],b=a.height,c=G[e].height,d=G[e].width,b>=c?(b=e!=da?(a.x4+a.x3)/2-d/2:(a.x5+a.x4)/2-d/2,c=e!=da?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,G[e].textBlock.x=b,G[e].textBlock.y=c):G[e].isDirty=!0)}function h(){function a(b,c){var d;if(0>b||b>=G.length)return 0;var e,f=G[b].textBlock;if(0>c){c*=-1;e=l(b);d=m(e,b);if(d>=c)return f.y-=c,c;if(0==b)return 0<d&&(f.y-=d),d;d+=a(e,-(c-d));0<d&&(f.y-=d);return d}e=q(b);d=m(b,e);if(d>=c)return f.y+=
|
|
549
|
-
1)return 0<d&&(f.y+=d),d;d+=a(e,c-d);0<d&&(f.y+=d);return d}function b(){var a,d,e,f,g=0,h;f=(P-R+2*C)/s;h=s;for(var k,n=1;n<h;n++){e=n*f;for(var p=G.length-1;0<=p;p--)!G[p].isDirty&&(G[p].textBlock.y<e&&G[p].textBlock.y+G[p].height>e)&&(k=q(p),!(k>=G.length-1)&&G[p].textBlock.y+G[p].height+ea>G[k].textBlock.y&&(G[p].textBlock.y=G[p].textBlock.y+G[p].height-e>e-G[p].textBlock.y?e+1:e-G[p].height-1))}for(k=L.length-1;0<k;k--)if(!G[k].isDirty){e=l(k);if(0>e&&(e=0,G[e].isDirty))break;
|
|
550
|
-
G[e].textBlock.y+G[e].height){d=d||k;f=k;for(h=0;G[f].textBlock.y<G[e].textBlock.y+G[e].height+ea;){a=a||G[f].textBlock.y+G[f].height;h+=G[f].height;h+=ea;f=e;if(0>=f){f=0;h+=G[f].height;break}e=l(f);if(0>e){f=0;h+=G[f].height;break}}if(f!=k){g=G[f].textBlock.y;a-=g;a=h-a;g=c(a,d,f);break}}}return g}function c(a,b,d){var e=[],f=0,g=0;for(a=Math.abs(a);d<=b;d++)e.push(L[d]);e.sort(function(a,b){return a.height-b.height});for(d=0;d<e.length;d++)if(b=e[d],f<a)g++,f+=G[b.id].height+
|
|
551
|
-
"",G[b.id].indexLabelText="",G[b.id].isDirty=!0,G[b.id].textBlock.measureText();else break;return g}for(var d,e,f,g,k,n,s=1,p=0;p<2*s;p++){for(var r=G.length-1;0<=r&&!(0<=l(r)&&l(r),f=G[r],g=f.textBlock,n=(k=q(r)<L.length?G[q(r)]:null)?k.textBlock:null,d=+f.height.toFixed(6),e=+g.y.toFixed(6),!f.isDirty&&(k&&e+d+ea>+n.y.toFixed(6))&&(d=g.y+d+ea-n.y,e=a(r,-d),e<d&&(0<e&&(d-=e),e=a(q(r),d),e!=d)));r--);b()}}function m(a,b){return(b<L.length?G[b].textBlock.y:r.reversed?Q+C
|
|
552
|
-
C:G[a].textBlock.y+G[a].height+ea)}function t(a,b,c){var d,f,g,h=[],l=C,s=[];-1!==b&&(0<=W.indexOf(b)?(f=W.indexOf(b),W.splice(f,1)):(W.push(b),W=W.sort(function(a,b){return a-b})));if(0===W.length)h=ia;else{f=C*(1!=W.length||0!=W[0]&&W[0]!=L.length-1?2:1)/k();for(var q=0;q<L.length;q++){if(1==W.length&&0==W[0]){if(0===q){h.push(ia[q]);d=l;continue}}else 0===q&&(d=-1*l);h.push(ia[q]+d);if(0<=W.indexOf(q)||q<L.length&&0<=W.indexOf(q+1))d+=f}}g=function(){for(var a=[],b=
|
|
553
|
-
L[b].y1);return a}();var p={startTime:(new Date).getTime(),duration:c||500,easingFunction:function(a,b,c,d){return M.easing.easeOutQuart(a,b,c,d)},changeSection:function(a){for(var b,c,d=0;d<L.length;d++)b=g[d],c=L[d],b*=a,"undefined"===typeof s[d]&&(s[d]=0),0>s&&(s*=-1),c.y1+=b-s[d],c.y2+=b-s[d],c.y3+=b-s[d],c.y4+=b-s[d],c.y5&&(c.y5+=b-s[d],c.y6+=b-s[d]),s[d]=b}};a._animator.animate(0,c,function(c){var d=a.plotArea.ctx||a.ctx;ha=!0;d.clearRect(v.x1,v.y1,v.x2-v.x1,v.y2-
|
|
554
|
-
d.fillRect(v.x1,v.y1,v.width,v.height);p.changeSection(c,b);var f={};f.dataSeries=r;f.dataPoint=r.reversed?r.dataPoints[x.length-1-b]:r.dataPoints[b];f.index=r.reversed?x.length-1-b:b;a.toolTip.highlightObjects([f]);for(f=0;f<L.length;f++)sa(d,L[f],r.fillOpacity);y(d);J&&("inside"!==r.indexLabelPlacement?n(d):e(),A(d));1<=c&&(ha=!1)},null,M.easing.easeOutQuart)}function k(){for(var a=0,b=0;b<L.length-1;b++)(0<=W.indexOf(b)||0<=W.indexOf(b+1))&&a++;return a}function n(a){for(var b,
|
|
555
|
-
1===G[g].lineThickness%2?0.5:0,c=((L[g].y2+L[g].y4)/2<<0)+e,b=f(c).x2-1,isNaN(b)&&(Math.round(L[g].x1)===Math.round(L[g].x4)&&Math.round(L[g].x2)===Math.round(L[g].x3))&&(b=L[g].x2),d=G[g].textBlock.x,e=(G[g].textBlock.y+G[g].height/2<<0)+e,G[g].isDirty||0==G[g].lineThickness||(a.strokeStyle=G[g].lineColor,a.lineWidth=G[g].lineThickness,a.setLineDash&&a.setLineDash(I(G[g].lineDashType,G[g].lineThickness)),a.beginPath(),a.moveTo(b,c),a.lineTo(d,e),a.stroke())}function l(a){for(a-=
|
|
556
|
-
return a}function q(a){for(a+=1;a<=L.length&&a!=L.length&&G[a].isDirty;a++);return a}function f(a){for(var b,c=0;c<x.length;c++)if(L[c].y1<a&&L[c].y4>a){b=L[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 A(a){for(var b=0;b<L.length;b++)G[b].isDirty||(a&&(G[b].textBlock.ctx=a),G[b].textBlock.y+=G[b].textBlock._lineHeight/2,G[b].textBlock.render(!0),
|
|
557
|
-
2)}function y(a){z.plotArea.layoutManager.reset();a.roundRect||ya(a);z.title&&(z.title.dockInsidePlotArea||"center"===z.title.horizontalAlign&&"center"===z.title.verticalAlign)&&(z.title.ctx=a,z.title.render());if(z.subtitles)for(var b=0;b<z.subtitles.length;b++){var c=z.subtitles[b];if(c.dockInsidePlotArea||"center"===c.horizontalAlign&&"center"===c.verticalAlign)z.subtitles.ctx=a,c.render()}z.legend&&(z.legend.dockInsidePlotArea||"center"===z.legend.horizontalAlign&&
|
|
558
|
-
(z.legend.ctx=a,z.legend.setLayout(),z.legend.render());va.fNg&&va.fNg(z)}var z=this;if(!(0>=a.dataSeriesIndexes.length)){for(var r=this.data[a.dataSeriesIndexes[0]],x=r.dataPoints,v=this.plotArea,C=0.025*v.width,B=0.01*v.width,E=0,D=v.height-2*C-4,K=Math.min(v.width-2*B,2.8*v.height),J=!1,N=0;N<x.length;N++)if(!J&&("undefined"!==typeof x[N].indexLabel&&null!==x[N].indexLabel&&0<x[N].indexLabel.toString().length)&&(J=!0),!J&&("undefined"!==typeof x[N].label&&null!==
|
|
559
|
-
(J=!0),!J&&"function"===typeof r.indexLabelFormatter||"function"===typeof x[N].indexLabelFormatter)J=!0;J=J||"undefined"!==typeof r.indexLabel&&null!==r.indexLabel&&0<r.indexLabel.toString().length;"inside"!==r.indexLabelPlacement&&J||(B=(v.width-0.75*K)/2);var N=v.x1+B,Z=v.x2-B,R=v.y1+C+2,P=v.y2-C-2,O=a.targetCanvasCtx||this.plotArea.ctx||this.ctx;if(0!=r.length&&(r.dataPoints&&r.visible)&&0!==x.length){var ba,F;a=75*K/100;var
|
|
560
|
-
F=p(r.options.neckWidth)?0.25*a:r.neckWidth,"string"===typeof ba&&ba.match(/%$/)?(ba=parseInt(ba),ba=ba*D/100):ba=parseInt(ba),"string"===typeof F&&F.match(/%$/)?(F=parseInt(F),F=F*a/100):F=parseInt(F),ba>D?ba=D:0>=ba&&(ba=0),F>a?F=a-0.5:0>=F&&(F=0)):"pyramid"===r.type&&(F=ba=0,r.reversed=r.reversed?!1:!0);var B=N+a/2,
|
|
561
|
-
(V-Q)/(
|
|
562
|
-
F].color:r._colorSet[(x.length-1-F)%r._colorSet.length]:x[F].color?x[F].color:r._colorSet[F%r._colorSet.length],F===da?L.push({x1:N[F],y1:B[F],x2:a[F],y2:B[F],x3:Y,y3:V,x4:a[F+1],y4:B[F+1],x5:N[F+1],y5:B[F+1],x6
|
|
563
|
-
(N=!0,r.reversed?W.push(x.length-1-F):W.push(F));O.clearRect(v.x1,v.y1,v.width,v.height);O.fillStyle=z.backgroundColor;O.fillRect(v.x1,v.y1,v.width,v.height);if(J&&r.visible&&(c(),e(),"inside"!==r.indexLabelPlacement)){d();h();for(F=0;F<x.length;F++)G[F].isDirty||(a=G[F].textBlock.x+G[F].width,a=(Z-a)/2,0==F&&(E=a),E>a&&(E=a));for(F=0;F<L.length;F++)L[F].x1+=E,L[F].x2+=E,L[F].x3+=E,L[F].x4+=E,L[F].x5&&(L[F].x5+=E,L[F].x6+=E),G[F].textBlock.x+=E}for(F=
|
|
564
|
-
ia.push(E.y1);y(O);J&&r.visible&&("inside"===r.indexLabelPlacement||z.animationEnabled||n(O),z.animationEnabled||A());if(!J)for(F=0;F<x.length;F++)E=r.dataPointIds[F],a={id:E,objectType:"dataPoint",dataPointIndex:F,dataSeriesIndex:0,funnelSection:L[r.reversed?x.length-1-F:F]},z._eventManager.objectMap[E]=a;!z.animationEnabled&&N?t(z,-1,0):z.animationEnabled&&!z.animatedRender&&t(z,-1,0);this.funnelPyramidClickHandler=function(a){var b=-1;if(!ha&&!z.isAnimating&&
|
|
565
|
-
(b=r.reversed?x.length-1-a.dataPointIndex:a.dataPointIndex,0<=b)){a=b;if("funnel"===r.type||"pyramid"===r.type)r.reversed?x[x.length-1-a].exploded=x[x.length-1-a].exploded?!1:!0:x[a].exploded=x[a].exploded?!1:!0;t(z,b,500)}};return{source:O,dest:this.plotArea.ctx,animationCallback:function(a,b){M.fadeInAnimation(a,b);1<=a&&(t(z,-1,500),y(z.plotArea.ctx||z.ctx))},easingFunction:M.easing.easeInQuad,animationBase:0}}}}};m.prototype.requestAnimFrame=
|
|
566
|
-
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,b){b="undefined"===
|
|
567
|
-
a,g,b)};m.prototype.exportChart=function(a){a="undefined"===typeof a?{}:a;var g=a.format?a.format:"png",b=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+g);var c=this.canvas;if(c&&g&&b){b=b+"."+g;a="image/"+g;var c=c.toDataURL(a),d=!1,e=document.createElement("a");e.download=b;e.href=c;if("undefined"!==typeof Blob&&new Blob){for(var h=c.replace(/^data:[a-z\/]*;base64,/,
|
|
568
|
-
h.charCodeAt(m);g=new Blob([p.buffer],{type:"image/"+g});try{window.navigator.msSaveBlob(g,b),d=!0}catch(k){e.dataset.downloadurl=[a,e.download,e.href].join(":"),e.href=window.URL.createObjectURL(g)}}if(!d)try{event=document.createEvent("MouseEvents"),event.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent?e.dispatchEvent(event):e.fireEvent&&e.fireEvent("onclick")}catch(n){g=window.open(),
|
|
569
|
-
g.document.close()}}};m.prototype.print=function(){var a=this.exportChart({toDataURL:!0}),g=document.createElement("iframe");g.setAttribute("class","canvasjs-chart-print-frame");
|
|
570
|
-
a+'"/><body/></html>');c.document.body&&c.document.body.style&&(c.document.body.style.margin="0px 0px 0px 0px",c.document.body.style.padding="0px 0px 0px 0px");c.document.close();setTimeout(function(){c.focus();c.print();setTimeout(function(){b._canvasJSContainer.removeChild(g)},1E3)},500)};m.prototype.getPercentAndTotal=function(a,g){var b=null,c=null,d=b=null;if(0<=a.type.indexOf("stacked"))c=0,b=g.x.getTime?
|
|
571
|
-
d=isNaN(g.y)?0:0===b?0:100*(g.y/b));else if("pie"===a.type||"doughnut"===a.type||"funnel"===a.type||"pyramid"===a.type){for(b=c=0;b<a.dataPoints.length;b++)isNaN(a.dataPoints[b].y)||(c+=a.dataPoints[b].y);d=isNaN(g.y)?0:100*(g.y/c)}return{percent:d,total:c}};m.prototype.replaceKeywordsWithValue=function(a,g,b,c,d){var e=this;d="undefined"===typeof d?0:d;if((0<=b.type.indexOf("stacked")||"pie"===b.type||
|
|
572
|
-
"#percent",p="#total",m=this.getPercentAndTotal(b,g),p=isNaN(m.total)?p:m.total,h=isNaN(m.percent)?h:m.percent;do{m="";if(b.percentFormatString)m=b.percentFormatString;else{var m="#,##0.",k=Math.max(Math.ceil(Math.log(1/Math.abs(h))/Math.LN10),2);if(isNaN(k)||!isFinite(k))k=2;for(var n=0;n<k;n++)m+="#";b.percentFormatString=m}a=a.replace("#percent",fa(h,m,e._cultureInfo));a=a.replace("#total",
|
|
573
|
-
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",d);var h=null;try{var f=a.match(/(.*?)\s*\[\s*(.*?)\s*\]/);f&&0<f.length&&(h=Ga(f[2]),a=Ga(f[1]))}catch(k){}f=null;if("color"===a)return"waterfall"===b.type?g.color?
|
|
574
|
-
g.color?g.color:b.color?b.color:b._colorSet[c%b._colorSet.length];if(g.hasOwnProperty(a))f=g;else if(b.hasOwnProperty(a))f=b;else return"";f=f[a];null!==h&&(f=f[h]);return"x"===a?(b.axisX&&"dateTime"===b.axisX.valueType||"dateTime"===b.xValueType||g.x&&g.x.getTime)&&!b.axisX.logarithmic?Ba(f,g.xValueFormatString?g.xValueFormatString:b.xValueFormatString?b.xValueFormatString:b.xValueFormatString=
|
|
575
|
-
g.xValueFormatString:b.xValueFormatString?b.xValueFormatString:b.xValueFormatString="#,##0.########",e._cultureInfo):"y"===a?fa(f,g.yValueFormatString?g.yValueFormatString:b.yValueFormatString?b.yValueFormatString:b.yValueFormatString="#,##0.########",e._cultureInfo):"z"===a?fa(f,g.zValueFormatString?g.zValueFormatString:b.zValueFormatString?b.zValueFormatString:b.zValueFormatString=
|
|
576
|
-
this.chart,g=a.layoutManager.getFreeSpace(),b=null,c=0,d=0,e=0,h=0,m=this.markerMargin=this.chart.options.legend&&!p(this.chart.options.legend.markerMargin)?this.chart.options.legend.markerMargin:0.3*this.fontSize;this.height=0;var u=[],k=[];if("top"===this.verticalAlign||"bottom"===this.verticalAlign)this.orientation="horizontal",b=this.verticalAlign,e=this.maxWidth=null!==
|
|
577
|
-
"vertical";if("left"===this.horizontalAlign||"center"===this.horizontalAlign||"right"===this.horizontalAlign)b=this.horizontalAlign;e=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*g.width;h=this.maxHeight=null!==this.maxHeight?this.maxHeight:g.height}this.errorMarkerColor=[];for(var n=0;n<this.dataSeries.length;n++){var l=this.dataSeries[n];
|
|
578
|
-
l.legendMarkerType:"line"!==l.type&&"stepLine"!==l.type&&"spline"!==l.type&&"scatter"!==l.type&&"bubble"!==l.type||!l.markerType?"error"===l.type&&l._linkedSeries?l._linkedSeries.legendMarkerType?l._linkedSeries.legendMarkerType:O.getDefaultLegendMarker(l._linkedSeries.type):O.getDefaultLegendMarker(l.type):l.markerType,f=l.legendText?l.legendText:
|
|
579
|
-
l.legendMarkerColor:l.markerColor?l.markerColor:"error"===l.type?p(l.whiskerColor)?l._colorSet[0]:l.whiskerColor:l._colorSet[0],y=l.markerSize||"line"!==l.type&&"stepLine"!==l.type&&"spline"!==l.type?0.75*this.lineHeight:0,z=l.legendMarkerBorderColor?l.legendMarkerBorderColor:l.markerBorderColor,r=l.legendMarkerBorderThickness?l.legendMarkerBorderThickness:
|
|
580
|
-
l.dataPoints[0],l,n);q={markerType:q,markerColor:t,text:f,textBlock:null,chartType:l.type,markerSize:y,lineColor:l._colorSet[0],dataSeriesIndex:l.index,dataPointIndex:null,markerBorderColor:z,markerBorderThickness:r};u.push(q)}else for(var x=0;x<l.dataPoints.length;x++){var v=l.dataPoints[x],q=v.legendMarkerType?v.legendMarkerType:l.legendMarkerType?
|
|
581
|
-
legend:this.options,dataSeries:l,dataPoint:v}):v.name?v.name:"DataPoint: "+(x+1),t=v.legendMarkerColor?v.legendMarkerColor:l.legendMarkerColor?l.legendMarkerColor:v.color?v.color:l.color?l.color:l._colorSet[x%l._colorSet.length],y=0.75*this.lineHeight,z=v.legendMarkerBorderColor?v.legendMarkerBorderColor:l.legendMarkerBorderColor?
|
|
582
|
-
l.legendMarkerBorderThickness:v.markerBorderThickness||l.markerBorderThickness?Math.max(1,Math.round(0.2*y)):0,f=this.chart.replaceKeywordsWithValue(f,v,l,x),q={markerType:q,markerColor:t,text:f,textBlock:null,chartType:l.type,markerSize:y,dataSeriesIndex:n,dataPointIndex:x,markerBorderColor:z,markerBorderThickness:r};(v.showInLegend||
|
|
583
|
-
null!==this.itemMaxWidth?Math.min(this.itemWidth,this.itemMaxWidth,e):this.itemMaxWidth=Math.min(this.itemWidth,e):null!==this.itemMaxWidth?Math.min(this.itemMaxWidth,e):this.itemMaxWidth=e;y=0===y?0.75*this.lineHeight:y;v=(this.itemMaxWidth?this.itemMaxWidth:v)-(y+m);for(n=0;n<u.length;n++){q=u[n];t=v;if("line"===q.chartType||
|
|
584
|
-
new ja(this.ctx,{x:0,y:0,maxWidth:t,maxHeight:this.itemWrap?h:this.lineHeight,angle:0,text:q.text,textAlign:this.itemTextAlign,fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"});q.textBlock.measureText();null!==this.itemWidth&&
|
|
585
|
-
y+m+(0===l.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))>e)l={items:[],width:0},k.push(l),this.height+=f,f=0;f=Math.max(f,q.textBlock.height?q.textBlock.height:this.lineHeight);q.textBlock.x=l.width;q.textBlock.y=0;l.width+=Math.round(q.textBlock.width+
|
|
586
|
-
Math.max(l.width,this.width)}else q.textBlock=new ja(this.ctx,{x:0,y:0,maxWidth:v,maxHeight:!0===this.itemWrap?h:1.5*this.fontSize,angle:0,text:q.text,textAlign:this.itemTextAlign,fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),q.textBlock.measureText(),
|
|
587
|
-
0))),this.height<h-this.lineHeight?(l={items:[],width:0},k.push(l)):(l=k[x],x=(x+1)%k.length),l&&(this.height+=q.textBlock.height?q.textBlock.height:this.lineHeight,q.textBlock.x=l.width,q.textBlock.y=0,l.width+=Math.round(q.textBlock.width+y+m+(0===l.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?
|
|
588
|
-
f;this.height=Math.min(h,this.height);this.width=Math.min(e,this.width)}"top"===this.verticalAlign?(d="left"===this.horizontalAlign?g.x1:"right"===this.horizontalAlign?g.x2-this.width:g.x1+g.width/2-this.width/2,c=g.y1):"center"===this.verticalAlign?(d="left"===this.horizontalAlign?g.x1:"right"===this.horizontalAlign?g.x2-this.width:g.x1+g.width/2-
|
|
589
|
-
this.width:g.x1+g.width/2-this.width/2,c=g.y2-this.height);this.items=u;for(n=0;n<this.items.length;n++)q=u[n],q.id=++this.chart._eventManager.lastObjectId,this.chart._eventManager.objectMap[q.id]={id:q.id,objectType:"legendItem",legendItemIndex:n,dataSeriesIndex:q.dataSeriesIndex,dataPointIndex:q.dataPointIndex};this.markerSize=y;this.rows=k;0<u.length&&
|
|
590
|
-
function(){var a=this.bounds.x1,g=this.bounds.y1,b=this.markerMargin,c=this.maxWidth,d=this.maxHeight,e=this.markerSize,h=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 p=0,m=0;m<h.length;m++){for(var k=
|
|
591
|
-
(this.ctx.globalAlpha=0.5);this.ctx.save();this.ctx.beginPath();this.ctx.rect(a,g,c,Math.max(d-d%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,
|
|
592
|
-
this.errorMarkerColor[0];this.ctx.lineWidth=e/8;this.ctx.beginPath();var z=f-0.08*this.lineHeight+0.1*this.lineHeight,r=u+0.15*this.lineHeight,x=0.7*this.lineHeight,v=x+0.02*this.lineHeight;this.ctx.moveTo(z,r);this.ctx.lineTo(z+x,r);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(z+x/2,r);this.ctx.lineTo(z+x/2,r+v);this.ctx.stroke();
|
|
593
|
-
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+b+e;if("line"===q.chartType||"stepLine"===q.chartType||"spline"===q.chartType)q.textBlock.x+=0.1*this.lineHeight;q.textBlock.y=Math.round(u+this.lineHeight/
|
|
594
|
-
this.chart.data[q.dataSeriesIndex].visible||(this.ctx.globalAlpha=1);f=Q(q.id);this.ghostCtx.fillStyle=f;this.ghostCtx.beginPath();this.ghostCtx.fillRect(t,q.textBlock.y-this.lineHeight/2,q.textBlock.x+q.textBlock.width-t,q.textBlock.height?q.textBlock.height:this.lineHeight);q.x1=this.chart._eventManager.objectMap[q.id].x1=t;q.y1=
|
|
595
|
-
q.textBlock.y+(q.textBlock.height?q.textBlock.height:this.lineHeight)-this.lineHeight/2}p+=n}};qa(O,P);O.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"===
|
|
596
|
-
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};O.getDefaultLegendMarker=
|
|
597
|
-
"
|
|
598
|
-
g,b){if(!this.dataPoints||0===this.dataPoints.length)return null;var c={dataPoint:null,distance:Infinity,index:NaN},d=null,e=0,h=0,m=1,u=Infinity,k=0,n=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=
|
|
599
|
-
1)/l*(a-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0));for(;;){h=0<m?l+e:l-e;if(0<=h&&h<this.dataPoints.length){var d=this.dataPoints[h],q=this.axisX&&this.axisX.logarithmic?d.x>a?d.x/a:a/d.x:Math.abs(d.x-a);q<c.distance&&(p(b)||b&&!p(d.y))&&(c.dataPoint=d,c.distance=
|
|
600
|
-
a)?g&&null!==c.dataPoint?c:null:c};O.prototype.getDataPointAtXY=function(a,g,b){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;b=b||!1;var c=[],d=0,e=0,h=1,
|
|
601
|
-
1
|
|
602
|
-
q
|
|
603
|
-
Math.abs(q.
|
|
604
|
-
|
|
605
|
-
(
|
|
606
|
-
|
|
607
|
-
a+q.x1-a)<q.borderThickness&&g>=q.y1&&g<=q.y4)c.push({dataPoint:f,dataPointIndex:e,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 "
|
|
608
|
-
|
|
609
|
-
this.
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
this.
|
|
616
|
-
|
|
617
|
-
this.labelFormatter({chart:this.chart,axis:this.options,value:new Date(n),label:this.labels[n]?this.labels[n]:null}):"axisX"===this.type&&this.labels[n]?
|
|
618
|
-
|
|
619
|
-
this.
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
t=A.height}d=[];q=l=0;if(this.labelAutoFit||this.options.labelAutoFit)if(p(this.labelAngle)||(this.labelAngle=(this.labelAngle%360+360)%360,90<this.labelAngle&&
|
|
623
|
-
|
|
624
|
-
this._labels[b].textBlock;
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
this.
|
|
629
|
-
-
|
|
630
|
-
|
|
631
|
-
e
|
|
632
|
-
this._labels[y
|
|
633
|
-
|
|
634
|
-
(
|
|
635
|
-
this.
|
|
636
|
-
this.
|
|
637
|
-
|
|
546
|
+
"undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,G[k].textBlock.y=c-G[k].height/2,r.reversed?(G[k].textBlock.y+G[k].height>Q+C&&(G[k].textBlock.y=Q+C-G[k].height),G[k].textBlock.y<aa-C&&(G[k].textBlock.y=aa-C)):(G[k].textBlock.y<Q-C&&(G[k].textBlock.y=Q-C),G[k].textBlock.y+G[k].height>aa+C&&(G[k].textBlock.y=aa+C-G[k].height))}function e(){var a,b,c,d;if("inside"!==r.indexLabelPlacement)for(var e=0;e<L.length;e++)0==G[e].textBlock.text.length?G[e].isDirty=!0:(a=L[e],c="undefined"!==typeof a.x5?
|
|
547
|
+
(a.y2+a.y4)/2:(a.y2+a.y3)/2,b=r.reversed?"undefined"!==typeof a.x5?c>V?f(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?c<V?f(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,G[e].textBlock.x=b+X,G[e].textBlock.y=c-G[e].height/2,r.reversed?(G[e].textBlock.y+G[e].height>Q+C&&(G[e].textBlock.y=Q+C-G[e].height),G[e].textBlock.y<aa-C&&(G[e].textBlock.y=aa-C)):(G[e].textBlock.y<Q-C&&(G[e].textBlock.y=Q-C),G[e].textBlock.y+G[e].height>aa+C&&(G[e].textBlock.y=aa+C-G[e].height)));else for(e=0;e<
|
|
548
|
+
L.length;e++)0==G[e].textBlock.text.length?G[e].isDirty=!0:(a=L[e],b=a.height,c=G[e].height,d=G[e].width,b>=c?(b=e!=da?(a.x4+a.x3)/2-d/2:(a.x5+a.x4)/2-d/2,c=e!=da?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,G[e].textBlock.x=b,G[e].textBlock.y=c):G[e].isDirty=!0)}function h(){function a(b,c){var d;if(0>b||b>=G.length)return 0;var e,f=G[b].textBlock;if(0>c){c*=-1;e=l(b);d=m(e,b);if(d>=c)return f.y-=c,c;if(0==b)return 0<d&&(f.y-=d),d;d+=a(e,-(c-d));0<d&&(f.y-=d);return d}e=q(b);d=m(b,e);if(d>=c)return f.y+=
|
|
549
|
+
c,c;if(b==L.length-1)return 0<d&&(f.y+=d),d;d+=a(e,c-d);0<d&&(f.y+=d);return d}function b(){var a,d,e,f,g=0,h;f=(P-R+2*C)/s;h=s;for(var k,n=1;n<h;n++){e=n*f;for(var p=G.length-1;0<=p;p--)!G[p].isDirty&&(G[p].textBlock.y<e&&G[p].textBlock.y+G[p].height>e)&&(k=q(p),!(k>=G.length-1)&&G[p].textBlock.y+G[p].height+ea>G[k].textBlock.y&&(G[p].textBlock.y=G[p].textBlock.y+G[p].height-e>e-G[p].textBlock.y?e+1:e-G[p].height-1))}for(k=L.length-1;0<k;k--)if(!G[k].isDirty){e=l(k);if(0>e&&(e=0,G[e].isDirty))break;
|
|
550
|
+
if(G[k].textBlock.y<G[e].textBlock.y+G[e].height){d=d||k;f=k;for(h=0;G[f].textBlock.y<G[e].textBlock.y+G[e].height+ea;){a=a||G[f].textBlock.y+G[f].height;h+=G[f].height;h+=ea;f=e;if(0>=f){f=0;h+=G[f].height;break}e=l(f);if(0>e){f=0;h+=G[f].height;break}}if(f!=k){g=G[f].textBlock.y;a-=g;a=h-a;g=c(a,d,f);break}}}return g}function c(a,b,d){var e=[],f=0,g=0;for(a=Math.abs(a);d<=b;d++)e.push(L[d]);e.sort(function(a,b){return a.height-b.height});for(d=0;d<e.length;d++)if(b=e[d],f<a)g++,f+=G[b.id].height+
|
|
551
|
+
ea,G[b.id].textBlock.text="",G[b.id].indexLabelText="",G[b.id].isDirty=!0,G[b.id].textBlock.measureText();else break;return g}for(var d,e,f,g,k,n,s=1,p=0;p<2*s;p++){for(var r=G.length-1;0<=r&&!(0<=l(r)&&l(r),f=G[r],g=f.textBlock,n=(k=q(r)<L.length?G[q(r)]:null)?k.textBlock:null,d=+f.height.toFixed(6),e=+g.y.toFixed(6),!f.isDirty&&(k&&e+d+ea>+n.y.toFixed(6))&&(d=g.y+d+ea-n.y,e=a(r,-d),e<d&&(0<e&&(d-=e),e=a(q(r),d),e!=d)));r--);b()}}function m(a,b){return(b<L.length?G[b].textBlock.y:r.reversed?Q+C:
|
|
552
|
+
aa+C)-(0>a?r.reversed?aa-C:Q-C:G[a].textBlock.y+G[a].height+ea)}function t(a,b,c){var d,f,g,h=[],l=C,s=[];-1!==b&&(0<=W.indexOf(b)?(f=W.indexOf(b),W.splice(f,1)):(W.push(b),W=W.sort(function(a,b){return a-b})));if(0===W.length)h=ia;else{f=C*(1!=W.length||0!=W[0]&&W[0]!=L.length-1?2:1)/k();for(var q=0;q<L.length;q++){if(1==W.length&&0==W[0]){if(0===q){h.push(ia[q]);d=l;continue}}else 0===q&&(d=-1*l);h.push(ia[q]+d);if(0<=W.indexOf(q)||q<L.length&&0<=W.indexOf(q+1))d+=f}}g=function(){for(var a=[],b=
|
|
553
|
+
0;b<L.length;b++)a.push(h[b]-L[b].y1);return a}();var p={startTime:(new Date).getTime(),duration:c||500,easingFunction:function(a,b,c,d){return M.easing.easeOutQuart(a,b,c,d)},changeSection:function(a){for(var b,c,d=0;d<L.length;d++)b=g[d],c=L[d],b*=a,"undefined"===typeof s[d]&&(s[d]=0),0>s&&(s*=-1),c.y1+=b-s[d],c.y2+=b-s[d],c.y3+=b-s[d],c.y4+=b-s[d],c.y5&&(c.y5+=b-s[d],c.y6+=b-s[d]),s[d]=b}};a._animator.animate(0,c,function(c){var d=a.plotArea.ctx||a.ctx;ha=!0;d.clearRect(v.x1,v.y1,v.x2-v.x1,v.y2-
|
|
554
|
+
v.y1);d.fillStyle=a.backgroundColor;d.fillRect(v.x1,v.y1,v.width,v.height);p.changeSection(c,b);var f={};f.dataSeries=r;f.dataPoint=r.reversed?r.dataPoints[x.length-1-b]:r.dataPoints[b];f.index=r.reversed?x.length-1-b:b;a.toolTip.highlightObjects([f]);for(f=0;f<L.length;f++)sa(d,L[f],r.fillOpacity);y(d);J&&("inside"!==r.indexLabelPlacement?n(d):e(),A(d));1<=c&&(ha=!1)},null,M.easing.easeOutQuart)}function k(){for(var a=0,b=0;b<L.length-1;b++)(0<=W.indexOf(b)||0<=W.indexOf(b+1))&&a++;return a}function n(a){for(var b,
|
|
555
|
+
c,d,e,g=0;g<L.length;g++)e=1===G[g].lineThickness%2?0.5:0,c=((L[g].y2+L[g].y4)/2<<0)+e,b=f(c).x2-1,isNaN(b)&&(Math.round(L[g].x1)===Math.round(L[g].x4)&&Math.round(L[g].x2)===Math.round(L[g].x3))&&(b=L[g].x2),d=G[g].textBlock.x,e=(G[g].textBlock.y+G[g].height/2<<0)+e,G[g].isDirty||0==G[g].lineThickness||(a.strokeStyle=G[g].lineColor,a.lineWidth=G[g].lineThickness,a.setLineDash&&a.setLineDash(I(G[g].lineDashType,G[g].lineThickness)),a.beginPath(),a.moveTo(b,c),a.lineTo(d,e),a.stroke())}function l(a){for(a-=
|
|
556
|
+
1;-1<=a&&-1!=a&&G[a].isDirty;a--);return a}function q(a){for(a+=1;a<=L.length&&a!=L.length&&G[a].isDirty;a++);return a}function f(a){for(var b,c=0;c<x.length;c++)if(L[c].y1<a&&L[c].y4>a){b=L[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 A(a){for(var b=0;b<L.length;b++)G[b].isDirty||(a&&(G[b].textBlock.ctx=a),G[b].textBlock.y+=G[b].textBlock._lineHeight/2,G[b].textBlock.render(!0),
|
|
557
|
+
G[b].textBlock.y-=G[b].textBlock._lineHeight/2)}function y(a){z.plotArea.layoutManager.reset();a.roundRect||ya(a);z.title&&(z.title.dockInsidePlotArea||"center"===z.title.horizontalAlign&&"center"===z.title.verticalAlign)&&(z.title.ctx=a,z.title.render());if(z.subtitles)for(var b=0;b<z.subtitles.length;b++){var c=z.subtitles[b];if(c.dockInsidePlotArea||"center"===c.horizontalAlign&&"center"===c.verticalAlign)z.subtitles.ctx=a,c.render()}z.legend&&(z.legend.dockInsidePlotArea||"center"===z.legend.horizontalAlign&&
|
|
558
|
+
"center"===z.legend.verticalAlign)&&(z.legend.ctx=a,z.legend.setLayout(),z.legend.render());va.fNg&&va.fNg(z)}var z=this;if(!(0>=a.dataSeriesIndexes.length)){for(var r=this.data[a.dataSeriesIndexes[0]],x=r.dataPoints,v=this.plotArea,C=0.025*v.width,B=0.01*v.width,E=0,D=v.height-2*C-4,K=Math.min(v.width-2*B,2.8*v.height),J=!1,N=0;N<x.length;N++)if(!J&&("undefined"!==typeof x[N].indexLabel&&null!==x[N].indexLabel&&0<x[N].indexLabel.toString().length)&&(J=!0),!J&&("undefined"!==typeof x[N].label&&null!==
|
|
559
|
+
x[N].label&&0<x[N].label.toString().length)&&(J=!0),!J&&"function"===typeof r.indexLabelFormatter||"function"===typeof x[N].indexLabelFormatter)J=!0;J=J||"undefined"!==typeof r.indexLabel&&null!==r.indexLabel&&0<r.indexLabel.toString().length;"inside"!==r.indexLabelPlacement&&J||(B=(v.width-0.75*K)/2);var N=v.x1+B,Z=v.x2-B,R=v.y1+C+2,P=v.y2-C-2,O=a.targetCanvasCtx||this.plotArea.ctx||this.ctx;if(0!=r.length&&(r.dataPoints&&r.visible)&&0!==x.length){var ba,F;a=75*K/100;var X=30*(Z-a)/100;"funnel"===
|
|
560
|
+
r.type?(ba=p(r.options.neckHeight)?0.35*D:r.neckHeight,F=p(r.options.neckWidth)?0.25*a:r.neckWidth,"string"===typeof ba&&ba.match(/%$/)?(ba=parseInt(ba),ba=ba*D/100):ba=parseInt(ba),"string"===typeof F&&F.match(/%$/)?(F=parseInt(F),F=F*a/100):F=parseInt(F),ba>D?ba=D:0>=ba&&(ba=0),F>a?F=a-0.5:0>=F&&(F=0)):"pyramid"===r.type&&(F=ba=0,r.reversed=r.reversed?!1:!0);var B=N+a/2,U=N,S=N+a,Q=r.reversed?P:R,$=B-F/2,Y=B+F/2,V=r.reversed?R+ba:P-ba,aa=r.reversed?R:P;F=r.valueRepresents=r.valueRepresents?r.valueRepresents:
|
|
561
|
+
"height";N=[];a=[];var L=[],B=[],T=R,da,ca=(V-Q)/($-U),fa=-ca,K="area"===F?b():g();if(-1!==K){if(r.reversed)for(B.push(T),F=K.length-1;0<F;F--)T+=K[F],B.push(Math.round(T));else for(F=0;F<K.length;F++)T+=K[F],B.push(Math.round(T));if(r.reversed)for(F=0;F<K.length;F++)B[F]<V?(N.push($),a.push(Y),da=F):(N.push((B[F]-Q+ca*U)/ca),a.push((B[F]-Q+fa*S)/fa));else for(F=0;F<K.length;F++)B[F]<V?(N.push((B[F]-Q+ca*U)/ca),a.push((B[F]-Q+fa*S)/fa),da=F):(N.push($),a.push(Y));for(F=0;F<K.length-1;F++)T=r.reversed?
|
|
562
|
+
x[x.length-1-F].color?x[x.length-1-F].color:r._colorSet[(x.length-1-F)%r._colorSet.length]:x[F].color?x[F].color:r._colorSet[F%r._colorSet.length],F===da?L.push({x1:N[F],y1:B[F],x2:a[F],y2:B[F],x3:Y,y3:V,x4:a[F+1],y4:B[F+1],x5:N[F+1],y5:B[F+1],x6:$,y6:V,id:F,height:B[F+1]-B[F],color:T}):L.push({x1:N[F],y1:B[F],x2:a[F],y2:B[F],x3:a[F+1],y3:B[F+1],x4:N[F+1],y4:B[F+1],id:F,height:B[F+1]-B[F],color:T}),r.dataPointEOs[F]&&L[F]&&(r.dataPointEOs[F].sectionsofFunnel=L[F]);var ea=2,G=[],ha=!1,W=[],ia=[],N=
|
|
563
|
+
!1;a=a=0;Ca(W);for(F=0;F<x.length;F++)x[F].exploded&&(N=!0,r.reversed?W.push(x.length-1-F):W.push(F));O.clearRect(v.x1,v.y1,v.width,v.height);O.fillStyle=z.backgroundColor;O.fillRect(v.x1,v.y1,v.width,v.height);if(J&&r.visible&&(c(),e(),"inside"!==r.indexLabelPlacement)){d();h();for(F=0;F<x.length;F++)G[F].isDirty||(a=G[F].textBlock.x+G[F].width,a=(Z-a)/2,0==F&&(E=a),E>a&&(E=a));for(F=0;F<L.length;F++)L[F].x1+=E,L[F].x2+=E,L[F].x3+=E,L[F].x4+=E,L[F].x5&&(L[F].x5+=E,L[F].x6+=E),G[F].textBlock.x+=E}for(F=
|
|
564
|
+
0;F<L.length;F++)E=L[F],sa(O,E,r.fillOpacity),ia.push(E.y1);y(O);J&&r.visible&&("inside"===r.indexLabelPlacement||z.animationEnabled||n(O),z.animationEnabled||A());if(!J)for(F=0;F<x.length;F++)E=r.dataPointIds[F],a={id:E,objectType:"dataPoint",dataPointIndex:F,dataSeriesIndex:0,funnelSection:L[r.reversed?x.length-1-F:F]},z._eventManager.objectMap[E]=a;!z.animationEnabled&&N?t(z,-1,0):z.animationEnabled&&!z.animatedRender&&t(z,-1,0);this.funnelPyramidClickHandler=function(a){var b=-1;if(!ha&&!z.isAnimating&&
|
|
565
|
+
(p(a.dataSeries.explodeOnClick)||a.dataSeries.explodeOnClick)&&(b=r.reversed?x.length-1-a.dataPointIndex:a.dataPointIndex,0<=b)){a=b;if("funnel"===r.type||"pyramid"===r.type)r.reversed?x[x.length-1-a].exploded=x[x.length-1-a].exploded?!1:!0:x[a].exploded=x[a].exploded?!1:!0;t(z,b,500)}};return{source:O,dest:this.plotArea.ctx,animationCallback:function(a,b){M.fadeInAnimation(a,b);1<=a&&(t(z,-1,500),y(z.plotArea.ctx||z.ctx))},easingFunction:M.easing.easeInQuad,animationBase:0}}}}};m.prototype.requestAnimFrame=
|
|
566
|
+
function(){return window.requestAnimationFrame||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,b){b="undefined"===
|
|
567
|
+
typeof b?!0:b;"options"===a?(this.options=g,b&&this.render()):m.base.set.call(this,a,g,b)};m.prototype.exportChart=function(a){a="undefined"===typeof a?{}:a;var g=a.format?a.format:"png",b=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+g);var c=this.canvas;if(c&&g&&b){b=b+"."+g;a="image/"+g;var c=c.toDataURL(a),d=!1,e=document.createElement("a");e.download=b;e.href=c;if("undefined"!==typeof Blob&&new Blob){for(var h=c.replace(/^data:[a-z\/]*;base64,/,
|
|
568
|
+
""),h=atob(h),p=new ArrayBuffer(h.length),p=new Uint8Array(p),m=0;m<h.length;m++)p[m]=h.charCodeAt(m);g=new Blob([p.buffer],{type:"image/"+g});try{window.navigator.msSaveBlob(g,b),d=!0}catch(k){e.dataset.downloadurl=[a,e.download,e.href].join(":"),e.href=window.URL.createObjectURL(g)}}if(!d)try{event=document.createEvent("MouseEvents"),event.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent?e.dispatchEvent(event):e.fireEvent&&e.fireEvent("onclick")}catch(n){g=window.open(),
|
|
569
|
+
g.document.write("<img src='"+c+"'></img><div>Please right click on the image and save it to your device</div>"),g.document.close()}}};m.prototype.print=function(){var a=this.exportChart({toDataURL:!0}),g=document.createElement("iframe");g.setAttribute("class","canvasjs-chart-print-frame");U(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 b=this,c=g.contentWindow||g.contentDocument.document||
|
|
570
|
+
g.contentDocument;c.document.open();c.document.write('<!DOCTYPE HTML>\n<html><body><img src="'+a+'"/><body/></html>');c.document.body&&c.document.body.style&&(c.document.body.style.margin="0px 0px 0px 0px",c.document.body.style.padding="0px 0px 0px 0px");c.document.close();setTimeout(function(){c.focus();c.print();setTimeout(function(){b._canvasJSContainer.removeChild(g)},1E3)},500)};m.prototype.getPercentAndTotal=function(a,g){var b=null,c=null,d=b=null;if(0<=a.type.indexOf("stacked"))c=0,b=g.x.getTime?
|
|
571
|
+
g.x.getTime():g.x,b in a.plotUnit.yTotals&&(c=a.plotUnit.yTotals[b],b=a.plotUnit.yAbsTotals[b],d=isNaN(g.y)?0:0===b?0:100*(g.y/b));else if("pie"===a.type||"doughnut"===a.type||"funnel"===a.type||"pyramid"===a.type){for(b=c=0;b<a.dataPoints.length;b++)isNaN(a.dataPoints[b].y)||(c+=a.dataPoints[b].y);d=isNaN(g.y)?0:100*(g.y/c)}return{percent:d,total:c}};m.prototype.replaceKeywordsWithValue=function(a,g,b,c,d){var e=this;d="undefined"===typeof d?0:d;if((0<=b.type.indexOf("stacked")||"pie"===b.type||
|
|
572
|
+
"doughnut"===b.type||"funnel"===b.type||"pyramid"===b.type)&&(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))){var h="#percent",p="#total",m=this.getPercentAndTotal(b,g),p=isNaN(m.total)?p:m.total,h=isNaN(m.percent)?h:m.percent;do{m="";if(b.percentFormatString)m=b.percentFormatString;else{var m="#,##0.",k=Math.max(Math.ceil(Math.log(1/Math.abs(h))/Math.LN10),2);if(isNaN(k)||!isFinite(k))k=2;for(var n=0;n<k;n++)m+="#";b.percentFormatString=m}a=a.replace("#percent",fa(h,m,e._cultureInfo));a=a.replace("#total",
|
|
573
|
+
fa(p,b.yValueFormatString?b.yValueFormatString:"#,##0.########",e._cultureInfo))}while(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))}return a.replace(/\{.*?\}|"[^"]*"|'[^']*'/g,function(a){if('"'===a[0]&&'"'===a[a.length-1]||"'"===a[0]&&"'"===a[a.length-1])return a.slice(1,a.length-1);a=Ga(a.slice(1,a.length-1));a=a.replace("#index",d);var h=null;try{var f=a.match(/(.*?)\s*\[\s*(.*?)\s*\]/);f&&0<f.length&&(h=Ga(f[2]),a=Ga(f[1]))}catch(k){}f=null;if("color"===a)return"waterfall"===b.type?g.color?
|
|
574
|
+
g.color:0<g.y?b.risingColor:b.fallingColor:"error"===b.type?b.color?b.color:b._colorSet[h%b._colorSet.length]:g.color?g.color:b.color?b.color:b._colorSet[c%b._colorSet.length];if(g.hasOwnProperty(a))f=g;else if(b.hasOwnProperty(a))f=b;else return"";f=f[a];null!==h&&(f=f[h]);return"x"===a?(b.axisX&&"dateTime"===b.axisX.valueType||"dateTime"===b.xValueType||g.x&&g.x.getTime)&&!b.axisX.logarithmic?Ba(f,g.xValueFormatString?g.xValueFormatString:b.xValueFormatString?b.xValueFormatString:b.xValueFormatString=
|
|
575
|
+
e.axisX&&e.axisX.autoValueFormatString?e.axisX.autoValueFormatString:"DD MMM YY",e._cultureInfo):fa(f,g.xValueFormatString?g.xValueFormatString:b.xValueFormatString?b.xValueFormatString:b.xValueFormatString="#,##0.########",e._cultureInfo):"y"===a?fa(f,g.yValueFormatString?g.yValueFormatString:b.yValueFormatString?b.yValueFormatString:b.yValueFormatString="#,##0.########",e._cultureInfo):"z"===a?fa(f,g.zValueFormatString?g.zValueFormatString:b.zValueFormatString?b.zValueFormatString:b.zValueFormatString=
|
|
576
|
+
"#,##0.########",e._cultureInfo):f})};qa(D,P);D.prototype.setLayout=function(){var a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,g=a.layoutManager.getFreeSpace(),b=null,c=0,d=0,e=0,h=0,m=this.markerMargin=this.chart.options.legend&&!p(this.chart.options.legend.markerMargin)?this.chart.options.legend.markerMargin:0.3*this.fontSize;this.height=0;var u=[],k=[];if("top"===this.verticalAlign||"bottom"===this.verticalAlign)this.orientation="horizontal",b=this.verticalAlign,e=this.maxWidth=null!==
|
|
577
|
+
this.maxWidth?this.maxWidth:g.width,h=this.maxHeight=null!==this.maxHeight?this.maxHeight:0.5*g.height;else if("center"===this.verticalAlign){this.orientation="vertical";if("left"===this.horizontalAlign||"center"===this.horizontalAlign||"right"===this.horizontalAlign)b=this.horizontalAlign;e=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*g.width;h=this.maxHeight=null!==this.maxHeight?this.maxHeight:g.height}this.errorMarkerColor=[];for(var n=0;n<this.dataSeries.length;n++){var l=this.dataSeries[n];
|
|
578
|
+
if(l.dataPoints&&l.dataPoints.length){if("pie"!==l.type&&"doughnut"!==l.type&&"funnel"!==l.type&&"pyramid"!==l.type){var q=l.legendMarkerType=l.legendMarkerType?l.legendMarkerType:"line"!==l.type&&"stepLine"!==l.type&&"spline"!==l.type&&"scatter"!==l.type&&"bubble"!==l.type||!l.markerType?"error"===l.type&&l._linkedSeries?l._linkedSeries.legendMarkerType?l._linkedSeries.legendMarkerType:O.getDefaultLegendMarker(l._linkedSeries.type):O.getDefaultLegendMarker(l.type):l.markerType,f=l.legendText?l.legendText:
|
|
579
|
+
this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:l,dataPoint:null}):l.name,t=l.legendMarkerColor=l.legendMarkerColor?l.legendMarkerColor:l.markerColor?l.markerColor:"error"===l.type?p(l.whiskerColor)?l._colorSet[0]:l.whiskerColor:l._colorSet[0],y=l.markerSize||"line"!==l.type&&"stepLine"!==l.type&&"spline"!==l.type?0.75*this.lineHeight:0,z=l.legendMarkerBorderColor?l.legendMarkerBorderColor:l.markerBorderColor,r=l.legendMarkerBorderThickness?l.legendMarkerBorderThickness:
|
|
580
|
+
l.markerBorderThickness?Math.max(1,Math.round(0.2*y)):0;"error"===l.type&&this.errorMarkerColor.push(t);f=l.legendText=this.chart.replaceKeywordsWithValue(f,l.dataPoints[0],l,n);q={markerType:q,markerColor:t,text:f,textBlock:null,chartType:l.type,markerSize:y,lineColor:l._colorSet[0],dataSeriesIndex:l.index,dataPointIndex:null,markerBorderColor:z,markerBorderThickness:r};u.push(q)}else for(var x=0;x<l.dataPoints.length;x++){var v=l.dataPoints[x],q=v.legendMarkerType?v.legendMarkerType:l.legendMarkerType?
|
|
581
|
+
l.legendMarkerType:O.getDefaultLegendMarker(l.type),f=v.legendText?v.legendText:v.name?v.name:l.legendText?l.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:l,dataPoint:v}):v.name?v.name:"DataPoint: "+(x+1),t=v.legendMarkerColor?v.legendMarkerColor:l.legendMarkerColor?l.legendMarkerColor:v.color?v.color:l.color?l.color:l._colorSet[x%l._colorSet.length],y=0.75*this.lineHeight,z=v.legendMarkerBorderColor?v.legendMarkerBorderColor:l.legendMarkerBorderColor?
|
|
582
|
+
l.legendMarkerBorderColor:v.markerBorderColor?v.markerBorderColor:l.markerBorderColor,r=v.legendMarkerBorderThickness?v.legendMarkerBorderThickness:l.legendMarkerBorderThickness?l.legendMarkerBorderThickness:v.markerBorderThickness||l.markerBorderThickness?Math.max(1,Math.round(0.2*y)):0,f=this.chart.replaceKeywordsWithValue(f,v,l,x),q={markerType:q,markerColor:t,text:f,textBlock:null,chartType:l.type,markerSize:y,dataSeriesIndex:n,dataPointIndex:x,markerBorderColor:z,markerBorderThickness:r};(v.showInLegend||
|
|
583
|
+
l.showInLegend&&!1!==v.showInLegend)&&u.push(q)}p(l.legendText)&&(l.legendText=l.name)}}!0===this.reversed&&u.reverse();if(0<u.length){l=null;f=v=x=0;v=null!==this.itemWidth?null!==this.itemMaxWidth?Math.min(this.itemWidth,this.itemMaxWidth,e):this.itemMaxWidth=Math.min(this.itemWidth,e):null!==this.itemMaxWidth?Math.min(this.itemMaxWidth,e):this.itemMaxWidth=e;y=0===y?0.75*this.lineHeight:y;v=(this.itemMaxWidth?this.itemMaxWidth:v)-(y+m);for(n=0;n<u.length;n++){q=u[n];t=v;if("line"===q.chartType||
|
|
584
|
+
"spline"===q.chartType||"stepLine"===q.chartType)t-=2*0.1*this.lineHeight;if(!(0>=h||"undefined"===typeof h||0>=t||"undefined"===typeof t))if("horizontal"===this.orientation){q.textBlock=new ja(this.ctx,{x:0,y:0,maxWidth:t,maxHeight:this.itemWrap?h:this.lineHeight,angle:0,text:q.text,textAlign:this.itemTextAlign,fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"});q.textBlock.measureText();null!==this.itemWidth&&
|
|
585
|
+
(q.textBlock.width=this.itemWidth-(y+m+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0)));if(!l||l.width+Math.round(q.textBlock.width+y+m+(0===l.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))>e)l={items:[],width:0},k.push(l),this.height+=f,f=0;f=Math.max(f,q.textBlock.height?q.textBlock.height:this.lineHeight);q.textBlock.x=l.width;q.textBlock.y=0;l.width+=Math.round(q.textBlock.width+
|
|
586
|
+
y+m+(0===l.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0));l.items.push(q);this.width=Math.max(l.width,this.width)}else q.textBlock=new ja(this.ctx,{x:0,y:0,maxWidth:v,maxHeight:!0===this.itemWrap?h:1.5*this.fontSize,angle:0,text:q.text,textAlign:this.itemTextAlign,fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),q.textBlock.measureText(),
|
|
587
|
+
null!==this.itemWidth&&(q.textBlock.width=this.itemWidth-(y+m+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))),this.height<h-this.lineHeight?(l={items:[],width:0},k.push(l)):(l=k[x],x=(x+1)%k.length),l&&(this.height+=q.textBlock.height?q.textBlock.height:this.lineHeight,q.textBlock.x=l.width,q.textBlock.y=0,l.width+=Math.round(q.textBlock.width+y+m+(0===l.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?
|
|
588
|
+
2*0.1*this.lineHeight:0)),l.items.push(q),this.width=Math.max(l.width,this.width))}this.height=!1===this.itemWrap?k.length*this.lineHeight:this.height+f;this.height=Math.min(h,this.height);this.width=Math.min(e,this.width)}"top"===this.verticalAlign?(d="left"===this.horizontalAlign?g.x1:"right"===this.horizontalAlign?g.x2-this.width:g.x1+g.width/2-this.width/2,c=g.y1):"center"===this.verticalAlign?(d="left"===this.horizontalAlign?g.x1:"right"===this.horizontalAlign?g.x2-this.width:g.x1+g.width/2-
|
|
589
|
+
this.width/2,c=g.y1+g.height/2-this.height/2):"bottom"===this.verticalAlign&&(d="left"===this.horizontalAlign?g.x1:"right"===this.horizontalAlign?g.x2-this.width:g.x1+g.width/2-this.width/2,c=g.y2-this.height);this.items=u;for(n=0;n<this.items.length;n++)q=u[n],q.id=++this.chart._eventManager.lastObjectId,this.chart._eventManager.objectMap[q.id]={id:q.id,objectType:"legendItem",legendItemIndex:n,dataSeriesIndex:q.dataSeriesIndex,dataPointIndex:q.dataPointIndex};this.markerSize=y;this.rows=k;0<u.length&&
|
|
590
|
+
a.layoutManager.registerSpace(b,{width:this.width+2+2,height:this.height+5+5});this.bounds={x1:d,y1:c,x2:d+this.width,y2:c+this.height}};D.prototype.render=function(){var a=this.bounds.x1,g=this.bounds.y1,b=this.markerMargin,c=this.maxWidth,d=this.maxHeight,e=this.markerSize,h=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 p=0,m=0;m<h.length;m++){for(var k=
|
|
591
|
+
h[m],n=0,l=0;l<k.items.length;l++){var q=k.items[l],f=q.textBlock.x+a+(0===l?0.2*e:this.horizontalSpacing),u=g+p,t=f;this.chart.data[q.dataSeriesIndex].visible||(this.ctx.globalAlpha=0.5);this.ctx.save();this.ctx.beginPath();this.ctx.rect(a,g,c,Math.max(d-d%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,
|
|
592
|
+
u+this.lineHeight/2),this.ctx.lineTo(f+0.85*this.lineHeight,u+this.lineHeight/2),this.ctx.stroke(),t-=0.1*this.lineHeight;if("error"===q.chartType){this.ctx.strokeStyle=this.errorMarkerColor[0];this.ctx.lineWidth=e/8;this.ctx.beginPath();var z=f-0.08*this.lineHeight+0.1*this.lineHeight,r=u+0.15*this.lineHeight,x=0.7*this.lineHeight,v=x+0.02*this.lineHeight;this.ctx.moveTo(z,r);this.ctx.lineTo(z+x,r);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(z+x/2,r);this.ctx.lineTo(z+x/2,r+v);this.ctx.stroke();
|
|
593
|
+
this.ctx.beginPath();this.ctx.moveTo(z,r+v);this.ctx.lineTo(z+x,r+v);this.ctx.stroke();this.errorMarkerColor.shift()}aa.drawMarker(f+e/2,u+this.lineHeight/2,this.ctx,q.markerType,"error"===q.chartType||"line"===q.chartType||"spline"===q.chartType?q.markerSize/2:q.markerSize,q.markerColor,q.markerBorderColor,q.markerBorderThickness);q.textBlock.x=f+b+e;if("line"===q.chartType||"stepLine"===q.chartType||"spline"===q.chartType)q.textBlock.x+=0.1*this.lineHeight;q.textBlock.y=Math.round(u+this.lineHeight/
|
|
594
|
+
2);q.textBlock.render(!0);this.ctx.restore();n=0<l?Math.max(n,q.textBlock.height?q.textBlock.height:this.lineHeight):q.textBlock.height?q.textBlock.height:this.lineHeight;this.chart.data[q.dataSeriesIndex].visible||(this.ctx.globalAlpha=1);f=Q(q.id);this.ghostCtx.fillStyle=f;this.ghostCtx.beginPath();this.ghostCtx.fillRect(t,q.textBlock.y-this.lineHeight/2,q.textBlock.x+q.textBlock.width-t,q.textBlock.height?q.textBlock.height:this.lineHeight);q.x1=this.chart._eventManager.objectMap[q.id].x1=t;q.y1=
|
|
595
|
+
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=q.textBlock.y+(q.textBlock.height?q.textBlock.height:this.lineHeight)-this.lineHeight/2}p+=n}};qa(O,P);O.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"===
|
|
596
|
+
a||"bubble"===a||"scatter"===a||"stackedArea"===a||"stackedColumn100"===a||"stackedLine100"===a||"stackedArea100"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeArea"===a||"rangeSplineArea"===a||"boxAndWhisker"===a||"waterfall"===a)return"normal";if("bar"===a||"stackedBar"===a||"stackedBar100"===a||"rangeBar"===a)return"xySwapped";if("pie"===a||"doughnut"===a||"funnel"===a||"pyramid"===a)return"none";"error"!==a&&window.console.log("Unknown Chart Type: "+a);return null};O.getDefaultLegendMarker=
|
|
597
|
+
function(a){if("column"===a||"stackedColumn"===a||"stackedLine"===a||"bar"===a||"stackedBar"===a||"stackedBar100"===a||"bubble"===a||"scatter"===a||"stackedColumn100"===a||"stackedLine100"===a||"stepArea"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeBar"===a||"rangeArea"===a||"rangeSplineArea"===a||"boxAndWhisker"===a||"waterfall"===a)return"square";if("line"===a||"stepLine"===a||"spline"===a||"pie"===a||"doughnut"===a)return"circle";if("area"===a||"splineArea"===a||"stackedArea"===
|
|
598
|
+
a||"stackedArea100"===a||"funnel"===a||"pyramid"===a)return"triangle";if("error"===a)return"none";window.console.log("Unknown Chart Type: "+a);return null};O.prototype.getDataPointAtX=function(a,g,b){if(!this.dataPoints||0===this.dataPoints.length)return null;var c={dataPoint:null,distance:Infinity,index:NaN},d=null,e=0,h=0,m=1,u=Infinity,k=0,n=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=
|
|
599
|
+
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-1)/l*(a-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0));for(;;){h=0<m?l+e:l-e;if(0<=h&&h<this.dataPoints.length){var d=this.dataPoints[h],q=this.axisX&&this.axisX.logarithmic?d.x>a?d.x/a:a/d.x:Math.abs(d.x-a);q<c.distance&&(p(b)||b&&!p(d.y))&&(c.dataPoint=d,c.distance=
|
|
600
|
+
q,c.index=h);d=q;d<=u?u=d:0<m?k++:n++;if(1E3<k&&1E3<n)break}else if(0>l-e&&l+e>=this.dataPoints.length)break;-1===m?(e++,m=1):m=-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:c};O.prototype.getDataPointAtXY=function(a,g,b){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;b=b||!1;var c=[],d=0,e=0,h=1,
|
|
601
|
+
m=!1,u=Infinity,k=0,n=0,l=0;if("none"!==this.chart.plotInfo.axisPlacement)if(l=(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),l=1<q?Math.min(Math.max((this.dataPoints.length-1)/q*Math.log(l/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;else q=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,l=0<q?Math.min(Math.max((this.dataPoints.length-
|
|
602
|
+
1)/q*(l-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;for(;;){e=0<h?l+d:l-d;if(0<=e&&e<this.dataPoints.length){var q=this.chart._eventManager.objectMap[this.dataPointIds[e]],f=this.dataPoints[e],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>=q.x1&&(a<=q.x2&&g>=q.y1&&g<=q.y2)&&(c.push({dataPoint:f,dataPointIndex:e,dataSeries:this,distance:Math.min(Math.abs(q.x1-
|
|
603
|
+
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 y=ka("markerSize",f,this)||4,z=b?20:y,t=Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-g,2));t<=z&&c.push({dataPoint:f,dataPointIndex:e,dataSeries:this,distance:t});q=Math.abs(q.x1-a);q<=u?u=q:0<h?k++:n++;t<=y/2&&(m=!0);break;case "rangeArea":case "rangeSplineArea":y=ka("markerSize",f,this)||
|
|
604
|
+
4;z=b?20:y;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<=z&&c.push({dataPoint:f,dataPointIndex:e,dataSeries:this,distance:t});q=Math.abs(q.x1-a);q<=u?u=q:0<h?k++:n++;t<=y/2&&(m=!0);break;case "bubble":y=q.size;t=Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-g,2));t<=y/2&&(c.push({dataPoint:f,dataPointIndex:e,dataSeries:this,distance:t}),m=!0);break;case "pie":case "doughnut":y=q.center;z="doughnut"===this.type?q.percentInnerRadius*q.radius:
|
|
605
|
+
0;t=Math.sqrt(Math.pow(y.x-a,2)+Math.pow(y.y-g,2));t<q.radius&&t>z&&(t=Math.atan2(g-y.y,a-y.x),0>t&&(t+=2*Math.PI),t=Number(((180*(t/Math.PI)%360+360)%360).toFixed(12)),y=Number(((180*(q.startAngle/Math.PI)%360+360)%360).toFixed(12)),z=Number(((180*(q.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===z&&1<q.endAngle&&(z=360),y>=z&&(0!==f.y&&!p(f.y))&&(z+=360,t<y&&(t+=360)),t>y&&t<z&&(c.push({dataPoint:f,dataPointIndex:e,dataSeries:this,distance:0}),m=!0));break;case "funnel":case "pyramid":t=q.funnelSection;
|
|
606
|
+
g>t.y1&&g<t.y4&&(t.y6?g>t.y6?(e=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)):(e=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)):(e=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>e&&a<t&&(c.push({dataPoint:f,dataPointIndex:q.dataPointIndex,dataSeries:this,distance:0}),m=!0));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/
|
|
607
|
+
2||Math.abs(q.x2-a+q.x1-a)<q.borderThickness&&g>=q.y1&&g<=q.y4)c.push({dataPoint:f,dataPointIndex:e,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-a+q.x1-a)<q.borderThickness&&g>=q.y1&&g<=q.y4)c.push({dataPoint:f,dataPointIndex:e,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),
|
|
608
|
+
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)c.push({dataPoint:f,dataPointIndex:e,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}if(m||1E3<k&&1E3<n)break}}else if(0>l-d&&l+d>=
|
|
609
|
+
this.dataPoints.length)break;-1===h?(d++,h=1):h=-1}a=null;for(g=0;g<c.length;g++)a?c[g].distance<=a.distance&&(a=c[g]):a=c[g];return a};O.prototype.getMarkerProperties=function(a,g,b,c){var d=this.dataPoints,e=d[a].markerColor?d[a].markerColor:this.markerColor?this.markerColor:d[a].color?d[a].color:this.color?this.color:this._colorSet[a%this._colorSet.length],h=d[a].markerBorderColor?d[a].markerBorderColor:this.markerBorderColor?this.markerBorderColor:null,m=p(d[a].markerBorderThickness)?this.markerBorderThickness?
|
|
610
|
+
this.markerBorderThickness:null:d[a].markerBorderThickness,t=d[a].markerType?d[a].markerType:this.markerType;a=p(d[a].markerSize)?this.markerSize:d[a].markerSize;return{x:g,y:b,ctx:c,type:t,size:a,color:e,borderColor:h,borderThickness:m}};qa(A,P);A.prototype.createExtraLabelsForLog=function(a){a=(a||0)+1;if(!(5<a)){var g=this.logLabelValues[0]||this.intervalStartPosition;if(Math.log(this.range)/Math.log(g/this.viewportMinimum)<this.noTicks-1){for(var b=A.getNiceNumber((g-this.viewportMinimum)/Math.min(Math.max(2,
|
|
611
|
+
this.noTicks-this.logLabelValues.length),3),!0),c=Math.ceil(this.viewportMinimum/b)*b;c<g;c+=b)c<this.viewportMinimum||this.logLabelValues.push(c);this.logLabelValues.sort(Sa);this.createExtraLabelsForLog(a)}}};A.prototype.createLabels=function(){var a,g,b=0,c=0,d,e=0,h=0,c=0,c=this.interval,m=0,t,k=0.6*this.chart.height,n;a=!1;var l=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],q=l.length?p(this.scaleBreaks.firstBreakIndex)?0:this.scaleBreaks.firstBreakIndex:0;if("axisX"!==this.type||"dateTime"!==
|
|
612
|
+
this.valueType||this.logarithmic){d=this.viewportMaximum;if(this.labels){a=Math.ceil(c);for(var c=Math.ceil(this.intervalStartPosition),f=!1,b=c;b<this.viewportMaximum;b+=a)if(this.labels[b])f=!0;else{f=!1;break}f&&(this.interval=a,this.intervalStartPosition=c)}if(this.logarithmic&&!this.equidistantInterval)for(this.logLabelValues||(this.logLabelValues=[],this.createExtraLabelsForLog()),c=0,f=q;c<this.logLabelValues.length;c++)if(b=this.logLabelValues[c],b<this.viewportMinimum)c++;else{for(;f<l.length&&
|
|
613
|
+
b>l[f].endValue;f++);a=f<l.length&&b>=l[f].startValue&&b<=l[f].endValue;n=b;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:n,label:this.labels[n]?this.labels[n]:null}):"axisX"===this.type&&this.labels[n]?this.labels[n]:fa(n,this.valueFormatString,this.chart._cultureInfo),a=new ja(this.ctx,{x:0,y:0,maxWidth:e,maxHeight:h,angle:this.labelAngle,text:this.prefix+a+this.suffix,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,cornerRadius:this.labelCornerRadius,
|
|
614
|
+
textAlign:this.labelTextAlign,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle",borderThickness:this.labelBorderThickness,padding:this.labelPadding}),this._labels.push({position:n,textBlock:a,effectiveHeight:null}))}f=q;for(b=this.intervalStartPosition;b<=d;b=parseFloat(1E-12>this.interval?this.logarithmic&&this.equidistantInterval?b*Math.pow(this.logarithmBase,this.interval):
|
|
615
|
+
b+this.interval:(this.logarithmic&&this.equidistantInterval?b*Math.pow(this.logarithmBase,this.interval):b+this.interval).toFixed(12))){for(;f<l.length&&b>l[f].endValue;f++);a=f<l.length&&b>=l[f].startValue&&b<=l[f].endValue;n=b;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:n,label:this.labels[n]?this.labels[n]:null}):"axisX"===this.type&&this.labels[n]?this.labels[n]:fa(n,this.valueFormatString,this.chart._cultureInfo),a=new ja(this.ctx,{x:0,y:0,maxWidth:e,
|
|
616
|
+
maxHeight:h,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",padding:this.labelPadding}),this._labels.push({position:n,textBlock:a,effectiveHeight:null}))}}else for(this.intervalStartPosition=
|
|
617
|
+
this.getLabelStartPoint(new Date(this.viewportMinimum),this.intervalType,this.interval),d=Ya(new Date(this.viewportMaximum),this.interval,this.intervalType),f=q,b=this.intervalStartPosition;b<d;Ya(b,c,this.intervalType)){for(a=b.getTime();f<l.length&&a>l[f].endValue;f++);n=a;a=f<l.length&&a>=l[f].startValue&&a<=l[f].endValue;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:new Date(n),label:this.labels[n]?this.labels[n]:null}):"axisX"===this.type&&this.labels[n]?
|
|
618
|
+
this.labels[n]:Ba(n,this.valueFormatString,this.chart._cultureInfo),a=new ja(this.ctx,{x:0,y:0,maxWidth:e,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,maxHeight:h,angle:this.labelAngle,text:this.prefix+a+this.suffix,textAlign:this.labelTextAlign,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,
|
|
619
|
+
textBaseline:"middle",padding:this.labelPadding}),this._labels.push({position:n,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))/Math.log(this.range):this.lineCoordinates.width/(this.logarithmic&&
|
|
620
|
+
this.equidistantInterval?Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*K[this.intervalType+"Duration"]*this.interval,e="undefined"===typeof this.options.labelMaxWidth?0.5*this.chart.width>>0:this.options.labelMaxWidth,this.chart.panEnabled||(h="undefined"===typeof this.options.labelWrap||this.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize+("object"===typeof this.labelPadding?(this.labelPadding.top||0)+(this.labelPadding.bottom||0):2*this.labelPadding));else if("left"===
|
|
621
|
+
this._position||"right"===this._position)m=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))*K[this.intervalType+"Duration"]*this.interval,
|
|
622
|
+
this.chart.panEnabled||(e="undefined"===typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),h="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize;for(c=0;c<this._labels.length;c++){a=this._labels[c].textBlock;a.maxWidth=e;a.maxHeight=h;var A=a.measureText();t=A.height}d=[];q=l=0;if(this.labelAutoFit||this.options.labelAutoFit)if(p(this.labelAngle)||(this.labelAngle=(this.labelAngle%360+360)%360,90<this.labelAngle&&
|
|
623
|
+
270>this.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360)),"bottom"===this._position||"top"===this._position)if(e=Math.floor(0.9*m),q=0,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=e;this.sessionVariables.labelMaxHeight=h;this.sessionVariables.labelAngle=this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;b<this._labels.length;b++)if(!this._labels[b].breaksLabelType){a=
|
|
624
|
+
this._labels[b].textBlock;for(var y,f=a.text.split(" "),c=0;c<f.length;c++)n=f[c],this.ctx.font=a.fontStyle+" "+a.fontWeight+" "+a.fontSize+"px "+a.fontFamily,n=this.ctx.measureText(n),n.width>q&&(y=b,q=n.width)}b=0;for(b=this.intervalStartPosition<this.viewportMinimum?1:0;b<this._labels.length;b++)if(!this._labels[b].breaksLabelType){a=this._labels[b].textBlock;A=a.measureText();for(f=b+1;f<this._labels.length;f++)if(!this._labels[f].breaksLabelType){g=this._labels[f].textBlock;g=g.measureText();
|
|
625
|
+
break}d.push(a.height);this.sessionVariables.labelMaxHeight=Math.max.apply(Math,d);Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.sin(Math.PI/180*Math.abs(this.labelAngle));c=e*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(h-a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));if(p(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle)if(this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:Math.min((c-e*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/
|
|
626
|
+
Math.sin(Math.PI/180*Math.abs(this.labelAngle)),c),n=(k-(t+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(-25)))/Math.sin(Math.PI/180*Math.abs(-25)),!p(this.options.labelWrap))this.labelWrap?p(this.options.labelMaxWidth)?(this.sessionVariables.labelMaxWidth=Math.min(Math.max(e,q),n),this.sessionVariables.labelWrap=this.labelWrap,g&&A.width+g.width>>0>2*e&&(this.sessionVariables.labelAngle=-25)):(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,
|
|
627
|
+
this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>e?-25:this.sessionVariables.labelAngle):p(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelMaxWidth=e,g&&A.width+g.width>>0>2*e&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=n)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>e?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=
|
|
628
|
+
this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelWrap=this.labelWrap);else{if(p(this.options.labelWrap))if(!p(this.options.labelMaxWidth))this.options.labelMaxWidth<e?(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=c):(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=h);else if(!p(g))if(c=A.width+g.width>>0,f=this.labelFontSize,
|
|
629
|
+
q<e)c-2*e>l&&(l=c-2*e,c>=2*e&&c<2.2*e?(this.sessionVariables.labelMaxWidth=e,p(this.options.labelFontSize)&&12<f&&(f=Math.floor(12/13*f),a.measureText()),this.sessionVariables.labelFontSize=p(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelAngle=this.labelAngle):c>=2.2*e&&c<2.8*e?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=n,this.sessionVariables.labelFontSize=f):c>=2.8*e&&c<3.2*e?(this.sessionVariables.labelMaxWidth=Math.max(e,q),
|
|
630
|
+
this.sessionVariables.labelWrap=!0,p(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=p(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelAngle=this.labelAngle):c>=3.2*e&&c<3.6*e?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=n,this.sessionVariables.labelFontSize=this.labelFontSize):c>3.6*e&&
|
|
631
|
+
c<5*e?(p(this.options.labelFontSize)&&12<f&&(f=Math.floor(12/13*f),a.measureText()),this.sessionVariables.labelFontSize=p(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=n):c>5*e&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=e,this.sessionVariables.labelFontSize=f,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelAngle=this.labelAngle));else if(y===
|
|
632
|
+
b&&(0===y&&q+this._labels[y+1].textBlock.measureText().width-2*e>l||y===this._labels.length-1&&q+this._labels[y-1].textBlock.measureText().width-2*e>l||0<y&&y<this._labels.length-1&&q+this._labels[y+1].textBlock.measureText().width-2*e>l&&q+this._labels[y-1].textBlock.measureText().width-2*e>l))l=0===y?q+this._labels[y+1].textBlock.measureText().width-2*e:q+this._labels[y-1].textBlock.measureText().width-2*e,this.sessionVariables.labelFontSize=p(this.options.labelFontSize)?f:this.options.labelFontSize,
|
|
633
|
+
this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=n;else if(0===l)for(this.sessionVariables.labelFontSize=p(this.options.labelFontSize)?f:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,c=0;c<this._labels.length;c++)a=this._labels[c].textBlock,a.maxWidth=this.sessionVariables.labelMaxWidth=Math.min(Math.max(e,q),n),A=a.measureText(),c<this._labels.length-1&&(f=c+1,g=this._labels[f].textBlock,g.maxWidth=this.sessionVariables.labelMaxWidth=
|
|
634
|
+
Math.min(Math.max(e,q),n),g=g.measureText(),A.width+g.width>>0>2*e&&(this.sessionVariables.labelAngle=-25))}else(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:Math.min((c-e*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),c),n=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)):e,this.sessionVariables.labelMaxHeight=
|
|
635
|
+
this.labelWrap?(k-n*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)):1.5*this.labelFontSize,p(this.options.labelWrap))?p(this.options.labelWrap)&&(this.labelWrap&&!p(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:n,this.sessionVariables.labelMaxHeight=h):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=
|
|
636
|
+
n,this.sessionVariables.labelMaxHeight=Math.max(c,0.9*m),this.sessionVariables.labelWrap=this.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:n):(p(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:n,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight=h)}this.sessionVariables.labelMaxHeight=
|
|
637
|
+
Math.max(this.sessionVariables.labelMaxHeight,1.5*this.labelFontSize);for(c=0;c<this._labels.length;c++)a=this._labels[c].textBlock,a.maxWidth=this.labelMaxWidth=this.sessionVariables.labelMaxWidth,a.fontSize=this.sessionVariables.labelFontSize,a.angle=this.labelAngle=this.sessionVariables.labelAngle,a.wrap=this.labelWrap=this.sessionVariables.labelWrap,a.maxHeight=this.sessionVariables.labelMaxHeight,a.measureText()}else for(b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.labelMaxWidth=
|
|
638
|
+
p(this.options.labelMaxWidth)?p(this.sessionVariables.labelMaxWidth)?this.sessionVariables.labelMaxWidth=e:this.sessionVariables.labelMaxWidth:this.options.labelMaxWidth,a.fontSize=this.labelFontSize=p(this.options.labelFontSize)?p(this.sessionVariables.labelFontSize)?this.sessionVariables.labelFontSize=this.labelFontSize:this.sessionVariables.labelFontSize:this.options.labelFontSize,a.angle=this.labelAngle=p(this.options.labelAngle)?p(this.sessionVariables.labelAngle)?this.sessionVariables.labelAngle=
|
|
639
|
+
this.labelAngle:this.sessionVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=p(this.options.labelWrap)?p(this.sessionVariables.labelWrap)?this.sessionVariables.labelWrap=this.labelWrap:this.sessionVariables.labelWrap:this.options.labelWrap,a.maxHeight=p(this.sessionVariables.labelMaxHeight)?this.sessionVariables.labelMaxHeight=h:this.sessionVariables.labelMaxHeight,a.measureText();else if("left"===this._position||"right"===this._position)if(e=p(this.options.labelMaxWidth)?0.3*this.chart.width>>
|
|
640
|
+
0:this.options.labelMaxWidth,h="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=e;this.sessionVariables.labelMaxHeight=h;this.sessionVariables.labelAngle=p(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;b<this._labels.length;b++)if(!this._labels[b].breaksLabelType){a=
|
|
641
|
+
this._labels[b].textBlock;A=a.measureText();for(f=b+1;f<this._labels.length;f++)if(!this._labels[f].breaksLabelType){g=this._labels[f].textBlock;g=g.measureText();break}d.push(a.height);this.sessionVariables.labelMaxHeight=Math.max.apply(Math,d);c=e*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(h-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));p(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&
|
|
642
|
+
0!==this.options.labelAngle?p(this.options.labelWrap)?p(this.options.labelWrap)&&(p(this.options.labelMaxWidth)?p(g)||(m=A.height+g.height>>0,m-2*h>q&&(q=m-2*h,m>=2*h&&m<2.4*h?(p(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelFontSize=p(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize):m>=2.4*h&&m<2.8*h?(this.sessionVariables.labelMaxHeight=
|
|
643
|
+
c,this.sessionVariables.labelFontSize=this.labelFontSize,this.sessionVariables.labelWrap=!0):m>=2.8*h&&m<3.2*h?(this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelWrap=!0,p(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=p(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelAngle=p(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):
|
|
644
|
+
m>=3.2*h&&m<3.6*h?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelFontSize=this.labelFontSize):m>3.6*h&&m<10*h?(p(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=p(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelMaxWidth=e,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelAngle=
|
|
645
|
+
p(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):m>10*h&&m<50*h&&(p(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=p(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelMaxWidth=e,this.sessionVariables.labelAngle=p(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle))):
|
|
646
|
+
(this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth)):(this.sessionVariables.labelMaxWidth=this.labelWrap?this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth:this.labelMaxWidth?this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth:e,this.sessionVariables.labelMaxHeight=h):(this.sessionVariables.labelAngle=this.labelAngle,
|
|
647
|
+
this.sessionVariables.labelMaxWidth=0===this.labelAngle?e:Math.min((c-h*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)),h),p(this.options.labelWrap))?p(this.options.labelWrap)&&(this.labelWrap&&!p(this.options.labelMaxWidth)?(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=c):(this.sessionVariables.labelMaxWidth=
|
|
648
|
+
this.options.labelMaxWidth?this.options.labelMaxWidth:e,this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:c,p(this.options.labelMaxWidth)&&(this.sessionVariables.labelAngle=this.labelAngle))):this.options.labelWrap?(this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:c,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=e):(this.sessionVariables.labelMaxHeight=h,p(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?
|
|
649
|
+
this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=this.labelWrap)}for(c=0;c<this._labels.length;c++)a=this._labels[c].textBlock,a.maxWidth=this.labelMaxWidth=this.sessionVariables.labelMaxWidth,a.fontSize=this.labelFontSize=this.sessionVariables.labelFontSize,a.angle=this.labelAngle=this.sessionVariables.labelAngle,a.wrap=this.labelWrap=this.sessionVariables.labelWrap,a.maxHeight=this.sessionVariables.labelMaxHeight,a.measureText()}else for(p(this.chart.stockChart)||
|
|
650
|
+
this.chart.isNavigator||(this.sessionVariables.labelMaxHeight=h),b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.labelMaxWidth=p(this.options.labelMaxWidth)?p(this.sessionVariables.labelMaxWidth)?this.sessionVariables.labelMaxWidth=e:this.sessionVariables.labelMaxWidth:this.options.labelMaxWidth,a.fontSize=this.labelFontSize=p(this.options.labelFontSize)?p(this.sessionVariables.labelFontSize)?this.sessionVariables.labelFontSize=this.labelFontSize:this.sessionVariables.labelFontSize:
|
|
638
651
|
this.options.labelFontSize,a.angle=this.labelAngle=p(this.options.labelAngle)?p(this.sessionVariables.labelAngle)?this.sessionVariables.labelAngle=this.labelAngle:this.sessionVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=p(this.options.labelWrap)?p(this.sessionVariables.labelWrap)?this.sessionVariables.labelWrap=this.labelWrap:this.sessionVariables.labelWrap:this.options.labelWrap,a.maxHeight=p(this.sessionVariables.labelMaxHeight)?this.sessionVariables.labelMaxHeight=h:this.sessionVariables.labelMaxHeight,
|
|
639
|
-
a.measureText();
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
p(
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
this.
|
|
647
|
-
this.
|
|
648
|
-
|
|
649
|
-
this.
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
0
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
(
|
|
662
|
-
0
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
0
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
if(
|
|
680
|
-
|
|
681
|
-
c[
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
a[
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
[]
|
|
692
|
-
|
|
693
|
-
(
|
|
694
|
-
b
|
|
695
|
-
|
|
696
|
-
k-c[f].labelEffectiveHeight-5,c[f].lineCoordinates.y2=c[f].lineCoordinates.y1-c[f].lineThickness/2),"inside"===c[f].tickPlacement&&(c[f].lineCoordinates.y1-=c[f].tickLength,c[f].lineCoordinates.y2=c[f].lineCoordinates.y1-c[f].lineThickness/2),c[f].bounds={x1:h,y1:m+(c[f].margin+U),x2:t,y2:k,width:t-h},c[f].bounds.height=c[f].bounds.y2-c[f].bounds.y1,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),
|
|
697
|
-
U+=C[f]+c[f].margin);if(a&&0<a.length)for(f=0;f<a.length;f++){aa=a[f]._labels&&0<a[f]._labels.length?a[f]._labels[0].textBlock.fontSize/2:0;h=Math.round(e.x1+d);m=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y2:e.y1<Math.max(aa,10)?Math.max(aa,10):e.y1):e.y1<Math.max(aa,10)?Math.max(aa,10):e.y1;t=Math.round(e.x1+W+d);k=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y1:e.y2-S>n.height-Math.max(aa,10)?n.height-Math.max(aa,10):e.y2-S):e.y2>n.height-Math.max(aa,10)?n.height-Math.max(aa,10):
|
|
698
|
-
e.y2;if(b&&0<b.length)for(T=0;T<b.length;T++)b[T]&&b[T].labelAutoFit&&(t=b[T].lineCoordinates.x1+(a[0]?("inside"===a[0].labelPlacement?a[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===a[0].tickPlacement?a[0].tickLength:0):0),h=0>b[T].labelAngle||0===b[T].labelAngle?t-W:h);if(c&&0<c.length)for(T=0;T<c.length;T++)c[T]&&c[T].labelAutoFit&&(t=c[T].lineCoordinates.x1+(a[0]?("inside"===a[0].labelPlacement?a[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===a[0].tickPlacement?a[0].tickLength:
|
|
699
|
-
0):0),h=t-W);a[f].lineCoordinates={x1:t-P,y1:m,x2:t-P,y2:k,height:Math.abs(k-m)};"inside"===a[f].labelPlacement&&(a[f].lineCoordinates.x1=a[f].lineCoordinates.x1-a[f].labelEffectiveWidth-5,a[f].lineCoordinates.x2=a[f].lineCoordinates.x1+a[f].lineThickness/2);"inside"===a[f].tickPlacement&&(a[f].lineCoordinates.x1-=a[f].tickLength,a[f].lineCoordinates.x2=a[f].lineCoordinates.x1+a[f].lineThickness/2);a[f].bounds={x1:t-(I[f]+P),y1:m,x2:t-P,y2:k,height:k-m};a[f].bounds.width=a[f].bounds.x2-a[f].bounds.x1;
|
|
700
|
-
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();P+=I[f]+a[f].margin}if(g&&0<g.length)for(f=0;f<g.length;f++){aa=g[f]._labels&&0<g[f]._labels.length?g[f]._labels[0].textBlock.fontSize/2:0;t=Math.round(e.x1-R);m=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y2:e.y1<Math.max(aa,10)?Math.max(aa,10):e.y1):
|
|
701
|
-
e.y1<Math.max(aa,10)?Math.max(aa,10):e.y1;h=Math.round(e.x2-V-R);k=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y1:e.y2-S>n.height-Math.max(aa,10)?n.height-Math.max(aa,10):e.y2-S):e.y2>n.height-Math.max(aa,10)?n.height-Math.max(aa,10):e.y2;if(b&&0<b.length)for(T=0;T<b.length;T++)b[T]&&b[T].labelAutoFit&&(h=b[T].lineCoordinates.x2-(g[0]?("inside"===g[0].labelPlacement?g[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===g[0].tickPlacement?g[0].tickLength:0):0),t=0>b[T].labelAngle||0===
|
|
702
|
-
b[T].labelAngle?h+V:h);if(c&&0<c.length)for(T=0;T<c.length;T++)c[T]&&c[T].labelAutoFit&&(h=c[T].lineCoordinates.x2-(g[0]?("inside"===g[0].labelPlacement?g[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===g[0].tickPlacement?g[0].tickLength:0):0),t=h+V);g[f].lineCoordinates={x1:h+F,y1:m,x2:h+F,y2:k,height:Math.abs(k-m)};"inside"===g[f].labelPlacement&&(g[f].lineCoordinates.x1=g[f].lineCoordinates.x1+g[f].labelEffectiveWidth+(n.isNavigator?0:5),g[f].lineCoordinates.x2=g[f].lineCoordinates.x1+
|
|
703
|
-
g[f].lineThickness/2);"inside"===g[f].tickPlacement&&(g[f].lineCoordinates.x1+=g[f].tickLength,g[f].lineCoordinates.x2=g[f].lineCoordinates.x1+g[f].lineThickness/2);g[f].bounds={x1:h+F,y1:m,x2:h+z[f]+F,y2:k,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();
|
|
704
|
-
F+=z[f]+g[f].margin}for(f=0;f<q.length;f++)"axisY"===q[f].type&&(q[f].calculateValueToPixelConversionParameters(),q[f].calculateBreaksSizeInValues());if(0<y){if(a&&0<a.length)for(f=0;f<a.length;f++)u=O[y-1][f]===O[y][f]?!0:!1;else u=!0;if(g&&0<g.length)for(f=0;f<g.length;f++)J=Q[y-1][f]===Q[y][f]?!0:!1;else J=!0;if(b&&0<b.length)for(f=0;f<b.length;f++)K=r[y-1][f]===r[y][f]?!0:!1;else K=!0;if(c&&0<c.length)for(f=0;f<c.length;f++)M=D[y-1][f]===D[y][f]?!0:!1;else M=!0}if(u&&J&&K&&M)break;y++}if(b&&0<
|
|
705
|
-
b.length)for(f=0;f<b.length;f++)b[f].calculateStripLinesThicknessInValues(),b[f].calculateBreaksInPixels();if(c&&0<c.length)for(f=0;f<c.length;f++)c[f].calculateStripLinesThicknessInValues(),c[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,b,c,d){var e=a[0]?a[0].chart:
|
|
706
|
-
g[0].chart,h=e.ctx,m=[];m.push.apply(m,a);m.push.apply(m,g);m.push.apply(m,b);m.push.apply(m,c);e.alignVerticalAxes&&e.alignVerticalAxes();h.save();"normal"===d&&(h.beginPath(),a&&a.length&&h.rect(2,a[0].bounds.y1,a[0].chart.width-4,a[a.length-1].bounds.y2),g&&g.length&&h.rect(2,g[g.length-1].bounds.y1,g[0].chart.width-4,g[0].bounds.y2),h.clip());if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderLabelsTicksAndTitle();if(g&&0<g.length)for(d=0;d<g.length;d++)g[d].renderLabelsTicksAndTitle();h.restore();
|
|
707
|
-
if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderLabelsTicksAndTitle();if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderLabelsTicksAndTitle();e.preparePlotArea();a=e.plotArea;h.save();h.beginPath();h.rect(a.x1,a.y1,Math.abs(a.x2-a.x1),Math.abs(a.y2-a.y1));h.clip();if(m&&0<m.length){for(d=0;d<m.length;d++)m[d].renderStripLinesOfThicknessType("value");for(d=0;d<m.length;d++)m[d].renderInterlacedColors()}h.restore();h=!1;if(m&&0<m.length){for(d=0;d<m.length;d++)m[d].renderGrid(),u&&(m[d].createMask(),
|
|
652
|
+
a.measureText();for(b=0;b<this.stripLines.length;b++){var e=this.stripLines[b],z;e.labelFontSize="outside"===e.labelPlacement&&p(e.options.labelFontSize)?this.labelFontSize:e.labelFontSize;e.labelFontFamily="outside"===e.labelPlacement&&p(e.options.labelFontFamily)?this.labelFontFamily:e.labelFontFamily;e.labelFontWeight="outside"===e.labelPlacement&&p(e.options.labelFontWeight)?this.labelFontWeight:e.labelFontWeight;e.labelFontStyle="outside"===e.labelPlacement&&p(e.options.labelFontStyle)?this.labelFontStyle:
|
|
653
|
+
e.labelFontStyle;if("outside"===e.labelPlacement){h=this.sessionVariables.labelMaxWidth;if("bottom"===this._position||"top"===this._position)p(e.options.labelWrap)&&!p(this.sessionVariables.stripLineLabelMaxHeight)?z=this.sessionVariables.stripLineLabelMaxHeight:this.sessionVariables.stripLineLabelMaxHeight=z=e.labelWrap?0.8*this.chart.height>>0:1.5*e.labelFontSize+("object"===typeof e.labelPadding?(e.labelPadding.top||0)+(e.labelPadding.bottom||0):2*e.labelPadding);if("left"===this._position||"right"===
|
|
654
|
+
this._position)p(e.options.labelWrap)&&!p(this.sessionVariables.stripLineLabelMaxHeight)?z=this.sessionVariables.stripLineLabelMaxHeight:this.sessionVariables.stripLineLabelMaxHeight=z=e.labelWrap?0.8*this.chart.width>>0:1.5*e.labelFontSize+("object"===typeof e.labelPadding?(e.labelPadding.top||0)+(e.labelPadding.bottom||0):2*e.labelPadding);p(e.labelBackgroundColor)&&(e.labelBackgroundColor="#EEEEEE")}else h="bottom"===this._position||"top"===this._position?0.9*this.chart.width>>0:0.9*this.chart.height>>
|
|
655
|
+
0,z=p(e.options.labelWrap)||e.labelWrap?"bottom"===this._position||"top"===this._position?0.8*this.chart.width>>0:0.8*this.chart.height>>0:1.5*e.labelFontSize+("object"===typeof e.labelPadding?(e.labelPadding.top||0)+(e.labelPadding.bottom||0):2*e.labelPadding),p(e.labelBackgroundColor)&&(p(e.startValue)&&0!==e.startValue?e.labelBackgroundColor=u?"transparent":null:e.labelBackgroundColor="#EEEEEE");a=new ja(this.ctx,{x:0,y:0,backgroundColor:e.labelBackgroundColor,borderColor:e.labelBorderColor,borderThickness:e.labelBorderThickness,
|
|
656
|
+
cornerRadius:e.labelCornerRadius,maxWidth:e.options.labelMaxWidth?e.options.labelMaxWidth:h,maxHeight:z,angle:this.labelAngle,text:e.labelFormatter?e.labelFormatter({chart:this.chart,axis:this,stripLine:e}):e.label,textAlign:e.labelTextAlign,fontSize:e.labelFontSize,fontFamily:e.labelFontFamily,fontWeight:e.labelFontWeight,fontColor:e.labelFontColor||e.color,fontStyle:e.labelFontStyle,textBaseline:"middle",padding:e.labelPadding});this._stripLineLabels.push({position:e.value,textBlock:a,effectiveHeight:null,
|
|
657
|
+
stripLine:e})}};A.prototype.createLabelsAndCalculateWidth=function(){var a=0,g=0;this._labels=[];this._stripLineLabels=[];var b=this.chart.isNavigator?0:5;this.labelEffectiveWidth=p(this.labelEffectiveWidth)?0:this.labelEffectiveWidth;if("left"===this._position||"right"===this._position){this.createLabels();for(g=0;g<this._labels.length;g++){var c=this._labels[g].textBlock,c=c.measureText(),d=0,d=0===this.labelAngle?c.width:c.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+c.height*Math.sin(Math.PI/
|
|
658
|
+
180*Math.abs(this.labelAngle));a<=d&&(this.labelEffectiveWidth=a=d);this._labels[g].effectiveWidth=d}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)&&(c=this._stripLineLabels[g].textBlock,c=c.measureText(),d=0===this.labelAngle?c.width:c.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+c.height*Math.sin(Math.PI/
|
|
659
|
+
180*Math.abs(this.labelAngle)),"inside"===this.tickPlacement&&(d+=this.tickLength),"inside"===this.labelPlacement&&(a+=d+b),a<=d&&(a=d),this.stripLineLabelEffectiveWidth=this._stripLineLabels[g].effectiveWidth=d)}return(this.title?this._titleTextBlock.measureText().height+2:0)+a+this.tickLength+b};A.prototype.createLabelsAndCalculateHeight=function(){var a=0;this._labels=[];this._stripLineLabels=[];var g,b=0,c=this.chart.isNavigator?0:5;this.labelEffectiveHeight=p(this.labelEffectiveHeight)?0:this.labelEffectiveHeight;
|
|
660
|
+
if("bottom"===this._position||"top"===this._position){this.createLabels();for(b=0;b<this._labels.length;b++){g=this._labels[b].textBlock;g=g.measureText();var d=0,d=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<=d&&(this.labelEffectiveHeight=a=d);this._labels[b].effectiveHeight=d}for(b=0;b<this._stripLineLabels.length;b++)"outside"===this._stripLineLabels[b].stripLine.labelPlacement&&(this._stripLineLabels[b].stripLine.value>=
|
|
661
|
+
this.viewportMinimum&&this._stripLineLabels[b].stripLine.value<=this.viewportMaximum)&&(g=this._stripLineLabels[b].textBlock,g=g.measureText(),d=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&&(d+=this.tickLength),"inside"===this.labelPlacement&&(a+=d+c),a<=d&&(a=d),this.stripLineLabelEffectiveHeight=this._stripLineLabels[b].effectiveHeight=d)}return(this.title?this._titleTextBlock.measureText().height+
|
|
662
|
+
2:0)+a+this.tickLength+c};A.setLayout=function(a,g,b,c,d,e){var h,m,t,k,n=a[0]?a[0].chart:g[0].chart,l=n.isNavigator?0:10,q=n._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(b&&0<b.length)for(f=0;f<b.length;f++)b[f].calculateAxisParameters();if(c&&0<c.length)for(f=0;f<c.length;f++)c[f].calculateAxisParameters();for(f=0;f<q.length;f++)if(q[f]&&q[f].scaleBreaks&&q[f].scaleBreaks._appliedBreaks.length)for(var u=
|
|
663
|
+
q[f].scaleBreaks._appliedBreaks,y=0;y<u.length&&!(u[y].startValue>q[f].viewportMaximum);y++)u[y].endValue<q[f].viewportMinimum||(p(q[f].scaleBreaks.firstBreakIndex)&&(q[f].scaleBreaks.firstBreakIndex=y),u[y].startValue>=q[f].viewPortMinimum&&(q[f].scaleBreaks.lastBreakIndex=y));for(var z=y=0,r=0,x=0,v=0,A=0,B=0,C,D,I=m=0,J,K,M,u=J=K=M=!1,f=0;f<q.length;f++)q[f]&&q[f].title&&(q[f]._titleTextBlock=new ja(q[f].ctx,{text:q[f].title,fontSize:q[f].titleFontSize,fontFamily:q[f].titleFontFamily,fontWeight:q[f].titleFontWeight,
|
|
664
|
+
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",textAlign:q[f].titleTextAlign,padding:q[f].titlePadding}));for(f=0;f<q.length;f++)if(q[f].title){var R=1.5*q[f].titleFontSize+("object"===typeof q[f].titlePadding?(q[f].titlePadding.top||0)+(q[f].titlePadding.bottom||0):2*q[f].titlePadding);q[f]._titleTextBlock.maxWidth=
|
|
665
|
+
q[f].titleMaxWidth||e.height;q[f]._titleTextBlock.maxHeight=q[f].titleWrap?0.8*e.width:Math.min(R,0.8*e.width);switch(q[f]._position){case "left":q[f]._titleTextBlock.angle=-90;break;case "right":q[f]._titleTextBlock.angle=90;break;default:q[f]._titleTextBlock.maxWidth=q[f].titleMaxWidth||e.width,q[f]._titleTextBlock.maxHeight=q[f].titleWrap?0.8*e.height:Math.min(R,0.8*e.height),q[f]._titleTextBlock.angle=0}}if("normal"===d){for(var x=[],v=[],A=[],B=[],O=[],Q=[],P=[],F=[];4>y;){var X=0,U=0,S=0,W=
|
|
666
|
+
0,$=R=d=0,aa=0,V=0,Y=0,L=h=0;if(b&&0<b.length)for(A=[],f=h=0;f<b.length;f++)A.push(Math.ceil(b[f]?b[f].createLabelsAndCalculateWidth():0)),h+=A[f],$+=b[f]&&!n.isNavigator?b[f].margin:0;else A.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateWidth():0));P.push(A);if(c&&0<c.length)for(B=[],f=L=0;f<c.length;f++)B.push(Math.ceil(c[f]?c[f].createLabelsAndCalculateWidth():0)),L+=B[f],aa+=c[f]?c[f].margin:0;else B.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateWidth():0));F.push(B);h=Math.round(e.x1+h+
|
|
667
|
+
$-(b[0]?("inside"===b[0].labelPlacement?b[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===b[0].tickPlacement?b[0].tickLength:0):0));t=Math.round(Math.min(e.x2-L-aa+(c[0]?("inside"===c[0].labelPlacement?c[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===c[0].tickPlacement?c[0].tickLength:0):0),n.width-l));if(a&&0<a.length)for(x=[],f=V=0;f<a.length;f++)a[f]&&(a[f].lineCoordinates={}),a[f].lineCoordinates.width=Math.abs(t-h),a[f].title&&(a[f]._titleTextBlock.maxWidth=0<a[f].titleMaxWidth&&
|
|
668
|
+
a[f].titleMaxWidth<a[f].lineCoordinates.width?a[f].titleMaxWidth:a[f].lineCoordinates.width),x.push(Math.ceil(a[f]?a[f].createLabelsAndCalculateHeight():0)),V+=x[f],d+=a[f]&&!n.isNavigator?a[f].margin:0;else x.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateHeight():0));O.push(x);if(g&&0<g.length)for(v=[],f=Y=0;f<g.length;f++)g[f]&&(g[f].lineCoordinates={}),g[f].lineCoordinates.width=Math.abs(t-h),g[f].title&&(g[f]._titleTextBlock.maxWidth=0<g[f].titleMaxWidth&&g[f].titleMaxWidth<g[f].lineCoordinates.width?
|
|
669
|
+
g[f].titleMaxWidth:g[f].lineCoordinates.width),v.push(Math.ceil(g[f]?g[f].createLabelsAndCalculateHeight():0)),Y+=v[f],R+=g[f]&&!n.isNavigator?g[f].margin:0;else v.push(Math.ceil(g[0]?g[0].createLabelsAndCalculateHeight():0));Q.push(v);if(a&&0<a.length){for(f=0;f<a.length;f++){if(a[f]){a[f].lineCoordinates.x1=h;t=Math.round(Math.min(e.x2-L-aa+(c[0]?("inside"===c[0].labelPlacement?c[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===c[0].tickPlacement?c[0].tickLength:0):0),n.width-l));if(a[f]._labels&&
|
|
670
|
+
1<a[f]._labels.length){var T=m=0;m=a[f]._labels[1];T="dateTime"===a[f].valueType?a[f]._labels[a[f]._labels.length-2]:a[f]._labels[a[f]._labels.length-1];z=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));r=T.textBlock.width*Math.cos(Math.PI/180*Math.abs(T.textBlock.angle))+T.textBlock.height*Math.sin(Math.PI/180*Math.abs(T.textBlock.angle))}!a[f]||(!a[f].labelAutoFit||p(C)||p(D)||n.isNavigator||
|
|
671
|
+
n.stockChart)||(m=0,0<a[f].labelAngle?(k=r-(T.textBlock.height-T.textBlock._lineHeight/2)*Math.sin(Math.PI/180*T.textBlock.angle),D+k>t&&(a[f].convertPixelToValue(D)>=a[f].viewportMinimum&&a[f].convertPixelToValue(D)<=a[f].viewportMaximum)&&(m+=D+k-t-L)):0>a[f].labelAngle?C-z<h&&C-z<a[f].viewportMinimum&&(I=h-($+a[f].tickLength+A+C-z+a[f].labelFontSize/2)):0===a[f].labelAngle&&(D+r>t&&(a[f].convertPixelToValue(D)>=a[f].viewportMinimum&&a[f].convertPixelToValue(D)<=a[f].viewportMaximum)&&(m=D+r/2-
|
|
672
|
+
t-L),C-z<h&&C-z<a[f].viewportMinimum&&(I=h-$-a[f].tickLength-A-C+z/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<I?h+=I:a[f].viewportMaximum===a[f].maximum&&a[f].viewportMinimum===a[f].minimum&&0===a[f].labelAngle&&(0<I&&(h+=I),0<m&&(t-=m)));n.panEnabled?V=p(n.sessionVariables.axisX.height)||n.stockChart?n.sessionVariables.axisX.height=V:n.sessionVariables.axisX.height:
|
|
673
|
+
n.sessionVariables.axisX.height=V;m=Math.round(e.y2-V-d+X);k=Math.round(e.y2);a[f].lineCoordinates.x2=t;a[f].lineCoordinates.width=t-h;a[f].lineCoordinates.y1=m;a[f].lineCoordinates.y2=m;a[f].bounds={x1:h,y1:m,x2:t,y2:k-(V+d-x[f]-X),width:t-h};a[f].bounds.height=a[f].bounds.y2-a[f].bounds.y1;"inside"===a[f].labelPlacement&&(a[f].lineCoordinates.y1=a[0].bounds.y1+X+(a[f].labelEffectiveHeight||0)+(n.isNavigator?0:5),a[f].lineCoordinates.y2=a[f].lineCoordinates.y1+a[f].lineThickness/2);"inside"===a[f].tickPlacement&&
|
|
674
|
+
(a[f].lineCoordinates.y1+=a[f].tickLength,a[f].lineCoordinates.y2=a[f].lineCoordinates.y1+a[f].lineThickness/2)}X+=x[f]+a[f].margin}$=0===a[0].dataSeries.length;if(!$)for(f=0;f<a[0].dataSeries.length;f++){if(a[0].dataSeries[f].dataPoints){$=!1;break}$=!0}if($)for($=!1,f=1;f<a.length;f++)0!==a[f].dataSeries.length&&($?a[f].lineCoordinates.x2>a[0].lineCoordinates.x2&&(a[0].lineCoordinates.x2=a[f].lineCoordinates.x2):(a[0].lineCoordinates.x2=a[f].lineCoordinates.x2,$=!0),a[0].lineCoordinates.width=a[0].lineCoordinates.x2-
|
|
675
|
+
a[0].lineCoordinates.x1)}if(g&&0<g.length)for(f=0;f<g.length;f++)g[f].lineCoordinates.x1=h,g[f].lineCoordinates.x2=t,g[f].lineCoordinates.width=Math.abs(t-h),g[f]._labels&&1<g[f]._labels.length&&(m=g[f]._labels[1],T="dateTime"===g[f].valueType?g[f]._labels[g[f]._labels.length-2]:g[f]._labels[g[f]._labels.length-1],z=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock.height-T.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)),r=T.textBlock.width*Math.cos(Math.PI/
|
|
676
|
+
180*Math.abs(T.textBlock.angle))+(T.textBlock.height-T.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(T.textBlock.angle))),n.panEnabled?Y=p(n.sessionVariables.axisX2.height)||n.stockChart?n.sessionVariables.axisX2.height=Y:n.sessionVariables.axisX2.height:n.sessionVariables.axisX2.height=Y,m=Math.round(e.y1),k=g[f].lineCoordinates.y1=m+Y+R-U,g[f].lineCoordinates.y2=m,g[f].bounds={x1:h,y1:m+(Y+R-v[f]-U),x2:t,y2:k,width:t-h},g[f].bounds.height=g[f].bounds.y2-g[f].bounds.y1,"inside"===g[f].labelPlacement&&
|
|
677
|
+
(g[f].lineCoordinates.y1=g[0].bounds.y2-U-(g[f].labelEffectiveHeight||0)-5),"inside"===g[f].tickPlacement&&(g[f].lineCoordinates.y1-=g[f].tickLength),U+=v[f]+g[f].margin;if(b&&0<b.length)for(f=0;f<b.length;f++)$=n.isNavigator?0:10,b[f]&&(h=t=Math.round((a[0]?a[0].lineCoordinates.x1:g[0].lineCoordinates.x1)+(b[0]?("inside"===b[0].labelPlacement?b[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===b[0].tickPlacement?b[0].tickLength:0):0)),$=b[f]._labels&&0<b[f]._labels.length?b[f]._labels[b[f]._labels.length-
|
|
678
|
+
1].textBlock._lineHeight/2:l,m=Math.round(Math.max(e.y1+Y+R-(g[0]?("inside"===g[0].labelPlacement?g[0].labelEffectiveHeight+5:0)+("inside"===g[0].tickPlacement?g[0].tickLength:0):0),Math.max($,l))),$=0<a.length?0:b[f]._labels&&0<b[f]._labels.length?b[f]._labels[0].textBlock.height/2:l,k=Math.round(e.y2-V+(a[0]?("inside"===a[0].labelPlacement?a[0].labelEffectiveHeight+(n.isNavigator?0:5):0)+("inside"===a[0].tickPlacement?a[0].tickLength:0):0)-d-$),b[f].lineCoordinates={x1:h-S,y1:m,x2:t-S,y2:k,height:Math.abs(k-
|
|
679
|
+
m)},b[f].bounds={x1:h-(A[f]+S),y1:m,x2:t-S,y2:k,height:k-m},b[f].bounds.width=b[f].bounds.x2-b[f].bounds.x1,"inside"===b[f].labelPlacement&&(b[f].lineCoordinates.x1=b[0].bounds.x1+A[0]-S-(b[f].labelEffectiveWidth||0)-5,b[f].lineCoordinates.x2=b[f].lineCoordinates.x1+b[f].lineThickness/2),"inside"===b[f].tickPlacement&&(b[f].lineCoordinates.x1-=b[f].tickLength,b[f].lineCoordinates.x2=b[f].lineCoordinates.x1+b[f].lineThickness/2),b[f].title&&(b[f]._titleTextBlock.maxWidth=0<b[f].titleMaxWidth&&b[f].titleMaxWidth<
|
|
680
|
+
b[f].lineCoordinates.height?b[f].titleMaxWidth:b[f].lineCoordinates.height),S+=A[f]+b[f].margin);if(c&&0<c.length)for(f=0;f<c.length;f++)c[f]&&(h=t=Math.round((a[0]?a[0].lineCoordinates.x2:g[0].lineCoordinates.x2)-(c[0]?("inside"===c[0].labelPlacement?c[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===c[0].tickPlacement?c[0].tickLength:0):0)),$=c[f]._labels&&0<c[f]._labels.length?c[f]._labels[c[f]._labels.length-1].textBlock.height/2:0,m=Math.round(Math.max(e.y1+Y+R-(g[0]?("inside"===g[0].labelPlacement?
|
|
681
|
+
g[0].labelEffectiveHeight+(n.isNavigator?0:5):0)+("inside"===g[0].tickPlacement?g[0].tickLength:0):0),Math.max($,l))),$=0<a.length?0:c[f]._labels&&0<c[f]._labels.length?c[f]._labels[0].textBlock.height/2:0,k=Math.round(e.y2-(V+d+$)+(a[0]?("inside"===a[0].labelPlacement?a[0].labelEffectiveHeight+(n.isNavigator?0:5):0)+("inside"===a[0].tickPlacement?a[0].tickLength:0):0)),c[f].lineCoordinates={x1:h+W,y1:m,x2:h+W,y2:k,height:Math.abs(k-m)},c[f].bounds={x1:h+W,y1:m,x2:t+B[f]+W,y2:k,height:k-m},c[f].bounds.width=
|
|
682
|
+
c[f].bounds.x2-c[f].bounds.x1,"inside"===c[f].labelPlacement&&(c[f].lineCoordinates.x1=c[0].bounds.x1+W+(c[f].labelEffectiveWidth||0)+(n.isNavigator?0:5),c[f].lineCoordinates.x2=c[f].lineCoordinates.x1+c[f].lineThickness/2),"inside"===c[f].tickPlacement&&(c[f].lineCoordinates.x1+=c[f].tickLength,c[f].lineCoordinates.x2=c[f].lineCoordinates.x1+c[f].lineThickness/2),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),
|
|
683
|
+
W+=B[f]+c[f].margin);if(a&&0<a.length)for(f=0;f<a.length;f++)a[f]&&(a[f].calculateValueToPixelConversionParameters(),a[f].calculateBreaksSizeInValues(),a[f]._labels&&1<a[f]._labels.length&&(C=(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,h=a[f]._labels[a[f]._labels.length-("dateTime"===a[f].valueType?2:1)].position,
|
|
684
|
+
h=a[f].getApparentDifference(a[f].viewportMinimum,h),D=a[f].logarithmic?(1<h?Math.log(h)/a[f].conversionParameters.lnLogarithmBase*Math.abs(a[f].conversionParameters.pixelPerUnit):0)+a[f].lineCoordinates.x1:(0<h?h*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&&(C=(g[f].logarithmic?Math.log(g[f]._labels[1].position/
|
|
685
|
+
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,h=g[f]._labels[g[f]._labels.length-("dateTime"===g[f].valueType?2:1)].position,h=g[f].getApparentDifference(g[f].viewportMinimum,h),D=g[f].logarithmic?(1<h?Math.log(h)/g[f].conversionParameters.lnLogarithmBase*Math.abs(g[f].conversionParameters.pixelPerUnit):0)+g[f].lineCoordinates.x1:(0<h?h*Math.abs(g[f].conversionParameters.pixelPerUnit):
|
|
686
|
+
0)+g[f].lineCoordinates.x1);for(f=0;f<q.length;f++)"axisY"===q[f].type&&(q[f].calculateValueToPixelConversionParameters(),q[f].calculateBreaksSizeInValues());if(0<y){if(a&&0<a.length)for(f=0;f<a.length;f++)u=O[y-1][f]===O[y][f]?!0:!1;else u=!0;if(g&&0<g.length)for(f=0;f<g.length;f++)J=Q[y-1][f]===Q[y][f]?!0:!1;else J=!0;if(b&&0<b.length)for(f=0;f<b.length;f++)K=P[y-1][f]===P[y][f]?!0:!1;else K=!0;if(c&&0<c.length)for(f=0;f<c.length;f++)M=F[y-1][f]===F[y][f]?!0:!1;else M=!0}if(u&&J&&K&&M)break;y++}if(a&&
|
|
687
|
+
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(b&&0<b.length)for(f=0;f<b.length;f++)b[f].calculateStripLinesThicknessInValues(),b[f].calculateBreaksInPixels();if(c&&0<c.length)for(f=0;f<c.length;f++)c[f].calculateStripLinesThicknessInValues(),c[f].calculateBreaksInPixels()}else{l=[];C=[];I=[];z=[];r=[];D=[];O=[];for(Q=[];4>
|
|
688
|
+
y;){V=W=S=aa=$=R=d=F=P=U=Y=0;if(a&&0<a.length)for(I=[],f=W=0;f<a.length;f++)I.push(Math.ceil(a[f]?a[f].createLabelsAndCalculateWidth():0)),W+=I[f],d+=a[f]&&!n.isNavigator?a[f].margin:0;else I.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateWidth():0));O.push(I);if(g&&0<g.length)for(z=[],f=V=0;f<g.length;f++)z.push(Math.ceil(g[f]?g[f].createLabelsAndCalculateWidth():0)),V+=z[f],R+=g[f]?g[f].margin:0;else z.push(Math.ceil(g[0]?g[0].createLabelsAndCalculateWidth():0));Q.push(z);if(b&&0<b.length)for(f=
|
|
689
|
+
0;f<b.length;f++)b[f].lineCoordinates={},h=Math.round(e.x1+W+d-(a[0]?("inside"===a[0].labelPlacement?a[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===a[0].tickPlacement?a[0].tickLength:0):0)),t=Math.round(Math.min(e.x2-V-R+(g[0]?("inside"===g[0].labelPlacement?g[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===g[0].tickPlacement?g[0].tickLength:0):0),n.width-10)),b[f].labelAutoFit&&!p(x)&&(0<!a.length&&(h=0>b[f].labelAngle?Math.max(h,x):0===b[f].labelAngle?Math.max(h,x/2):h),0<
|
|
690
|
+
!g.length&&(t=0<b[f].labelAngle?t-v/2:0===b[f].labelAngle?t-v/2:t)),b[f].lineCoordinates.x1=h,b[f].lineCoordinates.x2=t,b[f].lineCoordinates.width=Math.abs(t-h),b[f].title&&(b[f]._titleTextBlock.maxWidth=0<b[f].titleMaxWidth&&b[f].titleMaxWidth<b[f].lineCoordinates.width?b[f].titleMaxWidth:b[f].lineCoordinates.width);if(c&&0<c.length)for(f=0;f<c.length;f++)c[f].lineCoordinates={},h=Math.round(e.x1+W+d-(a[0]?("inside"===a[0].labelPlacement?a[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===
|
|
691
|
+
a[0].tickPlacement?a[0].tickLength:0):0)),t=Math.round(Math.min(e.x2-V-R+(g[0]?("inside"===g[0].labelPlacement?g[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===g[0].tickPlacement?g[0].tickLength:0):0),c[f].chart.width-10)),c[f]&&c[f].labelAutoFit&&!p(A)&&(0<!a.length&&(h=0<c[f].labelAngle?Math.max(h,A):0===c[f].labelAngle?Math.max(h,A/2):h),0<!g.length&&(t-=B/2)),c[f].lineCoordinates.x1=h,c[f].lineCoordinates.x2=t,c[f].lineCoordinates.width=Math.abs(t-h),c[f].title&&(c[f]._titleTextBlock.maxWidth=
|
|
692
|
+
0<c[f].titleMaxWidth&&c[f].titleMaxWidth<c[f].lineCoordinates.width?c[f].titleMaxWidth:c[f].lineCoordinates.width);if(b&&0<b.length)for(l=[],f=S=0;f<b.length;f++)l.push(Math.ceil(b[f]?b[f].createLabelsAndCalculateHeight():0)),S+=l[f]+b[f].margin,$+=b[f].margin;else l.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateHeight():0));r.push(l);if(c&&0<c.length)for(C=[],f=0;f<c.length;f++)C.push(Math.ceil(c[f]?c[f].createLabelsAndCalculateHeight():0)),aa+=c[f].margin;else C.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateHeight():
|
|
693
|
+
0));D.push(C);if(b&&0<b.length)for(f=0;f<b.length;f++)0<b[f]._labels.length&&(m=b[f]._labels[0],T=b[f]._labels[b[f]._labels.length-1],x=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock.height-T.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)),v=T.textBlock.width*Math.cos(Math.PI/180*Math.abs(T.textBlock.angle))+(T.textBlock.height-T.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(T.textBlock.angle)));if(c&&0<c.length)for(f=0;f<c.length;f++)c[f]&&
|
|
694
|
+
0<c[f]._labels.length&&(m=c[f]._labels[0],T=c[f]._labels[c[f]._labels.length-1],A=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock.height-T.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)),B=T.textBlock.width*Math.cos(Math.PI/180*Math.abs(T.textBlock.angle))+(T.textBlock.height-T.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(T.textBlock.angle)));if(n.panEnabled)for(f=0;f<b.length;f++)l[f]=p(n.sessionVariables.axisY[f].height)?n.sessionVariables.axisY[f].height=
|
|
695
|
+
l[f]:n.sessionVariables.axisY[f].height;else for(f=0;f<b.length;f++)n.sessionVariables.axisY[f].height=l[f];if(b&&0<b.length)for(f=b.length-1;0<=f;f--)m=Math.round(e.y2),k=Math.round(e.y2>b[f].chart.height?b[f].chart.height:e.y2),b[f].lineCoordinates.y1=m-(l[f]+b[f].margin+Y),b[f].lineCoordinates.y2=m-(l[f]+b[f].margin+Y),"inside"===b[f].labelPlacement&&(b[f].lineCoordinates.y1=b[f].lineCoordinates.y1+b[f].labelEffectiveHeight+(n.isNavigator?0:5),b[f].lineCoordinates.y2=b[f].lineCoordinates.y1+b[f].lineThickness/
|
|
696
|
+
2),"inside"===b[f].tickPlacement&&(b[f].lineCoordinates.y1+=b[f].tickLength,b[f].lineCoordinates.y2=b[f].lineCoordinates.y1+b[f].lineThickness/2),b[f].bounds={x1:h,y1:m-(l[f]+Y+b[f].margin),x2:t,y2:k-(Y+b[f].margin),width:t-h,height:l[f]},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),Y+=l[f]+b[f].margin;if(c&&0<c.length)for(f=c.length-1;0<=f;f--)c[f]&&(m=Math.round(e.y1),k=Math.round(e.y1+
|
|
697
|
+
(C[f]+c[f].margin+U)),c[f].lineCoordinates.y1=k,c[f].lineCoordinates.y2=k,"inside"===c[f].labelPlacement&&(c[f].lineCoordinates.y1=k-c[f].labelEffectiveHeight-5,c[f].lineCoordinates.y2=c[f].lineCoordinates.y1-c[f].lineThickness/2),"inside"===c[f].tickPlacement&&(c[f].lineCoordinates.y1-=c[f].tickLength,c[f].lineCoordinates.y2=c[f].lineCoordinates.y1-c[f].lineThickness/2),c[f].bounds={x1:h,y1:m+(c[f].margin+U),x2:t,y2:k,width:t-h},c[f].bounds.height=c[f].bounds.y2-c[f].bounds.y1,c[f].title&&(c[f]._titleTextBlock.maxWidth=
|
|
698
|
+
0<c[f].titleMaxWidth&&c[f].titleMaxWidth<c[f].lineCoordinates.width?c[f].titleMaxWidth:c[f].lineCoordinates.width),U+=C[f]+c[f].margin);if(a&&0<a.length)for(f=0;f<a.length;f++){$=a[f]._labels&&0<a[f]._labels.length?a[f]._labels[0].textBlock.fontSize/2:0;h=Math.round(e.x1+d);m=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y2:e.y1<Math.max($,10)?Math.max($,10):e.y1):e.y1<Math.max($,10)?Math.max($,10):e.y1;t=Math.round(e.x1+W+d);k=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y1:e.y2-S>n.height-
|
|
699
|
+
Math.max($,10)?n.height-Math.max($,10):e.y2-S):e.y2>n.height-Math.max($,10)?n.height-Math.max($,10):e.y2;if(b&&0<b.length)for(T=0;T<b.length;T++)b[T]&&b[T].labelAutoFit&&(t=b[T].lineCoordinates.x1+(a[0]?("inside"===a[0].labelPlacement?a[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===a[0].tickPlacement?a[0].tickLength:0):0),h=0>b[T].labelAngle||0===b[T].labelAngle?t-W:h);if(c&&0<c.length)for(T=0;T<c.length;T++)c[T]&&c[T].labelAutoFit&&(t=c[T].lineCoordinates.x1+(a[0]?("inside"===a[0].labelPlacement?
|
|
700
|
+
a[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===a[0].tickPlacement?a[0].tickLength:0):0),h=t-W);a[f].lineCoordinates={x1:t-P,y1:m,x2:t-P,y2:k,height:Math.abs(k-m)};"inside"===a[f].labelPlacement&&(a[f].lineCoordinates.x1=a[f].lineCoordinates.x1-a[f].labelEffectiveWidth-5,a[f].lineCoordinates.x2=a[f].lineCoordinates.x1+a[f].lineThickness/2);"inside"===a[f].tickPlacement&&(a[f].lineCoordinates.x1-=a[f].tickLength,a[f].lineCoordinates.x2=a[f].lineCoordinates.x1+a[f].lineThickness/2);a[f].bounds=
|
|
701
|
+
{x1:t-(I[f]+P),y1:m,x2:t-P,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();P+=I[f]+a[f].margin}if(g&&0<g.length)for(f=0;f<g.length;f++){$=g[f]._labels&&0<g[f]._labels.length?g[f]._labels[0].textBlock.fontSize/2:0;t=Math.round(e.x1-R);m=c&&0<
|
|
702
|
+
c.length?Math.round(c[0]?c[0].lineCoordinates.y2:e.y1<Math.max($,10)?Math.max($,10):e.y1):e.y1<Math.max($,10)?Math.max($,10):e.y1;h=Math.round(e.x2-V-R);k=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y1:e.y2-S>n.height-Math.max($,10)?n.height-Math.max($,10):e.y2-S):e.y2>n.height-Math.max($,10)?n.height-Math.max($,10):e.y2;if(b&&0<b.length)for(T=0;T<b.length;T++)b[T]&&b[T].labelAutoFit&&(h=b[T].lineCoordinates.x2-(g[0]?("inside"===g[0].labelPlacement?g[0].labelEffectiveWidth+(n.isNavigator?0:
|
|
703
|
+
5):0)+("inside"===g[0].tickPlacement?g[0].tickLength:0):0),t=0>b[T].labelAngle||0===b[T].labelAngle?h+V:h);if(c&&0<c.length)for(T=0;T<c.length;T++)c[T]&&c[T].labelAutoFit&&(h=c[T].lineCoordinates.x2-(g[0]?("inside"===g[0].labelPlacement?g[0].labelEffectiveWidth+(n.isNavigator?0:5):0)+("inside"===g[0].tickPlacement?g[0].tickLength:0):0),t=h+V);g[f].lineCoordinates={x1:h+F,y1:m,x2:h+F,y2:k,height:Math.abs(k-m)};"inside"===g[f].labelPlacement&&(g[f].lineCoordinates.x1=g[f].lineCoordinates.x1+g[f].labelEffectiveWidth+
|
|
704
|
+
(n.isNavigator?0:5),g[f].lineCoordinates.x2=g[f].lineCoordinates.x1+g[f].lineThickness/2);"inside"===g[f].tickPlacement&&(g[f].lineCoordinates.x1+=g[f].tickLength,g[f].lineCoordinates.x2=g[f].lineCoordinates.x1+g[f].lineThickness/2);g[f].bounds={x1:h+F,y1:m,x2:h+z[f]+F,y2:k,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();
|
|
705
|
+
g[f].calculateBreaksSizeInValues();F+=z[f]+g[f].margin}for(f=0;f<q.length;f++)"axisY"===q[f].type&&(q[f].calculateValueToPixelConversionParameters(),q[f].calculateBreaksSizeInValues());if(0<y){if(a&&0<a.length)for(f=0;f<a.length;f++)u=O[y-1][f]===O[y][f]?!0:!1;else u=!0;if(g&&0<g.length)for(f=0;f<g.length;f++)J=Q[y-1][f]===Q[y][f]?!0:!1;else J=!0;if(b&&0<b.length)for(f=0;f<b.length;f++)K=r[y-1][f]===r[y][f]?!0:!1;else K=!0;if(c&&0<c.length)for(f=0;f<c.length;f++)M=D[y-1][f]===D[y][f]?!0:!1;else M=
|
|
706
|
+
!0}if(u&&J&&K&&M)break;y++}if(b&&0<b.length)for(f=0;f<b.length;f++)b[f].calculateStripLinesThicknessInValues(),b[f].calculateBreaksInPixels();if(c&&0<c.length)for(f=0;f<c.length;f++)c[f].calculateStripLinesThicknessInValues(),c[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,
|
|
707
|
+
g,b,c,d){var e=a[0]?a[0].chart:g[0].chart,h=e.ctx,m=[];m.push.apply(m,a);m.push.apply(m,g);m.push.apply(m,b);m.push.apply(m,c);e.alignVerticalAxes&&e.alignVerticalAxes();h.save();"normal"===d&&(h.beginPath(),a&&a.length&&h.rect(2,a[0].bounds.y1,a[0].chart.width-4,a[a.length-1].bounds.y2),g&&g.length&&h.rect(2,g[g.length-1].bounds.y1,g[0].chart.width-4,g[0].bounds.y2),h.clip());if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderLabelsTicksAndTitle();if(g&&0<g.length)for(d=0;d<g.length;d++)g[d].renderLabelsTicksAndTitle();
|
|
708
|
+
h.restore();if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderLabelsTicksAndTitle();if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderLabelsTicksAndTitle();e.preparePlotArea();a=e.plotArea;h.save();h.beginPath();h.rect(a.x1,a.y1,Math.abs(a.x2-a.x1),Math.abs(a.y2-a.y1));h.clip();if(m&&0<m.length){for(d=0;d<m.length;d++)m[d].renderStripLinesOfThicknessType("value");for(d=0;d<m.length;d++)m[d].renderInterlacedColors()}h.restore();h=!1;if(m&&0<m.length){for(d=0;d<m.length;d++)m[d].renderGrid(),u&&(m[d].createMask(),
|
|
708
709
|
m[d].renderBreaksBackground());for(d=0;d<m.length;d++)m[d].renderAxisLine();for(d=0;d<m.length;d++)m[d].renderStripLinesOfThicknessType("pixel"),m[d].crosshair&&m[d].crosshair.enabled&&(h=!0,e.clearedOverlayedCanvas=m[d].type)}if(h||!h&&e.clearedOverlayedCanvas&&0<=e.clearedOverlayedCanvas.indexOf("axis"))e.resetOverlayedCanvas(),e.renderCrosshairs(null,p(e.sessionVariables.crosshairShownByPixel)||e.sessionVariables.crosshairShownByPixel?!0:e.sessionVariables.crosshairShownByPixel)};A.prototype.calculateStripLinesThicknessInValues=
|
|
709
710
|
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),b=Math.max(this.stripLines[a].startValue,this.stripLines[a].endValue),c=this.getApparentDifference(g,b);this.stripLines[a].value=this.convertPixelToValue((this.convertValueToPixel(g)+this.convertValueToPixel(b))/2);this.stripLines[a].thickness=c;this.stripLines[a]._thicknessType="value"}};A.prototype.calculateBreaksSizeInValues=
|
|
710
711
|
function(){for(var a="left"===this._position||"right"===this._position?this.lineCoordinates.height||this.chart.height:this.lineCoordinates.width||this.chart.width,g=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],b=this.conversionParameters.pixelPerUnit||a/(this.logarithmic?this.conversionParameters.maximum/this.conversionParameters.minimum:this.conversionParameters.maximum-this.conversionParameters.minimum),c=this.scaleBreaks&&!p(this.scaleBreaks.options.spacing),d,e=0;e<g.length;e++)d=c||!p(g[e].options.spacing),
|
|
@@ -888,10 +889,10 @@ this.parent._position&&(k.y=this.parent.lineCoordinates.y1-k.height+k.fontSize/2
|
|
|
888
889
|
fa(p(b)?this.parent.convertPixelToValue(a):b,this.valueFormatString,this.chart._cultureInfo):this.label:this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:p(b)?this.parent.convertPixelToValue(a):b}):p(this.options.label)?Ba(p(b)?this.parent.convertPixelToValue(a):b,this.valueFormatString,this.chart._cultureInfo):this.label;k.x=c-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&&
|
|
889
890
|
(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-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:p(b)?this.parent.convertPixelToValue(g):b}):p(this.options.label)?fa(p(b)?this.parent.convertPixelToValue(g):
|
|
890
891
|
b,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/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<
|
|
891
|
-
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"===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.measureText().height>this.chart.bounds.y2&&(k.y=this.chart.bounds.y2-k.height+k.fontSize/2+2);f.globalAlpha=l;0<q&&(
|
|
892
|
-
this.parent.sessionVariables._crosshairHidden=this._hidden=!1);this.value="bottom"===this.parent._position||"top"===this.parent._position?this.parent.convertPixelToValue(a):this.parent.convertPixelToValue(g)}if("bottom"===this.parent._position||"top"===this.parent._position)this.parent.sessionVariables.crosshairValue=this._updatedValue=this.parent.convertPixelToValue(m);if("left"===this.parent._position||"right"===this.parent._position)this.parent.sessionVariables.crosshairValue=
|
|
893
|
-
this.parent.convertPixelToValue(t);this._textBlock=k;this._label=b;p(b)||this.renderLabel();f.restore();f.globalAlpha=u};ea.prototype.renderLabel=function(){this.value>=Math.min(this.parent.viewportMinimum,this.parent.viewportMaximum)&&this.value<=Math.max(this.parent.viewportMinimum,this.parent.viewportMaximum)&&(p(this._textBlock)||(p(this._textBlock.text)||!("number"===typeof this._textBlock.text.valueOf()||0<this._textBlock.text.length)||this._hidden)||this._textBlock.render(!0),
|
|
894
|
-
this.dispatchEvent("updated",{chart:this.chart,crosshair:this.options,axis:this.parent,value:this.value},this.parent))};qa(na,P);na.prototype._updateOptions=function(){this.updateOption("enabled");this.updateOption("shared");this.updateOption("animationEnabled");this.updateOption("content");this.updateOption("contentFormatter");this.updateOption("reversed");this.updateOption("backgroundColor");this.updateOption("borderColor");this.updateOption("borderThickness");this.updateOption("cornerRadius");
|
|
892
|
+
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"===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.measureText().height>this.chart.bounds.y2&&(k.y=this.chart.bounds.y2-k.height+k.fontSize/2+2);f.globalAlpha=l;0<q&&("bottom"!==this.parent._position||d<=this.parent.lineCoordinates.x2)&&
|
|
893
|
+
(f.moveTo(c,e),f.lineTo(d,h),f.stroke(),this.parent.sessionVariables._crosshairHidden=this._hidden=!1);this.value="bottom"===this.parent._position||"top"===this.parent._position?this.parent.convertPixelToValue(a):this.parent.convertPixelToValue(g)}if("bottom"===this.parent._position||"top"===this.parent._position)this.parent.sessionVariables.crosshairValue=this._updatedValue=this.parent.convertPixelToValue(m);if("left"===this.parent._position||"right"===this.parent._position)this.parent.sessionVariables.crosshairValue=
|
|
894
|
+
this._updatedValue=this.parent.convertPixelToValue(t);this._textBlock=k;this._label=b;p(b)||this.renderLabel();f.restore();f.globalAlpha=u};ea.prototype.renderLabel=function(){this.value>=Math.min(this.parent.viewportMinimum,this.parent.viewportMaximum)&&this.value<=Math.max(this.parent.viewportMinimum,this.parent.viewportMaximum)&&(p(this._textBlock)||(p(this._textBlock.text)||!("number"===typeof this._textBlock.text.valueOf()||0<this._textBlock.text.length)||this._hidden)||this._textBlock.render(!0),
|
|
895
|
+
p(this._label)&&this.dispatchEvent("updated",{chart:this.chart,crosshair:this.options,axis:this.parent,value:this.value},this.parent))};qa(na,P);na.prototype._updateOptions=function(){this.updateOption("enabled");this.updateOption("shared");this.updateOption("animationEnabled");this.updateOption("content");this.updateOption("contentFormatter");this.updateOption("reversed");this.updateOption("backgroundColor");this.updateOption("borderColor");this.updateOption("borderThickness");this.updateOption("cornerRadius");
|
|
895
896
|
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","canvasjs-chart-tooltip");this.container.style.position="absolute";this.container.style.height="auto";this.container.style.boxShadow="1px 1px 2px 2px rgba(0,0,0,0.1)";
|
|
896
897
|
this.container.style.zIndex="1000";this.container.style.pointerEvents="none";this.container.style.display="none";var a=document.createElement("div");a.style.width="auto";a.style.height="auto";a.style.minWidth="50px";a.style.lineHeight="normal";a.style.margin="0px 0px 0px 0px";a.style.padding="5px";a.style.fontFamily="Calibri, Arial, Georgia, serif";a.style.fontWeight="normal";a.style.fontStyle=u?"italic":"normal";a.style.fontSize="14px";a.style.color="#000000";a.style.textShadow="1px 1px 1px rgba(0, 0, 0, 0.1)";
|
|
897
898
|
a.style.textAlign="left";a.style.border="2px solid gray";a.style.background=u?"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";u||(a.style.filter="alpha(opacity = 90)",a.style.filter="progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=135, Color='#666666')");a.innerText="Sample Tooltip";this.container.appendChild(a);
|
|
@@ -915,8 +916,8 @@ this.contentDiv.style.borderWidth=this.borderThickness||0===this.borderThickness
|
|
|
915
916
|
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(c=0;c<e.length;c++)g.push({xValue:e[c].dataPoint.x,dataPoint:e[c].dataPoint,dataSeries:e[c].dataSeries,dataPointIndex:e[c].index,dataSeriesIndex:e[c].dataSeries._index});this._updatedEventParameters={chart:this.chart,toolTip:this.options,
|
|
916
917
|
content:b,entries:g}}}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;p(this.chart.clearedOverlayedCanvas)||"toolTip"===this.chart.clearedOverlayedCanvas?(this.chart.resetOverlayedCanvas(),g.clearRect(0,0,this.chart.width,this.chart.height),this.chart.clearedOverlayedCanvas="toolTip",this.chart.sessionVariables._dataHighlighted=!1):
|
|
917
918
|
this.chart.clearedOverlayedCanvas=null;g.save();var b=this.chart.plotArea,c=0;g.beginPath();g.rect(b.x1,b.y1,b.x2-b.x1,b.y2-b.y1);g.clip();for(b=0;b<a.length;b++){var d=a[b];if((d=this.chart._eventManager.objectMap[d.dataSeries.dataPointIds[d.index]])&&d.objectType&&"dataPoint"===d.objectType){var c=this.chart.data[d.dataSeriesIndex],e=c.dataPoints[d.dataPointIndex],h=d.dataPointIndex;!1===e.highlightEnabled||!0!==c.highlightEnabled&&!0!==e.highlightEnabled||("line"===c.type||"stepLine"===c.type||
|
|
918
|
-
"spline"===c.type||"scatter"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"stackedArea"===c.type||"stackedArea100"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type?(e=c.getMarkerProperties(h,d.x1,d.y1,this.chart.overlaidCanvasCtx),e.size=Math.max(1.5*e.size<<0,10),e.borderColor=e.borderColor||"#FFFFFF",e.borderThickness=e.borderThickness||Math.ceil(0.1*e.size)
|
|
919
|
-
e.size=Math.max(1.5*e.size<<0,10),e.borderColor=e.borderColor||"#FFFFFF",e.borderThickness=e.borderThickness||Math.ceil(0.1*e.size)
|
|
919
|
+
"spline"===c.type||"scatter"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"stackedArea"===c.type||"stackedArea100"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type?(e=c.getMarkerProperties(h,d.x1,d.y1,this.chart.overlaidCanvasCtx),e.size=Math.max(1.5*e.size<<0,10),e.borderColor=e.borderColor||"#FFFFFF",e.borderThickness=e.borderThickness||Math.ceil(0.1*e.size),aa.drawMarkers([e]),"undefined"!==typeof d.y2&&(e=c.getMarkerProperties(h,d.x1,d.y2,this.chart.overlaidCanvasCtx),
|
|
920
|
+
e.size=Math.max(1.5*e.size<<0,10),e.borderColor=e.borderColor||"#FFFFFF",e.borderThickness=e.borderThickness||Math.ceil(0.1*e.size),aa.drawMarkers([e])),this.chart.sessionVariables._dataHighlighted=!0):"bubble"===c.type?(e=c.getMarkerProperties(h,d.x1,d.y1,this.chart.overlaidCanvasCtx),e.size=d.size,e.color="white",e.borderColor="white",g.globalAlpha=0.3,aa.drawMarkers([e]),g.globalAlpha=1,this.chart.sessionVariables._dataHighlighted=!0):"column"===c.type||"stackedColumn"===c.type||"stackedColumn100"===
|
|
920
921
|
c.type||"bar"===c.type||"rangeBar"===c.type||"stackedBar"===c.type||"stackedBar100"===c.type||"rangeColumn"===c.type||"waterfall"===c.type?(da(g,d.x1,d.y1,d.x2,d.y2,"white",0,null,!1,!1,!1,!1,0.3),this.chart.sessionVariables._dataHighlighted=!0):"pie"===c.type||"doughnut"===c.type?(ra(g,d.center,d.radius,"white",c.type,d.startAngle,d.endAngle,0.3,d.percentInnerRadius),this.chart.sessionVariables._dataHighlighted=!0):"funnel"===c.type||"pyramid"===c.type?(sa(g,d.funnelSection,0.3,"white"),this.chart.sessionVariables._dataHighlighted=
|
|
921
922
|
!0):"candlestick"===c.type?(g.globalAlpha=1,g.strokeStyle=d.color,g.lineWidth=2*d.borderThickness,c=0===g.lineWidth%2?0:0.5,g.beginPath(),g.moveTo(d.x3-c,Math.min(d.y2,d.y3)),g.lineTo(d.x3-c,Math.min(d.y1,d.y4)),g.stroke(),g.beginPath(),g.moveTo(d.x3-c,Math.max(d.y1,d.y4)),g.lineTo(d.x3-c,Math.max(d.y2,d.y3)),g.stroke(),da(g,d.x1,Math.min(d.y1,d.y4),d.x2,Math.max(d.y1,d.y4),"transparent",2*d.borderThickness,d.color,!1,!1,!1,!1),g.globalAlpha=1,this.chart.sessionVariables._dataHighlighted=!0):"ohlc"===
|
|
922
923
|
c.type?(g.globalAlpha=1,g.strokeStyle=d.color,g.lineWidth=2*d.borderThickness,c=0===g.lineWidth%2?0:0.5,g.beginPath(),g.moveTo(d.x3-c,d.y2),g.lineTo(d.x3-c,d.y3),g.stroke(),g.beginPath(),g.moveTo(d.x3,d.y1),g.lineTo(d.x1,d.y1),g.stroke(),g.beginPath(),g.moveTo(d.x3,d.y4),g.lineTo(d.x2,d.y4),g.stroke(),g.globalAlpha=1,this.chart.sessionVariables._dataHighlighted=!0):"boxAndWhisker"===c.type?(g.save(),g.globalAlpha=1,g.strokeStyle=d.stemColor,g.lineWidth=2*d.stemThickness,0<d.stemThickness&&(g.beginPath(),
|
|
@@ -961,9 +962,9 @@ delete a.eventParameter,delete a.eventContext);"click"===g&&("dataPoint"===a.obj
|
|
|
961
962
|
(a?a:0),duration:g,animationCallback:b,onComplete:c});for(a=[];0<this.animations.length;)if(g=this.animations.shift(),b=(new Date).getTime(),c=0,g.startTime<=b&&(c=d(Math.min(b-g.startTime,g.duration),0,1,g.duration),c=Math.min(c,1),isNaN(c)||!isFinite(c))&&(c=1),1>c&&a.push(g),g.animationCallback(c),1<=c&&g.onComplete)g.onComplete();this.animations=a;0<this.animations.length?this.animationRequestId=this.chart.requestAnimFrame.call(window,function(){e.animate.call(e)}):this.chart.isAnimating=!1};
|
|
962
963
|
la.prototype.cancelAllAnimations=function(){this.animations=[];this.animationRequestId&&this.chart.cancelRequestAnimFrame.call(window,this.animationRequestId);this.animationRequestId=null;this.chart.isAnimating=!1};var M={yScaleAnimation:function(a,g){if(0!==a){var b=g.dest,c=g.source.canvas,d=g.animationBase;b.drawImage(c,0,0,c.width,c.height,0,d-d*a,b.canvas.width/ma,a*b.canvas.height/ma)}},xScaleAnimation:function(a,g){if(0!==a){var b=g.dest,c=g.source.canvas,d=g.animationBase;b.drawImage(c,0,
|
|
963
964
|
0,c.width,c.height,d-d*a,0,a*b.canvas.width/ma,b.canvas.height/ma)}},xClipAnimation:function(a,g){if(0!==a){var b=g.dest,c=g.source.canvas;b.save();0<a&&b.drawImage(c,0,0,c.width*a,c.height,0,0,c.width*a/ma,c.height/ma);b.restore()}},fadeInAnimation:function(a,g){if(0!==a){var b=g.dest,c=g.source.canvas;b.save();b.globalAlpha=a;b.drawImage(c,0,0,c.width,c.height,0,0,b.canvas.width/ma,b.canvas.height/ma);b.restore()}},easing:{linear:function(a,g,b,c){return b*a/c+g},easeOutQuad:function(a,g,b,c){return-b*
|
|
964
|
-
(a/=c)*(a-2)+g},easeOutQuart:function(a,g,b,c){return-b*((a=a/c-1)*a*a*a-1)+g},easeInQuad:function(a,g,b,c){return b*(a/=c)*a+g},easeInQuart:function(a,g,b,c){return b*(a/=c)*a*a*a+g}}}
|
|
965
|
+
(a/=c)*(a-2)+g},easeOutQuart:function(a,g,b,c){return-b*((a=a/c-1)*a*a*a-1)+g},easeInQuad:function(a,g,b,c){return b*(a/=c)*a+g},easeInQuart:function(a,g,b,c){return b*(a/=c)*a*a*a+g}}},aa={drawMarker:function(a,g,b,c,d,e,h,m){if(b){var p=1;b.fillStyle=e?e:"#000000";b.strokeStyle=h?h:"#000000";b.lineWidth=m?m:0;b.setLineDash&&b.setLineDash(I("solid",m));"circle"===c?(b.moveTo(a,g),b.beginPath(),b.arc(a,g,d/2,0,2*Math.PI,!1),e&&b.fill(),m&&(h?b.stroke():(p=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle=
|
|
965
966
|
"black",b.stroke(),b.globalAlpha=p))):"square"===c?(b.beginPath(),b.rect(a-d/2,g-d/2,d,d),e&&b.fill(),m&&(h?b.stroke():(p=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=p))):"triangle"===c?(b.beginPath(),b.moveTo(a-d/2,g+d/2),b.lineTo(a+d/2,g+d/2),b.lineTo(a,g-d/2),b.closePath(),e&&b.fill(),m&&(h?b.stroke():(p=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=p)),b.beginPath()):"cross"===c&&(b.strokeStyle=e,b.lineWidth=d/4,b.beginPath(),
|
|
966
|
-
b.moveTo(a-d/2,g-d/2),b.lineTo(a+d/2,g+d/2),b.stroke(),b.moveTo(a+d/2,g-d/2),b.lineTo(a-d/2,g+d/2),b.stroke())}},drawMarkers:function(a){for(var g=0;g<a.length;g++){var b=a[g]
|
|
967
|
+
b.moveTo(a-d/2,g-d/2),b.lineTo(a+d/2,g+d/2),b.stroke(),b.moveTo(a+d/2,g-d/2),b.lineTo(a-d/2,g+d/2),b.stroke())}},drawMarkers:function(a){for(var g=0;g<a.length;g++){var b=a[g];aa.drawMarker(b.x,b.y,b.ctx,b.type,b.size,b.color,b.borderColor,b.borderThickness)}}};return m}();t.version="v3.12.19 GA";window.CanvasJS&&(t&&!window.CanvasJS.Chart)&&(window.CanvasJS.Chart=t)})();
|
|
967
968
|
|
|
968
969
|
/*
|
|
969
970
|
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.
|