]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Internal code inprovment in bgraph classe
authorDavide Franco <bacula-dev@dflc.ch>
Tue, 25 Jan 2011 17:49:39 +0000 (18:49 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:37 +0000 (14:43 +0200)
 - Inproved BGraph class constructor
 - Changed some options in graph construction

gui/bacula-web/bgraph.inc.php

index 6c8d98039c6515d478dc8db44b5d9cc7603ead2f..7d77de5e4eb0379b774d2f1804b8753aeffb06c7 100644 (file)
@@ -18,10 +18,7 @@ class BGraph{
        
        function __construct( $filename = "graph.png" )
        {
-               if( !empty($filename) )
-                       $this->output_file = 'templates_c/' . $filename;
-               else
-                       $this->output_file = 'templates_c/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 {