Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/exports/ChartExportHelper.java @ 1052:b30361464775
The pdf format depends on the chart's aspect ratio (issue290).
gnv-artifacts/trunk@1126 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 26 May 2010 06:45:03 +0000 |
parents | 7f3154331bc1 |
children | 6169ddc827ac |
comparison
equal
deleted
inserted
replaced
1051:8f836fb6f592 | 1052:b30361464775 |
---|---|
233 */ | 233 */ |
234 public static void exportPDF( | 234 public static void exportPDF( |
235 OutputStream out, | 235 OutputStream out, |
236 JFreeChart chart, | 236 JFreeChart chart, |
237 String pageFormat, | 237 String pageFormat, |
238 boolean landscape, | |
239 float marginLeft, | 238 float marginLeft, |
240 float marginRight, | 239 float marginRight, |
241 float marginTop, | 240 float marginTop, |
242 float marginBottom, | 241 float marginBottom, |
243 CallContext context | 242 CallContext context |
253 int pageHeight = (int) (page.getTop(marginTop) - page.getBottom(marginBottom)); | 252 int pageHeight = (int) (page.getTop(marginTop) - page.getBottom(marginBottom)); |
254 | 253 |
255 // the chart width | 254 // the chart width |
256 int chartWidth = (Integer) context.getContextValue("chart.width"); | 255 int chartWidth = (Integer) context.getContextValue("chart.width"); |
257 int chartHeight = (Integer) context.getContextValue("chart.height"); | 256 int chartHeight = (Integer) context.getContextValue("chart.height"); |
257 | |
258 boolean landscape = chartWidth > chartHeight ? true : false; | |
258 | 259 |
259 int width = 0; | 260 int width = 0; |
260 int height = 0; | 261 int height = 0; |
261 if (landscape) { | 262 if (landscape) { |
262 width = pageHeight; | 263 width = pageHeight; |