comparison flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java @ 733:5f5e67aceb8c

#172 Charts of type duration curve will now have a lower X set to '0'. flys-artifacts/trunk@2226 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 24 Jun 2011 09:49:27 +0000
parents eab5e5089d77
children 7ca4a287cd0e
comparison
equal deleted inserted replaced
732:39d191f011dc 733:5f5e67aceb8c
6 6
7 import org.apache.log4j.Logger; 7 import org.apache.log4j.Logger;
8 8
9 import org.jfree.chart.JFreeChart; 9 import org.jfree.chart.JFreeChart;
10 import org.jfree.chart.axis.NumberAxis; 10 import org.jfree.chart.axis.NumberAxis;
11 import org.jfree.chart.axis.ValueAxis;
11 import org.jfree.chart.plot.XYPlot; 12 import org.jfree.chart.plot.XYPlot;
12 import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; 13 import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
13 import org.jfree.chart.title.TextTitle; 14 import org.jfree.chart.title.TextTitle;
15 import org.jfree.data.Range;
14 import org.jfree.data.xy.XYSeries; 16 import org.jfree.data.xy.XYSeries;
15 import org.jfree.data.xy.XYSeriesCollection; 17 import org.jfree.data.xy.XYSeriesCollection;
16 18
17 import de.intevation.artifacts.Artifact; 19 import de.intevation.artifacts.Artifact;
18 20
106 protected String getYAxisLabel() { 108 protected String getYAxisLabel() {
107 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); 109 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
108 } 110 }
109 111
110 112
113 @Override
114 protected boolean zoomX(XYPlot plot, ValueAxis axis, Range range, Range x) {
115 boolean zoomin = super.zoom(plot, axis, range, x);
116
117 if (!zoomin) {
118 axis.setLowerBound(0d);
119 }
120
121 return zoomin;
122 }
123
124
111 public void addDatasets(JFreeChart chart) { 125 public void addDatasets(JFreeChart chart) {
112 XYPlot plot = (XYPlot) chart.getPlot(); 126 XYPlot plot = (XYPlot) chart.getPlot();
113 127
114 plot.setDataset(0, w); 128 plot.setDataset(0, w);
115 plot.setDataset(1, q); 129 plot.setDataset(1, q);

http://dive4elements.wald.intevation.org