comparison gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java @ 312:19fbd03544ea

Generate timeseries chart in TimeSeriesChart class instead of AbstractXYChart to instantiate special timeseries charts. gnv-artifacts/trunk@370 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 25 Nov 2009 11:41:42 +0000
parents 45625b5cd6d4
children 63f8b3fb7d9a
comparison
equal deleted inserted replaced
311:cbb610197b9f 312:19fbd03544ea
5 import java.util.Locale; 5 import java.util.Locale;
6 6
7 import org.apache.log4j.Logger; 7 import org.apache.log4j.Logger;
8 8
9 import org.jfree.chart.ChartTheme; 9 import org.jfree.chart.ChartTheme;
10 import org.jfree.chart.ChartFactory;
11 import org.jfree.chart.JFreeChart;
10 import org.jfree.chart.plot.XYPlot; 12 import org.jfree.chart.plot.XYPlot;
11 import org.jfree.chart.plot.PlotOrientation; 13 import org.jfree.chart.plot.PlotOrientation;
12 import org.jfree.data.general.Series; 14 import org.jfree.data.general.Series;
13 import org.jfree.data.time.TimeSeries; 15 import org.jfree.data.time.TimeSeries;
14 import org.jfree.data.time.Minute; 16 import org.jfree.data.time.Minute;
44 this.dates = dates; 46 this.dates = dates;
45 this.resultSet = result; 47 this.resultSet = result;
46 this.timeGaps = timeGaps; 48 this.timeGaps = timeGaps;
47 this.locale = locale; 49 this.locale = locale;
48 this.PLOT_ORIENTATION = PlotOrientation.VERTICAL; 50 this.PLOT_ORIENTATION = PlotOrientation.VERTICAL;
51 }
52
53
54 public JFreeChart generateChart() {
55 log.debug("generate timeseries chart");
56
57 if (chart != null)
58 return chart;
59
60 chart = ChartFactory.createTimeSeriesChart(
61 labels.getTitle(),
62 labels.getDomainAxisLabel(),
63 null,
64 null,
65 true,
66 false,
67 false
68 );
69
70 theme.apply(chart);
71 initData();
72
73 return chart;
49 } 74 }
50 75
51 76
52 protected void initData() { 77 protected void initData() {
53 log.debug("init data for timeseries chart"); 78 log.debug("init data for timeseries chart");

http://dive4elements.wald.intevation.org