diff flys-artifacts/src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java @ 2586:8cd6358eb7f8

Enabeld axes label font sizes for timeseries charts. flys-artifacts/trunk@4141 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 14 Mar 2012 15:12:45 +0000
parents ee5eca3871cb
children bece6f604899
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java	Wed Mar 14 15:00:30 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java	Wed Mar 14 15:12:45 2012 +0000
@@ -1,6 +1,7 @@
 package de.intevation.flys.exports;
 
 import java.awt.Color;
+import java.awt.Font;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -168,6 +169,7 @@
         addSubtitles(chart);
         adjustPlot(plot);
         addDatasets(plot);
+        adjustAxes(plot);
 
         adaptZoom(plot);
 
@@ -491,5 +493,28 @@
             total.applyBounds(axis, AXIS_SPACE);
         }
     }
+
+
+    /**
+     * Adjusts the axes of a plot. This method sets the <i>labelFont</i> of the
+     * X axis.
+     *
+     * @param plot The XYPlot of the chart.
+     */
+    protected void adjustAxes(XYPlot plot) {
+        ValueAxis xaxis = plot.getDomainAxis();
+
+        ChartSettings chartSettings = getChartSettings();
+        if (chartSettings == null) {
+            return;
+        }
+
+        Font labelFont = new Font(
+            DEFAULT_FONT_NAME,
+            Font.BOLD,
+            getXAxisLabelFontSize());
+
+        xaxis.setLabelFont(labelFont);
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org