make all 2-dataset graphs with no grph rows defined MRTG-style
authorrobert <robert>
Sun, 8 May 2005 16:29:29 +0000 (16:29 +0000)
committerrobert <robert>
Sun, 8 May 2005 16:29:29 +0000 (16:29 +0000)
include/classes/rrdstat.php-class

index c1eed086555576cc5e904ccf885690fcd6e74212..308c5a2b7732da8ec7440facbed8d0ea13396d9d 100644 (file)
@@ -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;
       }