comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java @ 1050:7f3154331bc1

Use the chart size/height to export it to pdf. The chart's aspect ratio keeps alive if the size exceeds the maximum page size (issue290). gnv-artifacts/trunk@1124 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 25 May 2010 15:41:31 +0000
parents b5d852991cbf
children b30361464775
comparison
equal deleted inserted replaced
1049:778d86255d76 1050:7f3154331bc1
373 sVisible, 373 sVisible,
374 callContext 374 callContext
375 ); 375 );
376 } 376 }
377 else if (mode.equalsIgnoreCase("pdf")) { 377 else if (mode.equalsIgnoreCase("pdf")) {
378 callContext.putContextValue("chart.width", chartWidth);
379 callContext.putContextValue("chart.height", chartHeight);
380 callContext.putContextValue("shapes.visible", sVisible);
381 callContext.putContextValue("lines.visible", lVisible);
382 callContext.putContextValue("locale", locale);
383
378 createPDF( 384 createPDF(
379 outputStream, 385 outputStream,
380 parameters, 386 parameters,
381 measurements, 387 measurements,
382 dates, 388 dates,
383 chartLables, 389 chartLables,
384 uuid, 390 uuid,
385 "A4", 391 "A4",
386 true, 392 true,
387 lVisible,
388 sVisible,
389 locale,
390 callContext 393 callContext
391 ); 394 );
392 } 395 }
393 else if (mode.equalsIgnoreCase("svg")) { 396 else if (mode.equalsIgnoreCase("svg")) {
394 createSVG( 397 createSVG(
844 Collection dates, 847 Collection dates,
845 ChartLabels chartLables, 848 ChartLabels chartLables,
846 String uuid, 849 String uuid,
847 String exportFormat, 850 String exportFormat,
848 boolean landscape, 851 boolean landscape,
849 boolean linesVisible,
850 boolean shapesVisible,
851 Locale locale,
852 CallContext context 852 CallContext context
853 ) { 853 ) {
854 Chart chart = getChart( 854 Chart chart = getChart(
855 chartLables, 855 chartLables,
856 createStyle(context), 856 createStyle(context),
857 parameters, 857 parameters,
858 measurements, 858 measurements,
859 dates, 859 dates,
860 getChartResult(uuid, context), 860 getChartResult(uuid, context),
861 locale, 861 (Locale) context.getContextValue("locale"),
862 uuid, 862 uuid,
863 linesVisible, 863 Boolean.TRUE.equals(context.getContextValue("lines.visible")),
864 shapesVisible, 864 Boolean.TRUE.equals(context.getContextValue("shapes.visible")),
865 context 865 context
866 ); 866 );
867 867
868 if (chart == null) { 868 if (chart == null) {
869 log.error("Could not initialize chart."); 869 log.error("Could not initialize chart.");
873 ChartExportHelper.exportPDF( 873 ChartExportHelper.exportPDF(
874 outputStream, 874 outputStream,
875 chart.generateChart(), 875 chart.generateChart(),
876 "A4", 876 "A4",
877 PDF_FORMAT_LANDSCAPE, 877 PDF_FORMAT_LANDSCAPE,
878 50F, 50F, 50F, 50F 878 50F, 50F, 50F, 50F,
879 context
879 ); 880 );
880 } 881 }
881 882
882 883
883 /** 884 /**

http://dive4elements.wald.intevation.org