How to display HRULE lines in preview graphs

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
fdessart
Posts: 4
Joined: Tue Oct 08, 2002 7:29 am

How to display HRULE lines in preview graphs

Post by fdessart »

Hello,

I have a few graphs, with AREA, LINE1 and HRULE displayed.
However on the preview graphs, only AREA and LINE1 are displayed, not the HRULE line!

Is there a way to change this?

Thanks for your help.
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I can't tell you what my thinking was at the time, but for some reason what you are describing is coded as such. You can try to disable it by commenting out the following lines of 'include/rrd_functions.php':

873, 874, 875, and 877

I did not test it, but I do not see why it would not work.

-Ian
fdessart
Posts: 4
Joined: Tue Oct 08, 2002 7:29 am

Post by fdessart »

I commented out the following lines:

case 'HRULE':
$text_format[$i] = ereg_replace (":", "\:" ,$text_format[$i]); /* escape colons */

// if ($graph_data_array["graph_nolegend"] == true) {
// $value_format[$i] = "0";
// }else{
$value_format[$i] = ereg_replace (":", "\:" ,$value_format[$i]); /* escape colons */
// }

$graph_items .= mysql_result($sql_id_item, $i, "tname") . ":" .
$value_format[$i] . "#" . mysql_result($sql_id_item, $i, "hex") . ":\"" .
"$text_format[$i]$hardreturn[$i]\" ";
break;


But now the graph is not displayed at all and I get the following error in Apache error_log: "ERROR: can't parse '#F51D30:'" where #F51D30 is the color of my HRULE line...

Any idea?

Thanks.
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I decided to test this on an installation of cacti. It works fine for me in both preview mode and non-preview mode. Here is an example:

http://www.bigspring.k12.pa.us/cacti/gr ... &rraid=all

Make sure you enter values for VRULE in the 'Value' field in the format 'HH:MM'. In this case I entered 0:00 and the graph renders fine in all cases.

Perhaps something else is up.

-Ian
Guest

Post by Guest »

I talked about HRULE, not VRULE.

Francois.
tamas

Re: How to display HRULE lines in preview graphs

Post by tamas »

fdessart wrote:Hello,

I have a few graphs, with AREA, LINE1 and HRULE displayed.
However on the preview graphs, only AREA and LINE1 are displayed, not the HRULE line!

Is there a way to change this?

Thanks for your help.
Hi!

I modified line 876 in include/rrd_functions.php from
$value_format[$i] = "0";
to
$value_format[$i] = mysql_result($sql_id_item, $i, "value") ;
and it seems to work fine for me.

Maybe this is not the best solution. :-?

regards

Tamas
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests