X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=blobdiff_plain;f=cgi;fp=cgi;h=489037409d73010192f5ae2d803988084aef01af;hb=2b76d12dcb758706022e9072c45dc6984feb8ee0;hp=968745e218940818a98a7b86657802efc62a2d0c;hpb=ea225eac1b0e3d2b85e092b8ea457031efcd5ee4;p=rrd-graphs.git diff --git a/cgi b/cgi index 968745e..4890374 100755 --- a/cgi +++ b/cgi @@ -45,11 +45,16 @@ our $SELF= '/home/ijackson/things/rrd-graphs'; our @timeranges= (3600, map { $_*86400 } qw(1 7 28), 13*7+1, 366); -sub graph_of_group ($$$$$) { - my ($section, $group, $elem, $basis, $args) = @_; +sub graph_of_group ($$$$$;$) { + my ($section, $group, $elem, $basis, $args, $title) = @_; $basis->{Args}= $args; $basis->{Slower}= 0 unless exists $basis->{Slower}; $basis->{TimeRanges} ||= \@timeranges; + if (!defined $title) { + $title = $group; + if (length $elem) { $title.= " $elem"; } + } + $basis->{Title} = $title; $graphs{$section,$group,$elem}= $basis; if (!exists $group_elems{$section,$group}) { # new group then @@ -458,9 +463,7 @@ if (defined $elem) { s,\, $end/$1 ,ge foreach @args; unshift @args, qw(--end now --start), "end-${end}s"; - my $title= $group; - if (length $elem) { $title.= " $elem"; } - + my $title = $g->{Title}; $title .= " $g->{Units}" if $g->{Units}; unshift @args, '-t', $title, '-w',$width, '-h',$height; unshift @args, qw(-a PNG --full-size-mode);