added option --time_t

This commit is contained in:
hjp 2012-09-03 11:42:04 +00:00
parent 92b79b783e
commit 1490373cb7
1 changed files with 7 additions and 1 deletions

View File

@ -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};
$ts->add_timestring($timestamp, @values); if ($time_t) {
$ts->add($timestamp, @values);
} else {
$ts->add_timestring($timestamp, @values);
}
} }
my $g = $ts->plot(); my $g = $ts->plot();