Add parameter --yrange
This commit is contained in:
parent
55a1151be7
commit
70388313a2
10
tsplotv
10
tsplotv
|
@ -16,6 +16,7 @@ tsplotv
|
|||
[--time_t]
|
||||
[--colors rgb-list]
|
||||
[--configfile yaml]
|
||||
[--yrange min:max]
|
||||
[file ...]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
@ -55,6 +56,7 @@ my $finalresolution;
|
|||
my $time_t = 0;
|
||||
my $colors;
|
||||
my $configfile;
|
||||
my $yrange;
|
||||
|
||||
GetOptions('help|?' => \$help,
|
||||
'legend_position|legend-position=s' => \$legend_position,
|
||||
|
@ -66,6 +68,7 @@ GetOptions('help|?' => \$help,
|
|||
'time_t' => \$time_t,
|
||||
'colors=s' => \$colors,
|
||||
'configfile=s' => \$configfile,
|
||||
'yrange=s' => \$yrange,
|
||||
) or pod2usage(2);
|
||||
pod2usage(1) if $help;
|
||||
|
||||
|
@ -106,6 +109,13 @@ $ts->log_y($log_y);
|
|||
$ts->finalresolution($finalresolution) if $finalresolution;
|
||||
$ts->colors(map $config->{timeseries}{$_}{color}, @series);
|
||||
|
||||
if ($yrange) {
|
||||
$yrange =~s /^\[(.*)\]$/$1/; # remove optional brackets
|
||||
my ($min, $max) = $yrange =~ /^(\*|[-+0-9E.]+):(\*|[-+0-9E.]+)$/;
|
||||
$ts->yrange($min, $max);
|
||||
}
|
||||
|
||||
|
||||
for my $timestamp (sort keys %data) {
|
||||
my %d = %{$data{$timestamp}};
|
||||
my @values = @d{@series};
|
||||
|
|
Loading…
Reference in New Issue