From e920ca68f705d79c416b98752c228c57271d66e0 Mon Sep 17 00:00:00 2001 From: robert Date: Sun, 8 May 2005 16:29:29 +0000 Subject: [PATCH] make all 2-dataset graphs with no grph rows defined MRTG-style --- include/classes/rrdstat.php-class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/classes/rrdstat.php-class b/include/classes/rrdstat.php-class index c1eed08..308c5a2 100644 --- a/include/classes/rrdstat.php-class +++ b/include/classes/rrdstat.php-class @@ -327,7 +327,7 @@ class rrdstat { } } else { - foreach ($this->rrd_fields as $ds) { + foreach ($this->rrd_fields as $key=>$ds) { $grow = array(); $grow['dType'] = 'DEF'; $grow['name'] = $ds['name'].(isset($gconf['scale'])?'_tmp':''); @@ -340,7 +340,7 @@ class rrdstat { $grow['name'] = $ds['name']; $grow['rpn_expr'] = $ds['name'].'_tmp,'.$gconf['scale'].',*'; } - $grow['gType'] = ($ds['name']=='ds0')?'AREA':'LINE1'; + $grow['gType'] = ((count($this->rrd_fields)==2) && ($key==0))?'AREA':'LINE1'; $grow['color'] = $gColors[$gC++]; if ($gC >= count($gColors)) { $gC = 0; } $graphrows[] = $grow; } -- 2.43.0