From bc78006b380f30e2b2915b27a5b0cd9870116208 Mon Sep 17 00:00:00 2001 From: 军 <军@hp-pc> Date: 星期三, 10 十月 2018 09:34:55 +0800 Subject: [PATCH] 实时监测页面中的柱状图的最大值改成柱状图中的最大值的比例显示 --- gx_tieta/WebRoot/control.jsp | 30 ++++++++++++++++++------------ gx_tieta/WebRoot/js/control.js | 4 ++-- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/gx_tieta/WebRoot/control.jsp b/gx_tieta/WebRoot/control.jsp index 6d70783..62da258 100644 --- a/gx_tieta/WebRoot/control.jsp +++ b/gx_tieta/WebRoot/control.jsp @@ -1013,29 +1013,32 @@ var unit = ""; if(lname == 'Voltage'){ unit ="V"; - max = batt.MonVolStd*1.25; + /* max = batt.MonVolStd*1.25; var tempmax = Math.max.apply( Math, array); if(tempmax > max){ max = tempmax*1.25; - } + } */ + max = Math.max.apply( Math, array)*1.1; max = max.toFixed(3); }else if(lname == 'Resistance'){ unit = "m惟"; - max = (batt.MonResStd*1.25); + /* max = (batt.MonResStd*1.25); max = 10; var tempmax = Math.max.apply( Math, array)*1.25; if(tempmax<max){ max = tempmax; - } + } */ + max = Math.max.apply( Math, array)*1.1; max = (max).toFixed(3); }else if(lname == 'Temperature'){ unit = "鈩�"; - max = (Math.max.apply( Math, array)*1.25).toFixed(3); + max = (Math.max.apply( Math, array)*1.5).toFixed(3); }else if(lname == 'Conductance'){ - max = (batt.MonSerStd*1.25).toFixed(3); + //max = (batt.MonSerStd*1.25).toFixed(3); + max = (Math.max.apply( Math, array)*1.1).toFixed(3); }else if(lname == 'MonJHCurr') { unit = "mA"; - max = (Math.max.apply( Math, array)*1.25).toFixed(3); + max = (Math.max.apply( Math, array)*1.1).toFixed(3); } //console.info("max:"+max+" min:"+min); if(lname=='Resistance' || lname=='Temperature'){ @@ -1669,17 +1672,20 @@ var array = getArray(lname); var batt = getBatt(); var min = (Math.min.apply( Math, array)*0.9).toFixed(3); - var max = 0 ; + var max = (Math.max.apply( Math, array)*1.1).toFixed(3); //console.info(batt); if(lname == 'Voltage'){ - max = (batt.MonVolStd*1.25).toFixed(3); + //max = (batt.MonVolStd*1.25).toFixed(3); + max = (Math.max.apply( Math, array)*1.1).toFixed(3); }else if(lname == 'Resistance'){ //max = (batt.MonResStd*1.25).toFixed(3); - max =10; + //max =10; + max = (Math.max.apply( Math, array)*1.1).toFixed(3); }else if(lname == 'Temperature'){ - max = (Math.max.apply( Math, array)*1.25).toFixed(3); + max = (Math.max.apply( Math, array)*1.5).toFixed(3); }else if(lname == 'Conductance'){ - max = (batt.MonSerStd*1.25).toFixed(3); + //max = (batt.MonSerStd*1.25).toFixed(3); + max = (Math.max.apply( Math, array)*1.1).toFixed(3); } //console.info("max:"+max+" min:"+min); if(lname=='Resistance' || lname=='Temperature'){ diff --git a/gx_tieta/WebRoot/js/control.js b/gx_tieta/WebRoot/js/control.js index 8947cdd..76997e6 100644 --- a/gx_tieta/WebRoot/js/control.js +++ b/gx_tieta/WebRoot/js/control.js @@ -496,8 +496,8 @@ } } } - var tempmax = (Math.max.apply(null,ydata)*1.25).toFixed(3); - if(tempmax < max){ + var tempmax = (Math.max.apply(null,ydata)*1.1).toFixed(3); + if(tempmax > max){ max = tempmax; //max = (tempmax*1.25).toFixed(1); } -- Gitblit v1.9.1