diff flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 375:60f63539d004

Ws and Qs of a longitudinal section chart are mapped to an own range axis now. flys-artifacts/trunk@1785 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 02 May 2011 09:41:22 +0000
parents 2ce7b473620e
children 0385bcc4229a
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Sun May 01 10:58:38 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Mon May 02 09:41:22 2011 +0000
@@ -11,7 +11,6 @@
 import org.jfree.chart.axis.NumberAxis;
 import org.jfree.chart.plot.PlotOrientation;
 import org.jfree.chart.plot.XYPlot;
-import org.jfree.data.xy.XYDataset;
 
 import de.intevation.flys.exports.ChartExportHelper;
 
@@ -49,11 +48,12 @@
     protected abstract String getYAxisLabel();
 
     /**
-     * Returns the XYDataset used to add curves to the chart.
+     * This method is called to add all datasets of a concrete XYChartGenerator
+     * to the JFreeChart.
      *
-     * @return the XYDataset used to add curves to the chart.
+     * @param chart The JFreeChart object.
      */
-    protected abstract XYDataset getXYDataset();
+    protected abstract void addDatasets(JFreeChart chart);
 
 
     public void generate()
@@ -65,7 +65,7 @@
             getChartTitle(),
             getXAxisLabel(),
             getYAxisLabel(),
-            getXYDataset(),
+            null,
             PlotOrientation.VERTICAL,
             true,
             false,
@@ -74,6 +74,8 @@
         chart.setBackgroundPaint(Color.WHITE);
         chart.getPlot().setBackgroundPaint(Color.WHITE);
 
+        addDatasets(chart);
+
         adjustAxes((XYPlot) chart.getPlot());
 
         ChartExportHelper.exportImage(

http://dive4elements.wald.intevation.org