From 1490373cb7b5e463a9e34e95cc5075a24084fba9 Mon Sep 17 00:00:00 2001 From: hjp Date: Mon, 3 Sep 2012 11:42:04 +0000 Subject: [PATCH] added option --time_t --- tsplotv | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tsplotv b/tsplotv index a7e1a68..25803c3 100755 --- a/tsplotv +++ b/tsplotv @@ -48,6 +48,7 @@ my $stacked = 0; my $style = "lines"; my $log_y =0; my $finalresolution; +my $time_t =0; GetOptions('help|?' => \$help, 'legend_position|legend-position=s' => \$legend_position, @@ -56,6 +57,7 @@ GetOptions('help|?' => \$help, 'style:s' => \$style, 'log_y|log-y' => \$log_y, 'finalresolution' => \$finalresolution, + 'time_t' => \$time_t, ) or pod2usage(2); pod2usage(1) if $help; @@ -84,7 +86,11 @@ $ts->finalresolution($finalresolution) if $finalresolution; for my $timestamp (sort keys %data) { my %d = %{$data{$timestamp}}; 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();