From 5dba496569641f4d922bd56eaff6de2e401a426d Mon Sep 17 00:00:00 2001
From: Tim Molter <tim.molter@gmail.com>
Date: Wed, 27 Feb 2013 21:17:54 +0100
Subject: [PATCH] fixed legend vertical positioning

---
 .../main/java/com/xeiam/xchart/internal/chartpart/Legend.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xchart/src/main/java/com/xeiam/xchart/internal/chartpart/Legend.java b/xchart/src/main/java/com/xeiam/xchart/internal/chartpart/Legend.java
index 81e02efa..1770cea6 100644
--- a/xchart/src/main/java/com/xeiam/xchart/internal/chartpart/Legend.java
+++ b/xchart/src/main/java/com/xeiam/xchart/internal/chartpart/Legend.java
@@ -124,7 +124,7 @@ public class Legend implements ChartPart {
       switch (chart.getStyleManager().getLegendPosition()) {
       case OutsideW:
         xOffset = chart.getWidth() - legendBoxWidth - chart.getStyleManager().getChartPadding();
-        yOffset = (int) ((chart.getHeight() - legendBoxHeight) / 2.0 + chart.getChartTitle().getSizeHint());
+        yOffset = (int) (chart.getPlot().getBounds().getY() + (chart.getPlot().getBounds().getHeight() - legendBoxHeight) / 2.0);
         break;
       case InsideNW:
         xOffset = (int) (chart.getPlot().getBounds().getX() + LEGEND_MARGIN);
-- 
GitLab