From 55ee833e5725f355e5d5c4504e137629830603a4 Mon Sep 17 00:00:00 2001 From: Mickael Marchand Date: Sun, 10 May 2015 18:44:49 +0200 Subject: [PATCH] remove the headers if there is nothing to display below them --- .../graphs/generic_multi_bits_separated.inc.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/html/includes/graphs/generic_multi_bits_separated.inc.php b/html/includes/graphs/generic_multi_bits_separated.inc.php index c312d315d..5eaa70908 100644 --- a/html/includes/graphs/generic_multi_bits_separated.inc.php +++ b/html/includes/graphs/generic_multi_bits_separated.inc.php @@ -13,14 +13,15 @@ if($width > "500") $unit_text = "Bits/sec"; -if($width > "500") -{ - $rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)." Current Average Maximum '"; - if (!$nototal) { $rrd_options .= " COMMENT:'Total '"; } - $rrd_options .= " COMMENT:'\l'"; -} else { - $nototal=TRUE; - $rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)." Now Ave Max\l'"; +if (!$noagg || !$nodetails) { + if($width > "500") { + $rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)." Current Average Maximum '"; + if (!$nototal) { $rrd_options .= " COMMENT:'Total '"; } + $rrd_options .= " COMMENT:'\l'"; + } else { + $nototal=TRUE; + $rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)." Now Ave Max\l'"; + } } if(!isset($multiplier)) { $multiplier = "8"; }