Author: spadkins
Date: Thu Apr 16 08:28:08 2009
New Revision: 12705

Modified:
   p5ee/trunk/App-Widget-ChartDirector/lib/App/Widget/ChartDirector.pm

Log:
rate level graph does not display selected rate level

Modified: p5ee/trunk/App-Widget-ChartDirector/lib/App/Widget/ChartDirector.pm
==============================================================================
--- p5ee/trunk/App-Widget-ChartDirector/lib/App/Widget/ChartDirector.pm 
(original)
+++ p5ee/trunk/App-Widget-ChartDirector/lib/App/Widget/ChartDirector.pm Thu Apr 
16 08:28:08 2009
@@ -580,7 +580,7 @@
 
 sub modify_plot_area {
     &App::sub_entry if ($App::trace);
-    my ($self, $spec, $x, $c) = @_;
+    my ($self, $spec, $x, $c, $force) = @_;
 
     my $PIX_PER_CHAR     = 15.5;
     my $MAX_LABEL_LENGTH = 3;
@@ -594,6 +594,12 @@
     #print STDERR "plot_area_width  = [$plot_area_width]\n";
     #print STDERR "plot_area_height = [$plot_area_height]\n";
 
+    if ($force) {
+        my $plot_area = $c->setPlotArea($plot_area_x, $plot_area_y,
+                            $plot_area_width, $plot_area_height);
+        $plot_area->setBackground(hex($spec->{plot_bgcolor}), 
hex($spec->{plot_bgcolor}));
+    }
+
     my $max_length_x   = 0;
     my $total_length_x = 0;
     for (my $i = 0; $i <= $#$x; $i++) {
@@ -748,6 +754,16 @@
         elsif ($x->[0] =~ /^[0-9]+$/) {
             $layer->setXData($x);
         }
+        elsif ($x->[0] =~ /^[0-9]+-\d{3}$/) {
+            # 0-100
+            $chart->xAxis()->setLabels($x);
+            if ($#$x >= 4 && $spec->{width} < 500) {
+                $chart->xAxis()->setLabels($x)->setFontAngle(45);
+                $chart->xAxis()->setLabels($x)->setFontSize(9, 0);
+                $spec->{plot_area_height} = $spec->{plot_area_height} - 10;
+                $self->modify_plot_area($spec, $x, $chart, 1);
+            }
+        }
         else {
             if ($x->[0] =~ /^[0-9]+\-[0-9]+$/) {
                 my %m = ("01"=>"Jan","02"=>"Feb","03"=>"Mar","04"=>"Apr",

Reply via email to