]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/bacula-web/bgraph.inc.php
bacula-web: Internal code inprovment in bgraph classe
[bacula/bacula] / gui / bacula-web / bgraph.inc.php
index 11c88d55adb8a486ab2ad4a5d41a2cb69c3619f1..7d77de5e4eb0379b774d2f1804b8753aeffb06c7 100644 (file)
@@ -18,10 +18,7 @@ class BGraph{
        
        function __construct( $filename = "graph.png" )
        {
-               if( !empty($filename) )
-                       $this->output_file = $filename;
-               else
-                       $this->output_file = 'graph.png';
+               $this->output_file = 'templates_c/' . $filename;
        }
        
        public function SetData( $data_in, $type, $data_type, $shading = 5 )
@@ -65,8 +62,10 @@ class BGraph{
                $this->plot = new PHPlot( $this->width, $this->height );
                
                // Render to file instead of screen
-               $this->plot->SetIsInline( true );
                $this->plot->SetOutputFile( $this->output_file );
+               $this->plot->SetFileFormat("png");
+               $this->plot->SetIsInline( true );
+               
                
                $this->plot->SetImageBorderType('plain');
 
@@ -114,7 +113,8 @@ class BGraph{
 
                $this->plot->DrawGraph();
        } // end function Render()
-}
+} // end BGraph classe
+
 /*
 class BGraph {
 
@@ -241,7 +241,7 @@ class BCreateGraph extends BGraph {
         
                 $this->StartDate = "1900-01-01";
                 $this->EndDate = "4000-01-01";
-                $this->elapsed = "86400";                   // 24 hours in seconds.
+                $this->elapsed = LAST_DAY;                   // 24 hours in seconds.
                 
          }