mirror of
https://github.com/YunoHost/tartiflette.git
synced 2024-09-03 20:06:08 +02:00
894 lines
443 KiB
JavaScript
894 lines
443 KiB
JavaScript
/*
|
|
CanvasJS HTML5 & JavaScript Charts - v2.0 Beta 2 - https://canvasjs.com/
|
|
Copyright 2017 fenopix
|
|
|
|
--------------------- License Information --------------------
|
|
CanvasJS is a commercial product which requires purchase of license. Without a commercial license you can use it for evaluation purposes for upto 30 days. Please refer to the following link for further details.
|
|
https://canvasjs.com/license-canvasjs/
|
|
|
|
*/
|
|
(function(){function la(q,s){q.prototype=Za(s.prototype);q.prototype.constructor=q;q.base=s.prototype}function Za(q){function s(){}s.prototype=q;return new s}function Ra(q,s,u){"millisecond"===u?q.setMilliseconds(q.getMilliseconds()+1*s):"second"===u?q.setSeconds(q.getSeconds()+1*s):"minute"===u?q.setMinutes(q.getMinutes()+1*s):"hour"===u?q.setHours(q.getHours()+1*s):"day"===u?q.setDate(q.getDate()+1*s):"week"===u?q.setDate(q.getDate()+7*s):"month"===u?q.setMonth(q.getMonth()+1*s):"year"===u&&q.setFullYear(q.getFullYear()+
|
|
1*s);return q}function fa(q,s){var u=!1;0>q&&(u=!0,q*=-1);q=""+q;for(s=s?s:1;q.length<s;)q="0"+q;return u?"-"+q:q}function Da(q){if(!q)return q;q=q.replace(/^\s\s*/,"");for(var s=/\s/,u=q.length;s.test(q.charAt(--u)););return q.slice(0,u+1)}function Aa(q){q.roundRect=function(q,u,w,x,y,z,R,B){R&&(this.fillStyle=R);B&&(this.strokeStyle=B);"undefined"===typeof y&&(y=5);this.lineWidth=z;this.beginPath();this.moveTo(q+y,u);this.lineTo(q+w-y,u);this.quadraticCurveTo(q+w,u,q+w,u+y);this.lineTo(q+w,u+x-
|
|
y);this.quadraticCurveTo(q+w,u+x,q+w-y,u+x);this.lineTo(q+y,u+x);this.quadraticCurveTo(q,u+x,q,u+x-y);this.lineTo(q,u+y);this.quadraticCurveTo(q,u,q+y,u);this.closePath();R&&this.fill();B&&0<z&&this.stroke()}}function Na(q,s){return q-s}function W(q){var s=((q&16711680)>>16).toString(16),u=((q&65280)>>8).toString(16);q=((q&255)>>0).toString(16);s=2>s.length?"0"+s:s;u=2>u.length?"0"+u:u;q=2>q.length?"0"+q:q;return"#"+s+u+q}function $a(q,s){var u=this.length>>>0,w=Number(s)||0,w=0>w?Math.ceil(w):Math.floor(w);
|
|
for(0>w&&(w+=u);w<u;w++)if(w in this&&this[w]===q)return w;return-1}function x(q){return null===q||"undefined"===typeof q}function Ea(q){q.indexOf||(q.indexOf=$a);return q}function ab(q){if(V.fSDec)q[V.fSDec("`eeDwdouMhrudods")](V.fSDec("e`u`@ohl`uhnoHuds`uhnoDoe"),function(){V._fTWm&&V._fTWm(q)})}function Sa(q,s,u){u=u||"normal";var w=q+"_"+s+"_"+u,x=Ta[w];if(isNaN(x)){try{q="position:absolute; left:0px; top:-20000px; padding:0px;margin:0px;border:none;white-space:pre;line-height:normal;font-family:"+
|
|
q+"; font-size:"+s+"px; font-weight:"+u+";";if(!pa){var y=document.body;pa=document.createElement("span");pa.innerHTML="";var z=document.createTextNode("Mpgyi");pa.appendChild(z);y.appendChild(pa)}pa.style.display="";pa.setAttribute("style",q);x=Math.round(pa.offsetHeight);pa.style.display="none"}catch(R){x=Math.ceil(1.1*s)}x=Math.max(x,s);Ta[w]=x}return x}function F(q,s){var u=[];if(u={solid:[],shortDash:[3,1],shortDot:[1,1],shortDashDot:[3,1,1,1],shortDashDotDot:[3,1,1,1,1,1],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]}[q||"solid"])for(var w=0;w<u.length;w++)u[w]*=s;else u=[];return u}function $(q,s,u,w){return q.addEventListener?(q.addEventListener(s,u,w||!1),u):q.attachEvent?(w=function(s){s=s||window.event;s.preventDefault=s.preventDefault||function(){s.returnValue=!1};s.stopPropagation=s.stopPropagation||function(){s.cancelBubble=!0};u.call(q,s)},q.attachEvent("on"+s,w),w):!1}function Ua(q,s,u){q*=ia;s*=ia;q=u.getImageData(q,
|
|
s,2,2).data;s=!0;for(u=0;4>u;u++)if(q[u]!==q[u+4]|q[u]!==q[u+8]|q[u]!==q[u+12]){s=!1;break}return s?q[0]<<16|q[1]<<8|q[2]:0}function ja(q,s,u){return q in s?s[q]:u[q]}function Fa(q,s,u){if(w&&Va){var x=q.getContext("2d");Ja=x.webkitBackingStorePixelRatio||x.mozBackingStorePixelRatio||x.msBackingStorePixelRatio||x.oBackingStorePixelRatio||x.backingStorePixelRatio||1;ia=Oa/Ja;q.width=s*ia;q.height=u*ia;Oa!==Ja&&(q.style.width=s+"px",q.style.height=u+"px",x.scale(ia,ia))}else q.width=s,q.height=u}function Wa(q){if(!Xa){var s=
|
|
!1,u=!1;"undefined"===typeof qa.Chart.creditHref?(q.creditHref="https://canvasjs.com/",q.creditText="CanvasJS.com"):(s=q.updateOption("creditText"),u=q.updateOption("creditHref"));if(q.creditHref&&q.creditText){q._creditLink||(q._creditLink=document.createElement("a"),q._creditLink.setAttribute("class","canvasjs-chart-credit"),q._creditLink.setAttribute("style","outline:none;margin:0px;position:absolute;right:2px;top:"+(q.height-14)+"px;color:dimgrey;text-decoration:none;font-size:11px;font-family: Calibri, Lucida Grande, Lucida Sans Unicode, Arial, sans-serif"),
|
|
q._creditLink.setAttribute("tabIndex",-1),q._creditLink.setAttribute("target","_blank"));if(0===q.renderCount||s||u)q._creditLink.setAttribute("href",q.creditHref),q._creditLink.innerHTML=q.creditText;q._creditLink&&q.creditHref&&q.creditText?(q._creditLink.parentElement||q._canvasJSContainer.appendChild(q._creditLink),q._creditLink.style.top=q.height-14+"px"):q._creditLink.parentElement&&q._canvasJSContainer.removeChild(q._creditLink)}}}function ta(q,s){var u=document.createElement("canvas");u.setAttribute("class",
|
|
"canvasjs-chart-canvas");Fa(u,q,s);w||"undefined"===typeof G_vmlCanvasManager||G_vmlCanvasManager.initElement(u);return u}function na(q,s,u){for(var w in u)s.style[w]=u[w]}function ua(q,s,u){s.getAttribute("state")||(s.style.backgroundColor=q.toolbar.backgroundColor,s.style.color=q.toolbar.fontColor,s.style.border="none",na(q,s,{WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"}));s.getAttribute("state")!==u&&(s.setAttribute("state",u),s.setAttribute("type","button"),
|
|
na(q,s,{padding:"5px 12px",cursor:"pointer","float":"left",width:"40px",height:"25px",outline:"0px",verticalAlign:"baseline",lineHeight:"0"}),s.setAttribute("title",q._cultureInfo[u+"Text"]),s.innerHTML="<img style='height:95%;' src='"+bb[u].image+"' alt='"+q._cultureInfo[u+"Text"]+"' />")}function Ka(){for(var q=null,s=0;s<arguments.length;s++)q=arguments[s],q.style&&(q.style.display="inline")}function va(){for(var q=null,s=0;s<arguments.length;s++)(q=arguments[s])&&q.style&&(q.style.display="none")}
|
|
function T(q,s,u,w,y){this._defaultsKey=q;this._themeOptionsKey=s;this._index=w;this.parent=y;this._eventListeners=[];q={};this.theme&&x(s)&&x(w)?q=x(xa[this.theme])?xa.light1:xa[this.theme]:this.parent&&(this.parent.themeOptions&&this.parent.themeOptions[s])&&(null===w?q=this.parent.themeOptions[s]:0<this.parent.themeOptions[s].length&&(w=Math.min(this.parent.themeOptions[s].length-1,w),q=this.parent.themeOptions[s][w]));this.themeOptions=q;this.options=u?u:{_isPlaceholder:!0};this.setOptions(this.options,
|
|
q)}function Ba(q,s,u,w,x){"undefined"===typeof x&&(x=0);this._padding=x;this._x1=q;this._y1=s;this._x2=u;this._y2=w;this._rightOccupied=this._leftOccupied=this._bottomOccupied=this._topOccupied=this._padding}function ka(q,s){ka.base.constructor.call(this,"TextBlock",null,s,null,null);this.ctx=q;this._isDirty=!0;this._wrappedText=null;this._initialize()}function Pa(q,s){Pa.base.constructor.call(this,"Toolbar","toolbar",s,null,q);this.chart=q;this.canvas=q.canvas;this.ctx=this.chart.ctx;this.optionsName=
|
|
"toolbar"}function Ga(q,s){Ga.base.constructor.call(this,"Title","title",s,null,q);this.chart=q;this.canvas=q.canvas;this.ctx=this.chart.ctx;this.optionsName="title";if(x(this.options.margin)&&q.options.subtitles)for(var u=q.options.subtitles,w=0;w<u.length;w++)if((x(u[w].horizontalAlign)&&"center"===this.horizontalAlign||u[w].horizontalAlign===this.horizontalAlign)&&(x(u[w].verticalAlign)&&"top"===this.verticalAlign||u[w].verticalAlign===this.verticalAlign)&&!u[w].dockInsidePlotArea===!this.dockInsidePlotArea){this.margin=
|
|
0;break}"undefined"===typeof this.options.fontSize&&(this.fontSize=this.chart.getAutoFontSize(this.fontSize));this.height=this.width=null;this.bounds={x1:null,y1:null,x2:null,y2:null}}function La(q,s,u){La.base.constructor.call(this,"Subtitle","subtitles",s,u,q);this.chart=q;this.canvas=q.canvas;this.ctx=this.chart.ctx;this.optionsName="subtitles";this.isOptionsInArray=!0;"undefined"===typeof this.options.fontSize&&(this.fontSize=this.chart.getAutoFontSize(this.fontSize));this.height=this.width=null;
|
|
this.bounds={x1:null,y1:null,x2:null,y2:null}}function Ha(q){var s;q&&Ia[q]&&(s=Ia[q]);Ha.base.constructor.call(this,"CultureInfo",null,s,null,null)}var V={},w=!!document.createElement("canvas").getContext,qa={Chart:{width:500,height:400,zoomEnabled:!1,zoomType:"x",backgroundColor:"white",theme:"theme1",animationEnabled:!1,animationDuration:1200,dataPointWidth:null,dataPointMinWidth:null,dataPointMaxWidth:null,colorSet:"colorSet1",culture:"en",creditHref:"",creditText:"CanvasJS",interactivityEnabled:!0,
|
|
exportEnabled:!1,exportFileName:"Chart",rangeChanging:null,rangeChanged:null,publicProperties:{title:"readWrite",subtitles:"readWrite",toolbar:"readWrite",toolTip:"readWrite",legend:"readWrite",axisX:"readWrite",axisY:"readWrite",axisX2:"readWrite",axisY2:"readWrite",data:"readWrite",options:"readWrite",bounds:"readOnly",container:"readOnly"}},Title:{padding:0,text:null,verticalAlign:"top",horizontalAlign:"center",fontSize:20,fontFamily:"Calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",
|
|
borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:w?"transparent":null,margin:5,wrap:!0,maxWidth:null,dockInsidePlotArea:!1,publicProperties:{options:"readWrite",bounds:"readOnly",chart:"readOnly"}},Subtitle:{padding:0,text:null,verticalAlign:"top",horizontalAlign:"center",fontSize:14,fontFamily:"Calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:null,margin:2,wrap:!0,maxWidth:null,dockInsidePlotArea:!1,
|
|
publicProperties:{options:"readWrite",bounds:"readOnly",chart:"readOnly"}},Toolbar:{backgroundColor:"white",backgroundColorOnHover:"#2196f3",borderColor:"#2196f3",borderThickness:1,fontColor:"black",fontColorOnHover:"white",publicProperties:{options:"readWrite",chart:"readOnly"}},Legend:{name:null,verticalAlign:"center",horizontalAlign:"right",fontSize:14,fontFamily:"calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",cursor:null,itemmouseover:null,itemmouseout:null,itemmousemove:null,
|
|
itemclick:null,dockInsidePlotArea:!1,reversed:!1,backgroundColor:w?"transparent":null,borderColor:w?"transparent":null,borderThickness:0,cornerRadius:0,maxWidth:null,maxHeight:null,markerMargin:null,itemMaxWidth:null,itemWidth:null,itemWrap:!0,itemTextFormatter:null,publicProperties:{options:"readWrite",bounds:"readOnly",chart:"readOnly"}},ToolTip:{enabled:!0,shared:!1,animationEnabled:!0,content:null,contentFormatter:null,reversed:!1,backgroundColor:w?"rgba(255,255,255,.9)":"rgb(255,255,255)",borderColor:null,
|
|
borderThickness:2,cornerRadius:5,fontSize:14,fontColor:"black",fontFamily:"Calibri, Arial, Georgia, serif;",fontWeight:"normal",fontStyle:"italic",publicProperties:{options:"readWrite",chart:"readOnly"}},Axis:{minimum:null,maximum:null,viewportMinimum:null,viewportMaximum:null,interval:null,intervalType:null,reversed:!1,logarithmic:!1,logarithmBase:10,title:null,titleFontColor:"black",titleFontSize:20,titleFontFamily:"arial",titleFontWeight:"normal",titleFontStyle:"normal",titleWrap:!0,titleMaxWidth:null,
|
|
titleBackgroundColor:w?"transparent":null,titleBorderColor:w?"transparent":null,titleBorderThickness:0,titleCornerRadius:0,labelAngle:0,labelFontFamily:"arial",labelFontColor:"black",labelFontSize:12,labelFontWeight:"normal",labelFontStyle:"normal",labelAutoFit:!0,labelWrap:!0,labelMaxWidth:null,labelFormatter:null,labelBackgroundColor:w?"transparent":null,labelBorderColor:w?"transparent":null,labelBorderThickness:0,labelCornerRadius:0,labelPlacement:"outside",prefix:"",suffix:"",includeZero:!0,tickLength:5,
|
|
tickColor:"black",tickThickness:1,lineColor:"black",lineThickness:1,lineDashType:"solid",gridColor:"A0A0A0",gridThickness:0,gridDashType:"solid",interlacedColor:w?"transparent":null,valueFormatString:null,margin:2,publicProperties:{options:"readWrite",stripLines:"readWrite",scaleBreaks:"readWrite",crosshair:"readWrite",bounds:"readOnly",chart:"readOnly"}},StripLine:{value:null,startValue:null,endValue:null,color:"orange",opacity:null,thickness:2,lineDashType:"solid",label:"",labelPlacement:"inside",
|
|
labelAlign:"far",labelWrap:!0,labelMaxWidth:null,labelBackgroundColor:null,labelBorderColor:w?"transparent":null,labelBorderThickness:0,labelCornerRadius:0,labelFontFamily:"arial",labelFontColor:"orange",labelFontSize:12,labelFontWeight:"normal",labelFontStyle:"normal",labelFormatter:null,showOnTop:!1,publicProperties:{options:"readWrite",axis:"readOnly",bounds:"readOnly",chart:"readOnly"}},ScaleBreaks:{autoCalculate:!1,collapsibleThreshold:"25%",maxNumberOfAutoBreaks:2,spacing:8,type:"straight",
|
|
color:"#FFFFFF",fillOpacity:0.9,lineThickness:2,lineColor:"#E16E6E",lineDashType:"solid",publicProperties:{options:"readWrite",customBreaks:"readWrite",axis:"readOnly",autoBreaks:"readOnly",bounds:"readOnly",chart:"readOnly"}},Break:{startValue:null,endValue:null,spacing:8,type:"straight",color:"#FFFFFF",fillOpacity:0.9,lineThickness:2,lineColor:"#E16E6E",lineDashType:"solid",publicProperties:{options:"readWrite",scaleBreaks:"readOnly",bounds:"readOnly",chart:"readOnly"}},Crosshair:{enabled:!1,snapToDataPoint:!1,
|
|
color:"grey",opacity:null,thickness:2,lineDashType:"solid",label:"",labelWrap:!0,labelMaxWidth:null,labelBackgroundColor:w?"grey":null,labelBorderColor:w?"grey":null,labelBorderThickness:0,labelCornerRadius:0,labelFontFamily:w?"Calibri, Optima, Candara, Verdana, Geneva, sans-serif":"calibri",labelFontSize:12,labelFontColor:"#fff",labelFontWeight:"normal",labelFontStyle:"normal",labelFormatter:null,valueFormatString:null,publicProperties:{options:"readWrite",axis:"readOnly",bounds:"readOnly",chart:"readOnly"}},
|
|
DataSeries:{name:null,dataPoints:null,label:"",bevelEnabled:!1,highlightEnabled:!0,cursor:"default",indexLabel:"",indexLabelPlacement:"auto",indexLabelOrientation:"horizontal",indexLabelFontColor:"black",indexLabelFontSize:12,indexLabelFontStyle:"normal",indexLabelFontFamily:"Arial",indexLabelFontWeight:"normal",indexLabelBackgroundColor:null,indexLabelLineColor:"gray",indexLabelLineThickness:1,indexLabelLineDashType:"solid",indexLabelMaxWidth:null,indexLabelWrap:!0,indexLabelFormatter:null,lineThickness:2,
|
|
lineDashType:"solid",connectNullData:!1,nullDataLineDashType:"dash",color:null,lineColor:null,risingColor:"white",fallingColor:"red",fillOpacity:null,startAngle:0,radius:null,innerRadius:null,neckHeight:null,neckWidth:null,reversed:!1,valueRepresents:null,linkedDataSeriesIndex:null,whiskerThickness:2,whiskerDashType:"solid",whiskerColor:null,whiskerLength:null,stemThickness:2,stemColor:null,stemDashType:"solid",upperBoxColor:"white",lowerBoxColor:"white",type:"column",xValueType:"number",axisXType:"primary",
|
|
axisYType:"primary",axisXIndex:0,axisYIndex:0,xValueFormatString:null,yValueFormatString:null,zValueFormatString:null,percentFormatString:null,showInLegend:null,legendMarkerType:null,legendMarkerColor:null,legendText:null,legendMarkerBorderColor:w?"transparent":null,legendMarkerBorderThickness:0,markerType:"circle",markerColor:null,markerSize:null,markerBorderColor:w?"transparent":null,markerBorderThickness:0,mouseover:null,mouseout:null,mousemove:null,click:null,toolTipContent:null,visible:!0,publicProperties:{options:"readWrite",
|
|
axisX:"readWrite",axisY:"readWrite",chart:"readOnly"}},TextBlock:{x:0,y:0,width:null,height:null,maxWidth:null,maxHeight:null,padding:0,angle:0,text:"",horizontalAlign:"center",fontSize:12,fontFamily:"calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:null,textBaseline:"top"},CultureInfo:{decimalSeparator:".",digitGroupSeparator:",",zoomText:"Zoom",panText:"Pan",resetText:"Reset",menuText:"More Options",saveJPGText:"Save as JPEG",
|
|
savePNGText:"Save as PNG",printText:"Print",days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ")}},Ia={en:{}},y=w?"Trebuchet MS, Helvetica, sans-serif":"Arial",wa=w?"Impact, Charcoal, sans-serif":"Arial",ya={colorSet1:"#4F81BC #C0504E #9BBB58 #23BFAA #8064A1 #4AACC5 #F79647 #7F6084 #77A033 #33558B #E59566".split(" "),
|
|
colorSet2:"#6D78AD #51CDA0 #DF7970 #4C9CA0 #AE7D99 #C9D45C #5592AD #DF874D #52BCA8 #8E7AA3 #E3CB64 #C77B85 #C39762 #8DD17E #B57952 #FCC26C".split(" "),colorSet3:"#8CA1BC #36845C #017E82 #8CB9D0 #708C98 #94838D #F08891 #0366A7 #008276 #EE7757 #E5BA3A #F2990B #03557B #782970".split(" ")},P,da,S,X,ga;da="#333333";S="#000000";P="#666666";ga=X="#000000";var ca=20,z=14,Qa={colorSet:"colorSet1",backgroundColor:"#FFFFFF",title:{fontFamily:wa,fontSize:32,fontColor:da,fontWeight:"normal",verticalAlign:"top",
|
|
margin:5},subtitles:[{fontFamily:wa,fontSize:z,fontColor:da,fontWeight:"normal",verticalAlign:"top",margin:5}],data:[{indexLabelFontFamily:y,indexLabelFontSize:z,indexLabelFontColor:da,indexLabelFontWeight:"normal",indexLabelLineThickness:1}],axisX:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:da,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:S,labelFontWeight:"normal",lineThickness:1,lineColor:P,tickThickness:1,tickColor:P,gridThickness:0,gridColor:P,stripLines:[{labelFontFamily:y,
|
|
labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:ga,color:X,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,lineDashType:"solid"}}],axisX2:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:da,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,
|
|
labelFontColor:S,labelFontWeight:"normal",lineThickness:1,lineColor:P,tickThickness:1,tickColor:P,gridThickness:0,gridColor:P,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:ga,color:X,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,
|
|
lineDashType:"solid"}}],axisY:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:da,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:S,labelFontWeight:"normal",lineThickness:1,lineColor:P,tickThickness:1,tickColor:P,gridThickness:1,gridColor:P,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",
|
|
labelBackgroundColor:ga,color:X,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,lineDashType:"solid"}}],axisY2:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:da,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:S,labelFontWeight:"normal",lineThickness:1,lineColor:P,tickThickness:1,tickColor:P,gridThickness:1,gridColor:P,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",
|
|
labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:ga,color:X,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,lineDashType:"solid"}}],legend:{fontFamily:y,fontSize:14,fontColor:da,fontWeight:"bold",verticalAlign:"bottom",horizontalAlign:"center"},toolTip:{fontFamily:y,fontSize:14,fontStyle:"normal",cornerRadius:0,borderThickness:1}};
|
|
S=da="#F5F5F5";P="#FFFFFF";X="#40BAF1";ga="#F5F5F5";var ca=20,z=14,Ya={colorSet:"colorSet2",title:{fontFamily:y,fontSize:33,fontColor:"#3A3A3A",fontWeight:"bold",verticalAlign:"top",margin:5},subtitles:[{fontFamily:y,fontSize:z,fontColor:"#3A3A3A",fontWeight:"normal",verticalAlign:"top",margin:5}],data:[{indexLabelFontFamily:y,indexLabelFontSize:z,indexLabelFontColor:"#666666",indexLabelFontWeight:"normal",indexLabelLineThickness:1}],axisX:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:"#666666",
|
|
titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:"#666666",labelFontWeight:"normal",lineThickness:1,lineColor:"#BBBBBB",tickThickness:1,tickColor:"#BBBBBB",gridThickness:1,gridColor:"#BBBBBB",stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FFA500",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FFA500",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:"black",color:"black",
|
|
thickness:1,lineDashType:"dot"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,lineDashType:"solid"}}],axisX2:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:"#666666",titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:"#666666",labelFontWeight:"normal",lineThickness:1,lineColor:"#BBBBBB",tickColor:"#BBBBBB",tickThickness:1,gridThickness:1,gridColor:"#BBBBBB",stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FFA500",labelFontWeight:"normal",
|
|
labelBackgroundColor:null,color:"#FFA500",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:"black",color:"black",thickness:1,lineDashType:"dot"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,lineDashType:"solid"}}],axisY:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:"#666666",titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:"#666666",labelFontWeight:"normal",
|
|
lineThickness:0,lineColor:"#BBBBBB",tickColor:"#BBBBBB",tickThickness:1,gridThickness:1,gridColor:"#BBBBBB",stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FFA500",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FFA500",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:"black",color:"black",thickness:1,lineDashType:"dot"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,
|
|
lineDashType:"solid"}}],axisY2:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:"#666666",titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:"#666666",labelFontWeight:"normal",lineThickness:0,lineColor:"#BBBBBB",tickColor:"#BBBBBB",tickThickness:1,gridThickness:1,gridColor:"#BBBBBB",stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FFA500",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FFA500",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,
|
|
labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:"black",color:"black",thickness:1,lineDashType:"dot"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,lineDashType:"solid"}}],legend:{fontFamily:y,fontSize:14,fontColor:"#3A3A3A",fontWeight:"bold",verticalAlign:"bottom",horizontalAlign:"center"},toolTip:{fontFamily:y,fontSize:14,fontStyle:"normal",cornerRadius:0,borderThickness:1}};S=da="#F5F5F5";P="#FFFFFF";X="#40BAF1";ga="#F5F5F5";ca=20;z=14;wa={colorSet:"colorSet12",
|
|
backgroundColor:"#2A2A2A",title:{fontFamily:wa,fontSize:32,fontColor:da,fontWeight:"normal",verticalAlign:"top",margin:5},subtitles:[{fontFamily:wa,fontSize:z,fontColor:da,fontWeight:"normal",verticalAlign:"top",margin:5}],toolbar:{backgroundColor:"#666666",backgroundColorOnHover:"#FF7372",borderColor:"#FF7372",borderThickness:1,fontColor:"#F5F5F5",fontColorOnHover:"#F5F5F5"},data:[{indexLabelFontFamily:y,indexLabelFontSize:z,indexLabelFontColor:S,indexLabelFontWeight:"normal",indexLabelLineThickness:1}],
|
|
axisX:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:S,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:S,labelFontWeight:"normal",lineThickness:1,lineColor:P,tickThickness:1,tickColor:P,gridThickness:0,gridColor:P,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:ga,
|
|
color:X,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],axisX2:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:S,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:S,labelFontWeight:"normal",lineThickness:1,lineColor:P,tickThickness:1,tickColor:P,gridThickness:0,gridColor:P,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,
|
|
color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:ga,color:X,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],axisY:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:S,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:S,labelFontWeight:"normal",lineThickness:1,lineColor:P,tickThickness:1,
|
|
tickColor:P,gridThickness:1,gridColor:P,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:ga,color:X,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],axisY2:[{titleFontFamily:y,titleFontSize:ca,
|
|
titleFontColor:S,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:S,labelFontWeight:"normal",lineThickness:1,lineColor:P,tickThickness:1,tickColor:P,gridThickness:1,gridColor:P,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:ga,color:X,thickness:1,lineDashType:"dash"},
|
|
scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],legend:{fontFamily:y,fontSize:14,fontColor:da,fontWeight:"bold",verticalAlign:"bottom",horizontalAlign:"center"},toolTip:{fontFamily:y,fontSize:14,fontStyle:"normal",cornerRadius:0,borderThickness:1,fontColor:S,backgroundColor:"rgba(0, 0, 0, .7)"}};P="#FFFFFF";S=da="#FAFAFA";X="#40BAF1";ga="#F5F5F5";var ca=20,z=14,xa={light1:Qa,light2:Ya,dark1:wa,dark2:{colorSet:"colorSet2",backgroundColor:"#32373A",
|
|
title:{fontFamily:y,fontSize:32,fontColor:da,fontWeight:"normal",verticalAlign:"top",margin:5},subtitles:[{fontFamily:y,fontSize:z,fontColor:da,fontWeight:"normal",verticalAlign:"top",margin:5}],toolbar:{backgroundColor:"#666666",backgroundColorOnHover:"#FF7372",borderColor:"#FF7372",borderThickness:1,fontColor:"#F5F5F5",fontColorOnHover:"#F5F5F5"},data:[{indexLabelFontFamily:y,indexLabelFontSize:z,indexLabelFontColor:S,indexLabelFontWeight:"normal",indexLabelLineThickness:1}],axisX:[{titleFontFamily:y,
|
|
titleFontSize:ca,titleFontColor:S,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:S,labelFontWeight:"normal",lineThickness:1,lineColor:P,tickThickness:1,tickColor:P,gridThickness:0,gridColor:P,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:ga,color:X,thickness:1,
|
|
lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],axisX2:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:S,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:S,labelFontWeight:"normal",lineThickness:1,lineColor:P,tickThickness:1,tickColor:P,gridThickness:0,gridColor:P,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,
|
|
color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:ga,color:X,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],axisY:[{titleFontFamily:y,titleFontSize:ca,titleFontColor:S,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:S,labelFontWeight:"normal",lineThickness:0,lineColor:P,tickThickness:1,
|
|
tickColor:P,gridThickness:1,gridColor:P,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:ga,color:X,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],axisY2:[{titleFontFamily:y,titleFontSize:ca,
|
|
titleFontColor:S,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:S,labelFontWeight:"normal",lineThickness:0,lineColor:P,tickThickness:1,tickColor:P,gridThickness:1,gridColor:P,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:ga,color:X,thickness:1,lineDashType:"dash"},
|
|
scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],legend:{fontFamily:y,fontSize:14,fontColor:da,fontWeight:"bold",verticalAlign:"bottom",horizontalAlign:"center"},toolTip:{fontFamily:y,fontSize:14,fontStyle:"normal",cornerRadius:0,borderThickness:1,fontColor:S,backgroundColor:"rgba(0, 0, 0, .7)"}},theme1:Qa,theme2:Ya,theme3:Qa},M={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(" ")};(function(){V.fSDec=function(q){for(var s="",u=0;u<q.length;u++)s+=String.fromCharCode(Math.ceil(q.length/57/5)^q.charCodeAt(u));return s};V.obj={trVs:"Ush`m!Wdsrhno",fntStr:"qy!B`mhcsh-!Mtbhe`!Fs`oed-!Mtbhe`!R`or!Tohbned-!@sh`m-!r`or,rdshg",txtBl:"udyuC`rdmhod",fnt:"gnou",fSy:"ghmmRuxmd",fTx:"ghmmUdyu",grClr:"fsdx",cntx:"buy",tp:"unq"};delete qa[V.fSDec("Bi`su")][V.fSDec("bsdehuIsdg")];
|
|
V.pro={sCH:qa[V.fSDec("Bi`su")][V.fSDec("bsdehuIsdg")]};V._fTWm=function(q){if("undefined"===typeof V.pro.sCH&&!Xa)try{var s=q[V.fSDec(V.obj.cntx)];s[V.fSDec(V.obj.txtBl)]=V.fSDec(V.obj.tp);s[V.fSDec(V.obj.fnt)]=11+V.fSDec(V.obj.fntStr);s[V.fSDec(V.obj.fSy)]=V.fSDec(V.obj.grClr);s[V.fSDec(V.obj.fTx)](V.fSDec(V.obj.trVs),2,q.height-11-2)}catch(u){}}})();var Ta={},pa=null,za=function(){var q=/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,s="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
|
|
u="Sun Mon Tue Wed Thu Fri Sat".split(" "),w="January February March April May June July August September October November December".split(" "),x="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),y=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,z=/[^-+\dA-Z]/g;return function(R,B,J){var F=J?J.days:s,V=J?J.months:w,P=J?J.shortDays:u,W=J?J.shortMonths:x;J="";var M=!1;R=R&&R.getTime?R:R?new Date(R):new Date;
|
|
if(isNaN(R))throw SyntaxError("invalid date");"UTC:"===B.slice(0,4)&&(B=B.slice(4),M=!0);J=M?"getUTC":"get";var $=R[J+"Date"](),Y=R[J+"Day"](),T=R[J+"Month"](),S=R[J+"FullYear"](),Q=R[J+"Hours"](),ea=R[J+"Minutes"](),a=R[J+"Seconds"](),f=R[J+"Milliseconds"](),b=M?0:R.getTimezoneOffset();return J=B.replace(q,function(c){switch(c){case "D":return $;case "DD":return fa($,2);case "DDD":return P[Y];case "DDDD":return F[Y];case "M":return T+1;case "MM":return fa(T+1,2);case "MMM":return W[T];case "MMMM":return V[T];
|
|
case "Y":return parseInt(String(S).slice(-2));case "YY":return fa(String(S).slice(-2),2);case "YYY":return fa(String(S).slice(-3),3);case "YYYY":return fa(S,4);case "h":return Q%12||12;case "hh":return fa(Q%12||12,2);case "H":return Q;case "HH":return fa(Q,2);case "m":return ea;case "mm":return fa(ea,2);case "s":return a;case "ss":return fa(a,2);case "f":return String(f).slice(0,1);case "ff":return fa(String(f).slice(0,2),2);case "fff":return fa(String(f).slice(0,3),3);case "t":return 12>Q?"a":"p";
|
|
case "tt":return 12>Q?"am":"pm";case "T":return 12>Q?"A":"P";case "TT":return 12>Q?"AM":"PM";case "K":return M?"UTC":(String(R).match(y)||[""]).pop().replace(z,"");case "z":return(0<b?"-":"+")+Math.floor(Math.abs(b)/60);case "zz":return(0<b?"-":"+")+fa(Math.floor(Math.abs(b)/60),2);case "zzz":return(0<b?"-":"+")+fa(Math.floor(Math.abs(b)/60),2)+fa(Math.abs(b)%60,2);default:return c.slice(1,c.length-1)}})}}(),ea=function(q,s,u){if(null===q)return"";if(!isFinite(q))return q;q=Number(q);var w=0>q?!0:
|
|
!1;w&&(q*=-1);var x=u?u.decimalSeparator:".",y=u?u.digitGroupSeparator:",",z="";s=String(s);var z=1,R=u="",B=-1,J=[],F=[],V=0,P=0,W=0,M=!1,T=0,R=s.match(/"[^"]*"|'[^']*'|[eE][+-]*[0]+|[,]+[.]|\u2030|./g);s=null;for(var Y=0;R&&Y<R.length;Y++)if(s=R[Y],"."===s&&0>B)B=Y;else{if("%"===s)z*=100;else if("\u2030"===s){z*=1E3;continue}else if(","===s[0]&&"."===s[s.length-1]){z/=Math.pow(1E3,s.length-1);B=Y+s.length-1;continue}else"E"!==s[0]&&"e"!==s[0]||"0"!==s[s.length-1]||(M=!0);0>B?(J.push(s),"#"===s||
|
|
"0"===s?V++:","===s&&W++):(F.push(s),"#"!==s&&"0"!==s||P++)}M&&(s=Math.floor(q),R=-Math.floor(Math.log(q)/Math.LN10+1),T=0===q?0:0===s?-(V+R):String(s).length-V,z/=Math.pow(10,T));0>B&&(B=Y);z=(q*z).toFixed(P);s=z.split(".");z=(s[0]+"").split("");q=(s[1]+"").split("");z&&"0"===z[0]&&z.shift();for(M=R=Y=P=B=0;0<J.length;)if(s=J.pop(),"#"===s||"0"===s)if(B++,B===V){var S=z,z=[];if("0"===s)for(s=V-P-(S?S.length:0);0<s;)S.unshift("0"),s--;for(;0<S.length;)u=S.pop()+u,M++,0===M%R&&(Y===W&&0<S.length)&&
|
|
(u=y+u)}else 0<z.length?(u=z.pop()+u,P++,M++):"0"===s&&(u="0"+u,P++,M++),0===M%R&&(Y===W&&0<z.length)&&(u=y+u);else"E"!==s[0]&&"e"!==s[0]||"0"!==s[s.length-1]||!/[eE][+-]*[0]+/.test(s)?","===s?(Y++,R=M,M=0,0<z.length&&(u=y+u)):u=1<s.length&&('"'===s[0]&&'"'===s[s.length-1]||"'"===s[0]&&"'"===s[s.length-1])?s.slice(1,s.length-1)+u:s+u:(s=0>T?s.replace("+","").replace("-",""):s.replace("-",""),u+=s.replace(/[0]+/,function(q){return fa(T,q.length)}));y="";for(J=!1;0<F.length;)s=F.shift(),"#"===s||"0"===
|
|
s?0<q.length&&0!==Number(q.join(""))?(y+=q.shift(),J=!0):"0"===s&&(y+="0",J=!0):1<s.length&&('"'===s[0]&&'"'===s[s.length-1]||"'"===s[0]&&"'"===s[s.length-1])?y+=s.slice(1,s.length-1):"E"!==s[0]&&"e"!==s[0]||"0"!==s[s.length-1]||!/[eE][+-]*[0]+/.test(s)?y+=s:(s=0>T?s.replace("+","").replace("-",""):s.replace("-",""),y+=s.replace(/[0]+/,function(q){return fa(T,q.length)}));u+=(J?x:"")+y;return w?"-"+u:u},Ma=function(q){var s=0,u=0;q=q||window.event;q.offsetX||0===q.offsetX?(s=q.offsetX,u=q.offsetY):
|
|
q.layerX||0==q.layerX?(s=q.layerX,u=q.layerY):(s=q.pageX-q.target.offsetLeft,u=q.pageY-q.target.offsetTop);return{x:s,y:u}},Va=!0,Oa=window.devicePixelRatio||1,Ja=1,ia=Va?Oa/Ja:1,Xa=window&&window.location&&window.location.href&&window.location.href.indexOf&&(-1!==window.location.href.indexOf("canvasjs.com")||-1!==window.location.href.indexOf("fenopix.com")||-1!==window.location.href.indexOf("fiddle")),bb={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=="},
|
|
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"},
|
|
zoom:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALWSURBVEhLvZZLaBNRFIabyftBIgEfqCCBoCC6MYqiXYiIj4U76U4X7sUHbhQhUBfixhZEUBDB16YuFERaUaQLK7ooCOJj4UKtYEFU0EptShO/A9Ph3js3k8lo/eHnP7n3nP/M3LlzMz1hkUwmNziOcyKRSFyFt+LxeD/c2Wq1Ym7Kv0M2m11Os1OxWGycn1OwZXCGuXfwIhezkd9/jRgNT2L4ldhs1pbkX5OLJe4euVxuGQaPCa3mnUjtJx7BDuKusJTCV6jVVGHTMuYRjxma7yIOhTgFY6jNaAKew2xPKpVay9ganmkvj+M448/MfJdT5K5Gg4HJacRngPFgqVRaRNwW1B4i7yehWfsEDdz1K+A01AoxPIqGAiuwGfkOTY8+1A6u7AyiFTB2Hu0KPIrdiOnzHLWDybeImvy+Wq2mZa5bUHsD0Zpz+KxHdWQymV6kAb1ElqeORgJLvgnRdj1+R1AfzkIvSUjxVjQSarVakrueIPT8+H1F5jSUy+WXiJrUYBVWyVxU4PEU8TzhfaijUqnMIWrjaY492eWRwdKOIqrnIxnXwLLeRLwk2GQzrEMjg0avEbXxkIxr4OoOImpj2QwyFgms1koa/SZUG8s+0iGnEhNfCNXEhzIXBVz0McTzEvJ+70P9oNFtxEzei3aFYrFYxmuSUPWSv9Yi9IMm2xE1We56Mp1OV4nDwqFmBDV9gk9AEh4gZtFHNt8W4kAUCoXF5MorY9Z/kDni9nDv7hc0i2fhgLvTtX8a99PoMPPagTFPxofRzmDJ9yM+AyEmTfgGysYbQcfhDzPPJDmX0c7gDg4gs9BqFIWhm/Nct5H8gtBq1I7UfIbtvmIuoaGQcp+fdpbbSM43eEH5wrwLbXmhm/fU63VHXjcuok7hEByFY/AeHGC8L5/PL3HT5xGH1uYwfPOICGo+CBcU0vwO1BqzUqILDl/z/9VYIMfpddiAc47jDP8BsUpb13wOLRwAAAAASUVORK5CYII="},
|
|
menu:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAeCAYAAABE4bxTAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADoSURBVFhH7dc9CsJAFATgRxIIBCwCqZKATX5sbawsY2MvWOtF9AB6AU8gguAJbD2AnZ2VXQT/Ko2TYGCL2OYtYQc+BuYA+1hCtnCVwMm27SGaXpDJIAiCvCkVR05hGOZNN3HkFMdx3nQRR06+76/R1IcFLJlNQEWlmWlBTwJtKLKHynehZqnjOGM0PYWRVXk61C37p7xlZ3Hk5HneCk1dmMH811xGoKLSzDiQwIBZB4ocoPJdqNkDt2yKlueWRVGUtzy3rPwo3sWRU3nLjuLI6OO67oZM00wMw3hrmpZx0XU9syxrR0T0BeMpb9dneSR2AAAAAElFTkSuQmCC"}};
|
|
T.prototype.setOptions=function(q,s){if(qa[this._defaultsKey]){var u=qa[this._defaultsKey],w;for(w in u)"publicProperties"!==w&&u.hasOwnProperty(w)&&(this[w]=q&&w in q?q[w]:s&&w in s?s[w]:u[w])}};T.prototype.get=function(q){var s=qa[this._defaultsKey];if("options"===q)return this.options&&this.options._isPlaceholder?null:this.options;if(s.hasOwnProperty(q)||s.publicProperties&&s.publicProperties.hasOwnProperty(q))return this[q];window.console&&window.console.log('Property "'+q+"\" doesn't exist. Please check for typo.")};
|
|
T.prototype.set=function(q,s,u){u="undefined"===typeof u?!0:u;var w=qa[this._defaultsKey];if("options"===q)this.createUserOptions(s);else if(w.hasOwnProperty(q)||w.publicProperties&&w.publicProperties.hasOwnProperty(q)&&"readWrite"===w.publicProperties[q])this.options._isPlaceholder&&this.createUserOptions(),this.options[q]=s;else{window.console&&(w.publicProperties&&w.publicProperties.hasOwnProperty(q)&&"readOnly"===w.publicProperties[q]?window.console.log('Property "'+q+'" is read-only.'):window.console.log('Property "'+
|
|
q+"\" doesn't exist. Please check for typo."));return}u&&(this.chart||this).render()};T.prototype.addTo=function(q,s,u,w){w="undefined"===typeof w?!0:w;var x=qa[this._defaultsKey];x.hasOwnProperty(q)||x.publicProperties&&x.publicProperties.hasOwnProperty(q)&&"readWrite"===x.publicProperties[q]?(this.options._isPlaceholder&&this.createUserOptions(),"undefined"===typeof this.options[q]&&(this.options[q]=[]),q=this.options[q],u="undefined"===typeof u||null===u?q.length:u,q.splice(u,0,s),w&&(this.chart||
|
|
this).render()):window.console&&(x.publicProperties&&x.publicProperties.hasOwnProperty(q)&&"readOnly"===x.publicProperties[q]?window.console.log('Property "'+q+'" is read-only.'):window.console.log('Property "'+q+"\" doesn't exist. Please check for typo."))};T.prototype.createUserOptions=function(q){if("undefined"!==typeof q||this.options._isPlaceholder)if(this.parent.options._isPlaceholder&&this.parent.createUserOptions(),this.isOptionsInArray){this.parent.options[this.optionsName]||(this.parent.options[this.optionsName]=
|
|
[]);var s=this.parent.options[this.optionsName],w=s.length;this.options._isPlaceholder||(Ea(s),w=s.indexOf(this.options));this.options="undefined"===typeof q?{}:q;s[w]=this.options}else this.options="undefined"===typeof q?{}:q,q=this.parent.options,this.optionsName?s=this.optionsName:(s=this._defaultsKey)&&0!==s.length?(w=s.charAt(0).toLowerCase(),1<s.length&&(w=w.concat(s.slice(1))),s=w):s=void 0,q[s]=this.options};T.prototype.remove=function(q){q="undefined"===typeof q?!0:q;if(this.isOptionsInArray){var s=
|
|
this.parent.options[this.optionsName];Ea(s);var w=s.indexOf(this.options);0<=w&&s.splice(w,1)}else delete this.parent.options[this.optionsName];q&&(this.chart||this).render()};T.prototype.updateOption=function(q){var s=qa[this._defaultsKey],w={},y=this[q],z=this._themeOptionsKey,F=this._index;this.theme&&x(z)&&x(F)?w=x(xa[this.theme])?xa.light1:xa[this.theme]:this.parent&&(this.parent.themeOptions&&this.parent.themeOptions[z])&&(null===F?w=this.parent.themeOptions[z]:0<this.parent.themeOptions[z].length&&
|
|
(w=Math.min(this.parent.themeOptions[z].length-1,F),w=this.parent.themeOptions[z][w]));this.themeOptions=w;q in s&&(y=q in this.options?this.options[q]:w&&q in w?w[q]:s[q]);if(y===this[q])return!1;this[q]=y;return!0};T.prototype.trackChanges=function(q){if(!this.sessionVariables)throw"Session Variable Store not set";this.sessionVariables[q]=this.options[q]};T.prototype.isBeingTracked=function(q){this.options._oldOptions||(this.options._oldOptions={});return this.options._oldOptions[q]?!0:!1};T.prototype.hasOptionChanged=
|
|
function(q){if(!this.sessionVariables)throw"Session Variable Store not set";return this.sessionVariables[q]!==this.options[q]};T.prototype.addEventListener=function(q,w,u){q&&w&&(this._eventListeners[q]=this._eventListeners[q]||[],this._eventListeners[q].push({context:u||this,eventHandler:w}))};T.prototype.removeEventListener=function(q,w){if(q&&w&&this._eventListeners[q])for(var u=this._eventListeners[q],x=0;x<u.length;x++)if(u[x].eventHandler===w){u[x].splice(x,1);break}};T.prototype.removeAllEventListeners=
|
|
function(){this._eventListeners=[]};T.prototype.dispatchEvent=function(q,w,u){if(q&&this._eventListeners[q]){w=w||{};for(var x=this._eventListeners[q],y=0;y<x.length;y++)x[y].eventHandler.call(x[y].context,w)}"function"===typeof this[q]&&this[q].call(u||this.chart,w)};Ba.prototype.registerSpace=function(q,w){"top"===q?this._topOccupied+=w.height:"bottom"===q?this._bottomOccupied+=w.height:"left"===q?this._leftOccupied+=w.width:"right"===q&&(this._rightOccupied+=w.width)};Ba.prototype.unRegisterSpace=
|
|
function(q,w){"top"===q?this._topOccupied-=w.height:"bottom"===q?this._bottomOccupied-=w.height:"left"===q?this._leftOccupied-=w.width:"right"===q&&(this._rightOccupied-=w.width)};Ba.prototype.getFreeSpace=function(){return{x1:this._x1+this._leftOccupied,y1:this._y1+this._topOccupied,x2:this._x2-this._rightOccupied,y2:this._y2-this._bottomOccupied,width:this._x2-this._x1-this._rightOccupied-this._leftOccupied,height:this._y2-this._y1-this._bottomOccupied-this._topOccupied}};Ba.prototype.reset=function(){this._rightOccupied=
|
|
this._leftOccupied=this._bottomOccupied=this._topOccupied=this._padding};la(ka,T);ka.prototype._initialize=function(){x(this.padding)||"object"!==typeof this.padding?this.topPadding=this.rightPadding=this.bottomPadding=this.leftPadding=Number(this.padding)|0:(this.topPadding=x(this.padding.top)?0:Number(this.padding.top)|0,this.rightPadding=x(this.padding.right)?0:Number(this.padding.right)|0,this.bottomPadding=x(this.padding.bottom)?0:Number(this.padding.bottom)|0,this.leftPadding=x(this.padding.left)?
|
|
0:Number(this.padding.left)|0)};ka.prototype.render=function(q){if(0!==this.fontSize){q&&this.ctx.save();var w=this.ctx.font;this.ctx.textBaseline=this.textBaseline;var u=0;this._isDirty&&this.measureText(this.ctx);this.ctx.translate(this.x,this.y+u);"middle"===this.textBaseline&&(u=-this._lineHeight/2);this.ctx.font=this._getFontString();this.ctx.rotate(Math.PI/180*this.angle);var x=0,y=this.topPadding,z=null;this.ctx.roundRect||Aa(this.ctx);(0<this.borderThickness&&this.borderColor||this.backgroundColor)&&
|
|
this.ctx.roundRect(0,u,this.width,this.height,this.cornerRadius,this.borderThickness,this.backgroundColor,this.borderColor);this.ctx.fillStyle=this.fontColor;for(u=0;u<this._wrappedText.lines.length;u++)z=this._wrappedText.lines[u],"right"===this.horizontalAlign?x=(this.width-(this.leftPadding+this.rightPadding))/2-z.width/2+this.leftPadding:"left"===this.horizontalAlign?x=this.leftPadding:"center"===this.horizontalAlign&&(x=(this.width-(this.leftPadding+this.rightPadding))/2-z.width/2+this.leftPadding),
|
|
this.ctx.fillText(z.text,x,y),y+=z.height;this.ctx.font=w;q&&this.ctx.restore()}};ka.prototype.setText=function(q){this.text=q;this._isDirty=!0;this._wrappedText=null};ka.prototype.measureText=function(){this._lineHeight=Sa(this.fontFamily,this.fontSize,this.fontWeight);if(null===this.maxWidth)throw"Please set maxWidth and height for TextBlock";this._wrapText(this.ctx);this._isDirty=!1;return{width:this.width,height:this.height}};ka.prototype._getLineWithWidth=function(q,w,u){q=String(q);if(!q)return{text:"",
|
|
width:0};var x=u=0,y=q.length-1,z=Infinity;for(this.ctx.font=this._getFontString();x<=y;){var z=Math.floor((x+y)/2),F=q.substr(0,z+1);u=this.ctx.measureText(F).width;if(u<w)x=z+1;else if(u>w)y=z-1;else break}u>w&&1<F.length&&(F=F.substr(0,F.length-1),u=this.ctx.measureText(F).width);w=!0;if(F.length===q.length||" "===q[F.length])w=!1;w&&(q=F.split(" "),1<q.length&&q.pop(),F=q.join(" "),u=this.ctx.measureText(F).width);return{text:F,width:u}};ka.prototype._wrapText=function(){var q=new String(Da(String(this.text))),
|
|
w=[],u=this.ctx.font,x=0,y=0;this.ctx.font=this._getFontString();if(0===this.frontSize)y=x=0;else for(;0<q.length;){var z=this.maxHeight-(this.topPadding+this.bottomPadding),F=this._getLineWithWidth(q,this.maxWidth-(this.leftPadding+this.rightPadding),!1);F.height=this._lineHeight;w.push(F);var M=y,y=Math.max(y,F.width),x=x+F.height,q=Da(q.slice(F.text.length,q.length));z&&x>z&&(F=w.pop(),x-=F.height,y=M)}this._wrappedText={lines:w,width:y,height:x};this.width=y+(this.leftPadding+this.rightPadding);
|
|
this.height=x+(this.topPadding+this.bottomPadding);this.ctx.font=u};ka.prototype._getFontString=function(){var q;q=""+(this.fontStyle?this.fontStyle+" ":"");q+=this.fontWeight?this.fontWeight+" ":"";q+=this.fontSize?this.fontSize+"px ":"";var s=this.fontFamily?this.fontFamily+"":"";!w&&s&&(s=s.split(",")[0],"'"!==s[0]&&'"'!==s[0]&&(s="'"+s+"'"));return q+=s};la(Pa,T);la(Ga,T);Ga.prototype.render=function(){if(this.text){var q=this.dockInsidePlotArea?this.chart.plotArea:this.chart,w=q.layoutManager.getFreeSpace(),
|
|
u=w.x1,y=w.y1,z=0,F=0,M=this.chart._menuButton&&this.chart.exportEnabled&&"top"===this.verticalAlign?22:0,P,B;"top"===this.verticalAlign||"bottom"===this.verticalAlign?(null===this.maxWidth&&(this.maxWidth=w.width-4-M*("center"===this.horizontalAlign?2:1)),F=0.5*w.height-this.margin-2,z=0):"center"===this.verticalAlign&&("left"===this.horizontalAlign||"right"===this.horizontalAlign?(null===this.maxWidth&&(this.maxWidth=w.height-4),F=0.5*w.width-this.margin-2):"center"===this.horizontalAlign&&(null===
|
|
this.maxWidth&&(this.maxWidth=w.width-4),F=0.5*w.height-4));var J;x(this.padding)||"number"!==typeof this.padding?x(this.padding)||"object"!==typeof this.padding||(J=this.padding.top?this.padding.top:this.padding.bottom?this.padding.bottom:0,J+=this.padding.bottom?this.padding.bottom:this.padding.top?this.padding.top:0,J*=1.25):J=2.5*this.padding;this.wrap||(F=Math.min(F,Math.max(1.5*this.fontSize,this.fontSize+J)));F=new ka(this.ctx,{fontSize:this.fontSize,fontFamily:this.fontFamily,fontColor:this.fontColor,
|
|
fontStyle:this.fontStyle,fontWeight:this.fontWeight,horizontalAlign:this.horizontalAlign,verticalAlign:this.verticalAlign,borderColor:this.borderColor,borderThickness:this.borderThickness,backgroundColor:this.backgroundColor,maxWidth:this.maxWidth,maxHeight:F,cornerRadius:this.cornerRadius,text:this.text,padding:this.padding,textBaseline:"top"});J=F.measureText();"top"===this.verticalAlign||"bottom"===this.verticalAlign?("top"===this.verticalAlign?(y=w.y1+2,B="top"):"bottom"===this.verticalAlign&&
|
|
(y=w.y2-2-J.height,B="bottom"),"left"===this.horizontalAlign?u=w.x1+2:"center"===this.horizontalAlign?u=w.x1+w.width/2-J.width/2:"right"===this.horizontalAlign&&(u=w.x2-2-J.width-M),P=this.horizontalAlign,this.width=J.width,this.height=J.height):"center"===this.verticalAlign&&("left"===this.horizontalAlign?(u=w.x1+2,y=w.y2-2-(this.maxWidth/2-J.width/2),z=-90,B="left",this.width=J.height,this.height=J.width):"right"===this.horizontalAlign?(u=w.x2-2,y=w.y1+2+(this.maxWidth/2-J.width/2),z=90,B="right",
|
|
this.width=J.height,this.height=J.width):"center"===this.horizontalAlign&&(y=q.y1+(q.height/2-J.height/2),u=q.x1+(q.width/2-J.width/2),B="center",this.width=J.width,this.height=J.height),P="center");F.x=u;F.y=y;F.angle=z;F.horizontalAlign=P;F.render(!0);q.layoutManager.registerSpace(B,{width:this.width+("left"===B||"right"===B?this.margin+2:0),height:this.height+("top"===B||"bottom"===B?this.margin+2:0)});this.bounds={x1:u,y1:y,x2:u+this.width,y2:y+this.height};this.ctx.textBaseline="top"}};la(La,
|
|
T);La.prototype.render=Ga.prototype.render;la(Ha,T);y={addTheme:function(q,w){xa[q]=w},addColorSet:function(q,w){ya[q]=w},addCultureInfo:function(q,w){Ia[q]=w},formatNumber:function(q,w,u){u=u||"en";if(Ia[u])return ea(q,w||"#,##0.##",new Ha(u));throw"Unknown Culture Name";},formatDate:function(q,w,u){u=u||"en";if(Ia[u])return za(q,w||"DD MMM YYYY",new Ha(u));throw"Unknown Culture Name";}};window.CanvasJS=y;y.Chart=function(){function q(a,f){return a.x-f.x}function s(a,f,b){if(a&&f&&b){b=b+"."+f;var c=
|
|
"image/"+f;a=a.toDataURL(c);var d=!1,g=document.createElement("a");g.download=b;g.href=a;g.target="_blank";if("undefined"!==typeof Blob&&new Blob){for(var k=a.replace(/^data:[a-z\/]*;base64,/,""),k=atob(k),l=new ArrayBuffer(k.length),l=new Uint8Array(l),n=0;n<k.length;n++)l[n]=k.charCodeAt(n);f=new Blob([l.buffer],{type:"image/"+f});try{window.navigator.msSaveBlob(f,b),d=!0}catch(h){g.dataset.downloadurl=[c,g.download,g.href].join(":"),g.href=window.URL.createObjectURL(f)}}if(!d)try{event=document.createEvent("MouseEvents"),
|
|
event.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),g.dispatchEvent?g.dispatchEvent(event):g.fireEvent&&g.fireEvent("onclick")}catch(r){f=window.open(),f.document.write("<img src='"+a+"'></img><div>Please right click on the image and save it to your device</div>"),f.document.close()}}}function u(a,f){f=f||{};this.theme=x(f.theme)||x(xa[f.theme])?"light1":f.theme;u.base.constructor.call(this,"Chart",null,f,null,null);var b=this;this._containerId=a;this._objectsInitialized=!1;this.overlaidCanvasCtx=
|
|
this.ctx=null;this._indexLabels=[];this._panTimerId=0;this._lastTouchEventType="";this._lastTouchData=null;this.isAnimating=!1;this.renderCount=0;this.panEnabled=this.disableToolTip=this.animatedRender=!1;this._defaultCursor="default";this.plotArea={canvas:null,ctx:null,x1:0,y1:0,x2:0,y2:0,width:0,height:0};this._dataInRenderedOrder=[];if(this.container="string"===typeof this._containerId?document.getElementById(this._containerId):this._containerId){this.container.innerHTML="";var c=0,d=0,c=this.options.width?
|
|
this.width:0<this.container.clientWidth?this.container.clientWidth:this.width,d=this.options.height?this.height:0<this.container.clientHeight?this.container.clientHeight:this.height;this.width=c;this.height=d;this.x1=this.y1=0;this.x2=this.width;this.y2=this.height;this._selectedColorSet="undefined"!==typeof ya[this.colorSet]?ya[this.colorSet]:ya.colorSet1;this._canvasJSContainer=document.createElement("div");this._canvasJSContainer.setAttribute("class","canvasjs-chart-container");this._canvasJSContainer.style.position=
|
|
"relative";this._canvasJSContainer.style.textAlign="left";this._canvasJSContainer.style.cursor="auto";w||(this._canvasJSContainer.style.height="0px");this.container.appendChild(this._canvasJSContainer);this.canvas=ta(c,d);this._preRenderCanvas=ta(c,d);this.canvas.style.position="absolute";this.canvas.getContext&&(this._canvasJSContainer.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.ctx.textBaseline="top",Aa(this.ctx),this._preRenderCtx=this._preRenderCanvas.getContext("2d"),
|
|
this._preRenderCtx.textBaseline="top",Aa(this._preRenderCtx),w?this.plotArea.ctx=this.ctx:(this.plotArea.canvas=ta(c,d),this.plotArea.canvas.style.position="absolute",this.plotArea.canvas.setAttribute("class","plotAreaCanvas"),this._canvasJSContainer.appendChild(this.plotArea.canvas),this.plotArea.ctx=this.plotArea.canvas.getContext("2d")),this.overlaidCanvas=ta(c,d),this.overlaidCanvas.style.position="absolute",this.overlaidCanvas.getContext&&(this._canvasJSContainer.appendChild(this.overlaidCanvas),
|
|
this.overlaidCanvasCtx=this.overlaidCanvas.getContext("2d"),this.overlaidCanvasCtx.textBaseline="top",Aa(this.overlaidCanvasCtx)),this._eventManager=new ga(this),this.windowResizeHandler=$(window,"resize",function(){b._updateSize()&&b.render()}),this._toolBar=document.createElement("div"),this._toolBar.setAttribute("class","canvasjs-chart-toolbar"),this._toolBar.style.cssText="position: absolute; right: 1px; top: 1px;",this._canvasJSContainer.appendChild(this._toolBar),this.bounds={x1:0,y1:0,x2:this.width,
|
|
y2:this.height},$(this.overlaidCanvas,"click",function(a){b._mouseEventHandler(a)}),$(this.overlaidCanvas,"mousemove",function(a){b._mouseEventHandler(a)}),$(this.overlaidCanvas,"mouseup",function(a){b._mouseEventHandler(a)}),$(this.overlaidCanvas,"mousedown",function(a){b._mouseEventHandler(a);va(b._dropdownMenu)}),$(this.overlaidCanvas,"mouseout",function(a){b._mouseEventHandler(a)}),$(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerDown":"touchstart",function(a){b._touchEventHandler(a)}),
|
|
$(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerMove":"touchmove",function(a){b._touchEventHandler(a)}),$(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerUp":"touchend",function(a){b._touchEventHandler(a)}),$(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerCancel":"touchcancel",function(a){b._touchEventHandler(a)}),this.toolTip=new X(this,this.options.toolTip),this.data=null,this.axisX=[],this.axisX2=[],this.axisY=[],this.axisY2=[],this.sessionVariables=
|
|
{axisX:[],axisX2:[],axisY:[],axisY2:[]})}else window.console&&window.console.log('CanvasJS Error: Chart Container with id "'+this._containerId+'" was not found')}function y(a,f){for(var b=[],c,d=0;d<a.length;d++)if(0==d)b.push(a[0]);else{var g,k,l;l=d-1;g=0===l?0:l-1;k=l===a.length-1?l:l+1;c=Math.abs((a[k].x-a[g].x)/(0===a[k].x-a[l].x?0.01:a[k].x-a[l].x))*(f-1)/2+1;var n=(a[k].x-a[g].x)/c;c=(a[k].y-a[g].y)/c;b[b.length]=a[l].x>a[g].x&&0<n||a[l].x<a[g].x&&0>n?{x:a[l].x+n/3,y:a[l].y+c/3}:{x:a[l].x,
|
|
y:a[l].y+c/9};l=d;g=0===l?0:l-1;k=l===a.length-1?l:l+1;c=Math.abs((a[k].x-a[g].x)/(0===a[l].x-a[g].x?0.01:a[l].x-a[g].x))*(f-1)/2+1;n=(a[k].x-a[g].x)/c;c=(a[k].y-a[g].y)/c;b[b.length]=a[l].x>a[g].x&&0<n||a[l].x<a[g].x&&0>n?{x:a[l].x-n/3,y:a[l].y-c/3}:{x:a[l].x,y:a[l].y-c/9};b[b.length]=a[d]}return b}function z(a,f,b,c,d,g,k,l,n,h){var r=0;h?(k.color=g,l.color=g):h=1;r=n?Math.abs(d-b):Math.abs(c-f);r=0<k.trimLength?Math.abs(r*k.trimLength/100):Math.abs(r-k.length);n?(b+=r/2,d-=r/2):(f+=r/2,c-=r/2);
|
|
var r=1===Math.round(k.thickness)%2?0.5:0,p=1===Math.round(l.thickness)%2?0.5:0;a.save();a.globalAlpha=h;a.strokeStyle=l.color||g;a.lineWidth=l.thickness||2;a.setLineDash&&a.setLineDash(F(l.dashType,l.thickness));a.beginPath();n&&0<l.thickness?(a.moveTo(c-k.thickness/2,Math.round((b+d)/2)-p),a.lineTo(f+k.thickness/2,Math.round((b+d)/2)-p)):0<l.thickness&&(a.moveTo(Math.round((f+c)/2)-p,b+k.thickness/2),a.lineTo(Math.round((f+c)/2)-p,d-k.thickness/2));a.stroke();a.strokeStyle=k.color||g;a.lineWidth=
|
|
k.thickness||2;a.setLineDash&&a.setLineDash(F(k.dashType,k.thickness));a.beginPath();n&&0<k.thickness?(a.moveTo(c-r,b),a.lineTo(c-r,d),a.moveTo(f+r,b),a.lineTo(f+r,d)):0<k.thickness&&(a.moveTo(f,b+r),a.lineTo(c,b+r),a.moveTo(f,d-r),a.lineTo(c,d-r));a.stroke();a.restore()}function P(a,f,b,c,d){if(null===a||"undefined"===typeof a)return"undefined"===typeof b?f:b;a=parseFloat(a.toString())*(0<=a.toString().indexOf("%")?f/100:1);"undefined"!==typeof c&&(a=Math.min(c,a),"undefined"!==typeof d&&(a=Math.max(d,
|
|
a)));return!isNaN(a)&&a<=f&&0<=a?a:"undefined"===typeof b?f:b}function S(a,f){S.base.constructor.call(this,"Legend","legend",f,null,a);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx;this.ghostCtx=this.chart._eventManager.ghostCtx;this.items=[];this.optionsName="legend";this.height=this.width=0;this.orientation=null;this.dataSeries=[];this.bounds={x1:null,y1:null,x2:null,y2:null};"undefined"===typeof this.options.fontSize&&(this.fontSize=this.chart.getAutoFontSize(this.fontSize));this.lineHeight=
|
|
Sa(this.fontFamily,this.fontSize,this.fontWeight);this.horizontalSpacing=this.fontSize}function R(a,f,b,c){R.base.constructor.call(this,"DataSeries","data",f,b,a);this.chart=a;this.canvas=a.canvas;this._ctx=a.canvas.ctx;this.index=b;this.noDataPointsInPlotArea=0;this.id=c;this.chart._eventManager.objectMap[c]={id:c,objectType:"dataSeries",dataSeriesIndex:b};a=f.dataPoints?f.dataPoints.length:0;this.dataPointEOs=[];for(f=0;f<a;f++)this.dataPointEOs[f]={};this.dataPointIds=[];this.plotUnit=[];this.axisY=
|
|
this.axisX=null;this.optionsName="data";this.isOptionsInArray=!0;null===this.fillOpacity&&(this.type.match(/area/i)?this.fillOpacity=0.7:this.fillOpacity=1);this.axisPlacement=this.getDefaultAxisPlacement();"undefined"===typeof this.options.indexLabelFontSize&&(this.indexLabelFontSize=this.chart.getAutoFontSize(this.indexLabelFontSize))}function B(a,f,b,c,d,g){B.base.constructor.call(this,"Axis",f,b,c,a);this.chart=a;this.canvas=a.canvas;this.ctx=a.ctx;this.intervalStartPosition=this.maxHeight=this.maxWidth=
|
|
0;this.labels=[];this.dataSeries=[];this._stripLineLabels=this._ticks=this._labels=null;this.dataInfo={min:Infinity,max:-Infinity,viewPortMin:Infinity,viewPortMax:-Infinity,minDiff:Infinity};this.isOptionsInArray=!0;"axisX"===d?("left"===g||"bottom"===g?(this.optionsName="axisX",x(this.chart.sessionVariables.axisX[c])&&(this.chart.sessionVariables.axisX[c]={}),this.sessionVariables=this.chart.sessionVariables.axisX[c]):(this.optionsName="axisX2",x(this.chart.sessionVariables.axisX2[c])&&(this.chart.sessionVariables.axisX2[c]=
|
|
{}),this.sessionVariables=this.chart.sessionVariables.axisX2[c]),this.options.interval||(this.intervalType=null)):"left"===g||"top"===g?(this.optionsName="axisY",x(this.chart.sessionVariables.axisY[c])&&(this.chart.sessionVariables.axisY[c]={}),this.sessionVariables=this.chart.sessionVariables.axisY[c]):(this.optionsName="axisY2",x(this.chart.sessionVariables.axisY2[c])&&(this.chart.sessionVariables.axisY2[c]={}),this.sessionVariables=this.chart.sessionVariables.axisY2[c]);"undefined"===typeof this.options.titleFontSize&&
|
|
(this.titleFontSize=this.chart.getAutoFontSize(this.titleFontSize));"undefined"===typeof this.options.labelFontSize&&(this.labelFontSize=this.chart.getAutoFontSize(this.labelFontSize));this.type=d;"axisX"!==d||b&&"undefined"!==typeof b.gridThickness||(this.gridThickness=0);this._position=g;this.lineCoordinates={x1:null,y1:null,x2:null,y2:null,width:null};this.labelAngle=(this.labelAngle%360+360)%360;90<this.labelAngle&&270>this.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&&
|
|
(this.labelAngle-=360);this.options.scaleBreaks&&(this.scaleBreaks=new J(this.chart,this.options.scaleBreaks,++this.chart._eventManager.lastObjectId,this));this.stripLines=[];if(this.options.stripLines&&0<this.options.stripLines.length)for(a=0;a<this.options.stripLines.length;a++)this.stripLines.push(new da(this.chart,this.options.stripLines[a],a,++this.chart._eventManager.lastObjectId,this));this.options.crosshair&&(this.crosshair=new fa(this.chart,this.options.crosshair,this));this._titleTextBlock=
|
|
null;this.hasOptionChanged("viewportMinimum")&&null===this.viewportMinimum&&(this.options.viewportMinimum=void 0,this.sessionVariables.viewportMinimum=null);this.hasOptionChanged("viewportMinimum")||isNaN(this.sessionVariables.newViewportMinimum)||null===this.sessionVariables.newViewportMinimum?this.sessionVariables.newViewportMinimum=null:this.viewportMinimum=this.sessionVariables.newViewportMinimum;this.hasOptionChanged("viewportMaximum")&&null===this.viewportMaximum&&(this.options.viewportMaximum=
|
|
void 0,this.sessionVariables.viewportMaximum=null);this.hasOptionChanged("viewportMaximum")||isNaN(this.sessionVariables.newViewportMaximum)||null===this.sessionVariables.newViewportMaximum?this.sessionVariables.newViewportMaximum=null:this.viewportMaximum=this.sessionVariables.newViewportMaximum;null!==this.minimum&&null!==this.viewportMinimum&&(this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum));null!==this.maximum&&null!==this.viewportMaximum&&(this.viewportMaximum=Math.min(this.viewportMaximum,
|
|
this.maximum));this.trackChanges("viewportMinimum");this.trackChanges("viewportMaximum")}function J(a,f,b,c){J.base.constructor.call(this,"ScaleBreaks","scaleBreaks",f,null,c);this.id=b;this.chart=a;this.ctx=this.chart.ctx;this.axis=c;this.optionsName="scaleBreaks";this.isOptionsInArray=!1;this._appliedBreaks=[];this.customBreaks=[];this.autoBreaks=[];"string"===typeof this.spacing?(this.spacing=parseFloat(this.spacing),this.spacing=isNaN(this.spacing)?8:(10<this.spacing?10:this.spacing)+"%"):"number"!==
|
|
typeof this.spacing&&(this.spacing=8);this.autoCalculate&&(this.maxNumberOfAutoBreaks=Math.min(this.maxNumberOfAutoBreaks,5));if(this.options.customBreaks&&0<this.options.customBreaks.length){for(a=0;a<this.options.customBreaks.length;a++)this.customBreaks.push(new ca(this.chart,"customBreaks",this.options.customBreaks[a],a,++this.chart._eventManager.lastObjectId,this)),"number"===typeof this.customBreaks[a].startValue&&("number"===typeof this.customBreaks[a].endValue&&this.customBreaks[a].endValue!==
|
|
this.customBreaks[a].startValue)&&this._appliedBreaks.push(this.customBreaks[a]);this._appliedBreaks.sort(function(a,c){return a.startValue-c.startValue});for(a=0;a<this._appliedBreaks.length-1;a++)this._appliedBreaks[a].endValue>=this._appliedBreaks[a+1].startValue&&(this._appliedBreaks[a].endValue=Math.max(this._appliedBreaks[a].endValue,this._appliedBreaks[a+1].endValue),window.console&&window.console.log("CanvasJS Error: Breaks "+a+" and "+(a+1)+" are overlapping."),this._appliedBreaks.splice(a,
|
|
2),a--)}}function ca(a,f,b,c,d,g){ca.base.constructor.call(this,"Break",f,b,c,g);this.id=d;this.chart=a;this.ctx=this.chart.ctx;this.scaleBreaks=g;this.optionsName=f;this.isOptionsInArray=!0;this.type=b.type?this.type:g.type;this.fillOpacity=x(b.fillOpacity)?g.fillOpacity:this.fillOpacity;this.lineThickness=x(b.lineThickness)?g.lineThickness:this.lineThickness;this.color=b.color?this.color:g.color;this.lineColor=b.lineColor?this.lineColor:g.lineColor;this.lineDashType=b.lineDashType?this.lineDashType:
|
|
g.lineDashType;!x(this.startValue)&&this.startValue.getTime&&(this.startValue=this.startValue.getTime());!x(this.endValue)&&this.endValue.getTime&&(this.endValue=this.endValue.getTime());"number"===typeof this.startValue&&("number"===typeof this.endValue&&this.endValue<this.startValue)&&(a=this.startValue,this.startValue=this.endValue,this.endValue=a);this.spacing="undefined"===typeof b.spacing?g.spacing:b.spacing;"string"===typeof this.options.spacing?(this.spacing=parseFloat(this.spacing),this.spacing=
|
|
isNaN(this.spacing)?0:(10<this.spacing?10:this.spacing)+"%"):"number"!==typeof this.options.spacing&&(this.spacing=g.spacing);this.size=g.parent.logarithmic?1:0}function da(a,f,b,c,d){da.base.constructor.call(this,"StripLine","stripLines",f,b,d);this.id=c;this.chart=a;this.ctx=this.chart.ctx;this.label=this.label;this.axis=d;this.optionsName="stripLines";this.isOptionsInArray=!0;this._thicknessType="pixel";null!==this.startValue&&null!==this.endValue&&(this.value=d.logarithmic?Math.sqrt((this.startValue.getTime?
|
|
this.startValue.getTime():this.startValue)*(this.endValue.getTime?this.endValue.getTime():this.endValue)):((this.startValue.getTime?this.startValue.getTime():this.startValue)+(this.endValue.getTime?this.endValue.getTime():this.endValue))/2,this._thicknessType=null)}function fa(a,f,b){fa.base.constructor.call(this,"Crosshair","crosshair",f,null,b);this.chart=a;this.ctx=this.chart.ctx;this.axis=b;this.optionsName="crosshair";this._thicknessType="pixel"}function X(a,f){X.base.constructor.call(this,"ToolTip",
|
|
"toolTip",f,null,a);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx;this.currentDataPointIndex=this.currentSeriesIndex=-1;this._timerId=0;this._prevY=this._prevX=NaN;this.containerTransitionDuration=0.1;this.mozContainerTransition=this.getContainerTransition(this.containerTransitionDuration);this.optionsName="toolTip";this._initialize()}function ga(a){this.chart=a;this.lastObjectId=0;this.objectMap=[];this.rectangularRegionEventSubscriptions=[];this.previousDataPointEventObject=null;this.ghostCanvas=
|
|
ta(this.chart.width,this.chart.height);this.ghostCtx=this.ghostCanvas.getContext("2d");this.mouseoveredObjectMaps=[]}function pa(a){this.chart=a;this.ctx=this.chart.plotArea.ctx;this.animations=[];this.animationRequestId=null}la(u,T);u.prototype.destroy=function(){var a=window,f=this.windowResizeHandler;a.removeEventListener?a.removeEventListener("resize",f):a.detachEvent&&a.detachEvent("onresize",f)};u.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.updateOption("colorSet")&&(this._selectedColorSet="undefined"!==typeof ya[this.colorSet]?ya[this.colorSet]:ya.colorSet1);this.updateOption("backgroundColor");this.backgroundColor||(this.backgroundColor="rgba(0,0,0,0)");this.updateOption("culture");this._cultureInfo=new Ha(this.options.culture);this.updateOption("animationEnabled");
|
|
this.animationEnabled=this.animationEnabled&&w;this.updateOption("animationDuration");this.updateOption("rangeChanging");this.updateOption("rangeChanged");this.updateOption("exportEnabled");this.updateOption("exportFileName");this.updateOption("zoomType");this.options.zoomEnabled?(this._zoomButton||(va(this._zoomButton=document.createElement("button")),ua(this,this._zoomButton,"pan"),this._toolBar.appendChild(this._zoomButton),this._zoomButton.style.borderRight=this.toolbar.borderThickness+"px solid "+
|
|
this.toolbar.borderColor,$(this._zoomButton,"click",function(){a.zoomEnabled?(a.zoomEnabled=!1,a.panEnabled=!0,ua(a,a._zoomButton,"zoom")):(a.zoomEnabled=!0,a.panEnabled=!1,ua(a,a._zoomButton,"pan"));a.render()}),$(this._zoomButton,"mouseover",function(){na(a,a._zoomButton,{backgroundColor:a.toolbar.backgroundColorOnHover,color:a.toolbar.fontColorOnHover,transition:"0.4s",WebkitTransition:"0.4s"});0>=navigator.userAgent.search("MSIE")&&na(a,a._zoomButton.childNodes[0],{WebkitFilter:"invert(100%)",
|
|
filter:"invert(100%)"})}),$(this._zoomButton,"mouseout",function(){na(a,a._zoomButton,{backgroundColor:a.toolbar.backgroundColor,color:a.toolbar.fontColor,transition:"0.4s",WebkitTransition:"0.4s"});0>=navigator.userAgent.search("MSIE")&&na(a,a._zoomButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"})})),this._resetButton||(va(this._resetButton=document.createElement("button")),ua(this,this._resetButton,"reset"),this._resetButton.style.borderRight=(this.exportEnabled?this.toolbar.borderThickness:
|
|
0)+"px solid "+this.toolbar.borderColor,this._toolBar.appendChild(this._resetButton),$(this._resetButton,"click",function(){a.toolTip.hide();a.zoomEnabled||a.panEnabled?(a.zoomEnabled=!0,a.panEnabled=!1,ua(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=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=
|
|
null;a.resetOverlayedCanvas();va(a._zoomButton,a._resetButton);a._dispatchRangeEvent("rangeChanging","reset");a.render();a._dispatchRangeEvent("rangeChanged","reset")}),$(this._resetButton,"mouseover",function(){na(a,a._resetButton,{backgroundColor:a.toolbar.backgroundColorOnHover,color:a.toolbar.hoverFfontColorOnHoverontColor,transition:"0.4s",WebkitTransition:"0.4s"});0>=navigator.userAgent.search("MSIE")&&na(a,a._resetButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"})}),
|
|
$(this._resetButton,"mouseout",function(){na(a,a._resetButton,{backgroundColor:a.toolbar.backgroundColor,color:a.toolbar.fontColor,transition:"0.4s",WebkitTransition:"0.4s"});0>=navigator.userAgent.search("MSIE")&&na(a,a._resetButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"})}),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),Ka(a._zoomButton,a._resetButton)):(this.zoomEnabled=!0,this.panEnabled=!1))):this.panEnabled=this.zoomEnabled=!1;this._menuButton?this.exportEnabled?Ka(this._menuButton):va(this._menuButton):this.exportEnabled&&w&&(this._menuButton=document.createElement("button"),ua(this,this._menuButton,"menu"),this._toolBar.appendChild(this._menuButton),$(this._menuButton,"click",function(){"none"!==a._dropdownMenu.style.display||a._dropDownCloseTime&&500>=(new Date).getTime()-
|
|
a._dropDownCloseTime.getTime()||(a._dropdownMenu.style.display="block",a._menuButton.blur(),a._dropdownMenu.focus())},!0),$(this._menuButton,"mouseover",function(){na(a,a._menuButton,{backgroundColor:a.toolbar.backgroundColorOnHover,color:a.toolbar.fontColorOnHover});0>=navigator.userAgent.search("MSIE")&&na(a,a._menuButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"})},!0),$(this._menuButton,"mouseout",function(){na(a,a._menuButton,{backgroundColor:a.toolbar.backgroundColor,
|
|
color:a.toolbar.fontColor});0>=navigator.userAgent.search("MSIE")&&na(a,a._menuButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"})},!0));if(!this._dropdownMenu&&this.exportEnabled&&w){this._dropdownMenu=document.createElement("div");this._dropdownMenu.setAttribute("tabindex",-1);var f=-1!==this.theme.indexOf("dark")?"black":"#888888";this._dropdownMenu.style.cssText="position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer;right: 0px;top: 25px;min-width: 120px;outline: 0;font-size: 14px; font-family: Arial, Helvetica, sans-serif;padding: 5px 0px 5px 0px;text-align: left;line-height: 10px;background-color:"+
|
|
this.toolbar.backgroundColor+";box-shadow: 2px 2px 10px "+f;a._dropdownMenu.style.display="none";this._toolBar.appendChild(this._dropdownMenu);$(this._dropdownMenu,"blur",function(){va(a._dropdownMenu);a._dropDownCloseTime=new Date},!0);f=document.createElement("div");f.style.cssText="padding: 12px 8px 12px 8px";f.innerHTML=this._cultureInfo.printText;f.style.backgroundColor=this.toolbar.backgroundColor;f.style.color=this.toolbar.fontColor;this._dropdownMenu.appendChild(f);$(f,"mouseover",function(){this.style.backgroundColor=
|
|
a.toolbar.backgroundColorOnHover;this.style.color=a.toolbar.fontColorOnHover},!0);$(f,"mouseout",function(){this.style.backgroundColor=a.toolbar.backgroundColor;this.style.color=a.toolbar.fontColor},!0);$(f,"click",function(){a.print();va(a._dropdownMenu)},!0);f=document.createElement("div");f.style.cssText="padding: 12px 8px 12px 8px";f.innerHTML=this._cultureInfo.saveJPGText;f.style.backgroundColor=this.toolbar.backgroundColor;f.style.color=this.toolbar.fontColor;this._dropdownMenu.appendChild(f);
|
|
$(f,"mouseover",function(){this.style.backgroundColor=a.toolbar.backgroundColorOnHover;this.style.color=a.toolbar.fontColorOnHover},!0);$(f,"mouseout",function(){this.style.backgroundColor=a.toolbar.backgroundColor;this.style.color=a.toolbar.fontColor},!0);$(f,"click",function(){s(a.canvas,"jpeg",a.exportFileName);va(a._dropdownMenu)},!0);f=document.createElement("div");f.style.cssText="padding: 12px 8px 12px 8px";f.innerHTML=this._cultureInfo.savePNGText;f.style.backgroundColor=this.toolbar.backgroundColor;
|
|
f.style.color=this.toolbar.fontColor;this._dropdownMenu.appendChild(f);$(f,"mouseover",function(){this.style.backgroundColor=a.toolbar.backgroundColorOnHover;this.style.color=a.toolbar.fontColorOnHover},!0);$(f,"mouseout",function(){this.style.backgroundColor=a.toolbar.backgroundColor;this.style.color=a.toolbar.fontColor},!0);$(f,"click",function(){s(a.canvas,"png",a.exportFileName);va(a._dropdownMenu)},!0)}"none"!==this._toolBar.style.display&&this._zoomButton&&(this.panEnabled?ua(a,a._zoomButton,
|
|
"zoom"):ua(a,a._zoomButton,"pan"),a._resetButton.getAttribute("state")!==a._cultureInfo.resetText&&ua(a,a._resetButton,"reset"));this.options.toolTip&&this.toolTip.options!==this.options.toolTip&&(this.toolTip.options=this.options.toolTip);for(var b in this.toolTip.options)this.toolTip.options.hasOwnProperty(b)&&this.toolTip.updateOption(b)};u.prototype._updateSize=function(){var a=0,f=0;this.options.width?a=this.width:this.width=a=0<this.container.clientWidth?this.container.clientWidth:this.width;
|
|
this.options.height?f=this.height:this.height=f=0<this.container.clientHeight?this.container.clientHeight:this.height;return this.canvas.width!==a*ia||this.canvas.height!==f*ia?(Fa(this.canvas,a,f),Fa(this._preRenderCanvas,a,f),Fa(this.overlaidCanvas,a,f),Fa(this._eventManager.ghostCanvas,a,f),this.bounds={x1:0,y1:0,x2:this.width,y2:this.height},!0):!1};u.prototype._initialize=function(){this.toolbar=new Pa(this,this.options.toolbar);this._animator?this._animator.cancelAllAnimations():this._animator=
|
|
new pa(this);this.removeAllEventListeners();this.disableToolTip=!1;this._axes=[];this.funnelPyramidClickHandler=this.pieDoughnutClickHandler=null;this.animationRequestId&&this.cancelRequestAnimFrame.call(window,this.animationRequestId);this._updateOptions();this.animatedRender=w&&this.animationEnabled&&0===this.renderCount;this._updateSize();this.clearCanvas();this.ctx.beginPath();this.axisX=[];this.axisX2=[];this.axisY=[];this.axisY2=[];this._indexLabels=[];this._dataInRenderedOrder=[];this._events=
|
|
[];this._eventManager&&this._eventManager.reset();this.plotInfo={axisPlacement:null,axisXValueType:null,plotTypes:[]};this.layoutManager=new Ba(0,0,this.width,this.height,2);this.plotArea.layoutManager&&this.plotArea.layoutManager.reset();this.data=[];var a=0,f=null;if(this.options.data){for(var b=0;b<this.options.data.length;b++)if(a++,!this.options.data[b].type||0<=u._supportedChartTypes.indexOf(this.options.data[b].type)){var c=new R(this,this.options.data[b],a-1,++this._eventManager.lastObjectId);
|
|
"error"===c.type&&(c.linkedDataSeriesIndex=x(this.options.data[b].linkedDataSeriesIndex)?b-1:this.options.data[b].linkedDataSeriesIndex,0>c.linkedDataSeriesIndex||c.linkedDataSeriesIndex>=this.options.data.length||"number"!==typeof c.linkedDataSeriesIndex||"error"===this.options.data[c.linkedDataSeriesIndex].type)&&(c.linkedDataSeriesIndex=null);null===c.name&&(c.name="DataSeries "+a);null===c.color?1<this.options.data.length?(c._colorSet=[this._selectedColorSet[c.index%this._selectedColorSet.length]],
|
|
c.color=this._selectedColorSet[c.index%this._selectedColorSet.length]):c._colorSet="line"===c.type||"stepLine"===c.type||"spline"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"stackedArea"===c.type||"stackedArea100"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type||"candlestick"===c.type||"ohlc"===c.type||"waterfall"===c.type||"boxAndWhisker"===c.type?[this._selectedColorSet[0]]:this._selectedColorSet:c._colorSet=[c.color];null===c.markerSize&&(("line"===c.type||
|
|
"stepLine"===c.type||"spline"===c.type||0<=c.type.toLowerCase().indexOf("area"))&&c.dataPoints&&c.dataPoints.length<this.width/16||"scatter"===c.type)&&(c.markerSize=8);"bubble"!==c.type&&"scatter"!==c.type||!c.dataPoints||(c.dataPoints.some?c.dataPoints.some(function(a){return a.x})&&c.dataPoints.sort(q):c.dataPoints.sort(q));this.data.push(c);var d=c.axisPlacement,f=f||d,g;"normal"===d?"xySwapped"===this.plotInfo.axisPlacement?g='You cannot combine "'+c.type+'" with bar chart':"none"===this.plotInfo.axisPlacement?
|
|
g='You cannot combine "'+c.type+'" with pie chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="normal"):"xySwapped"===d?"normal"===this.plotInfo.axisPlacement?g='You cannot combine "'+c.type+'" with line, area, column or pie chart':"none"===this.plotInfo.axisPlacement?g='You cannot combine "'+c.type+'" with pie chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="xySwapped"):"none"===d?"normal"===this.plotInfo.axisPlacement?g='You cannot combine "'+c.type+
|
|
'" with line, area, column or bar chart':"xySwapped"===this.plotInfo.axisPlacement?g='You cannot combine "'+c.type+'" with bar chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="none"):null===d&&"none"===this.plotInfo.axisPlacement&&(g='You cannot combine "'+c.type+'" with pie chart');if(g&&window.console){window.console.log(g);return}}for(b=0;b<this.data.length;b++){if("none"==f&&"error"===this.data[b].type&&window.console){window.console.log('You cannot combine "'+c.type+'" with error chart');
|
|
return}"error"===this.data[b].type&&(this.data[b].axisPlacement=this.plotInfo.axisPlacement=f||"normal",this.data[b]._linkedSeries=null===this.data[b].linkedDataSeriesIndex?null:this.data[this.data[b].linkedDataSeriesIndex])}}var k=this;this.addEventListener("dataAnimationIterationEnd",function(){V.fSWm&&V.fSWm(k);0!==k.axisX.length&&V.fBWm&&V.fBWm(k)});Wa(this);this._objectsInitialized=!0};u._supportedChartTypes=Ea("line stepLine spline column area stepArea splineArea bar bubble scatter stackedColumn stackedColumn100 stackedBar stackedBar100 stackedArea stackedArea100 candlestick ohlc boxAndWhisker rangeColumn error rangeBar rangeArea rangeSplineArea pie doughnut funnel pyramid waterfall".split(" "));
|
|
u.prototype.render=function(a){a&&(this.options=a);this._initialize();ab(this);Wa(this);var f=[];for(a=0;a<this.data.length;a++)if("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement){if(!this.data[a].axisYType||"primary"===this.data[a].axisYType)if(this.options.axisY&&0<this.options.axisY.length){if(!this.axisY.length)for(var b=0;b<this.options.axisY.length;b++)"normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisY[b]=new B(this,"axisY",this.options.axisY[b],
|
|
b,"axisY","left")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisY[b]=new B(this,"axisY",this.options.axisY[b],b,"axisY","bottom"));this.data[a].axisY=this.axisY[0<=this.data[a].axisYIndex&&this.data[a].axisYIndex<this.axisY.length?this.data[a].axisYIndex:0];this.axisY[0<=this.data[a].axisYIndex&&this.data[a].axisYIndex<this.axisY.length?this.data[a].axisYIndex:0].dataSeries.push(this.data[a])}else this.axisY.length||("normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisY[0]=
|
|
new B(this,"axisY",this.options.axisY,0,"axisY","left")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisY[0]=new B(this,"axisY",this.options.axisY,0,"axisY","bottom"))),this.data[a].axisY=this.axisY[0],this.axisY[0].dataSeries.push(this.data[a]);if("secondary"===this.data[a].axisYType)if(this.options.axisY2&&0<this.options.axisY2.length){if(!this.axisY2.length)for(b=0;b<this.options.axisY2.length;b++)"normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisY2[b]=new B(this,
|
|
"axisY2",this.options.axisY2[b],b,"axisY","right")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisY2[b]=new B(this,"axisY2",this.options.axisY2[b],b,"axisY","top"));this.data[a].axisY=this.axisY2[0<=this.data[a].axisYIndex&&this.data[a].axisYIndex<this.axisY2.length?this.data[a].axisYIndex:0];this.axisY2[0<=this.data[a].axisYIndex&&this.data[a].axisYIndex<this.axisY2.length?this.data[a].axisYIndex:0].dataSeries.push(this.data[a])}else this.axisY2.length||("normal"===this.plotInfo.axisPlacement?
|
|
this._axes.push(this.axisY2[0]=new B(this,"axisY2",this.options.axisY2,0,"axisY","right")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisY2[0]=new B(this,"axisY2",this.options.axisY2,0,"axisY","top"))),this.data[a].axisY=this.axisY2[0],this.axisY2[0].dataSeries.push(this.data[a]);if(!this.data[a].axisXType||"primary"===this.data[a].axisXType)if(this.options.axisX&&0<this.options.axisX.length){if(!this.axisX.length)for(b=0;b<this.options.axisX.length;b++)"normal"===this.plotInfo.axisPlacement?
|
|
this._axes.push(this.axisX[b]=new B(this,"axisX",this.options.axisX[b],b,"axisX","bottom")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisX[b]=new B(this,"axisX",this.options.axisX[b],b,"axisX","left"));this.data[a].axisX=this.axisX[0<=this.data[a].axisXIndex&&this.data[a].axisXIndex<this.axisX.length?this.data[a].axisXIndex:0];this.axisX[0<=this.data[a].axisXIndex&&this.data[a].axisXIndex<this.axisX.length?this.data[a].axisXIndex:0].dataSeries.push(this.data[a])}else this.axisX.length||
|
|
("normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisX[0]=new B(this,"axisX",this.options.axisX,0,"axisX","bottom")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisX[0]=new B(this,"axisX",this.options.axisX,0,"axisX","left"))),this.data[a].axisX=this.axisX[0],this.axisX[0].dataSeries.push(this.data[a]);if("secondary"===this.data[a].axisXType)if(this.options.axisX2&&0<this.options.axisX2.length){if(!this.axisX2.length)for(b=0;b<this.options.axisX2.length;b++)"normal"===
|
|
this.plotInfo.axisPlacement?this._axes.push(this.axisX2[b]=new B(this,"axisX2",this.options.axisX2[b],b,"axisX","top")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisX2[b]=new B(this,"axisX2",this.options.axisX2[b],b,"axisX","right"));this.data[a].axisX=this.axisX2[0<=this.data[a].axisXIndex&&this.data[a].axisXIndex<this.axisX2.length?this.data[a].axisXIndex:0];this.axisX2[0<=this.data[a].axisXIndex&&this.data[a].axisXIndex<this.axisX2.length?this.data[a].axisXIndex:0].dataSeries.push(this.data[a])}else this.axisX2.length||
|
|
("normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisX2[0]=new B(this,"axisX2",this.options.axisX2,0,"axisX","top")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisX2[0]=new B(this,"axisX2",this.options.axisX2,0,"axisX","right"))),this.data[a].axisX=this.axisX2[0],this.axisX2[0].dataSeries.push(this.data[a])}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"===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=
|
|
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&&
|
|
"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.zoomEnabled||this.panEnabled))for(a=0;a<this._axes.length;a++)if(null!==this._axes[a].viewportMinimum||null!==this._axes[a].viewportMaximum){b=!0;break}b?(Ka(this._zoomButton,this._resetButton),this._toolBar.style.border=this.toolbar.borderThickness+"px solid "+
|
|
this.toolbar.borderColor,this._zoomButton.style.borderRight=this.toolbar.borderThickness+"px solid "+this.toolbar.borderColor,this._resetButton.style.borderRight=(this.exportEnabled?this.toolbar.borderThickness:0)+"px solid "+this.toolbar.borderColor):(va(this._zoomButton,this._resetButton),this._toolBar.style.border=this.toolbar.borderThickness+"px solid transparent",this.options.zoomEnabled&&(this.zoomEnabled=!0,this.panEnabled=!1));this._processData();this.options.title&&(this.title=new Ga(this,
|
|
this.options.title),this.title.dockInsidePlotArea?f.push(this.title):this.title.render());if(this.options.subtitles)for(this.subtitles=[],a=0;a<this.options.subtitles.length;a++)b=new La(this,this.options.subtitles[a],a),this.subtitles.push(b),b.dockInsidePlotArea?f.push(b):b.render();this.legend=new S(this,this.options.legend);for(a=0;a<this.data.length;a++)(this.data[a].showInLegend||"pie"===this.data[a].type||"doughnut"===this.data[a].type||"funnel"===this.data[a].type||"pyramid"===this.data[a].type)&&
|
|
this.legend.dataSeries.push(this.data[a]);this.legend.dockInsidePlotArea?f.push(this.legend):this.legend.render();for(a=0;a<this._axes.length;a++)if(this._axes[a].scaleBreaks&&this._axes[a].scaleBreaks._appliedBreaks.length){w?(this._breaksCanvas=ta(this.width,this.height,!0),this._breaksCanvasCtx=this._breaksCanvas.getContext("2d")):(this._breaksCanvas=this.canvas,this._breaksCanvasCtx=this.ctx);break}this._preRenderCanvas=ta(this.width,this.height);this._preRenderCtx=this._preRenderCanvas.getContext("2d");
|
|
if("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)B.setLayoutAndRender(this.axisX,this.axisX2,this.axisY,this.axisY2,this.plotInfo.axisPlacement,this.layoutManager.getFreeSpace());else if("none"===this.plotInfo.axisPlacement)this.preparePlotArea();else return;for(a=0;a<f.length;a++)f[a].render();var c=[];if(this.animatedRender){var d=ta(this.width,this.height);d.getContext("2d").drawImage(this.canvas,0,0,this.width,this.height)}var f=this.ctx.miterLimit,g;this.ctx.miterLimit=
|
|
3;w&&this._breaksCanvas&&(this._preRenderCtx.drawImage(this.canvas,0,0,this.width,this.height),this._preRenderCtx.drawImage(this._breaksCanvas,0,0,this.width,this.height),this._breaksCanvasCtx.globalCompositeOperation="source-atop",this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),this._preRenderCtx.clearRect(0,0,this.width,this.height));for(a=0;a<this.plotInfo.plotTypes.length;a++)for(var k=this.plotInfo.plotTypes[a],l=0;l<k.plotUnits.length;l++){var n=k.plotUnits[l],
|
|
h=null;n.targetCanvas=null;this.animatedRender&&(n.targetCanvas=ta(this.width,this.height),n.targetCanvasCtx=n.targetCanvas.getContext("2d"),g=n.targetCanvasCtx.miterLimit,n.targetCanvasCtx.miterLimit=3);"line"===n.type?h=this.renderLine(n):"stepLine"===n.type?h=this.renderStepLine(n):"spline"===n.type?h=this.renderSpline(n):"column"===n.type?h=this.renderColumn(n):"bar"===n.type?h=this.renderBar(n):"area"===n.type?h=this.renderArea(n):"stepArea"===n.type?h=this.renderStepArea(n):"splineArea"===n.type?
|
|
h=this.renderSplineArea(n):"stackedColumn"===n.type?h=this.renderStackedColumn(n):"stackedColumn100"===n.type?h=this.renderStackedColumn100(n):"stackedBar"===n.type?h=this.renderStackedBar(n):"stackedBar100"===n.type?h=this.renderStackedBar100(n):"stackedArea"===n.type?h=this.renderStackedArea(n):"stackedArea100"===n.type?h=this.renderStackedArea100(n):"bubble"===n.type?h=h=this.renderBubble(n):"scatter"===n.type?h=this.renderScatter(n):"pie"===n.type?this.renderPie(n):"doughnut"===n.type?this.renderPie(n):
|
|
"funnel"===n.type?h=this.renderFunnel(n):"pyramid"===n.type?h=this.renderFunnel(n):"candlestick"===n.type?h=this.renderCandlestick(n):"ohlc"===n.type?h=this.renderCandlestick(n):"rangeColumn"===n.type?h=this.renderRangeColumn(n):"error"===n.type?h=this.renderError(n):"rangeBar"===n.type?h=this.renderRangeBar(n):"rangeArea"===n.type?h=this.renderRangeArea(n):"rangeSplineArea"===n.type?h=this.renderRangeSplineArea(n):"waterfall"===n.type?h=this.renderWaterfall(n):"boxAndWhisker"===n.type&&(h=this.renderBoxAndWhisker(n));
|
|
for(b=0;b<n.dataSeriesIndexes.length;b++)this._dataInRenderedOrder.push(this.data[n.dataSeriesIndexes[b]]);this.animatedRender&&(n.targetCanvasCtx.miterLimit=g,h&&c.push(h))}this.ctx.miterLimit=f;this.animatedRender&&this._breaksCanvasCtx&&c.push({source:this._breaksCanvasCtx,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0,startTimePercent:0.7});this.animatedRender&&0<this._indexLabels.length&&(g=ta(this.width,this.height).getContext("2d"),
|
|
c.push(this.renderIndexLabels(g)));var r=this;if(0<c.length)r.disableToolTip=!0,r._animator.animate(200,r.animationDuration,function(a){r.ctx.clearRect(0,0,r.width,r.height);r.ctx.drawImage(d,0,0,Math.floor(r.width*ia),Math.floor(r.height*ia),0,0,r.width,r.height);for(var b=0;b<c.length;b++)h=c[b],1>a&&"undefined"!==typeof h.startTimePercent?a>=h.startTimePercent&&h.animationCallback(h.easingFunction(a-h.startTimePercent,0,1,1-h.startTimePercent),h):h.animationCallback(h.easingFunction(a,0,1,1),h);
|
|
r.dispatchEvent("dataAnimationIterationEnd",{chart:r})},function(){c=[];for(var a=0;a<r.plotInfo.plotTypes.length;a++)for(var b=r.plotInfo.plotTypes[a],e=0;e<b.plotUnits.length;e++)b.plotUnits[e].targetCanvas=null;d=null;r.disableToolTip=!1});else{if(r._breaksCanvas)if(w)r.plotArea.ctx.drawImage(r._breaksCanvas,0,0,this.width,this.height);else for(b=0;b<r._axes.length;b++)r._axes[b].createMask();0<r._indexLabels.length&&r.renderIndexLabels();r.dispatchEvent("dataAnimationIterationEnd",{chart:r})}this.attachPlotAreaEventHandlers();
|
|
this.zoomEnabled||(this.panEnabled||!this._zoomButton||"none"===this._zoomButton.style.display)||va(this._zoomButton,this._resetButton);this.toolTip._updateToolTip();this.renderCount++;this._breaksCanvas&&(delete this._breaksCanvas,delete this._breaksCanvasCtx);for(b=0;b<this._axes.length;b++)this._axes[b].maskCanvas&&(delete this._axes[b].maskCanvas,delete this._axes[b].maskCtx)};u.prototype.attachPlotAreaEventHandlers=function(){this.attachEvent({context:this,chart:this,mousedown:this._plotAreaMouseDown,
|
|
mouseup:this._plotAreaMouseUp,mousemove:this._plotAreaMouseMove,cursor:this.panEnabled?"move":"default",capture:!0,bounds:this.plotArea})};u.prototype.categoriseDataSeries=function(){for(var a="",f=0;f<this.data.length;f++)if(a=this.data[f],a.dataPoints&&(0!==a.dataPoints.length&&a.visible)&&0<=u._supportedChartTypes.indexOf(a.type)){for(var b=null,c=!1,d=null,g=!1,k=0;k<this.plotInfo.plotTypes.length;k++)if(this.plotInfo.plotTypes[k].type===a.type){c=!0;b=this.plotInfo.plotTypes[k];break}c||(b={type:a.type,
|
|
totalDataSeries:0,plotUnits:[]},this.plotInfo.plotTypes.push(b));for(k=0;k<b.plotUnits.length;k++)if(b.plotUnits[k].axisYType===a.axisYType&&b.plotUnits[k].axisXType===a.axisXType&&b.plotUnits[k].axisYIndex===a.axisYIndex&&b.plotUnits[k].axisXIndex===a.axisXIndex){g=!0;d=b.plotUnits[k];break}g||(d={type:a.type,previousDataSeriesCount:0,index:b.plotUnits.length,plotType:b,axisXType:a.axisXType,axisYType:a.axisYType,axisYIndex:a.axisYIndex,axisXIndex:a.axisXIndex,axisY:"primary"===a.axisYType?this.axisY[0<=
|
|
a.axisYIndex&&a.axisYIndex<this.axisY.length?a.axisYIndex:0]:this.axisY2[0<=a.axisYIndex&&a.axisYIndex<this.axisY2.length?a.axisYIndex:0],axisX:"primary"===a.axisXType?this.axisX[0<=a.axisXIndex&&a.axisXIndex<this.axisX.length?a.axisXIndex:0]:this.axisX2[0<=a.axisXIndex&&a.axisXIndex<this.axisX2.length?a.axisXIndex:0],dataSeriesIndexes:[],yTotals:[]},b.plotUnits.push(d));b.totalDataSeries++;d.dataSeriesIndexes.push(f);a.plotUnit=d}for(f=0;f<this.plotInfo.plotTypes.length;f++)for(b=this.plotInfo.plotTypes[f],
|
|
k=a=0;k<b.plotUnits.length;k++)b.plotUnits[k].previousDataSeriesCount=a,a+=b.plotUnits[k].dataSeriesIndexes.length};u.prototype.assignIdToDataPoints=function(){for(var a=0;a<this.data.length;a++){var f=this.data[a];if(f.dataPoints)for(var b=f.dataPoints.length,c=0;c<b;c++)f.dataPointIds[c]=++this._eventManager.lastObjectId}};u.prototype._processData=function(){this.assignIdToDataPoints();this.categoriseDataSeries();for(var a=0;a<this.plotInfo.plotTypes.length;a++)for(var f=this.plotInfo.plotTypes[a],
|
|
b=0;b<f.plotUnits.length;b++){var c=f.plotUnits[b];"line"===c.type||"stepLine"===c.type||"spline"===c.type||"column"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"bar"===c.type||"bubble"===c.type||"scatter"===c.type?this._processMultiseriesPlotUnit(c):"stackedColumn"===c.type||"stackedBar"===c.type||"stackedArea"===c.type?this._processStackedPlotUnit(c):"stackedColumn100"===c.type||"stackedBar100"===c.type||"stackedArea100"===c.type?this._processStacked100PlotUnit(c):"candlestick"===
|
|
c.type||"ohlc"===c.type||"rangeColumn"===c.type||"rangeBar"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type||"error"===c.type||"boxAndWhisker"===c.type?this._processMultiYPlotUnit(c):"waterfall"===c.type&&this._processSpecificPlotUnit(c)}this.calculateAutoBreaks()};u.prototype._processMultiseriesPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,d,g=!1,k=0;k<a.dataSeriesIndexes.length;k++){var l=this.data[a.dataSeriesIndexes[k]],
|
|
n=0,h=!1,r=!1,p;if("normal"===l.axisPlacement||"xySwapped"===l.axisPlacement)var m=a.axisX.sessionVariables.newViewportMinimum?a.axisX.sessionVariables.newViewportMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.minimum:a.axisX.logarithmic?0:-Infinity,e=a.axisX.sessionVariables.newViewportMaximum?a.axisX.sessionVariables.newViewportMaximum:this.options.axisX&&this.options.axisX.viewportMaximum?
|
|
this.options.axisX.viewportMaximum:this.options.axisX&&this.options.axisX.maximum?this.options.axisX.maximum:Infinity;if(l.dataPoints[n].x&&l.dataPoints[n].x.getTime||"dateTime"===l.xValueType)g=!0;for(n=0;n<l.dataPoints.length;n++){"undefined"===typeof l.dataPoints[n].x&&(l.dataPoints[n].x=n+(a.axisX.logarithmic?1:0));l.dataPoints[n].x.getTime?(g=!0,c=l.dataPoints[n].x.getTime()):c=l.dataPoints[n].x;d=l.dataPoints[n].y;c<b.min&&(b.min=c);c>b.max&&(b.max=c);d<f.min&&"number"===typeof d&&(f.min=d);
|
|
d>f.max&&"number"===typeof d&&(f.max=d);if(0<n){if(a.axisX.logarithmic){var t=c/l.dataPoints[n-1].x;1>t&&(t=1/t);b.minDiff>t&&1!==t&&(b.minDiff=t)}else t=c-l.dataPoints[n-1].x,0>t&&(t*=-1),b.minDiff>t&&0!==t&&(b.minDiff=t);null!==d&&null!==l.dataPoints[n-1].y&&(a.axisY.logarithmic?(t=d/l.dataPoints[n-1].y,1>t&&(t=1/t),f.minDiff>t&&1!==t&&(f.minDiff=t)):(t=d-l.dataPoints[n-1].y,0>t&&(t*=-1),f.minDiff>t&&0!==t&&(f.minDiff=t)))}if(c<m&&!h)null!==d&&(p=c);else{if(!h&&(h=!0,0<n)){n-=2;continue}if(c>e&&
|
|
!r)r=!0;else if(c>e&&r)continue;l.dataPoints[n].label&&(a.axisX.labels[c]=l.dataPoints[n].label);c<b.viewPortMin&&(b.viewPortMin=c);c>b.viewPortMax&&(b.viewPortMax=c);null===d?b.viewPortMin===c&&p<c&&(b.viewPortMin=p):(d<f.viewPortMin&&"number"===typeof d&&(f.viewPortMin=d),d>f.viewPortMax&&"number"===typeof d&&(f.viewPortMax=d))}}this.plotInfo.axisXValueType=l.xValueType=g?"dateTime":"number"}};u.prototype._processStackedPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var f=
|
|
a.axisY.dataInfo,b=a.axisX.dataInfo,c,d,g=!1,k=[],l=[],n=Infinity,h=-Infinity,r=0;r<a.dataSeriesIndexes.length;r++){var p=this.data[a.dataSeriesIndexes[r]],m=0,e=!1,t=!1,ra;if("normal"===p.axisPlacement||"xySwapped"===p.axisPlacement)var C=this.sessionVariables.axisX.newViewportMinimum?this.sessionVariables.axisX.newViewportMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.minimum:-Infinity,
|
|
v=this.sessionVariables.axisX.newViewportMaximum?this.sessionVariables.axisX.newViewportMaximum:this.options.axisX&&this.options.axisX.viewportMaximum?this.options.axisX.viewportMaximum:this.options.axisX&&this.options.axisX.maximum?this.options.axisX.maximum:Infinity;if(p.dataPoints[m].x&&p.dataPoints[m].x.getTime||"dateTime"===p.xValueType)g=!0;for(m=0;m<p.dataPoints.length;m++){"undefined"===typeof p.dataPoints[m].x&&(p.dataPoints[m].x=m+(a.axisX.logarithmic?1:0));p.dataPoints[m].x.getTime?(g=
|
|
!0,c=p.dataPoints[m].x.getTime()):c=p.dataPoints[m].x;d=x(p.dataPoints[m].y)?0:p.dataPoints[m].y;c<b.min&&(b.min=c);c>b.max&&(b.max=c);if(0<m){if(a.axisX.logarithmic){var E=c/p.dataPoints[m-1].x;1>E&&(E=1/E);b.minDiff>E&&1!==E&&(b.minDiff=E)}else E=c-p.dataPoints[m-1].x,0>E&&(E*=-1),b.minDiff>E&&0!==E&&(b.minDiff=E);null!==d&&null!==p.dataPoints[m-1].y&&(a.axisY.logarithmic?0<d&&(E=d/p.dataPoints[m-1].y,1>E&&(E=1/E),f.minDiff>E&&1!==E&&(f.minDiff=E)):(E=d-p.dataPoints[m-1].y,0>E&&(E*=-1),f.minDiff>
|
|
E&&0!==E&&(f.minDiff=E)))}if(c<C&&!e)null!==p.dataPoints[m].y&&(ra=c);else{if(!e&&(e=!0,0<m)){m-=2;continue}if(c>v&&!t)t=!0;else if(c>v&&t)continue;p.dataPoints[m].label&&(a.axisX.labels[c]=p.dataPoints[m].label);c<b.viewPortMin&&(b.viewPortMin=c);c>b.viewPortMax&&(b.viewPortMax=c);null===p.dataPoints[m].y?b.viewPortMin===c&&ra<c&&(b.viewPortMin=ra):(a.yTotals[c]=(a.yTotals[c]?a.yTotals[c]:0)+d,0<=d?k[c]?k[c]+=d:(k[c]=d,n=Math.min(d,n)):l[c]?l[c]+=d:(l[c]=d,h=Math.max(d,h)))}}a.axisY.scaleBreaks&&
|
|
(a.axisY.scaleBreaks.autoCalculate&&1<=a.axisY.scaleBreaks.maxNumberOfAutoBreaks)&&(f.dataPointYPositiveSums?(f.dataPointYPositiveSums.push.apply(f.dataPointYPositiveSums,k),f.dataPointYNegativeSums.push.apply(f.dataPointYPositiveSums,l)):(f.dataPointYPositiveSums=k,f.dataPointYNegativeSums=l));this.plotInfo.axisXValueType=p.xValueType=g?"dateTime":"number"}for(m in k)k.hasOwnProperty(m)&&!isNaN(m)&&(a=k[m],a<f.min&&(f.min=Math.min(a,n)),a>f.max&&(f.max=a),m<b.viewPortMin||m>b.viewPortMax||(a<f.viewPortMin&&
|
|
(f.viewPortMin=Math.min(a,n)),a>f.viewPortMax&&(f.viewPortMax=a)));for(m in l)l.hasOwnProperty(m)&&!isNaN(m)&&(a=l[m],a<f.min&&(f.min=a),a>f.max&&(f.max=Math.max(a,h)),m<b.viewPortMin||m>b.viewPortMax||(a<f.viewPortMin&&(f.viewPortMin=a),a>f.viewPortMax&&(f.viewPortMax=Math.max(a,h))))}};u.prototype._processStacked100PlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,d,g=!1,k=!1,l=!1,n=[],h=0;h<a.dataSeriesIndexes.length;h++){var r=
|
|
this.data[a.dataSeriesIndexes[h]],p=0,m=!1,e=!1,t;if("normal"===r.axisPlacement||"xySwapped"===r.axisPlacement)var ra=this.sessionVariables.axisX.newViewportMinimum?this.sessionVariables.axisX.newViewportMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.minimum:-Infinity,C=this.sessionVariables.axisX.newViewportMaximum?this.sessionVariables.axisX.newViewportMaximum:this.options.axisX&&
|
|
this.options.axisX.viewportMaximum?this.options.axisX.viewportMaximum:this.options.axisX&&this.options.axisX.maximum?this.options.axisX.maximum:Infinity;if(r.dataPoints[p].x&&r.dataPoints[p].x.getTime||"dateTime"===r.xValueType)g=!0;for(p=0;p<r.dataPoints.length;p++){"undefined"===typeof r.dataPoints[p].x&&(r.dataPoints[p].x=p+(a.axisX.logarithmic?1:0));r.dataPoints[p].x.getTime?(g=!0,c=r.dataPoints[p].x.getTime()):c=r.dataPoints[p].x;d=x(r.dataPoints[p].y)?null:r.dataPoints[p].y;c<b.min&&(b.min=
|
|
c);c>b.max&&(b.max=c);if(0<p){if(a.axisX.logarithmic){var v=c/r.dataPoints[p-1].x;1>v&&(v=1/v);b.minDiff>v&&1!==v&&(b.minDiff=v)}else v=c-r.dataPoints[p-1].x,0>v&&(v*=-1),b.minDiff>v&&0!==v&&(b.minDiff=v);x(d)||null===r.dataPoints[p-1].y||(a.axisY.logarithmic?0<d&&(v=d/r.dataPoints[p-1].y,1>v&&(v=1/v),f.minDiff>v&&1!==v&&(f.minDiff=v)):(v=d-r.dataPoints[p-1].y,0>v&&(v*=-1),f.minDiff>v&&0!==v&&(f.minDiff=v)))}if(c<ra&&!m)null!==d&&(t=c);else{if(!m&&(m=!0,0<p)){p-=2;continue}if(c>C&&!e)e=!0;else if(c>
|
|
C&&e)continue;r.dataPoints[p].label&&(a.axisX.labels[c]=r.dataPoints[p].label);c<b.viewPortMin&&(b.viewPortMin=c);c>b.viewPortMax&&(b.viewPortMax=c);null===d?b.viewPortMin===c&&t<c&&(b.viewPortMin=t):(a.yTotals[c]=(a.yTotals[c]?a.yTotals[c]:0)+d,0<=d?k=!0:0>d&&(l=!0),n[c]=n[c]?n[c]+Math.abs(d):Math.abs(d))}}this.plotInfo.axisXValueType=r.xValueType=g?"dateTime":"number"}a.axisY.logarithmic?(f.max=x(f.viewPortMax)?99*Math.pow(a.axisY.logarithmBase,-0.05):Math.max(f.viewPortMax,99*Math.pow(a.axisY.logarithmBase,
|
|
-0.05)),f.min=x(f.viewPortMin)?1:Math.min(f.viewPortMin,1)):k&&!l?(f.max=x(f.viewPortMax)?99:Math.max(f.viewPortMax,99),f.min=x(f.viewPortMin)?1:Math.min(f.viewPortMin,1)):k&&l?(f.max=x(f.viewPortMax)?99:Math.max(f.viewPortMax,99),f.min=x(f.viewPortMin)?-99:Math.min(f.viewPortMin,-99)):!k&&l&&(f.max=x(f.viewPortMax)?-1:Math.max(f.viewPortMax,-1),f.min=x(f.viewPortMin)?-99:Math.min(f.viewPortMin,-99));f.viewPortMin=f.min;f.viewPortMax=f.max;a.dataPointYSums=n}};u.prototype._processMultiYPlotUnit=function(a){if(a.dataSeriesIndexes&&
|
|
!(1>a.dataSeriesIndexes.length))for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,d,g,k,l=!1,n=0;n<a.dataSeriesIndexes.length;n++){var h=this.data[a.dataSeriesIndexes[n]],r=0,p=!1,m=!1,e,t,ra;if("normal"===h.axisPlacement||"xySwapped"===h.axisPlacement)var C=this.sessionVariables.axisX.newViewportMinimum?this.sessionVariables.axisX.newViewportMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.minimum:
|
|
-Infinity,v=this.sessionVariables.axisX.newViewportMaximum?this.sessionVariables.axisX.newViewportMaximum:this.options.axisX&&this.options.axisX.viewportMaximum?this.options.axisX.viewportMaximum:this.options.axisX&&this.options.axisX.maximum?this.options.axisX.maximum:Infinity;if(h.dataPoints[r].x&&h.dataPoints[r].x.getTime||"dateTime"===h.xValueType)l=!0;for(r=0;r<h.dataPoints.length;r++){"undefined"===typeof h.dataPoints[r].x&&(h.dataPoints[r].x=r+(a.axisX.logarithmic?1:0));h.dataPoints[r].x.getTime?
|
|
(l=!0,c=h.dataPoints[r].x.getTime()):c=h.dataPoints[r].x;if((d=h.dataPoints[r].y)&&d.length){g=Math.min.apply(null,d);k=Math.max.apply(null,d);t=!0;for(var E=0;E<d.length;E++)null===d.k&&(t=!1);t&&(p||(ra=e),e=c)}c<b.min&&(b.min=c);c>b.max&&(b.max=c);g<f.min&&(f.min=g);k>f.max&&(f.max=k);0<r&&(a.axisX.logarithmic?(t=c/h.dataPoints[r-1].x,1>t&&(t=1/t),b.minDiff>t&&1!==t&&(b.minDiff=t)):(t=c-h.dataPoints[r-1].x,0>t&&(t*=-1),b.minDiff>t&&0!==t&&(b.minDiff=t)),d&&(null!==d[0]&&h.dataPoints[r-1].y&&null!==
|
|
h.dataPoints[r-1].y[0])&&(a.axisY.logarithmic?(t=d[0]/h.dataPoints[r-1].y[0],1>t&&(t=1/t),f.minDiff>t&&1!==t&&(f.minDiff=t)):(t=d[0]-h.dataPoints[r-1].y[0],0>t&&(t*=-1),f.minDiff>t&&0!==t&&(f.minDiff=t))));if(!(c<C)||p){if(!p&&(p=!0,0<r)){r-=2;e=ra;continue}if(c>v&&!m)m=!0;else if(c>v&&m)continue;h.dataPoints[r].label&&(a.axisX.labels[c]=h.dataPoints[r].label);c<b.viewPortMin&&(b.viewPortMin=c);c>b.viewPortMax&&(b.viewPortMax=c);if(b.viewPortMin===c&&d)for(E=0;E<d.length;E++)if(null===d[E]&&e<c){b.viewPortMin=
|
|
e;break}null===d?b.viewPortMin===c&&e<c&&(b.viewPortMin=e):(g<f.viewPortMin&&(f.viewPortMin=g),k>f.viewPortMax&&(f.viewPortMax=k))}}this.plotInfo.axisXValueType=h.xValueType=l?"dateTime":"number"}};u.prototype._processSpecificPlotUnit=function(a){if("waterfall"===a.type&&a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,d,g=!1,k=0;k<a.dataSeriesIndexes.length;k++){var l=this.data[a.dataSeriesIndexes[k]],n=0,h=!1,r=!1,p=c=0;if("normal"===l.axisPlacement||
|
|
"xySwapped"===l.axisPlacement)var m=a.axisX.sessionVariables.newViewportMinimum?a.axisX.sessionVariables.newViewportMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.minimum:a.axisX.logarithmic?0:-Infinity,e=a.axisX.sessionVariables.newViewportMaximum?a.axisX.sessionVariables.newViewportMaximum:this.options.axisX&&this.options.axisX.viewportMaximum?this.options.axisX.viewportMaximum:this.options.axisX&&
|
|
this.options.axisX.maximum?this.options.axisX.maximum:Infinity;if(l.dataPoints[n].x&&l.dataPoints[n].x.getTime||"dateTime"===l.xValueType)g=!0;for(n=0;n<l.dataPoints.length;n++)"undefined"!==typeof l.dataPoints[n].isCumulativeSum&&!0===l.dataPoints[n].isCumulativeSum?(l.dataPointEOs[n].cumulativeSumYStartValue=0,l.dataPointEOs[n].cumulativeSum=0===n?0:l.dataPointEOs[n-1].cumulativeSum,l.dataPoints[n].y=0===n?0:l.dataPointEOs[n-1].cumulativeSum):"undefined"!==typeof l.dataPoints[n].isIntermediateSum&&
|
|
!0===l.dataPoints[n].isIntermediateSum?(l.dataPointEOs[n].cumulativeSumYStartValue=p,l.dataPointEOs[n].cumulativeSum=0===n?0:l.dataPointEOs[n-1].cumulativeSum,l.dataPoints[n].y=0===n?0:c,p=0===n?0:l.dataPointEOs[n-1].cumulativeSum,c=0):(d="number"!==typeof l.dataPoints[n].y?0:l.dataPoints[n].y,l.dataPointEOs[n].cumulativeSumYStartValue=0===n?0:l.dataPointEOs[n-1].cumulativeSum,l.dataPointEOs[n].cumulativeSum=0===n?d:l.dataPointEOs[n-1].cumulativeSum+d,c+=d);for(n=0;n<l.dataPoints.length;n++)if("undefined"===
|
|
typeof l.dataPoints[n].x&&(l.dataPoints[n].x=n+(a.axisX.logarithmic?1:0)),l.dataPoints[n].x.getTime?(g=!0,c=l.dataPoints[n].x.getTime()):c=l.dataPoints[n].x,d=l.dataPoints[n].y,c<b.min&&(b.min=c),c>b.max&&(b.max=c),l.dataPointEOs[n].cumulativeSum<f.min&&(f.min=l.dataPointEOs[n].cumulativeSum),l.dataPointEOs[n].cumulativeSum>f.max&&(f.max=l.dataPointEOs[n].cumulativeSum),0<n&&(a.axisX.logarithmic?(p=c/l.dataPoints[n-1].x,1>p&&(p=1/p),b.minDiff>p&&1!==p&&(b.minDiff=p)):(p=c-l.dataPoints[n-1].x,0>p&&
|
|
(p*=-1),b.minDiff>p&&0!==p&&(b.minDiff=p)),null!==d&&null!==l.dataPoints[n-1].y&&(a.axisY.logarithmic?(d=l.dataPointEOs[n].cumulativeSum/l.dataPointEOs[n-1].cumulativeSum,1>d&&(d=1/d),f.minDiff>d&&1!==d&&(f.minDiff=d)):(d=l.dataPointEOs[n].cumulativeSum-l.dataPointEOs[n-1].cumulativeSum,0>d&&(d*=-1),f.minDiff>d&&0!==d&&(f.minDiff=d)))),!(c<m)||h){if(!h&&(h=!0,0<n)){n-=2;continue}if(c>e&&!r)r=!0;else if(c>e&&r)continue;l.dataPoints[n].label&&(a.axisX.labels[c]=l.dataPoints[n].label);c<b.viewPortMin&&
|
|
(b.viewPortMin=c);c>b.viewPortMax&&(b.viewPortMax=c);0<n&&(l.dataPointEOs[n-1].cumulativeSum<f.viewPortMin&&(f.viewPortMin=l.dataPointEOs[n-1].cumulativeSum),l.dataPointEOs[n-1].cumulativeSum>f.viewPortMax&&(f.viewPortMax=l.dataPointEOs[n-1].cumulativeSum));l.dataPointEOs[n].cumulativeSum<f.viewPortMin&&(f.viewPortMin=l.dataPointEOs[n].cumulativeSum);l.dataPointEOs[n].cumulativeSum>f.viewPortMax&&(f.viewPortMax=l.dataPointEOs[n].cumulativeSum)}this.plotInfo.axisXValueType=l.xValueType=g?"dateTime":
|
|
"number"}};u.prototype.calculateAutoBreaks=function(){function a(a,c){var b=c-a,d=Math.pow(10,Math.floor(Math.log(b)/Math.LN10)),f=Math.pow(10,Math.floor(Math.log(Math.abs(a||b))/Math.LN10)),g,h;f<d?(g=Math.ceil(a*(0<a?1.01:0.99)/f)*f,h=Math.floor(c*(0<c?0.99:1.01)/f)*f):(g=Math.ceil(a*(0<a?1.01:0.99)/d)*d,h=Math.floor(c*(0<c?0.99:1.01)/d)*d);g>h&&(h=Math.pow(0.1,Number((Math.log(d)/Math.LN10+1).toFixed(2))>>1),0.01>h?(g=Math.ceil(a*(1+(0<a?h:-1*h))/d)*d,h=Math.floor(c*(1+(0<c?-1*h:h))/d)*d):(d/=
|
|
10,g=Math.ceil((a+(0<a?d:-1*d))/d)*d,h=Math.floor((c+(0<c?-1*d:d))/d)*d));var k=g-a,m=c-h;if(m>0.01*b){var l=B.getNiceNumber(m);h+=Math.floor(0.99*m/l)*l}k>0.01*b&&(b=Math.min(B.getNiceNumber(k),Math.ceil(d/10),Math.ceil(f/10)))&&(g-=Math.floor(0.99*k/b)*b);return{startValue:g,endValue:h}}function f(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){var c=a.axisX.scaleBreaks&&a.axisX.scaleBreaks.autoCalculate&&1<=a.axisX.scaleBreaks.maxNumberOfAutoBreaks,b=a.axisY.scaleBreaks&&a.axisY.scaleBreaks.autoCalculate&&
|
|
1<=a.axisY.scaleBreaks.maxNumberOfAutoBreaks;if(c||b)for(var f=a.axisY.dataInfo,g=a.axisX.dataInfo,h,k=g.min,m=g.max,l=f.min,n=f.max,g=g._dataRanges,f=f._dataRanges,p,r=0,q=0;q<a.dataSeriesIndexes.length;q++){var w=d.data[a.dataSeriesIndexes[q]];if(!(4>w.dataPoints.length))for(r=0;r<w.dataPoints.length;r++)if(c&&(p=(m+1-k)*Math.max(parseFloat(a.axisX.scaleBreaks.collapsibleThreshold)||10,10)/100,h=w.dataPoints[r].x.getTime?w.dataPoints[r].x.getTime():w.dataPoints[r].x,p=Math.floor((h-k)/p),h<g[p].min&&
|
|
(g[p].min=h),h>g[p].max&&(g[p].max=h)),b){var u=(n+1-l)*Math.max(parseFloat(a.axisY.scaleBreaks.collapsibleThreshold)||10,10)/100;if((h="waterfall"===a.type?w.dataPointEOs[r].cumulativeSum:w.dataPoints[r].y)&&h.length)for(var s=0;s<h.length;s++)p=Math.floor((h[s]-l)/u),h[s]<f[p].min&&(f[p].min=h[s]),h[s]>f[p].max&&(f[p].max=h[s]);else x(h)||(p=Math.floor((h-l)/u),h<f[p].min&&(f[p].min=h),h>f[p].max&&(f[p].max=h))}}}}function b(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)&&a.axisX.scaleBreaks&&
|
|
a.axisX.scaleBreaks.autoCalculate&&1<=a.axisX.scaleBreaks.maxNumberOfAutoBreaks)for(var c=a.axisX.dataInfo,b=c.min,f=c.max,g=c._dataRanges,h,k=0,m=0;m<a.dataSeriesIndexes.length;m++){var l=d.data[a.dataSeriesIndexes[m]];if(!(4>l.dataPoints.length))for(k=0;k<l.dataPoints.length;k++)h=(f+1-b)*Math.max(parseFloat(a.axisX.scaleBreaks.collapsibleThreshold)||10,10)/100,c=l.dataPoints[k].x.getTime?l.dataPoints[k].x.getTime():l.dataPoints[k].x,h=Math.floor((c-b)/h),c<g[h].min&&(g[h].min=c),c>g[h].max&&(g[h].max=
|
|
c)}}for(var c,d=this,g=!1,k=0;k<this._axes.length;k++)if(this._axes[k].scaleBreaks&&this._axes[k].scaleBreaks.autoCalculate&&1<=this._axes[k].scaleBreaks.maxNumberOfAutoBreaks){g=!0;this._axes[k].dataInfo._dataRanges=[];for(var l=0;l<100/Math.max(parseFloat(this._axes[k].scaleBreaks.collapsibleThreshold)||10,10);l++)this._axes[k].dataInfo._dataRanges.push({min:Infinity,max:-Infinity})}if(g){for(k=0;k<this.plotInfo.plotTypes.length;k++)for(g=this.plotInfo.plotTypes[k],l=0;l<g.plotUnits.length;l++)c=
|
|
g.plotUnits[l],"line"===c.type||"stepLine"===c.type||"spline"===c.type||"column"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"bar"===c.type||"bubble"===c.type||"scatter"===c.type||"candlestick"===c.type||"ohlc"===c.type||"rangeColumn"===c.type||"rangeBar"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type||"waterfall"===c.type||"error"===c.type||"boxAndWhisker"===c.type?f(c):0<=c.type.indexOf("stacked")&&b(c);for(k=0;k<this._axes.length;k++)if(this._axes[k].dataInfo._dataRanges){var n=
|
|
this._axes[k].dataInfo.min;c=(this._axes[k].dataInfo.max+1-n)*Math.max(parseFloat(this._axes[k].scaleBreaks.collapsibleThreshold)||10,10)/100;var h=this._axes[k].dataInfo._dataRanges,r,p,g=[];if(this._axes[k].dataInfo.dataPointYPositiveSums){var m=this._axes[k].dataInfo.dataPointYPositiveSums;r=h;for(l in m)m.hasOwnProperty(l)&&!isNaN(l)&&(p=m[l],x(p)||(index=Math.floor((p-n)/c),p<r[index].min&&(r[index].min=p),p>r[index].max&&(r[index].max=p)));delete this._axes[k].dataInfo.dataPointYPositiveSums}if(this._axes[k].dataInfo.dataPointYNegativeSums){m=
|
|
this._axes[k].dataInfo.dataPointYNegativeSums;r=h;for(l in m)m.hasOwnProperty(l)&&!isNaN(l)&&(p=-1*m[l],x(p)||(index=Math.floor((p-n)/c),p<r[index].min&&(r[index].min=p),p>r[index].max&&(r[index].max=p)));delete this._axes[k].dataInfo.dataPointYNegativeSums}for(l=0;l<h.length-1;l++)if(r=h[l].max,isFinite(r))for(;l<h.length-1;)if(n=h[l+1].min,isFinite(n)){p=n-r;p>c&&g.push({diff:p,start:r,end:n});break}else l++;if(this._axes[k].scaleBreaks.customBreaks)for(l=0;l<this._axes[k].scaleBreaks.customBreaks.length;l++)for(c=
|
|
0;c<g.length;c++)if(this._axes[k].scaleBreaks.customBreaks[l].startValue<=g[c].start&&g[c].start<=this._axes[k].scaleBreaks.customBreaks[l].endValue||this._axes[k].scaleBreaks.customBreaks[l].startValue<=g[c].start&&g[c].start<=this._axes[k].scaleBreaks.customBreaks[l].endValue||g[c].start<=this._axes[k].scaleBreaks.customBreaks[l].startValue&&this._axes[k].scaleBreaks.customBreaks[l].startValue<=g[c].end||g[c].start<=this._axes[k].scaleBreaks.customBreaks[l].endValue&&this._axes[k].scaleBreaks.customBreaks[l].endValue<=
|
|
g[c].end)g.splice(c,1),c--;g.sort(function(a,c){return c.diff-a.diff});for(l=0;l<Math.min(g.length,this._axes[k].scaleBreaks.maxNumberOfAutoBreaks);l++)c=a(g[l].start,g[l].end),this._axes[k].scaleBreaks.autoBreaks.push(new ca(this,"autoBreaks",c,l,++this._eventManager.lastObjectId,this._axes[k].scaleBreaks)),this._axes[k].scaleBreaks._appliedBreaks.push(this._axes[k].scaleBreaks.autoBreaks[this._axes[k].scaleBreaks.autoBreaks.length-1]);this._axes[k].scaleBreaks._appliedBreaks.sort(function(a,c){return a.startValue-
|
|
c.startValue})}}};u.prototype.getDataPointAtXY=function(a,f,b){b=b||!1;for(var c=[],d=this._dataInRenderedOrder.length-1;0<=d;d--){var g=null;(g=this._dataInRenderedOrder[d].getDataPointAtXY(a,f,b))&&c.push(g)}a=null;f=!1;for(b=0;b<c.length;b++)if("line"===c[b].dataSeries.type||"stepLine"===c[b].dataSeries.type||"area"===c[b].dataSeries.type||"stepArea"===c[b].dataSeries.type)if(d=ja("markerSize",c[b].dataPoint,c[b].dataSeries)||8,c[b].distance<=d/2){f=!0;break}for(b=0;b<c.length;b++)f&&"line"!==
|
|
c[b].dataSeries.type&&"stepLine"!==c[b].dataSeries.type&&"area"!==c[b].dataSeries.type&&"stepArea"!==c[b].dataSeries.type||(a?c[b].distance<=a.distance&&(a=c[b]):a=c[b]);return a};u.prototype.getObjectAtXY=function(a,f,b){var c=null;if(b=this.getDataPointAtXY(a,f,b||!1))c=b.dataSeries.dataPointIds[b.dataPointIndex];else if(w)c=Ua(a,f,this._eventManager.ghostCtx);else for(b=0;b<this.legend.items.length;b++){var d=this.legend.items[b];a>=d.x1&&(a<=d.x2&&f>=d.y1&&f<=d.y2)&&(c=d.id)}return c};u.prototype.getAutoFontSize=
|
|
function(a,f,b){f=Math.min(this.width,this.height);return Math.max("theme4"===this.theme?0:300<=f?12:10,Math.round(f*(a/400)))};u.prototype.resetOverlayedCanvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)};u.prototype.clearCanvas=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))};u.prototype.attachEvent=function(a){this._events.push(a)};u.prototype._touchEventHandler=
|
|
function(a){if(a.changedTouches&&this.interactivityEnabled){var f=[],b=a.changedTouches,c=b?b[0]:a,d=null;switch(a.type){case "touchstart":case "MSPointerDown":f=["mousemove","mousedown"];this._lastTouchData=Ma(c);this._lastTouchData.time=new Date;break;case "touchmove":case "MSPointerMove":f=["mousemove"];break;case "touchend":case "MSPointerUp":f="touchstart"===this._lastTouchEventType||"MSPointerDown"===this._lastTouchEventType?["mouseup","click"]:["mouseup"];break;default:return}if(!(b&&1<b.length)){d=
|
|
Ma(c);d.time=new Date;try{var g=d.y-this._lastTouchData.y;if(15<Math.abs(g)&&this._lastTouchData.scroll){this._lastTouchData.scroll=!0;var k=window.parent||window;k&&k.scrollBy&&k.scrollBy(0,-g)}}catch(l){}this._lastTouchEventType=a.type;if(this._lastTouchData.scroll&&this.zoomEnabled)this.isDrag&&this.resetOverlayedCanvas(),this.isDrag=!1;else for(b=0;b<f.length;b++)d=f[b],g=document.createEvent("MouseEvent"),g.initMouseEvent(d,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,
|
|
null),c.target.dispatchEvent(g),a.preventManipulation&&a.preventManipulation()}}};u.prototype._dispatchRangeEvent=function(a,f){var b={chart:this};b.type=a;b.trigger=f;var c=[];this.axisX&&0<this.axisX.length&&c.push("axisX");this.axisX2&&0<this.axisX2.length&&c.push("axisX2");this.axisY&&0<this.axisY.length&&c.push("axisY");this.axisY2&&0<this.axisY2.length&&c.push("axisY2");for(var d=0;d<c.length;d++)if(x(b[c[d]])&&(b[c[d]]=[]),"axisY"===c[d])for(var g=0;g<this.axisY.length;g++)b[c[d]].push({viewportMinimum:this[c[d]][g].sessionVariables.newViewportMinimum,
|
|
viewportMaximum:this[c[d]][g].sessionVariables.newViewportMaximum});else if("axisY2"===c[d])for(g=0;g<this.axisY2.length;g++)b[c[d]].push({viewportMinimum:this[c[d]][g].sessionVariables.newViewportMinimum,viewportMaximum:this[c[d]][g].sessionVariables.newViewportMaximum});else if("axisX"===c[d])for(g=0;g<this.axisX.length;g++)b[c[d]].push({viewportMinimum:this[c[d]][g].sessionVariables.newViewportMinimum,viewportMaximum:this[c[d]][g].sessionVariables.newViewportMaximum});else if("axisX2"===c[d])for(g=
|
|
0;g<this.axisX2.length;g++)b[c[d]].push({viewportMinimum:this[c[d]][g].sessionVariables.newViewportMinimum,viewportMaximum:this[c[d]][g].sessionVariables.newViewportMaximum});this.dispatchEvent(a,b,this)};u.prototype._mouseEventHandler=function(a){"undefined"===typeof a.target&&a.srcElement&&(a.target=a.srcElement);var f=Ma(a),b=a.type,c,d;a.which?d=3==a.which:a.button&&(d=2==a.button);u.capturedEventParam&&(c=u.capturedEventParam,"mouseup"===b&&(u.capturedEventParam=null,c.chart.overlaidCanvas.releaseCapture?
|
|
c.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEventListener("mouseup",c.chart._mouseEventHandler,!1)),c.hasOwnProperty(b)&&("mouseup"!==b||c.chart.overlaidCanvas.releaseCapture?a.target!==c.chart.overlaidCanvas&&w||c[b].call(c.context,f.x,f.y):a.target!==c.chart.overlaidCanvas&&(c.chart.isDrag=!1)));if(this.interactivityEnabled)if(this._ignoreNextEvent)this._ignoreNextEvent=!1;else if(a.preventManipulation&&a.preventManipulation(),a.preventDefault&&a.preventDefault(),!d){if(!u.capturedEventParam&&
|
|
this._events){for(var g=0;g<this._events.length;g++)if(this._events[g].hasOwnProperty(b))if(c=this._events[g],d=c.bounds,f.x>=d.x1&&f.x<=d.x2&&f.y>=d.y1&&f.y<=d.y2){c[b].call(c.context,f.x,f.y);"mousedown"===b&&!0===c.capture?(u.capturedEventParam=c,this.overlaidCanvas.setCapture?this.overlaidCanvas.setCapture():document.documentElement.addEventListener("mouseup",this._mouseEventHandler,!1)):"mouseup"===b&&(c.chart.overlaidCanvas.releaseCapture?c.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEventListener("mouseup",
|
|
this._mouseEventHandler,!1));break}else c=null;a.target.style.cursor=c&&c.cursor?c.cursor:this._defaultCursor}b=this.plotArea;if(f.x<b.x1||f.x>b.x2||f.y<b.y1||f.y>b.y2)this.toolTip&&this.toolTip.enabled?this.toolTip.hide():this.resetOverlayedCanvas();this.isDrag&&this.zoomEnabled||!this._eventManager||this._eventManager.mouseEventHandler(a)}};u.prototype._plotAreaMouseDown=function(a,f){this.isDrag=!0;this.dragStartPoint={x:a,y:f}};u.prototype._plotAreaMouseUp=function(a,f){if(("normal"===this.plotInfo.axisPlacement||
|
|
"xySwapped"===this.plotInfo.axisPlacement)&&this.isDrag){var b=f-this.dragStartPoint.y,c=a-this.dragStartPoint.x,d=0<=this.zoomType.indexOf("x"),g=0<=this.zoomType.indexOf("y"),k=!1;this.resetOverlayedCanvas();if("xySwapped"===this.plotInfo.axisPlacement)var l=g,g=d,d=l;if(this.panEnabled||this.zoomEnabled){if(this.panEnabled)for(d=g=0;d<this._axes.length;d++)b=this._axes[d],b.logarithmic?b.viewportMinimum<b.minimum?(g=b.minimum/b.viewportMinimum,b.sessionVariables.newViewportMinimum=b.viewportMinimum*
|
|
g,b.sessionVariables.newViewportMaximum=b.viewportMaximum*g,k=!0):b.viewportMaximum>b.maximum&&(g=b.viewportMaximum/b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum/g,b.sessionVariables.newViewportMaximum=b.viewportMaximum/g,k=!0):b.viewportMinimum<b.minimum?(g=b.minimum-b.viewportMinimum,b.sessionVariables.newViewportMinimum=b.viewportMinimum+g,b.sessionVariables.newViewportMaximum=b.viewportMaximum+g,k=!0):b.viewportMaximum>b.maximum&&(g=b.viewportMaximum-b.maximum,b.sessionVariables.newViewportMinimum=
|
|
b.viewportMinimum-g,b.sessionVariables.newViewportMaximum=b.viewportMaximum-g,k=!0);else if((!d||2<Math.abs(c))&&(!g||2<Math.abs(b))&&this.zoomEnabled){if(!this.dragStartPoint)return;b=d?this.dragStartPoint.x:this.plotArea.x1;c=g?this.dragStartPoint.y:this.plotArea.y1;d=d?a:this.plotArea.x2;g=g?f:this.plotArea.y2;2<Math.abs(b-d)&&2<Math.abs(c-g)&&this._zoomPanToSelectedRegion(b,c,d,g)&&(k=!0)}k&&(this._ignoreNextEvent=!0,this._dispatchRangeEvent("rangeChanging","zoom"),this.render(),this._dispatchRangeEvent("rangeChanged",
|
|
"zoom"),k&&(this.zoomEnabled&&"none"===this._zoomButton.style.display)&&(Ka(this._zoomButton,this._resetButton),ua(this,this._zoomButton,"pan"),ua(this,this._resetButton,"reset")))}}this.isDrag=!1;if("none"!==this.plotInfo.axisPlacement){this.resetOverlayedCanvas();if(this.axisX&&0<this.axisX.length)for(k=0;k<this.axisX.length;k++)this.axisX[k].crosshair&&this.axisX[k].crosshair.enabled&&this.axisX[k].renderCrosshair(a,f);if(this.axisX2&&0<this.axisX2.length)for(k=0;k<this.axisX2.length;k++)this.axisX2[k].crosshair&&
|
|
this.axisX2[k].crosshair.enabled&&this.axisX2[k].renderCrosshair(a,f);if(this.axisY&&0<this.axisY.length)for(k=0;k<this.axisY.length;k++)this.axisY[k].crosshair&&this.axisY[k].crosshair.enabled&&this.axisY[k].renderCrosshair(a,f);if(this.axisY2&&0<this.axisY2.length)for(k=0;k<this.axisY2.length;k++)this.axisY2[k].crosshair&&this.axisY2[k].crosshair.enabled&&this.axisY2[k].renderCrosshair(a,f)}};u.prototype._plotAreaMouseMove=function(a,f){if(this.isDrag&&"none"!==this.plotInfo.axisPlacement){var b=
|
|
0,c=0,d=b=null,d=0<=this.zoomType.indexOf("x"),g=0<=this.zoomType.indexOf("y"),k=this;"xySwapped"===this.plotInfo.axisPlacement&&(b=g,g=d,d=b);b=this.dragStartPoint.x-a;c=this.dragStartPoint.y-f;2<Math.abs(b)&&8>Math.abs(b)&&(this.panEnabled||this.zoomEnabled)?this.toolTip.hide():this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,f);if((!d||2<Math.abs(b)||!g||2<Math.abs(c))&&(this.panEnabled||this.zoomEnabled))if(this.panEnabled)d={x1:d?this.plotArea.x1+b:this.plotArea.x1,y1:g?this.plotArea.y1+
|
|
c:this.plotArea.y1,x2:d?this.plotArea.x2+b:this.plotArea.x2,y2:g?this.plotArea.y2+c:this.plotArea.y2},clearTimeout(k._panTimerId),k._panTimerId=setTimeout(function(c,b,d,e){return function(){k._zoomPanToSelectedRegion(c,b,d,e,!0)&&(k._dispatchRangeEvent("rangeChanging","pan"),k.render(),k._dispatchRangeEvent("rangeChanged","pan"),k.dragStartPoint.x=a,k.dragStartPoint.y=f)}}(d.x1,d.y1,d.x2,d.y2),0);else if(this.zoomEnabled){this.resetOverlayedCanvas();b=this.overlaidCanvasCtx.globalAlpha;this.overlaidCanvasCtx.fillStyle=
|
|
"#A89896";var c=d?this.dragStartPoint.x:this.plotArea.x1,l=g?this.dragStartPoint.y:this.plotArea.y1,n=d?a-this.dragStartPoint.x:this.plotArea.x2-this.plotArea.x1,h=g?f-this.dragStartPoint.y:this.plotArea.y2-this.plotArea.y1;this.validateRegion(c,l,d?a:this.plotArea.x2-this.plotArea.x1,g?f:this.plotArea.y2-this.plotArea.y1,"xy"!==this.zoomType).isValid&&(this.resetOverlayedCanvas(),this.overlaidCanvasCtx.fillStyle="#99B2B5");this.overlaidCanvasCtx.globalAlpha=0.7;this.overlaidCanvasCtx.fillRect(c,
|
|
l,n,h);this.overlaidCanvasCtx.globalAlpha=b}}else if(this.toolTip.mouseMoveHandler(a,f),"none"!==this.plotInfo.axisPlacement){if(this.axisX&&0<this.axisX.length)for(d=0;d<this.axisX.length;d++)this.axisX[d].crosshair&&this.axisX[d].crosshair.enabled&&this.axisX[d].renderCrosshair(a,f);if(this.axisX2&&0<this.axisX2.length)for(d=0;d<this.axisX2.length;d++)this.axisX2[d].crosshair&&this.axisX2[d].crosshair.enabled&&this.axisX2[d].renderCrosshair(a,f);if(this.axisY&&0<this.axisY.length)for(d=0;d<this.axisY.length;d++)this.axisY[d].crosshair&&
|
|
this.axisY[d].crosshair.enabled&&this.axisY[d].renderCrosshair(a,f);if(this.axisY2&&0<this.axisY2.length)for(d=0;d<this.axisY2.length;d++)this.axisY2[d].crosshair&&this.axisY2[d].crosshair.enabled&&this.axisY2[d].renderCrosshair(a,f)}};u.prototype._zoomPanToSelectedRegion=function(a,f,b,c,d){a=this.validateRegion(a,f,b,c,d);f=a.axesWithValidRange;b=a.axesRanges;if(a.isValid)for(c=0;c<f.length;c++)d=b[c],f[c].setViewPortRange(d.val1,d.val2);return a.isValid};u.prototype.validateRegion=function(a,f,
|
|
b,c,d){d=d||!1;for(var g=0<=this.zoomType.indexOf("x"),k=0<=this.zoomType.indexOf("y"),l=!1,n=[],h=[],r=[],p=0;p<this._axes.length;p++)("axisX"===this._axes[p].type&&g||"axisY"===this._axes[p].type&&k)&&h.push(this._axes[p]);for(k=0;k<h.length;k++){var p=h[k],g=!1,m=p.convertPixelToValue({x:a,y:f}),e=p.convertPixelToValue({x:b,y:c});if(m>e)var t=e,e=m,m=t;if(p.scaleBreaks)for(t=0;!g&&t<p.scaleBreaks._appliedBreaks.length;t++)g=p.scaleBreaks._appliedBreaks[t].startValue<=m&&p.scaleBreaks._appliedBreaks[t].endValue>=
|
|
e;if(isFinite(p.dataInfo.minDiff))if(t=p.getAppearentDifferceReplacingBreaksToSize(m,e,null,!0),!(g||!(this.panEnabled&&p.scaleBreaks&&p.scaleBreaks._appliedBreaks.length)&&(p.logarithmic&&t<Math.pow(p.dataInfo.minDiff,3)||!p.logarithmic&&t<3*Math.abs(p.dataInfo.minDiff))||m<p.minimum||e>p.maximum))n.push(p),r.push({val1:m,val2:e}),l=!0;else if(!d){l=!1;break}}return{isValid:l,axesWithValidRange:n,axesRanges:r}};u.prototype.preparePlotArea=function(){var a=this.plotArea;!w&&(0<a.x1||0<a.y1)&&a.ctx.translate(a.x1,
|
|
a.y1);if((this.axisX[0]||this.axisX2[0])&&(this.axisY[0]||this.axisY2[0])){var f=this.axisX[0]?this.axisX[0].lineCoordinates:this.axisX2[0].lineCoordinates;if(this.axisY&&0<this.axisY.length&&this.axisY[0]){var b=this.axisY[0];a.x1=f.x1<f.x2?f.x1:b.lineCoordinates.x1;a.y1=f.y1<b.lineCoordinates.y1?f.y1:b.lineCoordinates.y1;a.x2=f.x2>b.lineCoordinates.x2?f.x2:b.lineCoordinates.x2;a.y2=f.y2>f.y1?f.y2:b.lineCoordinates.y2;a.width=a.x2-a.x1;a.height=a.y2-a.y1}this.axisY2&&0<this.axisY2.length&&this.axisY2[0]&&
|
|
(b=this.axisY2[0],a.x1=f.x1<f.x2?f.x1:b.lineCoordinates.x1,a.y1=f.y1<b.lineCoordinates.y1?f.y1:b.lineCoordinates.y1,a.x2=f.x2>b.lineCoordinates.x2?f.x2:b.lineCoordinates.x2,a.y2=f.y2>f.y1?f.y2:b.lineCoordinates.y2,a.width=a.x2-a.x1,a.height=a.y2-a.y1)}else f=this.layoutManager.getFreeSpace(),a.x1=f.x1,a.x2=f.x2,a.y1=f.y1,a.y2=f.y2,a.width=f.width,a.height=f.height;w||(a.canvas.width=a.width,a.canvas.height=a.height,a.canvas.style.left=a.x1+"px",a.canvas.style.top=a.y1+"px",(0<a.x1||0<a.y1)&&a.ctx.translate(-a.x1,
|
|
-a.y1));a.layoutManager=new Ba(a.x1,a.y1,a.x2,a.y2,2)};u.prototype.renderIndexLabels=function(a){var f=a||this.plotArea.ctx,b=this.plotArea,c=0,d=0,g=0,k=0,l=c=k=d=g=0,n=0;for(a=0;a<this._indexLabels.length;a++){var h=this._indexLabels[a],r=h.chartType.toLowerCase(),p,m,l=ja("indexLabelFontColor",h.dataPoint,h.dataSeries),n=ja("indexLabelFontSize",h.dataPoint,h.dataSeries);p=ja("indexLabelFontFamily",h.dataPoint,h.dataSeries);m=ja("indexLabelFontStyle",h.dataPoint,h.dataSeries);var k=ja("indexLabelFontWeight",
|
|
h.dataPoint,h.dataSeries),e=ja("indexLabelBackgroundColor",h.dataPoint,h.dataSeries),d=ja("indexLabelMaxWidth",h.dataPoint,h.dataSeries),g=ja("indexLabelWrap",h.dataPoint,h.dataSeries),t=ja("indexLabelLineDashType",h.dataPoint,h.dataSeries),q=ja("indexLabelLineColor",h.dataPoint,h.dataSeries),C=x(h.dataPoint.indexLabelLineThickness)?x(h.dataSeries.options.indexLabelLineThickness)?0:h.dataSeries.options.indexLabelLineThickness:h.dataPoint.indexLabelLineThickness,c=0<C?Math.min(10,("normal"===this.plotInfo.axisPlacement?
|
|
this.plotArea.height:this.plotArea.width)<<0):0,v={percent:null,total:null},E=null;if(0<=h.dataSeries.type.indexOf("stacked")||"pie"===h.dataSeries.type||"doughnut"===h.dataSeries.type)v=this.getPercentAndTotal(h.dataSeries,h.dataPoint);if(h.dataSeries.indexLabelFormatter||h.dataPoint.indexLabelFormatter)E={chart:this,dataSeries:h.dataSeries,dataPoint:h.dataPoint,index:h.indexKeyword,total:v.total,percent:v.percent};var G=h.dataPoint.indexLabelFormatter?h.dataPoint.indexLabelFormatter(E):h.dataPoint.indexLabel?
|
|
this.replaceKeywordsWithValue(h.dataPoint.indexLabel,h.dataPoint,h.dataSeries,null,h.indexKeyword):h.dataSeries.indexLabelFormatter?h.dataSeries.indexLabelFormatter(E):h.dataSeries.indexLabel?this.replaceKeywordsWithValue(h.dataSeries.indexLabel,h.dataPoint,h.dataSeries,null,h.indexKeyword):null;if(null!==G&&""!==G){var v=ja("indexLabelPlacement",h.dataPoint,h.dataSeries),E=ja("indexLabelOrientation",h.dataPoint,h.dataSeries),u=h.direction,s=h.dataSeries.axisX,A=h.dataSeries.axisY,oa=!1,e=new ka(f,
|
|
{x:0,y:0,maxWidth:d?d:0.5*this.width,maxHeight:g?5*n:1.5*n,angle:"horizontal"===E?0:-90,text:G,padding:0,backgroundColor:e,horizontalAlign:"left",fontSize:n,fontFamily:p,fontWeight:k,fontColor:l,fontStyle:m,textBaseline:"top"});e.measureText();h.dataSeries.indexLabelMaxWidth=e.maxWidth;if("stackedarea100"===r){if(h.point.x<b.x1||h.point.x>b.x2||h.point.y<b.y1-1||h.point.y>b.y2+1)continue}else if("rangearea"===r||"rangesplinearea"===r){if(h.dataPoint.x<s.viewportMinimum||h.dataPoint.x>s.viewportMaximum||
|
|
Math.max.apply(null,h.dataPoint.y)<A.viewportMinimum||Math.min.apply(null,h.dataPoint.y)>A.viewportMaximum)continue}else if(0<=r.indexOf("line")||0<=r.indexOf("area")||0<=r.indexOf("bubble")||0<=r.indexOf("scatter")){if(h.dataPoint.x<s.viewportMinimum||h.dataPoint.x>s.viewportMaximum||h.dataPoint.y<A.viewportMinimum||h.dataPoint.y>A.viewportMaximum)continue}else if(0<=r.indexOf("column")||"waterfall"===r||"error"===r&&!h.axisSwapped){if(h.dataPoint.x<s.viewportMinimum||h.dataPoint.x>s.viewportMaximum||
|
|
h.bounds.y1>b.y2||h.bounds.y2<b.y1)continue}else if(0<=r.indexOf("bar")||"error"===r){if(h.dataPoint.x<s.viewportMinimum||h.dataPoint.x>s.viewportMaximum||h.bounds.x1>b.x2||h.bounds.x2<b.x1)continue}else if("candlestick"===r||"ohlc"===r){if(h.dataPoint.x<s.viewportMinimum||h.dataPoint.x>s.viewportMaximum||Math.max.apply(null,h.dataPoint.y)<A.viewportMinimum||Math.min.apply(null,h.dataPoint.y)>A.viewportMaximum)continue}else if(h.dataPoint.x<s.viewportMinimum||h.dataPoint.x>s.viewportMaximum)continue;
|
|
d=k=2;"horizontal"===E?(l=e.width,n=e.height):(n=e.width,l=e.height);if("normal"===this.plotInfo.axisPlacement){if(0<=r.indexOf("line")||0<=r.indexOf("area"))v="auto",k=4;else if(0<=r.indexOf("stacked"))"auto"===v&&(v="inside");else if("bubble"===r||"scatter"===r)v="inside";p=h.point.x-l/2;"inside"!==v?(d=b.y1,g=b.y2,0<u?(m=h.point.y-n-k-c,m<d&&(m="auto"===v?Math.max(h.point.y,d)+k+c:d+k+c,oa=m+n>h.point.y)):(m=h.point.y+k+c,m>g-n-k-c&&(m="auto"===v?Math.min(h.point.y,g)-n-k-c:g-n-k-c,oa=m<h.point.y))):
|
|
(d=Math.max(h.bounds.y1,b.y1),g=Math.min(h.bounds.y2,b.y2),c=0<=r.indexOf("range")||"error"===r?0<u?Math.max(h.bounds.y1,b.y1)+n/2+k:Math.min(h.bounds.y2,b.y2)-n/2-k:(Math.max(h.bounds.y1,b.y1)+Math.min(h.bounds.y2,b.y2))/2,0<u?(m=Math.max(h.point.y,c)-n/2,m<d&&("bubble"===r||"scatter"===r)&&(m=Math.max(h.point.y-n-k,b.y1+k))):(m=Math.min(h.point.y,c)-n/2,m>g-n-k&&("bubble"===r||"scatter"===r)&&(m=Math.min(h.point.y+k,b.y2-n-k))),m=Math.min(m,g-n))}else 0<=r.indexOf("line")||0<=r.indexOf("area")||
|
|
0<=r.indexOf("scatter")?(v="auto",d=4):0<=r.indexOf("stacked")?"auto"===v&&(v="inside"):"bubble"===r&&(v="inside"),m=h.point.y-n/2,"inside"!==v?(k=b.x1,g=b.x2,0>u?(p=h.point.x-l-d-c,p<k&&(p="auto"===v?Math.max(h.point.x,k)+d+c:k+d+c,oa=p+l>h.point.x)):(p=h.point.x+d+c,p>g-l-d-c&&(p="auto"===v?Math.min(h.point.x,g)-l-d-c:g-l-d-c,oa=p<h.point.x))):(k=Math.max(h.bounds.x1,b.x1),Math.min(h.bounds.x2,b.x2),c=0<=r.indexOf("range")||"error"===r?0>u?Math.max(h.bounds.x1,b.x1)+l/2+d:Math.min(h.bounds.x2,b.x2)-
|
|
l/2-d:(Math.max(h.bounds.x1,b.x1)+Math.min(h.bounds.x2,b.x2))/2,p=0>u?Math.max(h.point.x,c)-l/2:Math.min(h.point.x,c)-l/2,p=Math.max(p,k));"vertical"===E&&(m+=n);e.x=p;e.y=m;e.render(!0);C&&("inside"!==v&&(0>r.indexOf("bar")&&("error"!==r||!h.axisSwapped)&&h.point.x>b.x1&&h.point.x<b.x2||!oa)&&(0>r.indexOf("column")&&("error"!==r||h.axisSwapped)&&h.point.y>b.y1&&h.point.y<b.y2||!oa))&&(f.lineWidth=C,f.strokeStyle=q?q:"gray",f.setLineDash&&f.setLineDash(F(t,C)),f.beginPath(),f.moveTo(h.point.x,h.point.y),
|
|
0<=r.indexOf("bar")||"error"===r&&h.axisSwapped?f.lineTo(p+(0<h.direction?0:l),m+("horizontal"===E?n:-n)/2):0<=r.indexOf("column")||"error"===r&&!h.axisSwapped?f.lineTo(p+l/2,m+((0<h.direction?n:-n)+("horizontal"===E?n:-n))/2):f.lineTo(p+l/2,m+((m<h.point.y?n:-n)+("horizontal"===E?n:-n))/2),f.stroke())}}f={source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0,startTimePercent:0.7};for(a=0;a<this._indexLabels.length;a++)h=this._indexLabels[a],
|
|
e=ja("indexLabelBackgroundColor",h.dataPoint,h.dataSeries),h.dataSeries.indexLabelBackgroundColor=x(e)?w?"transparent":null:e;return f};u.prototype.renderLine=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;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 g=[],k,l=0;l<a.dataSeriesIndexes.length;l++){var n=a.dataSeriesIndexes[l],h=this.data[n];b.lineWidth=
|
|
h.lineThickness;var r=h.dataPoints,p="solid";if(b.setLineDash){var m=F(h.nullDataLineDashType,h.lineThickness),p=h.lineDashType,e=F(p,h.lineThickness);b.setLineDash(e)}var t=h.id;this._eventManager.objectMap[t]={objectType:"dataSeries",dataSeriesIndex:n};t=W(t);c.strokeStyle=t;c.lineWidth=0<h.lineThickness?Math.max(h.lineThickness,4):0;var t=h._colorSet,q=t=h.lineColor=h.options.lineColor?h.options.lineColor:t[0];b.strokeStyle=t;var C=!0,v=0,E,G;b.beginPath();if(0<r.length){for(var u=!1,v=0;v<r.length;v++)if(E=
|
|
r[v].x.getTime?r[v].x.getTime():r[v].x,!(E<a.axisX.dataInfo.viewPortMin||E>a.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!u)))if("number"!==typeof r[v].y)0<v&&!(h.connectNullData||u||C)&&(b.stroke(),w&&c.stroke()),u=!0;else{E=a.axisX.convertValueToPixel(E);G=a.axisY.convertValueToPixel(r[v].y);var s=h.dataPointIds[v];this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:v,x1:E,y1:G};C||u?(!C&&h.connectNullData?(b.setLineDash&&(h.options.nullDataLineDashType||
|
|
p===h.lineDashType&&h.lineDashType!==h.nullDataLineDashType)&&(b.stroke(),b.beginPath(),b.moveTo(k.x,k.y),p=h.nullDataLineDashType,b.setLineDash(m)),b.lineTo(E,G),w&&c.lineTo(E,G)):(b.beginPath(),b.moveTo(E,G),w&&(c.beginPath(),c.moveTo(E,G))),u=C=!1):(b.lineTo(E,G),w&&c.lineTo(E,G),0==v%500&&(b.stroke(),b.beginPath(),b.moveTo(E,G),w&&(c.stroke(),c.beginPath(),c.moveTo(E,G))));k={x:E,y:G};v<r.length-1&&(q!==(r[v].lineColor||t)||p!==(r[v].lineDashType||h.lineDashType))&&(b.stroke(),b.beginPath(),b.moveTo(E,
|
|
G),q=r[v].lineColor||t,b.strokeStyle=q,b.setLineDash&&(r[v].lineDashType?(p=r[v].lineDashType,b.setLineDash(F(p,h.lineThickness))):(p=h.lineDashType,b.setLineDash(e))));if(0<r[v].markerSize||0<h.markerSize){var A=h.getMarkerProperties(v,E,G,b);g.push(A);s=W(s);w&&g.push({x:E,y:G,ctx:c,type:A.type,size:A.size,color:s,borderColor:s,borderThickness:A.borderThickness})}(r[v].indexLabel||h.indexLabel||r[v].indexLabelFormatter||h.indexLabelFormatter)&&this._indexLabels.push({chartType:"line",dataPoint:r[v],
|
|
dataSeries:h,point:{x:E,y:G},direction:0>r[v].y===a.axisY.reversed?1:-1,color:t})}b.stroke();w&&c.stroke()}}aa.drawMarkers(g);w&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(d.x1,
|
|
d.y1,d.width,d.height),c.beginPath());b.restore();b.beginPath();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderStepLine=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;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 g=[],k,l=0;l<a.dataSeriesIndexes.length;l++){var n=
|
|
a.dataSeriesIndexes[l],h=this.data[n];b.lineWidth=h.lineThickness;var r=h.dataPoints,p="solid";if(b.setLineDash){var m=F(h.nullDataLineDashType,h.lineThickness),p=h.lineDashType,e=F(p,h.lineThickness);b.setLineDash(e)}var t=h.id;this._eventManager.objectMap[t]={objectType:"dataSeries",dataSeriesIndex:n};t=W(t);c.strokeStyle=t;c.lineWidth=0<h.lineThickness?Math.max(h.lineThickness,4):0;var t=h._colorSet,q=t=h.lineColor=h.options.lineColor?h.options.lineColor:t[0];b.strokeStyle=t;var C=!0,v=0,E,G;b.beginPath();
|
|
if(0<r.length){for(var u=!1,v=0;v<r.length;v++)if(E=r[v].getTime?r[v].x.getTime():r[v].x,!(E<a.axisX.dataInfo.viewPortMin||E>a.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!u)))if("number"!==typeof r[v].y)0<v&&!(h.connectNullData||u||C)&&(b.stroke(),w&&c.stroke()),u=!0;else{var s=G;E=a.axisX.convertValueToPixel(E);G=a.axisY.convertValueToPixel(r[v].y);var A=h.dataPointIds[v];this._eventManager.objectMap[A]={id:A,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:v,x1:E,y1:G};C||u?(!C&&h.connectNullData?
|
|
(b.setLineDash&&(h.options.nullDataLineDashType||p===h.lineDashType&&h.lineDashType!==h.nullDataLineDashType)&&(b.stroke(),b.beginPath(),b.moveTo(k.x,k.y),p=h.nullDataLineDashType,b.setLineDash(m)),b.lineTo(E,s),b.lineTo(E,G),w&&(c.lineTo(E,s),c.lineTo(E,G))):(b.beginPath(),b.moveTo(E,G),w&&(c.beginPath(),c.moveTo(E,G))),u=C=!1):(b.lineTo(E,s),w&&c.lineTo(E,s),b.lineTo(E,G),w&&c.lineTo(E,G),0==v%500&&(b.stroke(),b.beginPath(),b.moveTo(E,G),w&&(c.stroke(),c.beginPath(),c.moveTo(E,G))));k={x:E,y:G};
|
|
v<r.length-1&&(q!==(r[v].lineColor||t)||p!==(r[v].lineDashType||h.lineDashType))&&(b.stroke(),b.beginPath(),b.moveTo(E,G),q=r[v].lineColor||t,b.strokeStyle=q,b.setLineDash&&(r[v].lineDashType?(p=r[v].lineDashType,b.setLineDash(F(p,h.lineThickness))):(p=h.lineDashType,b.setLineDash(e))));if(0<r[v].markerSize||0<h.markerSize)s=h.getMarkerProperties(v,E,G,b),g.push(s),A=W(A),w&&g.push({x:E,y:G,ctx:c,type:s.type,size:s.size,color:A,borderColor:A,borderThickness:s.borderThickness});(r[v].indexLabel||h.indexLabel||
|
|
r[v].indexLabelFormatter||h.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepLine",dataPoint:r[v],dataSeries:h,point:{x:E,y:G},direction:0>r[v].y===a.axisY.reversed?1:-1,color:t})}b.stroke();w&&c.stroke()}}aa.drawMarkers(g);w&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),
|
|
this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(d.x1,d.y1,d.width,d.height),c.beginPath());b.restore();b.beginPath();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderSpline=function(a){function f(a){a=y(a,2);if(0<a.length){c.beginPath();w&&d.beginPath();c.moveTo(a[0].x,a[0].y);a[0].newStrokeStyle&&(c.strokeStyle=a[0].newStrokeStyle);a[0].newLineDashArray&&
|
|
c.setLineDash(a[0].newLineDashArray);w&&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),w&&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),a[b+3].newLineDashArray&&c.setLineDash(a[b+3].newLineDashArray),w&&(d.stroke(),d.beginPath(),
|
|
d.moveTo(a[b+3].x,a[b+3].y));c.stroke();w&&d.stroke()}}var b=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:b;if(!(0>=a.dataSeriesIndexes.length)){var d=this._eventManager.ghostCtx;c.save();var g=this.plotArea;c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();for(var k=[],l=0;l<a.dataSeriesIndexes.length;l++){var n=a.dataSeriesIndexes[l],h=this.data[n];c.lineWidth=h.lineThickness;var r=h.dataPoints,p="solid";if(c.setLineDash){var m=F(h.nullDataLineDashType,h.lineThickness),p=
|
|
h.lineDashType,e=F(p,h.lineThickness);c.setLineDash(e)}var t=h.id;this._eventManager.objectMap[t]={objectType:"dataSeries",dataSeriesIndex:n};t=W(t);d.strokeStyle=t;d.lineWidth=0<h.lineThickness?Math.max(h.lineThickness,4):0;var t=h._colorSet,q=t=h.lineColor=h.options.lineColor?h.options.lineColor:t[0];c.strokeStyle=t;var C=0,v,E,G=[];c.beginPath();if(0<r.length)for(E=!1,C=0;C<r.length;C++)if(v=r[C].getTime?r[C].x.getTime():r[C].x,!(v<a.axisX.dataInfo.viewPortMin||v>a.axisX.dataInfo.viewPortMax&&
|
|
(!h.connectNullData||!E)))if("number"!==typeof r[C].y)0<C&&!E&&(h.connectNullData?c.setLineDash&&(0<G.length&&(h.options.nullDataLineDashType||!r[C-1].lineDashType))&&(G[G.length-1].newLineDashArray=m,p=h.nullDataLineDashType):(f(G),G=[])),E=!0;else{v=a.axisX.convertValueToPixel(v);E=a.axisY.convertValueToPixel(r[C].y);var u=h.dataPointIds[C];this._eventManager.objectMap[u]={id:u,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:C,x1:v,y1:E};G[G.length]={x:v,y:E};C<r.length-1&&(q!==(r[C].lineColor||
|
|
t)||p!==(r[C].lineDashType||h.lineDashType))&&(q=r[C].lineColor||t,G[G.length-1].newStrokeStyle=q,c.setLineDash&&(r[C].lineDashType?(p=r[C].lineDashType,G[G.length-1].newLineDashArray=F(p,h.lineThickness)):(p=h.lineDashType,G[G.length-1].newLineDashArray=e)));if(0<r[C].markerSize||0<h.markerSize){var s=h.getMarkerProperties(C,v,E,c);k.push(s);u=W(u);w&&k.push({x:v,y:E,ctx:d,type:s.type,size:s.size,color:u,borderColor:u,borderThickness:s.borderThickness})}(r[C].indexLabel||h.indexLabel||r[C].indexLabelFormatter||
|
|
h.indexLabelFormatter)&&this._indexLabels.push({chartType:"spline",dataPoint:r[C],dataSeries:h,point:{x:v,y:E},direction:0>r[C].y===a.axisY.reversed?1:-1,color:t});E=!1}f(G)}aa.drawMarkers(k);w&&(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(g.x1,g.y1,g.width,g.height),d.beginPath());c.restore();c.beginPath();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};var Y=function(a,f,b,c,d,g,k,l,n,h,r,p,m){"undefined"===typeof m&&(m=1);k=k||0;l=l||"black";var e=15<c-f&&15<d-b?8:0.35*Math.min(c-f,d-b);a.beginPath();a.moveTo(f,b);a.save();a.fillStyle=g;a.globalAlpha=m;a.fillRect(f,b,c-f,d-b);a.globalAlpha=1;0<k&&(m=0===k%2?0:0.5,a.beginPath(),
|
|
a.lineWidth=k,a.strokeStyle=l,a.moveTo(f,b),a.rect(f-m,b-m,c-f+2*m,d-b+2*m),a.stroke());a.restore();!0===n&&(a.save(),a.beginPath(),a.moveTo(f,b),a.lineTo(f+e,b+e),a.lineTo(c-e,b+e),a.lineTo(c,b),a.closePath(),k=a.createLinearGradient((c+f)/2,b+e,(c+f)/2,b),k.addColorStop(0,g),k.addColorStop(1,"rgba(255, 255, 255, .4)"),a.fillStyle=k,a.fill(),a.restore());!0===h&&(a.save(),a.beginPath(),a.moveTo(f,d),a.lineTo(f+e,d-e),a.lineTo(c-e,d-e),a.lineTo(c,d),a.closePath(),k=a.createLinearGradient((c+f)/2,
|
|
d-e,(c+f)/2,d),k.addColorStop(0,g),k.addColorStop(1,"rgba(255, 255, 255, .4)"),a.fillStyle=k,a.fill(),a.restore());!0===r&&(a.save(),a.beginPath(),a.moveTo(f,b),a.lineTo(f+e,b+e),a.lineTo(f+e,d-e),a.lineTo(f,d),a.closePath(),k=a.createLinearGradient(f+e,(d+b)/2,f,(d+b)/2),k.addColorStop(0,g),k.addColorStop(1,"rgba(255, 255, 255, 0.1)"),a.fillStyle=k,a.fill(),a.restore());!0===p&&(a.save(),a.beginPath(),a.moveTo(c,b),a.lineTo(c-e,b+e),a.lineTo(c-e,d-e),a.lineTo(c,d),k=a.createLinearGradient(c-e,(d+
|
|
b)/2,c,(d+b)/2),k.addColorStop(0,g),k.addColorStop(1,"rgba(255, 255, 255, 0.1)"),a.fillStyle=k,k.addColorStop(0,g),k.addColorStop(1,"rgba(255, 255, 255, 0.1)"),a.fillStyle=k,a.fill(),a.closePath(),a.restore())};u.prototype.renderColumn=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=0,k,l,n,h=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),g=this.dataPointMinWidth=this.dataPointMinWidth?
|
|
this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,r=this.dataPointMaxWidth=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.width,0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth=this.dataPointWidth?this.dataPointWidth:0.9*(d.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<
|
|
0;this.dataPointMaxWidth&&g>r&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&r<g)&&(r=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,g));p<g&&(p=g);p>r&&(p=r);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(r=0;r<a.dataSeriesIndexes.length;r++){var m=
|
|
a.dataSeriesIndexes[r],e=this.data[m],t=e.dataPoints;if(0<t.length)for(var q=5<p&&e.bevelEnabled?!0:!1,g=0;g<t.length;g++)if(t[g].getTime?n=t[g].x.getTime():n=t[g].x,!(n<a.axisX.dataInfo.viewPortMin||n>a.axisX.dataInfo.viewPortMax)&&"number"===typeof t[g].y){k=a.axisX.convertValueToPixel(n);l=a.axisY.convertValueToPixel(t[g].y);k=a.axisX.reversed?k+a.plotType.totalDataSeries*p/2-(a.previousDataSeriesCount+r)*p<<0:k-a.plotType.totalDataSeries*p/2+(a.previousDataSeriesCount+r)*p<<0;var C=a.axisX.reversed?
|
|
k-p<<0:k+p<<0,v;0<=t[g].y?v=h:(v=l,l=h);l>v&&(c=l,l=v,v=c);c=t[g].color?t[g].color:e._colorSet[g%e._colorSet.length];Y(b,k,l,C,v,c,0,null,q&&0<=t[g].y,0>t[g].y&&q,!1,!1,e.fillOpacity);c=e.dataPointIds[g];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:g,x1:k,y1:l,x2:C,y2:v};c=W(c);w&&Y(this._eventManager.ghostCtx,k,l,C,v,c,0,null,!1,!1,!1,!1);(t[g].indexLabel||e.indexLabel||t[g].indexLabelFormatter||e.indexLabelFormatter)&&this._indexLabels.push({chartType:"column",
|
|
dataPoint:t[g],dataSeries:e,point:{x:k+(C-k)/2,y:0>t[g].y===a.axisY.reversed?l:v},direction:0>t[g].y===a.axisY.reversed?1:-1,bounds:{x1:k,y1:Math.min(l,v),x2:C,y2:Math.max(l,v)},color:c})}}w&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,
|
|
0,0,this.width,this.height),b.clearRect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.yScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:h<a.axisY.bounds.y1?a.axisY.bounds.y1:h>a.axisY.bounds.y2?a.axisY.bounds.y2:h}}};u.prototype.renderStackedColumn=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,
|
|
g=[],k=[],l=[],n=[],h=0,r,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;r=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0;var e=a.axisX.dataInfo.minDiff;isFinite(e)||(e=0.3*Math.abs(a.axisX.range));e=this.dataPointWidth?this.dataPointWidth:0.9*(d.width*(a.axisX.logarithmic?Math.log(e)/Math.log(a.axisX.range):Math.abs(e)/
|
|
Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>r&&(h=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&r<h)&&(r=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,h));e<h&&(e=h);e>r&&(e=r);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),
|
|
this._eventManager.ghostCtx.clip());for(var t=0;t<a.dataSeriesIndexes.length;t++){var q=a.dataSeriesIndexes[t],C=this.data[q],v=C.dataPoints;if(0<v.length){var E=5<e&&C.bevelEnabled?!0:!1;b.strokeStyle="#4572A7 ";for(h=0;h<v.length;h++)if(c=v[h].x.getTime?v[h].x.getTime():v[h].x,!(c<a.axisX.dataInfo.viewPortMin||c>a.axisX.dataInfo.viewPortMax)&&"number"===typeof v[h].y){r=a.axisX.convertValueToPixel(c);var G=r-a.plotType.plotUnits.length*e/2+a.index*e<<0,u=G+e<<0,s;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&
|
|
0<a.axisY.scaleBreaks._appliedBreaks.length&&0<v[h].y)l[c]=v[h].y+(l[c]?l[c]:0),0<l[c]&&(p=a.axisY.convertValueToPixel(l[c]),s="undefined"!==typeof g[c]?g[c]:m,g[c]=p);else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=v[h].y)n[c]=v[h].y+(n[c]?n[c]:0),s=a.axisY.convertValueToPixel(n[c]),p="undefined"!==typeof k[c]?k[c]:m,k[c]=s;else if(p=a.axisY.convertValueToPixel(v[h].y),0<=v[h].y){var x="undefined"!==typeof g[c]?g[c]:0;p-=x;s=m-x;g[c]=x+(s-p)}else x=k[c]?k[c]:0,s=p+x,
|
|
p=m+x,k[c]=x+(s-p);c=v[h].color?v[h].color:C._colorSet[h%C._colorSet.length];Y(b,G,p,u,s,c,0,null,E&&0<=v[h].y,0>v[h].y&&E,!1,!1,C.fillOpacity);c=C.dataPointIds[h];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:G,y1:p,x2:u,y2:s};c=W(c);w&&Y(this._eventManager.ghostCtx,G,p,u,s,c,0,null,!1,!1,!1,!1);(v[h].indexLabel||C.indexLabel||v[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn",dataPoint:v[h],dataSeries:C,
|
|
point:{x:r,y:0<=v[h].y?p:s},direction:0>v[h].y===a.axisY.reversed?1:-1,bounds:{x1:G,y1:Math.min(p,s),x2:u,y2:Math.max(p,s)},color:c})}}}w&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),
|
|
b.clearRect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.yScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:m<a.axisY.bounds.y1?a.axisY.bounds.y1:m>a.axisY.bounds.y2?a.axisY.bounds.y2:m}}};u.prototype.renderStackedColumn100=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=[],k=[],l=[],n=[],h=0,
|
|
r,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;r=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0;var e=a.axisX.dataInfo.minDiff;isFinite(e)||(e=0.3*Math.abs(a.axisX.range));e=this.dataPointWidth?this.dataPointWidth:0.9*(d.width*(a.axisX.logarithmic?Math.log(e)/Math.log(a.axisX.range):Math.abs(e)/Math.abs(a.axisX.range))/
|
|
a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>r&&(h=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&r<h)&&(r=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,h));e<h&&(e=h);e>r&&(e=r);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());
|
|
for(var t=0;t<a.dataSeriesIndexes.length;t++){var q=a.dataSeriesIndexes[t],C=this.data[q],v=C.dataPoints;if(0<v.length)for(var E=5<e&&C.bevelEnabled?!0:!1,h=0;h<v.length;h++)if(c=v[h].x.getTime?v[h].x.getTime():v[h].x,!(c<a.axisX.dataInfo.viewPortMin||c>a.axisX.dataInfo.viewPortMax)&&"number"===typeof v[h].y){r=a.axisX.convertValueToPixel(c);p=0!==a.dataPointYSums[c]?100*(v[h].y/a.dataPointYSums[c]):0;var G=r-a.plotType.plotUnits.length*e/2+a.index*e<<0,s=G+e<<0,u;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&
|
|
0<a.axisY.scaleBreaks._appliedBreaks.length&&0<v[h].y){l[c]=p+("undefined"!==typeof l[c]?l[c]:0);if(0>=l[c])continue;p=a.axisY.convertValueToPixel(l[c]);u=g[c]?g[c]:m;g[c]=p}else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=v[h].y)n[c]=p+("undefined"!==typeof n[c]?n[c]:0),u=a.axisY.convertValueToPixel(n[c]),p=k[c]?k[c]:m,k[c]=u;else if(p=a.axisY.convertValueToPixel(p),0<=v[h].y){var x="undefined"!==typeof g[c]?g[c]:0;p-=x;u=m-x;g[c]=x+(u-p)}else x="undefined"!==typeof k[c]?
|
|
k[c]:0,u=p+x,p=m+x,k[c]=x+(u-p);c=v[h].color?v[h].color:C._colorSet[h%C._colorSet.length];Y(b,G,p,s,u,c,0,null,E&&0<=v[h].y,0>v[h].y&&E,!1,!1,C.fillOpacity);c=C.dataPointIds[h];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:G,y1:p,x2:s,y2:u};c=W(c);w&&Y(this._eventManager.ghostCtx,G,p,s,u,c,0,null,!1,!1,!1,!1);(v[h].indexLabel||C.indexLabel||v[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn100",dataPoint:v[h],
|
|
dataSeries:C,point:{x:r,y:0<=v[h].y?p:u},direction:0>v[h].y===a.axisY.reversed?1:-1,bounds:{x1:G,y1:Math.min(p,u),x2:s,y2:Math.max(p,u)},color:c})}}w&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,
|
|
this.height),b.clearRect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.yScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:m<a.axisY.bounds.y1?a.axisY.bounds.y1:m>a.axisY.bounds.y2?a.axisY.bounds.y2:m}}};u.prototype.renderBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=0,k,l,n,h=a.axisY.convertValueToPixel(a.axisY.logarithmic?
|
|
a.axisY.viewportMinimum:0),g=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,r=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(d.height*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/
|
|
a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&g>r&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&r<g)&&(r=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,g));p<g&&(p=g);p>r&&(p=r);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());
|
|
for(r=0;r<a.dataSeriesIndexes.length;r++){var m=a.dataSeriesIndexes[r],e=this.data[m],t=e.dataPoints;if(0<t.length){var q=5<p&&e.bevelEnabled?!0:!1;b.strokeStyle="#4572A7 ";for(g=0;g<t.length;g++)if(t[g].getTime?n=t[g].x.getTime():n=t[g].x,!(n<a.axisX.dataInfo.viewPortMin||n>a.axisX.dataInfo.viewPortMax)&&"number"===typeof t[g].y){l=a.axisX.convertValueToPixel(n);k=a.axisY.convertValueToPixel(t[g].y);l=a.axisX.reversed?l+a.plotType.totalDataSeries*p/2-(a.previousDataSeriesCount+r)*p<<0:l-a.plotType.totalDataSeries*
|
|
p/2+(a.previousDataSeriesCount+r)*p<<0;var C=a.axisX.reversed?l-p<<0:l+p<<0,v;0<=t[g].y?v=h:(v=k,k=h);c=t[g].color?t[g].color:e._colorSet[g%e._colorSet.length];Y(b,v,l,k,C,c,0,null,q,!1,!1,!1,e.fillOpacity);c=e.dataPointIds[g];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:g,x1:v,y1:l,x2:k,y2:C};c=W(c);w&&Y(this._eventManager.ghostCtx,v,l,k,C,c,0,null,!1,!1,!1,!1);(t[g].indexLabel||e.indexLabel||t[g].indexLabelFormatter||e.indexLabelFormatter)&&this._indexLabels.push({chartType:"bar",
|
|
dataPoint:t[g],dataSeries:e,point:{x:0<=t[g].y?k:v,y:l+(C-l)/2},direction:0>t[g].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(v,k),y1:l,x2:Math.max(v,k),y2:C},color:c})}}}w&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,
|
|
0,0,this.width,this.height),b.clearRect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:h<a.axisY.bounds.x1?a.axisY.bounds.x1:h>a.axisY.bounds.x2?a.axisY.bounds.x2:h}}};u.prototype.renderStackedBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=
|
|
[],k=[],l=[],n=[],h=0,r,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;p=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.height<<0;var e=a.axisX.dataInfo.minDiff;isFinite(e)||(e=0.3*Math.abs(a.axisX.range));e=this.dataPointWidth?this.dataPointWidth:0.9*(d.height*(a.axisX.logarithmic?Math.log(e)/Math.log(a.axisX.range):Math.abs(e)/
|
|
Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>p&&(h=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&p<h)&&(p=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,h));e<h&&(e=h);e>p&&(e=p);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),
|
|
this._eventManager.ghostCtx.clip());for(var t=0;t<a.dataSeriesIndexes.length;t++){var q=a.dataSeriesIndexes[t],C=this.data[q],v=C.dataPoints;if(0<v.length){var E=5<e&&C.bevelEnabled?!0:!1;b.strokeStyle="#4572A7 ";for(h=0;h<v.length;h++)if(c=v[h].x.getTime?v[h].x.getTime():v[h].x,!(c<a.axisX.dataInfo.viewPortMin||c>a.axisX.dataInfo.viewPortMax)&&"number"===typeof v[h].y){p=a.axisX.convertValueToPixel(c);var u=p-a.plotType.plotUnits.length*e/2+a.index*e<<0,s=u+e<<0,x;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&
|
|
0<a.axisY.scaleBreaks._appliedBreaks.length&&0<v[h].y)l[c]=v[h].y+(l[c]?l[c]:0),0<l[c]&&(x=g[c]?g[c]:m,g[c]=r=a.axisY.convertValueToPixel(l[c]));else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=v[h].y)n[c]=v[h].y+(n[c]?n[c]:0),r=k[c]?k[c]:m,k[c]=x=a.axisY.convertValueToPixel(n[c]);else if(r=a.axisY.convertValueToPixel(v[h].y),0<=v[h].y){var A=g[c]?g[c]:0;x=m+A;r+=A;g[c]=A+(r-x)}else A=k[c]?k[c]:0,x=r-A,r=m-A,k[c]=A+(r-x);c=v[h].color?v[h].color:C._colorSet[h%C._colorSet.length];
|
|
Y(b,x,u,r,s,c,0,null,E,!1,!1,!1,C.fillOpacity);c=C.dataPointIds[h];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:x,y1:u,x2:r,y2:s};c=W(c);w&&Y(this._eventManager.ghostCtx,x,u,r,s,c,0,null,!1,!1,!1,!1);(v[h].indexLabel||C.indexLabel||v[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar",dataPoint:v[h],dataSeries:C,point:{x:0<=v[h].y?r:x,y:p},direction:0>v[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(x,
|
|
r),y1:u,x2:Math.max(x,r),y2:s},color:c})}}}w&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();
|
|
return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:m<a.axisY.bounds.x1?a.axisY.bounds.x1:m>a.axisY.bounds.x2?a.axisY.bounds.x2:m}}};u.prototype.renderStackedBar100=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=[],k=[],l=[],n=[],h=0,r,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth?
|
|
this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;p=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.height<<0;var e=a.axisX.dataInfo.minDiff;isFinite(e)||(e=0.3*Math.abs(a.axisX.range));e=this.dataPointWidth?this.dataPointWidth:0.9*(d.height*(a.axisX.logarithmic?Math.log(e)/Math.log(a.axisX.range):Math.abs(e)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>p&&(h=Math.min(this.dataPointWidth?this.dataPointWidth:
|
|
Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&p<h)&&(p=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,h));e<h&&(e=h);e>p&&(e=p);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var t=0;t<a.dataSeriesIndexes.length;t++){var q=a.dataSeriesIndexes[t],C=this.data[q],v=C.dataPoints;
|
|
if(0<v.length){var E=5<e&&C.bevelEnabled?!0:!1;b.strokeStyle="#4572A7 ";for(h=0;h<v.length;h++)if(c=v[h].x.getTime?v[h].x.getTime():v[h].x,!(c<a.axisX.dataInfo.viewPortMin||c>a.axisX.dataInfo.viewPortMax)&&"number"===typeof v[h].y){p=a.axisX.convertValueToPixel(c);var u;u=0!==a.dataPointYSums[c]?100*(v[h].y/a.dataPointYSums[c]):0;var s=p-a.plotType.plotUnits.length*e/2+a.index*e<<0,x=s+e<<0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0<v[h].y){l[c]=u+
|
|
(l[c]?l[c]:0);if(0>=l[c])continue;u=g[c]?g[c]:m;g[c]=r=a.axisY.convertValueToPixel(l[c])}else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=v[h].y)n[c]=u+(n[c]?n[c]:0),r=k[c]?k[c]:m,k[c]=u=a.axisY.convertValueToPixel(n[c]);else if(r=a.axisY.convertValueToPixel(u),0<=v[h].y){var A=g[c]?g[c]:0;u=m+A;r+=A;g[c]=A+(r-u)}else A=k[c]?k[c]:0,u=r-A,r=m-A,k[c]=A+(r-u);c=v[h].color?v[h].color:C._colorSet[h%C._colorSet.length];Y(b,u,s,r,x,c,0,null,E,!1,!1,!1,C.fillOpacity);c=C.dataPointIds[h];
|
|
this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:u,y1:s,x2:r,y2:x};c=W(c);w&&Y(this._eventManager.ghostCtx,u,s,r,x,c,0,null,!1,!1,!1,!1);(v[h].indexLabel||C.indexLabel||v[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar100",dataPoint:v[h],dataSeries:C,point:{x:0<=v[h].y?r:u,y:p},direction:0>v[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(u,r),y1:s,x2:Math.max(u,r),y2:x},color:c})}}}w&&(f.drawImage(this._preRenderCanvas,
|
|
0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xScaleAnimation,easingFunction:Q.easing.easeOutQuart,
|
|
animationBase:m<a.axisY.bounds.x1?a.axisY.bounds.x1:m>a.axisY.bounds.x2?a.axisY.bounds.x2:m}}};u.prototype.renderArea=function(a){var f,b;function c(){A&&(0<t.lineThickness&&g.stroke(),a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?x=s:0>a.axisY.viewportMaximum?x=n.y1:0<a.axisY.viewportMinimum&&(x=l.y2),g.lineTo(v,x),g.lineTo(A.x,x),g.closePath(),g.globalAlpha=t.fillOpacity,g.fill(),g.globalAlpha=1,w&&(k.lineTo(v,x),k.lineTo(A.x,x),k.closePath(),k.fill()),g.beginPath(),
|
|
g.moveTo(v,E),k.beginPath(),k.moveTo(v,E),A={x:v,y:E})}var d=a.targetCanvasCtx||this.plotArea.ctx,g=w?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var k=this._eventManager.ghostCtx,l=a.axisX.lineCoordinates,n=a.axisY.lineCoordinates,h=[],r=this.plotArea,p;g.save();w&&k.save();g.beginPath();g.rect(r.x1,r.y1,r.width,r.height);g.clip();w&&(k.beginPath(),k.rect(r.x1,r.y1,r.width,r.height),k.clip());for(var m=0;m<a.dataSeriesIndexes.length;m++){var e=a.dataSeriesIndexes[m],t=this.data[e],
|
|
q=t.dataPoints,h=t.id;this._eventManager.objectMap[h]={objectType:"dataSeries",dataSeriesIndex:e};h=W(h);k.fillStyle=h;h=[];f=!0;var C=0,v,E,u,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),x,A=null;if(0<q.length){var y=t._colorSet[C%t._colorSet.length],z=t.lineColor=t.options.lineColor||y,N=z;g.fillStyle=y;g.strokeStyle=z;g.lineWidth=t.lineThickness;b="solid";if(g.setLineDash){var U=F(t.nullDataLineDashType,t.lineThickness);b=t.lineDashType;var ba=F(b,t.lineThickness);
|
|
g.setLineDash(ba)}for(var Z=!0;C<q.length;C++)if(u=q[C].x.getTime?q[C].x.getTime():q[C].x,!(u<a.axisX.dataInfo.viewPortMin||u>a.axisX.dataInfo.viewPortMax&&(!t.connectNullData||!Z)))if("number"!==typeof q[C].y)t.connectNullData||(Z||f)||c(),Z=!0;else{v=a.axisX.convertValueToPixel(u);E=a.axisY.convertValueToPixel(q[C].y);f||Z?(!f&&t.connectNullData?(g.setLineDash&&(t.options.nullDataLineDashType||b===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(f=v,b=E,v=p.x,E=p.y,c(),g.moveTo(p.x,p.y),
|
|
v=f,E=b,A=p,b=t.nullDataLineDashType,g.setLineDash(U)),g.lineTo(v,E),w&&k.lineTo(v,E)):(g.beginPath(),g.moveTo(v,E),w&&(k.beginPath(),k.moveTo(v,E)),A={x:v,y:E}),Z=f=!1):(g.lineTo(v,E),w&&k.lineTo(v,E),0==C%250&&c());p={x:v,y:E};C<q.length-1&&(N!==(q[C].lineColor||z)||b!==(q[C].lineDashType||t.lineDashType))&&(c(),N=q[C].lineColor||z,g.strokeStyle=N,g.setLineDash&&(q[C].lineDashType?(b=q[C].lineDashType,g.setLineDash(F(b,t.lineThickness))):(b=t.lineDashType,g.setLineDash(ba))));var O=t.dataPointIds[C];
|
|
this._eventManager.objectMap[O]={id:O,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:C,x1:v,y1:E};0!==q[C].markerSize&&(0<q[C].markerSize||0<t.markerSize)&&(u=t.getMarkerProperties(C,v,E,g),h.push(u),O=W(O),w&&h.push({x:v,y:E,ctx:k,type:u.type,size:u.size,color:O,borderColor:O,borderThickness:u.borderThickness}));(q[C].indexLabel||t.indexLabel||q[C].indexLabelFormatter||t.indexLabelFormatter)&&this._indexLabels.push({chartType:"area",dataPoint:q[C],dataSeries:t,point:{x:v,y:E},direction:0>
|
|
q[C].y===a.axisY.reversed?1:-1,color:y})}c();aa.drawMarkers(h)}}w&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),g.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&g.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&g.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),g.clearRect(r.x1,r.y1,r.width,r.height),this._eventManager.ghostCtx.restore());
|
|
g.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderSplineArea=function(a){function f(){var b=y(s,2);if(0<b.length){if(0<p.lineThickness){c.beginPath();c.moveTo(b[0].x,b[0].y);b[0].newStrokeStyle&&(c.strokeStyle=b[0].newStrokeStyle);b[0].newLineDashArray&&c.setLineDash(b[0].newLineDashArray);for(var e=0;e<b.length-3;e+=3)if(c.bezierCurveTo(b[e+1].x,b[e+1].y,b[e+2].x,b[e+2].y,b[e+3].x,b[e+3].y),w&&
|
|
d.bezierCurveTo(b[e+1].x,b[e+1].y,b[e+2].x,b[e+2].y,b[e+3].x,b[e+3].y),b[e+3].newStrokeStyle||b[e+3].newLineDashArray)c.stroke(),c.beginPath(),c.moveTo(b[e+3].x,b[e+3].y),b[e+3].newStrokeStyle&&(c.strokeStyle=b[e+3].newStrokeStyle),b[e+3].newLineDashArray&&c.setLineDash(b[e+3].newLineDashArray);c.stroke()}c.beginPath();c.moveTo(b[0].x,b[0].y);w&&(d.beginPath(),d.moveTo(b[0].x,b[0].y));for(e=0;e<b.length-3;e+=3)c.bezierCurveTo(b[e+1].x,b[e+1].y,b[e+2].x,b[e+2].y,b[e+3].x,b[e+3].y),w&&d.bezierCurveTo(b[e+
|
|
1].x,b[e+1].y,b[e+2].x,b[e+2].y,b[e+3].x,b[e+3].y);a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?v=C:0>a.axisY.viewportMaximum?v=k.y1:0<a.axisY.viewportMinimum&&(v=g.y2);u={x:b[0].x,y:b[0].y};c.lineTo(b[b.length-1].x,v);c.lineTo(u.x,v);c.closePath();c.globalAlpha=p.fillOpacity;c.fill();c.globalAlpha=1;w&&(d.lineTo(b[b.length-1].x,v),d.lineTo(u.x,v),d.closePath(),d.fill())}}var b=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:b;if(!(0>=a.dataSeriesIndexes.length)){var d=
|
|
this._eventManager.ghostCtx,g=a.axisX.lineCoordinates,k=a.axisY.lineCoordinates,l=[],n=this.plotArea;c.save();w&&d.save();c.beginPath();c.rect(n.x1,n.y1,n.width,n.height);c.clip();w&&(d.beginPath(),d.rect(n.x1,n.y1,n.width,n.height),d.clip());for(var h=0;h<a.dataSeriesIndexes.length;h++){var r=a.dataSeriesIndexes[h],p=this.data[r],m=p.dataPoints,l=p.id;this._eventManager.objectMap[l]={objectType:"dataSeries",dataSeriesIndex:r};l=W(l);d.fillStyle=l;var l=[],e=0,t,q,C=a.axisY.convertValueToPixel(a.axisY.logarithmic?
|
|
a.axisY.viewportMinimum:0),v,u=null,s=[];if(0<m.length){var x=p._colorSet[e%p._colorSet.length],D=p.lineColor=p.options.lineColor||x,A=D;c.fillStyle=x;c.strokeStyle=D;c.lineWidth=p.lineThickness;var oa="solid";if(c.setLineDash){var z=F(p.nullDataLineDashType,p.lineThickness),oa=p.lineDashType,N=F(oa,p.lineThickness);c.setLineDash(N)}for(q=!1;e<m.length;e++)if(t=m[e].x.getTime?m[e].x.getTime():m[e].x,!(t<a.axisX.dataInfo.viewPortMin||t>a.axisX.dataInfo.viewPortMax&&(!p.connectNullData||!q)))if("number"!==
|
|
typeof m[e].y)0<e&&!q&&(p.connectNullData?c.setLineDash&&(0<s.length&&(p.options.nullDataLineDashType||!m[e-1].lineDashType))&&(s[s.length-1].newLineDashArray=z,oa=p.nullDataLineDashType):(f(),s=[])),q=!0;else{t=a.axisX.convertValueToPixel(t);q=a.axisY.convertValueToPixel(m[e].y);var U=p.dataPointIds[e];this._eventManager.objectMap[U]={id:U,objectType:"dataPoint",dataSeriesIndex:r,dataPointIndex:e,x1:t,y1:q};s[s.length]={x:t,y:q};e<m.length-1&&(A!==(m[e].lineColor||D)||oa!==(m[e].lineDashType||p.lineDashType))&&
|
|
(A=m[e].lineColor||D,s[s.length-1].newStrokeStyle=A,c.setLineDash&&(m[e].lineDashType?(oa=m[e].lineDashType,s[s.length-1].newLineDashArray=F(oa,p.lineThickness)):(oa=p.lineDashType,s[s.length-1].newLineDashArray=N)));if(0!==m[e].markerSize&&(0<m[e].markerSize||0<p.markerSize)){var ba=p.getMarkerProperties(e,t,q,c);l.push(ba);U=W(U);w&&l.push({x:t,y:q,ctx:d,type:ba.type,size:ba.size,color:U,borderColor:U,borderThickness:ba.borderThickness})}(m[e].indexLabel||p.indexLabel||m[e].indexLabelFormatter||
|
|
p.indexLabelFormatter)&&this._indexLabels.push({chartType:"splineArea",dataPoint:m[e],dataSeries:p,point:{x:t,y:q},direction:0>m[e].y===a.axisY.reversed?1:-1,color:x});q=!1}f();aa.drawMarkers(l)}}w&&(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(n.x1,n.y1,n.width,n.height),this._eventManager.ghostCtx.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderStepArea=function(a){var f,b;function c(){A&&(0<t.lineThickness&&g.stroke(),a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?D=x:0>a.axisY.viewportMaximum?D=n.y1:0<a.axisY.viewportMinimum&&(D=l.y2),g.lineTo(v,D),g.lineTo(A.x,
|
|
D),g.closePath(),g.globalAlpha=t.fillOpacity,g.fill(),g.globalAlpha=1,w&&(k.lineTo(v,D),k.lineTo(A.x,D),k.closePath(),k.fill()),g.beginPath(),g.moveTo(v,u),k.beginPath(),k.moveTo(v,u),A={x:v,y:u})}var d=a.targetCanvasCtx||this.plotArea.ctx,g=w?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var k=this._eventManager.ghostCtx,l=a.axisX.lineCoordinates,n=a.axisY.lineCoordinates,h=[],r=this.plotArea,p;g.save();w&&k.save();g.beginPath();g.rect(r.x1,r.y1,r.width,r.height);g.clip();w&&(k.beginPath(),
|
|
k.rect(r.x1,r.y1,r.width,r.height),k.clip());for(var m=0;m<a.dataSeriesIndexes.length;m++){var e=a.dataSeriesIndexes[m],t=this.data[e],q=t.dataPoints,h=t.id;this._eventManager.objectMap[h]={objectType:"dataSeries",dataSeriesIndex:e};h=W(h);k.fillStyle=h;h=[];f=!0;var C=0,v,u,s,x=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),D,A=null;b=!1;if(0<q.length){var y=t._colorSet[C%t._colorSet.length],z=t.lineColor=t.options.lineColor||y,N=z;g.fillStyle=y;g.strokeStyle=z;g.lineWidth=
|
|
t.lineThickness;var U="solid";if(g.setLineDash){var ba=F(t.nullDataLineDashType,t.lineThickness),U=t.lineDashType,Z=F(U,t.lineThickness);g.setLineDash(Z)}for(;C<q.length;C++)if(s=q[C].x.getTime?q[C].x.getTime():q[C].x,!(s<a.axisX.dataInfo.viewPortMin||s>a.axisX.dataInfo.viewPortMax&&(!t.connectNullData||!b))){var O=u;"number"!==typeof q[C].y?(t.connectNullData||(b||f)||c(),b=!0):(v=a.axisX.convertValueToPixel(s),u=a.axisY.convertValueToPixel(q[C].y),f||b?(!f&&t.connectNullData?(g.setLineDash&&(t.options.nullDataLineDashType||
|
|
U===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(f=v,b=u,v=p.x,u=p.y,c(),g.moveTo(p.x,p.y),v=f,u=b,A=p,U=t.nullDataLineDashType,g.setLineDash(ba)),g.lineTo(v,O),g.lineTo(v,u),w&&(k.lineTo(v,O),k.lineTo(v,u))):(g.beginPath(),g.moveTo(v,u),w&&(k.beginPath(),k.moveTo(v,u)),A={x:v,y:u}),b=f=!1):(g.lineTo(v,O),w&&k.lineTo(v,O),g.lineTo(v,u),w&&k.lineTo(v,u),0==C%250&&c()),p={x:v,y:u},C<q.length-1&&(N!==(q[C].lineColor||z)||U!==(q[C].lineDashType||t.lineDashType))&&(c(),N=q[C].lineColor||
|
|
z,g.strokeStyle=N,g.setLineDash&&(q[C].lineDashType?(U=q[C].lineDashType,g.setLineDash(F(U,t.lineThickness))):(U=t.lineDashType,g.setLineDash(Z)))),s=t.dataPointIds[C],this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:C,x1:v,y1:u},0!==q[C].markerSize&&(0<q[C].markerSize||0<t.markerSize)&&(O=t.getMarkerProperties(C,v,u,g),h.push(O),s=W(s),w&&h.push({x:v,y:u,ctx:k,type:O.type,size:O.size,color:s,borderColor:s,borderThickness:O.borderThickness})),(q[C].indexLabel||
|
|
t.indexLabel||q[C].indexLabelFormatter||t.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepArea",dataPoint:q[C],dataSeries:t,point:{x:v,y:u},direction:0>q[C].y===a.axisY.reversed?1:-1,color:y}))}c();aa.drawMarkers(h)}}w&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),g.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&g.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&g.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&
|
|
this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),g.clearRect(r.x1,r.y1,r.width,r.height),this._eventManager.ghostCtx.restore());g.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderStackedArea=function(a){function f(){if(!(1>n.length)){for(0<A.lineThickness&&c.stroke();0<n.length;){var a=n.pop();c.lineTo(a.x,a.y);w&&C.lineTo(a.x,a.y)}c.closePath();c.globalAlpha=A.fillOpacity;
|
|
c.fill();c.globalAlpha=1;c.beginPath();w&&(C.closePath(),C.fill(),C.beginPath());n=[]}}var b=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:b;if(!(0>=a.dataSeriesIndexes.length)){var d=null,g=[],k=this.plotArea,l=[],n=[],h=[],r=[],p=0,m,e,t,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),C=this._eventManager.ghostCtx,v,u,s;w&&C.beginPath();c.save();w&&C.save();c.beginPath();c.rect(k.x1,k.y1,k.width,k.height);c.clip();w&&(C.beginPath(),C.rect(k.x1,k.y1,k.width,
|
|
k.height),C.clip());for(var d=[],x=0;x<a.dataSeriesIndexes.length;x++){var D=a.dataSeriesIndexes[x],A=this.data[D],y=A.dataPoints;A.dataPointIndexes=[];for(p=0;p<y.length;p++)D=y[p].x.getTime?y[p].x.getTime():y[p].x,A.dataPointIndexes[D]=p,d[D]||(h.push(D),d[D]=!0);h.sort(Na)}for(x=0;x<a.dataSeriesIndexes.length;x++){D=a.dataSeriesIndexes[x];A=this.data[D];y=A.dataPoints;u=!0;n=[];p=A.id;this._eventManager.objectMap[p]={objectType:"dataSeries",dataSeriesIndex:D};p=W(p);C.fillStyle=p;if(0<h.length){var d=
|
|
A._colorSet[0],z=A.lineColor=A.options.lineColor||d,N=z;c.fillStyle=d;c.strokeStyle=z;c.lineWidth=A.lineThickness;s="solid";if(c.setLineDash){var U=F(A.nullDataLineDashType,A.lineThickness);s=A.lineDashType;var ba=F(s,A.lineThickness);c.setLineDash(ba)}for(var Z=!0,p=0;p<h.length;p++){t=h[p];var O=null,O=0<=A.dataPointIndexes[t]?y[A.dataPointIndexes[t]]:{x:t,y:null};if(!(t<a.axisX.dataInfo.viewPortMin||t>a.axisX.dataInfo.viewPortMax&&(!A.connectNullData||!Z)))if("number"!==typeof O.y)A.connectNullData||
|
|
(Z||u)||f(),Z=!0;else{m=a.axisX.convertValueToPixel(t);var I=l[t]?l[t]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length){r[t]=O.y+(r[t]?r[t]:0);if(0>=r[t]&&a.axisY.logarithmic)continue;e=a.axisY.convertValueToPixel(r[t])}else e=a.axisY.convertValueToPixel(O.y),e-=I;n.push({x:m,y:q-I});l[t]=q-e;u||Z?(!u&&A.connectNullData?(c.setLineDash&&(A.options.nullDataLineDashType||s===A.lineDashType&&A.lineDashType!==A.nullDataLineDashType)&&(u=n.pop(),s=n[n.length-1],
|
|
f(),c.moveTo(v.x,v.y),n.push(s),n.push(u),s=A.nullDataLineDashType,c.setLineDash(U)),c.lineTo(m,e),w&&C.lineTo(m,e)):(c.beginPath(),c.moveTo(m,e),w&&(C.beginPath(),C.moveTo(m,e))),Z=u=!1):(c.lineTo(m,e),w&&C.lineTo(m,e),0==p%250&&(f(),c.moveTo(m,e),w&&C.moveTo(m,e),n.push({x:m,y:q-I})));v={x:m,y:e};p<y.length-1&&(N!==(y[p].lineColor||z)||s!==(y[p].lineDashType||A.lineDashType))&&(f(),c.beginPath(),c.moveTo(m,e),n.push({x:m,y:q-I}),N=y[p].lineColor||z,c.strokeStyle=N,c.setLineDash&&(y[p].lineDashType?
|
|
(s=y[p].lineDashType,c.setLineDash(F(s,A.lineThickness))):(s=A.lineDashType,c.setLineDash(ba))));if(0<=A.dataPointIndexes[t]){var ma=A.dataPointIds[A.dataPointIndexes[t]];this._eventManager.objectMap[ma]={id:ma,objectType:"dataPoint",dataSeriesIndex:D,dataPointIndex:A.dataPointIndexes[t],x1:m,y1:e}}0<=A.dataPointIndexes[t]&&0!==O.markerSize&&(0<O.markerSize||0<A.markerSize)&&(t=A.getMarkerProperties(A.dataPointIndexes[t],m,e,c),g.push(t),markerColor=W(ma),w&&g.push({x:m,y:e,ctx:C,type:t.type,size:t.size,
|
|
color:markerColor,borderColor:markerColor,borderThickness:t.borderThickness}));(O.indexLabel||A.indexLabel||O.indexLabelFormatter||A.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedArea",dataPoint:O,dataSeries:A,point:{x:m,y:e},direction:0>y[p].y===a.axisY.reversed?1:-1,color:d})}}f();c.moveTo(m,e);w&&C.moveTo(m,e)}delete A.dataPointIndexes}aa.drawMarkers(g);w&&(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(k.x1,k.y1,k.width,k.height),C.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderStackedArea100=function(a){function f(){for(0<A.lineThickness&&
|
|
c.stroke();0<n.length;){var a=n.pop();c.lineTo(a.x,a.y);w&&x.lineTo(a.x,a.y)}c.closePath();c.globalAlpha=A.fillOpacity;c.fill();c.globalAlpha=1;c.beginPath();w&&(x.closePath(),x.fill(),x.beginPath());n=[]}var b=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:b;if(!(0>=a.dataSeriesIndexes.length)){var d=null,g=this.plotArea,k=[],l=[],n=[],h=[],r=[],p=0,m,e,t,q,u,v,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),x=this._eventManager.ghostCtx;c.save();w&&x.save();
|
|
c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();w&&(x.beginPath(),x.rect(g.x1,g.y1,g.width,g.height),x.clip());for(var d=[],y=0;y<a.dataSeriesIndexes.length;y++){var D=a.dataSeriesIndexes[y],A=this.data[D],z=A.dataPoints;A.dataPointIndexes=[];for(p=0;p<z.length;p++)D=z[p].x.getTime?z[p].x.getTime():z[p].x,A.dataPointIndexes[D]=p,d[D]||(h.push(D),d[D]=!0);h.sort(Na)}for(y=0;y<a.dataSeriesIndexes.length;y++){D=a.dataSeriesIndexes[y];A=this.data[D];z=A.dataPoints;u=!0;d=A.id;this._eventManager.objectMap[d]=
|
|
{objectType:"dataSeries",dataSeriesIndex:D};d=W(d);x.fillStyle=d;n=[];if(0<h.length){var d=A._colorSet[p%A._colorSet.length],B=A.lineColor=A.options.lineColor||d,N=B;c.fillStyle=d;c.strokeStyle=B;c.lineWidth=A.lineThickness;v="solid";if(c.setLineDash){var U=F(A.nullDataLineDashType,A.lineThickness);v=A.lineDashType;var ba=F(v,A.lineThickness);c.setLineDash(ba)}for(var Z=!0,p=0;p<h.length;p++){t=h[p];var O=null,O=0<=A.dataPointIndexes[t]?z[A.dataPointIndexes[t]]:{x:t,y:null};if(!(t<a.axisX.dataInfo.viewPortMin||
|
|
t>a.axisX.dataInfo.viewPortMax&&(!A.connectNullData||!Z)))if("number"!==typeof O.y)A.connectNullData||(Z||u)||f(),Z=!0;else{var I;I=0!==a.dataPointYSums[t]?100*(O.y/a.dataPointYSums[t]):0;m=a.axisX.convertValueToPixel(t);var ma=l[t]?l[t]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length){r[t]=I+(r[t]?r[t]:0);if(0>=r[t]&&a.axisY.logarithmic)continue;e=a.axisY.convertValueToPixel(r[t])}else e=a.axisY.convertValueToPixel(I),e-=ma;n.push({x:m,y:s-ma});l[t]=s-e;
|
|
u||Z?(!u&&A.connectNullData?(c.setLineDash&&(A.options.nullDataLineDashType||v===A.lineDashType&&A.lineDashType!==A.nullDataLineDashType)&&(u=n.pop(),v=n[n.length-1],f(),c.moveTo(q.x,q.y),n.push(v),n.push(u),v=A.nullDataLineDashType,c.setLineDash(U)),c.lineTo(m,e),w&&x.lineTo(m,e)):(c.beginPath(),c.moveTo(m,e),w&&(x.beginPath(),x.moveTo(m,e))),Z=u=!1):(c.lineTo(m,e),w&&x.lineTo(m,e),0==p%250&&(f(),c.moveTo(m,e),w&&x.moveTo(m,e),n.push({x:m,y:s-ma})));q={x:m,y:e};p<z.length-1&&(N!==(z[p].lineColor||
|
|
B)||v!==(z[p].lineDashType||A.lineDashType))&&(f(),c.beginPath(),c.moveTo(m,e),n.push({x:m,y:s-ma}),N=z[p].lineColor||B,c.strokeStyle=N,c.setLineDash&&(z[p].lineDashType?(v=z[p].lineDashType,c.setLineDash(F(v,A.lineThickness))):(v=A.lineDashType,c.setLineDash(ba))));if(0<=A.dataPointIndexes[t]){var sa=A.dataPointIds[A.dataPointIndexes[t]];this._eventManager.objectMap[sa]={id:sa,objectType:"dataPoint",dataSeriesIndex:D,dataPointIndex:A.dataPointIndexes[t],x1:m,y1:e}}0<=A.dataPointIndexes[t]&&0!==O.markerSize&&
|
|
(0<O.markerSize||0<A.markerSize)&&(t=A.getMarkerProperties(p,m,e,c),k.push(t),markerColor=W(sa),w&&k.push({x:m,y:e,ctx:x,type:t.type,size:t.size,color:markerColor,borderColor:markerColor,borderThickness:t.borderThickness}));(O.indexLabel||A.indexLabel||O.indexLabelFormatter||A.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedArea100",dataPoint:O,dataSeries:A,point:{x:m,y:e},direction:0>z[p].y===a.axisY.reversed?1:-1,color:d})}}f();c.moveTo(m,e);w&&x.moveTo(m,e)}delete A.dataPointIndexes}aa.drawMarkers(k);
|
|
w&&(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(g.x1,g.y1,g.width,g.height),x.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,
|
|
easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderBubble=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this.plotArea,d=0,g,k;b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(c.x1,c.y1,c.width,c.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var l=-Infinity,n=Infinity,h=0;h<
|
|
a.dataSeriesIndexes.length;h++)for(var r=a.dataSeriesIndexes[h],p=this.data[r],m=p.dataPoints,e=0,d=0;d<m.length;d++)g=m[d].getTime?g=m[d].x.getTime():g=m[d].x,g<a.axisX.dataInfo.viewPortMin||g>a.axisX.dataInfo.viewPortMax||"undefined"===typeof m[d].z||(e=m[d].z,e>l&&(l=e),e<n&&(n=e));for(var t=25*Math.PI,q=Math.max(Math.pow(0.25*Math.min(c.height,c.width)/2,2)*Math.PI,t),h=0;h<a.dataSeriesIndexes.length;h++)if(r=a.dataSeriesIndexes[h],p=this.data[r],m=p.dataPoints,0<m.length)for(b.strokeStyle="#4572A7 ",
|
|
d=0;d<m.length;d++)if(g=m[d].getTime?g=m[d].x.getTime():g=m[d].x,!(g<a.axisX.dataInfo.viewPortMin||g>a.axisX.dataInfo.viewPortMax)&&"number"===typeof m[d].y){g=a.axisX.convertValueToPixel(g);k=a.axisY.convertValueToPixel(m[d].y);var e=m[d].z,u=2*Math.max(Math.sqrt((l===n?q/2:t+(q-t)/(l-n)*(e-n))/Math.PI)<<0,1),e=p.getMarkerProperties(d,b);e.size=u;b.globalAlpha=p.fillOpacity;aa.drawMarker(g,k,b,e.type,e.size,e.color,e.borderColor,e.borderThickness);b.globalAlpha=1;var v=p.dataPointIds[d];this._eventManager.objectMap[v]=
|
|
{id:v,objectType:"dataPoint",dataSeriesIndex:r,dataPointIndex:d,x1:g,y1:k,size:u};u=W(v);w&&aa.drawMarker(g,k,this._eventManager.ghostCtx,e.type,e.size,u,u,e.borderThickness);(m[d].indexLabel||p.indexLabel||m[d].indexLabelFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"bubble",dataPoint:m[d],dataSeries:p,point:{x:g,y:k},direction:1,bounds:{x1:g-e.size/2,y1:k-e.size/2,x2:g+e.size/2,y2:k+e.size/2},color:null})}w&&(f.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());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderScatter=
|
|
function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this.plotArea,d=0,g,k;b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(c.x1,c.y1,c.width,c.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var l=0;l<a.dataSeriesIndexes.length;l++){var n=a.dataSeriesIndexes[l],h=this.data[n],r=h.dataPoints;if(0<
|
|
r.length){b.strokeStyle="#4572A7 ";Math.pow(0.3*Math.min(c.height,c.width)/2,2);for(var p=0,m=0,d=0;d<r.length;d++)if(g=r[d].getTime?g=r[d].x.getTime():g=r[d].x,!(g<a.axisX.dataInfo.viewPortMin||g>a.axisX.dataInfo.viewPortMax)&&"number"===typeof r[d].y){g=a.axisX.convertValueToPixel(g);k=a.axisY.convertValueToPixel(r[d].y);var e=h.getMarkerProperties(d,g,k,b);b.globalAlpha=h.fillOpacity;aa.drawMarker(e.x,e.y,e.ctx,e.type,e.size,e.color,e.borderColor,e.borderThickness);b.globalAlpha=1;Math.sqrt((p-
|
|
g)*(p-g)+(m-k)*(m-k))<Math.min(e.size,5)&&r.length>Math.min(this.plotArea.width,this.plotArea.height)||(p=h.dataPointIds[d],this._eventManager.objectMap[p]={id:p,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:d,x1:g,y1:k},p=W(p),w&&aa.drawMarker(e.x,e.y,this._eventManager.ghostCtx,e.type,e.size,p,p,e.borderThickness),(r[d].indexLabel||h.indexLabel||r[d].indexLabelFormatter||h.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:r[d],dataSeries:h,point:{x:g,y:k},direction:1,
|
|
bounds:{x1:g-e.size/2,y1:k-e.size/2,x2:g+e.size/2,y2:k+e.size/2},color:null}),p=g,m=k)}}}w&&(f.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());
|
|
b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderCandlestick=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f,c=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var d=null,g=null,k=this.plotArea,l=0,n,h,r,p,m,e,d=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,g=this.dataPointMaxWidth?this.dataPointMaxWidth:
|
|
this.dataPointWidth?this.dataPointWidth:0.015*this.width,t=a.axisX.dataInfo.minDiff;isFinite(t)||(t=0.3*Math.abs(a.axisX.range));t=this.dataPointWidth?this.dataPointWidth:0.7*k.width*(a.axisX.logarithmic?Math.log(t)/Math.log(a.axisX.range):Math.abs(t)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&d>g&&(d=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&g<d)&&(g=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,d));t<d&&
|
|
(t=d);t>g&&(t=g);b.save();w&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();w&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height),c.clip());for(var q=0;q<a.dataSeriesIndexes.length;q++){var u=a.dataSeriesIndexes[q],v=this.data[u],s=v.dataPoints;if(0<s.length)for(var G=5<t&&v.bevelEnabled?!0:!1,l=0;l<s.length;l++)if(s[l].getTime?e=s[l].x.getTime():e=s[l].x,!(e<a.axisX.dataInfo.viewPortMin||e>a.axisX.dataInfo.viewPortMax)&&!x(s[l].y)&&s[l].y.length&&"number"===typeof s[l].y[0]&&"number"===
|
|
typeof s[l].y[1]&&"number"===typeof s[l].y[2]&&"number"===typeof s[l].y[3]){n=a.axisX.convertValueToPixel(e);h=a.axisY.convertValueToPixel(s[l].y[0]);r=a.axisY.convertValueToPixel(s[l].y[1]);p=a.axisY.convertValueToPixel(s[l].y[2]);m=a.axisY.convertValueToPixel(s[l].y[3]);var y=n-t/2<<0,D=y+t<<0,g=v.options.fallingColor?v.fallingColor:v._colorSet[0],d=s[l].color?s[l].color:v._colorSet[0],A=Math.round(Math.max(1,0.15*t)),z=0===A%2?0:0.5,B=v.dataPointIds[l];this._eventManager.objectMap[B]={id:B,objectType:"dataPoint",
|
|
dataSeriesIndex:u,dataPointIndex:l,x1:y,y1:h,x2:D,y2:r,x3:n,y3:p,x4:n,y4:m,borderThickness:A,color:d};b.strokeStyle=d;b.beginPath();b.lineWidth=A;c.lineWidth=Math.max(A,4);"candlestick"===v.type?(b.moveTo(n-z,r),b.lineTo(n-z,Math.min(h,m)),b.stroke(),b.moveTo(n-z,Math.max(h,m)),b.lineTo(n-z,p),b.stroke(),Y(b,y,Math.min(h,m),D,Math.max(h,m),s[l].y[0]<=s[l].y[3]?v.risingColor:g,A,d,G,G,!1,!1,v.fillOpacity),w&&(d=W(B),c.strokeStyle=d,c.moveTo(n-z,r),c.lineTo(n-z,Math.min(h,m)),c.stroke(),c.moveTo(n-
|
|
z,Math.max(h,m)),c.lineTo(n-z,p),c.stroke(),Y(c,y,Math.min(h,m),D,Math.max(h,m),d,0,null,!1,!1,!1,!1))):"ohlc"===v.type&&(b.moveTo(n-z,r),b.lineTo(n-z,p),b.stroke(),b.beginPath(),b.moveTo(n,h),b.lineTo(y,h),b.stroke(),b.beginPath(),b.moveTo(n,m),b.lineTo(D,m),b.stroke(),w&&(d=W(B),c.strokeStyle=d,c.moveTo(n-z,r),c.lineTo(n-z,p),c.stroke(),c.beginPath(),c.moveTo(n,h),c.lineTo(y,h),c.stroke(),c.beginPath(),c.moveTo(n,m),c.lineTo(D,m),c.stroke()));(s[l].indexLabel||v.indexLabel||s[l].indexLabelFormatter||
|
|
v.indexLabelFormatter)&&this._indexLabels.push({chartType:v.type,dataPoint:s[l],dataSeries:v,point:{x:y+(D-y)/2,y:a.axisY.reversed?p:r},direction:1,bounds:{x1:y,y1:Math.min(r,p),x2:D,y2:Math.max(r,p)},color:d})}}w&&(f.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(k.x1,k.y1,k.width,k.height),c.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderBoxAndWhisker=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f,c=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var d=null,g=this.plotArea,k=0,l,n,h,r,p,m,e,d=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?
|
|
this.dataPointWidth:1,k=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.015*this.width,t=a.axisX.dataInfo.minDiff;isFinite(t)||(t=0.3*Math.abs(a.axisX.range));t=this.dataPointWidth?this.dataPointWidth:0.7*g.width*(a.axisX.logarithmic?Math.log(t)/Math.log(a.axisX.range):Math.abs(t)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&d>k&&(d=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&k<d)&&(k=
|
|
Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,d));t<d&&(t=d);t>k&&(t=k);b.save();w&&c.save();b.beginPath();b.rect(g.x1,g.y1,g.width,g.height);b.clip();w&&(c.beginPath(),c.rect(g.x1,g.y1,g.width,g.height),c.clip());for(var q=!1,q=!!a.axisY.reversed,u=0;u<a.dataSeriesIndexes.length;u++){var v=a.dataSeriesIndexes[u],s=this.data[v],G=s.dataPoints;if(0<G.length)for(var y=5<t&&s.bevelEnabled?!0:!1,k=0;k<G.length;k++)if(G[k].getTime?e=G[k].x.getTime():e=G[k].x,!(e<a.axisX.dataInfo.viewPortMin||
|
|
e>a.axisX.dataInfo.viewPortMax)&&!x(G[k].y)&&G[k].y.length&&"number"===typeof G[k].y[0]&&"number"===typeof G[k].y[1]&&"number"===typeof G[k].y[2]&&"number"===typeof G[k].y[3]&&"number"===typeof G[k].y[4]&&5===G[k].y.length){l=a.axisX.convertValueToPixel(e);n=a.axisY.convertValueToPixel(G[k].y[0]);h=a.axisY.convertValueToPixel(G[k].y[1]);r=a.axisY.convertValueToPixel(G[k].y[2]);p=a.axisY.convertValueToPixel(G[k].y[3]);m=a.axisY.convertValueToPixel(G[k].y[4]);var D=l-t/2<<0,A=l+t/2<<0,d=G[k].color?
|
|
G[k].color:s._colorSet[0],z=Math.round(Math.max(1,0.15*t)),B=0===z%2?0:0.5,N=G[k].whiskerColor?G[k].whiskerColor:G[k].color?s.whiskerColor?s.whiskerColor:G[k].color:s.whiskerColor?s.whiskerColor:d,U="number"===typeof G[k].whiskerThickness?G[k].whiskerThickness:"number"===typeof s.options.whiskerThickness?s.whiskerThickness:z,ba=G[k].whiskerDashType?G[k].whiskerDashType:s.whiskerDashType,Z=x(G[k].whiskerLength)?x(s.options.whiskerLength)?t:s.whiskerLength:G[k].whiskerLength,Z="number"===typeof Z?0>=
|
|
Z?0:Z>=t?t:Z:"string"===typeof Z?parseInt(Z)*t/100>t?t:parseInt(Z)*t/100:t,O=1===Math.round(U)%2?0.5:0,I=G[k].stemColor?G[k].stemColor:G[k].color?s.stemColor?s.stemColor:G[k].color:s.stemColor?s.stemColor:d,ma="number"===typeof G[k].stemThickness?G[k].stemThickness:"number"===typeof s.options.stemThickness?s.stemThickness:z,sa=1===Math.round(ma)%2?0.5:0,P=G[k].stemDashType?G[k].stemDashType:s.stemDashType,M=G[k].lineColor?G[k].lineColor:G[k].color?s.lineColor?s.lineColor:G[k].color:s.lineColor?s.lineColor:
|
|
d,J="number"===typeof G[k].lineThickness?G[k].lineThickness:"number"===typeof s.options.lineThickness?s.lineThickness:z,V=G[k].lineDashType?G[k].lineDashType:s.lineDashType,K=1===Math.round(J)%2?0.5:0,R=s.upperBoxColor,cb=s.lowerBoxColor,L=x(s.options.fillOpacity)?1:s.fillOpacity,ha=s.dataPointIds[k];this._eventManager.objectMap[ha]={id:ha,objectType:"dataPoint",dataSeriesIndex:v,dataPointIndex:k,x1:D,y1:n,x2:A,y2:h,x3:l,y3:r,x4:l,y4:p,y5:m,borderThickness:z,color:d,stemThickness:ma,stemColor:I,whiskerThickness:U,
|
|
whiskerLength:Z,whiskerColor:N,lineThickness:J,lineColor:M};b.save();0<ma&&(b.beginPath(),b.strokeStyle=I,b.lineWidth=ma,b.setLineDash&&b.setLineDash(F(P,ma)),b.moveTo(l-sa,h),b.lineTo(l-sa,n),b.stroke(),b.moveTo(l-sa,p),b.lineTo(l-sa,r),b.stroke());b.restore();c.lineWidth=Math.max(z,4);b.beginPath();Y(b,D,Math.min(m,h),A,Math.max(h,m),cb,0,d,q?y:!1,q?!1:y,!1,!1,L);b.beginPath();Y(b,D,Math.min(r,m),A,Math.max(m,r),R,0,d,q?!1:y,q?y:!1,!1,!1,L);b.beginPath();b.lineWidth=z;b.strokeStyle=d;b.rect(D-B,
|
|
Math.min(h,r)-B,A-D+2*B,Math.max(h,r)-Math.min(h,r)+2*B);b.stroke();b.save();0<J&&(b.beginPath(),b.globalAlpha=1,b.setLineDash&&b.setLineDash(F(V,J)),b.strokeStyle=M,b.lineWidth=J,b.moveTo(D,m-K),b.lineTo(A,m-K),b.stroke());b.restore();b.save();0<U&&(b.beginPath(),b.setLineDash&&b.setLineDash(F(ba,U)),b.strokeStyle=N,b.lineWidth=U,b.moveTo(l-Z/2<<0,p-O),b.lineTo(l+Z/2<<0,p-O),b.stroke(),b.moveTo(l-Z/2<<0,n+O),b.lineTo(l+Z/2<<0,n+O),b.stroke());b.restore();w&&(d=W(ha),c.strokeStyle=d,c.lineWidth=ma,
|
|
0<ma&&(c.moveTo(l-B-sa,h),c.lineTo(l-B-sa,Math.max(n,p)),c.stroke(),c.moveTo(l-B-sa,Math.min(n,p)),c.lineTo(l-B-sa,r),c.stroke()),Y(c,D,Math.max(h,r),A,Math.min(h,r),d,0,null,!1,!1,!1,!1),0<U&&(c.beginPath(),c.lineWidth=U,c.moveTo(l+Z/2,p-O),c.lineTo(l-Z/2,p-O),c.stroke(),c.moveTo(l+Z/2,n+O),c.lineTo(l-Z/2,n+O),c.stroke()));(G[k].indexLabel||s.indexLabel||G[k].indexLabelFormatter||s.indexLabelFormatter)&&this._indexLabels.push({chartType:s.type,dataPoint:G[k],dataSeries:s,point:{x:D+(A-D)/2,y:a.axisY.reversed?
|
|
n:p},direction:1,bounds:{x1:D,y1:Math.min(n,p),x2:A,y2:Math.max(n,p)},color:d})}}w&&(f.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(g.x1,g.y1,g.width,g.height),c.restore());
|
|
b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderRangeColumn=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=0,k,l,n,g=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;k=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:
|
|
0.03*this.width;var h=a.axisX.dataInfo.minDiff;isFinite(h)||(h=0.3*Math.abs(a.axisX.range));h=this.dataPointWidth?this.dataPointWidth:0.9*(d.width*(a.axisX.logarithmic?Math.log(h)/Math.log(a.axisX.range):Math.abs(h)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&g>k&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&k<g)&&(k=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,g));h<g&&(h=g);h>
|
|
k&&(h=k);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var r=0;r<a.dataSeriesIndexes.length;r++){var p=a.dataSeriesIndexes[r],m=this.data[p],e=m.dataPoints;if(0<e.length)for(var t=5<h&&m.bevelEnabled?!0:!1,g=0;g<e.length;g++)if(e[g].getTime?n=e[g].x.getTime():n=e[g].x,!(n<a.axisX.dataInfo.viewPortMin||
|
|
n>a.axisX.dataInfo.viewPortMax)&&!x(e[g].y)&&e[g].y.length&&"number"===typeof e[g].y[0]&&"number"===typeof e[g].y[1]){c=a.axisX.convertValueToPixel(n);k=a.axisY.convertValueToPixel(e[g].y[0]);l=a.axisY.convertValueToPixel(e[g].y[1]);var q=a.axisX.reversed?c+a.plotType.totalDataSeries*h/2-(a.previousDataSeriesCount+r)*h<<0:c-a.plotType.totalDataSeries*h/2+(a.previousDataSeriesCount+r)*h<<0,s=a.axisX.reversed?q-h<<0:q+h<<0,c=e[g].color?e[g].color:m._colorSet[g%m._colorSet.length];if(k>l){var v=k;k=
|
|
l;l=v}v=m.dataPointIds[g];this._eventManager.objectMap[v]={id:v,objectType:"dataPoint",dataSeriesIndex:p,dataPointIndex:g,x1:q,y1:k,x2:s,y2:l};Y(b,q,k,s,l,c,0,c,t,t,!1,!1,m.fillOpacity);c=W(v);w&&Y(this._eventManager.ghostCtx,q,k,s,l,c,0,null,!1,!1,!1,!1);if(e[g].indexLabel||m.indexLabel||e[g].indexLabelFormatter||m.indexLabelFormatter)this._indexLabels.push({chartType:"rangeColumn",dataPoint:e[g],dataSeries:m,indexKeyword:0,point:{x:q+(s-q)/2,y:e[g].y[1]>=e[g].y[0]?l:k},direction:e[g].y[1]>=e[g].y[0]?
|
|
-1:1,bounds:{x1:q,y1:Math.min(k,l),x2:s,y2:Math.max(k,l)},color:c}),this._indexLabels.push({chartType:"rangeColumn",dataPoint:e[g],dataSeries:m,indexKeyword:1,point:{x:q+(s-q)/2,y:e[g].y[1]>=e[g].y[0]?k:l},direction:e[g].y[1]>=e[g].y[0]?1:-1,bounds:{x1:q,y1:Math.min(k,l),x2:s,y2:Math.max(k,l)},color:c})}}w&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&
|
|
b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderError=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f,c=a.axisY._position?
|
|
"left"===a.axisY._position||"right"===a.axisY._position?!1:!0:!1;if(!(0>=a.dataSeriesIndexes.length)){var d=null,g=!1,k=this.plotArea,l=0,n,h,r,p,m,e,t,q=a.axisX.dataInfo.minDiff;isFinite(q)||(q=0.3*Math.abs(a.axisX.range));b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.clip());for(var s=0,v=0;v<this.data.length;v++)!this.data[v].type.match(/(bar|column)/ig)||
|
|
!this.data[v].visible||this.data[v].type.match(/(stacked)/ig)&&s||s++;for(var u=0;u<a.dataSeriesIndexes.length;u++){var G=a.dataSeriesIndexes[u],y=this.data[G],D=y.dataPoints,A=x(y._linkedSeries)?!1:y._linkedSeries.type.match(/(bar|column)/ig)&&y._linkedSeries.visible?!0:!1,B=0;if(A)for(d=y._linkedSeries.id,v=0;v<d;v++)!this.data[v].type.match(/(bar|column)/ig)||!this.data[v].visible||this.data[v].type.match(/(stacked)/ig)&&B||(this.data[v].type.match(/(range)/ig)&&(g=!0),B++);d=this.dataPointMinWidth?
|
|
this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;l=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:c?Math.min(0.15*this.height,0.9*(this.plotArea.height/(A?s:1)))<<0:0.3*this.width;g&&(l=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:c?Math.min(0.15*this.height,0.9*(this.plotArea.height/(A?s:1)))<<0:0.03*this.width);v=this.options.dataPointWidth?this.dataPointWidth:0.9*((c?k.height:k.width)*(a.axisX.logarithmic?
|
|
Math.log(q)/Math.log(a.axisX.range):Math.abs(q)/Math.abs(a.axisX.range))/(A?s:1))<<0;this.dataPointMaxWidth&&d>l&&(d=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,l));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&l<d)&&(l=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,d));v<d&&(v=d);v>l&&(v=l);if(0<D.length)for(var F=y._colorSet,l=0;l<D.length;l++){var d=y.lineColor=y.options.color?y.options.color:F[0],N={color:D[l].whiskerColor?D[l].whiskerColor:D[l].color?y.whiskerColor?
|
|
y.whiskerColor:D[l].color:y.whiskerColor?y.whiskerColor:d,thickness:x(D[l].whiskerThickness)?y.whiskerThickness:D[l].whiskerThickness,dashType:D[l].whiskerDashType?D[l].whiskerDashType:y.whiskerDashType,length:x(D[l].whiskerLength)?x(y.options.whiskerLength)?v:y.options.whiskerLength:D[l].whiskerLength,trimLength:x(D[l].whiskerLength)?x(y.options.whiskerLength)?50:0:0};N.length="number"===typeof N.length?0>=N.length?0:N.length>=v?v:N.length:"string"===typeof N.length?parseInt(N.length)*v/100>v?v:
|
|
parseInt(N.length)*v/100>v:v;N.thickness="number"===typeof N.thickness?0>N.thickness?0:Math.round(N.thickness):2;var U={color:D[l].stemColor?D[l].stemColor:D[l].color?y.stemColor?y.stemColor:D[l].color:y.stemColor?y.stemColor:d,thickness:D[l].stemThickness?D[l].stemThickness:y.stemThickness,dashType:D[l].stemDashType?D[l].stemDashType:y.stemDashType};U.thickness="number"===typeof U.thickness?0>U.thickness?0:Math.round(U.thickness):2;D[l].getTime?t=D[l].x.getTime():t=D[l].x;if(!(t<a.axisX.dataInfo.viewPortMin||
|
|
t>a.axisX.dataInfo.viewPortMax)&&!x(D[l].y)&&D[l].y.length&&"number"===typeof D[l].y[0]&&"number"===typeof D[l].y[1]){var ba=a.axisX.convertValueToPixel(t);c?h=ba:n=ba;ba=a.axisY.convertValueToPixel(D[l].y[0]);c?r=ba:m=ba;ba=a.axisY.convertValueToPixel(D[l].y[1]);c?p=ba:e=ba;c?(m=a.axisX.reversed?h+(A?s:1)*v/2-(A?B-1:0)*v<<0:h-(A?s:1)*v/2+(A?B-1:0)*v<<0,e=a.axisX.reversed?m-v<<0:m+v<<0):(r=a.axisX.reversed?n+(A?s:1)*v/2-(A?B-1:0)*v<<0:n-(A?s:1)*v/2+(A?B-1:0)*v<<0,p=a.axisX.reversed?r-v<<0:r+v<<0);
|
|
!c&&m>e&&(ba=m,m=e,e=ba);c&&r>p&&(ba=r,r=p,p=ba);ba=y.dataPointIds[l];this._eventManager.objectMap[ba]={id:ba,objectType:"dataPoint",dataSeriesIndex:G,dataPointIndex:l,x1:Math.min(r,p),y1:Math.min(m,e),x2:Math.max(p,r),y2:Math.max(e,m),isXYSwapped:c,stemProperties:U,whiskerProperties:N};z(b,Math.min(r,p),Math.min(m,e),Math.max(p,r),Math.max(e,m),d,N,U,c);w&&z(this._eventManager.ghostCtx,r,m,p,e,d,N,U,c);if(D[l].indexLabel||y.indexLabel||D[l].indexLabelFormatter||y.indexLabelFormatter)this._indexLabels.push({chartType:"error",
|
|
dataPoint:D[l],dataSeries:y,indexKeyword:0,point:{x:c?D[l].y[1]>=D[l].y[0]?r:p:r+(p-r)/2,y:c?m+(e-m)/2:D[l].y[1]>=D[l].y[0]?e:m},direction:D[l].y[1]>=D[l].y[0]?-1:1,bounds:{x1:c?Math.min(r,p):r,y1:c?m:Math.min(m,e),x2:c?Math.max(r,p):p,y2:c?e:Math.max(m,e)},color:d,axisSwapped:c}),this._indexLabels.push({chartType:"error",dataPoint:D[l],dataSeries:y,indexKeyword:1,point:{x:c?D[l].y[1]>=D[l].y[0]?p:r:r+(p-r)/2,y:c?m+(e-m)/2:D[l].y[1]>=D[l].y[0]?m:e},direction:D[l].y[1]>=D[l].y[0]?1:-1,bounds:{x1:c?
|
|
Math.min(r,p):r,y1:c?m:Math.min(m,e),x2:c?Math.max(r,p):p,y2:c?e:Math.max(m,e)},color:d,axisSwapped:c})}}}w&&(f.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(k.x1,k.y1,k.width,
|
|
k.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderRangeBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=0,k,l,n,h,g=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;k=this.dataPointMaxWidth?this.dataPointMaxWidth:
|
|
this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0;var r=a.axisX.dataInfo.minDiff;isFinite(r)||(r=0.3*Math.abs(a.axisX.range));r=this.dataPointWidth?this.dataPointWidth:0.9*(d.height*(a.axisX.logarithmic?Math.log(r)/Math.log(a.axisX.range):Math.abs(r)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&g>k&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&
|
|
k<g)&&(k=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,g));r<g&&(r=g);r>k&&(r=k);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var p=0;p<a.dataSeriesIndexes.length;p++){var m=a.dataSeriesIndexes[p],e=this.data[m],t=e.dataPoints;if(0<t.length){var q=5<r&&e.bevelEnabled?!0:!1;b.strokeStyle=
|
|
"#4572A7 ";for(g=0;g<t.length;g++)if(t[g].getTime?h=t[g].x.getTime():h=t[g].x,!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax)&&!x(t[g].y)&&t[g].y.length&&"number"===typeof t[g].y[0]&&"number"===typeof t[g].y[1]){k=a.axisY.convertValueToPixel(t[g].y[0]);l=a.axisY.convertValueToPixel(t[g].y[1]);n=a.axisX.convertValueToPixel(h);n=a.axisX.reversed?n+a.plotType.totalDataSeries*r/2-(a.previousDataSeriesCount+p)*r<<0:n-a.plotType.totalDataSeries*r/2+(a.previousDataSeriesCount+p)*r<<0;var s=
|
|
a.axisX.reversed?n-r<<0:n+r<<0;k>l&&(c=k,k=l,l=c);c=t[g].color?t[g].color:e._colorSet[g%e._colorSet.length];Y(b,k,n,l,s,c,0,null,q,!1,!1,!1,e.fillOpacity);c=e.dataPointIds[g];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:g,x1:k,y1:n,x2:l,y2:s};c=W(c);w&&Y(this._eventManager.ghostCtx,k,n,l,s,c,0,null,!1,!1,!1,!1);if(t[g].indexLabel||e.indexLabel||t[g].indexLabelFormatter||e.indexLabelFormatter)this._indexLabels.push({chartType:"rangeBar",dataPoint:t[g],
|
|
dataSeries:e,indexKeyword:0,point:{x:t[g].y[1]>=t[g].y[0]?k:l,y:n+(s-n)/2},direction:t[g].y[1]>=t[g].y[0]?-1:1,bounds:{x1:Math.min(k,l),y1:n,x2:Math.max(k,l),y2:s},color:c}),this._indexLabels.push({chartType:"rangeBar",dataPoint:t[g],dataSeries:e,indexKeyword:1,point:{x:t[g].y[1]>=t[g].y[0]?l:k,y:n+(s-n)/2},direction:t[g].y[1]>=t[g].y[0]?1:-1,bounds:{x1:Math.min(k,l),y1:n,x2:Math.max(k,l),y2:s},color:c})}}}w&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation=
|
|
"source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderRangeArea=
|
|
function(a){function f(){if(u){var a=null;0<r.lineThickness&&c.stroke();for(var b=n.length-1;0<=b;b--)a=n[b],c.lineTo(a.x,a.y),d.lineTo(a.x,a.y);c.closePath();c.globalAlpha=r.fillOpacity;c.fill();c.globalAlpha=1;d.fill();if(0<r.lineThickness){c.beginPath();c.moveTo(a.x,a.y);for(b=0;b<n.length;b++)a=n[b],c.lineTo(a.x,a.y);c.stroke()}c.beginPath();c.moveTo(t,q);d.beginPath();d.moveTo(t,q);u={x:t,y:q};n=[];n.push({x:t,y:s})}}var b=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:b;if(!(0>=
|
|
a.dataSeriesIndexes.length)){var d=this._eventManager.ghostCtx,g=[],k=this.plotArea;c.save();w&&d.save();c.beginPath();c.rect(k.x1,k.y1,k.width,k.height);c.clip();w&&(d.beginPath(),d.rect(k.x1,k.y1,k.width,k.height),d.clip());for(var l=0;l<a.dataSeriesIndexes.length;l++){var n=[],h=a.dataSeriesIndexes[l],r=this.data[h],p=r.dataPoints,g=r.id;this._eventManager.objectMap[g]={objectType:"dataSeries",dataSeriesIndex:h};g=W(g);d.fillStyle=g;var g=[],m=!0,e=0,t,q,s,v,u=null;if(0<p.length){var x=r._colorSet[e%
|
|
r._colorSet.length],y=r.lineColor=r.options.lineColor||x,z=y;c.fillStyle=x;c.strokeStyle=y;c.lineWidth=r.lineThickness;var A="solid";if(c.setLineDash){var B=F(r.nullDataLineDashType,r.lineThickness),A=r.lineDashType,J=F(A,r.lineThickness);c.setLineDash(J)}for(var N=!0;e<p.length;e++)if(v=p[e].x.getTime?p[e].x.getTime():p[e].x,!(v<a.axisX.dataInfo.viewPortMin||v>a.axisX.dataInfo.viewPortMax&&(!r.connectNullData||!N)))if(null!==p[e].y&&p[e].y.length&&"number"===typeof p[e].y[0]&&"number"===typeof p[e].y[1]){t=
|
|
a.axisX.convertValueToPixel(v);q=a.axisY.convertValueToPixel(p[e].y[0]);s=a.axisY.convertValueToPixel(p[e].y[1]);m||N?(r.connectNullData&&!m?(c.setLineDash&&(r.options.nullDataLineDashType||A===r.lineDashType&&r.lineDashType!==r.nullDataLineDashType)&&(n[n.length-1].newLineDashArray=J,A=r.nullDataLineDashType,c.setLineDash(B)),c.lineTo(t,q),w&&d.lineTo(t,q),n.push({x:t,y:s})):(c.beginPath(),c.moveTo(t,q),u={x:t,y:q},n=[],n.push({x:t,y:s}),w&&(d.beginPath(),d.moveTo(t,q))),N=m=!1):(c.lineTo(t,q),n.push({x:t,
|
|
y:s}),w&&d.lineTo(t,q),0==e%250&&f());v=r.dataPointIds[e];this._eventManager.objectMap[v]={id:v,objectType:"dataPoint",dataSeriesIndex:h,dataPointIndex:e,x1:t,y1:q,y2:s};e<p.length-1&&(z!==(p[e].lineColor||y)||A!==(p[e].lineDashType||r.lineDashType))&&(f(),z=p[e].lineColor||y,n[n.length-1].newStrokeStyle=z,c.strokeStyle=z,c.setLineDash&&(p[e].lineDashType?(A=p[e].lineDashType,n[n.length-1].newLineDashArray=F(A,r.lineThickness),c.setLineDash(n[n.length-1].newLineDashArray)):(A=r.lineDashType,n[n.length-
|
|
1].newLineDashArray=J,c.setLineDash(J))));if(0!==p[e].markerSize&&(0<p[e].markerSize||0<r.markerSize)){var U=r.getMarkerProperties(e,t,s,c);g.push(U);var ba=W(v);w&&g.push({x:t,y:s,ctx:d,type:U.type,size:U.size,color:ba,borderColor:ba,borderThickness:U.borderThickness});U=r.getMarkerProperties(e,t,q,c);g.push(U);ba=W(v);w&&g.push({x:t,y:q,ctx:d,type:U.type,size:U.size,color:ba,borderColor:ba,borderThickness:U.borderThickness})}if(p[e].indexLabel||r.indexLabel||p[e].indexLabelFormatter||r.indexLabelFormatter)this._indexLabels.push({chartType:"rangeArea",
|
|
dataPoint:p[e],dataSeries:r,indexKeyword:0,point:{x:t,y:q},direction:p[e].y[0]>p[e].y[1]===a.axisY.reversed?-1:1,color:x}),this._indexLabels.push({chartType:"rangeArea",dataPoint:p[e],dataSeries:r,indexKeyword:1,point:{x:t,y:s},direction:p[e].y[0]>p[e].y[1]===a.axisY.reversed?1:-1,color:x})}else N||m||f(),N=!0;f();aa.drawMarkers(g)}}w&&(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(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderRangeSplineArea=function(a){function f(a,b){var e=y(q,2);if(0<e.length){if(0<
|
|
h.lineThickness){c.strokeStyle=b;c.setLineDash&&c.setLineDash(a);c.beginPath();c.moveTo(e[0].x,e[0].y);for(var f=0;f<e.length-3;f+=3){if(e[f].newStrokeStyle||e[f].newLineDashArray)c.stroke(),c.beginPath(),c.moveTo(e[f].x,e[f].y),e[f].newStrokeStyle&&(c.strokeStyle=e[f].newStrokeStyle),e[f].newLineDashArray&&c.setLineDash(e[f].newLineDashArray);c.bezierCurveTo(e[f+1].x,e[f+1].y,e[f+2].x,e[f+2].y,e[f+3].x,e[f+3].y)}c.stroke()}c.beginPath();c.moveTo(e[0].x,e[0].y);w&&(d.beginPath(),d.moveTo(e[0].x,e[0].y));
|
|
for(f=0;f<e.length-3;f+=3)c.bezierCurveTo(e[f+1].x,e[f+1].y,e[f+2].x,e[f+2].y,e[f+3].x,e[f+3].y),w&&d.bezierCurveTo(e[f+1].x,e[f+1].y,e[f+2].x,e[f+2].y,e[f+3].x,e[f+3].y);e=y(s,2);c.lineTo(s[s.length-1].x,s[s.length-1].y);for(f=e.length-1;2<f;f-=3)c.bezierCurveTo(e[f-1].x,e[f-1].y,e[f-2].x,e[f-2].y,e[f-3].x,e[f-3].y),w&&d.bezierCurveTo(e[f-1].x,e[f-1].y,e[f-2].x,e[f-2].y,e[f-3].x,e[f-3].y);c.closePath();c.globalAlpha=h.fillOpacity;c.fill();w&&(d.closePath(),d.fill());c.globalAlpha=1;if(0<h.lineThickness){c.strokeStyle=
|
|
b;c.setLineDash&&c.setLineDash(a);c.beginPath();c.moveTo(e[0].x,e[0].y);for(var g=f=0;f<e.length-3;f+=3,g++){if(q[g].newStrokeStyle||q[g].newLineDashArray)c.stroke(),c.beginPath(),c.moveTo(e[f].x,e[f].y),q[g].newStrokeStyle&&(c.strokeStyle=q[g].newStrokeStyle),q[g].newLineDashArray&&c.setLineDash(q[g].newLineDashArray);c.bezierCurveTo(e[f+1].x,e[f+1].y,e[f+2].x,e[f+2].y,e[f+3].x,e[f+3].y)}c.stroke()}c.beginPath()}}var b=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:b;if(!(0>=a.dataSeriesIndexes.length)){var d=
|
|
this._eventManager.ghostCtx,g=[],k=this.plotArea;c.save();w&&d.save();c.beginPath();c.rect(k.x1,k.y1,k.width,k.height);c.clip();w&&(d.beginPath(),d.rect(k.x1,k.y1,k.width,k.height),d.clip());for(var l=0;l<a.dataSeriesIndexes.length;l++){var n=a.dataSeriesIndexes[l],h=this.data[n],r=h.dataPoints,g=h.id;this._eventManager.objectMap[g]={objectType:"dataSeries",dataSeriesIndex:n};g=W(g);d.fillStyle=g;var g=[],p=0,m,e,t,q=[],s=[];if(0<r.length){var v=h._colorSet[p%h._colorSet.length],u=h.lineColor=h.options.lineColor||
|
|
v,x=u;c.fillStyle=v;c.lineWidth=h.lineThickness;var z="solid",D;if(c.setLineDash){var A=F(h.nullDataLineDashType,h.lineThickness),z=h.lineDashType;D=F(z,h.lineThickness)}for(e=!1;p<r.length;p++)if(m=r[p].x.getTime?r[p].x.getTime():r[p].x,!(m<a.axisX.dataInfo.viewPortMin||m>a.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!e)))if(null!==r[p].y&&r[p].y.length&&"number"===typeof r[p].y[0]&&"number"===typeof r[p].y[1]){m=a.axisX.convertValueToPixel(m);e=a.axisY.convertValueToPixel(r[p].y[0]);t=a.axisY.convertValueToPixel(r[p].y[1]);
|
|
var B=h.dataPointIds[p];this._eventManager.objectMap[B]={id:B,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:p,x1:m,y1:e,y2:t};q[q.length]={x:m,y:e};s[s.length]={x:m,y:t};p<r.length-1&&(x!==(r[p].lineColor||u)||z!==(r[p].lineDashType||h.lineDashType))&&(x=r[p].lineColor||u,q[q.length-1].newStrokeStyle=x,c.setLineDash&&(r[p].lineDashType?(z=r[p].lineDashType,q[q.length-1].newLineDashArray=F(z,h.lineThickness)):(z=h.lineDashType,q[q.length-1].newLineDashArray=D)));if(0!==r[p].markerSize&&(0<
|
|
r[p].markerSize||0<h.markerSize)){var J=h.getMarkerProperties(p,m,e,c);g.push(J);var N=W(B);w&&g.push({x:m,y:e,ctx:d,type:J.type,size:J.size,color:N,borderColor:N,borderThickness:J.borderThickness});J=h.getMarkerProperties(p,m,t,c);g.push(J);N=W(B);w&&g.push({x:m,y:t,ctx:d,type:J.type,size:J.size,color:N,borderColor:N,borderThickness:J.borderThickness})}if(r[p].indexLabel||h.indexLabel||r[p].indexLabelFormatter||h.indexLabelFormatter)this._indexLabels.push({chartType:"rangeSplineArea",dataPoint:r[p],
|
|
dataSeries:h,indexKeyword:0,point:{x:m,y:e},direction:r[p].y[0]<=r[p].y[1]?-1:1,color:v}),this._indexLabels.push({chartType:"rangeSplineArea",dataPoint:r[p],dataSeries:h,indexKeyword:1,point:{x:m,y:t},direction:r[p].y[0]<=r[p].y[1]?1:-1,color:v});e=!1}else 0<p&&!e&&(h.connectNullData?c.setLineDash&&(0<q.length&&(h.options.nullDataLineDashType||!r[p-1].lineDashType))&&(q[q.length-1].newLineDashArray=A,z=h.nullDataLineDashType):(f(D,u),q=[],s=[])),e=!0;f(D,u);aa.drawMarkers(g)}}w&&(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(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,
|
|
animationBase:0}}};u.prototype.renderWaterfall=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,d=null,g=this.plotArea,k=0,l,n,h,r,p=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),k=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;n=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15*
|
|
this.width,0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0;var m=a.axisX.dataInfo.minDiff;isFinite(m)||(m=0.3*Math.abs(a.axisX.range));m=this.dataPointWidth?this.dataPointWidth:0.6*(g.width*(a.axisX.logarithmic?Math.log(m)/Math.log(a.axisX.range):Math.abs(m)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&k>n&&(k=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&n<k)&&(n=Math.max(this.dataPointWidth?
|
|
this.dataPointWidth:-Infinity,k));m<k&&(m=k);m>n&&(m=n);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(g.x1,g.y1,g.width,g.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());for(var e=0;e<a.dataSeriesIndexes.length;e++){var t=a.dataSeriesIndexes[e],q=this.data[t],s=q.dataPoints,d=q._colorSet[0];q.risingColor=q.options.risingColor?q.options.risingColor:d;q.fallingColor=q.options.fallingColor?
|
|
q.options.fallingColor:"#e40a0a";var v="number"===typeof q.options.lineThickness?Math.round(q.lineThickness):1,u=1===Math.round(v)%2?-0.5:0;if(0<s.length)for(var x=5<m&&q.bevelEnabled?!0:!1,y=!1,z=null,A=null,k=0;k<s.length;k++)if(s[k].getTime?r=s[k].x.getTime():r=s[k].x,"number"!==typeof s[k].y){if(0<k&&!y&&q.connectNullData)var B=q.options.nullDataLineDashType||!s[k-1].lineDashType?q.nullDataLineDashType:s[k-1].lineDashType;y=!0}else{l=a.axisX.convertValueToPixel(r);n=0===q.dataPointEOs[k].cumulativeSum?
|
|
p:a.axisY.convertValueToPixel(q.dataPointEOs[k].cumulativeSum);h=0===q.dataPointEOs[k].cumulativeSumYStartValue?p:a.axisY.convertValueToPixel(q.dataPointEOs[k].cumulativeSumYStartValue);l=a.axisX.reversed?l+a.plotType.totalDataSeries*m/2-(a.previousDataSeriesCount+e)*m<<0:l-a.plotType.totalDataSeries*m/2+(a.previousDataSeriesCount+e)*m<<0;var J=a.axisX.reversed?l-m<<0:l+m<<0;n>h&&(d=n,n=h,h=d);a.axisY.reversed&&(d=n,n=h,h=d);d=q.dataPointIds[k];this._eventManager.objectMap[d]={id:d,objectType:"dataPoint",
|
|
dataSeriesIndex:t,dataPointIndex:k,x1:l,y1:n,x2:J,y2:h};var N=s[k].color?s[k].color:-1<s[k].y?q.risingColor:q.fallingColor;Y(b,l,n,J,h,N,0,N,x,x,!1,!1,q.fillOpacity);d=W(d);w&&Y(this._eventManager.ghostCtx,l,n,J,h,d,0,null,!1,!1,!1,!1);var U,N=l;U="undefined"!==typeof s[k].isIntermediateSum&&!0===s[k].isIntermediateSum||"undefined"!==typeof s[k].isCumulativeSum&&!0===s[k].isCumulativeSum?-1<s[k].y?n:h:-1<s[k].y?h:n;0<k&&z&&(!y||q.connectNullData)&&(y&&b.setLineDash&&b.setLineDash(F(B,v)),b.beginPath(),
|
|
b.moveTo(z,A-u),b.lineTo(N,U-u),0<v&&b.stroke(),w&&(c.beginPath(),c.moveTo(z,A-u),c.lineTo(N,U-u),0<v&&c.stroke()));y=!1;z=J;A=-1<s[k].y?n:h;N=s[k].lineDashType?s[k].lineDashType:q.options.lineDashType?q.options.lineDashType:"shortDash";b.strokeStyle=s[k].lineColor?s[k].lineColor:q.options.lineColor?q.options.lineColor:"#9e9e9e";b.lineWidth=v;b.setLineDash&&(N=F(N,v),b.setLineDash(N));(s[k].indexLabel||q.indexLabel||s[k].indexLabelFormatter||q.indexLabelFormatter)&&this._indexLabels.push({chartType:"waterfall",
|
|
dataPoint:s[k],dataSeries:q,point:{x:l+(J-l)/2,y:0<=s[k].y?n:h},direction:0>s[k].y===a.axisY.reversed?1:-1,bounds:{x1:l,y1:Math.min(n,h),x2:J,y2:Math.max(n,h)},color:d})}}w&&(f.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(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};var qa=function(a,f,b,c,d,g,k,l,n){if(!(0>b)){"undefined"===typeof l&&(l=1);if(!w){var h=Number((k%(2*Math.PI)).toFixed(8));Number((g%(2*Math.PI)).toFixed(8))===h&&(k-=1E-4)}a.save();a.globalAlpha=l;"pie"===d?(a.beginPath(),a.moveTo(f.x,f.y),a.arc(f.x,f.y,
|
|
b,g,k,!1),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.fill()):"doughnut"===d&&(a.beginPath(),a.arc(f.x,f.y,b,g,k,!1),0<=n&&a.arc(f.x,f.y,n*b,k,g,!0),a.closePath(),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.fill());a.globalAlpha=1;a.restore()}};u.prototype.renderPie=function(a){function f(){if(h&&r){for(var a=0,b=0,c=0,d=0,f=0;f<r.length;f++){var g=r[f],k=h.dataPointIds[f];e[f].id=k;e[f].objectType="dataPoint";e[f].dataPointIndex=f;e[f].dataSeriesIndex=0;var l=e[f],p=
|
|
{percent:null,total:null},t=null,p=n.getPercentAndTotal(h,g);if(h.indexLabelFormatter||g.indexLabelFormatter)t={chart:n.options,dataSeries:h,dataPoint:g,total:p.total,percent:p.percent};p=g.indexLabelFormatter?g.indexLabelFormatter(t):g.indexLabel?n.replaceKeywordsWithValue(g.indexLabel,g,h,f):h.indexLabelFormatter?h.indexLabelFormatter(t):h.indexLabel?n.replaceKeywordsWithValue(h.indexLabel,g,h,f):g.label?g.label:"";n._eventManager.objectMap[k]=l;l.center={x:w.x,y:w.y};l.y=g.y;l.radius=A;l.percentInnerRadius=
|
|
J;l.indexLabelText=p;l.indexLabelPlacement=h.indexLabelPlacement;l.indexLabelLineColor=g.indexLabelLineColor?g.indexLabelLineColor:h.options.indexLabelLineColor?h.options.indexLabelLineColor:g.color?g.color:h._colorSet[f%h._colorSet.length];l.indexLabelLineThickness=x(g.indexLabelLineThickness)?h.indexLabelLineThickness:g.indexLabelLineThickness;l.indexLabelLineDashType=g.indexLabelLineDashType?g.indexLabelLineDashType:h.indexLabelLineDashType;l.indexLabelFontColor=g.indexLabelFontColor?g.indexLabelFontColor:
|
|
h.indexLabelFontColor;l.indexLabelFontStyle=g.indexLabelFontStyle?g.indexLabelFontStyle:h.indexLabelFontStyle;l.indexLabelFontWeight=g.indexLabelFontWeight?g.indexLabelFontWeight:h.indexLabelFontWeight;l.indexLabelFontSize=x(g.indexLabelFontSize)?h.indexLabelFontSize:g.indexLabelFontSize;l.indexLabelFontFamily=g.indexLabelFontFamily?g.indexLabelFontFamily:h.indexLabelFontFamily;l.indexLabelBackgroundColor=g.indexLabelBackgroundColor?g.indexLabelBackgroundColor:h.options.indexLabelBackgroundColor?
|
|
h.options.indexLabelBackgroundColor:h.indexLabelBackgroundColor;l.indexLabelMaxWidth=g.indexLabelMaxWidth?g.indexLabelMaxWidth:h.indexLabelMaxWidth?h.indexLabelMaxWidth:0.33*m.width;l.indexLabelWrap="undefined"!==typeof g.indexLabelWrap?g.indexLabelWrap:h.indexLabelWrap;l.startAngle=0===f?h.startAngle?h.startAngle/180*Math.PI:0:e[f-1].endAngle;l.startAngle=(l.startAngle+2*Math.PI)%(2*Math.PI);l.endAngle=l.startAngle+2*Math.PI/y*Math.abs(g.y);g=(l.endAngle+l.startAngle)/2;g=(g+2*Math.PI)%(2*Math.PI);
|
|
l.midAngle=g;if(l.midAngle>Math.PI/2-v&&l.midAngle<Math.PI/2+v){if(0===a||e[c].midAngle>l.midAngle)c=f;a++}else if(l.midAngle>3*Math.PI/2-v&&l.midAngle<3*Math.PI/2+v){if(0===b||e[d].midAngle>l.midAngle)d=f;b++}l.hemisphere=g>Math.PI/2&&g<=3*Math.PI/2?"left":"right";l.indexLabelTextBlock=new ka(n.plotArea.ctx,{fontSize:l.indexLabelFontSize,fontFamily:l.indexLabelFontFamily,fontColor:l.indexLabelFontColor,fontStyle:l.indexLabelFontStyle,fontWeight:l.indexLabelFontWeight,horizontalAlign:"left",backgroundColor:l.indexLabelBackgroundColor,
|
|
maxWidth:l.indexLabelMaxWidth,maxHeight:l.indexLabelWrap?5*l.indexLabelFontSize:1.5*l.indexLabelFontSize,text:l.indexLabelText,padding:0,textBaseline:"top"});l.indexLabelTextBlock.measureText()}k=g=0;p=!1;for(f=0;f<r.length;f++)l=e[(c+f)%r.length],1<a&&(l.midAngle>Math.PI/2-v&&l.midAngle<Math.PI/2+v)&&(g<=a/2&&!p?(l.hemisphere="right",g++):(l.hemisphere="left",p=!0));p=!1;for(f=0;f<r.length;f++)l=e[(d+f)%r.length],1<b&&(l.midAngle>3*Math.PI/2-v&&l.midAngle<3*Math.PI/2+v)&&(k<=b/2&&!p?(l.hemisphere=
|
|
"left",k++):(l.hemisphere="right",p=!0))}}function b(a){var b=n.plotArea.ctx;b.clearRect(m.x1,m.y1,m.width,m.height);b.fillStyle=n.backgroundColor;b.fillRect(m.x1,m.y1,m.width,m.height);for(b=0;b<r.length;b++){var c=e[b].startAngle,d=e[b].endAngle;if(d>c){var f=0.07*A*Math.cos(e[b].midAngle),g=0.07*A*Math.sin(e[b].midAngle),k=!1;if(r[b].exploded){if(1E-9<Math.abs(e[b].center.x-(w.x+f))||1E-9<Math.abs(e[b].center.y-(w.y+g)))e[b].center.x=w.x+f*a,e[b].center.y=w.y+g*a,k=!0}else if(0<Math.abs(e[b].center.x-
|
|
w.x)||0<Math.abs(e[b].center.y-w.y))e[b].center.x=w.x+f*(1-a),e[b].center.y=w.y+g*(1-a),k=!0;k&&(f={},f.dataSeries=h,f.dataPoint=h.dataPoints[b],f.index=b,n.toolTip.highlightObjects([f]));qa(n.plotArea.ctx,e[b].center,e[b].radius,r[b].color?r[b].color:h._colorSet[b%h._colorSet.length],h.type,c,d,h.fillOpacity,e[b].percentInnerRadius)}}a=n.plotArea.ctx;a.save();a.fillStyle="black";a.strokeStyle="grey";a.textBaseline="middle";a.lineJoin="round";for(b=b=0;b<r.length;b++)c=e[b],c.indexLabelText&&(c.indexLabelTextBlock.y-=
|
|
c.indexLabelTextBlock.height/2,d=0,d="left"===c.hemisphere?"inside"!==h.indexLabelPlacement?-(c.indexLabelTextBlock.width+p):-c.indexLabelTextBlock.width/2:"inside"!==h.indexLabelPlacement?p:-c.indexLabelTextBlock.width/2,c.indexLabelTextBlock.x+=d,c.indexLabelTextBlock.render(!0),c.indexLabelTextBlock.x-=d,c.indexLabelTextBlock.y+=c.indexLabelTextBlock.height/2,"inside"!==c.indexLabelPlacement&&0<c.indexLabelLineThickness&&(d=c.center.x+A*Math.cos(c.midAngle),f=c.center.y+A*Math.sin(c.midAngle),
|
|
a.strokeStyle=c.indexLabelLineColor,a.lineWidth=c.indexLabelLineThickness,a.setLineDash&&a.setLineDash(F(c.indexLabelLineDashType,c.indexLabelLineThickness)),a.beginPath(),a.moveTo(d,f),a.lineTo(c.indexLabelTextBlock.x,c.indexLabelTextBlock.y),a.lineTo(c.indexLabelTextBlock.x+("left"===c.hemisphere?-p:p),c.indexLabelTextBlock.y),a.stroke()),a.lineJoin="miter");a.save()}function c(a,b){var c=0,c=a.indexLabelTextBlock.y-a.indexLabelTextBlock.height/2,d=a.indexLabelTextBlock.y+a.indexLabelTextBlock.height/
|
|
2,e=b.indexLabelTextBlock.y-b.indexLabelTextBlock.height/2,f=b.indexLabelTextBlock.y+b.indexLabelTextBlock.height/2;return c=b.indexLabelTextBlock.y>a.indexLabelTextBlock.y?e-d:c-f}function d(a){for(var b=null,d=1;d<r.length;d++)if(b=(a+d+e.length)%e.length,e[b].hemisphere!==e[a].hemisphere){b=null;break}else if(e[b].indexLabelText&&b!==a&&(0>c(e[b],e[a])||("right"===e[a].hemisphere?e[b].indexLabelTextBlock.y>=e[a].indexLabelTextBlock.y:e[b].indexLabelTextBlock.y<=e[a].indexLabelTextBlock.y)))break;
|
|
else b=null;return b}function g(a,b,f){f=(f||0)+1;if(1E3<f)return 0;b=b||0;var h=0,k=w.y-1*q,m=w.y+1*q;if(0<=a&&a<r.length){var l=e[a];if(0>b&&l.indexLabelTextBlock.y<k||0<b&&l.indexLabelTextBlock.y>m)return 0;var n=0,p=0,p=n=n=0;0>b?l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2>k&&l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2+b<k&&(b=-(k-(l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2+b))):l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2<k&&l.indexLabelTextBlock.y+
|
|
l.indexLabelTextBlock.height/2+b>m&&(b=l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2+b-m);b=l.indexLabelTextBlock.y+b;k=0;k="right"===l.hemisphere?w.x+Math.sqrt(Math.pow(q,2)-Math.pow(b-w.y,2)):w.x-Math.sqrt(Math.pow(q,2)-Math.pow(b-w.y,2));p=w.x+A*Math.cos(l.midAngle);n=w.y+A*Math.sin(l.midAngle);n=Math.sqrt(Math.pow(k-p,2)+Math.pow(b-n,2));p=Math.acos(A/q);n=Math.acos((q*q+A*A-n*n)/(2*A*q));b=n<p?b-l.indexLabelTextBlock.y:0;k=null;for(m=1;m<r.length;m++)if(k=(a-m+e.length)%e.length,e[k].hemisphere!==
|
|
e[a].hemisphere){k=null;break}else if(e[k].indexLabelText&&e[k].hemisphere===e[a].hemisphere&&k!==a&&(0>c(e[k],e[a])||("right"===e[a].hemisphere?e[k].indexLabelTextBlock.y<=e[a].indexLabelTextBlock.y:e[k].indexLabelTextBlock.y>=e[a].indexLabelTextBlock.y)))break;else k=null;p=k;n=d(a);m=k=0;0>b?(m="right"===l.hemisphere?p:n,h=b,null!==m&&(p=-b,b=l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2-(e[m].indexLabelTextBlock.y+e[m].indexLabelTextBlock.height/2),b-p<t&&(k=-p,m=g(m,k,f+1),+m.toFixed(u)>
|
|
+k.toFixed(u)&&(h=b>t?-(b-t):-(p-(m-k)))))):0<b&&(m="right"===l.hemisphere?n:p,h=b,null!==m&&(p=b,b=e[m].indexLabelTextBlock.y-e[m].indexLabelTextBlock.height/2-(l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2),b-p<t&&(k=p,m=g(m,k,f+1),+m.toFixed(u)<+k.toFixed(u)&&(h=b>t?b-t:p-(k-m)))));h&&(f=l.indexLabelTextBlock.y+h,b=0,b="right"===l.hemisphere?w.x+Math.sqrt(Math.pow(q,2)-Math.pow(f-w.y,2)):w.x-Math.sqrt(Math.pow(q,2)-Math.pow(f-w.y,2)),l.midAngle>Math.PI/2-v&&l.midAngle<Math.PI/2+v?(k=(a-
|
|
1+e.length)%e.length,k=e[k],a=e[(a+1+e.length)%e.length],"left"===l.hemisphere&&"right"===k.hemisphere&&b>k.indexLabelTextBlock.x?b=k.indexLabelTextBlock.x-15:"right"===l.hemisphere&&("left"===a.hemisphere&&b<a.indexLabelTextBlock.x)&&(b=a.indexLabelTextBlock.x+15)):l.midAngle>3*Math.PI/2-v&&l.midAngle<3*Math.PI/2+v&&(k=(a-1+e.length)%e.length,k=e[k],a=e[(a+1+e.length)%e.length],"right"===l.hemisphere&&"left"===k.hemisphere&&b<k.indexLabelTextBlock.x?b=k.indexLabelTextBlock.x+15:"left"===l.hemisphere&&
|
|
("right"===a.hemisphere&&b>a.indexLabelTextBlock.x)&&(b=a.indexLabelTextBlock.x-15)),l.indexLabelTextBlock.y=f,l.indexLabelTextBlock.x=b,l.indexLabelAngle=Math.atan2(l.indexLabelTextBlock.y-w.y,l.indexLabelTextBlock.x-w.x))}return h}function k(){var a=n.plotArea.ctx;a.fillStyle="grey";a.strokeStyle="grey";a.font="16px Arial";a.textBaseline="middle";for(var b=a=0,f=0,k=!0,b=0;10>b&&(1>b||0<f);b++){if(h.radius||!h.radius&&"undefined"!==typeof h.innerRadius&&null!==h.innerRadius&&A-f<=B)k=!1;k&&(A-=
|
|
f);f=0;if("inside"!==h.indexLabelPlacement){q=A*s;for(a=0;a<r.length;a++){var l=e[a];l.indexLabelTextBlock.x=w.x+q*Math.cos(l.midAngle);l.indexLabelTextBlock.y=w.y+q*Math.sin(l.midAngle);l.indexLabelAngle=l.midAngle;l.radius=A;l.percentInnerRadius=J}for(var v,x,a=0;a<r.length;a++){var l=e[a],y=d(a);if(null!==y){v=e[a];x=e[y];var z=0,z=c(v,x)-t;if(0>z){for(var D=x=0,F=0;F<r.length;F++)F!==a&&e[F].hemisphere===l.hemisphere&&(e[F].indexLabelTextBlock.y<l.indexLabelTextBlock.y?x++:D++);x=z/(x+D||1)*D;
|
|
var D=-1*(z-x),Ca=F=0;"right"===l.hemisphere?(F=g(a,x),D=-1*(z-F),Ca=g(y,D),+Ca.toFixed(u)<+D.toFixed(u)&&+F.toFixed(u)<=+x.toFixed(u)&&g(a,-(D-Ca))):(F=g(y,x),D=-1*(z-F),Ca=g(a,D),+Ca.toFixed(u)<+D.toFixed(u)&&+F.toFixed(u)<=+x.toFixed(u)&&g(y,-(D-Ca)))}}}}else for(a=0;a<r.length;a++)l=e[a],q="pie"===h.type?0.7*A:0.8*A,y=w.x+q*Math.cos(l.midAngle),x=w.y+q*Math.sin(l.midAngle),l.indexLabelTextBlock.x=y,l.indexLabelTextBlock.y=x;for(a=0;a<r.length;a++)if(l=e[a],y=l.indexLabelTextBlock.measureText(),
|
|
0!==y.height&&0!==y.width)y=y=0,"right"===l.hemisphere?(y=m.x2-(l.indexLabelTextBlock.x+l.indexLabelTextBlock.width+p),y*=-1):y=m.x1-(l.indexLabelTextBlock.x-l.indexLabelTextBlock.width-p),0<y&&(!k&&l.indexLabelText&&(x="right"===l.hemisphere?m.x2-l.indexLabelTextBlock.x:l.indexLabelTextBlock.x-m.x1,0.3*l.indexLabelTextBlock.maxWidth>x?l.indexLabelText="":l.indexLabelTextBlock.maxWidth=0.85*x,0.3*l.indexLabelTextBlock.maxWidth<x&&(l.indexLabelTextBlock.x-="right"===l.hemisphere?2:-2)),Math.abs(l.indexLabelTextBlock.y-
|
|
l.indexLabelTextBlock.height/2-w.y)<A||Math.abs(l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2-w.y)<A)&&(y/=Math.abs(Math.cos(l.indexLabelAngle)),9<y&&(y*=0.3),y>f&&(f=y)),y=y=0,0<l.indexLabelAngle&&l.indexLabelAngle<Math.PI?(y=m.y2-(l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2+5),y*=-1):y=m.y1-(l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2-5),0<y&&(!k&&l.indexLabelText&&(x=0<l.indexLabelAngle&&l.indexLabelAngle<Math.PI?-1:1,0===g(a,y*x)&&g(a,2*x)),Math.abs(l.indexLabelTextBlock.x-
|
|
w.x)<A&&(y/=Math.abs(Math.sin(l.indexLabelAngle)),9<y&&(y*=0.3),y>f&&(f=y)));var K=function(a,b,c){for(var d=[],f=0;d.push(e[b]),b!==c;b=(b+1+r.length)%r.length);d.sort(function(a,b){return a.y-b.y});for(b=0;b<d.length;b++)if(c=d[b],f<0.7*a)f+=c.indexLabelTextBlock.height,c.indexLabelTextBlock.text="",c.indexLabelText="",c.indexLabelTextBlock.measureText();else break};(function(){for(var a=-1,b=-1,f=0,g=!1,k=0;k<r.length;k++)if(g=!1,v=e[k],v.indexLabelText){var h=d(k);if(null!==h){var l=e[h];z=0;
|
|
z=c(v,l);var m;if(m=0>z){m=v.indexLabelTextBlock.x;var n=v.indexLabelTextBlock.y-v.indexLabelTextBlock.height/2,t=v.indexLabelTextBlock.y+v.indexLabelTextBlock.height/2,q=l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2,s=l.indexLabelTextBlock.x+l.indexLabelTextBlock.width,u=l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2;m=v.indexLabelTextBlock.x+v.indexLabelTextBlock.width<l.indexLabelTextBlock.x-p||m>s+p||n>u+p||t<q-p?!1:!0}m?(0>a&&(a=k),h!==a&&(b=h,f+=-z),0===k%Math.max(r.length/
|
|
10,3)&&(g=!0)):g=!0;g&&(0<f&&0<=a&&0<=b)&&(K(f,a,b),b=a=-1,f=0)}}0<f&&K(f,a,b)})()}}function l(){n.plotArea.layoutManager.reset();n.title&&(n.title.dockInsidePlotArea||"center"===n.title.horizontalAlign&&"center"===n.title.verticalAlign)&&n.title.render();if(n.subtitles)for(var a=0;a<n.subtitles.length;a++){var b=n.subtitles[a];(b.dockInsidePlotArea||"center"===b.horizontalAlign&&"center"===b.verticalAlign)&&b.render()}n.legend&&(n.legend.dockInsidePlotArea||"center"===n.legend.horizontalAlign&&"center"===
|
|
n.legend.verticalAlign)&&n.legend.render();V.fBWm&&V.fBWm(n)}var n=this;if(!(0>=a.dataSeriesIndexes.length)){var h=this.data[a.dataSeriesIndexes[0]],r=h.dataPoints,p=10,m=this.plotArea,e=h.dataPointEOs,t=2,q,s=1.3,v=20/180*Math.PI,u=6,w={x:(m.x2+m.x1)/2,y:(m.y2+m.y1)/2},y=0;a=!1;for(var z=0;z<r.length;z++)y+=Math.abs(r[z].y),!a&&("undefined"!==typeof r[z].indexLabel&&null!==r[z].indexLabel&&0<r[z].indexLabel.toString().length)&&(a=!0),!a&&("undefined"!==typeof r[z].label&&null!==r[z].label&&0<r[z].label.toString().length)&&
|
|
(a=!0);if(0!==y){a=a||"undefined"!==typeof h.indexLabel&&null!==h.indexLabel&&0<h.indexLabel.toString().length;var A="inside"!==h.indexLabelPlacement&&a?0.75*Math.min(m.width,m.height)/2:0.92*Math.min(m.width,m.height)/2;h.radius&&(A=P(h.radius,A));var B="undefined"!==typeof h.innerRadius&&null!==h.innerRadius?P(h.innerRadius,A):0.7*A;h.radius=A;"doughnut"===h.type&&(h.innerRadius=B);var J=Math.min(B/A,(A-1)/A);this.pieDoughnutClickHandler=function(a){n.isAnimating||!x(a.dataSeries.explodeOnClick)&&
|
|
!a.dataSeries.explodeOnClick||(a=a.dataPoint,a.exploded=a.exploded?!1:!0,1<this.dataPoints.length&&n._animator.animate(0,500,function(a){b(a);l()}))};f();k();k();k();k();this.disableToolTip=!0;this._animator.animate(0,this.animatedRender?this.animationDuration:0,function(a){var b=n.plotArea.ctx;b.clearRect(m.x1,m.y1,m.width,m.height);b.fillStyle=n.backgroundColor;b.fillRect(m.x1,m.y1,m.width,m.height);a=e[0].startAngle+2*Math.PI*a;for(b=0;b<r.length;b++){var c=0===b?e[b].startAngle:d,d=c+(e[b].endAngle-
|
|
e[b].startAngle),f=!1;d>a&&(d=a,f=!0);var g=r[b].color?r[b].color:h._colorSet[b%h._colorSet.length];d>c&&qa(n.plotArea.ctx,e[b].center,e[b].radius,g,h.type,c,d,h.fillOpacity,e[b].percentInnerRadius);if(f)break}l()},function(){n.disableToolTip=!1;n._animator.animate(0,n.animatedRender?500:0,function(a){b(a);l()})})}}};var wa=function(a,f,b,c){"undefined"===typeof b&&(b=1);0>=Math.round(f.y4-f.y1)||(a.save(),a.globalAlpha=b,a.beginPath(),a.moveTo(Math.round(f.x1),Math.round(f.y1)),a.lineTo(Math.round(f.x2),
|
|
Math.round(f.y2)),a.lineTo(Math.round(f.x3),Math.round(f.y3)),a.lineTo(Math.round(f.x4),Math.round(f.y4)),"undefined"!==f.x5&&(a.lineTo(Math.round(f.x5),Math.round(f.y5)),a.lineTo(Math.round(f.x6),Math.round(f.y6))),a.closePath(),a.fillStyle=c?c:f.color,a.fill(),a.globalAplha=1,a.restore())};u.prototype.renderFunnel=function(a){function f(){for(var a=0,b=[],c=0;c<u.length;c++){if("undefined"===typeof u[c].y)return-1;u[c].y="number"===typeof u[c].y?u[c].y:0;a+=Math.abs(u[c].y)}if(0===a)return-1;for(c=
|
|
b[0]=0;c<u.length;c++)b.push(Math.abs(u[c].y)*P/a);return b}function b(){var a=W,b=S,c=Y,d=K,e,f;e=N;f=U-O;headArea=(f-e)*(b-a+(d-c))/2;headArea=Math.abs(headArea);c=K-Y;e=f-e;f=c*(f-U);f=Math.abs(f);f=headArea+f;for(var d=[],g=0,k=0;k<u.length;k++){if("undefined"===typeof u[k].y)return-1;u[k].y="number"===typeof u[k].y?u[k].y:0;g+=Math.abs(u[k].y)}if(0===g)return-1;for(var h=d[0]=0,l=0,m,b=b-a,n=!1,k=0;k<u.length;k++)a=Math.abs(u[k].y)*f/g,n?h=0==Number(c.toFixed(3))?0:a/c:(sqrt=da*da*b*b-4*Math.abs(da)*
|
|
a,0>sqrt?(m=c,h=(b+m)*(e-l)/2,a-=h,h=e-l,l+=e-l,h+=0==m?0:a/m,l+=a/m,n=!0):(h=(Math.abs(da)*b-Math.sqrt(sqrt))/2,m=b-2*h/Math.abs(da),l+=h,l>e&&(l-=h,m=c,h=(b+m)*(e-l)/2,a-=h,h=e-l,l+=e-l,h+=a/m,l+=a/m,n=!0),b=m)),d.push(h);return d}function c(){if(v&&u){for(var a,b,c,d,f,g,h,k,l,m,n,p,r,t,q=[],x=[],y={percent:null,total:null},A=null,z=0;z<u.length;z++)t=L[z],t="undefined"!==typeof t.x5?(t.y2+t.y4)/2:(t.y2+t.y3)/2,t=e(t).x2+1,q[z]=J-t-M;t=0.5*M;for(var z=0,ra=u.length-1;z<u.length||0<=ra;z++,ra--){b=
|
|
v.reversed?u[ra]:u[z];a=b.color?b.color:v.reversed?v._colorSet[(u.length-1-z)%v._colorSet.length]:v._colorSet[z%v._colorSet.length];c=b.indexLabelPlacement||v.indexLabelPlacement||"outside";d=b.indexLabelBackgroundColor||v.indexLabelBackgroundColor||(w?"transparent":null);f=b.indexLabelFontColor||v.indexLabelFontColor||"#979797";g=b.indexLabelFontSize||v.indexLabelFontSize||12;h=b.indexLabelFontStyle||v.indexLabelFontStyle||"normal";k=b.indexLabelFontFamily||v.indexLabelFontFamily||"arial";l=b.indexLabelFontWeight||
|
|
v.indexLabelFontWeight||"normal";a=b.indexLabelLineColor||v.options.indexLabelLineColor||a;m="number"===typeof b.indexLabelLineThickness?b.indexLabelLineThickness:"number"===typeof v.indexLabelLineThickness?v.indexLabelLineThickness:2;n=b.indexLabelLineDashType||v.indexLabelLineDashType||"solid";p="undefined"!==typeof b.indexLabelWrap?b.indexLabelWrap:"undefined"!==typeof v.indexLabelWrap?v.indexLabelWrap:!0;r=v.dataPointIds[z];s._eventManager.objectMap[r]={id:r,objectType:"dataPoint",dataPointIndex:z,
|
|
dataSeriesIndex:0,funnelSection:L[v.reversed?u.length-1-z:z]};"inside"===v.indexLabelPlacement&&(q[z]=z!==ea?v.reversed?L[z].x2-L[z].x1:L[z].x3-L[z].x4:L[z].x3-L[z].x6,20>q[z]&&(q[z]=z!==ea?v.reversed?L[z].x3-L[z].x4:L[z].x2-L[z].x1:L[z].x2-L[z].x1,q[z]/=2));r=b.indexLabelMaxWidth||v.indexLabelMaxWidth||q[z];if(r>q[z]||0>r)r=q[z];x[z]="inside"===v.indexLabelPlacement?L[z].height:!1;y=s.getPercentAndTotal(v,b);if(v.indexLabelFormatter||b.indexLabelFormatter)A={chart:s.options,dataSeries:v,dataPoint:b,
|
|
total:y.total,percent:y.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(A):b.indexLabel?s.replaceKeywordsWithValue(b.indexLabel,b,v,z):v.indexLabelFormatter?v.indexLabelFormatter(A):v.indexLabel?s.replaceKeywordsWithValue(v.indexLabel,b,v,z):b.label?b.label:"";0>=m&&(m=0);1E3>r&&1E3-r<t&&(r+=1E3-r);Z.roundRect||Aa(Z);c=new ka(Z,{fontSize:g,fontFamily:k,fontColor:f,fontStyle:h,fontWeight:l,horizontalAlign:c,backgroundColor:d,maxWidth:r,maxHeight:!1===x[z]?p?4.28571429*g:1.5*g:x[z],text:b,padding:fa});
|
|
c.measureText();H.push({textBlock:c,id:v.reversed?ra:z,isDirty:!1,lineColor:a,lineThickness:m,lineDashType:n,height:c.height<c.maxHeight?c.height:c.maxHeight,width:c.width<c.maxWidth?c.width:c.maxWidth})}}}function d(){var a,b,c,d,e,f=[];e=!1;c=0;for(var g=J-S-M/2,g=v.options.indexLabelMaxWidth?v.indexLabelMaxWidth>g?g:v.indexLabelMaxWidth:g,h=H.length-1;0<=h;h--){dataPoint=u[H[h].id];c=H[h];d=c.textBlock;b=(a=m(h)<L.length?H[m(h)]:null)?a.textBlock:null;c=c.height;a&&d.y+c+fa>b.y&&(e=!0);c=dataPoint.indexLabelMaxWidth||
|
|
g;if(c>g||0>c)c=g;f.push(c)}if(e)for(h=H.length-1;0<=h;h--)a=L[h],H[h].textBlock.maxWidth=f[f.length-(h+1)],H[h].textBlock.measureText(),H[h].textBlock.x=J-g,c=H[h].textBlock.height<H[h].textBlock.maxHeight?H[h].textBlock.height:H[h].textBlock.maxHeight,e=H[h].textBlock.width<H[h].textBlock.maxWidth?H[h].textBlock.width:H[h].textBlock.maxWidth,H[h].height=c,H[h].width=e,c="undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,H[h].textBlock.y=c-H[h].height/2,v.reversed?(H[h].textBlock.y+H[h].height>
|
|
T+z&&(H[h].textBlock.y=T+z-H[h].height),H[h].textBlock.y<X-z&&(H[h].textBlock.y=X-z)):(H[h].textBlock.y<T-z&&(H[h].textBlock.y=T-z),H[h].textBlock.y+H[h].height>X+z&&(H[h].textBlock.y=X+z-H[h].height))}function g(){var a,b,c,d;if("inside"!==v.indexLabelPlacement)for(var f=0;f<L.length;f++)0==H[f].textBlock.text.length?H[f].isDirty=!0:(a=L[f],c="undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,b=v.reversed?"undefined"!==typeof a.x5?c>$?e(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?
|
|
c<$?e(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,H[f].textBlock.x=b+M,H[f].textBlock.y=c-H[f].height/2,v.reversed?(H[f].textBlock.y+H[f].height>T+z&&(H[f].textBlock.y=T+z-H[f].height),H[f].textBlock.y<X-z&&(H[f].textBlock.y=X-z)):(H[f].textBlock.y<T-z&&(H[f].textBlock.y=T-z),H[f].textBlock.y+H[f].height>X+z&&(H[f].textBlock.y=X+z-H[f].height)));else for(f=0;f<L.length;f++)0==H[f].textBlock.text.length?H[f].isDirty=!0:(a=L[f],b=a.height,c=H[f].height,d=H[f].width,b>=c?(b=f!=ea?(a.x4+a.x3)/2-d/2:(a.x5+
|
|
a.x4)/2-d/2,c=f!=ea?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,H[f].textBlock.x=b,H[f].textBlock.y=c):H[f].isDirty=!0)}function k(){function a(b,c){var d;if(0>b||b>=H.length)return 0;var e,f=H[b].textBlock;if(0>c){c*=-1;e=p(b);d=l(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=m(b);d=l(b,e);if(d>=c)return f.y+=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=(U-N+2*z)/n;h=n;for(var k,l=1;l<
|
|
h;l++){e=l*f;for(var r=H.length-1;0<=r;r--)!H[r].isDirty&&(H[r].textBlock.y<e&&H[r].textBlock.y+H[r].height>e)&&(k=m(r),!(k>=H.length-1)&&H[r].textBlock.y+H[r].height+fa>H[k].textBlock.y&&(H[r].textBlock.y=H[r].textBlock.y+H[r].height-e>e-H[r].textBlock.y?e+1:e-H[r].height-1))}for(k=L.length-1;0<k;k--)if(!H[k].isDirty){e=p(k);if(0>e&&(e=0,H[e].isDirty))break;if(H[k].textBlock.y<H[e].textBlock.y+H[e].height){d=d||k;f=k;for(h=0;H[f].textBlock.y<H[e].textBlock.y+H[e].height+fa;){a=a||H[f].textBlock.y+
|
|
H[f].height;h+=H[f].height;h+=fa;f=e;if(0>=f){f=0;h+=H[f].height;break}e=p(f);if(0>e){f=0;h+=H[f].height;break}}if(f!=k){g=H[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+=H[b.id].height+fa,H[b.id].textBlock.text="",H[b.id].indexLabelText="",H[b.id].isDirty=!0,H[b.id].textBlock.measureText();else break;return g}for(var d,e,f,
|
|
g,h,k,n=1,r=0;r<2*n;r++){for(var t=H.length-1;0<=t&&!(previousTextBlock=(previousLabel=0<=p(t)?H[p(t)]:null)?previousLabel.textBlock:null,f=H[t],g=f.textBlock,k=(h=m(t)<L.length?H[m(t)]:null)?h.textBlock:null,d=+f.height.toFixed(6),e=+g.y.toFixed(6),!f.isDirty&&(h&&e+d+fa>+k.y.toFixed(6))&&(d=g.y+d+fa-k.y,e=a(t,-d),e<d&&(0<e&&(d-=e),e=a(m(t),d),e!=d)));t--);b()}}function l(a,b){return(b<L.length?H[b].textBlock.y:v.reversed?T+z:X+z)-(0>a?v.reversed?X-z:T-z:H[a].textBlock.y+H[a].height+fa)}function n(a,
|
|
b,c){function d(b,c,f,h){ia=!0;var k=((new Date).getTime()-f.startTime)/f.duration,k=f.easingFunction(f.startTime,k,0,f.duration/1E3);1<=k&&(k=1);e(c);f.changeSection(k,b);var l={};l.dataSeries=v;l.dataPoint=v.reversed?v.dataPoints[u.length-1-b]:v.dataPoints[b];l.index=v.reversed?u.length-1-b:b;a.toolTip.highlightObjects([l]);for(l=0;l<L.length;l++)wa(c,L[l],v.fillOpacity);q(c);A&&("inside"!==v.indexLabelPlacement?r(c):g(),t(c));1==k?(ia=!1,h.cancelRequestAnimFrame.call(window,n)):n=h.requestAnimFrame.call(window,
|
|
function(){d(b,c,f,h)})}function e(b){b.clearRect(y.x1,y.y1,y.x2-y.x1,y.y2-y.y1);b.fillStyle=a.backgroundColor;b.fillRect(y.x1,y.y1,y.width,y.height)}var f=[],k,l,m=z,n,p,s=[];-1!==b&&(0<=aa.indexOf(b)?(l=aa.indexOf(b),aa.splice(l,1)):(aa.push(b),aa=aa.sort(function(a,b){return a-b})));if(0===aa.length)f=ja;else{l=z*(1!=aa.length||0!=aa[0]&&aa[0]!=L.length-1?2:1)/h();for(var w=0;w<L.length;w++){if(1==aa.length&&0==aa[0]){if(0===w){f.push(ja[w]);k=m;continue}}else 0===w&&(k=-1*m);f.push(ja[w]+k);if(0<=
|
|
aa.indexOf(w)||w<L.length&&0<=aa.indexOf(w+1))k+=l}}p=function(){for(var a=[],b=0;b<L.length;b++)a.push(f[b]-L[b].y1);return a}();c={startTime:(new Date).getTime(),duration:c||500,easingFunction:function(a,b,c,d){return Q.easing.easeOutQuart(a,b,c,d)},changeSection:function(a){for(var b,c,d=0;d<L.length;d++)b=p[d],c=L[d],newY=b*a,"undefined"===typeof s[d]&&(s[d]=0),0>s&&(s*=-1),c.y1+=newY-s[d],c.y2+=newY-s[d],c.y3+=newY-s[d],c.y4+=newY-s[d],c.y5&&(c.y5+=newY-s[d],c.y6+=newY-s[d]),s[d]=newY}};d(b,
|
|
a.ctx,c,a)}function h(){for(var a=0,b=0;b<L.length-1;b++)(0<=aa.indexOf(b)||0<=aa.indexOf(b+1))&&a++;return a}function r(a){for(var b,c,d,f,g=0;g<L.length;g++)f=1===H[g].lineThickness%2?0.5:0,c=((L[g].y2+L[g].y4)/2<<0)+f,b=e(c).x2-1,d=H[g].textBlock.x,f=(H[g].textBlock.y+H[g].height/2<<0)+f,H[g].isDirty||0==H[g].lineThickness||(a.strokeStyle=H[g].lineColor,a.lineWidth=H[g].lineThickness,a.setLineDash&&a.setLineDash(F(H[g].lineDashType,H[g].lineThickness)),a.beginPath(),a.moveTo(b,c),a.lineTo(d,f),
|
|
a.stroke())}function p(a){for(a-=1;-1<=a&&-1!=a&&H[a].isDirty;a--);return a}function m(a){for(a+=1;a<=L.length&&a!=L.length&&H[a].isDirty;a++);return a}function e(a){for(var b,c=0;c<u.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 t(a){for(var b=0;b<L.length;b++)H[b].isDirty||(a&&(H[b].textBlock.ctx=a),H[b].textBlock.render(!0))}function q(a){s.plotArea.layoutManager.reset();
|
|
a.roundRect||Aa(a);s.title&&(s.title.dockInsidePlotArea||"center"===s.title.horizontalAlign&&"center"===s.title.verticalAlign)&&(s.title.ctx=a,s.title.render());if(s.subtitles)for(var b=0;b<s.subtitles.length;b++){var c=s.subtitles[b];if(c.dockInsidePlotArea||"center"===c.horizontalAlign&&"center"===c.verticalAlign)s.subtitles.ctx=a,c.render()}s.legend&&(s.legend.dockInsidePlotArea||"center"===s.legend.horizontalAlign&&"center"===s.legend.verticalAlign)&&(s.legend.ctx=a,s.legend.render());V.fNg&&
|
|
V.fNg(s)}var s=this;if(!(0>=a.dataSeriesIndexes.length)){for(var v=this.data[a.dataSeriesIndexes[0]],u=v.dataPoints,y=this.plotArea,z=0.025*y.width,D=0.01*y.width,A=!1,B=0;B<u.length;B++)if(!A&&("undefined"!==typeof u[B].indexLabel&&null!==u[B].indexLabel&&0<u[B].indexLabel.toString().length)&&(A=!0),!A&&("undefined"!==typeof u[B].label&&null!==u[B].label&&0<u[B].label.toString().length)&&(A=!0),!A&&"function"===typeof v.indexLabelFormatter||"function"===typeof u[B].indexLabelFormatter)A=!0;A=A||
|
|
"undefined"!==typeof v.indexLabel&&null!==v.indexLabel&&0<v.indexLabel.toString().length;"inside"!==v.indexLabelPlacement&&A||(D=12.5*y.width/100);var B=y.x1+D,J=y.x2-D,N=y.y1+z,U=y.y2-z,P=y.height-2*z,D=y.width,Z=a.targetCanvasCtx||this.plotArea.ctx||this.ctx;if(0!=v.length&&(v.dataPoints&&v.visible)&&0!==u.length){var O,I,D=75*D/100,M=30*(J-D)/100;"funnel"===v.type?(O=v.neckHeight,I=v.neckWidth,"string"===typeof O&&O.match(/%$/)?(O=parseInt(O),O=O*P/100):O=parseInt(O),"string"===typeof I&&I.match(/%$/)?
|
|
(I=parseInt(I),I=I*D/100):I=parseInt(I),O>P?O=P:0>=O&&(O=!0),I>D?I=D-0.5:0>=I&&(I=!0)):"pyramid"===v.type&&(I=O=!0,v.reversed=v.reversed?!1:!0);O=O?"number"===typeof O?O:0:0.35*P;I=I?"number"===typeof I?I:0:0.25*D;var R=B+D/2,W=B,S=B+D,T=v.reversed?U:N,Y=R-I/2,K=R+I/2,$=v.reversed?N+O:U-O,X=v.reversed?N:U,D=[],R=[],L=[],ha=[],ca=N,ea,da=($-T)/(Y-W),ga=-da,B="area"===(v.valueRepresents?v.valueRepresents:"height")?b():f();if(-1!==B){if(v.reversed)for(ha.push(ca),I=B.length-1;0<I;I--)ca+=B[I],ha.push(ca);
|
|
else for(I=0;I<B.length;I++)ca+=B[I],ha.push(ca);if(v.reversed)for(I=0;I<B.length;I++)ha[I]<$?(D.push(Y),R.push(K),ea=I):(D.push((ha[I]-T+da*W)/da),R.push((ha[I]-T+ga*S)/ga));else for(I=0;I<B.length;I++)ha[I]<$?(D.push((ha[I]-T+da*W)/da),R.push((ha[I]-T+ga*S)/ga),ea=I):(D.push(Y),R.push(K));for(I=0;I<B.length-1;I++)ca=v.reversed?u[u.length-1-I].color?u[u.length-1-I].color:v._colorSet[(u.length-1-I)%v._colorSet.length]:u[I].color?u[I].color:v._colorSet[I%v._colorSet.length],I===ea?L.push({x1:D[I],
|
|
y1:ha[I],x2:R[I],y2:ha[I],x3:K,y3:$,x4:R[I+1],y4:ha[I+1],x5:D[I+1],y5:ha[I+1],x6:Y,y6:$,id:I,height:ha[I+1]-ha[I],color:ca}):L.push({x1:D[I],y1:ha[I],x2:R[I],y2:ha[I],x3:R[I+1],y3:ha[I+1],x4:D[I+1],y4:ha[I+1],id:I,height:ha[I+1]-ha[I],color:ca});var fa=2,H=[],ia=!1,aa=[],ja=[],la=!1;for(I=0;I<u.length;I++)u[I].exploded&&(la=!0,v.reversed?aa.push(u.length-1-I):aa.push(I));Z.clearRect(y.x1,y.y1,y.width,y.height);Z.fillStyle=s.backgroundColor;Z.fillRect(y.x1,y.y1,y.width,y.height);for(I=0;I<L.length;I++)B=
|
|
L[I],wa(Z,B,v.fillOpacity),ja.push(B.y1);q(Z);A&&v.visible&&(c(),g(),d(),"inside"!==v.indexLabelPlacement&&(k(),s.animationEnabled||r(Z)),s.animationEnabled||t());if(!A)for(I=0;I<u.length;I++)B=v.dataPointIds[I],D={id:B,objectType:"dataPoint",dataPointIndex:I,dataSeriesIndex:0,funnelSection:L[v.reversed?u.length-1-I:I]},s._eventManager.objectMap[B]=D;s.animationEnabled&&s.animatedRender?setTimeout(function(){la&&n(s,-1);A&&(t(),"inside"!==v.indexLabelPlacement&&r(Z));a.targetCtx=null},s.animationDuration):
|
|
la?(n(s,-1,1),A&&(t(),"inside"!==v.indexLabelPlacement&&r(Z))):s.animationEnabled&&A&&(t(),"inside"!==v.indexLabelPlacement&&r(Z));this.funnelPyramidClickHandler=function(a){var b=-1;if(!ia&&!s.isAnimating&&(x(a.dataSeries.explodeOnClick)||a.dataSeries.explodeOnClick)&&(b=v.reversed?u.length-1-a.dataPointIndex:a.dataPointIndex,0<=b)){a=b;if("funnel"===v.type||"pyramid"===v.type)v.reversed?u[u.length-1-a].exploded=u[u.length-1-a].exploded?!1:!0:u[a].exploded=u[a].exploded?!1:!0;n(s,b)}};return{source:Z,
|
|
dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}}}};u.prototype.animationRequestId=null;u.prototype.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();u.prototype.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||
|
|
window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;u.prototype.set=function(a,f,b){b="undefined"===typeof b?!0:b;"options"===a?(this.options=f,b&&this.render()):u.base.set.call(this,a,f,b)};u.prototype.exportChart=function(a){a="undefined"===typeof a?{}:a;var f=a.format?a.format:"png",b=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+f);s(this.canvas,f,b)};u.prototype.print=function(){var a=
|
|
this.exportChart({toDataURL:!0}),f=document.createElement("iframe");f.setAttribute("class","canvasjs-chart-print-frame");f.setAttribute("style","position:absolute; width:100%; border: 0px; margin: 0px 0px 0px 0px; padding 0px 0px 0px 0px;");f.style.height=this.height+"px";this._canvasJSContainer.appendChild(f);var b=this,c=f.contentWindow||f.contentDocument.document||f.contentDocument;c.document.open();c.document.write('<!DOCTYPE HTML>\n<html><body style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;"><img src="'+
|
|
a+'"/><body/></html>');c.document.close();setTimeout(function(){c.focus();c.print();setTimeout(function(){b._canvasJSContainer.removeChild(f)},1E3)},500)};u.prototype.getPercentAndTotal=function(a,f){var b=null,c=null,d=null;if(0<=a.type.indexOf("stacked"))c=0,b=f.x.getTime?f.x.getTime():f.x,b in a.plotUnit.yTotals&&(c=a.plotUnit.yTotals[b],d=isNaN(f.y)?0:100*(f.y/c));else if("pie"===a.type||"doughnut"===a.type||"funnel"===a.type||"pyramid"===a.type){for(i=c=0;i<a.dataPoints.length;i++)isNaN(a.dataPoints[i].y)||
|
|
(c+=a.dataPoints[i].y);d=isNaN(f.y)?0:100*(f.y/c)}return{percent:d,total:c}};u.prototype.replaceKeywordsWithValue=function(a,f,b,c,d){var g=this;d="undefined"===typeof d?0:d;if((0<=b.type.indexOf("stacked")||"pie"===b.type||"doughnut"===b.type||"funnel"===b.type||"pyramid"===b.type)&&(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))){var k="#percent",l="#total",n=this.getPercentAndTotal(b,f),l=isNaN(n.total)?l:n.total,k=isNaN(n.percent)?k:n.percent;do{n="";if(b.percentFormatString)n=b.percentFormatString;
|
|
else{var n="#,##0.",h=Math.max(Math.ceil(Math.log(1/Math.abs(k))/Math.LN10),2);if(isNaN(h)||!isFinite(h))h=2;for(var r=0;r<h;r++)n+="#";b.percentFormatString=n}a=a.replace("#percent",ea(k,n,g._cultureInfo));a=a.replace("#total",ea(l,b.yValueFormatString?b.yValueFormatString:"#,##0.########",g._cultureInfo))}while(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))}return a.replace(/\{.*?\}|"[^"]*"|'[^']*'/g,function(a){if('"'===a[0]&&'"'===a[a.length-1]||"'"===a[0]&&"'"===a[a.length-1])return a.slice(1,
|
|
a.length-1);a=Da(a.slice(1,a.length-1));a=a.replace("#index",d);var h=null;try{var e=a.match(/(.*?)\s*\[\s*(.*?)\s*\]/);e&&0<e.length&&(h=Da(e[2]),a=Da(e[1]))}catch(k){}e=null;if("color"===a)return"waterfall"===b.type?f.color?f.color:-1<f.y?b.risingColor:b.fallingColor:"error"===b.type?b.color?b.color:b._colorSet[h%b._colorSet.length]:f.color?f.color:b.color?b.color:b._colorSet[c%b._colorSet.length];if(f.hasOwnProperty(a))e=f;else if(b.hasOwnProperty(a))e=b;else return"";e=e[a];null!==h&&(e=e[h]);
|
|
if("x"===a)if("dateTime"===g.plotInfo.axisXValueType||"dateTime"===b.xValueType||f.x&&f.x.getTime){if(g.plotInfo.plotTypes[0].plotUnits[0].axisX&&!g.plotInfo.plotTypes[0].plotUnits[0].axisX.logarithmic)return za(e,f.xValueFormatString?f.xValueFormatString:b.xValueFormatString?b.xValueFormatString:b.xValueFormatString=g.axisX&&g.axisX.autoValueFormatString?g.axisX.autoValueFormatString:"DD MMM YY",g._cultureInfo)}else return ea(e,f.xValueFormatString?f.xValueFormatString:b.xValueFormatString?b.xValueFormatString:
|
|
b.xValueFormatString="#,##0.########",g._cultureInfo);else return"y"===a?ea(e,f.yValueFormatString?f.yValueFormatString:b.yValueFormatString?b.yValueFormatString:b.yValueFormatString="#,##0.########",g._cultureInfo):"z"===a?ea(e,f.zValueFormatString?f.zValueFormatString:b.zValueFormatString?b.zValueFormatString:b.zValueFormatString="#,##0.########",g._cultureInfo):e})};la(S,T);S.prototype.render=function(){var a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,f=a.layoutManager.getFreeSpace(),
|
|
b=null,c=0,d=0,g=0,k=0,l=this.markerMargin=this.chart.options.legend&&!x(this.chart.options.legend.markerMargin)?this.chart.options.legend.markerMargin:0.3*this.fontSize;this.height=0;var n=[],h=[];"top"===this.verticalAlign||"bottom"===this.verticalAlign?(this.orientation="horizontal",b=this.verticalAlign,g=this.maxWidth=null!==this.maxWidth?this.maxWidth:f.width,k=this.maxHeight=null!==this.maxHeight?this.maxHeight:0.5*f.height):"center"===this.verticalAlign&&(this.orientation="vertical",b=this.horizontalAlign,
|
|
g=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*f.width,k=this.maxHeight=null!==this.maxHeight?this.maxHeight:f.height);for(var r=[],p=0;p<this.dataSeries.length;p++){var m=this.dataSeries[p];if(m.dataPoints&&m.dataPoints.length)if("pie"!==m.type&&"doughnut"!==m.type&&"funnel"!==m.type&&"pyramid"!==m.type){var e=m.legendMarkerType=m.legendMarkerType?m.legendMarkerType:"line"!==m.type&&"stepLine"!==m.type&&"spline"!==m.type&&"scatter"!==m.type&&"bubble"!==m.type||!m.markerType?"error"===m.type&&
|
|
m._linkedSeries?m._linkedSeries.legendMarkerType?m._linkedSeries.legendMarkerType:R.getDefaultLegendMarker(m._linkedSeries.type):R.getDefaultLegendMarker(m.type):m.markerType,t=m.legendText?m.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:m,dataPoint:null}):m.name,q=m.legendMarkerColor=m.legendMarkerColor?m.legendMarkerColor:m.markerColor?m.markerColor:"error"===m.type?x(m.whiskerColor)?m._colorSet[0]:m.whiskerColor:m._colorSet[0],s=m.markerSize||
|
|
"line"!==m.type&&"stepLine"!==m.type&&"spline"!==m.type?0.75*this.lineHeight:0,v=m.legendMarkerBorderColor?m.legendMarkerBorderColor:m.markerBorderColor,u=m.legendMarkerBorderThickness?m.legendMarkerBorderThickness:m.markerBorderThickness?Math.max(1,Math.round(0.2*s)):0;"error"===m.type&&r.push(q);t=this.chart.replaceKeywordsWithValue(t,m.dataPoints[0],m,p);e={markerType:e,markerColor:q,text:t,textBlock:null,chartType:m.type,markerSize:s,lineColor:m._colorSet[0],dataSeriesIndex:m.index,dataPointIndex:null,
|
|
markerBorderColor:v,markerBorderThickness:u};n.push(e)}else for(var w=0;w<m.dataPoints.length;w++){var y=m.dataPoints[w],e=y.legendMarkerType?y.legendMarkerType:m.legendMarkerType?m.legendMarkerType:R.getDefaultLegendMarker(m.type),t=y.legendText?y.legendText:m.legendText?m.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:m,dataPoint:y}):y.name?y.name:"DataPoint: "+(w+1),q=y.legendMarkerColor?y.legendMarkerColor:m.legendMarkerColor?m.legendMarkerColor:
|
|
y.color?y.color:m.color?m.color:m._colorSet[w%m._colorSet.length],s=0.75*this.lineHeight,v=y.legendMarkerBorderColor?y.legendMarkerBorderColor:m.legendMarkerBorderColor?m.legendMarkerBorderColor:y.markerBorderColor?y.markerBorderColor:m.markerBorderColor,u=y.legendMarkerBorderThickness?y.legendMarkerBorderThickness:m.legendMarkerBorderThickness?m.legendMarkerBorderThickness:y.markerBorderThickness||m.markerBorderThickness?Math.max(1,Math.round(0.2*s)):0,t=this.chart.replaceKeywordsWithValue(t,y,m,
|
|
w),e={markerType:e,markerColor:q,text:t,textBlock:null,chartType:m.type,markerSize:s,dataSeriesIndex:p,dataPointIndex:w,markerBorderColor:v,markerBorderThickness:u};(y.showInLegend||m.showInLegend&&!1!==y.showInLegend)&&n.push(e)}}!0===this.reversed&&n.reverse();if(0<n.length){m=null;t=w=y=u=0;y=null!==this.itemWidth?null!==this.itemMaxWidth?Math.min(this.itemWidth,this.itemMaxWidth,g):this.itemMaxWidth=Math.min(this.itemWidth,g):null!==this.itemMaxWidth?Math.min(this.itemMaxWidth,g):this.itemMaxWidth=
|
|
g;s=0===s?0.75*this.lineHeight:s;y-=s+l;for(p=0;p<n.length;p++){e=n[p];if("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType)y-=2*0.1*this.lineHeight;if(!(0>=k||"undefined"===typeof k||0>=y||"undefined"===typeof y)){if("horizontal"===this.orientation){e.textBlock=new ka(this.ctx,{x:0,y:0,maxWidth:y,maxHeight:this.itemWrap?k:this.lineHeight,angle:0,text:e.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,
|
|
fontStyle:this.fontStyle,textBaseline:"middle"});e.textBlock.measureText();null!==this.itemWidth&&(e.textBlock.width=this.itemWidth-(s+l+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0)));if(!m||m.width+Math.round(e.textBlock.width+s+l+(0===m.width?0:this.horizontalSpacing)+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0))>g)m={items:[],width:0},h.push(m),this.height+=w,w=0;w=Math.max(w,e.textBlock.height)}else e.textBlock=
|
|
new ka(this.ctx,{x:0,y:0,maxWidth:y,maxHeight:!0===this.itemWrap?k:1.5*this.fontSize,angle:0,text:e.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),e.textBlock.measureText(),null!==this.itemWidth&&(e.textBlock.width=this.itemWidth-(s+l+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0))),this.height<k-this.lineHeight?(m={items:[],
|
|
width:0},h.push(m)):(m=h[u],u=(u+1)%h.length),this.height+=e.textBlock.height;e.textBlock.x=m.width;e.textBlock.y=0;m.width+=Math.round(e.textBlock.width+s+l+(0===m.width?0:this.horizontalSpacing)+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0));m.items.push(e);this.width=Math.max(m.width,this.width);t=e.textBlock.width+(s+l+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0))}}this.itemWidth=t;this.height=
|
|
!1===this.itemWrap?h.length*this.lineHeight:this.height+w;this.height=Math.min(k,this.height);this.width=Math.min(g,this.width)}"top"===this.verticalAlign?(d="left"===this.horizontalAlign?f.x1:"right"===this.horizontalAlign?f.x2-this.width:f.x1+f.width/2-this.width/2,c=f.y1):"center"===this.verticalAlign?(d="left"===this.horizontalAlign?f.x1:"right"===this.horizontalAlign?f.x2-this.width:f.x1+f.width/2-this.width/2,c=f.y1+f.height/2-this.height/2):"bottom"===this.verticalAlign&&(d="left"===this.horizontalAlign?
|
|
f.x1:"right"===this.horizontalAlign?f.x2-this.width:f.x1+f.width/2-this.width/2,c=f.y2-this.height);this.items=n;for(p=0;p<this.items.length;p++)e=n[p],e.id=++this.chart._eventManager.lastObjectId,this.chart._eventManager.objectMap[e.id]={id:e.id,objectType:"legendItem",legendItemIndex:p,dataSeriesIndex:e.dataSeriesIndex,dataPointIndex:e.dataPointIndex};(0<this.borderThickness&&this.borderColor||this.backgroundColor)&&this.ctx.roundRect(d,c,this.width,this.height,this.cornerRadius,this.borderThickness,
|
|
this.backgroundColor,this.borderColor);for(p=f=0;p<h.length;p++){m=h[p];for(y=w=0;y<m.items.length;y++){e=m.items[y];q=e.textBlock.x+d+(0===y?0.2*s:this.horizontalSpacing);v=c+f;t=q;this.chart.data[e.dataSeriesIndex].visible||(this.ctx.globalAlpha=0.5);this.ctx.save();this.ctx.beginPath();this.ctx.rect(d,c,g,Math.max(k-k%this.lineHeight,0));this.ctx.clip();if("line"===e.chartType||"stepLine"===e.chartType||"spline"===e.chartType)this.ctx.strokeStyle=e.lineColor,this.ctx.lineWidth=Math.ceil(this.lineHeight/
|
|
8),this.ctx.beginPath(),this.ctx.moveTo(q-0.1*this.lineHeight,v+this.lineHeight/2),this.ctx.lineTo(q+0.85*this.lineHeight,v+this.lineHeight/2),this.ctx.stroke(),t-=0.1*this.lineHeight;if("error"===e.chartType){this.ctx.strokeStyle=r[0];u=s/8;this.ctx.lineWidth=u;this.ctx.beginPath();var u=q-0.08*this.lineHeight+0.1*this.lineHeight,z=v+0.15*this.lineHeight,A=0.7*this.lineHeight,B=A+0.02*this.lineHeight;this.ctx.moveTo(u,z);this.ctx.lineTo(u+A,z);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(u+
|
|
A/2,z);this.ctx.lineTo(u+A/2,z+B);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(u,z+B);this.ctx.lineTo(u+A,z+B);this.ctx.stroke();r.shift()}aa.drawMarker(q+s/2,v+this.lineHeight/2,this.ctx,e.markerType,"error"===e.chartType||"line"===e.chartType||"spline"===e.chartType?e.markerSize/2:e.markerSize,e.markerColor,e.markerBorderColor,e.markerBorderThickness);e.textBlock.x=q+l+s;if("line"===e.chartType||"stepLine"===e.chartType||"spline"===e.chartType)e.textBlock.x+=0.1*this.lineHeight;e.textBlock.y=
|
|
Math.round(v+this.lineHeight/2);e.textBlock.render(!0);this.ctx.restore();w=0<y?Math.max(w,e.textBlock.height):e.textBlock.height;this.chart.data[e.dataSeriesIndex].visible||(this.ctx.globalAlpha=1);u=W(e.id);this.ghostCtx.fillStyle=u;this.ghostCtx.beginPath();this.ghostCtx.fillRect(t,e.textBlock.y-this.lineHeight/2,e.textBlock.x+e.textBlock.width-t,e.textBlock.height);e.x1=this.chart._eventManager.objectMap[e.id].x1=t;e.y1=this.chart._eventManager.objectMap[e.id].y1=e.textBlock.y-this.lineHeight/
|
|
2;e.x2=this.chart._eventManager.objectMap[e.id].x2=e.textBlock.x+e.textBlock.width;e.y2=this.chart._eventManager.objectMap[e.id].y2=e.textBlock.y+e.textBlock.height-this.lineHeight/2}f+=w}0<n.length&&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}};la(R,T);R.prototype.getDefaultAxisPlacement=function(){var a=this.type;if("column"===a||"line"===a||"stepLine"===a||"spline"===a||"area"===a||"stepArea"===a||"splineArea"===
|
|
a||"stackedColumn"===a||"stackedLine"===a||"bubble"===a||"scatter"===a||"stackedArea"===a||"stackedColumn100"===a||"stackedLine100"===a||"stackedArea100"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeArea"===a||"rangeSplineArea"===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};R.getDefaultLegendMarker=function(a){if("column"===a||"stackedColumn"===a||"stackedLine"===a||"bar"===a||"stackedBar"===a||"stackedBar100"===a||"bubble"===a||"scatter"===a||"stackedColumn100"===a||"stackedLine100"===a||"stepArea"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeBar"===a||"rangeArea"===a||"rangeSplineArea"===a||"boxAndWhisker"===a||"waterfall"===a)return"square";if("line"===a||"stepLine"===a||"spline"===a||"pie"===a||"doughnut"===a)return"circle";if("area"===
|
|
a||"splineArea"===a||"stackedArea"===a||"stackedArea100"===a||"funnel"===a||"pyramid"===a)return"triangle";if("error"===a)return"none";window.console.log("Unknown Chart Type: "+a);return null};R.prototype.getDataPointAtX=function(a,f){if(!this.dataPoints||0===this.dataPoints.length)return null;var b={dataPoint:null,distance:Infinity,index:NaN},c=null,d=0,g=0,k=1,l=Infinity,n=0,h=0,r=0;"none"!==this.chart.plotInfo.axisPlacement&&(this.axisX.logarithmic?(r=Math.log(this.dataPoints[this.dataPoints.length-
|
|
1].x/this.dataPoints[0].x),r=1<r?Math.min(Math.max((this.dataPoints.length-1)/r*Math.log(a/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0):(r=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,r=0<r?Math.min(Math.max((this.dataPoints.length-1)/r*(a-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0));for(;;){g=0<k?r+d:r-d;if(0<=g&&g<this.dataPoints.length){var c=this.dataPoints[g],p=this.axisX.logarithmic?c.x>a?c.x/a:a/c.x:Math.abs(c.x-a);p<b.distance&&(b.dataPoint=c,b.distance=
|
|
p,b.index=g);c=p;c<=l?l=c:0<k?n++:h++;if(1E3<n&&1E3<h)break}else if(0>r-d&&r+d>=this.dataPoints.length)break;-1===k?(d++,k=1):k=-1}return f||b.dataPoint.x!==a?f&&null!==b.dataPoint?b:null:b};R.prototype.getDataPointAtXY=function(a,f,b){if(!this.dataPoints||0===this.dataPoints.length||a<this.chart.plotArea.x1||a>this.chart.plotArea.x2||f<this.chart.plotArea.y1||f>this.chart.plotArea.y2)return null;b=b||!1;var c=[],d=0,g=0,k=1,l=!1,n=Infinity,h=0,r=0,p=0;if("none"!==this.chart.plotInfo.axisPlacement)if(p=
|
|
(this.chart.axisX[0]?this.chart.axisX[0]:this.chart.axisX2[0]).getXValueAt({x:a,y:f}),this.axisX.logarithmic)var m=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),p=1<m?Math.min(Math.max((this.dataPoints.length-1)/m*Math.log(p/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;else m=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0<m?Math.min(Math.max((this.dataPoints.length-1)/m*(p-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;for(;;){g=0<
|
|
k?p+d:p-d;if(0<=g&&g<this.dataPoints.length){var m=this.chart._eventManager.objectMap[this.dataPointIds[g]],e=this.dataPoints[g],t=null;if(m){switch(this.type){case "column":case "stackedColumn":case "stackedColumn100":case "bar":case "stackedBar":case "stackedBar100":case "rangeColumn":case "rangeBar":case "waterfall":case "error":a>=m.x1&&(a<=m.x2&&f>=m.y1&&f<=m.y2)&&(c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(m.x1-a),Math.abs(m.x2-a),Math.abs(m.y1-f),Math.abs(m.y2-
|
|
f))}),l=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var q=ja("markerSize",e,this)||4,s=b?20:q,t=Math.sqrt(Math.pow(m.x1-a,2)+Math.pow(m.y1-f,2));t<=s&&c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:t});m=Math.abs(m.x1-a);m<=n?n=m:0<k?h++:r++;t<=q/2&&(l=!0);break;case "rangeArea":case "rangeSplineArea":q=ja("markerSize",e,this)||4;s=b?20:q;t=Math.min(Math.sqrt(Math.pow(m.x1-
|
|
a,2)+Math.pow(m.y1-f,2)),Math.sqrt(Math.pow(m.x1-a,2)+Math.pow(m.y2-f,2)));t<=s&&c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:t});m=Math.abs(m.x1-a);m<=n?n=m:0<k?h++:r++;t<=q/2&&(l=!0);break;case "bubble":q=m.size;t=Math.sqrt(Math.pow(m.x1-a,2)+Math.pow(m.y1-f,2));t<=q/2&&(c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:t}),l=!0);break;case "pie":case "doughnut":q=m.center;s="doughnut"===this.type?m.percentInnerRadius*m.radius:0;t=Math.sqrt(Math.pow(q.x-a,2)+Math.pow(q.y-
|
|
f,2));t<m.radius&&t>s&&(t=Math.atan2(f-q.y,a-q.x),0>t&&(t+=2*Math.PI),t=Number(((180*(t/Math.PI)%360+360)%360).toFixed(12)),q=Number(((180*(m.startAngle/Math.PI)%360+360)%360).toFixed(12)),s=Number(((180*(m.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===s&&1<m.endAngle&&(s=360),q>=s&&0!==e.y&&(s+=360,t<q&&(t+=360)),t>q&&t<s&&(c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:0}),l=!0));break;case "funnel":case "pyramid":t=m.funnelSection;f>t.y1&&f<t.y4&&(t.y6?f>t.y6?(g=t.x6+(t.x5-t.x6)/
|
|
(t.y5-t.y6)*(f-t.y6),t=t.x3+(t.x4-t.x3)/(t.y4-t.y3)*(f-t.y3)):(g=t.x1+(t.x6-t.x1)/(t.y6-t.y1)*(f-t.y1),t=t.x2+(t.x3-t.x2)/(t.y3-t.y2)*(f-t.y2)):(g=t.x1+(t.x4-t.x1)/(t.y4-t.y1)*(f-t.y1),t=t.x2+(t.x3-t.x2)/(t.y3-t.y2)*(f-t.y2)),a>g&&a<t&&(c.push({dataPoint:e,dataPointIndex:m.dataPointIndex,dataSeries:this,distance:0}),l=!0));break;case "boxAndWhisker":if(a>=m.x1-m.borderThickness/2&&a<=m.x2+m.borderThickness/2&&f>=m.y4-m.borderThickness/2&&f<=m.y1+m.borderThickness/2||Math.abs(m.x2-a+m.x1-a)<m.borderThickness&&
|
|
f>=m.y1&&f<=m.y4)c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(m.x1-a),Math.abs(m.x2-a),Math.abs(m.y2-f),Math.abs(m.y3-f))}),l=!0;break;case "candlestick":if(a>=m.x1-m.borderThickness/2&&a<=m.x2+m.borderThickness/2&&f>=m.y2-m.borderThickness/2&&f<=m.y3+m.borderThickness/2||Math.abs(m.x2-a+m.x1-a)<m.borderThickness&&f>=m.y1&&f<=m.y4)c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(m.x1-a),Math.abs(m.x2-a),Math.abs(m.y2-f),Math.abs(m.y3-
|
|
f))}),l=!0;break;case "ohlc":if(Math.abs(m.x2-a+m.x1-a)<m.borderThickness&&f>=m.y2&&f<=m.y3||a>=m.x1&&a<=(m.x2+m.x1)/2&&f>=m.y1-m.borderThickness/2&&f<=m.y1+m.borderThickness/2||a>=(m.x1+m.x2)/2&&a<=m.x2&&f>=m.y4-m.borderThickness/2&&f<=m.y4+m.borderThickness/2)c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(m.x1-a),Math.abs(m.x2-a),Math.abs(m.y2-f),Math.abs(m.y3-f))}),l=!0}if(l||1E3<h&&1E3<r)break}}else if(0>p-d&&p+d>=this.dataPoints.length)break;-1===k?(d++,k=1):
|
|
k=-1}a=null;for(f=0;f<c.length;f++)a?c[f].distance<=a.distance&&(a=c[f]):a=c[f];return a};R.prototype.getMarkerProperties=function(a,f,b,c){var d=this.dataPoints;return{x:f,y:b,ctx:c,type:d[a].markerType?d[a].markerType:this.markerType,size:d[a].markerSize?d[a].markerSize:this.markerSize,color: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],borderColor:d[a].markerBorderColor?d[a].markerBorderColor:
|
|
this.markerBorderColor?this.markerBorderColor:null,borderThickness:d[a].markerBorderThickness?d[a].markerBorderThickness:this.markerBorderThickness?this.markerBorderThickness:null}};la(B,T);B.prototype.createExtraLabelsForLog=function(a){a=(a||0)+1;if(!(5<a)){var f=this.logLabelValues[0]||this.intervalStartPosition;if(Math.log(this.range)/Math.log(f/this.viewportMinimum)<this.noTicks-1){for(var b=B.getNiceNumber((f-this.viewportMinimum)/Math.min(Math.max(2,this.noTicks-this.logLabelValues.length),
|
|
3),!0),c=Math.ceil(this.viewportMinimum/b)*b;c<f;c+=b)c<this.viewportMinimum||this.logLabelValues.push(c);this.logLabelValues.sort(Na);this.createExtraLabelsForLog(a)}}};B.prototype.createLabels=function(){var a,f,b=0,c=0,d,g=0,k=0,c=0,l=this.interval,n=0,h,r=0.6*this.chart.height,b=!1,p;a=!1;var m=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],e=m.length?x(this.scaleBreaks.firstBreakIndex)?0:this.scaleBreaks.firstBreakIndex:0;if(this.dataSeries&&0<this.dataSeries.length)for(c=0;c<this.dataSeries.length;c++)"dateTime"===
|
|
this.dataSeries[c].xValueType&&(b=!0);if("axisX"===this.type&&b&&!this.logarithmic){this.intervalStartPosition=this.getLabelStartPoint(new Date(this.viewportMinimum),this.intervalType,this.interval);d=Ra(new Date(this.viewportMaximum),this.interval,this.intervalType);for(var t=e,b=this.intervalStartPosition;b<d;Ra(b,l,this.intervalType)){for(a=b.getTime();t<m.length&&a>m[t].endValue;t++);p=a;a=t<m.length&&a>=m[t].startValue&&a<=m[t].endValue;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,
|
|
axis:this.options,value:new Date(p),label:this.labels[p]?this.labels[p]:null}):"axisX"===this.type&&this.labels[p]?this.labels[p]:za(p,this.valueFormatString,this.chart._cultureInfo),a=new ka(this.ctx,{x:0,y:0,maxWidth:g,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,maxHeight:k,angle:this.labelAngle,text:this.prefix+a+this.suffix,horizontalAlign:"left",fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,
|
|
fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"}),this._labels.push({position:p,textBlock:a,effectiveHeight:null,breaksLabelType:void 0}))}}else{d=this.viewportMaximum;if(this.labels){a=Math.ceil(l);c=Math.ceil(this.intervalStartPosition);t=!1;for(b=c;b<this.viewportMaximum;b+=a)if(this.labels[b])t=!0;else{t=!1;break}t&&(this.interval=a,this.intervalStartPosition=c)}if(this.logarithmic&&!this.equidistantInterval)for(this.logLabelValues||
|
|
(this.logLabelValues=[],this.createExtraLabelsForLog()),c=0,t=e;c<this.logLabelValues.length;c++)if(b=this.logLabelValues[c],b<this.viewportMinimum)c++;else{for(;t<m.length&&b>m[t].endValue;t++);a=t<m.length&&b>=m[t].startValue&&b<=m[t].endValue;p=b;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:p,label:this.labels[p]?this.labels[p]:null}):"axisX"===this.type&&this.labels[p]?this.labels[p]:ea(p,this.valueFormatString,this.chart._cultureInfo),a=new ka(this.ctx,
|
|
{x:0,y:0,maxWidth:g,maxHeight:k,angle:this.labelAngle,text:this.prefix+a+this.suffix,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,horizontalAlign:"left",fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle",borderThickness:0}),this._labels.push({position:p,textBlock:a,effectiveHeight:null}))}t=
|
|
e;for(b=this.intervalStartPosition;b<=d;b=parseFloat((this.logarithmic&&this.equidistantInterval?b*Math.pow(this.logarithmBase,this.interval):b+this.interval).toFixed(12))){for(;t<m.length&&b>m[t].endValue;t++);a=t<m.length&&b>=m[t].startValue&&b<=m[t].endValue;p=b;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:p,label:this.labels[p]?this.labels[p]:null}):"axisX"===this.type&&this.labels[p]?this.labels[p]:ea(p,this.valueFormatString,this.chart._cultureInfo),
|
|
a=new ka(this.ctx,{x:0,y:0,maxWidth:g,maxHeight:k,angle:this.labelAngle,text:this.prefix+a+this.suffix,horizontalAlign:"left",backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"}),this._labels.push({position:p,textBlock:a,effectiveHeight:null}))}}if("bottom"===
|
|
this._position||"top"===this._position)n=this.logarithmic&&!this.equidistantInterval&&2<=this._labels.length?this.lineCoordinates.width*Math.log(Math.min(this._labels[this._labels.length-1].position/this._labels[this._labels.length-2].position,this._labels[1].position/this._labels[0].position))/Math.log(this.range):this.lineCoordinates.width/(this.logarithmic&&this.equidistantInterval?Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*M[this.intervalType+"Duration"]*this.interval,
|
|
g="undefined"===typeof this.options.labelMaxWidth?0.5*this.chart.width>>0:this.options.labelMaxWidth,this.chart.panEnabled||(k="undefined"===typeof this.options.labelWrap||this.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize);else if("left"===this._position||"right"===this._position)n=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))*M[this.intervalType+"Duration"]*this.interval,this.chart.panEnabled||(g="undefined"===typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),k="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=g,a.maxHeight=k,p=a.measureText(),h=p.height;m=[];e=d=0;if(this.labelAutoFit||this.options.labelAutoFit)if(x(this.labelAngle)||(this.labelAngle=(this.labelAngle%360+360)%360,90<this.labelAngle&&270>this.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360)),"bottom"===this._position||"top"===this._position)if(g=0.9*n>>0,e=0,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;
|
|
this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=k;this.sessionVariables.labelAngle=this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;b<this._labels.length;b++)if(!this._labels[b].breaksLabelType){a=this._labels[b].textBlock;for(var q,t=a.text.split(" "),c=0;c<t.length;c++)l=t[c],this.ctx.font=a.fontStyle+" "+a.fontWeight+" "+a.fontSize+"px "+a.fontFamily,l=this.ctx.measureText(l),l.width>e&&(q=b,e=l.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;p=a.measureText();for(t=b+1;t<this._labels.length;t++)if(!this._labels[t].breaksLabelType){f=this._labels[t].textBlock;f=f.measureText();break}m.push(a.height);this.sessionVariables.labelMaxHeight=Math.max.apply(Math,m);Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.sin(Math.PI/180*Math.abs(this.labelAngle));c=g*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(k-a.fontSize/2)*Math.cos(Math.PI/180*
|
|
Math.abs(this.labelAngle));if(x(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle)if(this.sessionVariables.labelMaxHeight=0===this.labelAngle?k:Math.min((c-g*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),c),l=(r-(h+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(-25)))/Math.sin(Math.PI/180*Math.abs(-25)),!x(this.options.labelWrap))this.labelWrap?x(this.options.labelMaxWidth)?(this.sessionVariables.labelMaxWidth=Math.min(Math.max(g,
|
|
e),l),this.sessionVariables.labelWrap=this.labelWrap,p.width+f.width>>0>2*g&&(this.sessionVariables.labelAngle=-25)):(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g?-25:this.sessionVariables.labelAngle):x(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelMaxWidth=g,p.width+f.width>>
|
|
0>2*g&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelWrap=this.labelWrap);else{if(x(this.options.labelWrap))if(!x(this.options.labelMaxWidth))this.options.labelMaxWidth<g?(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,
|
|
this.sessionVariables.labelMaxHeight=c):(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=k);else if(!x(f))if(c=p.width+f.width>>0,t=this.labelFontSize,e<g)c-2*g>d&&(d=c-2*g,c>=2*g&&c<2.2*g?(this.sessionVariables.labelMaxWidth=g,x(this.options.labelFontSize)&&12<t&&(t=Math.floor(12/13*t),a.measureText()),this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?t:this.options.labelFontSize,this.sessionVariables.labelAngle=
|
|
this.labelAngle):c>=2.2*g&&c<2.8*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelFontSize=t):c>=2.8*g&&c<3.2*g?(this.sessionVariables.labelMaxWidth=Math.max(g,e),this.sessionVariables.labelWrap=!0,x(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?t:this.options.labelFontSize,this.sessionVariables.labelAngle=
|
|
this.labelAngle):c>=3.2*g&&c<3.6*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelFontSize=this.labelFontSize):c>3.6*g&&c<5*g?(x(this.options.labelFontSize)&&12<t&&(t=Math.floor(12/13*t),a.measureText()),this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?t:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l):
|
|
c>5*g&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelFontSize=t,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelAngle=this.labelAngle));else if(q===b&&(0===q&&e+this._labels[q+1].textBlock.measureText().width-2*g>d||q===this._labels.length-1&&e+this._labels[q-1].textBlock.measureText().width-2*g>d||0<q&&q<this._labels.length-1&&e+this._labels[q+1].textBlock.measureText().width-2*g>d&&e+this._labels[q-1].textBlock.measureText().width-
|
|
2*g>d))d=0===q?e+this._labels[q+1].textBlock.measureText().width-2*g:e+this._labels[q-1].textBlock.measureText().width-2*g,this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?t:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l;else if(0===d)for(this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?t: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(g,e),l),p=a.measureText(),c<this._labels.length-1&&(t=c+1,f=this._labels[t].textBlock,f.maxWidth=this.sessionVariables.labelMaxWidth=Math.min(Math.max(g,e),l),f=f.measureText(),p.width+f.width>>0>2*g&&(this.sessionVariables.labelAngle=-25))}else(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxHeight=0===this.labelAngle?k:Math.min((c-g*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/
|
|
Math.sin(Math.PI/180*Math.abs(this.labelAngle)),c),l=0!=this.labelAngle?(r-(h+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)):g,this.sessionVariables.labelMaxHeight=k=this.labelWrap?(r-l*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)):1.5*this.labelFontSize,x(this.options.labelWrap))?x(this.options.labelWrap)&&(this.labelWrap&&!x(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=
|
|
this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:l,this.sessionVariables.labelMaxHeight=k):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelMaxHeight=c<0.9*n?0.9*n:c,this.sessionVariables.labelWrap=this.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:l):
|
|
(x(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:l,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight=k)}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=x(this.options.labelMaxWidth)?this.sessionVariables.labelMaxWidth:this.options.labelMaxWidth,a.fontSize=this.labelFontSize=x(this.options.labelFontSize)?this.sessionVariables.labelFontSize:this.options.labelFontSize,a.angle=this.labelAngle=x(this.options.labelAngle)?this.sessionVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=x(this.options.labelWrap)?
|
|
this.sessionVariables.labelWrap:this.options.labelWrap,a.maxHeight=this.sessionVariables.labelMaxHeight,a.measureText();else if("left"===this._position||"right"===this._position)if(g=x(this.options.labelMaxWidth)?0.3*this.chart.width>>0:this.options.labelMaxWidth,k="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=
|
|
g;this.sessionVariables.labelMaxHeight=k;this.sessionVariables.labelAngle=x(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=this._labels[b].textBlock;p=a.measureText();for(t=b+1;t<this._labels.length;t++)if(!this._labels[t].breaksLabelType){f=this._labels[t].textBlock;f=f.measureText();break}m.push(a.height);this.sessionVariables.labelMaxHeight=Math.max.apply(Math,
|
|
m);c=g*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(k-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));x(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle?x(this.options.labelWrap)?x(this.options.labelWrap)&&(x(this.options.labelMaxWidth)?x(f)||(n=p.height+f.height>>0,n-2*k>e&&(e=n-2*k,n>=2*k&&n<2.4*k?(x(this.options.labelFontSize)&&12<this.labelFontSize&&
|
|
(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize):n>=2.4*k&&n<2.8*k?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelFontSize=this.labelFontSize,this.sessionVariables.labelWrap=!0):n>=2.8*k&&n<3.2*k?(this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelWrap=!0,x(this.options.labelFontSize)&&12<
|
|
this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelAngle=x(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):n>=3.2*k&&n<3.6*k?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelFontSize=this.labelFontSize):n>3.6*k&&n<10*k?(x(this.options.labelFontSize)&&
|
|
12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelAngle=x(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):n>10*k&&n<50*k&&(x(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),
|
|
a.measureText()),this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelAngle=x(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle))):(this.sessionVariables.labelMaxHeight=k,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:g,this.sessionVariables.labelMaxHeight=k):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=0===this.labelAngle?g:Math.min((c-k*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)),k),x(this.options.labelWrap))?
|
|
x(this.options.labelWrap)&&(this.labelWrap&&!x(this.options.labelMaxWidth)?(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth>this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=c):(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:g,this.sessionVariables.labelMaxHeight=0===this.labelAngle?k:c,x(this.options.labelMaxWidth)&&
|
|
(this.sessionVariables.labelAngle=this.labelAngle))):this.options.labelWrap?(this.sessionVariables.labelMaxHeight=0===this.labelAngle?k:c,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=g):(this.sessionVariables.labelMaxHeight=k,x(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?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(b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.labelMaxWidth=x(this.options.labelMaxWidth)?this.sessionVariables.labelMaxWidth:this.options.labelMaxWidth,
|
|
a.fontSize=this.labelFontSize=x(this.options.labelFontSize)?this.sessionVariables.labelFontSize:this.options.labelFontSize,a.angle=this.labelAngle=x(this.options.labelAngle)?this.sessionVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=x(this.options.labelWrap)?this.sessionVariables.labelWrap:this.options.labelWrap,a.maxHeight=this.sessionVariables.labelMaxHeight,a.measureText();for(b=0;b<this.stripLines.length;b++){var g=this.stripLines[b],s;if("outside"===g.labelPlacement){k=this.sessionVariables.labelMaxWidth;
|
|
if("bottom"===this._position||"top"===this._position)s=x(g.options.labelWrap)?this.sessionVariables.labelMaxHeight:g.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize;if("left"===this._position||"right"===this._position)s=x(g.options.labelWrap)?this.sessionVariables.labelMaxHeight:g.labelWrap?0.8*this.chart.width>>0:1.5*this.labelFontSize;x(g.labelBackgroundColor)&&(g.labelBackgroundColor="#EEEEEE")}else k="bottom"===this._position||"top"===this._position?0.9*this.chart.width>>0:0.9*this.chart.height>>
|
|
0,s=x(g.options.labelWrap)||g.labelWrap?"bottom"===this._position||"top"===this._position?0.8*this.chart.width>>0:0.8*this.chart.height>>0:1.5*this.labelFontSize,x(g.labelBackgroundColor)&&(x(g.startValue)&&0!==g.startValue?g.labelBackgroundColor=w?"transparent":null:g.labelBackgroundColor="#EEEEEE");a=new ka(this.ctx,{x:0,y:0,backgroundColor:g.labelBackgroundColor,borderColor:g.labelBorderColor,borderThickness:g.labelBorderThickness,cornerRadius:g.labelCornerRadius,maxWidth:g.options.labelMaxWidth?
|
|
g.options.labelMaxWidth:k,maxHeight:s,angle:this.labelAngle,text:g.labelFormatter?g.labelFormatter({chart:this.chart,axis:this,stripLine:g}):g.label,horizontalAlign:"left",fontSize:"outside"===g.labelPlacement?g.options.labelFontSize?g.labelFontSize:this.labelFontSize:g.labelFontSize,fontFamily:"outside"===g.labelPlacement?g.options.labelFontFamily?g.labelFontFamily:this.labelFontFamily:g.labelFontFamily,fontWeight:"outside"===g.labelPlacement?g.options.labelFontWeight?g.labelFontWeight:this.labelFontWeight:
|
|
g.labelFontWeight,fontColor:g.labelFontColor||g.color,fontStyle:"outside"===g.labelPlacement?g.options.labelFontStyle?g.labelFontStyle:this.fontWeight:g.labelFontStyle,textBaseline:"middle"});this._stripLineLabels.push({position:g.value,textBlock:a,effectiveHeight:null,stripLine:g})}};B.prototype.createLabelsAndCalculateWidth=function(){var a=0,f=0;this._labels=[];this._stripLineLabels=[];if("left"===this._position||"right"===this._position){this.createLabels();for(f=0;f<this._labels.length;f++){var b=
|
|
this._labels[f].textBlock,c=b.measureText(),d=0,d=0===this.labelAngle?c.width:c.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+(c.height-b.fontSize/2)*Math.sin(Math.PI/180*Math.abs(this.labelAngle));a<d&&(a=d);this._labels[f].effectiveWidth=d}for(f=0;f<this._stripLineLabels.length;f++)"outside"===this._stripLineLabels[f].stripLine.labelPlacement&&(this._stripLineLabels[f].stripLine.value>this.viewportMinimum&&this._stripLineLabels[f].stripLine.value<this.viewportMaximum)&&(b=this._stripLineLabels[f].textBlock,
|
|
c=b.measureText(),d=0===this.labelAngle?c.width:c.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+(c.height-b.fontSize/2)*Math.sin(Math.PI/180*Math.abs(this.labelAngle)),a<d&&(a=d),this._stripLineLabels[f].effectiveWidth=d)}f=this.title?this._titleTextBlock.measureText().height+2:0;return b="inside"===this.labelPlacement?b=f+5:f+a+this.tickLength+5};B.prototype.createLabelsAndCalculateHeight=function(){var a=0;this._labels=[];this._stripLineLabels=[];var f,b=0;this.createLabels();if("bottom"===
|
|
this._position||"top"===this._position){for(b=0;b<this._labels.length;b++){f=this._labels[b].textBlock;var c=f.measureText(),d=0,d=0===this.labelAngle?c.height:c.width*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(c.height-f.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));a<d&&(a=d);this._labels[b].effectiveHeight=d}for(b=0;b<this._stripLineLabels.length;b++)"outside"===this._stripLineLabels[b].stripLine.labelPlacement&&(f=this._stripLineLabels[b].textBlock,c=f.measureText(),d=0===
|
|
this.labelAngle?c.height:c.width*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(c.height-f.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)),a<d&&(a=d),this._stripLineLabels[b].effectiveHeight=d)}f=this.title?this._titleTextBlock.measureText().height+2:0;return b="inside"===this.labelPlacement?b=f+5:f+a+this.tickLength+5};B.setLayoutAndRender=function(a,f,b,c,d,g){var k,l,n,h,r=a[0]?a[0].chart:f[0].chart,p=r.ctx,m=r._axes;if(a&&0<a.length)for(var e=0;e<a.length;e++)a[e]&&a[e].calculateAxisParameters();
|
|
if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].calculateAxisParameters();if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].calculateAxisParameters();if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].calculateAxisParameters();for(e=0;e<m.length;e++)if(m[e]&&m[e].scaleBreaks&&m[e].scaleBreaks._appliedBreaks.length)for(var t=m[e].scaleBreaks._appliedBreaks,q=0;q<t.length&&!(t[q].startValue>m[e].viewportMaximum);q++)t[q].endValue<m[e].viewportMinimum||(x(m[e].scaleBreaks.firstBreakIndex)&&(m[e].scaleBreaks.firstBreakIndex=
|
|
q),t[q].startValue>=m[e].viewPortMinimum&&(m[e].scaleBreaks.lastBreakIndex=q));for(var s=q=0,v=0,u=0,y=0,z=0,B=0,A,F,J=l=0,N,U,P,t=N=U=P=!1,e=0;e<m.length;e++)m[e]&&m[e].title&&(m[e]._titleTextBlock=new ka(m[e].ctx,{text:m[e].title,horizontalAlign:"center",fontSize:m[e].titleFontSize,fontFamily:m[e].titleFontFamily,fontWeight:m[e].titleFontWeight,fontColor:m[e].titleFontColor,fontStyle:m[e].titleFontStyle,borderColor:m[e].titleBorderColor,borderThickness:m[e].titleBorderThickness,backgroundColor:m[e].titleBackgroundColor,
|
|
cornerRadius:m[e].titleCornerRadius,textBaseline:"top"}));for(e=0;e<m.length;e++)if(m[e].title)switch(m[e]._position){case "left":m[e]._titleTextBlock.maxWidth=m[e].titleMaxWidth||g.height;m[e]._titleTextBlock.maxHeight=m[e].titleWrap?0.8*g.width:1.5*m[e].titleFontSize;m[e]._titleTextBlock.angle=-90;break;case "right":m[e]._titleTextBlock.maxWidth=m[e].titleMaxWidth||g.height;m[e]._titleTextBlock.maxHeight=m[e].titleWrap?0.8*g.width:1.5*m[e].titleFontSize;m[e]._titleTextBlock.angle=90;break;default:m[e]._titleTextBlock.maxWidth=
|
|
m[e].titleMaxWidth||g.width,m[e]._titleTextBlock.maxHeight=m[e].titleWrap?0.8*g.height:1.5*m[e].titleFontSize,m[e]._titleTextBlock.angle=0}if("normal"===d){for(var u=[],y=[],z=[],B=[],Q=[],O=[],I=[],M=[];4>q;){var R=0,T=0,W=0,V=0,S=d=0,K=0,Y=0,X=0,L=0,$=0,aa=0;if(b&&0<b.length)for(z=[],e=$=0;e<b.length;e++)z.push(Math.ceil(b[e]?b[e].createLabelsAndCalculateWidth():0)),$+=z[e],K+=b[e]?b[e].margin:0;else z.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateWidth():0));I.push(z);if(c&&0<c.length)for(B=
|
|
[],e=aa=0;e<c.length;e++)B.push(Math.ceil(c[e]?c[e].createLabelsAndCalculateWidth():0)),aa+=B[e],Y+=c[e]?c[e].margin:0;else B.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateWidth():0));M.push(B);k=Math.round(g.x1+$+K);n=Math.round(g.x2-aa-Y>r.width-10?r.width-10:g.x2-aa-Y);if(a&&0<a.length)for(u=[],e=X=0;e<a.length;e++)a[e]&&(a[e].lineCoordinates={}),a[e].lineCoordinates.width=Math.abs(n-k),a[e].title&&(a[e]._titleTextBlock.maxWidth=0<a[e].titleMaxWidth&&a[e].titleMaxWidth<a[e].lineCoordinates.width?
|
|
a[e].titleMaxWidth:a[e].lineCoordinates.width),u.push(Math.ceil(a[e]?a[e].createLabelsAndCalculateHeight():0)),X+=u[e],d+=a[e]?a[e].margin:0;else u.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateHeight():0));Q.push(u);if(f&&0<f.length)for(y=[],e=L=0;e<f.length;e++)f[e]&&(f[e].lineCoordinates={}),f[e].lineCoordinates.width=Math.abs(n-k),f[e].title&&(f[e]._titleTextBlock.maxWidth=0<f[e].titleMaxWidth&&f[e].titleMaxWidth<f[e].lineCoordinates.width?f[e].titleMaxWidth:f[e].lineCoordinates.width),y.push(Math.ceil(f[e]?
|
|
f[e].createLabelsAndCalculateHeight():0)),L+=y[e],S+=f[e]?f[e].margin:0;else y.push(Math.ceil(f[0]?f[0].createLabelsAndCalculateHeight():0));O.push(y);if(a&&0<a.length)for(e=0;e<a.length;e++)a[e]&&(a[e].lineCoordinates.x1=k,n=Math.round(g.x2-aa-Y>r.width-10?r.width-10:g.x2-aa-Y),a[e]._labels&&1<a[e]._labels.length&&(l=h=0,h=a[e]._labels[1],l="dateTime"===a[e].chart.plotInfo.axisXValueType?a[e]._labels[a[e]._labels.length-2]:a[e]._labels[a[e]._labels.length-1],s=h.textBlock.width*Math.cos(Math.PI/
|
|
180*Math.abs(h.textBlock.angle))+(h.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(h.textBlock.angle)),v=l.textBlock.width*Math.cos(Math.PI/180*Math.abs(l.textBlock.angle))+(l.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(l.textBlock.angle))),a[e]&&(a[e].labelAutoFit&&!x(A)&&!x(F))&&(l=0,0<a[e].labelAngle?F+v>n&&(l+=0<a[e].labelAngle?F+v-n-aa:0):0>a[e].labelAngle?A-s<k&&A-s<a[e].viewportMinimum&&(J=k-(K+a[e].tickLength+z+A-s+a[e].labelFontSize/2)):
|
|
0===a[e].labelAngle&&(F+v>n&&(l=F+v/2-n-aa),A-s<k&&A-s<a[e].viewportMinimum&&(J=k-K-a[e].tickLength-z-A+s/2)),a[e].viewportMaximum===a[e].maximum&&a[e].viewportMinimum===a[e].minimum&&0<a[e].labelAngle&&0<l?n-=l:a[e].viewportMaximum===a[e].maximum&&a[e].viewportMinimum===a[e].minimum&&0>a[e].labelAngle&&0<J?k+=J:a[e].viewportMaximum===a[e].maximum&&a[e].viewportMinimum===a[e].minimum&&0===a[e].labelAngle&&(0<J&&(k+=J),0<l&&(n-=l))),r.panEnabled?X=r.sessionVariables.axisX.height:r.sessionVariables.axisX.height=
|
|
X,l=Math.round(g.y2-X-d+R),h=Math.round(g.y2),a[e].lineCoordinates.x2=n,a[e].lineCoordinates.width=n-k,a[e].lineCoordinates.y1=l,a[e].lineCoordinates.y2=l,a[e].bounds={x1:k,y1:l,x2:n,y2:h-(X+d-u[e]-R),width:n-k,height:h-l}),R+=u[e]+a[e].margin;if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].lineCoordinates.x1=Math.round(g.x1+$+K),f[e].lineCoordinates.x2=Math.round(g.x2-aa-Y>r.width-10?r.width-10:g.x2-aa-Y),f[e].lineCoordinates.width=Math.abs(n-k),f[e]._labels&&1<f[e]._labels.length&&(h=f[e]._labels[1],
|
|
l="dateTime"===f[e].chart.plotInfo.axisXValueType?f[e]._labels[f[e]._labels.length-2]:f[e]._labels[f[e]._labels.length-1],s=h.textBlock.width*Math.cos(Math.PI/180*Math.abs(h.textBlock.angle))+(h.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(h.textBlock.angle)),v=l.textBlock.width*Math.cos(Math.PI/180*Math.abs(l.textBlock.angle))+(l.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(l.textBlock.angle))),r.panEnabled?L=r.sessionVariables.axisX2.height:r.sessionVariables.axisX2.height=
|
|
L,l=Math.round(g.y1),h=Math.round(g.y2+f[e].margin),f[e].lineCoordinates.y1=l+L+S-T,f[e].lineCoordinates.y2=l,f[e].bounds={x1:k,y1:l+(L+S-y[e]-T),x2:n,y2:h,width:n-k,height:h-l},T+=y[e]+f[e].margin;if(b&&0<b.length)for(e=0;e<b.length;e++)K=10,b[e]&&(k=Math.round(a[0]?a[0].lineCoordinates.x1:f[0].lineCoordinates.x1),K=b[e]._labels&&0<b[e]._labels.length?b[e]._labels[b[e]._labels.length-1].textBlock.height/2:10,l=Math.round(g.y1+L+S<Math.max(K,10)?Math.max(K,10):g.y1+L+S),n=Math.round(a[0]?a[0].lineCoordinates.x1:
|
|
f[0].lineCoordinates.x1),K=0<a.length?0:b[e]._labels&&0<b[e]._labels.length?b[e]._labels[0].textBlock.height/2:10,h=Math.round(g.y2-X-d-K),b[e].lineCoordinates={x1:n-W,y1:l,x2:n-W,y2:h,height:Math.abs(h-l)},b[e].bounds={x1:k-(z[e]+W),y1:l,x2:n,y2:h,width:n-k,height:h-l},b[e].title&&(b[e]._titleTextBlock.maxWidth=0<b[e].titleMaxWidth&&b[e].titleMaxWidth<b[e].lineCoordinates.height?b[e].titleMaxWidth:b[e].lineCoordinates.height),W+=z[e]+b[e].margin);if(c&&0<c.length)for(e=0;e<c.length;e++)c[e]&&(k=
|
|
Math.round(a[0]?a[0].lineCoordinates.x2:f[0].lineCoordinates.x2),n=Math.round(k),K=c[e]._labels&&0<c[e]._labels.length?c[e]._labels[c[e]._labels.length-1].textBlock.height/2:0,l=Math.round(g.y1+L+S<Math.max(K,10)?Math.max(K,10):g.y1+L+S),K=0<a.length?0:c[e]._labels&&0<c[e]._labels.length?c[e]._labels[0].textBlock.height/2:0,h=Math.round(g.y2-(X+d+K)),c[e].lineCoordinates={x1:k+V,y1:l,x2:k+V,y2:h,height:Math.abs(h-l)},c[e].bounds={x1:k,y1:l,x2:n+(B[e]+V),y2:h,width:n-k,height:h-l},c[e].title&&(c[e]._titleTextBlock.maxWidth=
|
|
0<c[e].titleMaxWidth&&c[e].titleMaxWidth<c[e].lineCoordinates.height?c[e].titleMaxWidth:c[e].lineCoordinates.height),V+=B[e]+c[e].margin);if(a&&0<a.length)for(e=0;e<a.length;e++)a[e]&&(a[e].calculateValueToPixelConversionParameters(),a[e].calculateBreaksSizeInValues(),a[e]._labels&&1<a[e]._labels.length&&(A=(a[e].logarithmic?Math.log(a[e]._labels[1].position/a[e].viewportMinimum)/a[e].conversionParameters.lnLogarithmBase:a[e]._labels[1].position-a[e].viewportMinimum)*Math.abs(a[e].conversionParameters.pixelPerUnit)+
|
|
a[e].lineCoordinates.x1,k=a[e]._labels[a[e]._labels.length-("dateTime"===a[e].chart.plotInfo.axisXValueType?2:1)].position,k=a[e].getAppearentDifferceReplacingBreaksToSize(a[e].viewportMinimum,k),F=a[e].logarithmic?(1<k?Math.log(k)/a[e].conversionParameters.lnLogarithmBase*Math.abs(a[e].conversionParameters.pixelPerUnit):0)+a[e].lineCoordinates.x1:(0<k?k*Math.abs(a[e].conversionParameters.pixelPerUnit):0)+a[e].lineCoordinates.x1));if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].calculateValueToPixelConversionParameters(),
|
|
f[e].calculateBreaksSizeInValues(),f[e]._labels&&1<f[e]._labels.length&&(A=(f[e].logarithmic?Math.log(f[e]._labels[1].position/f[e].viewportMinimum)/f[e].conversionParameters.lnLogarithmBase:f[e]._labels[1].position-f[e].viewportMinimum)*Math.abs(f[e].conversionParameters.pixelPerUnit)+f[e].lineCoordinates.x1,k=f[e]._labels[f[e]._labels.length-("dateTime"===f[e].chart.plotInfo.axisX2ValueType?2:1)].position,k=f[e].getAppearentDifferceReplacingBreaksToSize(f[e].viewportMinimum,k),F=f[e].logarithmic?
|
|
(1<k?Math.log(k)/f[e].conversionParameters.lnLogarithmBase*Math.abs(f[e].conversionParameters.pixelPerUnit):0)+f[e].lineCoordinates.x1:(0<k?k*Math.abs(f[e].conversionParameters.pixelPerUnit):0)+f[e].lineCoordinates.x1);for(e=0;e<m.length;e++)"axisY"===m[e].type&&(m[e].calculateValueToPixelConversionParameters(),m[e].calculateBreaksSizeInValues());if(0<q){if(a&&0<a.length)for(e=0;e<a.length;e++)t=Q[q-1][e]===Q[q][e]?!0:!1;else t=!0;if(f&&0<f.length)for(e=0;e<f.length;e++)N=O[q-1][e]===O[q][e]?!0:!1;
|
|
else N=!0;if(b&&0<b.length)for(e=0;e<b.length;e++)U=I[q-1][e]===I[q][e]?!0:!1;else U=!0;if(c&&0<c.length)for(e=0;e<c.length;e++)P=M[q-1][e]===M[q][e]?!0:!1;else P=!0}if(t&&N&&U&&P)break;q++}p.save();p.beginPath();a[0]&&p.rect(5,a[0].bounds.y1,a[0].chart.width-10,a[0].bounds.height);f[0]&&p.rect(5,f[f.length-1].bounds.y1,f[0].chart.width-10,f[0].bounds.height);p.clip();if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].calculateStripLinesThicknessInValues(),a[e].calculateBreaksInPixels(),a[e].renderLabelsTicksAndTitle();
|
|
if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].calculateStripLinesThicknessInValues(),f[e].calculateBreaksInPixels(),f[e].renderLabelsTicksAndTitle();p.restore();if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].calculateStripLinesThicknessInValues(),b[e].calculateBreaksInPixels(),b[e].renderLabelsTicksAndTitle();if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].calculateStripLinesThicknessInValues(),c[e].calculateBreaksInPixels(),c[e].renderLabelsTicksAndTitle()}else{A=[];J=[];s=[];F=[];v=[];Q=[];O=[];for(I=
|
|
[];4>q;){L=X=$=V=Y=K=S=d=W=M=T=R=0;if(a&&0<a.length)for(s=[],e=X=0;e<a.length;e++)s.push(Math.ceil(a[e]?a[e].createLabelsAndCalculateWidth():0)),X+=s[e],d+=a[e]?a[e].margin:0;else s.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateWidth():0));O.push(s);if(f&&0<f.length)for(F=[],e=L=0;e<f.length;e++)F.push(Math.ceil(f[e]?f[e].createLabelsAndCalculateWidth():0)),L+=F[e],S+=f[e]?f[e].margin:0;else F.push(Math.ceil(f[0]?f[0].createLabelsAndCalculateWidth():0));I.push(F);if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].lineCoordinates=
|
|
{},k=Math.round(g.x1+X+d),n=Math.round(g.x2-L-S>r.width-10?r.width-10:g.x2-L-S),b[e].labelAutoFit&&!x(u)&&(0<!a.length&&(k=0>b[e].labelAngle?Math.max(k,u):0===b[e].labelAngle?Math.max(k,u/2):k),0<!f.length&&(n=0<b[e].labelAngle?n-y/2:0===b[e].labelAngle?n-y/2:n)),b[e].lineCoordinates.x1=k,b[e].lineCoordinates.x2=n,b[e].lineCoordinates.width=Math.abs(n-k),b[e].title&&(b[e]._titleTextBlock.maxWidth=0<b[e].titleMaxWidth&&b[e].titleMaxWidth<b[e].lineCoordinates.width?b[e].titleMaxWidth:b[e].lineCoordinates.width);
|
|
if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].lineCoordinates={},k=Math.round(g.x1+X+d),n=Math.round(g.x2-L-S>c[e].chart.width-10?c[e].chart.width-10:g.x2-L-S),c[e]&&c[e].labelAutoFit&&!x(z)&&(0<!a.length&&(k=0<c[e].labelAngle?Math.max(k,z):0===c[e].labelAngle?Math.max(k,z/2):k),0<!f.length&&(n-=B/2)),c[e].lineCoordinates.x1=k,c[e].lineCoordinates.x2=n,c[e].lineCoordinates.width=Math.abs(n-k),c[e].title&&(c[e]._titleTextBlock.maxWidth=0<c[e].titleMaxWidth&&c[e].titleMaxWidth<c[e].lineCoordinates.width?
|
|
c[e].titleMaxWidth:c[e].lineCoordinates.width);if(b&&0<b.length)for(A=[],e=V=0;e<b.length;e++)A.push(Math.ceil(b[e]?b[e].createLabelsAndCalculateHeight():0)),V+=A[e]+b[e].margin,K+=b[e].margin;else A.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateHeight():0));v.push(A);if(c&&0<c.length)for(J=[],e=$=0;e<c.length;e++)J.push(Math.ceil(c[e]?c[e].createLabelsAndCalculateHeight():0)),$+=J[e],Y+=c[e].margin;else J.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateHeight():0));Q.push(J);if(b&&0<b.length)for(e=
|
|
0;e<b.length;e++)0<b[e]._labels.length&&(h=b[e]._labels[0],l=b[e]._labels[b[e]._labels.length-1],u=h.textBlock.width*Math.cos(Math.PI/180*Math.abs(h.textBlock.angle))+(h.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(h.textBlock.angle)),y=l.textBlock.width*Math.cos(Math.PI/180*Math.abs(l.textBlock.angle))+(l.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(l.textBlock.angle)));if(c&&0<c.length)for(e=0;e<c.length;e++)c[e]&&0<c[e]._labels.length&&(h=c[e]._labels[0],
|
|
l=c[e]._labels[c[e]._labels.length-1],z=h.textBlock.width*Math.cos(Math.PI/180*Math.abs(h.textBlock.angle))+(h.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(h.textBlock.angle)),B=l.textBlock.width*Math.cos(Math.PI/180*Math.abs(l.textBlock.angle))+(l.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(l.textBlock.angle)));if(r.panEnabled)for(e=0;e<b.length;e++)A[e]=r.sessionVariables.axisY.height;else for(e=0;e<b.length;e++)r.sessionVariables.axisY.height=
|
|
A[e];if(b&&0<b.length)for(e=b.length-1;0<=e;e--)l=Math.round(g.y2),h=Math.round(g.y2>b[e].chart.height-10?b[e].chart.height-10:g.y2),b[e].lineCoordinates.y1=l-(A[e]+b[e].margin+R),b[e].lineCoordinates.y2=l-(A[e]+b[e].margin+R),b[e].bounds={x1:k,y1:l-(A[e]+R+b[e].margin),x2:n,y2:h-(R+b[e].margin),width:n-k,height:A[e]},b[e].title&&(b[e]._titleTextBlock.maxWidth=0<b[e].titleMaxWidth&&b[e].titleMaxWidth<b[e].lineCoordinates.width?b[e].titleMaxWidth:b[e].lineCoordinates.width),R+=A[e]+b[e].margin;if(c&&
|
|
0<c.length)for(e=c.length-1;0<=e;e--)c[e]&&(l=Math.round(g.y1),h=Math.round(g.y1+(J[e]+c[e].margin+T)),c[e].lineCoordinates.y1=h,c[e].lineCoordinates.y2=h,c[e].bounds={x1:k,y1:l+(c[e].margin+T),x2:n,y2:h,width:n-k,height:$},c[e].title&&(c[e]._titleTextBlock.maxWidth=0<c[e].titleMaxWidth&&c[e].titleMaxWidth<c[e].lineCoordinates.width?c[e].titleMaxWidth:c[e].lineCoordinates.width),T+=J[e]+c[e].margin);if(a&&0<a.length)for(e=0;e<a.length;e++){K=a[e]._labels&&0<a[e]._labels.length?a[e]._labels[0].textBlock.fontSize/
|
|
2:0;k=Math.round(g.x1+d);l=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y2:g.y1<Math.max(K,10)?Math.max(K,10):g.y1):g.y1<Math.max(K,10)?Math.max(K,10):g.y1;n=Math.round(g.x1+X+d);h=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y1:g.y2-V>r.height-Math.max(K,10)?r.height-Math.max(K,10):g.y2-V):g.y2>r.height-Math.max(K,10)?r.height-Math.max(K,10):g.y2;if(b&&0<b.length)for(K=0;K<b.length;K++)b[K]&&b[K].labelAutoFit&&(n=0>b[K].labelAngle?Math.max(n,u):0===b[K].labelAngle?Math.max(n,u/2):n,k=
|
|
0>b[K].labelAngle||0===b[K].labelAngle?n-X:k);if(c&&0<c.length)for(K=0;K<c.length;K++)c[K]&&c[K].labelAutoFit&&(n=c[K].lineCoordinates.x1,k=n-X);a[e].lineCoordinates={x1:n-M,y1:l,x2:n-M,y2:h,height:Math.abs(h-l)};a[e].bounds={x1:n-(s[e]+M),y1:l,x2:n,y2:h,width:n-k,height:h-l};a[e].title&&(a[e]._titleTextBlock.maxWidth=0<a[e].titleMaxWidth&&a[e].titleMaxWidth<a[e].lineCoordinates.height?a[e].titleMaxWidth:a[e].lineCoordinates.height);a[e].calculateValueToPixelConversionParameters();a[e].calculateBreaksSizeInValues();
|
|
M+=s[e]+a[e].margin}if(f&&0<f.length)for(e=0;e<f.length;e++){K=f[e]._labels&&0<f[e]._labels.length?f[e]._labels[0].textBlock.fontSize/2:0;k=Math.round(g.x1-d);l=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y2:g.y1<Math.max(K,10)?Math.max(K,10):g.y1):g.y1<Math.max(K,10)?Math.max(K,10):g.y1;n=Math.round(g.x2-L-S);h=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y1:g.y2-V>r.height-Math.max(K,10)?r.height-Math.max(K,10):g.y2-V):g.y2>r.height-Math.max(K,10)?r.height-Math.max(K,10):g.y2;if(b&&
|
|
0<b.length)for(K=0;K<b.length;K++)b[K]&&b[K].labelAutoFit&&(n=0>b[K].labelAngle?Math.max(n,u):0===b[K].labelAngle?Math.max(n,u/2):n,k=0>b[K].labelAngle||0===b[K].labelAngle?n-L:k);if(c&&0<c.length)for(K=0;K<c.length;K++)c[K]&&c[K].labelAutoFit&&(n=c[K].lineCoordinates.x2,k=n-L);f[e].lineCoordinates={x1:n+W,y1:l,x2:n+W,y2:h,height:Math.abs(h-l)};f[e].bounds={x1:k,y1:l,x2:n+F[e]+W,y2:h,width:n-k,height:h-l};f[e].title&&(f[e]._titleTextBlock.maxWidth=0<f[e].titleMaxWidth&&f[e].titleMaxWidth<f[e].lineCoordinates.height?
|
|
f[e].titleMaxWidth:f[e].lineCoordinates.height);f[e].calculateValueToPixelConversionParameters();f[e].calculateBreaksSizeInValues();W+=F[e]+f[e].margin}for(e=0;e<m.length;e++)"axisY"===m[e].type&&(m[e].calculateValueToPixelConversionParameters(),m[e].calculateBreaksSizeInValues());if(0<q){if(a&&0<a.length)for(e=0;e<a.length;e++)t=O[q-1][e]===O[q][e]?!0:!1;else t=!0;if(f&&0<f.length)for(e=0;e<f.length;e++)N=I[q-1][e]===I[q][e]?!0:!1;else N=!0;if(b&&0<b.length)for(e=0;e<b.length;e++)U=v[q-1][e]===v[q][e]?
|
|
!0:!1;else U=!0;if(c&&0<c.length)for(e=0;e<c.length;e++)P=Q[q-1][e]===Q[q][e]?!0:!1;else P=!0}if(t&&N&&U&&P)break;q++}if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].calculateBreaksInPixels(),b[e].renderLabelsTicksAndTitle();if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].calculateBreaksInPixels(),c[e].renderLabelsTicksAndTitle();if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].calculateBreaksInPixels(),a[e].renderLabelsTicksAndTitle();if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].calculateBreaksInPixels(),
|
|
f[e].renderLabelsTicksAndTitle()}r.preparePlotArea();g=r.plotArea;p.save();p.beginPath();p.rect(g.x1,g.y1,Math.abs(g.x2-g.x1),Math.abs(g.y2-g.y1));p.clip();if(a&&0<a.length)for(e=0;e<m.length;e++)m[e].renderStripLinesOfThicknessType("value");if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].renderStripLinesOfThicknessType("value");if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderStripLinesOfThicknessType("value");if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].renderStripLinesOfThicknessType("value");if(a&&
|
|
0<a.length)for(e=0;e<a.length;e++)a[e].renderInterlacedColors();if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].renderInterlacedColors();if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderInterlacedColors();if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].renderInterlacedColors();p.restore();if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].renderGrid(),w&&(a[e].createMask(),a[e].renderBreaksBackground());if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].renderGrid(),w&&(f[e].createMask(),f[e].renderBreaksBackground());
|
|
if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderGrid(),w&&(b[e].createMask(),b[e].renderBreaksBackground());if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].renderGrid(),w&&(c[e].createMask(),c[e].renderBreaksBackground());if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].renderAxisLine();if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].renderAxisLine();if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderAxisLine();if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].renderAxisLine();if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].renderStripLinesOfThicknessType("pixel");
|
|
if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].renderStripLinesOfThicknessType("pixel");if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderStripLinesOfThicknessType("pixel");if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].renderStripLinesOfThicknessType("pixel")};B.prototype.calculateStripLinesThicknessInValues=function(){for(var a=0;a<this.stripLines.length;a++)if(null!==this.stripLines[a].startValue&&null!==this.stripLines[a].endValue){var f=Math.min(this.stripLines[a].startValue,this.stripLines[a].endValue),
|
|
b=Math.max(this.stripLines[a].startValue,this.stripLines[a].endValue),f=this.getAppearentDifferceReplacingBreaksToSize(f,b);this.stripLines[a].value=this.logarithmic?this.stripLines[a].value*Math.sqrt(Math.log(this.stripLines[a].endValue/this.stripLines[a].startValue)/Math.log(f)):this.stripLines[a].value+(Math.abs(this.stripLines[a].endValue-this.stripLines[a].startValue)-f)/2;this.stripLines[a].thickness=f;this.stripLines[a]._thicknessType="value"}};B.prototype.calculateBreaksSizeInValues=function(){for(var a=
|
|
"left"===this._position||"right"===this._position?this.lineCoordinates.height||this.chart.height:this.lineCoordinates.width||this.chart.width,f=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&&!x(this.scaleBreaks.options.spacing),d,g=0;g<f.length;g++)d=c||!x(f[g].options.spacing),
|
|
f[g].spacing=P(f[g].spacing,a,8,d?0.1*a:8,d?0:3)<<0,f[g].size=0>f[g].spacing?0:Math.abs(f[g].spacing/b),this.logarithmic&&(f[g].size=Math.pow(this.logarithmBase,f[g].size))};B.prototype.calculateBreaksInPixels=function(){if(!(this.scaleBreaks&&0>=this.scaleBreaks._appliedBreaks.length)){var a=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[];a.length&&(this.scaleBreaks.firstBreakIndex=this.scaleBreaks.lastBreakIndex=null);for(var f=0;f<a.length&&!(a[f].startValue>this.conversionParameters.maximum);f++)a[f].endValue<
|
|
this.conversionParameters.minimum||(x(this.scaleBreaks.firstBreakIndex)&&(this.scaleBreaks.firstBreakIndex=f),a[f].startValue>=this.conversionParameters.minimum&&(a[f].startPixel=this.convertValueToPixel(a[f].startValue),this.scaleBreaks.lastBreakIndex=f),a[f].endValue<=this.conversionParameters.maximum&&(a[f].endPixel=this.convertValueToPixel(a[f].endValue)))}};B.prototype.renderLabelsTicksAndTitle=function(){var a=this,f=!1,b=0,c=0,d=1,g=0;0!==this.labelAngle&&360!==this.labelAngle&&(d=1.2);if("undefined"===
|
|
typeof this.options.interval){if("bottom"===this._position||"top"===this._position)if(this.logarithmic&&!this.equidistantInterval&&this.labelAutoFit){for(var b=[],d=0!==this.labelAngle&&360!==this.labelAngle?1:1.2,k,l=this.viewportMaximum,n=this.lineCoordinates.width/Math.log(this.range),h=this._labels.length-1;0<=h;h--){p=this._labels[h];if(p.position<this.viewportMinimum)break;p.position>this.viewportMaximum||!(h===this._labels.length-1||k<Math.log(l/p.position)*n/d)||(b.push(p),l=p.position,k=
|
|
p.textBlock.width*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.height*Math.abs(Math.sin(Math.PI/180*this.labelAngle)))}this._labels=b}else{for(h=0;h<this._labels.length;h++)p=this._labels[h],p.position<this.viewportMinimum||(k=p.textBlock.width*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.height*Math.abs(Math.sin(Math.PI/180*this.labelAngle)),b+=k);b>this.lineCoordinates.width*d&&this.labelAutoFit&&(f=!0)}if("left"===this._position||"right"===this._position)if(this.logarithmic&&
|
|
!this.equidistantInterval&&this.labelAutoFit){for(var b=[],r,l=this.viewportMaximum,n=this.lineCoordinates.height/Math.log(this.range),h=this._labels.length-1;0<=h;h--){p=this._labels[h];if(p.position<this.viewportMinimum)break;p.position>this.viewportMaximum||!(h===this._labels.length-1||r<Math.log(l/p.position)*n)||(b.push(p),l=p.position,r=p.textBlock.height*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.width*Math.abs(Math.sin(Math.PI/180*this.labelAngle)))}this._labels=b}else{for(h=
|
|
0;h<this._labels.length;h++)p=this._labels[h],p.position<this.viewportMinimum||(r=p.textBlock.height*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.width*Math.abs(Math.sin(Math.PI/180*this.labelAngle)),c+=r);c>this.lineCoordinates.height*d&&this.labelAutoFit&&(f=!0)}}this.logarithmic&&(!this.equidistantInterval&&this.labelAutoFit)&&this._labels.sort(function(a,b){return a.position-b.position});var h=0,p,m;if("bottom"===this._position){for(h=0;h<this._labels.length;h++)p=this._labels[h],
|
|
p.position<this.viewportMinimum||(p.position>this.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit)||(m=this.getPixelCoordinatesOnAxis(p.position),this.tickThickness&&"inside"!=this.labelPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(m.x<<0)+0.5:m.x<<0,this.ctx.beginPath(),this.ctx.moveTo(c,m.y<<0),this.ctx.lineTo(c,m.y+this.tickLength<<0),this.ctx.stroke()),0===p.textBlock.angle?(m.x-=p.textBlock.width/2,m.y="inside"===this.labelPlacement?
|
|
m.y-(this.tickLength+p.textBlock.fontSize/2):m.y+this.tickLength+p.textBlock.fontSize/2):(m.x="inside"===this.labelPlacement?0>this.labelAngle?m.x:m.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):m.x-(0>this.labelAngle?p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0),m.y="inside"===this.labelPlacement?0>this.labelAngle?m.y-this.tickLength-5:m.y-this.tickLength-Math.abs(p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)+5):m.y+this.tickLength+Math.abs(0>this.labelAngle?p.textBlock.width*
|
|
Math.sin(Math.PI/180*this.labelAngle)-5:5)),p.textBlock.x=m.x,p.textBlock.y=m.y);"inside"===this.labelPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(h=0;h<a._labels.length;h++)if(p=a._labels[h],!(p.position<a.viewportMinimum||p.position>a.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit)&&(m=a.getPixelCoordinatesOnAxis(p.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===a.ctx.lineWidth%2?(m.x<<0)+0.5:m.x<<0;a.ctx.save();
|
|
a.ctx.beginPath();a.ctx.moveTo(b,m.y<<0);a.ctx.lineTo(b,m.y-a.tickLength<<0);a.ctx.stroke();a.ctx.restore()}},this);this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+this.lineCoordinates.width/2-this._titleTextBlock.width/2,this._titleTextBlock.y=this.bounds.y2-this._titleTextBlock.height-3,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("top"===this._position){for(h=0;h<this._labels.length;h++)p=this._labels[h],
|
|
p.position<this.viewportMinimum||(p.position>this.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit)||(m=this.getPixelCoordinatesOnAxis(p.position),this.tickThickness&&"inside"!=this.labelPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(m.x<<0)+0.5:m.x<<0,this.ctx.beginPath(),this.ctx.moveTo(c,m.y<<0),this.ctx.lineTo(c,m.y-this.tickLength<<0),this.ctx.stroke()),0===p.textBlock.angle?(m.x-=p.textBlock.width/2,m.y="inside"===this.labelPlacement?
|
|
m.y+this.labelFontSize/2+this.tickLength+5:m.y-(this.tickLength+p.textBlock.height-p.textBlock.fontSize/2)):(m.x="inside"===this.labelPlacement?0<this.labelAngle?m.x:m.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):m.x+(p.textBlock.height-this.tickLength-this.labelFontSize)*Math.sin(Math.PI/180*this.labelAngle)-(0<this.labelAngle?p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0),m.y="inside"===this.labelPlacement?0<this.labelAngle?m.y+this.tickLength+5:m.y-p.textBlock.width*Math.sin(Math.PI/
|
|
180*this.labelAngle)+this.tickLength+5:m.y-(this.tickLength+((p.textBlock.height-p.textBlock.fontSize/2)*Math.cos(Math.PI/180*this.labelAngle)+(0<this.labelAngle?p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0)))),p.textBlock.x=m.x,p.textBlock.y=m.y);"inside"===this.labelPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(h=0;h<a._labels.length;h++)if(p=a._labels[h],!(p.position<a.viewportMinimum||p.position>a.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit)&&
|
|
(m=a.getPixelCoordinatesOnAxis(p.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===this.ctx.lineWidth%2?(m.x<<0)+0.5:m.x<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(b,m.y<<0);a.ctx.lineTo(b,m.y+a.tickLength<<0);a.ctx.stroke();a.ctx.restore()}},this);this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+this.lineCoordinates.width/2-this._titleTextBlock.width/2,this._titleTextBlock.y=this.bounds.y1+1,this.titleMaxWidth=
|
|
this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("left"===this._position){for(h=0;h<this._labels.length;h++)p=this._labels[h],p.position<this.viewportMinimum||(p.position>this.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit)||(m=this.getPixelCoordinatesOnAxis(p.position),this.tickThickness&&"inside"!=this.labelPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(m.y<<0)+0.5:m.y<<0,this.ctx.beginPath(),this.ctx.moveTo(m.x<<
|
|
0,c),this.ctx.lineTo(m.x-this.tickLength<<0,c),this.ctx.stroke()),0===this.labelAngle?(p.textBlock.y=m.y,p.textBlock.x="inside"===this.labelPlacement?m.x+this.tickLength+5:m.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5):(p.textBlock.y="inside"===this.labelPlacement?m.y:m.y-p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),p.textBlock.x="inside"===this.labelPlacement?m.x+this.tickLength+5:0<this.labelAngle?m.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-
|
|
this.tickLength-5:m.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+(p.textBlock.height-p.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)-this.tickLength));"inside"===this.labelPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(h=0;h<a._labels.length;h++)if(p=a._labels[h],!(p.position<a.viewportMinimum||p.position>a.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit)&&(m=a.getPixelCoordinatesOnAxis(p.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness;
|
|
a.ctx.strokeStyle=a.tickColor;var b=1===a.ctx.lineWidth%2?(m.y<<0)+0.5:m.y<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(m.x<<0,b);a.ctx.lineTo(m.x+a.tickLength<<0,b);a.ctx.stroke();a.ctx.restore()}},this);this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.bounds.x1+1,this._titleTextBlock.y=this.lineCoordinates.height/2+this._titleTextBlock.width/2+this.lineCoordinates.y1,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("right"===
|
|
this._position){for(h=0;h<this._labels.length;h++)p=this._labels[h],p.position<this.viewportMinimum||(p.position>this.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit)||(m=this.getPixelCoordinatesOnAxis(p.position),this.tickThickness&&"inside"!=this.labelPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(m.y<<0)+0.5:m.y<<0,this.ctx.beginPath(),this.ctx.moveTo(m.x<<0,c),this.ctx.lineTo(m.x+this.tickLength<<0,c),this.ctx.stroke()),0===this.labelAngle?
|
|
(p.textBlock.y=m.y,p.textBlock.x="inside"===this.labelPlacement?m.x-p.textBlock.width-this.tickLength-5:m.x+this.tickLength+5):(p.textBlock.y="inside"===this.labelPlacement?m.y-p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0>this.labelAngle?m.y:m.y-(p.textBlock.height-p.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),p.textBlock.x="inside"===this.labelPlacement?m.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5:0<this.labelAngle?m.x-(p.textBlock.height-
|
|
p.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)+this.tickLength:m.x+this.tickLength+5));"inside"===this.labelPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(h=0;h<a._labels.length;h++)if(p=a._labels[h],!(p.position<a.viewportMinimum||p.position>a.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit)&&(m=a.getPixelCoordinatesOnAxis(p.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===a.ctx.lineWidth%2?(m.y<<
|
|
0)+0.5:m.y<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(m.x<<0,b);a.ctx.lineTo(m.x-a.tickLength<<0,b);a.ctx.stroke();a.ctx.restore()}},this);this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.bounds.x2-1,this._titleTextBlock.y=this.lineCoordinates.height/2-this._titleTextBlock.width/2+this.lineCoordinates.y1,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}g=0;if("inside"===this.labelPlacement)this.chart.addEventListener("dataAnimationIterationEnd",
|
|
function(){for(h=0;h<a._labels.length;h++)p=a._labels[h],p.position<a.viewportMinimum||(p.position>a.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit&&p.skipFlag)||(a.ctx.save(),a.ctx.beginPath(),p.textBlock.render(!0),a.ctx.restore())},p.textBlock);else for(h=0;h<this._labels.length;h++)p=this._labels[h],p.position<this.viewportMinimum||(p.position>this.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit&&p.skipFlag)||p.textBlock.render(!0)};B.prototype.renderInterlacedColors=function(){var a=this.chart.plotArea.ctx,
|
|
f,b,c=this.chart.plotArea,d=0;f=!0;if(("bottom"===this._position||"top"===this._position)&&this.interlacedColor)for(a.fillStyle=this.interlacedColor,d=0;d<this._labels.length;d++)f?(f=this.getPixelCoordinatesOnAxis(this._labels[d].position),b=d+1>this._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[d+1].position),a.fillRect(Math.min(b.x,f.x),c.y1,Math.abs(b.x-f.x),Math.abs(c.y1-c.y2)),f=!1):f=!0;else if(("left"===this._position||"right"===
|
|
this._position)&&this.interlacedColor)for(a.fillStyle=this.interlacedColor,d=0;d<this._labels.length;d++)f?(b=this.getPixelCoordinatesOnAxis(this._labels[d].position),f=d+1>this._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[d+1].position),a.fillRect(c.x1,Math.min(b.y,f.y),Math.abs(c.x1-c.x2),Math.abs(f.y-b.y)),f=!1):f=!0;a.beginPath()};B.prototype.renderStripLinesOfThicknessType=function(a){if(this.stripLines&&0<this.stripLines.length&&
|
|
a){for(var f=this,b,c=0,d=0,g=!1,k=!1,l=[],n=[],k=!1,c=0;c<this.stripLines.length;c++){var h=this.stripLines[c];h._thicknessType===a&&("pixel"===a&&(h.value<this.viewportMinimum||h.value>this.viewportMaximum||x(h.value)||isNaN(this.range))||l.push(h))}for(c=0;c<this._stripLineLabels.length;c++)if(h=this.stripLines[c],b=this._stripLineLabels[c],!(b.position<this.viewportMinimum||b.position>this.viewportMaximum||isNaN(this.range))){a=this.getPixelCoordinatesOnAxis(b.position);if("outside"===b.stripLine.labelPlacement)if(h&&
|
|
(this.ctx.strokeStyle=h.color,"pixel"===h._thicknessType&&(this.ctx.lineWidth=h.thickness)),"bottom"===this._position){var r=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0;this.ctx.beginPath();this.ctx.moveTo(r,a.y<<0);this.ctx.lineTo(r,a.y+this.tickLength<<0);this.ctx.stroke();0===this.labelAngle?(a.x-=b.textBlock.width/2,a.y+=this.tickLength+b.textBlock.fontSize/2):(a.x-=0>this.labelAngle?b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,a.y+=this.tickLength+Math.abs(0>this.labelAngle?b.textBlock.width*
|
|
Math.sin(Math.PI/180*this.labelAngle)-5:5))}else"top"===this._position?(r=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0,this.ctx.beginPath(),this.ctx.moveTo(r,a.y<<0),this.ctx.lineTo(r,a.y-this.tickLength<<0),this.ctx.stroke(),0===this.labelAngle?(a.x-=b.textBlock.width/2,a.y-=this.tickLength+b.textBlock.height):(a.x+=(b.textBlock.height-this.tickLength-this.labelFontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-(0<this.labelAngle?b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0),a.y-=this.tickLength+
|
|
(b.textBlock.height*Math.cos(Math.PI/180*this.labelAngle)+(0<this.labelAngle?b.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0)))):"left"===this._position?(r=1===this.ctx.lineWidth%2?(a.y<<0)+0.5:a.y<<0,this.ctx.beginPath(),this.ctx.moveTo(a.x<<0,r),this.ctx.lineTo(a.x-this.tickLength<<0,r),this.ctx.stroke(),0===this.labelAngle?a.x=a.x-b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5:(a.y-=b.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),a.x=0<this.labelAngle?
|
|
a.x-b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5:a.x-b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+(b.textBlock.height-b.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)-this.tickLength)):"right"===this._position&&(r=1===this.ctx.lineWidth%2?(a.y<<0)+0.5:a.y<<0,this.ctx.beginPath(),this.ctx.moveTo(a.x<<0,r),this.ctx.lineTo(a.x+this.tickLength<<0,r),this.ctx.stroke(),0===this.labelAngle?a.x=a.x+this.tickLength+5:(a.y=0>this.labelAngle?a.y:a.y-(b.textBlock.height-
|
|
b.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),a.x=0<this.labelAngle?a.x+(b.textBlock.height-b.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)+this.tickLength:a.x+this.tickLength+5));else b.textBlock.angle=-90,"bottom"===this._position?(b.textBlock.maxWidth=this.options.stripLines[c].labelMaxWidth?this.options.stripLines[c].labelMaxWidth:this.chart.plotArea.height-3,b.textBlock.measureText(),a.x-b.textBlock.height>this.chart.plotArea.x1?x(h.startValue)?a.x-=b.textBlock.height-
|
|
b.textBlock.fontSize/2:a.x-=b.textBlock.height/2-b.textBlock.fontSize/2+3:(b.textBlock.angle=90,x(h.startValue)?a.x+=b.textBlock.height-b.textBlock.fontSize/2:a.x+=b.textBlock.height/2-b.textBlock.fontSize/2+3),a.y=-90===b.textBlock.angle?"near"===b.stripLine.labelAlign?this.chart.plotArea.y2-3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+b.textBlock.width)/2:this.chart.plotArea.y1+b.textBlock.width+3:"near"===b.stripLine.labelAlign?this.chart.plotArea.y2-b.textBlock.width-
|
|
3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-b.textBlock.width)/2:this.chart.plotArea.y1+3):"top"===this._position?(b.textBlock.maxWidth=this.options.stripLines[c].labelMaxWidth?this.options.stripLines[c].labelMaxWidth:this.chart.plotArea.height-3,b.textBlock.measureText(),a.x-b.textBlock.height>this.chart.plotArea.x1?x(h.startValue)?a.x-=b.textBlock.height-b.textBlock.fontSize/2:a.x-=b.textBlock.height/2-b.textBlock.fontSize/2+3:(b.textBlock.angle=90,x(h.startValue)?
|
|
a.x+=b.textBlock.height-b.textBlock.fontSize/2:a.x+=b.textBlock.height/2-b.textBlock.fontSize/2+3),a.y=-90===b.textBlock.angle?"near"===b.stripLine.labelAlign?this.chart.plotArea.y1+b.textBlock.width+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+b.textBlock.width)/2:this.chart.plotArea.y2-3:"near"===b.stripLine.labelAlign?this.chart.plotArea.y1+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-b.textBlock.width)/2:this.chart.plotArea.y2-
|
|
b.textBlock.width-3):"left"===this._position?(b.textBlock.maxWidth=this.options.stripLines[c].labelMaxWidth?this.options.stripLines[c].labelMaxWidth:this.chart.plotArea.width-3,b.textBlock.angle=0,b.textBlock.measureText(),a.y-b.textBlock.height>this.chart.plotArea.y1?x(h.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-b.textBlock.fontSize+3:a.y-b.textBlock.height<this.chart.plotArea.y2?a.y+=b.textBlock.fontSize/2+3:x(h.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/
|
|
2:a.y-=b.textBlock.height/2-b.textBlock.fontSize+3,a.x="near"===b.stripLine.labelAlign?this.chart.plotArea.x1+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.x2+this.chart.plotArea.x1)/2-b.textBlock.width/2:this.chart.plotArea.x2-b.textBlock.width-3):"right"===this._position&&(b.textBlock.maxWidth=this.options.stripLines[c].labelMaxWidth?this.options.stripLines[c].labelMaxWidth:this.chart.plotArea.width-3,b.textBlock.angle=0,b.textBlock.measureText(),a.y-+b.textBlock.height>this.chart.plotArea.y1?
|
|
x(h.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-b.textBlock.fontSize/2-3:a.y-b.textBlock.height<this.chart.plotArea.y2?a.y+=b.textBlock.fontSize/2+3:x(h.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-b.textBlock.fontSize/2+3,a.x="near"===b.stripLine.labelAlign?this.chart.plotArea.x2-b.textBlock.width-3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.x2+this.chart.plotArea.x1)/2-b.textBlock.width/2:this.chart.plotArea.x1+
|
|
3);b.textBlock.x=a.x;b.textBlock.y=a.y;n.push(b)}if(!k){k=!1;this.ctx.save();this.ctx.beginPath();this.ctx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.ctx.clip();for(c=0;c<l.length;c++)h=l[c],h.showOnTop?g||(g=!0,this.chart.addEventListener("dataAnimationIterationEnd",function(){this.ctx.save();this.ctx.beginPath();this.ctx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.ctx.clip();
|
|
for(d=0;d<l.length;d++)h=l[d],h.showOnTop&&h.render();this.ctx.restore()},h)):h.render();for(c=0;c<n.length;c++)b=n[c],b.stripLine.showOnTop?k||(k=!0,this.chart.addEventListener("dataAnimationIterationEnd",function(){for(d=0;d<n.length;d++)b=n[d],"inside"===b.stripLine.labelPlacement&&b.stripLine.showOnTop&&(f.ctx.save(),f.ctx.beginPath(),f.ctx.rect(f.chart.plotArea.x1,f.chart.plotArea.y1,f.chart.plotArea.width,f.chart.plotArea.height),f.ctx.clip(),b.textBlock.render(!0),f.ctx.restore())},b.textBlock)):
|
|
"inside"===b.stripLine.labelPlacement&&b.textBlock.render(!0);this.ctx.restore();k=!0}if(k)for(k=!1,c=0;c<n.length;c++)b=n[c],b.stripLine.showOnTop?k||(k=!0,this.chart.addEventListener("dataAnimationIterationEnd",function(){for(d=0;d<n.length;d++)b=n[d],"outside"===b.stripLine.labelPlacement&&b.stripLine.showOnTop&&b.textBlock.render(!0)},b.textBlock)):"outside"===b.stripLine.labelPlacement&&b.textBlock.render(!0)}};B.prototype.renderBreaksBackground=function(){this.chart._breaksCanvas&&(this.scaleBreaks&&
|
|
0<this.scaleBreaks._appliedBreaks.length&&this.maskCanvas)&&(this.chart._breaksCanvasCtx.save(),this.chart._breaksCanvasCtx.beginPath(),this.chart._breaksCanvasCtx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height),this.chart._breaksCanvasCtx.clip(),this.chart._breaksCanvasCtx.drawImage(this.maskCanvas,0,0,this.chart.width,this.chart.height),this.chart._breaksCanvasCtx.restore())};B.prototype.createMask=function(){if(this.scaleBreaks&&0<this.scaleBreaks._appliedBreaks.length){var a=
|
|
this.scaleBreaks._appliedBreaks;w?(this.maskCanvas=ta(this.chart.width,this.chart.height),this.maskCtx=this.maskCanvas.getContext("2d")):(this.maskCanvas=this.chart.plotArea.canvas,this.maskCtx=this.chart.plotArea.ctx);this.maskCtx.save();this.maskCtx.beginPath();this.maskCtx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.maskCtx.clip();for(var f=0;f<a.length;f++)a[f].endValue<this.viewportMinimum||(a[f].startValue>this.viewportMaximum||
|
|
isNaN(this.range))||a[f].render(this.maskCtx);this.maskCtx.restore()}};B.prototype.renderCrosshair=function(a,f){this.crosshair.render(a,f)};B.prototype.renderGrid=function(){if(this.gridThickness&&0<this.gridThickness){var a=this.chart.ctx;a.save();var f,b=this.chart.plotArea;a.lineWidth=this.gridThickness;a.strokeStyle=this.gridColor;a.setLineDash&&a.setLineDash(F(this.gridDashType,this.gridThickness));if("bottom"===this._position||"top"===this._position)for(c=0;c<this._labels.length;c++)this._labels[c].position<
|
|
this.viewportMinimum||(this._labels[c].position>this.viewportMaximum||this._labels[c].breaksLabelType)||(a.beginPath(),f=this.getPixelCoordinatesOnAxis(this._labels[c].position),f=1===a.lineWidth%2?(f.x<<0)+0.5:f.x<<0,a.moveTo(f,b.y1<<0),a.lineTo(f,b.y2<<0),a.stroke());else if("left"===this._position||"right"===this._position)for(var c=0;c<this._labels.length;c++)this._labels[c].position<this.viewportMinimum||(this._labels[c].position>this.viewportMaximum||this._labels[c].breaksLabelType)||(a.beginPath(),
|
|
f=this.getPixelCoordinatesOnAxis(this._labels[c].position),f=1===a.lineWidth%2?(f.y<<0)+0.5:f.y<<0,a.moveTo(b.x1<<0,f),a.lineTo(b.x2<<0,f),a.stroke());a.restore()}};B.prototype.renderAxisLine=function(){var a=this.chart.ctx,f=w?this.chart._preRenderCtx:a,b=Math.ceil(this.tickThickness/(this.reversed?-2:2)),c=Math.ceil(this.tickThickness/(this.reversed?2:-2)),d,g;f.save();if("bottom"===this._position||"top"===this._position){if(this.lineThickness){this.reversed?(d=this.lineCoordinates.x2,g=this.lineCoordinates.x1):
|
|
(d=this.lineCoordinates.x1,g=this.lineCoordinates.x2);f.lineWidth=this.lineThickness;f.strokeStyle=this.lineColor?this.lineColor:"black";f.setLineDash&&f.setLineDash(F(this.lineDashType,this.lineThickness));var k=1===this.lineThickness%2?(this.lineCoordinates.y1<<0)+0.5:this.lineCoordinates.y1<<0;f.beginPath();if(this.scaleBreaks&&!x(this.scaleBreaks.firstBreakIndex))if(x(this.scaleBreaks.lastBreakIndex))d=this.scaleBreaks._appliedBreaks[this.scaleBreaks.firstBreakIndex].endPixel+c;else for(var l=
|
|
this.scaleBreaks.firstBreakIndex;l<=this.scaleBreaks.lastBreakIndex;l++)f.moveTo(d,k),f.lineTo(this.scaleBreaks._appliedBreaks[l].startPixel+b,k),d=this.scaleBreaks._appliedBreaks[l].endPixel+c;d&&(f.moveTo(d,k),f.lineTo(g,k));f.stroke()}}else if(("left"===this._position||"right"===this._position)&&this.lineThickness){this.reversed?(d=this.lineCoordinates.y1,g=this.lineCoordinates.y2):(d=this.lineCoordinates.y2,g=this.lineCoordinates.y1);f.lineWidth=this.lineThickness;f.strokeStyle=this.lineColor;
|
|
f.setLineDash&&f.setLineDash(F(this.lineDashType,this.lineThickness));k=1===this.lineThickness%2?(this.lineCoordinates.x1<<0)+0.5:this.lineCoordinates.x1<<0;f.beginPath();if(this.scaleBreaks&&!x(this.scaleBreaks.firstBreakIndex))if(x(this.scaleBreaks.lastBreakIndex))d=this.scaleBreaks._appliedBreaks[this.scaleBreaks.firstBreakIndex].endPixel+b;else for(l=this.scaleBreaks.firstBreakIndex;l<=this.scaleBreaks.lastBreakIndex;l++)f.moveTo(k,d),f.lineTo(k,this.scaleBreaks._appliedBreaks[l].startPixel+c),
|
|
d=this.scaleBreaks._appliedBreaks[l].endPixel+b;d&&(f.moveTo(k,d),f.lineTo(k,g));f.stroke()}w&&(a.drawImage(this.chart._preRenderCanvas,0,0,this.chart.width,this.chart.height),this.chart._breaksCanvasCtx&&this.chart._breaksCanvasCtx.drawImage(this.chart._preRenderCanvas,0,0,this.chart.width,this.chart.height),f.clearRect(0,0,this.chart.width,this.chart.height));f.restore()};B.prototype.getPixelCoordinatesOnAxis=function(a){var f={};if("bottom"===this._position||"top"===this._position)f.x=this.convertValueToPixel(a),
|
|
f.y=this.lineCoordinates.y1;if("left"===this._position||"right"===this._position)f.y=this.convertValueToPixel(a),f.x=this.lineCoordinates.x2;return f};B.prototype.convertPixelToValue=function(a){if("undefined"===typeof a)return null;var f=0,b=0,c,f=!0,d=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],b="number"===typeof a?a:"left"===this._position||"right"===this._position?a.y:a.x;if(this.logarithmic){a=c=Math.pow(this.logarithmBase,(b-this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit);
|
|
if(b<=this.conversionParameters.reference===("left"===this._position||"right"===this._position)!==this.reversed)for(b=0;b<d.length;b++){if(!(d[b].endValue<this.conversionParameters.minimum))if(f)if(d[b].startValue<this.conversionParameters.minimum){if(1<d[b].size&&this.conversionParameters.minimum*Math.pow(d[b].endValue/d[b].startValue,Math.log(c)/Math.log(d[b].size))<d[b].endValue){a=Math.pow(d[b].endValue/d[b].startValue,Math.log(c)/Math.log(d[b].size));break}else a*=d[b].endValue/this.conversionParameters.minimum/
|
|
Math.pow(d[b].size,Math.log(d[b].endValue/this.conversionParameters.minimum)/Math.log(d[b].endValue/d[b].startValue)),c/=Math.pow(d[b].size,Math.log(d[b].endValue/this.conversionParameters.minimum)/Math.log(d[b].endValue/d[b].startValue));f=!1}else if(c>d[b].startValue/this.conversionParameters.minimum){c/=d[b].startValue/this.conversionParameters.minimum;if(c<d[b].size){a*=Math.pow(d[b].endValue/d[b].startValue,1===d[b].size?1:Math.log(c)/Math.log(d[b].size))/c;break}else a*=d[b].endValue/d[b].startValue/
|
|
d[b].size;c/=d[b].size;f=!1}else break;else if(c>d[b].startValue/d[b-1].endValue){c/=d[b].startValue/d[b-1].endValue;if(c<d[b].size){a*=Math.pow(d[b].endValue/d[b].startValue,1===d[b].size?1:Math.log(c)/Math.log(d[b].size))/c;break}else a*=d[b].endValue/d[b].startValue/d[b].size;c/=d[b].size}else break}else for(b=d.length-1;0<=b;b--)if(!(d[b].startValue>this.conversionParameters.minimum))if(f)if(d[b].endValue>this.conversionParameters.minimum){if(1<d[b].size&&this.conversionParameters.minimum*Math.pow(d[b].endValue/
|
|
d[b].startValue,Math.log(c)/Math.log(d[b].size))>d[b].startValue){a=Math.pow(d[b].endValue/d[b].startValue,Math.log(c)/Math.log(d[b].size));break}else a*=d[b].startValue/this.conversionParameters.minimum*Math.pow(d[b].size,Math.log(d[b].startValue/this.conversionParameters.minimum)/Math.log(d[b].endValue/d[b].startValue))*c,c*=Math.pow(d[b].size,Math.log(this.conversionParameters.minimum/d[b].startValue)/Math.log(d[b].endValue/d[b].startValue));f=!1}else if(c<d[b].endValue/this.conversionParameters.minimum){c/=
|
|
d[b].endValue/this.conversionParameters.minimum;if(c>1/d[b].size){a*=Math.pow(d[b].endValue/d[b].startValue,1>=d[b].size?1:Math.log(c)/Math.log(d[b].size))*c;break}else a/=d[b].endValue/d[b].startValue/d[b].size;c*=d[b].size;f=!1}else break;else if(c<d[b].endValue/d[b+1].startValue){c/=d[b].endValue/d[b+1].startValue;if(c>1/d[b].size){a*=Math.pow(d[b].endValue/d[b].startValue,1>=d[b].size?1:Math.log(c)/Math.log(d[b].size))*c;break}else a/=d[b].endValue/d[b].startValue/d[b].size;c*=d[b].size}else break;
|
|
f=a*this.viewportMinimum}else{a=c=(b-this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit;if(b<=this.conversionParameters.reference===("left"===this._position||"right"===this._position)!==this.reversed)for(b=0;b<d.length;b++){if(!(d[b].endValue<this.conversionParameters.minimum))if(f)if(d[b].startValue<this.conversionParameters.minimum){if(d[b].size&&this.conversionParameters.minimum+c*(d[b].endValue-d[b].startValue)/d[b].size<d[b].endValue){a=0>=d[b].size?0:c*(d[b].endValue-
|
|
d[b].startValue)/d[b].size;break}else a+=d[b].endValue-this.conversionParameters.minimum-d[b].size*(d[b].endValue-this.conversionParameters.minimum)/(d[b].endValue-d[b].startValue),c-=d[b].size*(d[b].endValue-this.conversionParameters.minimum)/(d[b].endValue-d[b].startValue);f=!1}else if(c>d[b].startValue-this.conversionParameters.minimum){c-=d[b].startValue-this.conversionParameters.minimum;if(c<d[b].size){a+=(d[b].endValue-d[b].startValue)*(0===d[b].size?1:c/d[b].size)-c;break}else a+=d[b].endValue-
|
|
d[b].startValue-d[b].size;c-=d[b].size;f=!1}else break;else if(c>d[b].startValue-d[b-1].endValue){c-=d[b].startValue-d[b-1].endValue;if(c<d[b].size){a+=(d[b].endValue-d[b].startValue)*(0===d[b].size?1:c/d[b].size)-c;break}else a+=d[b].endValue-d[b].startValue-d[b].size;c-=d[b].size}else break}else for(b=d.length-1;0<=b;b--)if(!(d[b].startValue>this.conversionParameters.minimum))if(f)if(d[b].endValue>this.conversionParameters.minimum)if(d[b].size&&this.conversionParameters.minimum+c*(d[b].endValue-
|
|
d[b].startValue)/d[b].size>d[b].startValue){a=0>=d[b].size?0:c*(d[b].endValue-d[b].startValue)/d[b].size;break}else a+=d[b].startValue-this.conversionParameters.minimum+d[b].size*(this.conversionParameters.minimum-d[b].startValue)/(d[b].endValue-d[b].startValue),c+=d[b].size*(this.conversionParameters.minimum-d[b].startValue)/(d[b].endValue-d[b].startValue),f=!1;else if(c<d[b].endValue-this.conversionParameters.minimum){c-=d[b].endValue-this.conversionParameters.minimum;if(c>-1*d[b].size){a+=(d[b].endValue-
|
|
d[b].startValue)*(0===d[b].size?1:c/d[b].size)+c;break}else a-=d[b].endValue-d[b].startValue-d[b].size;c+=d[b].size;f=!1}else break;else if(c<d[b].endValue-d[b+1].startValue){c-=d[b].endValue-d[b+1].startValue;if(c>-1*d[b].size){a+=(d[b].endValue-d[b].startValue)*(0===d[b].size?1:c/d[b].size)+c;break}else a-=d[b].endValue-d[b].startValue-d[b].size;c+=d[b].size}else break;f=this.conversionParameters.minimum+a}return f};B.prototype.convertValueToPixel=function(a){a=this.getAppearentDifferceReplacingBreaksToSize(this.conversionParameters.minimum,
|
|
a,a);return this.logarithmic?this.conversionParameters.reference+this.conversionParameters.pixelPerUnit*Math.log(a/this.conversionParameters.minimum)/this.conversionParameters.lnLogarithmBase+0.5<<0:this.conversionParameters.reference+this.conversionParameters.pixelPerUnit*(a-this.conversionParameters.minimum)+0.5<<0};B.prototype.getAppearentDifferceReplacingBreaksToSize=function(a,f,b,c){var d=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[];if(this.logarithmic){b=x(b)?f/a:b;for(var g=0;g<d.length&&
|
|
!(f<d[g].startValue);g++)a>d[g].endValue||(a<=d[g].startValue&&f>=d[g].endValue?b=b/d[g].endValue*d[g].startValue*d[g].size:a>=d[g].startValue&&f>=d[g].endValue?b=b/d[g].endValue*a*Math.pow(d[g].size,Math.log(d[g].endValue/a)/Math.log(d[g].endValue/d[g].startValue)):a<=d[g].startValue&&f<=d[g].endValue?b=b/f*d[g].startValue*Math.pow(d[g].size,Math.log(f/d[g].startValue)/Math.log(d[g].endValue/d[g].startValue)):!c&&(a>d[g].startValue&&f<d[g].endValue)&&(b=a*Math.pow(d[g].size,Math.log(f/a)/Math.log(d[g].endValue/
|
|
d[g].startValue))))}else for(b=x(b)?Math.abs(f-a):b,g=0;g<d.length&&!(f<d[g].startValue);g++)a>d[g].endValue||(a<=d[g].startValue&&f>=d[g].endValue?b=b-d[g].endValue+d[g].startValue+d[g].size:a>d[g].startValue&&f>=d[g].endValue?b=b-d[g].endValue+a+d[g].size*(d[g].endValue-a)/(d[g].endValue-d[g].startValue):a<=d[g].startValue&&f<d[g].endValue?b=b-f+d[g].startValue+d[g].size*(f-d[g].startValue)/(d[g].endValue-d[g].startValue):!c&&(a>d[g].startValue&&f<d[g].endValue)&&(b=a+d[g].size*(f-a)/(d[g].endValue-
|
|
d[g].startValue)));return b};B.prototype.setViewPortRange=function(a,f){this.sessionVariables.newViewportMinimum=this.viewportMinimum=Math.min(a,f);this.sessionVariables.newViewportMaximum=this.viewportMaximum=Math.max(a,f)};B.prototype.getXValueAt=function(a){if(!a)return null;var f=null;"left"===this._position?f=this.convertPixelToValue(a.y):"bottom"===this._position&&(f=this.convertPixelToValue(a.x));return f};B.prototype.calculateValueToPixelConversionParameters=function(a){a=this.scaleBreaks?
|
|
this.scaleBreaks._appliedBreaks:[];var f={pixelPerUnit:null,minimum:null,reference:null},b=this.lineCoordinates.width,c=this.lineCoordinates.height,b="bottom"===this._position||"top"===this._position?b:c,c=Math.abs(this.range);if(this.logarithmic)for(var d=0;d<a.length&&!(this.viewportMaximum<a[d].startValue);d++)this.viewportMinimum>a[d].endValue||(this.viewportMinimum>=a[d].startValue&&this.viewportMaximum<=a[d].endValue?b=0:this.viewportMinimum<=a[d].startValue&&this.viewportMaximum>=a[d].endValue?
|
|
(c=c/a[d].endValue*a[d].startValue,b=0<a[d].spacing.toString().indexOf("%")?b*(1-parseFloat(a[d].spacing)/100):b-Math.min(a[d].spacing,0.1*b)):this.viewportMinimum>a[d].startValue&&this.viewportMaximum>=a[d].endValue?(c=c/a[d].endValue*this.viewportMinimum,b=0<a[d].spacing.toString().indexOf("%")?b*(1-parseFloat(a[d].spacing)/100*Math.log(a[d].endValue/this.viewportMinimum)/Math.log(a[d].endValue/a[d].startValue)):b-Math.min(a[d].spacing,0.1*b)*Math.log(a[d].endValue/this.viewportMinimum)/Math.log(a[d].endValue/
|
|
a[d].startValue)):this.viewportMinimum<=a[d].startValue&&this.viewportMaximum<a[d].endValue&&(c=c/this.viewportMaximum*a[d].startValue,b=0<a[d].spacing.toString().indexOf("%")?b*(1-parseFloat(a[d].spacing)/100*Math.log(this.viewportMaximum/a[d].startValue)/Math.log(a[d].endValue/a[d].startValue)):b-Math.min(a[d].spacing,0.1*b)*Math.log(this.viewportMaximum/a[d].startValue)/Math.log(a[d].endValue/a[d].startValue)));else for(d=0;d<a.length&&!(this.viewportMaximum<a[d].startValue);d++)this.viewportMinimum>
|
|
a[d].endValue||(this.viewportMinimum>=a[d].startValue&&this.viewportMaximum<=a[d].endValue?b=0:this.viewportMinimum<=a[d].startValue&&this.viewportMaximum>=a[d].endValue?(c=c-a[d].endValue+a[d].startValue,b=0<a[d].spacing.toString().indexOf("%")?b*(1-parseFloat(a[d].spacing)/100):b-Math.min(a[d].spacing,0.1*b)):this.viewportMinimum>a[d].startValue&&this.viewportMaximum>=a[d].endValue?(c=c-a[d].endValue+this.viewportMinimum,b=0<a[d].spacing.toString().indexOf("%")?b*(1-parseFloat(a[d].spacing)/100*
|
|
(a[d].endValue-this.viewportMinimum)/(a[d].endValue-a[d].startValue)):b-Math.min(a[d].spacing,0.1*b)*(a[d].endValue-this.viewportMinimum)/(a[d].endValue-a[d].startValue)):this.viewportMinimum<=a[d].startValue&&this.viewportMaximum<a[d].endValue&&(c=c-this.viewportMaximum+a[d].startValue,b=0<a[d].spacing.toString().indexOf("%")?b*(1-parseFloat(a[d].spacing)/100*(this.viewportMaximum-a[d].startValue)/(a[d].endValue-a[d].startValue)):b-Math.min(a[d].spacing,0.1*b)*(this.viewportMaximum-a[d].startValue)/
|
|
(a[d].endValue-a[d].startValue)));f.minimum=this.viewportMinimum;f.maximum=this.viewportMaximum;f.range=c;if("bottom"===this._position||"top"===this._position)this.logarithmic?(f.lnLogarithmBase=Math.log(this.logarithmBase),f.pixelPerUnit=(this.reversed?-1:1)*b*f.lnLogarithmBase/Math.log(Math.abs(c))):f.pixelPerUnit=(this.reversed?-1:1)*b/Math.abs(c),f.reference=this.reversed?this.lineCoordinates.x2:this.lineCoordinates.x1;if("left"===this._position||"right"===this._position)this.logarithmic?(f.lnLogarithmBase=
|
|
Math.log(this.logarithmBase),f.pixelPerUnit=(this.reversed?1:-1)*b*f.lnLogarithmBase/Math.log(Math.abs(c))):f.pixelPerUnit=(this.reversed?1:-1)*b/Math.abs(c),f.reference=this.reversed?this.lineCoordinates.y1:this.lineCoordinates.y2;this.conversionParameters=f};B.prototype.calculateAxisParameters=function(){if(this.logarithmic)this.calculateLogarithmicAxisParameters();else{var a=this.chart.layoutManager.getFreeSpace(),f=!1,b=!1;"bottom"===this._position||"top"===this._position?(this.maxWidth=a.width,
|
|
this.maxHeight=a.height):(this.maxWidth=a.height,this.maxHeight=a.width);var a="axisX"===this.type?"xySwapped"===this.chart.plotInfo.axisPlacement?62:70:"xySwapped"===this.chart.plotInfo.axisPlacement?50:40,c=4;"axisX"===this.type&&(c=600>this.maxWidth?8:6);var a=Math.max(c,Math.floor(this.maxWidth/a)),d,g,k,c=0;!x(this.options.viewportMinimum)&&(!x(this.options.viewportMaximum)&&this.options.viewportMinimum>=this.options.viewportMaximum)&&(this.viewportMinimum=this.viewportMaximum=null);if(x(this.options.viewportMinimum)&&
|
|
!x(this.sessionVariables.newViewportMinimum)&&!isNaN(this.sessionVariables.newViewportMinimum))this.viewportMinimum=this.sessionVariables.newViewportMinimum;else if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=this.minimum;if(x(this.options.viewportMaximum)&&!x(this.sessionVariables.newViewportMaximum)&&!isNaN(this.sessionVariables.newViewportMaximum))this.viewportMaximum=this.sessionVariables.newViewportMaximum;else if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=
|
|
this.maximum;if(this.scaleBreaks)for(c=0;c<this.scaleBreaks._appliedBreaks.length;c++)if((!x(this.sessionVariables.newViewportMinimum)&&this.sessionVariables.newViewportMinimum>=this.scaleBreaks._appliedBreaks[c].startValue||!x(this.options.minimum)&&this.options.minimum>=this.scaleBreaks._appliedBreaks[c].startValue||!x(this.options.viewportMinimum)&&this.viewportMinimum>=this.scaleBreaks._appliedBreaks[c].startValue)&&(!x(this.sessionVariables.newViewportMaximum)&&this.sessionVariables.newViewportMaximum<=
|
|
this.scaleBreaks._appliedBreaks[c].endValue||!x(this.options.maximum)&&this.options.maximum<=this.scaleBreaks._appliedBreaks[c].endValue||!x(this.options.viewportMaximum)&&this.viewportMaximum<=this.scaleBreaks._appliedBreaks[c].endValue)){this.scaleBreaks._appliedBreaks.splice(c,1);break}if("axisX"===this.type){if(this.dataSeries&&0<this.dataSeries.length)for(d=0;d<this.dataSeries.length;d++)"dateTime"===this.dataSeries[d].xValueType&&(b=!0);d=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin;
|
|
g=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax;0===g-d&&(c="undefined"===typeof this.options.interval?0.4:this.options.interval,g+=c,d-=c);Infinity!==this.dataInfo.minDiff?k=this.dataInfo.minDiff:1<g-d?k=0.5*Math.abs(g-d):(k=1,b&&(f=!0))}else"axisY"===this.type&&(d=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,g=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,isFinite(d)||isFinite(g)?isFinite(d)?isFinite(g)||(g=
|
|
d):d=g:(g="undefined"===typeof this.options.interval?-Infinity:this.options.interval,d="undefined"!==typeof this.options.interval||isFinite(this.dataInfo.minDiff)?0:Infinity),0===d&&0===g?(g+=9,d=0):0===g-d?(c=Math.min(Math.abs(0.01*Math.abs(g)),5),g+=c,d-=c):d>g?(c=Math.min(0.01*Math.abs(this.getAppearentDifferceReplacingBreaksToSize(g,d,null,!0)),5),0<=g?d=g-c:g=isFinite(d)?d+c:0):(c=Math.min(0.01*Math.abs(this.getAppearentDifferceReplacingBreaksToSize(d,g,null,!0)),0.05),0!==g&&(g+=c),0!==d&&(d-=
|
|
c)),k=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1<g-d?0.5*Math.abs(g-d):1,this.includeZero&&(null===this.viewportMinimum||isNaN(this.viewportMinimum))&&0<d&&(d=0),this.includeZero&&(null===this.viewportMaximum||isNaN(this.viewportMaximum))&&0>g&&(g=0));c=this.getAppearentDifferceReplacingBreaksToSize(isNaN(this.viewportMinimum)||null===this.viewportMinimum?d:this.viewportMinimum,isNaN(this.viewportMaximum)||null===this.viewportMaximum?g:this.viewportMaximum,null,!0);if("axisX"===this.type&&
|
|
b){this.intervalType||(c/1<=a?(this.interval=1,this.intervalType="millisecond"):c/2<=a?(this.interval=2,this.intervalType="millisecond"):c/5<=a?(this.interval=5,this.intervalType="millisecond"):c/10<=a?(this.interval=10,this.intervalType="millisecond"):c/20<=a?(this.interval=20,this.intervalType="millisecond"):c/50<=a?(this.interval=50,this.intervalType="millisecond"):c/100<=a?(this.interval=100,this.intervalType="millisecond"):c/200<=a?(this.interval=200,this.intervalType="millisecond"):c/250<=a?
|
|
(this.interval=250,this.intervalType="millisecond"):c/300<=a?(this.interval=300,this.intervalType="millisecond"):c/400<=a?(this.interval=400,this.intervalType="millisecond"):c/500<=a?(this.interval=500,this.intervalType="millisecond"):c/(1*M.secondDuration)<=a?(this.interval=1,this.intervalType="second"):c/(2*M.secondDuration)<=a?(this.interval=2,this.intervalType="second"):c/(5*M.secondDuration)<=a?(this.interval=5,this.intervalType="second"):c/(10*M.secondDuration)<=a?(this.interval=10,this.intervalType=
|
|
"second"):c/(15*M.secondDuration)<=a?(this.interval=15,this.intervalType="second"):c/(20*M.secondDuration)<=a?(this.interval=20,this.intervalType="second"):c/(30*M.secondDuration)<=a?(this.interval=30,this.intervalType="second"):c/(1*M.minuteDuration)<=a?(this.interval=1,this.intervalType="minute"):c/(2*M.minuteDuration)<=a?(this.interval=2,this.intervalType="minute"):c/(5*M.minuteDuration)<=a?(this.interval=5,this.intervalType="minute"):c/(10*M.minuteDuration)<=a?(this.interval=10,this.intervalType=
|
|
"minute"):c/(15*M.minuteDuration)<=a?(this.interval=15,this.intervalType="minute"):c/(20*M.minuteDuration)<=a?(this.interval=20,this.intervalType="minute"):c/(30*M.minuteDuration)<=a?(this.interval=30,this.intervalType="minute"):c/(1*M.hourDuration)<=a?(this.interval=1,this.intervalType="hour"):c/(2*M.hourDuration)<=a?(this.interval=2,this.intervalType="hour"):c/(3*M.hourDuration)<=a?(this.interval=3,this.intervalType="hour"):c/(6*M.hourDuration)<=a?(this.interval=6,this.intervalType="hour"):c/(1*
|
|
M.dayDuration)<=a?(this.interval=1,this.intervalType="day"):c/(2*M.dayDuration)<=a?(this.interval=2,this.intervalType="day"):c/(4*M.dayDuration)<=a?(this.interval=4,this.intervalType="day"):c/(1*M.weekDuration)<=a?(this.interval=1,this.intervalType="week"):c/(2*M.weekDuration)<=a?(this.interval=2,this.intervalType="week"):c/(3*M.weekDuration)<=a?(this.interval=3,this.intervalType="week"):c/(1*M.monthDuration)<=a?(this.interval=1,this.intervalType="month"):c/(2*M.monthDuration)<=a?(this.interval=2,
|
|
this.intervalType="month"):c/(3*M.monthDuration)<=a?(this.interval=3,this.intervalType="month"):c/(6*M.monthDuration)<=a?(this.interval=6,this.intervalType="month"):(this.interval=c/(1*M.yearDuration)<=a?1:c/(2*M.yearDuration)<=a?2:c/(4*M.yearDuration)<=a?4:Math.floor(B.getNiceNumber(c/(a-1),!0)/M.yearDuration),this.intervalType="year"));if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=d-k/2;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=
|
|
g+k/2;f?this.autoValueFormatString="MMM DD YYYY HH:mm":"year"===this.intervalType?this.autoValueFormatString="YYYY":"month"===this.intervalType?this.autoValueFormatString="MMM YYYY":"week"===this.intervalType?this.autoValueFormatString="MMM DD YYYY":"day"===this.intervalType?this.autoValueFormatString="MMM DD YYYY":"hour"===this.intervalType?this.autoValueFormatString="hh:mm TT":"minute"===this.intervalType?this.autoValueFormatString="hh:mm TT":"second"===this.intervalType?this.autoValueFormatString=
|
|
"hh:mm:ss TT":"millisecond"===this.intervalType&&(this.autoValueFormatString="fff'ms'");this.valueFormatString||(this.valueFormatString=this.autoValueFormatString)}else{this.intervalType="number";c=B.getNiceNumber(c,!1);this.interval=this.options&&0<this.options.interval?this.options.interval:B.getNiceNumber(c/(a-1),!0);if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum="axisX"===this.type?d-k/2:Math.floor(d/this.interval)*this.interval;if(null===this.viewportMaximum||
|
|
isNaN(this.viewportMaximum))this.viewportMaximum="axisX"===this.type?g+k/2:Math.ceil(g/this.interval)*this.interval;0===this.viewportMaximum&&0===this.viewportMinimum&&(0===this.options.viewportMinimum?this.viewportMaximum+=10:0===this.options.viewportMaximum&&(this.viewportMinimum-=10),this.options&&"undefined"===typeof this.options.interval&&(this.interval=B.getNiceNumber((this.viewportMaximum-this.viewportMinimum)/(a-1),!0)))}if(null===this.minimum||null===this.maximum)if("axisX"===this.type?(d=
|
|
null!==this.minimum?this.minimum:this.dataInfo.min,g=null!==this.maximum?this.maximum:this.dataInfo.max,0===g-d&&(c="undefined"===typeof this.options.interval?0.4:this.options.interval,g+=c,d-=c),k=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1<g-d?0.5*Math.abs(g-d):1):"axisY"===this.type&&(d=null!==this.minimum?this.minimum:this.dataInfo.min,g=null!==this.maximum?this.maximum:this.dataInfo.max,isFinite(d)||isFinite(g)?0===d&&0===g?(g+=9,d=0):0===g-d?(c=Math.min(Math.abs(0.01*Math.abs(g)),
|
|
5),g+=c,d-=c):d>g?(c=Math.min(0.01*Math.abs(this.getAppearentDifferceReplacingBreaksToSize(g,d,null,!0)),5),0<=g?d=g-c:g=isFinite(d)?d+c:0):(c=Math.min(0.01*Math.abs(this.getAppearentDifferceReplacingBreaksToSize(d,g,null,!0)),0.05),0!==g&&(g+=c),0!==d&&(d-=c)):(g="undefined"===typeof this.options.interval?-Infinity:this.options.interval,d="undefined"!==typeof this.options.interval||isFinite(this.dataInfo.minDiff)?0:Infinity),k=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1<g-d?0.5*Math.abs(g-
|
|
d):1,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&0<d&&(d=0),this.includeZero&&(null===this.maximum||isNaN(this.maximum))&&0>g&&(g=0)),Math.abs(this.getAppearentDifferceReplacingBreaksToSize(d,g,null,!0)),"axisX"===this.type&&b){if(null===this.minimum||isNaN(this.minimum))this.minimum=d-k/2;if(null===this.maximum||isNaN(this.maximum))this.maximum=g+k/2}else this.intervalType="number",null===this.minimum&&(this.minimum="axisX"===this.type?d-k/2:Math.floor(d/this.interval)*this.interval,
|
|
this.minimum=Math.min(this.minimum,null===this.sessionVariables.viewportMinimum||isNaN(this.sessionVariables.viewportMinimum)?Infinity:this.sessionVariables.viewportMinimum)),null===this.maximum&&(this.maximum="axisX"===this.type?g+k/2:Math.ceil(g/this.interval)*this.interval,this.maximum=Math.max(this.maximum,null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?-Infinity:this.sessionVariables.viewportMaximum)),0===this.maximum&&0===this.minimum&&(0===this.options.minimum?
|
|
this.maximum+=10:0===this.options.maximum&&(this.minimum-=10));x(this.sessionVariables.newViewportMinimum)&&(this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum));x(this.sessionVariables.newViewportMaximum)&&(this.viewportMaximum=Math.min(this.viewportMaximum,this.maximum));this.range=this.viewportMaximum-this.viewportMinimum;this.intervalStartPosition="axisX"===this.type&&b?this.getLabelStartPoint(new Date(this.viewportMinimum),this.intervalType,this.interval):Math.floor((this.viewportMinimum+
|
|
0.2*this.interval)/this.interval)*this.interval;this.valueFormatString||(this.valueFormatString=B.generateValueFormatString(this.range,2))}};B.prototype.calculateLogarithmicAxisParameters=function(){var a=this.chart.layoutManager.getFreeSpace(),f=Math.log(this.logarithmBase),b;"bottom"===this._position||"top"===this._position?(this.maxWidth=a.width,this.maxHeight=a.height):(this.maxWidth=a.height,this.maxHeight=a.width);var a="axisX"===this.type?500>this.maxWidth?7:Math.max(7,Math.floor(this.maxWidth/
|
|
100)):Math.max(Math.floor(this.maxWidth/50),3),c,d,g,k;k=1;if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=this.minimum;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum;if(this.scaleBreaks)for(k=0;k<this.scaleBreaks._appliedBreaks.length;k++)if((!x(this.sessionVariables.newViewportMinimum)&&this.sessionVariables.newViewportMinimum>=this.scaleBreaks._appliedBreaks[k].startValue||!x(this.options.minimum)&&this.options.minimum>=
|
|
this.scaleBreaks._appliedBreaks[k].startValue||!x(this.options.viewportMinimum)&&this.viewportMinimum>=this.scaleBreaks._appliedBreaks[k].startValue)&&(!x(this.sessionVariables.newViewportMaximum)&&this.sessionVariables.newViewportMaximum<=this.scaleBreaks._appliedBreaks[k].endValue||!x(this.options.maximum)&&this.options.maximum<=this.scaleBreaks._appliedBreaks[k].endValue||!x(this.options.viewportMaximum)&&this.viewportMaximum<=this.scaleBreaks._appliedBreaks[k].endValue)){this.scaleBreaks._appliedBreaks.splice(k,
|
|
1);break}"axisX"===this.type?(c=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,d=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,1===d/c&&(k=Math.pow(this.logarithmBase,"undefined"===typeof this.options.interval?0.4:this.options.interval),d*=k,c/=k),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:d/c>this.logarithmBase?d/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase):"axisY"===this.type&&(c=null!==this.viewportMinimum?this.viewportMinimum:
|
|
this.dataInfo.viewPortMin,d=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,0>=c&&!isFinite(d)?(d="undefined"===typeof this.options.interval?0:this.options.interval,c=1):0>=c?c=d:isFinite(d)||(d=c),1===c&&1===d?(d*=this.logarithmBase-1/this.logarithmBase,c=1):1===d/c?(k=Math.min(d*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),d*=k,c/=k):c>d?(k=Math.min(c/d*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),1<=d?c=d/k:d=c*k):(k=Math.min(d/
|
|
c*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==d&&(d*=k),1!==c&&(c/=k)),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:d/c>this.logarithmBase?d/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase,this.includeZero&&(null===this.viewportMinimum||isNaN(this.viewportMinimum))&&1<c&&(c=1),this.includeZero&&(null===this.viewportMaximum||isNaN(this.viewportMaximum))&&1>d&&(d=1));k=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?d:this.viewportMaximum)/(isNaN(this.viewportMinimum)||
|
|
null===this.viewportMinimum?c:this.viewportMinimum);linearRange=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?d:this.viewportMaximum)-(isNaN(this.viewportMinimum)||null===this.viewportMinimum?c:this.viewportMinimum);this.intervalType="number";k=Math.pow(this.logarithmBase,B.getNiceNumber(Math.abs(Math.log(k)/f),!1));this.options&&0<this.options.interval?this.interval=this.options.interval:(this.interval=B.getNiceExponent(Math.log(k)/f/(a-1),!0),b=B.getNiceNumber(linearRange/(a-1),!0));
|
|
if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum="axisX"===this.type?c/Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.floor(Math.log(c)/f/this.interval));if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum="axisX"===this.type?d*Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.ceil(Math.log(d)/f/this.interval));1===this.viewportMaximum&&1===this.viewportMinimum&&(1===this.options.viewportMinimum?this.viewportMaximum*=
|
|
this.logarithmBase-1/this.logarithmBase:1===this.options.viewportMaximum&&(this.viewportMinimum/=this.logarithmBase-1/this.logarithmBase),this.options&&"undefined"===typeof this.options.interval&&(this.interval=B.getNiceExponent(Math.ceil(Math.log(k)/f)/(a-1)),b=B.getNiceNumber((this.viewportMaximum-this.viewportMinimum)/(a-1),!0)));if(null===this.minimum||null===this.maximum)"axisX"===this.type?(c=null!==this.minimum?this.minimum:this.dataInfo.min,d=null!==this.maximum?this.maximum:this.dataInfo.max,
|
|
1===d/c&&(k=Math.pow(this.logarithmBase,"undefined"===typeof this.options.interval?0.4:this.options.interval),d*=k,c/=k),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:d/c>this.logarithmBase?d/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase):"axisY"===this.type&&(c=null!==this.minimum?this.minimum:this.dataInfo.min,d=null!==this.maximum?this.maximum:this.dataInfo.max,isFinite(c)||isFinite(d)?1===c&&1===d?(d*=this.logarithmBase,c/=this.logarithmBase):1===d/c?(k=Math.pow(this.logarithmBase,
|
|
this.interval),d*=k,c/=k):c>d?(k=Math.min(0.01*(c/d),5),1<=d?c=d/k:d=c*k):(k=Math.min(d/c*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==d&&(d*=k),1!==c&&(c/=k)):(d="undefined"===typeof this.options.interval?0:this.options.interval,c=1),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:d/c>this.logarithmBase?d/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&1<c&&(c=1),this.includeZero&&(null===this.maximum||
|
|
isNaN(this.maximum))&&1>d&&(d=1)),this.intervalType="number",null===this.minimum&&(this.minimum="axisX"===this.type?c/Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.floor(Math.log(c)/f/this.interval)),this.minimum=Math.min(this.minimum,null===this.sessionVariables.viewportMinimum||isNaN(this.sessionVariables.viewportMinimum)?"undefined"===typeof this.sessionVariables.newViewportMinimum?Infinity:this.sessionVariables.newViewportMinimum:this.sessionVariables.viewportMinimum)),null===this.maximum&&
|
|
(this.maximum="axisX"===this.type?d*Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.ceil(Math.log(d)/f/this.interval)),this.maximum=Math.max(this.maximum,null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?"undefined"===typeof this.sessionVariables.newViewportMaximum?0:this.sessionVariables.newViewportMaximum:this.sessionVariables.viewportMaximum)),1===this.maximum&&1===this.minimum&&(1===this.options.minimum?this.maximum*=this.logarithmBase-1/this.logarithmBase:
|
|
1===this.options.maximum&&(this.minimum/=this.logarithmBase-1/this.logarithmBase));this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum);this.viewportMaximum=Math.min(this.viewportMaximum,this.maximum);this.viewportMinimum>this.viewportMaximum&&(!this.options.viewportMinimum&&!this.options.minimum||this.options.viewportMaximum||this.options.maximum?this.options.viewportMinimum||this.options.minimum||!this.options.viewportMaximum&&!this.options.maximum||(this.viewportMinimum=this.minimum=
|
|
(this.options.viewportMaximum||this.options.maximum)/Math.pow(this.logarithmBase,2*Math.ceil(this.interval))):this.viewportMaximum=this.maximum=this.options.viewportMinimum||this.options.minimum);c=Math.pow(this.logarithmBase,Math.floor(Math.log(this.viewportMinimum)/(f*this.interval)+0.2)*this.interval);this.range=this.viewportMaximum/this.viewportMinimum;this.noTicks=a;if(!this.options.interval&&this.range<Math.pow(this.logarithmBase,8>this.viewportMaximum||3>a?2:3)){for(f=Math.floor(this.viewportMinimum/
|
|
b+0.5)*b;f<this.viewportMinimum;)f+=b;this.equidistantInterval=!1;this.intervalStartPosition=f;this.interval=b}else this.options.interval||(b=Math.ceil(this.interval),this.range>this.interval&&(this.interval=b,c=Math.pow(this.logarithmBase,Math.floor(Math.log(this.viewportMinimum)/(f*this.interval)+0.2)*this.interval))),this.equidistantInterval=!0,this.intervalStartPosition=c;if(!this.valueFormatString&&(this.valueFormatString="#,##0.##",1>this.viewportMinimum)){f=Math.floor(Math.abs(Math.log(this.viewportMinimum)/
|
|
Math.LN10))+2;if(isNaN(f)||!isFinite(f))f=2;if(2<f)for(k=0;k<f-2;k++)this.valueFormatString+="#"}};B.generateValueFormatString=function(a,f){var b="#,##0.",c=f;1>a&&(c+=Math.floor(Math.abs(Math.log(a)/Math.LN10)),isNaN(c)||!isFinite(c))&&(c=f);for(var d=0;d<c;d++)b+="#";return b};B.getNiceExponent=function(a,f){var b=Math.floor(Math.log(a)/Math.LN10),c=a/Math.pow(10,b),c=0>b?1>=c?1:5>=c?5:10:Math.max(Math.floor(c),1);return Number((c*Math.pow(10,b)).toFixed(20))};B.getNiceNumber=function(a,f){var b=
|
|
Math.floor(Math.log(a)/Math.LN10),c=a/Math.pow(10,b);return Number(((f?1.5>c?1:3>c?2:7>c?5:10:1>=c?1:2>=c?2:5>=c?5:10)*Math.pow(10,b)).toFixed(20))};B.prototype.getLabelStartPoint=function(){var a=M[this.intervalType+"Duration"]*this.interval,a=new Date(Math.floor(this.viewportMinimum/a)*a);if("millisecond"!==this.intervalType)if("second"===this.intervalType)0<a.getMilliseconds()&&(a.setSeconds(a.getSeconds()+1),a.setMilliseconds(0));else if("minute"===this.intervalType){if(0<a.getSeconds()||0<a.getMilliseconds())a.setMinutes(a.getMinutes()+
|
|
1),a.setSeconds(0),a.setMilliseconds(0)}else if("hour"===this.intervalType){if(0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setHours(a.getHours()+1),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("day"===this.intervalType){if(0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setDate(a.getDate()+1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("week"===this.intervalType){if(0<a.getDay()||0<a.getHours()||0<a.getMinutes()||
|
|
0<a.getSeconds()||0<a.getMilliseconds())a.setDate(a.getDate()+(7-a.getDay())),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("month"===this.intervalType){if(1<a.getDate()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setMonth(a.getMonth()+1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else"year"===this.intervalType&&(0<a.getMonth()||1<a.getDate()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())&&
|
|
(a.setFullYear(a.getFullYear()+1),a.setMonth(0),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0));return a};la(J,T);la(ca,T);ca.prototype.createUserOptions=function(a){if("undefined"!==typeof a||this.options._isPlaceholder){var f=0;this.parent.options._isPlaceholder&&this.parent.createUserOptions();this.options._isPlaceholder||(Ea(this.parent[this.optionsName]),f=this.parent.options[this.optionsName].indexOf(this.options));this.options="undefined"===typeof a?{}:a;this.parent.options[this.optionsName][f]=
|
|
this.options}};ca.prototype.render=function(a){if(0!==this.spacing||0!==this.options.lineThickness&&("undefined"!==typeof this.options.lineThickness||0!==this.parent.lineThickness)){var f=this.ctx,b=this.ctx.globalAlpha;this.ctx=a||this.ctx;this.ctx.save();this.ctx.beginPath();this.ctx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.ctx.clip();var c=this.scaleBreaks.parent.getPixelCoordinatesOnAxis(this.startValue),d=this.scaleBreaks.parent.getPixelCoordinatesOnAxis(this.endValue);
|
|
this.ctx.strokeStyle=this.lineColor;this.ctx.fillStyle=this.color;this.ctx.beginPath();this.ctx.globalAlpha=1;W(this.id);var g,k,l,n,h,r;a=Math.max(this.spacing,3);var p=Math.max(0,this.lineThickness);this.ctx.lineWidth=p;this.ctx.setLineDash&&this.ctx.setLineDash(F(this.lineDashType,p));if("bottom"===this.scaleBreaks.parent._position||"top"===this.scaleBreaks.parent._position)if(c=1===p%2?(c.x<<0)+0.5:c.x<<0,k=1===p%2?(d.x<<0)+0.5:d.x<<0,"top"===this.scaleBreaks.parent._position?(d=this.chart.plotArea.y1,
|
|
l=this.chart.plotArea.y2+p/2+0.5<<0):(d=this.chart.plotArea.y2,l=this.chart.plotArea.y1-p/2+0.5<<0,a*=-1),this.bounds={x1:c-p/2,y1:d,x2:k+p/2,y2:l},this.ctx.moveTo(c,d),"straight"===this.type||"top"===this.scaleBreaks.parent._position&&0>=a||"bottom"===this.scaleBreaks.parent._position&&0<=a)this.ctx.lineTo(c,l),this.ctx.lineTo(k,l),this.ctx.lineTo(k,d);else if("wavy"===this.type){n=c;h=d;g=0.5;r=(l-h)/a/3;for(var m=0;m<r;m++)this.ctx.bezierCurveTo(n+g*a,h+a,n+g*a,h+2*a,n,h+3*a),h+=3*a,g*=-1;this.ctx.bezierCurveTo(n+
|
|
g*a,h+a,n+g*a,h+2*a,n,h+3*a);n=k;g*=-1;this.ctx.lineTo(n,h);for(m=0;m<r;m++)this.ctx.bezierCurveTo(n+g*a,h-a,n+g*a,h-2*a,n,h-3*a),h-=3*a,g*=-1}else{if("zigzag"===this.type){g=-1;h=d+a;n=c+a;r=(l-h)/a/2;for(m=0;m<r;m++)this.ctx.lineTo(n,h),n+=2*g*a,h+=2*a,g*=-1;this.ctx.lineTo(n,h);n+=k-c;for(m=0;m<r+1;m++)this.ctx.lineTo(n,h),n+=2*g*a,h-=2*a,g*=-1;this.ctx.lineTo(n+g*a,h+a)}}else if("left"===this.scaleBreaks.parent._position||"right"===this.scaleBreaks.parent._position)if(d=1===p%2?(d.y<<0)+0.5:d.y<<
|
|
0,l=1===p%2?(c.y<<0)+0.5:c.y<<0,"left"===this.scaleBreaks.parent._position?(c=this.chart.plotArea.x1,k=this.chart.plotArea.x2+p/2+0.5<<0):(c=this.chart.plotArea.x2,k=this.chart.plotArea.x1-p/2+0.5<<0,a*=-1),this.bounds={x1:c,y1:d-p/2,x2:k,y2:l+p/2},this.ctx.moveTo(c,d),"straight"===this.type||"left"===this.scaleBreaks.parent._position&&0>=a||"right"===this.scaleBreaks.parent._position&&0<=a)this.ctx.lineTo(k,d),this.ctx.lineTo(k,l),this.ctx.lineTo(c,l);else if("wavy"===this.type){n=c;h=d;g=0.5;r=
|
|
(k-n)/a/3;for(m=0;m<r;m++)this.ctx.bezierCurveTo(n+a,h+g*a,n+2*a,h+g*a,n+3*a,h),n+=3*a,g*=-1;this.ctx.bezierCurveTo(n+a,h+g*a,n+2*a,h+g*a,n+3*a,h);h=l;g*=-1;this.ctx.lineTo(n,h);for(m=0;m<r;m++)this.ctx.bezierCurveTo(n-a,h+g*a,n-2*a,h+g*a,n-3*a,h),n-=3*a,g*=-1}else if("zigzag"===this.type){g=1;h=d-a;n=c+a;r=(k-n)/a/2;for(m=0;m<r;m++)this.ctx.lineTo(n,h),h+=2*g*a,n+=2*a,g*=-1;this.ctx.lineTo(n,h);h+=l-d;for(m=0;m<r+1;m++)this.ctx.lineTo(n,h),h+=2*g*a,n-=2*a,g*=-1;this.ctx.lineTo(n+a,h+g*a)}0<p&&this.ctx.stroke();
|
|
this.ctx.closePath();this.ctx.globalAlpha=this.fillOpacity;this.ctx.globalCompositeOperation="destination-over";this.ctx.fill();this.ctx.restore();this.ctx.globalAlpha=b;this.ctx=f}};la(da,T);da.prototype.createUserOptions=function(a){if("undefined"!==typeof a||this.options._isPlaceholder){var f=0;this.parent.options._isPlaceholder&&this.parent.createUserOptions();this.options._isPlaceholder||(Ea(this.parent.stripLines),f=this.parent.options.stripLines.indexOf(this.options));this.options="undefined"===
|
|
typeof a?{}:a;this.parent.options.stripLines[f]=this.options}};da.prototype.render=function(){this.ctx.save();var a=this.parent.getPixelCoordinatesOnAxis(this.value),f=Math.abs("pixel"===this._thicknessType?this.thickness:this.parent.conversionParameters.pixelPerUnit*this.thickness);if(0<f){var b=null===this.opacity?1:this.opacity;this.ctx.strokeStyle=this.color;this.ctx.beginPath();var c=this.ctx.globalAlpha;this.ctx.globalAlpha=b;W(this.id);var d,g,k,l;this.ctx.lineWidth=f;this.ctx.setLineDash&&
|
|
this.ctx.setLineDash(F(this.lineDashType,f));if("bottom"===this.parent._position||"top"===this.parent._position)d=g=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0,k=this.chart.plotArea.y1,l=this.chart.plotArea.y2,this.bounds={x1:d-f/2,y1:k,x2:g+f/2,y2:l};else if("left"===this.parent._position||"right"===this.parent._position)k=l=1===this.ctx.lineWidth%2?(a.y<<0)+0.5:a.y<<0,d=this.chart.plotArea.x1,g=this.chart.plotArea.x2,this.bounds={x1:d,y1:k-f/2,x2:g,y2:l+f/2};this.ctx.moveTo(d,k);this.ctx.lineTo(g,
|
|
l);this.ctx.stroke();this.ctx.globalAlpha=c}this.ctx.restore()};la(fa,T);fa.prototype.render=function(a,f){var b,c,d,g,k=null,l=k=null,n="";if(!this.valueFormatString)if(!x(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&"dateTime"===this.parent.dataSeries[0].xValueType)this.valueFormatString=this.parent.valueFormatString;else{var h=0,h="xySwapped"===this.chart.plotInfo.axisPlacement?50<this.parent.range?0:500<this.chart.width&&25>this.parent.range?2:Math.floor(Math.abs(Math.log(this.parent.range)/
|
|
Math.LN10))+(5>this.parent.range?2:10>this.parent.range?1:0):50<this.parent.range?0:Math.floor(Math.abs(Math.log(this.parent.range)/Math.LN10))+(5>this.parent.range?2:10>this.parent.range?1:0);this.valueFormatString=B.generateValueFormatString(this.parent.range,h)}var l=null===this.opacity?1:this.opacity,h=Math.abs("pixel"===this._thicknessType?this.thickness:this.parent.conversionParameters.pixelPerUnit*this.thickness),r=this.chart.overlaidCanvasCtx,p=r.globalAlpha;r.globalAlpha=l;r.beginPath();
|
|
r.strokeStyle=this.color;r.lineWidth=h;r.save();this.labelFontSize=x(this.options.labelFontSize)?this.parent.labelFontSize:this.labelFontSize;if("left"===this.parent._position||"right"===this.parent._position)this.labelMaxWidth=x(this.options.labelMaxWidth)?this.parent.bounds.x2-this.parent.bounds.x1:this.labelMaxWidth,this.labelMaxHeight=x(this.options.labelWrap)||this.labelWrap?3*this.chart.height:2*this.labelFontSize;else if("top"===this.parent._position||"bottom"===this.parent._position)this.labelMaxWidth=
|
|
x(this.options.labelMaxWidth)?3*this.chart.width:this.labelMaxWidth,this.labelMaxHeight=x(this.options.labelWrap)||this.labelWrap?this.parent.bounds.height:2*this.labelFontSize;0<h&&r.setLineDash&&r.setLineDash(F(this.lineDashType,h));l=new ka(r,{x:0,y:0,padding:{top:2,right:3,bottom:2,left:4},backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,maxWidth:this.labelMaxWidth,maxHeight:this.labelMaxHeight,
|
|
angle:this.labelAngle,text:n,horizontalAlign:"left",fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"});if(this.snapToDataPoint){var m=0,k=[];if("xySwapped"===this.chart.plotInfo.axisPlacement){var e=null;if("bottom"===this.parent._position||"top"===this.parent._position)m=this.parent.dataSeries[0].axisX.convertPixelToValue({y:f});else if("left"===this.parent._position||"right"===
|
|
this.parent._position)m=this.parent.convertPixelToValue({y:f});for(var q=0;q<this.parent.dataSeries.length;q++)(e=this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(e.dataSeries=this.parent.dataSeries[q],null!==e.dataPoint.y&&k.push(e));e=null;if(0===k.length)return;k.sort(function(a,b){return a.distance-b.distance});e=Math.abs(a-this.parent.convertValueToPixel(k[0].dataPoint.y));q=0;if("rangeBar"===k[0].dataSeries.type||"error"===k[0].dataSeries.type)for(var e=Math.abs(a-this.parent.convertValueToPixel(k[q].dataPoint.y[0])),
|
|
s=0,m=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(a-this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else s=Math.abs(a-this.parent.convertValueToPixel(k[m].dataPoint.y)),s<e&&(e=s,q=m);else if("stackedBar"===k[0].dataSeries.type)for(var e=Math.abs(a-this.parent.convertValueToPixel(k[0].dataPoint.y)),u=s=0,m=q=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(a-
|
|
this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else u+=k[m].dataPoint.y,s=Math.abs(a-this.parent.convertValueToPixel(u)),s<e&&(e=s,q=m);else if("stackedBar100"===k[0].dataSeries.type)for(var e=Math.abs(a-this.parent.convertValueToPixel(k[0].dataPoint.y)),v=u=s=0,m=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(a-this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else u+=k[m].dataPoint.y,v=k[m].dataPoint.x.getTime?
|
|
k[m].dataPoint.x.getTime():k[m].dataPoint.x,v=100*(u/k[m].dataSeries.plotUnit.dataPointYSums[v]),s=Math.abs(a-this.parent.convertValueToPixel(v)),s<e&&(e=s,q=m);else for(e=Math.abs(a-this.parent.convertValueToPixel(k[0].dataPoint.y)),m=q=s=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(a-this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else s=Math.abs(a-this.parent.convertValueToPixel(k[m].dataPoint.y)),s<e&&(e=s,
|
|
q=m);n=k[q];if("bottom"===this.parent._position||"top"===this.parent._position){b=0;if("rangeBar"===this.parent.dataSeries[q].type||"error"===this.parent.dataSeries[q].type){e=Math.abs(a-this.parent.convertValueToPixel(n.dataPoint.y[0]));for(m=s=0;m<n.dataPoint.y.length;m++)s=Math.abs(a-this.parent.convertValueToPixel(n.dataPoint.y[m])),s<e&&(e=s,b=m);k=1===r.lineWidth%2?(this.parent.convertValueToPixel(n.dataPoint.y[b])<<0)+0.5:this.parent.convertValueToPixel(n.dataPoint.y[b])<<0;l.text=this.labelFormatter?
|
|
this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.y[b]}):x(this.options.label)?ea(n.dataPoint.y[b],this.valueFormatString,this.chart._cultureInfo):this.label}else if("stackedBar"===this.parent.dataSeries[q].type){e=Math.abs(a-this.parent.convertValueToPixel(k[0].dataPoint.y));u=s=0;for(m=q;0<=m;m--)u+=k[m].dataPoint.y,s=Math.abs(a-this.parent.convertValueToPixel(u)),s<e&&(e=s,b=m);k=1===r.lineWidth%2?(this.parent.convertValueToPixel(u)<<0)+0.5:
|
|
this.parent.convertValueToPixel(u)<<0;l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.y}):x(this.options.label)?ea(n.dataPoint.y,this.valueFormatString,this.chart._cultureInfo):this.label}else if("stackedBar100"===this.parent.dataSeries[q].type){e=Math.abs(a-this.parent.convertValueToPixel(k[0].dataPoint.y));v=u=s=0;for(m=q;0<=m;m--)u+=k[m].dataPoint.y,v=k[m].dataPoint.x.getTime?k[m].dataPoint.x.getTime():k[m].dataPoint.x,
|
|
v=100*(u/k[m].dataSeries.plotUnit.dataPointYSums[v]),s=Math.abs(a-this.parent.convertValueToPixel(v)),s<e&&(e=s,b=m);k=1===r.lineWidth%2?(this.parent.convertValueToPixel(v)<<0)+0.5:this.parent.convertValueToPixel(v)<<0;l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:v}):x(this.options.label)?ea(v,this.valueFormatString,this.chart._cultureInfo):this.label}else k=1===r.lineWidth%2?(this.parent.convertValueToPixel(n.dataPoint.y)<<
|
|
0)+0.5:this.parent.convertValueToPixel(n.dataPoint.y)<<0,l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.y}):x(this.options.label)?ea(n.dataPoint.y,this.valueFormatString,this.chart._cultureInfo):this.label;b=c=k;d=this.chart.plotArea.y1;g=this.chart.plotArea.y2;this.bounds={x1:b-h/2,y1:d,x2:c+h/2,y2:g};l.x=b-l.measureText().width/2;l.x+l.width>this.chart.bounds.x2?l.x=this.chart.bounds.x2-l.width:l.x<this.chart.bounds.x1&&
|
|
(l.x=this.chart.bounds.x1);l.y=this.parent.lineCoordinates.y2+l.fontSize/2+2}else if("left"===this.parent._position||"right"===this.parent._position){d=g=k=1===r.lineWidth%2?(this.parent.convertValueToPixel(n.dataPoint.x)<<0)+0.5:this.parent.convertValueToPixel(n.dataPoint.x)<<0;b=this.chart.plotArea.x1;c=this.chart.plotArea.x2;this.bounds={x1:b,y1:d-h/2,x2:c,y2:g+h/2};v=!1;if(this.parent.labels)for(k=Math.ceil(this.parent.interval),m=0;m<this.parent.viewportMaximum;m+=k)if(this.parent.labels[m])v=
|
|
!0;else{v=!1;break}if(v){if("axisX"===this.parent.type)for(m=this.parent.convertPixelToValue({y:f}),e=null,q=0;q<this.parent.dataSeries.length;q++)(e=this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.x}):x(this.options.label)?e.dataPoint.label:this.label)}else!x(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&"dateTime"===this.parent.dataSeries[0].xValueType?
|
|
l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.x}):x(this.options.label)?za(n.dataPoint.x,this.valueFormatString,this.chart._cultureInfo):this.label:!x(this.parent.dataSeries)&&(0<this.parent.dataSeries.length&&"number"===this.parent.dataSeries[0].xValueType)&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.x}):x(this.options.label)?
|
|
ea(n.dataPoint.x,this.valueFormatString,this.chart._cultureInfo):this.label);l.y=g+l.fontSize/2-l.measureText().height/2+2;l.y-l.fontSize/2<this.chart.bounds.y1?l.y=this.chart.bounds.y1+l.fontSize/2+2:l.y+l.measureText().height-l.fontSize/2>this.chart.bounds.y2&&(l.y=this.chart.bounds.y2-l.measureText().height+l.fontSize/2);"left"===this.parent._position?l.x=this.parent.lineCoordinates.x2-l.measureText().width:"right"===this.parent._position&&(l.x=this.parent.lineCoordinates.x2)}}else if("bottom"===
|
|
this.parent._position||"top"===this.parent._position){m=this.parent.convertPixelToValue({x:a});for(q=0;q<this.parent.dataSeries.length;q++)(e=this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(e.dataSeries=this.parent.dataSeries[q],null!==e.dataPoint.y&&k.push(e));if(0===k.length)return;k.sort(function(a,b){return a.distance-b.distance});n=k[0];b=c=k=1===r.lineWidth%2?(this.parent.convertValueToPixel(n.dataPoint.x)<<0)+0.5:this.parent.convertValueToPixel(n.dataPoint.x)<<0;d=this.chart.plotArea.y1;
|
|
g=this.chart.plotArea.y2;this.bounds={x1:b-h/2,y1:d,x2:c+h/2,y2:g};v=!1;if(this.parent.labels)for(k=Math.ceil(this.parent.interval),m=0;m<this.parent.viewportMaximum;m+=k)if(this.parent.labels[m])v=!0;else{v=!1;break}if(v){if("axisX"===this.parent.type)for(m=this.parent.convertPixelToValue({x:a}),e=null,q=0;q<this.parent.dataSeries.length;q++)(e=this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,
|
|
crosshair:this.options,value:n.dataPoint.x}):x(this.options.label)?e.dataPoint.label:this.label)}else!x(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&"dateTime"===this.parent.dataSeries[0].xValueType?l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.x}):x(this.options.label)?za(n.dataPoint.x,this.valueFormatString,this.chart._cultureInfo):this.label:!x(this.parent.dataSeries)&&(0<this.parent.dataSeries.length&&
|
|
"number"===this.parent.dataSeries[0].xValueType)&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.x}):x(this.options.label)?ea(n.dataPoint.x,this.valueFormatString,this.chart._cultureInfo):this.label);l.x=b-l.measureText().width/2;l.x+l.width>this.chart.bounds.x2&&(l.x=this.chart.bounds.x2-l.width);l.x<this.chart.bounds.x1&&(l.x=this.chart.bounds.x1);"bottom"===this.parent._position?l.y=this.parent.lineCoordinates.y2+
|
|
l.fontSize/2+2:"top"===this.parent._position&&(l.y=this.parent.lineCoordinates.y1-l.height+l.fontSize/2+2)}else if("left"===this.parent._position||"right"===this.parent._position){!x(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&(m=this.parent.dataSeries[0].axisX.convertPixelToValue({x:a}));for(q=0;q<this.parent.dataSeries.length;q++)(e=this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(e.dataSeries=this.parent.dataSeries[q],null!==e.dataPoint.y&&k.push(e));if(0===k.length)return;
|
|
k.sort(function(a,b){return a.distance-b.distance});q=0;if("rangeColumn"===k[0].dataSeries.type||"rangeArea"===k[0].dataSeries.type||"error"===k[0].dataSeries.type||"rangeSplineArea"===k[0].dataSeries.type||"candlestick"===k[0].dataSeries.type||"ohlc"===k[0].dataSeries.type||"boxAndWhisker"===k[0].dataSeries.type)for(e=Math.abs(f-this.parent.convertValueToPixel(k[0].dataPoint.y[0])),m=s=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(f-
|
|
this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else s=Math.abs(f-this.parent.convertValueToPixel(k[m].dataPoint.y)),s<e&&(e=s,q=m);else if("stackedColumn"===k[0].dataSeries.type||"stackedArea"===k[0].dataSeries.type)for(e=Math.abs(f-this.parent.convertValueToPixel(k[0].dataPoint.y)),m=u=s=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(f-this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else u+=
|
|
k[m].dataPoint.y,s=Math.abs(f-this.parent.convertValueToPixel(u)),s<e&&(e=s,q=m);else if("stackedColumn100"===k[0].dataSeries.type||"stackedArea100"===k[0].dataSeries.type)for(e=Math.abs(f-this.parent.convertValueToPixel(k[0].dataPoint.y)),m=v=u=s=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(f-this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else u+=k[m].dataPoint.y,v=k[m].dataPoint.x.getTime?k[m].dataPoint.x.getTime():
|
|
k[m].dataPoint.x,v=100*(u/k[m].dataSeries.plotUnit.dataPointYSums[v]),s=Math.abs(f-this.parent.convertValueToPixel(v)),s<e&&(e=s,q=m);else for(e=Math.abs(f-this.parent.convertValueToPixel(k[0].dataPoint.y)),m=s=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(f-this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else s=Math.abs(f-this.parent.convertValueToPixel(k[m].dataPoint.y)),s<e&&(e=s,q=m);n=k[q];b=0;if("rangeColumn"===
|
|
this.parent.dataSeries[q].type||"rangeArea"===this.parent.dataSeries[q].type||"error"===this.parent.dataSeries[q].type||"rangeSplineArea"===this.parent.dataSeries[q].type||"candlestick"===this.parent.dataSeries[q].type||"ohlc"===this.parent.dataSeries[q].type||"boxAndWhisker"===this.parent.dataSeries[q].type){e=Math.abs(f-this.parent.convertValueToPixel(n.dataPoint.y[0]));for(m=s=0;m<n.dataPoint.y.length;m++)s=Math.abs(f-this.parent.convertValueToPixel(n.dataPoint.y[m])),s<e&&(e=s,b=m);k=1===r.lineWidth%
|
|
2?(this.parent.convertValueToPixel(n.dataPoint.y[b])<<0)+0.5:this.parent.convertValueToPixel(n.dataPoint.y[b])<<0;l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.y[b]}):x(this.options.label)?ea(n.dataPoint.y[b],this.valueFormatString,this.chart._cultureInfo):this.label}else if("stackedColumn"===this.parent.dataSeries[q].type||"stackedArea"===this.parent.dataSeries[q].type){e=Math.abs(f-this.parent.convertValueToPixel(k[0].dataPoint.y));
|
|
u=s=0;for(m=q;0<=m;m--)u+=k[m].dataPoint.y,s=Math.abs(f-this.parent.convertValueToPixel(u)),s<e&&(e=s,b=m);k=1===r.lineWidth%2?(this.parent.convertValueToPixel(u)<<0)+0.5:this.parent.convertValueToPixel(u)<<0;l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.y}):x(this.options.label)?ea(n.dataPoint.y,this.valueFormatString,this.chart._cultureInfo):this.label}else if("stackedColumn100"===this.parent.dataSeries[q].type||
|
|
"stackedArea100"===this.parent.dataSeries[q].type){e=Math.abs(f-this.parent.convertValueToPixel(k[0].dataPoint.y));u=s=0;for(m=q;0<=m;m--)u+=k[m].dataPoint.y,v=k[m].dataPoint.x.getTime?k[m].dataPoint.x.getTime():k[m].dataPoint.x,v=100*(u/k[m].dataSeries.plotUnit.dataPointYSums[v]),s=Math.abs(f-this.parent.convertValueToPixel(v)),s<e&&(e=s,b=m);k=1===r.lineWidth%2?(this.parent.convertValueToPixel(v)<<0)+0.5:this.parent.convertValueToPixel(v)<<0;l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,
|
|
axis:this.parent.options,crosshair:this.options,value:v}):x(this.options.label)?ea(v,this.valueFormatString,this.chart._cultureInfo):this.label}else"waterfall"===this.parent.dataSeries[q].type?(k=1===r.lineWidth%2?(this.parent.convertValueToPixel(n.dataSeries.dataPointEOs[n.index].cumulativeSum)<<0)+0.5:this.parent.convertValueToPixel(n.dataSeries.dataPointEOs[n.index].cumulativeSum)<<0,l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,
|
|
value:n.dataSeries.dataPointEOs[n.index].cumulativeSum}):x(this.options.label)?ea(n.dataSeries.dataPointEOs[n.index].cumulativeSum,this.valueFormatString,this.chart._cultureInfo):this.label):(k=1===r.lineWidth%2?(this.parent.convertValueToPixel(n.dataPoint.y)<<0)+0.5:this.parent.convertValueToPixel(n.dataPoint.y)<<0,l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.y}):x(this.options.label)?ea(n.dataPoint.y,this.valueFormatString,
|
|
this.chart._cultureInfo):this.label);d=g=k;b=this.chart.plotArea.x1;c=this.chart.plotArea.x2;this.bounds={x1:b,y1:d-h/2,x2:c,y2:g+h/2};l.y=g+l.fontSize/2-l.measureText().height/2+2;l.y-l.fontSize/2<this.chart.bounds.y1?l.y=this.chart.bounds.y1+l.fontSize/2+2:l.y+l.measureText().height-l.fontSize/2>this.chart.bounds.y2&&(l.y=this.chart.bounds.y2-l.measureText().height+l.fontSize/2);"left"===this.parent._position?l.x=this.parent.lineCoordinates.x2-l.measureText().width:"right"===this.parent._position&&
|
|
(l.x=this.parent.lineCoordinates.x2)}k=null;("bottom"===this.parent._position||"top"===this.parent._position)&&(b>=this.parent.convertValueToPixel(this.parent.viewportMinimum)&&c<=this.parent.convertValueToPixel(this.parent.viewportMaximum))&&(0<h&&(r.moveTo(b,d),r.lineTo(c,g),r.stroke()),r.restore(),!x(l.text)&&("number"===typeof l.text.valueOf()||0<l.text.length)&&l.render(!0));("left"===this.parent._position||"right"===this.parent._position)&&(g>=this.parent.convertValueToPixel(this.parent.viewportMaximum)&&
|
|
d<=this.parent.convertValueToPixel(this.parent.viewportMinimum))&&(0<h&&(r.moveTo(b,d),r.lineTo(c,g),r.stroke()),r.restore(),!x(l.text)&&("number"===typeof l.text.valueOf()||0<l.text.length)&&l.render(!0))}else{if("bottom"===this.parent._position||"top"===this.parent._position)b=c=k=1===r.lineWidth%2?(a<<0)+0.5:a<<0,d=this.chart.plotArea.y1,g=this.chart.plotArea.y2,this.bounds={x1:b-h/2,y1:d,x2:c+h/2,y2:g};else if("left"===this.parent._position||"right"===this.parent._position)d=g=k=1===r.lineWidth%
|
|
2?(f<<0)+0.5:f<<0,b=this.chart.plotArea.x1,c=this.chart.plotArea.x2,this.bounds={x1:b,y1:d-h/2,x2:c,y2:g+h/2};if("xySwapped"===this.chart.plotInfo.axisPlacement)if("left"===this.parent._position||"right"===this.parent._position){v=!1;if(this.parent.labels)for(k=Math.ceil(this.parent.interval),m=0;m<this.parent.viewportMaximum;m+=k)if(this.parent.labels[m])v=!0;else{v=!1;break}if(v){if("axisX"===this.parent.type)for(m=this.parent.convertPixelToValue({y:f}),e=null,q=0;q<this.parent.dataSeries.length;q++)(e=
|
|
this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(a)}):x(this.options.label)?e.dataPoint.label:this.label)}else!x(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&"dateTime"===this.parent.dataSeries[0].xValueType?l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(f)}):
|
|
x(this.options.label)?za(this.parent.convertPixelToValue(f),this.valueFormatString,this.chart._cultureInfo):this.label:!x(this.parent.dataSeries)&&(0<this.parent.dataSeries.length&&"number"===this.parent.dataSeries[0].xValueType)&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(f)}):x(this.options.label)?ea(this.parent.convertPixelToValue(f),this.valueFormatString,this.chart._cultureInfo):this.label);
|
|
l.y=f+l.fontSize/2-l.measureText().height/2+2;l.y-l.fontSize/2<this.chart.bounds.y1?l.y=this.chart.bounds.y1+l.fontSize/2+2:l.y+l.measureText().height-l.fontSize/2>this.chart.bounds.y2&&(l.y=this.chart.bounds.y2-l.measureText().height+l.fontSize/2);"left"===this.parent._position?l.x=this.parent.lineCoordinates.x1-l.measureText().width:"right"===this.parent._position&&(l.x=this.parent.lineCoordinates.x2)}else{if("bottom"===this.parent._position||"top"===this.parent._position)l.text=this.labelFormatter?
|
|
this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(a)}):x(this.options.label)?ea(this.parent.convertPixelToValue(a),this.valueFormatString,this.chart._cultureInfo):this.label,l.x=b-l.measureText().width/2,l.x+l.width>this.chart.bounds.x2&&(l.x=this.chart.bounds.x2-l.width),l.x<this.chart.bounds.x1&&(l.x=this.chart.bounds.x1),"bottom"===this.parent._position&&(l.y=this.parent.lineCoordinates.y2+l.fontSize/2+2),"top"===this.parent._position&&
|
|
(l.y=this.parent.lineCoordinates.y1-l.height+l.fontSize/2+2)}else if("bottom"===this.parent._position||"top"===this.parent._position){v=!1;n="";if(this.parent.labels)for(k=Math.ceil(this.parent.interval),m=0;m<this.parent.viewportMaximum;m+=k)if(this.parent.labels[m])v=!0;else{v=!1;break}if(v){if("axisX"===this.parent.type)for(m=this.parent.convertPixelToValue({x:a}),e=null,q=0;q<this.parent.dataSeries.length;q++)(e=this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(l.text=this.labelFormatter?
|
|
this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(a)}):x(this.options.label)?e.dataPoint.label:this.label)}else!x(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&"dateTime"===this.parent.dataSeries[0].xValueType?l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(a)}):x(this.options.label)?za(this.parent.convertPixelToValue(a),
|
|
this.valueFormatString,this.chart._cultureInfo):this.label:!x(this.parent.dataSeries)&&(0<this.parent.dataSeries.length&&"number"===this.parent.dataSeries[0].xValueType)&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:0<this.parent.dataSeries.length?this.parent.convertPixelToValue(a):""}):x(this.options.label)?ea(this.parent.convertPixelToValue(a),this.valueFormatString,this.chart._cultureInfo):this.label);l.x=b-l.measureText().width/
|
|
2;l.x+l.width>this.chart.bounds.x2&&(l.x=this.chart.bounds.x2-l.width);l.x<this.chart.bounds.x1&&(l.x=this.chart.bounds.x1);"bottom"===this.parent._position?l.y=this.parent.lineCoordinates.y2+l.fontSize/2+2:"top"===this.parent._position&&(l.y=this.parent.lineCoordinates.y1-l.height+l.fontSize/2+2)}else if("left"===this.parent._position||"right"===this.parent._position)l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(f)}):
|
|
x(this.options.label)?ea(this.parent.convertPixelToValue(f),this.valueFormatString,this.chart._cultureInfo):this.label,l.y=f+l.fontSize/2-l.measureText().height/2+2,l.y-l.fontSize/2<this.chart.bounds.y1?l.y=this.chart.bounds.y1+l.fontSize/2+2:l.y+l.measureText().height-l.fontSize/2>this.chart.bounds.y2&&(l.y=this.chart.bounds.y2-l.measureText().height+l.fontSize/2),"left"===this.parent._position?l.x=this.parent.lineCoordinates.x2-l.measureText().width:"right"===this.parent._position&&(l.x=this.parent.lineCoordinates.x2);
|
|
0<h&&(r.moveTo(b,d),r.lineTo(c,g),r.stroke());r.restore();!x(l.text)&&("number"===typeof l.text.valueOf()||0<l.text.length)&&l.render(!0)}r.globalAlpha=p};la(X,T);X.prototype._initialize=function(){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)";this.container.style.zIndex="1000";this.container.style.pointerEvents=
|
|
"none";this.container.style.display="none";var a;a='<div style=" width: auto;height: auto;min-width: 50px;';a+="line-height: auto;";a+="margin: 0px 0px 0px 0px;";a+="padding: 5px;";a+="font-family: Calibri, Arial, Georgia, serif;";a+="font-weight: normal;";a+="font-style: "+(w?"italic;":"normal;");a+="font-size: 14px;";a+="color: #000000;";a+="text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);";a+="text-align: left;";a+="border: 2px solid gray;";a+=w?"background: rgba(255,255,255,.9);":"background: rgb(255,255,255);";
|
|
a+="text-indent: 0px;";a+="white-space: nowrap;";a+="border-radius: 5px;";a+="-moz-user-select:none;";a+="-khtml-user-select: none;";a+="-webkit-user-select: none;";a+="-ms-user-select: none;";a+="user-select: none;";w||(a+="filter: alpha(opacity = 90);",a+="filter: progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=135, Color='#666666');");a+='} "> Sample Tooltip</div>';this.container.innerHTML=a;this.contentDiv=this.container.firstChild;this.container.style.borderRadius=this.contentDiv.style.borderRadius;
|
|
this.chart._canvasJSContainer.appendChild(this.container)}};X.prototype.mouseMoveHandler=function(a,f){this._lastUpdated&&4>(new Date).getTime()-this._lastUpdated||(this._lastUpdated=(new Date).getTime(),this.chart.resetOverlayedCanvas(),this._updateToolTip(a,f))};X.prototype._updateToolTip=function(a,f,b){b="undefined"===typeof b?!0:b;this.container||this._initialize();this.enabled||this.hide();if(!this.chart.disableToolTip){if("undefined"===typeof a||"undefined"===typeof f){if(isNaN(this._prevX)||
|
|
isNaN(this._prevY))return;a=this._prevX;f=this._prevY}else this._prevX=a,this._prevY=f;var c=null,d=null,g=[],k=0;if(this.shared&&this.enabled&&"none"!==this.chart.plotInfo.axisPlacement){if("xySwapped"===this.chart.plotInfo.axisPlacement){var l=[];if(this.chart.axisX)for(var n=0;n<this.chart.axisX.length;n++){for(var k=this.chart.axisX[n].convertPixelToValue({y:f}),h=null,c=0;c<this.chart.axisX[n].dataSeries.length;c++)(h=this.chart.axisX[n].dataSeries[c].getDataPointAtX(k,b))&&0<=h.index&&(h.dataSeries=
|
|
this.chart.axisX[n].dataSeries[c],null!==h.dataPoint.y&&l.push(h));h=null}if(this.chart.axisX2)for(n=0;n<this.chart.axisX2.length;n++){k=this.chart.axisX2[n].convertPixelToValue({y:f});h=null;for(c=0;c<this.chart.axisX2[n].dataSeries.length;c++)(h=this.chart.axisX2[n].dataSeries[c].getDataPointAtX(k,b))&&0<=h.index&&(h.dataSeries=this.chart.axisX2[n].dataSeries[c],null!==h.dataPoint.y&&l.push(h));h=null}}else{l=[];if(this.chart.axisX)for(n=0;n<this.chart.axisX.length;n++)for(k=this.chart.axisX[n].convertPixelToValue({x:a}),
|
|
h=null,c=0;c<this.chart.axisX[n].dataSeries.length;c++)(h=this.chart.axisX[n].dataSeries[c].getDataPointAtX(k,b))&&0<=h.index&&(h.dataSeries=this.chart.axisX[n].dataSeries[c],null!==h.dataPoint.y&&l.push(h));if(this.chart.axisX2)for(n=0;n<this.chart.axisX2.length;n++)for(k=this.chart.axisX2[n].convertPixelToValue({x:a}),h=null,c=0;c<this.chart.axisX2[n].dataSeries.length;c++)(h=this.chart.axisX2[n].dataSeries[c].getDataPointAtX(k,b))&&0<=h.index&&(h.dataSeries=this.chart.axisX2[n].dataSeries[c],null!==
|
|
h.dataPoint.y&&l.push(h))}if(0===l.length)return;l.sort(function(a,b){return a.distance-b.distance});b=l[0];for(c=0;c<l.length;c++)l[c].dataPoint.x.valueOf()===b.dataPoint.x.valueOf()&&g.push(l[c]);l=null}else{if(h=this.chart.getDataPointAtXY(a,f,b))this.currentDataPointIndex=h.dataPointIndex,this.currentSeriesIndex=h.dataSeries.index;else if(w)if(h=Ua(a,f,this.chart._eventManager.ghostCtx),0<h&&"undefined"!==typeof this.chart._eventManager.objectMap[h]){h=this.chart._eventManager.objectMap[h];if("legendItem"===
|
|
h.objectType)return;this.currentSeriesIndex=h.dataSeriesIndex;this.currentDataPointIndex=0<=h.dataPointIndex?h.dataPointIndex:-1}else this.currentDataPointIndex=-1;else this.currentDataPointIndex=-1;if(0<=this.currentSeriesIndex){d=this.chart.data[this.currentSeriesIndex];h={};if(0<=this.currentDataPointIndex)c=d.dataPoints[this.currentDataPointIndex],h.dataSeries=d,h.dataPoint=c,h.index=this.currentDataPointIndex,h.distance=Math.abs(c.x-k),"waterfall"===d.type&&(h.cumulativeSumYStartValue=d.dataPointEOs[this.currentDataPointIndex].cumulativeSumYStartValue,
|
|
h.cumulativeSum=d.dataPointEOs[this.currentDataPointIndex].cumulativeSum);else{if(!this.enabled||"line"!==d.type&&"stepLine"!==d.type&&"spline"!==d.type&&"area"!==d.type&&"stepArea"!==d.type&&"splineArea"!==d.type&&"stackedArea"!==d.type&&"stackedArea100"!==d.type&&"rangeArea"!==d.type&&"rangeSplineArea"!==d.type&&"candlestick"!==d.type&&"ohlc"!==d.type&&"boxAndWhisker"!==d.type)return;k=d.axisX.convertPixelToValue({x:a});h=d.getDataPointAtX(k,b);h.dataSeries=d;this.currentDataPointIndex=h.index;
|
|
c=h.dataPoint}if(!x(h.dataPoint.y))if(h.dataSeries.axisY)if(0<h.dataPoint.y.length){for(c=b=0;c<h.dataPoint.y.length;c++)h.dataPoint.y[c]<h.dataSeries.axisY.viewportMinimum?b--:h.dataPoint.y[c]>h.dataSeries.axisY.viewportMaximum&&b++;b<h.dataPoint.y.length&&b>-h.dataPoint.y.length&&g.push(h)}else"column"===d.type||"bar"===d.type?0>h.dataPoint.y?0>h.dataSeries.axisY.viewportMinimum&&h.dataSeries.axisY.viewportMaximum>=h.dataPoint.y&&g.push(h):h.dataSeries.axisY.viewportMinimum<=h.dataPoint.y&&0<=h.dataSeries.axisY.viewportMaximum&&
|
|
g.push(h):"bubble"===d.type?(b=this.chart._eventManager.objectMap[d.dataPointIds[h.index]].size/2,h.dataPoint.y>=h.dataSeries.axisY.viewportMinimum-b&&h.dataPoint.y<=h.dataSeries.axisY.viewportMaximum+b&&g.push(h)):"waterfall"===d.type?(b=0,h.cumulativeSumYStartValue<h.dataSeries.axisY.viewportMinimum?b--:h.cumulativeSumYStartValue>h.dataSeries.axisY.viewportMaximum&&b++,h.cumulativeSum<h.dataSeries.axisY.viewportMinimum?b--:h.cumulativeSum>h.dataSeries.axisY.viewportMaximum&&b++,2>b&&-2<b&&g.push(h)):
|
|
(0<=h.dataSeries.type.indexOf("100")||"stackedColumn"===d.type||"stackedBar"===d.type||h.dataPoint.y>=h.dataSeries.axisY.viewportMinimum&&h.dataPoint.y<=h.dataSeries.axisY.viewportMaximum)&&g.push(h);else g.push(h)}}if(0<g.length&&(this.highlightObjects(g),this.enabled))if(b="",b=this.getToolTipInnerHTML({entries:g}),null!==b){this.contentDiv.innerHTML=b;b=!1;"none"===this.container.style.display&&(b=!0,this.container.style.display="block");try{this.contentDiv.style.background=this.backgroundColor?
|
|
this.backgroundColor:w?"rgba(255,255,255,.9)":"rgb(255,255,255)",this.borderColor="waterfall"===g[0].dataSeries.type?this.contentDiv.style.borderRightColor=this.contentDiv.style.borderLeftColor=this.contentDiv.style.borderColor=this.options.borderColor?this.options.borderColor:g[0].dataPoint.color?g[0].dataPoint.color:-1<g[0].dataPoint.y?g[0].dataSeries.risingColor:g[0].dataSeries.fallingColor:"error"===g[0].dataSeries.type?this.contentDiv.style.borderRightColor=this.contentDiv.style.borderLeftColor=
|
|
this.contentDiv.style.borderColor=this.options.borderColor?this.options.borderColor:g[0].dataSeries.color?g[0].dataSeries.color:g[0].dataSeries._colorSet[d.index%g[0].dataSeries._colorSet.length]:this.contentDiv.style.borderRightColor=this.contentDiv.style.borderLeftColor=this.contentDiv.style.borderColor=this.options.borderColor?this.options.borderColor:g[0].dataPoint.color?g[0].dataPoint.color:g[0].dataSeries.color?g[0].dataSeries.color:g[0].dataSeries._colorSet[g[0].index%g[0].dataSeries._colorSet.length],
|
|
this.contentDiv.style.borderWidth=this.borderThickness||0===this.borderThickness?this.borderThickness+"px":"2px",this.contentDiv.style.borderRadius=this.cornerRadius||0===this.cornerRadius?this.cornerRadius+"px":"5px",this.container.style.borderRadius=this.contentDiv.style.borderRadius,this.contentDiv.style.fontSize=this.fontSize||0===this.fontSize?this.fontSize+"px":"14px",this.contentDiv.style.color=this.fontColor?this.fontColor:"#000000",this.contentDiv.style.fontFamily=this.fontFamily?this.fontFamily:
|
|
"Calibri, Arial, Georgia, serif;",this.contentDiv.style.fontWeight=this.fontWeight?this.fontWeight:"normal",this.contentDiv.style.fontStyle=this.fontStyle?this.fontStyle:w?"italic":"normal"}catch(q){}"pie"===g[0].dataSeries.type||"doughnut"===g[0].dataSeries.type||"funnel"===g[0].dataSeries.type||"pyramid"===g[0].dataSeries.type||"bar"===g[0].dataSeries.type||"rangeBar"===g[0].dataSeries.type||"stackedBar"===g[0].dataSeries.type||"stackedBar100"===g[0].dataSeries.type?a=a-10-this.container.clientWidth:
|
|
(a=g[0].dataSeries.axisX.convertValueToPixel(g[0].dataPoint.x)-this.container.clientWidth<<0,a-=10);0>a&&(a+=this.container.clientWidth+20);a+this.container.clientWidth>Math.max(this.chart.container.clientWidth,this.chart.width)&&(a=Math.max(0,Math.max(this.chart.container.clientWidth,this.chart.width)-this.container.clientWidth));f=1!==g.length||this.shared||"line"!==g[0].dataSeries.type&&"stepLine"!==g[0].dataSeries.type&&"spline"!==g[0].dataSeries.type&&"area"!==g[0].dataSeries.type&&"stepArea"!==
|
|
g[0].dataSeries.type&&"splineArea"!==g[0].dataSeries.type?"bar"===g[0].dataSeries.type||"rangeBar"===g[0].dataSeries.type||"stackedBar"===g[0].dataSeries.type||"stackedBar100"===g[0].dataSeries.type?g[0].dataSeries.axisX.convertValueToPixel(g[0].dataPoint.x):f:g[0].dataSeries.axisY.convertValueToPixel(g[0].dataPoint.y);f=-f+10;0<f+this.container.clientHeight+5&&(f-=f+this.container.clientHeight+5-0);this.fixMozTransitionDelay(a,f);!this.animationEnabled||b?this.disableAnimation():(this.enableAnimation(),
|
|
this.container.style.MozTransition=this.mozContainerTransition);this.container.style.left=a+"px";this.container.style.bottom=f+"px"}else this.hide(!1)}};X.prototype.highlightObjects=function(a){var f=this.chart.overlaidCanvasCtx;this.chart.resetOverlayedCanvas();f.clearRect(0,0,this.chart.width,this.chart.height);f.save();var b=this.chart.plotArea,c=0;f.beginPath();f.rect(b.x1,b.y1,b.x2-b.x1,b.y2-b.y1);f.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],g=c.dataPoints[d.dataPointIndex],k=d.dataPointIndex;!1===g.highlightEnabled||!0!==c.highlightEnabled&&!0!==g.highlightEnabled||("line"===c.type||"stepLine"===c.type||"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?(g=c.getMarkerProperties(k,d.x1,d.y1,this.chart.overlaidCanvasCtx),
|
|
g.size=Math.max(1.5*g.size<<0,10),g.borderColor=g.borderColor||"#FFFFFF",g.borderThickness=g.borderThickness||Math.ceil(0.1*g.size),aa.drawMarkers([g]),"undefined"!==typeof d.y2&&(g=c.getMarkerProperties(k,d.x1,d.y2,this.chart.overlaidCanvasCtx),g.size=Math.max(1.5*g.size<<0,10),g.borderColor=g.borderColor||"#FFFFFF",g.borderThickness=g.borderThickness||Math.ceil(0.1*g.size),aa.drawMarkers([g]))):"bubble"===c.type?(g=c.getMarkerProperties(k,d.x1,d.y1,this.chart.overlaidCanvasCtx),g.size=d.size,g.color=
|
|
"white",g.borderColor="white",f.globalAlpha=0.3,aa.drawMarkers([g]),f.globalAlpha=1):"column"===c.type||"stackedColumn"===c.type||"stackedColumn100"===c.type||"bar"===c.type||"rangeBar"===c.type||"stackedBar"===c.type||"stackedBar100"===c.type||"rangeColumn"===c.type||"waterfall"===c.type?Y(f,d.x1,d.y1,d.x2,d.y2,"white",0,null,!1,!1,!1,!1,0.3):"pie"===c.type||"doughnut"===c.type?qa(f,d.center,d.radius,"white",c.type,d.startAngle,d.endAngle,0.3,d.percentInnerRadius):"funnel"===c.type||"pyramid"===
|
|
c.type?wa(f,d.funnelSection,0.3,"white"):"candlestick"===c.type?(f.globalAlpha=1,f.strokeStyle=d.color,f.lineWidth=2*d.borderThickness,c=0===f.lineWidth%2?0:0.5,f.beginPath(),f.moveTo(d.x3-c,Math.min(d.y2,d.y3)),f.lineTo(d.x3-c,Math.min(d.y1,d.y4)),f.stroke(),f.beginPath(),f.moveTo(d.x3-c,Math.max(d.y1,d.y4)),f.lineTo(d.x3-c,Math.max(d.y2,d.y3)),f.stroke(),Y(f,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),f.globalAlpha=1):"ohlc"===c.type?
|
|
(f.globalAlpha=1,f.strokeStyle=d.color,f.lineWidth=2*d.borderThickness,c=0===f.lineWidth%2?0:0.5,f.beginPath(),f.moveTo(d.x3-c,d.y2),f.lineTo(d.x3-c,d.y3),f.stroke(),f.beginPath(),f.moveTo(d.x3,d.y1),f.lineTo(d.x1,d.y1),f.stroke(),f.beginPath(),f.moveTo(d.x3,d.y4),f.lineTo(d.x2,d.y4),f.stroke(),f.globalAlpha=1):"boxAndWhisker"===c.type?(f.save(),f.globalAlpha=1,f.strokeStyle=d.stemColor,f.lineWidth=2*d.stemThickness,0<d.stemThickness&&(f.beginPath(),f.moveTo(d.x3,d.y2+d.borderThickness/2),f.lineTo(d.x3,
|
|
d.y1+d.whiskerThickness/2),f.stroke(),f.beginPath(),f.moveTo(d.x3,d.y4-d.whiskerThickness/2),f.lineTo(d.x3,d.y3-d.borderThickness/2),f.stroke()),f.beginPath(),Y(f,d.x1-d.borderThickness/2,Math.max(d.y2+d.borderThickness/2,d.y3+d.borderThickness/2),d.x2+d.borderThickness/2,Math.min(d.y2-d.borderThickness/2,d.y3-d.borderThickness/2),"transparent",d.borderThickness,d.color,!1,!1,!1,!1),f.globalAlpha=1,f.strokeStyle=d.whiskerColor,f.lineWidth=2*d.whiskerThickness,0<d.whiskerThickness&&(f.beginPath(),
|
|
f.moveTo(Math.floor(d.x3-d.whiskerLength/2),d.y4),f.lineTo(Math.ceil(d.x3+d.whiskerLength/2),d.y4),f.stroke(),f.beginPath(),f.moveTo(Math.floor(d.x3-d.whiskerLength/2),d.y1),f.lineTo(Math.ceil(d.x3+d.whiskerLength/2),d.y1),f.stroke()),f.globalAlpha=1,f.strokeStyle=d.lineColor,f.lineWidth=2*d.lineThickness,0<d.lineThickness&&(f.beginPath(),f.moveTo(d.x1,d.y5),f.lineTo(d.x2,d.y5),f.stroke()),f.restore(),f.globalAlpha=1):"error"===c.type&&z(f,d.x1,d.y1,d.x2,d.y2,"white",d.whiskerProperties,d.stemProperties,
|
|
d.isXYSwapped,0.3))}}f.restore();f.globalAlpha=1;f.beginPath()};X.prototype.getToolTipInnerHTML=function(a){a=a.entries;for(var f=null,b=null,c=null,d=0,g="",k=!0,l=0;l<a.length;l++)if(a[l].dataSeries.toolTipContent||a[l].dataPoint.toolTipContent){k=!1;break}if(k&&(this.content&&"function"===typeof this.content||this.contentFormatter))a={chart:this.chart,toolTip:this.options,entries:a},f=this.contentFormatter?this.contentFormatter(a):this.content(a);else if(this.shared&&"none"!==this.chart.plotInfo.axisPlacement){for(var n=
|
|
null,h="",l=0;l<a.length;l++)b=a[l].dataSeries,c=a[l].dataPoint,d=a[l].index,g="",0===l&&(k&&!this.content)&&(this.chart.axisX&&0<this.chart.axisX.length?h+="undefined"!==typeof this.chart.axisX[0].labels[c.x]?this.chart.axisX[0].labels[c.x]:"{x}":this.chart.axisX2&&0<this.chart.axisX2.length&&(h+="undefined"!==typeof this.chart.axisX2[0].labels[c.x]?this.chart.axisX2[0].labels[c.x]:"{x}"),h+="</br>",h=this.chart.replaceKeywordsWithValue(h,c,b,d)),null===c.toolTipContent||"undefined"===typeof c.toolTipContent&&
|
|
null===b.options.toolTipContent||("line"===b.type||"stepLine"===b.type||"spline"===b.type||"area"===b.type||"stepArea"===b.type||"splineArea"===b.type||"column"===b.type||"bar"===b.type||"scatter"===b.type||"stackedColumn"===b.type||"stackedColumn100"===b.type||"stackedBar"===b.type||"stackedBar100"===b.type||"stackedArea"===b.type||"stackedArea100"===b.type||"waterfall"===b.type?(this.chart.axisX&&1<this.chart.axisX.length&&(g+=n!=b.axisXIndex?b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>":
|
|
""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>{name}:</span> {y}",n=b.axisXIndex):"bubble"===b.type?(this.chart.axisX&&1<this.chart.axisX.length&&(g+=n!=b.axisXIndex?b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?
|
|
this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>{name}:</span> {y}, {z}"):"rangeColumn"===b.type||"rangeBar"===b.type||"rangeArea"===b.type||"rangeSplineArea"===b.type||"error"===b.type?(this.chart.axisX&&1<this.chart.axisX.length&&(g+=n!=b.axisXIndex?b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:
|
|
"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>{name}:</span> {y[0]}, {y[1]}"):"candlestick"===b.type||"ohlc"===b.type?(this.chart.axisX&&1<this.chart.axisX.length&&(g+=n!=b.axisXIndex?b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>{name}:</span><br/>Open: {y[0]}<br/>High: {y[1]}<br/>Low: {y[2]}<br/>Close: {y[3]}"):
|
|
"boxAndWhisker"===b.type&&(this.chart.axisX&&1<this.chart.axisX.length&&(g+=n!=b.axisXIndex?b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>{name}:</span><br/>Minimum: {y[0]}<br/>Q1: {y[1]}<br/>Q2: {y[4]}<br/>Q3: {y[2]}<br/>Maximum: {y[3]}"),
|
|
null===f&&(f=""),!0===this.reversed?(f=this.chart.replaceKeywordsWithValue(g,c,b,d)+f,l<a.length-1&&(f="</br>"+f)):(f+=this.chart.replaceKeywordsWithValue(g,c,b,d),l<a.length-1&&(f+="</br>")));null!==f&&(f=h+f)}else{b=a[0].dataSeries;c=a[0].dataPoint;d=a[0].index;if(null===c.toolTipContent||"undefined"===typeof c.toolTipContent&&null===b.options.toolTipContent)return null;"line"===b.type||"stepLine"===b.type||"spline"===b.type||"area"===b.type||"stepArea"===b.type||"splineArea"===b.type||"column"===
|
|
b.type||"bar"===b.type||"scatter"===b.type||"stackedColumn"===b.type||"stackedColumn100"===b.type||"stackedBar"===b.type||"stackedBar100"===b.type||"stackedArea"===b.type||"stackedArea100"===b.type||"waterfall"===b.type?g=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(c.label?"{label}":"{x}")+":</span> {y}":"bubble"===b.type?g=c.toolTipContent?
|
|
c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(c.label?"{label}":"{x}")+":</span> {y}, {z}":"pie"===b.type||"doughnut"===b.type||"funnel"===b.type||"pyramid"===b.type?g=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":
|
|
"'color:{color};'")+"\"'>"+(c.name?"{name}:</span> ":c.label?"{label}:</span> ":"</span>")+"{y}":"rangeColumn"===b.type||"rangeBar"===b.type||"rangeArea"===b.type||"rangeSplineArea"===b.type||"error"===b.type?g=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(c.label?"{label}":"{x}")+" :</span> {y[0]}, {y[1]}":
|
|
"candlestick"===b.type||"ohlc"===b.type?g=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(c.label?"{label}":"{x}")+"</span><br/>Open: {y[0]}<br/>High: {y[1]}<br/>Low: {y[2]}<br/>Close: {y[3]}":"boxAndWhisker"===b.type&&(g=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:
|
|
this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(c.label?"{label}":"{x}")+"</span><br/>Minimum: {y[0]}<br/>Q1: {y[1]}<br/>Q2: {y[4]}<br/>Q3: {y[2]}<br/>Maximum: {y[3]}");
|
|
null===f&&(f="");f+=this.chart.replaceKeywordsWithValue(g,c,b,d)}return f};X.prototype.enableAnimation=function(){if(!this.container.style.WebkitTransition){var a=this.getContainerTransition(this.containerTransitionDuration);this.container.style.WebkitTransition=a;this.container.style.MsTransition=a;this.container.style.transition=a;this.container.style.MozTransition=this.mozContainerTransition}};X.prototype.disableAnimation=function(){this.container.style.WebkitTransition&&(this.container.style.WebkitTransition=
|
|
"",this.container.style.MozTransition="",this.container.style.MsTransition="",this.container.style.transition="")};X.prototype.hide=function(a){this.container&&(this.container.style.display="none",this.currentSeriesIndex=-1,this._prevY=this._prevX=NaN,("undefined"===typeof a||a)&&this.chart.resetOverlayedCanvas())};X.prototype.show=function(a,f,b){this._updateToolTip(a,f,"undefined"===typeof b?!1:b)};X.prototype.fixMozTransitionDelay=function(a,f){if(20<this.chart._eventManager.lastObjectId)this.mozContainerTransition=
|
|
this.getContainerTransition(0);else{var b=parseFloat(this.container.style.left),b=isNaN(b)?0:b,c=parseFloat(this.container.style.bottom),c=isNaN(c)?0:c;10<Math.sqrt(Math.pow(b-a,2)+Math.pow(c-f,2))?this.mozContainerTransition=this.getContainerTransition(0.1):this.mozContainerTransition=this.getContainerTransition(0)}};X.prototype.getContainerTransition=function(a){return"left "+a+"s ease-out 0s, bottom "+a+"s ease-out 0s"};ga.prototype.reset=function(){this.lastObjectId=0;this.objectMap=[];this.rectangularRegionEventSubscriptions=
|
|
[];this.previousDataPointEventObject=null;this.eventObjects=[];w&&(this.ghostCtx.clearRect(0,0,this.chart.width,this.chart.height),this.ghostCtx.beginPath())};ga.prototype.getNewObjectTrackingId=function(){return++this.lastObjectId};ga.prototype.mouseEventHandler=function(a){if("mousemove"===a.type||"click"===a.type){var f=[],b=Ma(a),c=null;if((c=this.chart.getObjectAtXY(b.x,b.y,!1))&&"undefined"!==typeof this.objectMap[c])if(c=this.objectMap[c],"dataPoint"===c.objectType){var d=this.chart.data[c.dataSeriesIndex],
|
|
g=d.dataPoints[c.dataPointIndex],k=c.dataPointIndex;c.eventParameter={x:b.x,y:b.y,dataPoint:g,dataSeries:d.options,dataPointIndex:k,dataSeriesIndex:d.index,chart:this.chart};c.eventContext={context:g,userContext:g,mouseover:"mouseover",mousemove:"mousemove",mouseout:"mouseout",click:"click"};f.push(c);c=this.objectMap[d.id];c.eventParameter={x:b.x,y:b.y,dataPoint:g,dataSeries:d.options,dataPointIndex:k,dataSeriesIndex:d.index,chart:this.chart};c.eventContext={context:d,userContext:d.options,mouseover:"mouseover",
|
|
mousemove:"mousemove",mouseout:"mouseout",click:"click"};f.push(this.objectMap[d.id])}else"legendItem"===c.objectType&&(d=this.chart.data[c.dataSeriesIndex],g=null!==c.dataPointIndex?d.dataPoints[c.dataPointIndex]:null,c.eventParameter={x:b.x,y:b.y,dataSeries:d.options,dataPoint:g,dataPointIndex:c.dataPointIndex,dataSeriesIndex:c.dataSeriesIndex,chart:this.chart},c.eventContext={context:this.chart.legend,userContext:this.chart.legend.options,mouseover:"itemmouseover",mousemove:"itemmousemove",mouseout:"itemmouseout",
|
|
click:"itemclick"},f.push(c));d=[];for(b=0;b<this.mouseoveredObjectMaps.length;b++){g=!0;for(c=0;c<f.length;c++)if(f[c].id===this.mouseoveredObjectMaps[b].id){g=!1;break}g?this.fireEvent(this.mouseoveredObjectMaps[b],"mouseout",a):d.push(this.mouseoveredObjectMaps[b])}this.mouseoveredObjectMaps=d;for(b=0;b<f.length;b++){d=!1;for(c=0;c<this.mouseoveredObjectMaps.length;c++)if(f[b].id===this.mouseoveredObjectMaps[c].id){d=!0;break}d||(this.fireEvent(f[b],"mouseover",a),this.mouseoveredObjectMaps.push(f[b]));
|
|
"click"===a.type?this.fireEvent(f[b],"click",a):"mousemove"===a.type&&this.fireEvent(f[b],"mousemove",a)}}};ga.prototype.fireEvent=function(a,f,b){if(a&&f){var c=a.eventParameter,d=a.eventContext,g=a.eventContext.userContext;g&&(d&&g[d[f]])&&g[d[f]].call(g,c);"mouseout"!==f?g.cursor&&g.cursor!==b.target.style.cursor&&(b.target.style.cursor=g.cursor):(b.target.style.cursor=this.chart._defaultCursor,delete a.eventParameter,delete a.eventContext);"click"===f&&("dataPoint"===a.objectType&&this.chart.pieDoughnutClickHandler)&&
|
|
this.chart.pieDoughnutClickHandler.call(this.chart.data[a.dataSeriesIndex],c);"click"===f&&("dataPoint"===a.objectType&&this.chart.funnelPyramidClickHandler)&&this.chart.funnelPyramidClickHandler.call(this.chart.data[a.dataSeriesIndex],c)}};pa.prototype.animate=function(a,f,b,c,d){var g=this;this.chart.isAnimating=!0;d=d||Q.easing.linear;b&&this.animations.push({startTime:(new Date).getTime()+(a?a:0),duration:f,animationCallback:b,onComplete:c});for(a=[];0<this.animations.length;)if(f=this.animations.shift(),
|
|
b=(new Date).getTime(),c=0,f.startTime<=b&&(c=d(Math.min(b-f.startTime,f.duration),0,1,f.duration),c=Math.min(c,1),isNaN(c)||!isFinite(c))&&(c=1),1>c&&a.push(f),f.animationCallback(c),1<=c&&f.onComplete)f.onComplete();this.animations=a;0<this.animations.length?this.animationRequestId=this.chart.requestAnimFrame.call(window,function(){g.animate.call(g)}):this.chart.isAnimating=!1};pa.prototype.cancelAllAnimations=function(){this.animations=[];this.animationRequestId&&this.chart.cancelRequestAnimFrame.call(window,
|
|
this.animationRequestId);this.animationRequestId=null;this.chart.isAnimating=!1};var Q={yScaleAnimation:function(a,f){if(0!==a){var b=f.dest,c=f.source.canvas,d=f.animationBase;b.drawImage(c,0,0,c.width,c.height,0,d-d*a,b.canvas.width/ia,a*b.canvas.height/ia)}},xScaleAnimation:function(a,f){if(0!==a){var b=f.dest,c=f.source.canvas,d=f.animationBase;b.drawImage(c,0,0,c.width,c.height,d-d*a,0,a*b.canvas.width/ia,b.canvas.height/ia)}},xClipAnimation:function(a,f){if(0!==a){var b=f.dest,c=f.source.canvas;
|
|
b.save();0<a&&b.drawImage(c,0,0,c.width*a,c.height,0,0,c.width*a/ia,c.height/ia);b.restore()}},fadeInAnimation:function(a,f){if(0!==a){var b=f.dest,c=f.source.canvas;b.save();b.globalAlpha=a;b.drawImage(c,0,0,c.width,c.height,0,0,b.canvas.width/ia,b.canvas.height/ia);b.restore()}},easing:{linear:function(a,f,b,c){return b*a/c+f},easeOutQuad:function(a,f,b,c){return-b*(a/=c)*(a-2)+f},easeOutQuart:function(a,f,b,c){return-b*((a=a/c-1)*a*a*a-1)+f},easeInQuad:function(a,f,b,c){return b*(a/=c)*a+f},easeInQuart:function(a,
|
|
f,b,c){return b*(a/=c)*a*a*a+f}}},aa={drawMarker:function(a,f,b,c,d,g,k,l){if(b){var n=1;b.fillStyle=g?g:"#000000";b.strokeStyle=k?k:"#000000";b.lineWidth=l?l:0;"circle"===c?(b.moveTo(a,f),b.beginPath(),b.arc(a,f,d/2,0,2*Math.PI,!1),g&&b.fill(),l&&(k?b.stroke():(n=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=n))):"square"===c?(b.beginPath(),b.rect(a-d/2,f-d/2,d,d),g&&b.fill(),l&&(k?b.stroke():(n=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=
|
|
n))):"triangle"===c?(b.beginPath(),b.moveTo(a-d/2,f+d/2),b.lineTo(a+d/2,f+d/2),b.lineTo(a,f-d/2),b.closePath(),g&&b.fill(),l&&(k?b.stroke():(n=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=n)),b.beginPath()):"cross"===c&&(b.strokeStyle=g,b.lineWidth=d/4,b.beginPath(),b.moveTo(a-d/2,f-d/2),b.lineTo(a+d/2,f+d/2),b.stroke(),b.moveTo(a+d/2,f-d/2),b.lineTo(a-d/2,f+d/2),b.stroke())}},drawMarkers:function(a){for(var f=0;f<a.length;f++){var b=a[f];aa.drawMarker(b.x,b.y,b.ctx,
|
|
b.type,b.size,b.color,b.borderColor,b.borderThickness)}}};return u}();y.Chart.version="v2.0 Beta 2"})();
|
|
|
|
/*
|
|
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.
|
|
|
|
Copyright 2006 Google Inc. https://code.google.com/p/explorercanvas/
|
|
Licensed under the Apache License, Version 2.0
|
|
*/
|
|
document.createElement("canvas").getContext||function(){function V(){return this.context_||(this.context_=new C(this))}function W(a,b,c){var g=M.call(arguments,2);return function(){return a.apply(b,g.concat(M.call(arguments)))}}function N(a){return String(a).replace(/&/g,"&").replace(/"/g,""")}function O(a){a.namespaces.g_vml_||a.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");a.namespaces.g_o_||a.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");
|
|
a.styleSheets.ex_canvas_||(a=a.createStyleSheet(),a.owningElement.id="ex_canvas_",a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}")}function X(a){var b=a.srcElement;switch(a.propertyName){case "width":b.getContext().clearRect();b.style.width=b.attributes.width.nodeValue+"px";b.firstChild.style.width=b.clientWidth+"px";break;case "height":b.getContext().clearRect(),b.style.height=b.attributes.height.nodeValue+"px",b.firstChild.style.height=b.clientHeight+
|
|
"px"}}function Y(a){a=a.srcElement;a.firstChild&&(a.firstChild.style.width=a.clientWidth+"px",a.firstChild.style.height=a.clientHeight+"px")}function D(){return[[1,0,0],[0,1,0],[0,0,1]]}function t(a,b){for(var c=D(),g=0;3>g;g++)for(var e=0;3>e;e++){for(var f=0,d=0;3>d;d++)f+=a[g][d]*b[d][e];c[g][e]=f}return c}function P(a,b){b.fillStyle=a.fillStyle;b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.lineWidth=a.lineWidth;b.miterLimit=a.miterLimit;b.shadowBlur=a.shadowBlur;b.shadowColor=a.shadowColor;b.shadowOffsetX=
|
|
a.shadowOffsetX;b.shadowOffsetY=a.shadowOffsetY;b.strokeStyle=a.strokeStyle;b.globalAlpha=a.globalAlpha;b.font=a.font;b.textAlign=a.textAlign;b.textBaseline=a.textBaseline;b.arcScaleX_=a.arcScaleX_;b.arcScaleY_=a.arcScaleY_;b.lineScale_=a.lineScale_}function Q(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1),b=a.substring(b+1,c).split(",");if(4!=b.length||"a"!=a.charAt(3))b[3]=1;return b}function E(a,b,c){return Math.min(c,Math.max(b,a))}function F(a,b,c){0>c&&c++;1<c&&c--;return 1>6*c?a+6*(b-a)*c:
|
|
1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}function G(a){if(a in H)return H[a];var b,c=1;a=String(a);if("#"==a.charAt(0))b=a;else if(/^rgb/.test(a)){c=Q(a);b="#";for(var g,e=0;3>e;e++)g=-1!=c[e].indexOf("%")?Math.floor(255*(parseFloat(c[e])/100)):+c[e],b+=v[E(g,0,255)];c=+c[3]}else if(/^hsl/.test(a)){e=c=Q(a);b=parseFloat(e[0])/360%360;0>b&&b++;g=E(parseFloat(e[1])/100,0,1);e=E(parseFloat(e[2])/100,0,1);if(0==g)g=e=b=e;else{var f=0.5>e?e*(1+g):e+g-e*g,d=2*e-f;g=F(d,f,b+1/3);e=F(d,f,b);b=F(d,f,b-1/3)}b="#"+
|
|
v[Math.floor(255*g)]+v[Math.floor(255*e)]+v[Math.floor(255*b)];c=c[3]}else b=Z[a]||a;return H[a]={color:b,alpha:c}}function C(a){this.m_=D();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=1*q;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute",
|
|
c=a.ownerDocument.createElement("div");c.style.cssText=b;a.appendChild(c);b=c.cloneNode(!1);b.style.backgroundColor="red";b.style.filter="alpha(opacity=0)";a.appendChild(b);this.element_=c;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function R(a,b,c,g){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,cp1y:b.y,cp2x:c.x,cp2y:c.y,x:g.x,y:g.y});a.currentX_=g.x;a.currentY_=g.y}function S(a,b){var c=G(a.strokeStyle),g=c.color,c=c.alpha*a.globalAlpha,e=a.lineScale_*a.lineWidth;1>e&&(c*=e);b.push("<g_vml_:stroke",
|
|
' opacity="',c,'"',' joinstyle="',a.lineJoin,'"',' miterlimit="',a.miterLimit,'"',' endcap="',$[a.lineCap]||"square",'"',' weight="',e,'px"',' color="',g,'" />')}function T(a,b,c,g){var e=a.fillStyle,f=a.arcScaleX_,d=a.arcScaleY_,k=g.x-c.x,n=g.y-c.y;if(e instanceof w){var h=0,l=g=0,u=0,m=1;if("gradient"==e.type_){h=e.x1_/f;c=e.y1_/d;var p=s(a,e.x0_/f,e.y0_/d),h=s(a,h,c),h=180*Math.atan2(h.x-p.x,h.y-p.y)/Math.PI;0>h&&(h+=360);1E-6>h&&(h=0)}else p=s(a,e.x0_,e.y0_),g=(p.x-c.x)/k,l=(p.y-c.y)/n,k/=f*q,
|
|
n/=d*q,m=x.max(k,n),u=2*e.r0_/m,m=2*e.r1_/m-u;f=e.colors_;f.sort(function(a,b){return a.offset-b.offset});d=f.length;p=f[0].color;c=f[d-1].color;k=f[0].alpha*a.globalAlpha;a=f[d-1].alpha*a.globalAlpha;for(var n=[],r=0;r<d;r++){var t=f[r];n.push(t.offset*m+u+" "+t.color)}b.push('<g_vml_:fill type="',e.type_,'"',' method="none" focus="100%"',' color="',p,'"',' color2="',c,'"',' colors="',n.join(","),'"',' opacity="',a,'"',' g_o_:opacity2="',k,'"',' angle="',h,'"',' focusposition="',g,",",l,'" />')}else e instanceof
|
|
I?k&&n&&b.push("<g_vml_:fill",' position="',-c.x/k*f*f,",",-c.y/n*d*d,'"',' type="tile"',' src="',e.src_,'" />'):(e=G(a.fillStyle),b.push('<g_vml_:fill color="',e.color,'" opacity="',e.alpha*a.globalAlpha,'" />'))}function s(a,b,c){a=a.m_;return{x:q*(b*a[0][0]+c*a[1][0]+a[2][0])-r,y:q*(b*a[0][1]+c*a[1][1]+a[2][1])-r}}function z(a,b,c){isFinite(b[0][0])&&(isFinite(b[0][1])&&isFinite(b[1][0])&&isFinite(b[1][1])&&isFinite(b[2][0])&&isFinite(b[2][1]))&&(a.m_=b,c&&(a.lineScale_=aa(ba(b[0][0]*b[1][1]-b[0][1]*
|
|
b[1][0]))))}function w(a){this.type_=a;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}function I(a,b){if(!a||1!=a.nodeType||"IMG"!=a.tagName)throw new A("TYPE_MISMATCH_ERR");if("complete"!=a.readyState)throw new A("INVALID_STATE_ERR");switch(b){case "repeat":case null:case "":this.repetition_="repeat";break;case "repeat-x":case "repeat-y":case "no-repeat":this.repetition_=b;break;default:throw new A("SYNTAX_ERR");}this.src_=a.src;this.width_=a.width;this.height_=a.height}
|
|
function A(a){this.code=this[a];this.message=a+": DOM Exception "+this.code}var x=Math,k=x.round,J=x.sin,K=x.cos,ba=x.abs,aa=x.sqrt,q=10,r=q/2;navigator.userAgent.match(/MSIE ([\d.]+)?/);var M=Array.prototype.slice;O(document);var U={init:function(a){a=a||document;a.createElement("canvas");a.attachEvent("onreadystatechange",W(this.init_,this,a))},init_:function(a){a=a.getElementsByTagName("canvas");for(var b=0;b<a.length;b++)this.initElement(a[b])},initElement:function(a){if(!a.getContext){a.getContext=
|
|
V;O(a.ownerDocument);a.innerHTML="";a.attachEvent("onpropertychange",X);a.attachEvent("onresize",Y);var b=a.attributes;b.width&&b.width.specified?a.style.width=b.width.nodeValue+"px":a.width=a.clientWidth;b.height&&b.height.specified?a.style.height=b.height.nodeValue+"px":a.height=a.clientHeight}return a}};U.init();for(var v=[],d=0;16>d;d++)for(var B=0;16>B;B++)v[16*d+B]=d.toString(16)+B.toString(16);var Z={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",
|
|
bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",
|
|
darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",
|
|
ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",
|
|
mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",
|
|
peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"},
|
|
H={},L={},$={butt:"flat",round:"round"},d=C.prototype;d.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null);this.element_.innerHTML=""};d.beginPath=function(){this.currentPath_=[]};d.moveTo=function(a,b){var c=s(this,a,b);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.lineTo=function(a,b){var c=s(this,a,b);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.bezierCurveTo=
|
|
function(a,b,c,g,e,f){e=s(this,e,f);a=s(this,a,b);c=s(this,c,g);R(this,a,c,e)};d.quadraticCurveTo=function(a,b,c,g){a=s(this,a,b);c=s(this,c,g);g={x:this.currentX_+2/3*(a.x-this.currentX_),y:this.currentY_+2/3*(a.y-this.currentY_)};R(this,g,{x:g.x+(c.x-this.currentX_)/3,y:g.y+(c.y-this.currentY_)/3},c)};d.arc=function(a,b,c,g,e,f){c*=q;var d=f?"at":"wa",k=a+K(g)*c-r,n=b+J(g)*c-r;g=a+K(e)*c-r;e=b+J(e)*c-r;k!=g||f||(k+=0.125);a=s(this,a,b);k=s(this,k,n);g=s(this,g,e);this.currentPath_.push({type:d,
|
|
x:a.x,y:a.y,radius:c,xStart:k.x,yStart:k.y,xEnd:g.x,yEnd:g.y})};d.rect=function(a,b,c,g){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath()};d.strokeRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath();this.stroke();this.currentPath_=e};d.fillRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+
|
|
c,b+g);this.lineTo(a,b+g);this.closePath();this.fill();this.currentPath_=e};d.createLinearGradient=function(a,b,c,g){var e=new w("gradient");e.x0_=a;e.y0_=b;e.x1_=c;e.y1_=g;return e};d.createRadialGradient=function(a,b,c,g,e,f){var d=new w("gradientradial");d.x0_=a;d.y0_=b;d.r0_=c;d.x1_=g;d.y1_=e;d.r1_=f;return d};d.drawImage=function(a,b){var c,g,e,d,r,y,n,h;e=a.runtimeStyle.width;d=a.runtimeStyle.height;a.runtimeStyle.width="auto";a.runtimeStyle.height="auto";var l=a.width,u=a.height;a.runtimeStyle.width=
|
|
e;a.runtimeStyle.height=d;if(3==arguments.length)c=arguments[1],g=arguments[2],r=y=0,n=e=l,h=d=u;else if(5==arguments.length)c=arguments[1],g=arguments[2],e=arguments[3],d=arguments[4],r=y=0,n=l,h=u;else if(9==arguments.length)r=arguments[1],y=arguments[2],n=arguments[3],h=arguments[4],c=arguments[5],g=arguments[6],e=arguments[7],d=arguments[8];else throw Error("Invalid number of arguments");var m=s(this,c,g),p=[];p.push(" <g_vml_:group",' coordsize="',10*q,",",10*q,'"',' coordorigin="0,0"',' style="width:',
|
|
10,"px;height:",10,"px;position:absolute;");if(1!=this.m_[0][0]||this.m_[0][1]||1!=this.m_[1][1]||this.m_[1][0]){var t=[];t.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",k(m.x/q),",","Dy=",k(m.y/q),"");var v=s(this,c+e,g),w=s(this,c,g+d);c=s(this,c+e,g+d);m.x=x.max(m.x,v.x,w.x,c.x);m.y=x.max(m.y,v.y,w.y,c.y);p.push("padding:0 ",k(m.x/q),"px ",k(m.y/q),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",t.join(""),", sizingmethod='clip');")}else p.push("top:",
|
|
k(m.y/q),"px;left:",k(m.x/q),"px;");p.push(' ">','<g_vml_:image src="',a.src,'"',' style="width:',q*e,"px;"," height:",q*d,'px"',' cropleft="',r/l,'"',' croptop="',y/u,'"',' cropright="',(l-r-n)/l,'"',' cropbottom="',(u-y-h)/u,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",p.join(""))};d.stroke=function(a){var b=[];b.push("<g_vml_:shape",' filled="',!!a,'"',' style="position:absolute;width:',10,"px;height:",10,'px;"',' coordorigin="0,0"',' coordsize="',10*q,",",10*q,'"',
|
|
' stroked="',!a,'"',' path="');for(var c={x:null,y:null},d={x:null,y:null},e=0;e<this.currentPath_.length;e++){var f=this.currentPath_[e];switch(f.type){case "moveTo":b.push(" m ",k(f.x),",",k(f.y));break;case "lineTo":b.push(" l ",k(f.x),",",k(f.y));break;case "close":b.push(" x ");f=null;break;case "bezierCurveTo":b.push(" c ",k(f.cp1x),",",k(f.cp1y),",",k(f.cp2x),",",k(f.cp2y),",",k(f.x),",",k(f.y));break;case "at":case "wa":b.push(" ",f.type," ",k(f.x-this.arcScaleX_*f.radius),",",k(f.y-this.arcScaleY_*
|
|
f.radius)," ",k(f.x+this.arcScaleX_*f.radius),",",k(f.y+this.arcScaleY_*f.radius)," ",k(f.xStart),",",k(f.yStart)," ",k(f.xEnd),",",k(f.yEnd))}if(f){if(null==c.x||f.x<c.x)c.x=f.x;if(null==d.x||f.x>d.x)d.x=f.x;if(null==c.y||f.y<c.y)c.y=f.y;if(null==d.y||f.y>d.y)d.y=f.y}}b.push(' ">');a?T(this,b,c,d):S(this,b);b.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",b.join(""))};d.fill=function(){this.stroke(!0)};d.closePath=function(){this.currentPath_.push({type:"close"})};d.save=function(){var a=
|
|
{};P(this,a);this.aStack_.push(a);this.mStack_.push(this.m_);this.m_=t(D(),this.m_)};d.restore=function(){this.aStack_.length&&(P(this.aStack_.pop(),this),this.m_=this.mStack_.pop())};d.translate=function(a,b){z(this,t([[1,0,0],[0,1,0],[a,b,1]],this.m_),!1)};d.rotate=function(a){var b=K(a);a=J(a);z(this,t([[b,a,0],[-a,b,0],[0,0,1]],this.m_),!1)};d.scale=function(a,b){this.arcScaleX_*=a;this.arcScaleY_*=b;z(this,t([[a,0,0],[0,b,0],[0,0,1]],this.m_),!0)};d.transform=function(a,b,c,d,e,f){z(this,t([[a,
|
|
b,0],[c,d,0],[e,f,1]],this.m_),!0)};d.setTransform=function(a,b,c,d,e,f){z(this,[[a,b,0],[c,d,0],[e,f,1]],!0)};d.drawText_=function(a,b,c,d,e){var f=this.m_;d=0;var r=1E3,t=0,n=[],h;h=this.font;if(L[h])h=L[h];else{var l=document.createElement("div").style;try{l.font=h}catch(u){}h=L[h]={style:l.fontStyle||"normal",variant:l.fontVariant||"normal",weight:l.fontWeight||"normal",size:l.fontSize||10,family:l.fontFamily||"sans-serif"}}var l=h,m=this.element_;h={};for(var p in l)h[p]=l[p];p=parseFloat(m.currentStyle.fontSize);
|
|
m=parseFloat(l.size);"number"==typeof l.size?h.size=l.size:-1!=l.size.indexOf("px")?h.size=m:-1!=l.size.indexOf("em")?h.size=p*m:-1!=l.size.indexOf("%")?h.size=p/100*m:-1!=l.size.indexOf("pt")?h.size=m/0.75:h.size=p;h.size*=0.981;p=h.style+" "+h.variant+" "+h.weight+" "+h.size+"px "+h.family;m=this.element_.currentStyle;l=this.textAlign.toLowerCase();switch(l){case "left":case "center":case "right":break;case "end":l="ltr"==m.direction?"right":"left";break;case "start":l="rtl"==m.direction?"right":
|
|
"left";break;default:l="left"}switch(this.textBaseline){case "hanging":case "top":t=h.size/1.75;break;case "middle":break;default:case null:case "alphabetic":case "ideographic":case "bottom":t=-h.size/2.25}switch(l){case "right":d=1E3;r=0.05;break;case "center":d=r=500}b=s(this,b+0,c+t);n.push('<g_vml_:line from="',-d,' 0" to="',r,' 0.05" ',' coordsize="100 100" coordorigin="0 0"',' filled="',!e,'" stroked="',!!e,'" style="position:absolute;width:1px;height:1px;">');e?S(this,n):T(this,n,{x:-d,y:0},
|
|
{x:r,y:h.size});e=f[0][0].toFixed(3)+","+f[1][0].toFixed(3)+","+f[0][1].toFixed(3)+","+f[1][1].toFixed(3)+",0,0";b=k(b.x/q)+","+k(b.y/q);n.push('<g_vml_:skew on="t" matrix="',e,'" ',' offset="',b,'" origin="',d,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath on="true" string="',N(a),'" style="v-text-align:',l,";font:",N(p),'" /></g_vml_:line>');this.element_.insertAdjacentHTML("beforeEnd",n.join(""))};d.fillText=function(a,b,c,d){this.drawText_(a,b,c,d,!1)};d.strokeText=function(a,
|
|
b,c,d){this.drawText_(a,b,c,d,!0)};d.measureText=function(a){this.textMeasureEl_||(this.element_.insertAdjacentHTML("beforeEnd",'<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>'),this.textMeasureEl_=this.element_.lastChild);var b=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(b.createTextNode(a));return{width:this.textMeasureEl_.offsetWidth}};d.clip=function(){};
|
|
d.arcTo=function(){};d.createPattern=function(a,b){return new I(a,b)};w.prototype.addColorStop=function(a,b){b=G(b);this.colors_.push({offset:a,color:b.color,alpha:b.alpha})};d=A.prototype=Error();d.INDEX_SIZE_ERR=1;d.DOMSTRING_SIZE_ERR=2;d.HIERARCHY_REQUEST_ERR=3;d.WRONG_DOCUMENT_ERR=4;d.INVALID_CHARACTER_ERR=5;d.NO_DATA_ALLOWED_ERR=6;d.NO_MODIFICATION_ALLOWED_ERR=7;d.NOT_FOUND_ERR=8;d.NOT_SUPPORTED_ERR=9;d.INUSE_ATTRIBUTE_ERR=10;d.INVALID_STATE_ERR=11;d.SYNTAX_ERR=12;d.INVALID_MODIFICATION_ERR=
|
|
13;d.NAMESPACE_ERR=14;d.INVALID_ACCESS_ERR=15;d.VALIDATION_ERR=16;d.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=U;CanvasRenderingContext2D=C;CanvasGradient=w;CanvasPattern=I;DOMException=A}();
|