$.getScript("/final/scripts/utilities/EgChartTheme.js");function getHighChartsInstance(f,b,d){var a=true;var e={highchart:null,defaults:{chart:{plotBorderWidth:0,plotBorderColor:"#e5e5e5",backgroundColor:"#ffffff",plotBackgroundColor:"white",plotShadow:false,shadow:false,zoomType:"xy",ignoreHiddenSeries:false,},rangeSelector:{enabled:false},global:{useUTC:true,timezoneOffset:timezoneOffsetValue},navigator:{enabled:false},yAxis:{border:0,minPadding:0,startOnTick:false,gridLineWidth:0,tickPixelInterval:50,labels:{align:"right",x:-10,y:3,formatter:function(){var g=Highcharts.numberFormat(this.value,4,".","");
g=(parseFloat(g));return g;},style:{color:"black",fontWeight:"bold",fontSize:"11px",textDecoration:"none",whiteSpace:"normal",},},showLastLabel:true,},plotOptions:{series:{connectNulls:false,smoothed:true,lineWidth:3,marker:{enabled:false}},line:{shadow:false,linewidth:10}},scrollbar:{enabled:false},legend:{verticalAlign:"top",align:"center",layout:"horizontal",borderWidth:0,width:300,x:30,y:-10,adjustChartSize:false,floating:true,navigation:{arrowSize:8,activeColor:"#858585",inactive:"#858585",style:{fontWeight:"bold",color:"#858585",fontSize:"9px"}},itemStyle:{color:"black",fontWeight:"bold",fontSize:"11px",},symbolWidth:20,},labels:{itemStyle:{color:"black",fontWeight:"bold",fontSize:"11px",},},tooltip:{shared:true,borderColor:"black",valueDecimals:4,style:{color:"black",padding:10,fontWeight:"bold",fontSize:"11px",},},exporting:{enabled:false},credits:{enabled:false},xAxis:{border:1,lineWidth:1,minPadding:0.02,maxPadding:0.02,type:"datetime",ordinal:false,showLastLabel:true,endOnTick:true,showFirstLabel:true,startOnTick:false,labels:{rotation:270,style:{color:"#636363",fontWeight:"Regular",fontSize:"10px",},overflow:"justify",showLastLabel:true,endOnTick:true,showFirstLabel:true,startOnTick:false,useHTML:false,tickPixelInterval:50,},title:{enabled:true,}},title:{text:"",offset:"",margin:0},},setData:function(L,ab,p){var h="";
var F="line";var I=false;h=tooltipDateFormate(ab);var u="";ymax=L["maxRange"];var R=L["commonmaxRange"];ymin=L["minRange"];fontFamily=L["fontName"];fontSize=L["fontsize"];startTime=L["lowerLimit"];I=L["showLegendsEnable"];yaxisTitle=L["yLabel"];LegendPosition=L["LegendPosition"];showLegend=L["showlegendFont"];
xLabel=L["xLabel"];LegendFont=L["LegendFont"];F=L["chartType"];var i=L["LineWidth"];var T=L["reportType"];var O=L["TimeFormatOut"];var V=L["showdisconnectedline"];var X=L["ShowLegendinTableFormatforUI"];var af=true;if(V!=null&&V=="No"){af=false;}yaxisTitle=(yaxisTitle==null||yaxisTitle=="")?"":yaxisTitle;
YtitleEnable=(yaxisTitle==null||yaxisTitle=="")?false:true;R=(R==null||R==0)?null:R;ymax=(ymax==null||ymax==0)?null:ymax;if(yaxisTitle=="%"||yaxisTitle=="(%)"){if(ymax>90){R=(R==null||R==0)?100:R;}}if(yaxisTitle==null||yaxisTitle==""){spacing=[20,5,0,20];}else{spacing=[20,5,0,20];}if(R==null||R==0){R=ymax;
}ymin=(ymin==null)?0:ymin;if(ymin==ymax){ymax=ymin+1;}var j=null;if(setyaxismin!=null&&setyaxismin=="True"){ymin=null;j=0;}fontFamily="Arial";LegendFont="Arial";var ad="rgba(255, 255, 255, 0.85)";if(strSkin=="Dark"||strSkin=="dark"){ad="#000000";}var Q=0;var D=1;var o=0;var B=0;if(!(L["DataSet"]==""||L["DataSet"]=="null"||L["DataSet"]=="undefined"||L["DataSet"]==undefined)){if(L["DataSet"].length>10&&(LegendPosition==undefined||LegendPosition=="undefined")){LegendPosition="right";
}Q=L["DataSet"].length;if(L["DataSet"].length==1){ad=L["DataSet"][0]["color"];}B=L["DataSet"].length;}yaxisTitle=(yaxisTitle==null||yaxisTitle=="")?L["ylabel"]:yaxisTitle;i=(i==null||i=="")?1:i;if(yaxisTitle!=null&&yaxisTitle.length>0){if(yaxisTitle.length>32){var M=yaxisTitle.substring(32);if(M.length>3){yaxisTitle=yaxisTitle.substring(0,32)+"...";
}}}if(YtitleEnable==false){YtitleEnable=(yaxisTitle==null||yaxisTitle=="")?false:true;}xLabel=(xLabel==null||xLabel=="")?"":xLabel;xtitleEnable=(xLabel==null||xLabel=="")?false:true;fontFamily=(fontFamily==null||fontFamily=="")?"Arial":fontFamily;fontSize=(fontSize==null||fontSize=="")?"10px":fontFamily+"px";
startTime=(startTime==null||startTime=="")?null:startTime;LegendPosition=(LegendPosition==null||LegendPosition==""||LegendPosition=="top")?"center":LegendPosition;LegendFont=(LegendFont==null||LegendFont=="")?"Arial":LegendFont;O=(O==null||O=="")?"HH:mm":O;u=getTimeLineOutputFormat(O);legendWidth=(LegendPosition=="right")?400:400;
needLegendFormat=(LegendPosition=="right")?"true":"false";maxLegendHeight=(LegendPosition=="right")?null:37;var A=document.getElementById(f);if($(A).width()>1000){legendWidth=450;}maxLegendHeight=45;if(((B*8)/37)>1){maxLegendHeight=37;}if(B<=2){legendWidth=190;}var m=-5;if(B==1){m=50;}valign=(LegendPosition=="right")?"middle":"top";
LegendPosition="center";if(legendWidth>190&&valign=="top"){LegendPosition="right";}var ae=L["chartFor"];var k=L["yAxisLabelYval"];var g="datetime";var Z=null;var Y=false;var r=null;over_line_width=i-2;if(over_line_width==0){over_line_width=i;}var ac="";if(O=="HH:mm"){ac=33;}else{ac=5;if(k!=null&&k=="21"){ac=21;
}if(k!=null&&k=="70"){ac=70;}}if(xtitleEnable){if(O=="HH:mm"){ac=20;if(k!=null){ac=28;}}else{if(O.indexOf("HH:mm:ss")>-1){ac=60;if(k!=null){ac=21;}}else{ac=48;if(k!=null&&k=="21"){ac=21;}if(k!=null&&k=="70"){ac=70;}}}}if(xtitleEnable){spacing=[20,20,0,20];}var s=document.getElementById(f);var q=true;
q=L["reflow"];if(q==null||q=="undefined"||q==undefined){q=true;}var y=false;if(Ext.getCmp("showLegend")!="undefined"&&Ext.getCmp("showLegend")!=undefined){y=Ext.getCmp("showLegend").getValue();}var W=L["showLegends"];if(W!=null&&W=="true"){y=true;}if(I!="undefined"&&I!=undefined){if(I=="true"){y=true;
}else{if(I=="false"){y=false;}}}if(F!=null&&F=="stack"){F="area",Z="normal";}if(F!=null&&F=="scatter"){g=null;i=null;Y=true;r={pointFormat:yaxisTitle+":  {point.x}<br>"+xLabel+":  {point.y}"};}var w=-25;if(!Ext.isEmpty(T)&&T=="TCR"){spacing=[35,5,0,20];w=-35;}var K=false;var J=L["calculateHeight"];if(J!=null&&J.length>0){K=true;
}var S=L["ShowLegendinTableFormatforUIData"];var C=false;var x=L["marginBottom"];var v=L["marginTop"];legendWidth=legendWidth+20;if(X!=undefined&&S.length>0){C=true;if(L["DataSet"]!=null&&L["DataSet"].length>0){var E=L["DataSet"].length;var t=S.length/5;if(t!=undefined&&t>0){E=t;}var P=(E*25)+60;w=b;
maxLegendHeight=P;if((xLabel!=undefined&&(xLabel.indexOf("MM")>-1)||xLabel=="")){x=P+70;}else{x=P+50;}LegendPosition="left";legendWidth=null;b="";v=null;var aa=Ext.getCmp("legend_"+f);var l=document.getElementById("legend_"+f);var H=document.getElementById(f+"_legend");var G=Ext.getCmp(f+"_legendPanel");
if(aa!=undefined||(l!=null&&l!=undefined)||(H!=null&&H!=undefined)||(G!=null&&G!=undefined)){x=null;}}}if(ymin==0){ymin=0;}if(F==null||F==undefined){F="line";}var N={chart:{reflow:q,type:F,hasUserSize:false,spacingTop:spacing[0],spacingRight:spacing[1],spacingLeft:0,plotBorderColor:"transparent",backgroundColor:"transparent",padding:10,tableFormatLegend:S,events:{load:function(ag){if(X!=undefined){create_new_legend(ag,true,f,K);
}else{$(".highcharts-legend-item rect").attr("height","8").attr("y","7");$(".highcharts-legend-item rect").attr("width","8").attr("x","10");}}}},tooltip:{xDateFormat:h,valueDecimals:4,backgroundColor:ad,formatter:function(){var ag="";if(F==null||F!="scatter"){if(Q==1||(strSkin=="Dark"||strSkin=="dark")){ag='<span style="color:white">'+Highcharts.dateFormat(h,this.x,true)+"</span><br>";
}else{ag=Highcharts.dateFormat(h,this.x,true)+"<br>";}$.each(this.points,function(ai,ah){var ak=Highcharts.numberFormat(ah.y,4,".","");var aj=ak.split(".");if(aj.length>1){if(aj[1]=="0000"){ak=aj[0];}}if(Q==1){ag+='<br/><b><span style="color:white">'+ah.series.name+" :  "+ak+"</span></b>";}else{ag+='<br/><b><span style="color:'+this.series.color+'">'+ah.series.name+"  :  "+ak+"</span></b>";
}});}else{ag=yaxisTitle+":"+this.y+"<br>"+xLabel+":"+this.x;if((strSkin=="Dark"||strSkin=="dark")){ag='<span style="color:white">'+yaxisTitle+":"+this.y+'</span><br><span style="color:white">'+xLabel+":"+this.x+"</span>";}}return ag;},},yAxis:{min:ymin,minPadding:j,max:R,gridLineWidth:o,gridLineColor:"#e5e5e5",lineColor:"#e5e5e5",lineWidth:1,labels:{style:{fontFamily:fontFamily,fontSize:"10px",color:"#636363",fontWeight:"Regular",}},title:{text:yaxisTitle,enabled:YtitleEnable,style:{color:"#636363",fontWeight:"bold",fontSize:"11px",},}},xAxis:{type:g,gridLineWidth:D,gridLineColor:"#e5e5e5",lineColor:"#e5e5e5",lineWidth:1,tickWidth:0,labels:{x:1,y:ac,formatter:function(){if(g==null){var ag=Highcharts.numberFormat(this.value,4,".","");
ag=(parseFloat(ag));return ag;}else{return Highcharts.dateFormat(u,this.value);}}},title:{text:xLabel,enabled:xtitleEnable,style:{color:"#636363",fontWeight:"bold",fontSize:"11px",},},dateTimeLabelFormats:{minute:u,hour:u,day:u,month:u,year:u}},plotOptions:{series:{connectNulls:af,shadow:false,lineWidth:i,marker:{enabled:Y,},stacking:Z,states:{hover:{enabled:true,lineWidth:i}},events:{legendItemClick:function(ai){if(!this.visible){return true;
}var ag=this.index;var ah=this.chart.series;$.each(ah,function(ak,aj){if(aj.index!=ag){aj.visible?aj.hide():aj.show();}});return false;}},},scatter:{tooltip:r,},},legend:{enabled:y,verticalAlign:"top",width:legendWidth+20,align:LegendPosition,x:m,y:w,itemMarginBottom:4,itemDistance:10,itemStyle:{textAlign:"Middle",},useHTML:C,maxHeight:maxLegendHeight,itemStyle:{fontFamily:LegendFont,},labelFormatter:function(){var ag=this.name;
if(ag.length>28&&needLegendFormat=="true"){c=0;strval="";while(c<ag.length){strval+=ag.substring(c,c+28)+"<br>";c=c+28;}ag=strval;}return ag;},}};var U='<div class="egFlexCenterByColumnWise" style="height:100%"> <div class="iconInformation"></div> <div class="commonErrorMsgText">No Measures Available!</div> </div>';
var n='<table width="100%" height="100%"><tr><td align="center" valign="middle"><img src="/final/images/'+strSkin+'/prediction_warning.png" /></td></tr></table>';var s=document.getElementById(f);Highcharts.seriesTypes.line.prototype.drawLegendSymbol=Highcharts.seriesTypes.area.prototype.drawLegendSymbol;
this.highchart=jQuery.extend(true,this.defaults,N);var z=[];if(L["DataSet"]==""||L["DataSet"]=="null"||L["DataSet"]=="undefined"||L["DataSet"]==undefined){a=false;if(s!=null){if(L["PredictionStatus"]!="undefined"&&L["PredictionStatus"]!=undefined&&L["PredictionStatus"]=="negative"){s.innerHTML=n;}else{s.innerHTML=U;
}}$("#showLegend-inputEl").click(function(){var ag=document.getElementById(f+"_legend");if(ag!=null&&ag!=undefined){var ah=Ext.getCmp("showLegend").getValue();showLegendChangeEvent(f,ah);}});}else{this.highchart.series=L["DataSet"];this.highchart.chart.renderTo=f;}},drawChart:function(){if(a){Highcharts.setOptions({lang:{thousandsSep:""}});
Highcharts.setOptions({global:{useUTC:true,timezoneOffset:timezoneOffsetValue}});this.highchart=jQuery.extend(true,this.highchart,getUserThemeFor(strSkin));new Highcharts.Chart(this.highchart,function(g){$("#showLegend-inputEl").click(function(){var h=document.getElementById(f+"_legend");var j=Ext.getCmp(f+"_legendPanel");
if((h!=null&&h!=undefined)||(j!=null&&j!=undefined)){var i=Ext.getCmp("showLegend").getValue();showLegendChangeEvent(f,i);}else{if(g.options.legend.useHTML){var i=Ext.getCmp("showLegend").getValue();create_new_legend(g,i,f,toCalculateHeight);}else{g.legendToggle();}}});});}}};return e;}function showLegendChangeEvent(i,b){var j=Ext.getCmp(i+"_legendPanel");
if(j!=undefined&&j!=null){if(b){j.show();}else{j.hide();var h=Ext.getCmp(i+"_GraphPanel");if(h!=undefined&&h.isHidden()){h.show();j.setHeight(53);var e=document.getElementById(i+"_legendClose");var d=document.getElementById(i+"_legendExpand");e.className=e.className.replace("showDiv","hideDiv");d.className=d.className.replace("hideDiv","showDiv");
j.className=j.className.replace("showDiv","hideDiv");}}}else{if(b){var f=document.getElementById("commonLeg_"+i);if(f!=null&&f!=undefined){f.className=f.className.replace("hideDiv","showDiv");f.style.height=60;}var a=document.getElementById(i+"_legend");var e=document.getElementById(i+"_legendClose");
var d=document.getElementById(i+"_legendExpand");a.style.height="55px";a.style.paddingTop="0px";a.style.overflow="hidden";if(d!=null&&d!=undefined){d.className=d.className.replace("hideDiv","showDiv");}if(e!=null&&e!=undefined){e.className=e.className.replace("showDiv","hideDiv");}}else{var f=document.getElementById("commonLeg_"+i);
if(f!=null&&f!=undefined){f.className=f.className.replace("showDiv","hideDiv");}var g=document.getElementById(i);if(g!=null&&g!=undefined){g.className=g.className.replace("hideDiv","showDiv");}}}}function create_new_legend(e,u,d,a){var f=Ext.getCmp("legend_"+d);var b=document.getElementById("legend_"+d);
var h=document.getElementById(d+"_legend");var n=Ext.getCmp(d+"_legendPanel");var g=false;if((h!=null&&h!=undefined)||(n!=null&&n!=undefined)){g=true;}if(u){var l=e;if(l.target!=undefined){l=l.target;}var p=l.containerWidth-50;var q="#616161";if(strSkin!=undefined&&strSkin=="Light"){q="#DBDBDB";}var t=l.options.chart.tableFormatLegend;
var j="";if(t!=undefined&&t.length>0){var r=false;var s="left";if(t.length>5){r=true;}else{if(t[0]!=undefined&&t[0]!="DATA"){r=true;}else{s="center";}}if(g){j='<div id="dummyTest" class="newTable" style="padding: 0px 0px 0px 10px;">';}else{j='<div id="dummyTest" class="newTable" style="padding: 0px 0px 0px 20px;">';
}j+='<table cellpadding="0px" cellspacing="0px" style="table-layout:fixed;width:100%;">';var k="33%";if(r){k="17%";j+='<col width="49%"/>';}j+='<col width="'+k+'"/><col width="'+k+'"/><col width="'+k+'"/><thead><tr style="background-color:'+q+';font-size:11px;font-family:Arial;" height="22px">';if(r){j+="<th>&nbsp;</th>";
}j+='<th style="text-align:'+s+';">AVG</th><th style="text-align:'+s+';" >MAX</th><th  style="text-align:'+s+';">MIN';if(g&&r&&t.length>5){j+='<div id="'+d+'_legendClose"  class="iconCloseCircle hideDiv" style="float: right;cursor:pointer;" onclick="javascript:changeLegendWindow('+d+","+a+');"></div>';
j+='<div id="'+d+'_legendExpand" class="iconDotsCircle showDiv" style="float: right;cursor:pointer;" onclick="javascript:changeLegendWindow('+d+","+a+');"></div>';}j+="</th></tr></thead><tbody>";for(var m=0;m<t.length;m=m+5){j+="<tr>";if(r){j+='<td style="padding-left:9px;" align="'+s+'"><div><div style="float:left;margin-top:2px;height:100%;vertical-align:top"><svg height="10" width="10"><circle cx="4" cy="4" r="4" fill="'+t[m+1]+'" stoke-width="0" /></svg></div><div style="margin-left:16px;line-height:1.5em;word-break:break-all">'+Ext.String.htmlDecode(t[m])+"</div></div></td>";
}j+='<td align="'+s+'">'+t[m+2]+"</td>";j+='<td align="'+s+'">'+t[m+3]+"</td>";j+='<td align="'+s+'">'+t[m+4]+"</td>";j+="</tr>";}j+="</tbody></table></div>";}if(f!=undefined){if(t.length>0){var o=((t.length/5)*27)+35;f.setHeight(o);}f.update(j);$(d+".highcharts-legend").html("");}else{if(b!=null&&b!=undefined){if(t.length>0){var o=((t.length/5)*27)+35;
b.style.height=o+"px";}b.innerHTML=j;$(d+".highcharts-legend").html("");}else{if(n!=null&&n!=undefined){n.update(j);$(d+".highcharts-legend").html("");}else{if(h!=null&&h!=undefined){h.innerHTML=j;$(d+".highcharts-legend").html("");}else{$(".highcharts-legend").html(j);}}}}}else{$(".highcharts-legend").html("");
if(f!=undefined){f.setHeight(5);f.update("");}else{if(b!=null&&b!=undefined){b.style.height="5px";b.innerHTML="";}}}}function tooltipDateFormate(g){var d=g;var j="";if(d!="null"&&d!="undefined"&&d!=""&&d!=undefined){d=d.toLowerCase();var e=" ";var a=new Array();if(d.indexOf("-")>-1){e="-";}else{if(d.indexOf("/")>-1){e="/";
}else{if(d.indexOf(".")>-1){e=".";}}}var f=d.split(e);if(f!=null&&f.length>0){for(var i=0;i<f.length;i++){var h=f[i];var b=h;if(h!=null&&h.indexOf("d")>-1){if(h!=null&&h=="d"){b="%e";}else{if(h!=null&&h=="dd"){b="%d";}else{if(h!=null&&h=="dd,"){b="%d,";}}}}else{if(h!=null&&h.indexOf("m")>-1){if(h!=null&&h=="m"){b="%m";
}else{if(h!=null&&h=="mm"){b="%m";}else{if(h!=null&&h=="mmm"){b="%b";}}}}else{if(h!=null&&h.indexOf("y")>-1){if(h!=null&&h=="yy"){b="%y";}else{if(h!=null&&h=="yyyy"){b="%Y";}}}}}a[i]=b;}}if(a!=null&&a.length>0){for(var i=0;i<a.length;i++){j+=a[i]+e;}if(j!=null&&endsWith(j,e)&&!(d!=null&&endsWith(d,e))){j=j.substring(0,j.lastIndexOf(e));
}j=j+" %H:%M:%S";}}return j;}function getTimeLineOutputFormat(e){var i="";if(e!="null"&&e!=""){e=e.toLowerCase();var h=" ";var a=new Array();if(e.indexOf("-")>-1){h="-";}else{if(e.indexOf("/")>-1){h="/";}else{if(e.indexOf(".")>-1){h=".";}}}var f=e.split(h);if(f!=null&&f.length>0){for(var d=0;d<f.length;
d++){var g=f[d];var b=g;if(g.lastIndexOf(" ")>-1){g=g.substring(0,g.lastIndexOf(" "));}if(g!=null&&g.indexOf("d")>-1){if(g!=null&&g=="d"){b="%e";}else{if(g!=null&&g=="dd"){b="%d";}else{if(g!=null&&g=="dd,"){b="%d,";}}}}else{if(g!=null&&g.indexOf("m")>-1){if(g!=null&&g=="m"){b="%m";}else{if(g!=null&&g=="mm"){b="%m";
}else{if(g!=null&&g=="mmm"){b="%b";}}}}else{if(g!=null&&g.indexOf("y")>-1){if(g!=null&&g=="yy"){b="%y";}else{if(g!=null&&g=="yyyy"){b="%Y";}}}}}if(!(g=="hh:mm"||g=="hh:mm:ss")){a[d]=b;}}}if(a!=null&&a.length>1){for(var d=0;d<a.length;d++){i+=a[d]+h;}if(i!=null&&endsWith(i,h)){i=i.substring(0,i.lastIndexOf(h));
}i=i;}else{i="%H:%M";}}return i;}function endsWith(b,a){return b.indexOf(a,b.length-a.length)!==-1;}(function(a){a.Chart.prototype.reflow=function(){var b=this,d=b.renderTo;Ext.EventManager.onWindowResize(function(){var f=$(d).outerWidth();var e=$(d).outerHeight();if(b.container){b.setSize(f,e,false);
}b.containerWidth=f;b.containerHeight=e;});};}(Highcharts));