From 4fc99a11cac5ab6d833b63cd04028d4ee09bd318 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 14 Mar 2009 13:31:00 +0100 Subject: [PATCH] contrib/collection3: Add the "height" parameter. --- contrib/collection3/bin/graph.cgi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/contrib/collection3/bin/graph.cgi b/contrib/collection3/bin/graph.cgi index c246bda6..c096dc94 100755 --- a/contrib/collection3/bin/graph.cgi +++ b/contrib/collection3/bin/graph.cgi @@ -20,6 +20,7 @@ our $Debug = param ('debug'); our $Begin = param ('begin'); our $End = param ('end'); our $GraphWidth = param ('width'); +our $GraphHeight = param ('height'); our $Index = param ('index') || 0; our $OutputFormat = 'PNG'; our $ContentType = 'image/png'; @@ -59,6 +60,16 @@ if (!$GraphWidth) $GraphWidth = gc_get_scalar ('GraphWidth', 400); } +if ($GraphHeight) +{ + $GraphHeight =~ s/\D//g; +} + +if (!$GraphHeight) +{ + $GraphHeight = gc_get_scalar ('GraphHeight', 100); +} + { # Sanitize begin and end times $End ||= 0; $Begin ||= 0; @@ -191,7 +202,7 @@ else } $| = 1; - RRDs::graph ('-', '-a', $OutputFormat, '--width', $GraphWidth, @timesel, @$args); + RRDs::graph ('-', '-a', $OutputFormat, '--width', $GraphWidth, '--height', $GraphHeight, @timesel, @$args); if (my $err = RRDs::error ()) { print STDERR "RRDs::graph failed: $err\n"; -- 2.11.0