<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,11 +1,22 @@
 Revision history for Perl extension Chart::Clicker.
 
+2.35
+  - Legend
+    - Depend on Layout::Manager 0.29 and adjust Legend to use 
+    - Remove lots of random crap from Legend that wasn't being used
+  - Ditch Clicker's BUILD method for prepare-time work wrt plot &amp; legend
+    addition
+  - Add has_name predicate to Series and use it in Legend
+  - Bar
+    - Fix overlap in borders
+    - Fix stroking of translucent bars
+    - Only stroke bars if their opacity is &lt; 1 and the brush width &gt; 0
+
 2.34
   - Clean up some unnecessary POD
   - Add shape_brush to Point renderer
   - Add first cut of tutorial
 
-
 2.33
   - Rename share_axis_width to share_axes_with
   - Throw a useful error when there is no data, thanks Dave Hayes</diff>
      <filename>Changes</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,6 @@ requires    'Geometry::Primitive' =&gt; 0.13;
 requires    'Graphics::Color' =&gt; 0.20;
 requires    'Graphics::Primitive' =&gt; 0.42;
 requires    'Graphics::Primitive::Driver::Cairo' =&gt; 0.39;
-requires    'Layout::Manager' =&gt; 0.24;
+requires    'Layout::Manager' =&gt; 0.29;
 
 WriteAll;</diff>
      <filename>Makefile.PL</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@ use Chart::Clicker::Drawing::ColorAllocator;
 
 use Scalar::Util qw(refaddr);
 
