From: robert Date: Sun, 8 May 2005 16:29:29 +0000 (+0000) Subject: make all 2-dataset graphs with no grph rows defined MRTG-style X-Git-Url: https://git-public.kairo.at/?p=php-utility-classes.git;a=commitdiff_plain;h=e920ca68f705d79c416b98752c228c57271d66e0;ds=sidebyside make all 2-dataset graphs with no grph rows defined MRTG-style --- 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; }