diff flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 1997:210020108ca4

Implemented the buildAxisSections() method in XYChartGenerator to include an AxisSection for the X axis. flys-artifacts/trunk@3434 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 16 Dec 2011 10:35:08 +0000
parents 0bd7c3cf0af1
children e71719483546
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Fri Dec 16 10:25:55 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Fri Dec 16 10:35:08 2011 +0000
@@ -923,13 +923,30 @@
 
     /**
      * Creates new Sections for chart axes. Subclasses of this ChartGenerator
-     * should override this method to include all necessary axes in that
-     * concrete chart.
+     * should override this method to include all necessary Y axes in that
+     * concrete chart. The only Section contained in the list is the X axis.
      *
-     * @return an empty list.
+     * @return a List that contains a Section for the X axis.
      */
     protected List<Section> buildAxisSections() {
-        return new ArrayList<Section>();
+        List<Section> axisSections = new ArrayList<Section>();
+
+        String identifier = "X";
+
+        AxisSection axisSection = new AxisSection();
+        axisSection.setIdentifier(identifier);
+        axisSection.setLabel(getXAxisLabel());
+        axisSection.setFontSize(14);
+        axisSection.setFixed(false);
+
+        // XXX We are able to find better default ranges that [0,0], but the Y
+        // axes currently have no better ranges set.
+        axisSection.setUpperRange(0d);
+        axisSection.setLowerRange(0d);
+
+        axisSections.add(axisSection);
+
+        return axisSections;
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org