-our $VERSION = '2.34';
+our $VERSION = '2.35';
 
 has '+background_color' =&gt; (
     default =&gt; sub {
@@ -146,16 +146,6 @@ has '+width' =&gt; (
     default =&gt; 500
 );
 
-sub BUILD {
-    my ($self) = @_;
-
-    $self-&gt;add_component($self-&gt;plot, 'c');
-
-    if($self-&gt;legend-&gt;visible) {
-        $self-&gt;add_component($self-&gt;legend, $self-&gt;legend_position);
-    }
-}
-
 sub add_to_contexts {
     my ($self, $ctx) = @_;
 
@@ -167,7 +157,6 @@ sub add_to_contexts {
 
 sub draw {
     my ($self) = @_;
-
     my $driver = $self-&gt;driver;
     $driver-&gt;prepare($self);
 
@@ -194,6 +183,18 @@ override('prepare', sub {
 
     return if $self-&gt;prepared;
 
+    unless(scalar(@{ $self-&gt;components })) {
+        $self-&gt;add_component($self-&gt;plot, 'c');
+
+        my $lp = lc($self-&gt;legend_position);
+        if($self-&gt;legend-&gt;visible) {
+            if(($lp =~ /^e/) || ($lp =~ /^w/)) {
+                $self-&gt;legend-&gt;orientation('vertical');
+            }
+            $self-&gt;add_component($self-&gt;legend, $self-&gt;legend_position);
+        }
+    }
+
     my $plot = $self-&gt;plot;
 
     $plot-&gt;clear_components;</diff>
      <filename>lib/Chart/Clicker.pm</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,11 @@ has 'keys' =&gt; (
         'count' =&gt; 'key_count'
     }
 );
-has 'name' =&gt; ( is =&gt; 'rw', isa =&gt; 'Str' );
+has 'name' =&gt; (
+    is =&gt; 'rw',
+    isa =&gt; 'Str',
+    predicate =&gt; 'has_name'
+);
 has 'range' =&gt; (
     is =&gt; 'rw',
     isa =&gt; 'Chart::Clicker::Data::Range',</diff>
      <filename>lib/Chart/Clicker/Data/Series.pm</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,8 @@ use Graphics::Primitive::Font;
 use Graphics::Primitive::Insets;
 use Graphics::Primitive::TextBox;
 
+use Layout::Manager::Flow;
+
 has '+border' =&gt; (
     default =&gt; sub {
         my $b = Graphics::Primitive::Border-&gt;new;
@@ -37,10 +39,9 @@ has 'item_padding' =&gt; (
     }
 );
 has '+layout_manager' =&gt; (
-    default =&gt; sub { Layout::Manager::Compass-&gt;new }
+    default =&gt; sub { Layout::Manager::Flow-&gt;new(anchor =&gt; 'west', wrap =&gt; 1) },
+    lazy =&gt; 1
 );
-has 'tallest' =&gt; ( is =&gt; 'rw', isa =&gt; 'Num' );
-has 'widest' =&gt; ( is =&gt; 'rw', isa =&gt; 'Num' );
 
 override('prepare', sub {
     my ($self, $driver) = @_;
@@ -53,34 +54,27 @@ override('prepare', sub {
 
     my $ii = $self-&gt;item_padding;
 
+    if($self-&gt;is_vertical) {
+        # This assumes you aren't changing the layout manager...
+        $self-&gt;layout_manager-&gt;anchor('north');
+    }
+
     my $count = 0;
-    my $long = 0;
-    my $tall = 0;
-    my @items;
     foreach my $ds (@{ $self-&gt;clicker-&gt;datasets }) {
         foreach my $s (@{ $ds-&gt;series }) {
 
-            my $label = $s-&gt;name;
-            unless(defined($label)) {
+            unless($s-&gt;has_name) {
                 $s-&gt;name(&quot;Series $count&quot;);
-                $label = &quot;Series $count&quot;;
             }
 
             my $tb = Graphics::Primitive::TextBox-&gt;new(
                 color =&gt; $ca-&gt;next,
-                font =&gt; $self-&gt;font,
-                padding =&gt; $self-&gt;item_padding,
-                text =&gt; $label
+                font =&gt; $font,
+                padding =&gt; $ii,
+                text =&gt; $s-&gt;name
             );
 
-            # Add this to the container in the right direction based on
-            # our orientation
-            my $dir = 'w';
-            if($self-&gt;is_vertical) {
-                $dir = 'n';
-            }
-
-            $self-&gt;add_component($tb, $dir);
+            $self-&gt;add_component($tb);
 
             $count++;
         }
@@ -134,23 +128,11 @@ Set/Get this Legend's insets.
 
 Set/Get the padding for this legend's items.
 
-=head2 legend_items
-
-Set/Get this legend's items.
-
 =head2 prepare
 
 Prepare this Legend by creating the LegendItems based on the datasets
 provided and testing the lengths of the series names.
 
-=head2 tallest
-
-Set/Get the height of the tallest label.
-
-=head2 widest
-
-Set/Get the width of the widest label.
-
 =head1 AUTHOR
 
 Cory G Watson &lt;gphat@cpan.org&gt;</diff>
      <filename>lib/Chart/Clicker/Decoration/Legend.pm</filename>
    </modified>
    <modified>
      <diff>@@ -44,7 +44,7 @@ override('prepare', sub {
 });
 
 override('finalize', sub {
-    my $self = shift();
+    my ($self) = @_;
 
     my $clicker = $self-&gt;clicker;
 
@@ -53,7 +53,7 @@ override('finalize', sub {
 
     my $dses = $clicker-&gt;get_datasets_for_context($self-&gt;context);
 
-    my $padding = $self-&gt;bar_padding + $self-&gt;brush-&gt;width;
+    my $padding = $self-&gt;bar_padding + $self-&gt;brush-&gt;width * 2;
 
     my $offset = 1;
     foreach my $ds (@{ $dses }) {
@@ -64,7 +64,7 @@ override('finalize', sub {
             my $range = $ctx-&gt;range_axis;
 
             my $owidth = $width - ($width * $domain-&gt;fudge_amount);
-            my $bwidth = int(($owidth / $self-&gt;{KEYCOUNT})) - $self-&gt;brush-&gt;width - $padding;
+            my $bwidth = int(($owidth / $self-&gt;{KEYCOUNT})) - $padding;
             my $hbwidth = int($bwidth / 2);
 
             # Fudge amounts change mess up the calculation of bar widths, so
@@ -102,7 +102,7 @@ override('finalize', sub {
                             $x - $hbwidth + ($offset * $cbwidth), $basey
                         );
                         $self-&gt;rectangle(
-                            -int($cbwidth), -int($y - ($height - $basey))
+                            -int($cbwidth) + $self-&gt;brush-&gt;width, -int($y - ($height - $basey))
                         );
                     }
                 } else {
@@ -119,21 +119,26 @@ override('finalize', sub {
                 paint =&gt; Graphics::Primitive::Paint::Solid-&gt;new
             );
 
-            if($self-&gt;opacity) {
+            my $brwidth = $self-&gt;brush-&gt;width;
+
+            if($self-&gt;opacity &lt; 1) {
                 my $fillcolor = $color-&gt;clone;
                 $fillcolor-&gt;alpha($self-&gt;opacity);
                 $fillop-&gt;paint-&gt;color($fillcolor);
                 # Since we're going to stroke this, we want to preserve it.
-                $fillop-&gt;preserve(1);
+                $fillop-&gt;preserve(1) if $brwidth;
             } else {
                 $fillop-&gt;paint-&gt;color($color);
             }
 
             $self-&gt;do($fillop);
 
-            if($self-&gt;opacity) {
+            if(($self-&gt;opacity &lt; 1) &amp;&amp; ($brwidth &gt; 0)) {
                 my $strokeop = Graphics::Primitive::Operation::Stroke-&gt;new;
-                $strokeop-&gt;brush-&gt;color($color);
+                $strokeop-&gt;brush($self-&gt;brush-&gt;clone);
+                unless(defined($self-&gt;brush-&gt;color)) {
+                    $strokeop-&gt;brush-&gt;color($color);
+                }
                 $self-&gt;do($strokeop);
             }
 </diff>
      <filename>lib/Chart/Clicker/Renderer/Bar.pm</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>344b7b24823d1376927918f144e03a4f80425e43</id>
    </parent>
  </parents>
  <author>
    <name>Cory Watson</name>
    <email>github@onemogin.com</email>
  </author>
  <url>http://github.com/gphat/chart-clicker/commit/9671b82f70613d2de4ca994add2c2a46410a244a</url>
  <id>9671b82f70613d2de4ca994add2c2a46410a244a</id>
  <committed-date>2009-06-28T00:24:57-07:00</committed-date>
  <authored-date>2009-06-28T00:24:57-07:00</authored-date>
  <message>- Legend
    - Depend on Layout::Manager 0.29 and adjust Legend to use
    - Remove lots of random crap from Legend that wasn't being used
- Ditch Clicker's BUILD method for prepare-time work wrt plot &amp; legend
  addition
- Add has_name predicate to Series and use it in Legend
- Bar
    - Fix overlap in borders
    - Fix stroking of translucent bars
    - Only stroke bars if their opacity is &lt; 1 and the brush width &gt; 0</message>
  <tree>dd907b42cdcee5b4a05c06e2ecaae8478a481fa6</tree>
  <committer>
    <name>Cory Watson</name>
    <email>github@onemogin.com</email>
  </committer>
</commit>
