added option --time_t
This commit is contained in:
parent
92b79b783e
commit
1490373cb7
6
tsplotv
6
tsplotv
|
@ -48,6 +48,7 @@ my $stacked = 0;
|
||||||
my $style = "lines";
|
my $style = "lines";
|
||||||
my $log_y =0;
|
my $log_y =0;
|
||||||
my $finalresolution;
|
my $finalresolution;
|
||||||
|
my $time_t =0;
|
||||||
|
|
||||||
GetOptions('help|?' => \$help,
|
GetOptions('help|?' => \$help,
|
||||||
'legend_position|legend-position=s' => \$legend_position,
|
'legend_position|legend-position=s' => \$legend_position,
|
||||||
|
@ -56,6 +57,7 @@ GetOptions('help|?' => \$help,
|
||||||
'style:s' => \$style,
|
'style:s' => \$style,
|
||||||
'log_y|log-y' => \$log_y,
|
'log_y|log-y' => \$log_y,
|
||||||
'finalresolution' => \$finalresolution,
|
'finalresolution' => \$finalresolution,
|
||||||
|
'time_t' => \$time_t,
|
||||||
) or pod2usage(2);
|
) or pod2usage(2);
|
||||||
pod2usage(1) if $help;
|
pod2usage(1) if $help;
|
||||||
|
|
||||||
|
@ -84,7 +86,11 @@ $ts->finalresolution($finalresolution) if $finalresolution;
|
||||||
for my $timestamp (sort keys %data) {
|
for my $timestamp (sort keys %data) {
|
||||||
my %d = %{$data{$timestamp}};
|
my %d = %{$data{$timestamp}};
|
||||||
my @values = @d{@series};
|
my @values = @d{@series};
|
||||||
|
if ($time_t) {
|
||||||
|
$ts->add($timestamp, @values);
|
||||||
|
} else {
|
||||||
$ts->add_timestring($timestamp, @values);
|
$ts->add_timestring($timestamp, @values);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $g = $ts->plot();
|
my $g = $ts->plot();
|
||||||
|
|
Loading…
Reference in New Issue