From fe34d2fe76f7d1f69347e9fd6bc4535b60faec7f Mon Sep 17 00:00:00 2001 From: robert Date: Sun, 15 May 2005 13:00:49 +0000 Subject: [PATCH] add desc option for graph rows to display a different description in text table than on the graph legend --- include/classes/rrdstat.php-class | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'); -- 2.35.3