2003-08-08 15:01:59 +02:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
use strict;
|
|
|
|
use TimeSeries;
|
2006-08-29 10:14:27 +02:00
|
|
|
use Getopt::Long;
|
|
|
|
|
|
|
|
my $output_format ='png';
|
|
|
|
GetOptions('output_format|output-format=s' => \$output_format)
|
|
|
|
or die "Usage: $0 [--output_format format] [files...]\n";
|
|
|
|
|
2003-08-08 15:01:59 +02:00
|
|
|
|
2006-01-02 16:18:46 +01:00
|
|
|
binmode STDOUT, ':raw';
|
|
|
|
|
2006-08-29 10:14:27 +02:00
|
|
|
my $ts = TimeSeries->new(output_format => $output_format);
|
2003-08-08 15:01:59 +02:00
|
|
|
while (<>) {
|
|
|
|
my @legend = split;
|
|
|
|
shift @legend; # first must be for timestamp
|
|
|
|
$ts->legend(@legend);
|
|
|
|
last;
|
|
|
|
}
|
|
|
|
while (<>) {
|
|
|
|
my ($timestamp, @values) = split();
|
|
|
|
$ts->add_timestring($timestamp, @values);
|
|
|
|
}
|
|
|
|
|
|
|
|
my $g = $ts->plot();
|
|
|
|
print $g
|