diff artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java @ 8341:130160b8d245

Introduce annotations, which know to which axis they belong.
author Tom Gottfried <tom@intevation.de>
date Tue, 30 Sep 2014 11:50:43 +0200
parents c04c66839288
children e1ff1263d79a
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java	Tue Sep 30 10:57:58 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java	Tue Sep 30 11:50:43 2014 +0200
@@ -129,6 +129,9 @@
     /** Map of datasets ("index"). */
     protected SortedMap<Integer, AxisDataset> datasets;
 
+    /** Map of annotations to add at specific Y-axis. */
+    protected SortedMap<Integer, RiverAnnotation> yAnnotations;
+
     /** List of annotations to insert in plot. */
     protected List<RiverAnnotation> annotations = new ArrayList<RiverAnnotation>();
 
@@ -141,6 +144,7 @@
      */
     public ChartGenerator2() {
         datasets = new TreeMap<Integer, AxisDataset>();
+        yAnnotations = new TreeMap<Integer, RiverAnnotation>();
     }
 
     /**
@@ -150,6 +154,10 @@
         annotations.add(annotation);
     }
 
+    public void addYAnnotation(RiverAnnotation annotation, int axisIndex) {
+        yAnnotations.put(axisIndex, annotation);
+    }
+
     /**
      * This method needs to be implemented by concrete subclasses to create new
      * instances of JFreeChart.

http://dive4elements.wald.intevation.org