Index: trunk/tools/czartool/CzarDb.pm
===================================================================
--- trunk/tools/czartool/CzarDb.pm	(revision 29710)
+++ trunk/tools/czartool/CzarDb.pm	(revision 29711)
@@ -575,5 +575,5 @@
     $query->execute;
 
-    my $tmpFile = File::Temp->new( TEMPLATE => "czarplot_gnuplot_".$label."_".$stage."_t.XXXXX", DIR => '/tmp', SUFFIX => '.dat');
+    my $tmpFile = File::Temp->new( TEMPLATE => "czarplot_gnuplot_".$label."_".$stage."_t.XXXXX", DIR => '/tmp', SUFFIX => 'dat');
     $tmpFile->unlink_on_destroy( 0 );
     ${$dataFile} = $tmpFile->filename;
@@ -590,4 +590,5 @@
     
     $linearProcessed = 0;
+    my $someData = 0;
     while (my @row = $query->fetchrow_array()) {
         my ($thisTimestamp, $thisPending, $thisFaults, $thisProcessed) = @row;
@@ -640,4 +641,6 @@
         else {print GNUDAT "$timestamp $linearPending $linearFaults $linearProcessed\n";}
 
+        if ($linearPending > 0 || $linearFaults > 0 || $linearProcessed > 0) {$someData = 1;}
+
         $lastProcessed = $thisProcessed;
         $lastPending = $thisPending;
@@ -648,5 +651,5 @@
     close(GNUDAT) or print "* Problem closing gnuplot data file for plot for '$label' '$stage'\n";
 
-    return 1;
+    #return $someData;
 }
 
@@ -805,8 +808,7 @@
 ###########################################################################
 sub createStorageTimeSeriesData {
-    my ($self, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff) = @_;
-
-    my $dataFile = "/tmp/czarplot_gnuplot_storage_timeseries.dat";
-    open (GNUDAT, ">$dataFile");
+    my ($self, $tmpFile, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff) = @_;
+
+    open (GNUDAT, ">".$tmpFile->filename);
 
     my $query = $self->{_db}->prepare(<<SQL);
@@ -844,6 +846,4 @@
 
     close(GNUDAT);
-
-    return $dataFile;
 }
 
@@ -870,4 +870,5 @@
     open (GNUDAT, ">${$dataFile}") or print "* Problem opening gnuplot data file for plot for '$label' '$stage'\n";
     my $cleanupCarry = 0;
+    my $someData = 0;
     while(1) {
 
@@ -878,8 +879,12 @@
         print GNUDAT "$timestamp $processed 0 0\n";
 
+        if ($processed > 0 ) {$someData = 1;}
+
         $startTime = $endTime;
     }
 
-    close(GNUDAT) or print "* Problem closing gnuplot data file for rate plot for '$label' '$stage'\n"
+    close(GNUDAT) or print "* Problem closing gnuplot data file for rate plot for '$label' '$stage'\n";
+
+    #return $someData;
 }
 
