[freeside-commits] freeside/FS/FS svc_port.pm,1.7,1.8

Erik Levinson levinse at wavetail.420.am
Sun Jan 30 22:30:38 PST 2011


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv30961/FS/FS

Modified Files:
	svc_port.pm 
Log Message:
torrus various changes, RT10574

Index: svc_port.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_port.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -d -r1.7 -r1.8
--- svc_port.pm	31 Jan 2011 05:50:31 -0000	1.7
+++ svc_port.pm	31 Jan 2011 06:30:35 -0000	1.8
@@ -9,6 +9,7 @@
 use FS::cust_svc;
 use GD::Graph;
 use GD::Graph::mixed;
+use GD;
 use Date::Format qw(time2str);
 use Data::Dumper;
 
@@ -344,7 +345,7 @@
       $graph->set(
         types => ['area','lines'],
         dclrs => ['green','blue'],
-        x_label => "(In Out)  Current: $in_curr $out_curr  Average: $in_avg $out_avg  Maximum: $in_max $out_max  Minimum: $in_min $out_min",
+        x_label => '   ',
         x_tick_number => 'auto',
         x_number_format => sub {
             my $value = shift;
@@ -365,6 +366,7 @@
         },
         y_label => 'bps',
         legend_placement => 'BR',
+	lg_cols => 1,
         title => $self->serviceid,
       ) or return "can't create graph: ".$graph->error;
       
@@ -372,9 +374,26 @@
         or return "can't set text colour: ".$graph->error;
       $graph->set_legend(('In','Out')) 
         or return "can't set legend: ".$graph->error;
+      $graph->set_title_font(['verdana', 'arial', gdGiantFont], 16)
+	or return "can't set title font: ".$graph->error;
+      $graph->set_legend_font(['verdana', 'arial', gdMediumBoldFont], 12)
+	or return "can't set legend font: ".$graph->error;
+      $graph->set_x_axis_font(['verdana', 'arial', gdMediumBoldFont], 12)
+	or return "can't set font: ".$graph->error;
+      $graph->set_y_axis_font(['verdana', 'arial', gdMediumBoldFont], 12)
+	or return "can't set font: ".$graph->error;
+      $graph->set_y_label_font(['verdana', 'arial', gdMediumBoldFont], 12)
+	or return "can't set font: ".$graph->error;
 
       my $gd = $graph->plot(\@data);
       return "graph error: ".$graph->error unless($gd);
+
+      my $black = $gd->colorAllocate(0,0,0);       
+      $gd->string(gdMediumBoldFont,50,285,
+	    "Current: $in_curr   Average: $in_avg   Maximum: $in_max   Minimum: $in_min",$black);
+      $gd->string(gdMediumBoldFont,50,305,
+	    "Current: $out_curr   Average: $out_avg   Maximum: $out_max   Minimum: $out_min",$black);
+
       return $gd->png;
   }
 



More information about the freeside-commits mailing list