From: robert Date: Sun, 15 May 2005 13:00:49 +0000 (+0000) Subject: add desc option for graph rows to display a different description in text table than... X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=fe34d2fe76f7d1f69347e9fd6bc4535b60faec7f;p=php-utility-classes.git add desc option for graph rows to display a different description in text table than on the graph legend --- diff --git a/include/classes/rrdstat.php-class b/include/classes/rrdstat.php-class index 083ccfe..015d575 100644 --- a/include/classes/rrdstat.php-class +++ b/include/classes/rrdstat.php-class @@ -356,6 +356,7 @@ class rrdstat { if (!isset($gconf['show_legend'])) { $gconf['show_legend'] = true; } } if (isset($erow['stack'])) { $grow['stack'] = ($erow['stack'] == true); } + if (isset($erow['desc'])) { $grow['desc'] = $erow['desc']; } $graphrows[] = $grow; } } @@ -405,7 +406,7 @@ class rrdstat { else { foreach ($graphrows as $grow) { if (isset($grow['gType']) && strlen($grow['gType'])) { - $textprefix = isset($grow['legend'])?$grow['legend']:$grow['name']; + $textprefix = isset($grow['desc'])?$grow['desc']:(isset($grow['legend'])?$grow['legend']:$grow['name']); // XXX: use lines below once we have rrdtol 1.2 // $graphrows[] = array('dType'=>'VDEF', 'name'=>$grow['name'].'_last', 'rpn_expr'=>$grow['name'].',LAST'); // $specialrows[] = array('sType'=>'PRINT', 'name'=>$grow['name'].'_last', 'text'=>'%3.2lf%s');