Author: spadkins
Date: Mon Jun 18 08:07:10 2007
New Revision: 9660

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

Log:
Changes made to handle \#hex colors for add_mark_color, data_set_colors and 
add_zone

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 Mon Jun 
18 08:07:10 2007
@@ -374,14 +374,11 @@
     $c->xAxis()->setLabelStyle("arial.ttf", 10, hex($x_labelcolor));
 
     if ($spec->{add_mark} ne "") {
-        my $value_color;
-        if ($spec->{add_mark_color}) {
-            $value_color = "$spec->{add_mark},$spec->{add_mark_color}";
-        } else {
-            $value_color = $spec->{add_mark};
-        }
-        my ($value, $color) = split(/,/, $value_color );
-        $color = "000000" if (!$color);
+        my $value = $spec->{add_mark};
+        my $color = $spec->{add_mark_color};
+        $color =~ s/^#//;
+        $color = "000000" if (!$color || $color eq "none");
+        
         if ($value =~ /(?:^-)?\d+(?:\.)?(?:\d+)?$/ && length($color) == 6) {
             $color = hex($color); 
             $c->yAxis()->addMark($value, $c->dashLineColor($color, 
$perlchartdir::DashLine));
@@ -393,6 +390,7 @@
 
         foreach my $val (@values) {
             my ($zone1, $zone2, $color) = split(":", $val);
+            $color =~ s/^#//; 
             
             if ($zone1 =~ /((?:^-)?\d+(?:\.)?(?:\d+)?)/) {
                 $zone1 = $1;
@@ -512,6 +510,7 @@
 
     if ($spec->{data_set_colors}) {
        foreach my $color ( split(/,(?:\s+)?/, $spec->{data_set_colors}) ) {
+           $color =~ s/^#//; 
            push (@$data_set_colors, hex($color));
        }
     }

Reply via email to