Index: trunk/tools/czartool/CzarDb.pm
===================================================================
--- trunk/tools/czartool/CzarDb.pm	(revision 30920)
+++ trunk/tools/czartool/CzarDb.pm	(revision 30954)
@@ -330,10 +330,15 @@
     if (!$query->execute) {return 0;}
 
-    my ($_timeDiff);
-    (${$maxX}, ${$minX}, $_timeDiff) = $query->fetchrow_array();
-
+    my ($_maxX, $_minX, $_timeDiff) = $query->fetchrow_array();
+
+    # no values - get out of here
+    if (!$_maxX || !$_minX || !$_timeDiff) {return 0;}
     if ($_timeDiff > ${$timeDiff}) {${$timeDiff} = $_timeDiff;}
 
-return 1;
+    # set new min/max
+    if (!$self->isBefore(${$maxX}, $_maxX)) {${$maxX} = $_maxX;}
+    if (!$self->isBefore($_minX, ${$minX})) {${$minX} = $_minX;}
+
+    return 1;
 }
 
@@ -915,5 +920,5 @@
 ###########################################################################
 sub createProcessingRateData {
-    my ($self, $stage, $label, $begin, $end, $interval, $dataFile) = @_;
+    my ($self, $stage, $label, $begin, $end, $interval, $dataFile, $minX, $maxX, $timeDiff) = @_;
 
     my $startTime = $begin;
@@ -925,4 +930,6 @@
     my $timestamp;
 
+    $self->getTimeMinMaxDiff($label, $stage, $begin, $end, $minX, $maxX, $timeDiff);
+
     my $tmpFile = File::Temp->new( TEMPLATE => "czarplot_gnuplot_".$label."_".$stage."_r.XXXXX", DIR => '/tmp', SUFFIX => 'dat');
     $tmpFile->unlink_on_destroy(0);
@@ -939,5 +946,5 @@
         $timestamp = $self->getFormattedDate($endTime);
         if (!$processed) {$processed = 0;}
-        print GNUDAT "$timestamp $processed 0 0\n";
+        print GNUDAT "$timestamp $pending $faults $processed\n";
 
         if ($processed > 0 ) {$someData = 1;}
