Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Cvs P5ee > [svn:p5ee] r107...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 661 of 694
Post > Topic >>

[svn:p5ee] r10733 - p5ee/trunk/App-Widget-ChartDirector/lib/App/Widget

by spadkins@[EMAIL PROTECTED] Feb 14, 2008 at 11:03 AM

Author: spadkins
Date: Thu Feb 14 11:03:32 2008
New Revision: 10733

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

Log:
The x-axis does not show -1 and the graph in the report section overlaps
the legend since the max value is zero

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
Feb 14 11:03:32 2008
@[EMAIL PROTECTED]
 -246,6 +246,7 @[EMAIL PROTECTED]
     my $x_labelcolor  = $self->get_theme_value("x_labelcolor",
"0xfffcf0");
     my $y_labelcolor  = $self->get_theme_value("y_labelcolor",
"0xfffcf0");
     my $y_titlecolor  = $self->get_theme_value("y_titlecolor",
"0xfffcf0");
+    my $y_max_zero = 1;
 
     if (!$top_margin) {
         $top_margin = 5;
@[EMAIL PROTECTED]
 -264,6 +265,7 @[EMAIL PROTECTED]
         my ($y_min, $y_max) = $self->get_y_limits($spec);
         $y_min = int($y_min);
         $y_max = int($y_max);
+        $y_max_zero = int($y_max);
         my $y_label_len = length($y_max);
         $y_label_len = length($y_min) if (length($y_min) > $y_label_len);
         $left_margin = 20 + $y_label_len * 6;
@[EMAIL PROTECTED]
 -379,6 +381,10 @[EMAIL PROTECTED]
 
     $c->addTitle($spec->{title}, "arialbd.ttf", 12, hex($titlecolor)) if
($spec->{title});
 
+    if ($y_max_zero == 0) {
+        $c->yAxis()->setMargin($top_margin_adjusted + 15);
+    }
+
     #Add a legend box at (55, 22) using horizontal layout, with
transparent
     #background
     my $legend;
@[EMAIL PROTECTED]
 -762,7 +768,14 @[EMAIL PROTECTED]
                 $chart->xAxis()->setLabelStep($r);
             }
             else {
+                foreach my $xlabel (@[EMAIL PROTECTED]
) {
+                    if ($xlabel =~ /^-/) {
+                        $xlabel = '\\' . $xlabel;
+                    }
+                }
+
                 $chart->xAxis()->setLabels($x);
+
                 if ($spec->{x_label_pos}) {
                     $chart->xAxis()->setLabels($x)->setFontAngle(45) if (
$self->{total_x_length} > $self->{width}/8 );
                    
$chart->xAxis()->setLabels($x)->setFontSize($self->{fontsize}, 0) if ($#$x
> 30);




 1 Posts in Topic:
[svn:p5ee] r10733 - p5ee/trunk/App-Widget-ChartDirector/lib/App/
spadkins@[EMAIL PROTECTED  2008-02-14 11:03:33 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 23:55:22 CDT 2008.