changeset 1056:0318fda0001e

Fixed a bug in the pdf export. gnv-artifacts/trunk@1131 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 27 May 2010 08:48:16 +0000
parents bb2679624c6a
children 04967dc9c83f
files gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/exports/ChartExportHelper.java
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Thu May 27 07:41:14 2010 +0000
+++ b/gnv-artifacts/ChangeLog	Thu May 27 08:48:16 2010 +0000
@@ -1,3 +1,10 @@
+2010-05-27  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	* src/main/java/de/intevation/gnv/exports/ChartExportHelper.java: Fixed a
+	  bug while exporting charts and histograms to pdf. Charts/histograms that
+	  are larger than the pdf page have been cut. The reason was a usage of
+	  wrong values when creating the graphics area for the charts/histograms.
+
 2010-05-27  Ingo Weinzierl <ingo.weinzierl@intevation.de>
 
 	  Issue288
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/ChartExportHelper.java	Thu May 27 07:41:14 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/ChartExportHelper.java	Thu May 27 08:48:16 2010 +0000
@@ -302,7 +302,8 @@
             PdfContentByte content  = writer.getDirectContent();
 
             PdfTemplate template = content.createTemplate(width, height);
-            Graphics2D  graphics = template.createGraphics(width, height);
+            Graphics2D  graphics = template.createGraphics(
+                chartWidth, chartHeight);
             Rectangle2D area = new Rectangle2D.Double(
                 0.0D, 0.0D, chartWidth, chartHeight);
 
@@ -416,7 +417,7 @@
                 Graphics2D  graphics = template.createGraphics(
                     chartWidth, chartHeight);
                 Rectangle2D area     = new Rectangle2D.Double(
-                    0.0D, 0.0D,width,height);
+                    0.0D, 0.0D, chartWidth, chartHeight);
 
                 chart.draw(graphics, area);
                 graphics.dispose();

http://dive4elements.wald.intevation.org