KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfree > chart > demo > DemoDatasetFactory


1 /* ======================================
2  * JFreeChart : a free Java chart library
3  * ======================================
4  *
5  * Project Info: http://www.jfree.org/jfreechart/index.html
6  * Project Lead: David Gilbert (david.gilbert@object-refinery.com);
7  *
8  * (C) Copyright 2000-2003, by Object Refinery Limited and Contributors.
9  *
10  * This library is free software; you can redistribute it and/or modify it under the terms
11  * of the GNU Lesser General Public License as published by the Free Software Foundation;
12  * either version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License along with this
19  * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20  * Boston, MA 02111-1307, USA.
21  *
22  * -----------------------
23  * DemoDatasetFactory.java
24  * -----------------------
25  * (C) Copyright 2001-2003, by Object Refinery Limited.
26  *
27  * Original Author: David Gilbert (for Object Refinery Limited);
28  * Contributor(s): Bryan Scott;
29  * Bill Kelemen;
30  * David Browning;
31  *
32  * $Id: DemoDatasetFactory.java,v 1.17 2003/11/25 09:33:21 mungady Exp $
33  *
34  * Changes
35  * -------
36  * 10-Dec-2001 : Version 1 (DG);
37  * 15-Mar-2002 : Added createHighLowOpenCloseDataset() method (DG);
38  * 20-Jun-2002 : Added createMeterDataset() method (BRS);
39  * 24-Jun-2002 : Moved createGanttDataset() method from GanttDemo (BRS);
40  * 10-Oct-2002 : Fixed errors reported by Checkstyle (DG);
41  * 24-May-2003 : Added createSegmentedHighLowDataset(..) (BK);
42  * 05-Aug-2003 : Added createBoxAndWhiskerDataset() method (DB);
43  * 08-Aug-2003 : Refined createBoxAndWhiskerDataset() method (DB);
44  *
45  */

46
47 package org.jfree.chart.demo;
48
49 import java.util.Date JavaDoc;
50
51 import org.jfree.chart.axis.SegmentedTimeline;
52 import org.jfree.data.CategoryDataset;
53 import org.jfree.data.DatasetUtilities;
54 import org.jfree.data.DefaultHighLowDataset;
55 import org.jfree.data.DefaultWindDataset;
56 import org.jfree.data.HighLowDataset;
57 import org.jfree.data.IntervalCategoryDataset;
58 import org.jfree.data.SignalsDataset;
59 import org.jfree.data.WindDataset;
60 import org.jfree.data.XYDataset;
61 import org.jfree.data.XYSeries;
62 import org.jfree.data.XYSeriesCollection;
63 import org.jfree.data.time.Day;
64 import org.jfree.data.time.FixedMillisecond;
65 import org.jfree.data.time.TimeSeries;
66 import org.jfree.data.time.TimeSeriesCollection;
67 import org.jfree.data.time.Year;
68 import org.jfree.date.DateUtilities;
69 import org.jfree.date.MonthConstants;
70
71 /**
72  * A utility class for generating sample datasets for the demos.
73  * <p>
74  * These datasets are hard-coded so that they are easily accessible for the demonstration
75  * applications. In a real application, you would create datasets dynamically by reading data from
76  * a file, a database, or some other source.
77  *
78  * @author David Gilbert
79  */

80 public class DemoDatasetFactory {
81
82     /**
83      * To prevent (unnecessary) instantiation.
84      */

85     private DemoDatasetFactory() {
86     }
87     
88     /**
89      * Creates and returns a {@link CategoryDataset} for the demo charts.
90      *
91      * @return a sample dataset.
92      */

93     public static CategoryDataset createCategoryDataset() {
94
95         double[][] data = new double[][]
96             {{10.0, 4.0, 15.0, 14.0},
97              {-5.0, -7.0, 14.0, -3.0},
98              {6.0, 17.0, -12.0, 7.0},
99              {7.0, 15.0, 11.0, 0.0},
100              {-8.0, -6.0, 10.0, -9.0},
101              {9.0, 8.0, 0.0, 6.0},
102              {-10.0, 9.0, 7.0, 7.0},
103              {11.0, 13.0, 9.0, 9.0},
104              {-3.0, 7.0, 11.0, -10.0}};
105
106         return DatasetUtilities.createCategoryDataset("Series ", "Category ", data);
107
108     }
109
110     /**
111      * Creates and returns a category dataset with JUST ONE CATEGORY for the demo charts.
112      *
113      * @return a sample category dataset.
114      */

115     public static CategoryDataset createSingleCategoryDataset() {
116
117         Number JavaDoc[][] data = new Integer JavaDoc[][]
118             {{new Integer JavaDoc(10)},
119              {new Integer JavaDoc(-5)},
120              {new Integer JavaDoc(6)},
121              {new Integer JavaDoc(7)},
122              {new Integer JavaDoc(-8)},
123              {new Integer JavaDoc(9)},
124              {new Integer JavaDoc(-10)},
125              {new Integer JavaDoc(11)},
126              {new Integer JavaDoc(-3)}};
127
128         return DatasetUtilities.createCategoryDataset("Series ", "Category ", data);
129
130     }
131
132     /**
133      * Creates and returns a category dataset for the demo charts.
134      *
135      * @return a sample category dataset.
136      */

137     public static CategoryDataset createSingleSeriesCategoryDataset() {
138
139         double[][] data = new double[][] {{10.0, -4.0, 15.0, 14.0}};
140
141         return DatasetUtilities.createCategoryDataset("Series ", "Category ", data);
142
143     }
144
145     /**
146      * Returns a null interval category dataset.
147      *
148      * @return null.
149      */

150     public static IntervalCategoryDataset createIntervalCategoryDataset() {
151
152         return null;
153
154     }
155
156     /**
157      * Returns a sample XY dataset.
158      *
159      * @return a sample XY dataset.
160      */

161     public static XYDataset createSampleXYDataset() {
162         return new SampleXYDataset();
163     }
164
165     /**
166      * Creates and returns a sample dataset for the XY 'Step' chart.
167      *
168      * @return the sample dataset.
169      */

170     public static XYDataset createStepXYDataset() {
171
172         int feb = 2;
173         XYSeries s1 = new XYSeries("Plan 1");
174         s1.add(DateUtilities.createDate(2002, feb, 19, 8, 0).getTime(), 0);
175         s1.add(DateUtilities.createDate(2002, feb, 19, 8, 1).getTime(), 2);
176         s1.add(DateUtilities.createDate(2002, feb, 19, 9, 5).getTime(), 4);
177         s1.add(DateUtilities.createDate(2002, feb, 19, 10, 6).getTime(), 4);
178         s1.add(DateUtilities.createDate(2002, feb, 19, 11, 6).getTime(), 5);
179         s1.add(DateUtilities.createDate(2002, feb, 19, 12, 6).getTime(), 3);
180         s1.add(DateUtilities.createDate(2002, feb, 19, 13, 6).getTime(), 6);
181         s1.add(DateUtilities.createDate(2002, feb, 19, 14, 6).getTime(), 6);
182         s1.add(DateUtilities.createDate(2002, feb, 19, 15, 30).getTime(), 2);
183         s1.add(DateUtilities.createDate(2002, feb, 19, 16, 7).getTime(), 0);
184
185         XYSeries s2 = new XYSeries("Plan 2");
186         s2.add(DateUtilities.createDate(2002, feb, 19, 8, 40).getTime(), 0);
187         s2.add(DateUtilities.createDate(2002, feb, 19, 8, 45).getTime(), 1);
188         s2.add(DateUtilities.createDate(2002, feb, 19, 9, 0).getTime(), 6);
189         s2.add(DateUtilities.createDate(2002, feb, 19, 10, 6).getTime(), 2);
190         s2.add(DateUtilities.createDate(2002, feb, 19, 10, 45).getTime(), 4);
191         s2.add(DateUtilities.createDate(2002, feb, 19, 12, 0).getTime(), 7);
192         s2.add(DateUtilities.createDate(2002, feb, 19, 13, 0).getTime(), 5);
193         s2.add(DateUtilities.createDate(2002, feb, 19, 14, 6).getTime(), 4);
194         s2.add(DateUtilities.createDate(2002, feb, 19, 15, 15).getTime(), 4);
195         s2.add(DateUtilities.createDate(2002, feb, 19, 16, 0).getTime(), 0);
196
197         XYSeriesCollection dataset = new XYSeriesCollection();
198         dataset.addSeries(s1);
199         dataset.addSeries(s2);
200         return dataset;
201     }
202
203
204     /**
205      * Returns a dataset consisting of one annual series.
206      *
207      * @return a sample time series collection.
208      */

209     public static TimeSeriesCollection createTimeSeriesCollection1() {
210
211         TimeSeries t1 = new TimeSeries("Annual", "Year", "Value", Year.class);
212         try {
213             t1.add(new Year(1990), new Double JavaDoc(50.1));
214             t1.add(new Year(1991), new Double JavaDoc(12.3));
215             t1.add(new Year(1992), new Double JavaDoc(23.9));
216             t1.add(new Year(1993), new Double JavaDoc(83.4));
217             t1.add(new Year(1994), new Double JavaDoc(-34.7));
218             t1.add(new Year(1995), new Double JavaDoc(76.5));
219             t1.add(new Year(1996), new Double JavaDoc(10.0));
220             t1.add(new Year(1997), new Double JavaDoc(-14.7));
221             t1.add(new Year(1998), new Double JavaDoc(43.9));
222             t1.add(new Year(1999), new Double JavaDoc(49.6));
223             t1.add(new Year(2000), new Double JavaDoc(37.2));
224             t1.add(new Year(2001), new Double JavaDoc(17.1));
225         }
226         catch (Exception JavaDoc e) {
227             System.err.println(e.getMessage());
228         }
229
230         return new TimeSeriesCollection(t1);
231
232     }
233
234     /**
235      * Creates a time series collection containing JPY/GBP exchange rates.
236      *
237      * @return a sample time series collection.
238      */

239     public static TimeSeriesCollection createTimeSeriesCollection2() {
240
241         TimeSeriesCollection data = new TimeSeriesCollection();
242         data.addSeries(createJPYTimeSeries());
243         return data;
244
245     }
246
247     /**
248      * Creates a time series collection containing USD/GBP and EUR/GBP exchange rates.
249      *
250      * @return a sample time series collection.
251      */

252     public static TimeSeriesCollection createTimeSeriesCollection3() {
253
254         TimeSeriesCollection collection = new TimeSeriesCollection();
255         collection.addSeries(createUSDTimeSeries());
256         collection.addSeries(createEURTimeSeries());
257         return collection;
258
259     }
260
261     /**
262      * Returns a time series dataset using millisecond data.
263      *
264      * @return a sample time series collection.
265      */

266     public static TimeSeriesCollection createTimeSeriesCollection4() {
267
268         TimeSeries t4 = new TimeSeries("Test",
269                                                  "Millisecond", "Value", FixedMillisecond.class);
270         Date JavaDoc now = new Date JavaDoc();
271         try {
272             t4.add(new FixedMillisecond(now.getTime() + 0), new Double JavaDoc(50.1));
273             t4.add(new FixedMillisecond(now.getTime() + 1), new Double JavaDoc(12.3));
274             t4.add(new FixedMillisecond(now.getTime() + 2), new Double JavaDoc(23.9));
275             t4.add(new FixedMillisecond(now.getTime() + 3), new Double JavaDoc(83.4));
276             t4.add(new FixedMillisecond(now.getTime() + 4), new Double JavaDoc(34.7));
277             t4.add(new FixedMillisecond(now.getTime() + 5), new Double JavaDoc(76.5));
278             t4.add(new FixedMillisecond(now.getTime() + 6), new Double JavaDoc(150.0));
279             t4.add(new FixedMillisecond(now.getTime() + 7), new Double JavaDoc(414.7));
280             t4.add(new FixedMillisecond(now.getTime() + 8), new Double JavaDoc(1500.9));
281             t4.add(new FixedMillisecond(now.getTime() + 9), new Double JavaDoc(4530.6));
282             t4.add(new FixedMillisecond(now.getTime() + 10), new Double JavaDoc(7337.2));
283             t4.add(new FixedMillisecond(now.getTime() + 11), new Double JavaDoc(9117.1));
284         }
285         catch (Exception JavaDoc e) {
286             System.err.println(e.getMessage());
287         }
288
289         return new TimeSeriesCollection(t4);
290
291     }
292
293     /**
294      * Returns a time series of the daily USD/GBP exchange rates in 2001 (to date), for use in
295      * the JFreeChart demonstration application.
296      * <P>
297      * You wouldn't normally create a time series in this way. Typically, values would
298      * be read from a database.
299      *
300      * @return a time series.
301      *
302      */

303     public static TimeSeries createUSDTimeSeries() {
304
305         TimeSeries t1 = new TimeSeries("USD/GBP");
306         try {
307             t1.add(new Day(2, MonthConstants.JANUARY, 2001), 1.4956);
308             t1.add(new Day(3, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5047));
309             t1.add(new Day(4, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4931));
310             t1.add(new Day(5, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4955));
311             t1.add(new Day(8, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4994));
312             t1.add(new Day(9, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4911));
313             t1.add(new Day(10, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4903));
314             t1.add(new Day(11, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4947));
315             t1.add(new Day(12, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4784));
316             t1.add(new Day(15, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4787));
317             t1.add(new Day(16, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4702));
318             t1.add(new Day(17, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4729));
319             t1.add(new Day(18, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4760));
320             t1.add(new Day(19, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4685));
321             t1.add(new Day(22, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4609));
322             t1.add(new Day(23, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4709));
323             t1.add(new Day(24, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4576));
324             t1.add(new Day(25, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4589));
325             t1.add(new Day(26, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4568));
326             t1.add(new Day(29, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4566));
327             t1.add(new Day(30, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4604));
328             t1.add(new Day(31, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.4616));
329             t1.add(new Day(1, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4777));
330             t1.add(new Day(2, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4687));
331             t1.add(new Day(5, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4753));
332             t1.add(new Day(6, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4605));
333             t1.add(new Day(7, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4619));
334             t1.add(new Day(8, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4453));
335             t1.add(new Day(9, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4463));
336             t1.add(new Day(12, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4521));
337             t1.add(new Day(13, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4517));
338             t1.add(new Day(14, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4601));
339             t1.add(new Day(15, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4500));
340             t1.add(new Day(16, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4517));
341             t1.add(new Day(19, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4459));
342             t1.add(new Day(20, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4449));
343             t1.add(new Day(21, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4447));
344             t1.add(new Day(22, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4465));
345             t1.add(new Day(23, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4487));
346             t1.add(new Day(26, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4417));
347             t1.add(new Day(27, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4420));
348             t1.add(new Day(28, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.4421));
349             t1.add(new Day(1, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4547));
350             t1.add(new Day(2, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4741));
351             t1.add(new Day(5, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4686));
352             t1.add(new Day(6, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4667));
353             t1.add(new Day(7, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4618));
354             t1.add(new Day(8, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4685));
355             t1.add(new Day(9, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4677));
356             t1.add(new Day(12, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4660));
357             t1.add(new Day(13, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4526));
358             t1.add(new Day(14, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4483));
359             t1.add(new Day(15, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4441));
360             t1.add(new Day(16, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4303));
361             t1.add(new Day(19, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4259));
362             t1.add(new Day(20, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4283));
363             t1.add(new Day(21, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4293));
364             t1.add(new Day(22, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4192));
365             t1.add(new Day(23, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4293));
366             t1.add(new Day(26, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4334));
367             t1.add(new Day(27, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4371));
368             t1.add(new Day(28, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4347));
369             t1.add(new Day(29, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4362));
370             t1.add(new Day(30, MonthConstants.MARCH, 2001), new Double JavaDoc(1.4217));
371             t1.add(new Day(2, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4205));
372             t1.add(new Day(3, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4270));
373             t1.add(new Day(4, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4333));
374             t1.add(new Day(5, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4287));
375             t1.add(new Day(6, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4395));
376             t1.add(new Day(9, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4494));
377             t1.add(new Day(10, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4385));
378             t1.add(new Day(11, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4348));
379             t1.add(new Day(12, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4402));
380             t1.add(new Day(17, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4314));
381             t1.add(new Day(18, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4197));
382             t1.add(new Day(19, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4365));
383             t1.add(new Day(20, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4416));
384             t1.add(new Day(23, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4396));
385             t1.add(new Day(24, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4360));
386             t1.add(new Day(25, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4397));
387             t1.add(new Day(26, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4402));
388             t1.add(new Day(27, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4366));
389             t1.add(new Day(30, MonthConstants.APRIL, 2001), new Double JavaDoc(1.4309));
390             t1.add(new Day(1, MonthConstants.MAY, 2001), new Double JavaDoc(1.4324));
391             t1.add(new Day(2, MonthConstants.MAY, 2001), new Double JavaDoc(1.4336));
392             t1.add(new Day(3, MonthConstants.MAY, 2001), new Double JavaDoc(1.4329));
393             t1.add(new Day(4, MonthConstants.MAY, 2001), new Double JavaDoc(1.4375));
394             t1.add(new Day(8, MonthConstants.MAY, 2001), new Double JavaDoc(1.4321));
395             t1.add(new Day(9, MonthConstants.MAY, 2001), new Double JavaDoc(1.4219));
396             t1.add(new Day(10, MonthConstants.MAY, 2001), new Double JavaDoc(1.4226));
397             t1.add(new Day(11, MonthConstants.MAY, 2001), new Double JavaDoc(1.4199));
398             t1.add(new Day(14, MonthConstants.MAY, 2001), new Double JavaDoc(1.4183));
399             t1.add(new Day(15, MonthConstants.MAY, 2001), new Double JavaDoc(1.4218));
400             t1.add(new Day(16, MonthConstants.MAY, 2001), new Double JavaDoc(1.4295));
401             t1.add(new Day(17, MonthConstants.MAY, 2001), new Double JavaDoc(1.4296));
402             t1.add(new Day(18, MonthConstants.MAY, 2001), new Double JavaDoc(1.4296));
403             t1.add(new Day(21, MonthConstants.MAY, 2001), new Double JavaDoc(1.4366));
404             t1.add(new Day(22, MonthConstants.MAY, 2001), new Double JavaDoc(1.4283));
405             t1.add(new Day(23, MonthConstants.MAY, 2001), new Double JavaDoc(1.4244));
406             t1.add(new Day(24, MonthConstants.MAY, 2001), new Double JavaDoc(1.4102));
407             t1.add(new Day(25, MonthConstants.MAY, 2001), new Double JavaDoc(1.4205));
408             t1.add(new Day(29, MonthConstants.MAY, 2001), new Double JavaDoc(1.4183));
409             t1.add(new Day(30, MonthConstants.MAY, 2001), new Double JavaDoc(1.4230));
410             t1.add(new Day(31, MonthConstants.MAY, 2001), new Double JavaDoc(1.4201));
411             t1.add(new Day(1, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4148));
412             t1.add(new Day(4, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4142));
413             t1.add(new Day(5, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4095));
414             t1.add(new Day(6, MonthConstants.JUNE, 2001), new Double JavaDoc(1.3938));
415             t1.add(new Day(7, MonthConstants.JUNE, 2001), new Double JavaDoc(1.3886));
416             t1.add(new Day(8, MonthConstants.JUNE, 2001), new Double JavaDoc(1.3798));
417             t1.add(new Day(11, MonthConstants.JUNE, 2001), new Double JavaDoc(1.3726));
418             t1.add(new Day(12, MonthConstants.JUNE, 2001), new Double JavaDoc(1.3788));
419             t1.add(new Day(13, MonthConstants.JUNE, 2001), new Double JavaDoc(1.3878));
420             t1.add(new Day(14, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4002));
421             t1.add(new Day(15, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4033));
422             t1.add(new Day(18, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4038));
423             t1.add(new Day(19, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4023));
424             t1.add(new Day(20, MonthConstants.JUNE, 2001), new Double JavaDoc(1.3952));
425             t1.add(new Day(21, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4142));
426             t1.add(new Day(22, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4114));
427             t1.add(new Day(25, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4141));
428             t1.add(new Day(26, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4157));
429             t1.add(new Day(27, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4136));
430             t1.add(new Day(28, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4089));
431             t1.add(new Day(29, MonthConstants.JUNE, 2001), new Double JavaDoc(1.4066));
432             t1.add(new Day(2, MonthConstants.JULY, 2001), new Double JavaDoc(1.4154));
433             t1.add(new Day(3, MonthConstants.JULY, 2001), new Double JavaDoc(1.4072));
434             t1.add(new Day(4, MonthConstants.JULY, 2001), new Double JavaDoc(1.4064));
435             t1.add(new Day(5, MonthConstants.JULY, 2001), new Double JavaDoc(1.3995));
436             t1.add(new Day(6, MonthConstants.JULY, 2001), new Double JavaDoc(1.4070));
437             t1.add(new Day(9, MonthConstants.JULY, 2001), new Double JavaDoc(1.4094));
438             t1.add(new Day(10, MonthConstants.JULY, 2001), new Double JavaDoc(1.4113));
439             t1.add(new Day(11, MonthConstants.JULY, 2001), new Double JavaDoc(1.4143));
440             t1.add(new Day(12, MonthConstants.JULY, 2001), new Double JavaDoc(1.4061));
441             t1.add(new Day(13, MonthConstants.JULY, 2001), new Double JavaDoc(1.4008));
442             t1.add(new Day(16, MonthConstants.JULY, 2001), new Double JavaDoc(1.3999));
443             t1.add(new Day(17, MonthConstants.JULY, 2001), new Double JavaDoc(1.4003));
444             t1.add(new Day(18, MonthConstants.JULY, 2001), new Double JavaDoc(1.4155));
445             t1.add(new Day(19, MonthConstants.JULY, 2001), new Double JavaDoc(1.4165));
446             t1.add(new Day(20, MonthConstants.JULY, 2001), new Double JavaDoc(1.4282));
447             t1.add(new Day(23, MonthConstants.JULY, 2001), new Double JavaDoc(1.4190));
448             t1.add(new Day(24, MonthConstants.JULY, 2001), new Double JavaDoc(1.4200));
449             t1.add(new Day(25, MonthConstants.JULY, 2001), new Double JavaDoc(1.4276));
450             t1.add(new Day(26, MonthConstants.JULY, 2001), new Double JavaDoc(1.4275));
451             t1.add(new Day(27, MonthConstants.JULY, 2001), new Double JavaDoc(1.4233));
452             t1.add(new Day(30, MonthConstants.JULY, 2001), new Double JavaDoc(1.4246));
453             t1.add(new Day(31, MonthConstants.JULY, 2001), new Double JavaDoc(1.4254));
454             t1.add(new Day(1, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4319));
455             t1.add(new Day(2, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4321));
456             t1.add(new Day(3, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4293));
457             t1.add(new Day(6, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4190));
458             t1.add(new Day(7, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4176));
459             t1.add(new Day(8, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4139));
460             t1.add(new Day(9, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4214));
461             t1.add(new Day(10, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4266));
462             t1.add(new Day(11, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4220));
463             t1.add(new Day(12, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4210));
464             t1.add(new Day(15, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4383));
465             t1.add(new Day(16, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4431));
466             t1.add(new Day(17, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4445));
467             t1.add(new Day(20, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4444));
468             t1.add(new Day(21, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4483));
469             t1.add(new Day(22, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4556));
470             t1.add(new Day(23, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4468));
471             t1.add(new Day(24, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4464));
472             t1.add(new Day(28, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4483));
473             t1.add(new Day(29, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4519));
474             t1.add(new Day(30, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4494));
475             t1.add(new Day(31, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.4505));
476             t1.add(new Day(3, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4519));
477             t1.add(new Day(4, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4460));
478             t1.add(new Day(5, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4526));
479             t1.add(new Day(6, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4527));
480             t1.add(new Day(7, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4617));
481             t1.add(new Day(10, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4583));
482             t1.add(new Day(11, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4693));
483             t1.add(new Day(12, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4633));
484             t1.add(new Day(13, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4690));
485             t1.add(new Day(14, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4691));
486             t1.add(new Day(17, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4668));
487             t1.add(new Day(18, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4624));
488             t1.add(new Day(19, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4678));
489             t1.add(new Day(20, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4657));
490             t1.add(new Day(21, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4575));
491             t1.add(new Day(24, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4646));
492             t1.add(new Day(25, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4699));
493             t1.add(new Day(26, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4749));
494             t1.add(new Day(27, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4756));
495             t1.add(new Day(28, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.4699));
496             t1.add(new Day(1, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4784));
497             t1.add(new Day(2, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4661));
498             t1.add(new Day(3, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4767));
499             t1.add(new Day(4, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4770));
500             t1.add(new Day(5, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4810));
501             t1.add(new Day(8, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4743));
502             t1.add(new Day(9, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4667));
503             t1.add(new Day(10, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4505));
504             t1.add(new Day(11, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4434));
505             t1.add(new Day(12, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4504));
506             t1.add(new Day(15, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4471));
507             t1.add(new Day(16, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4474));
508             t1.add(new Day(17, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4512));
509             t1.add(new Day(18, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4445));
510             t1.add(new Day(19, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4384));
511             t1.add(new Day(22, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4275));
512             t1.add(new Day(23, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4212));
513             t1.add(new Day(24, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4233));
514             t1.add(new Day(25, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4297));
515             t1.add(new Day(26, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4328));
516             t1.add(new Day(29, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4515));
517             t1.add(new Day(30, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4564));
518             t1.add(new Day(31, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.4541));
519             t1.add(new Day(1, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4624));
520             t1.add(new Day(2, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4632));
521             t1.add(new Day(5, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4570));
522             t1.add(new Day(6, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4588));
523             t1.add(new Day(7, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4646));
524             t1.add(new Day(8, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4552));
525             t1.add(new Day(9, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4579));
526             t1.add(new Day(12, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4575));
527             t1.add(new Day(13, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4429));
528             t1.add(new Day(14, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4425));
529             t1.add(new Day(15, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4318));
530             t1.add(new Day(16, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4291));
531             t1.add(new Day(19, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4140));
532             t1.add(new Day(20, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4173));
533             t1.add(new Day(21, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4132));
534             t1.add(new Day(22, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4131));
535             t1.add(new Day(23, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4083));
536             t1.add(new Day(26, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4122));
537             t1.add(new Day(27, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4136));
538             t1.add(new Day(28, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4239));
539             t1.add(new Day(29, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4225));
540             t1.add(new Day(30, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.4260));
541         }
542         catch (Exception JavaDoc e) {
543             System.err.println(e.getMessage());
544         }
545         return t1;
546     }
547
548     /**
549      * Returns a time series of the daily EUR/GBP exchange rates in 2001 (to date), for use in
550      * the JFreeChart demonstration application.
551      * <P>
552      * You wouldn't normally create a time series in this way. Typically, values would
553      * be read from a database.
554      *
555      * @return a time series.
556      *
557      */

558     public static TimeSeries createEURTimeSeries() {
559
560         TimeSeries t1 = new TimeSeries("EUR/GBP");
561         try {
562             t1.add(new Day(2, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5788));
563             t1.add(new Day(3, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5913));
564             t1.add(new Day(4, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5807));
565             t1.add(new Day(5, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5711));
566             t1.add(new Day(8, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5778));
567             t1.add(new Day(9, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5851));
568             t1.add(new Day(10, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5846));
569             t1.add(new Day(11, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5727));
570             t1.add(new Day(12, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5585));
571             t1.add(new Day(15, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5694));
572             t1.add(new Day(16, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5629));
573             t1.add(new Day(17, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5831));
574             t1.add(new Day(18, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5624));
575             t1.add(new Day(19, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5694));
576             t1.add(new Day(22, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5615));
577             t1.add(new Day(23, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5656));
578             t1.add(new Day(24, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5795));
579             t1.add(new Day(25, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5852));
580             t1.add(new Day(26, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5797));
581             t1.add(new Day(29, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5862));
582             t1.add(new Day(30, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5803));
583             t1.add(new Day(31, MonthConstants.JANUARY, 2001), new Double JavaDoc(1.5714));
584             t1.add(new Day(1, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5717));
585             t1.add(new Day(2, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5735));
586             t1.add(new Day(5, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5691));
587             t1.add(new Day(6, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5676));
588             t1.add(new Day(7, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5677));
589             t1.add(new Day(8, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5737));
590             t1.add(new Day(9, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5654));
591             t1.add(new Day(12, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5621));
592             t1.add(new Day(13, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5761));
593             t1.add(new Day(14, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5898));
594             t1.add(new Day(15, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.6045));
595             t1.add(new Day(16, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5852));
596             t1.add(new Day(19, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5704));
597             t1.add(new Day(20, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5892));
598             t1.add(new Day(21, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5844));
599             t1.add(new Day(22, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5934));
600             t1.add(new Day(23, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5951));
601             t1.add(new Day(26, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5848));
602             t1.add(new Day(27, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5706));
603             t1.add(new Day(28, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(1.5680));
604             t1.add(new Day(1, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5645));
605             t1.add(new Day(2, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5754));
606             t1.add(new Day(5, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5808));
607             t1.add(new Day(6, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5766));
608             t1.add(new Day(7, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5756));
609             t1.add(new Day(8, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5760));
610             t1.add(new Day(9, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5748));
611             t1.add(new Day(12, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5779));
612             t1.add(new Day(13, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5837));
613             t1.add(new Day(14, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5886));
614             t1.add(new Day(15, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5931));
615             t1.add(new Day(16, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5945));
616             t1.add(new Day(19, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5880));
617             t1.add(new Day(20, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5817));
618             t1.add(new Day(21, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5927));
619             t1.add(new Day(22, MonthConstants.MARCH, 2001), new Double JavaDoc(1.6065));
620             t1.add(new Day(23, MonthConstants.MARCH, 2001), new Double JavaDoc(1.6006));
621             t1.add(new Day(26, MonthConstants.MARCH, 2001), new Double JavaDoc(1.6007));
622             t1.add(new Day(27, MonthConstants.MARCH, 2001), new Double JavaDoc(1.5989));
623             t1.add(new Day(28, MonthConstants.MARCH, 2001), new Double JavaDoc(1.6135));
624             t1.add(new Day(29, MonthConstants.MARCH, 2001), new Double JavaDoc(1.6282));
625             t1.add(new Day(30, MonthConstants.MARCH, 2001), new Double JavaDoc(1.6090));
626             t1.add(new Day(2, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6107));
627             t1.add(new Day(3, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6093));
628             t1.add(new Day(4, MonthConstants.APRIL, 2001), new Double JavaDoc(1.5880));
629             t1.add(new Day(5, MonthConstants.APRIL, 2001), new Double JavaDoc(1.5931));
630             t1.add(new Day(6, MonthConstants.APRIL, 2001), new Double JavaDoc(1.5968));
631             t1.add(new Day(9, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6072));
632             t1.add(new Day(10, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6167));
633             t1.add(new Day(11, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6214));
634             t1.add(new Day(12, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6120));
635             t1.add(new Day(17, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6229));
636             t1.add(new Day(18, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6298));
637             t1.add(new Day(19, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6159));
638             t1.add(new Day(20, MonthConstants.APRIL, 2001), new Double JavaDoc(1.5996));
639             t1.add(new Day(23, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6042));
640             t1.add(new Day(24, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6061));
641             t1.add(new Day(25, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6045));
642             t1.add(new Day(26, MonthConstants.APRIL, 2001), new Double JavaDoc(1.5970));
643             t1.add(new Day(27, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6095));
644             t1.add(new Day(30, MonthConstants.APRIL, 2001), new Double JavaDoc(1.6141));
645             t1.add(new Day(1, MonthConstants.MAY, 2001), new Double JavaDoc(1.6076));
646             t1.add(new Day(2, MonthConstants.MAY, 2001), new Double JavaDoc(1.6077));
647             t1.add(new Day(3, MonthConstants.MAY, 2001), new Double JavaDoc(1.6035));
648             t1.add(new Day(4, MonthConstants.MAY, 2001), new Double JavaDoc(1.6060));
649             t1.add(new Day(8, MonthConstants.MAY, 2001), new Double JavaDoc(1.6178));
650             t1.add(new Day(9, MonthConstants.MAY, 2001), new Double JavaDoc(1.6083));
651             t1.add(new Day(10, MonthConstants.MAY, 2001), new Double JavaDoc(1.6107));
652             t1.add(new Day(11, MonthConstants.MAY, 2001), new Double JavaDoc(1.6209));
653             t1.add(new Day(14, MonthConstants.MAY, 2001), new Double JavaDoc(1.6228));
654             t1.add(new Day(15, MonthConstants.MAY, 2001), new Double JavaDoc(1.6184));
655             t1.add(new Day(16, MonthConstants.MAY, 2001), new Double JavaDoc(1.6167));
656             t1.add(new Day(17, MonthConstants.MAY, 2001), new Double JavaDoc(1.6223));
657             t1.add(new Day(18, MonthConstants.MAY, 2001), new Double JavaDoc(1.6305));
658             t1.add(new Day(21, MonthConstants.MAY, 2001), new Double JavaDoc(1.6420));
659             t1.add(new Day(22, MonthConstants.MAY, 2001), new Double JavaDoc(1.6484));
660             t1.add(new Day(23, MonthConstants.MAY, 2001), new Double JavaDoc(1.6547));
661             t1.add(new Day(24, MonthConstants.MAY, 2001), new Double JavaDoc(1.6444));
662             t1.add(new Day(25, MonthConstants.MAY, 2001), new Double JavaDoc(1.6577));
663             t1.add(new Day(29, MonthConstants.MAY, 2001), new Double JavaDoc(1.6606));
664             t1.add(new Day(30, MonthConstants.MAY, 2001), new Double JavaDoc(1.6604));
665             t1.add(new Day(31, MonthConstants.MAY, 2001), new Double JavaDoc(1.6772));
666             t1.add(new Day(1, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6717));
667             t1.add(new Day(4, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6685));
668             t1.add(new Day(5, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6621));
669             t1.add(new Day(6, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6460));
670             t1.add(new Day(7, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6333));
671             t1.add(new Day(8, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6265));
672             t1.add(new Day(11, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6311));
673             t1.add(new Day(12, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6238));
674             t1.add(new Day(13, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6300));
675             t1.add(new Day(14, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6289));
676             t1.add(new Day(15, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6276));
677             t1.add(new Day(18, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6299));
678             t1.add(new Day(19, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6353));
679             t1.add(new Day(20, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6378));
680             t1.add(new Day(21, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6567));
681             t1.add(new Day(22, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6523));
682             t1.add(new Day(25, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6418));
683             t1.add(new Day(26, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6429));
684             t1.add(new Day(27, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6439));
685             t1.add(new Day(28, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6605));
686             t1.add(new Day(29, MonthConstants.JUNE, 2001), new Double JavaDoc(1.6599));
687             t1.add(new Day(2, MonthConstants.JULY, 2001), new Double JavaDoc(1.6727));
688             t1.add(new Day(3, MonthConstants.JULY, 2001), new Double JavaDoc(1.6620));
689             t1.add(new Day(4, MonthConstants.JULY, 2001), new Double JavaDoc(1.6628));
690             t1.add(new Day(5, MonthConstants.JULY, 2001), new Double JavaDoc(1.6730));
691             t1.add(new Day(6, MonthConstants.JULY, 2001), new Double JavaDoc(1.6649));
692             t1.add(new Day(9, MonthConstants.JULY, 2001), new Double JavaDoc(1.6603));
693             t1.add(new Day(10, MonthConstants.JULY, 2001), new Double JavaDoc(1.6489));
694             t1.add(new Day(11, MonthConstants.JULY, 2001), new Double JavaDoc(1.6421));
695             t1.add(new Day(12, MonthConstants.JULY, 2001), new Double JavaDoc(1.6498));
696             t1.add(new Day(13, MonthConstants.JULY, 2001), new Double JavaDoc(1.6447));
697             t1.add(new Day(16, MonthConstants.JULY, 2001), new Double JavaDoc(1.6373));
698             t1.add(new Day(17, MonthConstants.JULY, 2001), new Double JavaDoc(1.6443));
699             t1.add(new Day(18, MonthConstants.JULY, 2001), new Double JavaDoc(1.6246));
700             t1.add(new Day(19, MonthConstants.JULY, 2001), new Double JavaDoc(1.6295));
701             t1.add(new Day(20, MonthConstants.JULY, 2001), new Double JavaDoc(1.6362));
702             t1.add(new Day(23, MonthConstants.JULY, 2001), new Double JavaDoc(1.6348));
703             t1.add(new Day(24, MonthConstants.JULY, 2001), new Double JavaDoc(1.6242));
704             t1.add(new Day(25, MonthConstants.JULY, 2001), new Double JavaDoc(1.6241));
705             t1.add(new Day(26, MonthConstants.JULY, 2001), new Double JavaDoc(1.6281));
706             t1.add(new Day(27, MonthConstants.JULY, 2001), new Double JavaDoc(1.6296));
707             t1.add(new Day(30, MonthConstants.JULY, 2001), new Double JavaDoc(1.6279));
708             t1.add(new Day(31, MonthConstants.JULY, 2001), new Double JavaDoc(1.6300));
709             t1.add(new Day(1, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.6290));
710             t1.add(new Day(2, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.6237));
711             t1.add(new Day(3, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.6138));
712             t1.add(new Day(6, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.6121));
713             t1.add(new Day(7, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.6170));
714             t1.add(new Day(8, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.6135));
715             t1.add(new Day(9, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5996));
716             t1.add(new Day(10, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5931));
717             t1.add(new Day(13, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5828));
718             t1.add(new Day(14, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5824));
719             t1.add(new Day(15, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5783));
720             t1.add(new Day(16, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5810));
721             t1.add(new Day(17, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5761));
722             t1.add(new Day(20, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5831));
723             t1.add(new Day(21, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5870));
724             t1.add(new Day(22, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5808));
725             t1.add(new Day(23, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5845));
726             t1.add(new Day(24, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5844));
727             t1.add(new Day(28, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5924));
728             t1.add(new Day(29, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5950));
729             t1.add(new Day(30, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5941));
730             t1.add(new Day(31, MonthConstants.AUGUST, 2001), new Double JavaDoc(1.5968));
731             t1.add(new Day(3, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6020));
732             t1.add(new Day(4, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6236));
733             t1.add(new Day(5, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6352));
734             t1.add(new Day(6, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6302));
735             t1.add(new Day(7, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6180));
736             t1.add(new Day(10, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6218));
737             t1.add(new Day(11, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6182));
738             t1.add(new Day(12, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6157));
739             t1.add(new Day(13, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6171));
740             t1.add(new Day(14, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.5960));
741             t1.add(new Day(17, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.5952));
742             t1.add(new Day(18, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.5863));
743             t1.add(new Day(19, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.5790));
744             t1.add(new Day(20, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.5811));
745             t1.add(new Day(21, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.5917));
746             t1.add(new Day(24, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6005));
747             t1.add(new Day(25, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.5915));
748             t1.add(new Day(26, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6012));
749             t1.add(new Day(27, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6032));
750             t1.add(new Day(28, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(1.6133));
751             t1.add(new Day(1, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6147));
752             t1.add(new Day(2, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6002));
753             t1.add(new Day(3, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6041));
754             t1.add(new Day(4, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6172));
755             t1.add(new Day(5, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6121));
756             t1.add(new Day(8, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6044));
757             t1.add(new Day(9, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.5974));
758             t1.add(new Day(10, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.5915));
759             t1.add(new Day(11, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6022));
760             t1.add(new Day(12, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6014));
761             t1.add(new Day(15, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.5942));
762             t1.add(new Day(16, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.5925));
763             t1.add(new Day(17, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6007));
764             t1.add(new Day(18, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6000));
765             t1.add(new Day(19, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6030));
766             t1.add(new Day(22, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6014));
767             t1.add(new Day(23, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.5995));
768             t1.add(new Day(24, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.5951));
769             t1.add(new Day(25, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.5953));
770             t1.add(new Day(26, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6057));
771             t1.add(new Day(29, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6051));
772             t1.add(new Day(30, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6027));
773             t1.add(new Day(31, MonthConstants.OCTOBER, 2001), new Double JavaDoc(1.6144));
774             t1.add(new Day(1, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6139));
775             t1.add(new Day(2, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6189));
776             t1.add(new Day(5, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6248));
777             t1.add(new Day(6, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6267));
778             t1.add(new Day(7, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6281));
779             t1.add(new Day(8, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6310));
780             t1.add(new Day(9, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6313));
781             t1.add(new Day(12, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6272));
782             t1.add(new Day(13, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6361));
783             t1.add(new Day(14, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6323));
784             t1.add(new Day(15, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6252));
785             t1.add(new Day(16, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6141));
786             t1.add(new Day(19, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6086));
787             t1.add(new Day(20, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6055));
788             t1.add(new Day(21, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6132));
789             t1.add(new Day(22, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6074));
790             t1.add(new Day(23, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6065));
791             t1.add(new Day(26, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6061));
792             t1.add(new Day(27, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6039));
793             t1.add(new Day(28, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6069));
794             t1.add(new Day(29, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.6044));
795             t1.add(new Day(30, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(1.5928));
796         }
797         catch (Exception JavaDoc e) {
798             System.err.println(e.getMessage());
799         }
800         return t1;
801     }
802
803     /**
804      * Returns a time series of the daily EUR/GBP exchange rates in 2001 (to date), for use in
805      * the JFreeChart demonstration application.
806      * <P>
807      * You wouldn't normally create a time series in this way. Typically, values would
808      * be read from a database.
809      *
810      * @return a sample time series.
811      */

812     public static TimeSeries createJPYTimeSeries() {
813
814         TimeSeries t1 = new TimeSeries("JPY/GBP Exchange Rate");
815         try {
816             t1.add(new Day(2, MonthConstants.JANUARY, 2001), new Double JavaDoc(171.2612));
817             t1.add(new Day(3, MonthConstants.JANUARY, 2001), new Double JavaDoc(172.1076));
818             t1.add(new Day(4, MonthConstants.JANUARY, 2001), new Double JavaDoc(172.3485));
819             t1.add(new Day(5, MonthConstants.JANUARY, 2001), new Double JavaDoc(173.7023));
820             t1.add(new Day(8, MonthConstants.JANUARY, 2001), new Double JavaDoc(174.1253));
821             t1.add(new Day(9, MonthConstants.JANUARY, 2001), new Double JavaDoc(173.6386));
822             t1.add(new Day(10, MonthConstants.JANUARY, 2001), new Double JavaDoc(173.2623));
823             t1.add(new Day(11, MonthConstants.JANUARY, 2001), new Double JavaDoc(175.7319));
824             t1.add(new Day(12, MonthConstants.JANUARY, 2001), new Double JavaDoc(174.2442));
825             t1.add(new Day(15, MonthConstants.JANUARY, 2001), new Double JavaDoc(175.7583));
826             t1.add(new Day(16, MonthConstants.JANUARY, 2001), new Double JavaDoc(173.0719));
827             t1.add(new Day(17, MonthConstants.JANUARY, 2001), new Double JavaDoc(173.0805));
828             t1.add(new Day(18, MonthConstants.JANUARY, 2001), new Double JavaDoc(174.1975));
829             t1.add(new Day(19, MonthConstants.JANUARY, 2001), new Double JavaDoc(172.3138));
830             t1.add(new Day(22, MonthConstants.JANUARY, 2001), new Double JavaDoc(170.5016));
831             t1.add(new Day(23, MonthConstants.JANUARY, 2001), new Double JavaDoc(172.1836));
832             t1.add(new Day(24, MonthConstants.JANUARY, 2001), new Double JavaDoc(172.2154));
833             t1.add(new Day(25, MonthConstants.JANUARY, 2001), new Double JavaDoc(170.1515));
834             t1.add(new Day(26, MonthConstants.JANUARY, 2001), new Double JavaDoc(170.3728));
835             t1.add(new Day(29, MonthConstants.JANUARY, 2001), new Double JavaDoc(170.2911));
836             t1.add(new Day(30, MonthConstants.JANUARY, 2001), new Double JavaDoc(170.3995));
837             t1.add(new Day(31, MonthConstants.JANUARY, 2001), new Double JavaDoc(169.9110));
838             t1.add(new Day(1, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(170.4084));
839             t1.add(new Day(2, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(169.8845));
840             t1.add(new Day(5, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(169.5120));
841             t1.add(new Day(6, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(167.9429));
842             t1.add(new Day(7, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(169.6096));
843             t1.add(new Day(8, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(167.8282));
844             t1.add(new Day(9, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(170.1427));
845             t1.add(new Day(12, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(170.8250));
846             t1.add(new Day(13, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(170.4005));
847             t1.add(new Day(14, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(170.1455));
848             t1.add(new Day(15, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(167.6925));
849             t1.add(new Day(16, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(167.6133));
850             t1.add(new Day(19, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(167.7099));
851             t1.add(new Day(20, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(166.9004));
852             t1.add(new Day(21, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(168.4231));
853             t1.add(new Day(22, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(168.3292));
854             t1.add(new Day(23, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(168.6142));
855             t1.add(new Day(26, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(168.2608));
856             t1.add(new Day(27, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(167.6325));
857             t1.add(new Day(28, MonthConstants.FEBRUARY, 2001), new Double JavaDoc(169.1728));
858             t1.add(new Day(1, MonthConstants.MARCH, 2001), new Double JavaDoc(170.5199));
859             t1.add(new Day(2, MonthConstants.MARCH, 2001), new Double JavaDoc(175.5211));
860             t1.add(new Day(5, MonthConstants.MARCH, 2001), new Double JavaDoc(174.9543));
861             t1.add(new Day(6, MonthConstants.MARCH, 2001), new Double JavaDoc(174.4053));
862             t1.add(new Day(7, MonthConstants.MARCH, 2001), new Double JavaDoc(175.1675));
863             t1.add(new Day(8, MonthConstants.MARCH, 2001), new Double JavaDoc(175.7501));
864             t1.add(new Day(9, MonthConstants.MARCH, 2001), new Double JavaDoc(175.5956));
865             t1.add(new Day(12, MonthConstants.MARCH, 2001), new Double JavaDoc(176.6677));
866             t1.add(new Day(13, MonthConstants.MARCH, 2001), new Double JavaDoc(174.4282));
867             t1.add(new Day(14, MonthConstants.MARCH, 2001), new Double JavaDoc(175.1140));
868             t1.add(new Day(15, MonthConstants.MARCH, 2001), new Double JavaDoc(175.8914));
869             t1.add(new Day(16, MonthConstants.MARCH, 2001), new Double JavaDoc(175.7124));
870             t1.add(new Day(19, MonthConstants.MARCH, 2001), new Double JavaDoc(174.2307));
871             t1.add(new Day(20, MonthConstants.MARCH, 2001), new Double JavaDoc(175.0382));
872             t1.add(new Day(21, MonthConstants.MARCH, 2001), new Double JavaDoc(176.1183));
873             t1.add(new Day(22, MonthConstants.MARCH, 2001), new Double JavaDoc(176.2646));
874             t1.add(new Day(23, MonthConstants.MARCH, 2001), new Double JavaDoc(175.3608));
875             t1.add(new Day(26, MonthConstants.MARCH, 2001), new Double JavaDoc(176.5805));
876             t1.add(new Day(27, MonthConstants.MARCH, 2001), new Double JavaDoc(176.8495));
877             t1.add(new Day(28, MonthConstants.MARCH, 2001), new Double JavaDoc(174.7895));
878             t1.add(new Day(29, MonthConstants.MARCH, 2001), new Double JavaDoc(176.6957));
879             t1.add(new Day(30, MonthConstants.MARCH, 2001), new Double JavaDoc(178.1106));
880             t1.add(new Day(2, MonthConstants.APRIL, 2001), new Double JavaDoc(179.5654));
881             t1.add(new Day(3, MonthConstants.APRIL, 2001), new Double JavaDoc(179.7021));
882             t1.add(new Day(4, MonthConstants.APRIL, 2001), new Double JavaDoc(179.5065));
883             t1.add(new Day(5, MonthConstants.APRIL, 2001), new Double JavaDoc(177.9874));
884             t1.add(new Day(6, MonthConstants.APRIL, 2001), new Double JavaDoc(178.3541));
885             t1.add(new Day(9, MonthConstants.APRIL, 2001), new Double JavaDoc(181.0301));
886             t1.add(new Day(10, MonthConstants.APRIL, 2001), new Double JavaDoc(179.0357));
887             t1.add(new Day(11, MonthConstants.APRIL, 2001), new Double JavaDoc(178.8478));
888             t1.add(new Day(12, MonthConstants.APRIL, 2001), new Double JavaDoc(177.7927));
889             t1.add(new Day(17, MonthConstants.APRIL, 2001), new Double JavaDoc(177.1644));
890             t1.add(new Day(18, MonthConstants.APRIL, 2001), new Double JavaDoc(174.1972));
891             t1.add(new Day(19, MonthConstants.APRIL, 2001), new Double JavaDoc(174.9370));
892             t1.add(new Day(20, MonthConstants.APRIL, 2001), new Double JavaDoc(176.8555));
893             t1.add(new Day(23, MonthConstants.APRIL, 2001), new Double JavaDoc(175.3433));
894             t1.add(new Day(24, MonthConstants.APRIL, 2001), new Double JavaDoc(175.4792));
895             t1.add(new Day(25, MonthConstants.APRIL, 2001), new Double JavaDoc(175.7154));
896             t1.add(new Day(26, MonthConstants.APRIL, 2001), new Double JavaDoc(176.1797));
897             t1.add(new Day(27, MonthConstants.APRIL, 2001), new Double JavaDoc(177.7074));
898             t1.add(new Day(30, MonthConstants.APRIL, 2001), new Double JavaDoc(176.8592));
899             t1.add(new Day(1, MonthConstants.MAY, 2001), new Double JavaDoc(174.9104));
900             t1.add(new Day(2, MonthConstants.MAY, 2001), new Double JavaDoc(174.8992));
901             t1.add(new Day(3, MonthConstants.MAY, 2001), new Double JavaDoc(173.4239));
902             t1.add(new Day(4, MonthConstants.MAY, 2001), new Double JavaDoc(173.9663));
903             t1.add(new Day(8, MonthConstants.MAY, 2001), new Double JavaDoc(174.4871));
904             t1.add(new Day(9, MonthConstants.MAY, 2001), new Double JavaDoc(173.6851));
905             t1.add(new Day(10, MonthConstants.MAY, 2001), new Double JavaDoc(174.5957));
906             t1.add(new Day(11, MonthConstants.MAY, 2001), new Double JavaDoc(173.6254));
907             t1.add(new Day(14, MonthConstants.MAY, 2001), new Double JavaDoc(174.7913));
908             t1.add(new Day(15, MonthConstants.MAY, 2001), new Double JavaDoc(175.3932));
909             t1.add(new Day(16, MonthConstants.MAY, 2001), new Double JavaDoc(176.7291));
910             t1.add(new Day(17, MonthConstants.MAY, 2001), new Double JavaDoc(175.8551));
911             t1.add(new Day(18, MonthConstants.MAY, 2001), new Double JavaDoc(176.8558));
912             t1.add(new Day(21, MonthConstants.MAY, 2001), new Double JavaDoc(176.6443));
913             t1.add(new Day(22, MonthConstants.MAY, 2001), new Double JavaDoc(175.1953));
914             t1.add(new Day(23, MonthConstants.MAY, 2001), new Double JavaDoc(171.6117));
915             t1.add(new Day(24, MonthConstants.MAY, 2001), new Double JavaDoc(169.0407));
916             t1.add(new Day(25, MonthConstants.MAY, 2001), new Double JavaDoc(171.3975));
917             t1.add(new Day(29, MonthConstants.MAY, 2001), new Double JavaDoc(170.2811));
918             t1.add(new Day(30, MonthConstants.MAY, 2001), new Double JavaDoc(171.2154));
919             t1.add(new Day(31, MonthConstants.MAY, 2001), new Double JavaDoc(168.6795));
920             t1.add(new Day(1, MonthConstants.JUNE, 2001), new Double JavaDoc(168.2339));
921             t1.add(new Day(4, MonthConstants.JUNE, 2001), new Double JavaDoc(169.2090));
922             t1.add(new Day(5, MonthConstants.JUNE, 2001), new Double JavaDoc(169.4501));
923             t1.add(new Day(6, MonthConstants.JUNE, 2001), new Double JavaDoc(167.8414));
924             t1.add(new Day(7, MonthConstants.JUNE, 2001), new Double JavaDoc(166.6042));
925             t1.add(new Day(8, MonthConstants.JUNE, 2001), new Double JavaDoc(166.5005));
926             t1.add(new Day(11, MonthConstants.JUNE, 2001), new Double JavaDoc(167.2925));
927             t1.add(new Day(12, MonthConstants.JUNE, 2001), new Double JavaDoc(168.1171));
928             t1.add(new Day(13, MonthConstants.JUNE, 2001), new Double JavaDoc(168.9091));
929             t1.add(new Day(14, MonthConstants.JUNE, 2001), new Double JavaDoc(169.8863));
930             t1.add(new Day(15, MonthConstants.JUNE, 2001), new Double JavaDoc(171.5254));
931             t1.add(new Day(18, MonthConstants.JUNE, 2001), new Double JavaDoc(172.6955));
932             t1.add(new Day(19, MonthConstants.JUNE, 2001), new Double JavaDoc(172.3427));
933             t1.add(new Day(20, MonthConstants.JUNE, 2001), new Double JavaDoc(172.0421));
934             t1.add(new Day(21, MonthConstants.JUNE, 2001), new Double JavaDoc(175.9830));
935             t1.add(new Day(22, MonthConstants.JUNE, 2001), new Double JavaDoc(175.5076));
936             t1.add(new Day(25, MonthConstants.JUNE, 2001), new Double JavaDoc(175.1080));
937             t1.add(new Day(26, MonthConstants.JUNE, 2001), new Double JavaDoc(175.5043));
938             t1.add(new Day(27, MonthConstants.JUNE, 2001), new Double JavaDoc(175.3712));
939             t1.add(new Day(28, MonthConstants.JUNE, 2001), new Double JavaDoc(175.9575));
940             t1.add(new Day(29, MonthConstants.JUNE, 2001), new Double JavaDoc(175.4734));
941             t1.add(new Day(2, MonthConstants.JULY, 2001), new Double JavaDoc(175.9908));
942             t1.add(new Day(3, MonthConstants.JULY, 2001), new Double JavaDoc(175.2386));
943             t1.add(new Day(4, MonthConstants.JULY, 2001), new Double JavaDoc(175.0405));
944             t1.add(new Day(5, MonthConstants.JULY, 2001), new Double JavaDoc(175.9451));
945             t1.add(new Day(6, MonthConstants.JULY, 2001), new Double JavaDoc(177.3383));
946             t1.add(new Day(9, MonthConstants.JULY, 2001), new Double JavaDoc(176.6965));
947             t1.add(new Day(10, MonthConstants.JULY, 2001), new Double JavaDoc(177.0476));
948             t1.add(new Day(11, MonthConstants.JULY, 2001), new Double JavaDoc(175.6136));
949             t1.add(new Day(12, MonthConstants.JULY, 2001), new Double JavaDoc(174.1736));
950             t1.add(new Day(13, MonthConstants.JULY, 2001), new Double JavaDoc(174.8619));
951             t1.add(new Day(16, MonthConstants.JULY, 2001), new Double JavaDoc(175.4915));
952             t1.add(new Day(17, MonthConstants.JULY, 2001), new Double JavaDoc(175.1916));
953             t1.add(new Day(18, MonthConstants.JULY, 2001), new Double JavaDoc(176.0599));
954             t1.add(new Day(19, MonthConstants.JULY, 2001), new Double JavaDoc(174.8244));
955             t1.add(new Day(20, MonthConstants.JULY, 2001), new Double JavaDoc(175.8257));
956             t1.add(new Day(23, MonthConstants.JULY, 2001), new Double JavaDoc(176.2682));
957             t1.add(new Day(24, MonthConstants.JULY, 2001), new Double JavaDoc(176.1794));
958             t1.add(new Day(25, MonthConstants.JULY, 2001), new Double JavaDoc(176.4514));
959             t1.add(new Day(26, MonthConstants.JULY, 2001), new Double JavaDoc(176.7673));
960             t1.add(new Day(27, MonthConstants.JULY, 2001), new Double JavaDoc(176.1476));
961             t1.add(new Day(30, MonthConstants.JULY, 2001), new Double JavaDoc(178.3029));
962             t1.add(new Day(31, MonthConstants.JULY, 2001), new Double JavaDoc(178.0895));
963             t1.add(new Day(1, MonthConstants.AUGUST, 2001), new Double JavaDoc(178.6438));
964             t1.add(new Day(2, MonthConstants.AUGUST, 2001), new Double JavaDoc(177.1364));
965             t1.add(new Day(3, MonthConstants.AUGUST, 2001), new Double JavaDoc(176.4042));
966             t1.add(new Day(6, MonthConstants.AUGUST, 2001), new Double JavaDoc(175.7999));
967             t1.add(new Day(7, MonthConstants.AUGUST, 2001), new Double JavaDoc(175.5131));
968             t1.add(new Day(8, MonthConstants.AUGUST, 2001), new Double JavaDoc(173.9804));
969             t1.add(new Day(9, MonthConstants.AUGUST, 2001), new Double JavaDoc(174.9459));
970             t1.add(new Day(10, MonthConstants.AUGUST, 2001), new Double JavaDoc(173.8883));
971             t1.add(new Day(13, MonthConstants.AUGUST, 2001), new Double JavaDoc(173.8253));
972             t1.add(new Day(14, MonthConstants.AUGUST, 2001), new Double JavaDoc(173.0352));
973             t1.add(new Day(15, MonthConstants.AUGUST, 2001), new Double JavaDoc(172.4666));
974             t1.add(new Day(16, MonthConstants.AUGUST, 2001), new Double JavaDoc(173.4173));
975             t1.add(new Day(17, MonthConstants.AUGUST, 2001), new Double JavaDoc(173.6289));
976             t1.add(new Day(20, MonthConstants.AUGUST, 2001), new Double JavaDoc(174.3824));
977             t1.add(new Day(21, MonthConstants.AUGUST, 2001), new Double JavaDoc(173.5063));
978             t1.add(new Day(22, MonthConstants.AUGUST, 2001), new Double JavaDoc(174.3372));
979             t1.add(new Day(23, MonthConstants.AUGUST, 2001), new Double JavaDoc(173.8620));
980             t1.add(new Day(24, MonthConstants.AUGUST, 2001), new Double JavaDoc(173.5825));
981             t1.add(new Day(28, MonthConstants.AUGUST, 2001), new Double JavaDoc(174.7664));
982             t1.add(new Day(29, MonthConstants.AUGUST, 2001), new Double JavaDoc(173.5166));
983             t1.add(new Day(30, MonthConstants.AUGUST, 2001), new Double JavaDoc(173.8555));
984             t1.add(new Day(31, MonthConstants.AUGUST, 2001), new Double JavaDoc(172.6675));
985             t1.add(new Day(3, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(172.3986));
986             t1.add(new Day(4, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(171.8860));
987             t1.add(new Day(5, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(174.8640));
988             t1.add(new Day(6, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(176.1399));
989             t1.add(new Day(7, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(175.7110));
990             t1.add(new Day(10, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(176.3085));
991             t1.add(new Day(11, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(174.6263));
992             t1.add(new Day(12, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(174.8058));
993             t1.add(new Day(13, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(174.8257));
994             t1.add(new Day(14, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(172.3107));
995             t1.add(new Day(17, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(172.5397));
996             t1.add(new Day(18, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(171.7004));
997             t1.add(new Day(19, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(172.1289));
998             t1.add(new Day(20, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(170.3143));
999             t1.add(new Day(21, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(169.9737));
1000            t1.add(new Day(24, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(172.0319));
1001            t1.add(new Day(25, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(172.5516));
1002            t1.add(new Day(26, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(173.8612));
1003            t1.add(new Day(27, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(176.5408));
1004            t1.add(new Day(28, MonthConstants.SEPTEMBER, 2001), new Double JavaDoc(175.1092));
1005            t1.add(new Day(1, MonthConstants.OCTOBER, 2001), new Double JavaDoc(177.6150));
1006            t1.add(new Day(2, MonthConstants.OCTOBER, 2001), new Double JavaDoc(177.1049));
1007            t1.add(new Day(3, MonthConstants.OCTOBER, 2001), new Double JavaDoc(178.2525));
1008            t1.add(new Day(4, MonthConstants.OCTOBER, 2001), new Double JavaDoc(178.0819));
1009            t1.add(new Day(5, MonthConstants.OCTOBER, 2001), new Double JavaDoc(178.1643));
1010            t1.add(new Day(8, MonthConstants.OCTOBER, 2001), new Double JavaDoc(176.6654));
1011            t1.add(new Day(9, MonthConstants.OCTOBER, 2001), new Double JavaDoc(176.0773));
1012            t1.add(new Day(10, MonthConstants.OCTOBER, 2001), new Double JavaDoc(174.4806));
1013            t1.add(new Day(11, MonthConstants.OCTOBER, 2001), new Double JavaDoc(175.1855));
1014            t1.add(new Day(12, MonthConstants.OCTOBER, 2001), new Double JavaDoc(176.1221));
1015            t1.add(new Day(15, MonthConstants.OCTOBER, 2001), new Double JavaDoc(175.1425));
1016            t1.add(new Day(16, MonthConstants.OCTOBER, 2001), new Double JavaDoc(175.4683));
1017            t1.add(new Day(17, MonthConstants.OCTOBER, 2001), new Double JavaDoc(175.4936));
1018            t1.add(new Day(18, MonthConstants.OCTOBER, 2001), new Double JavaDoc(174.8134));
1019            t1.add(new Day(19, MonthConstants.OCTOBER, 2001), new Double JavaDoc(174.4492));
1020            t1.add(new Day(22, MonthConstants.OCTOBER, 2001), new Double JavaDoc(174.1978));
1021            t1.add(new Day(23, MonthConstants.OCTOBER, 2001), new Double JavaDoc(174.8360));
1022            t1.add(new Day(24, MonthConstants.OCTOBER, 2001), new Double JavaDoc(174.9378));
1023            t1.add(new Day(25, MonthConstants.OCTOBER, 2001), new Double JavaDoc(175.4385));
1024            t1.add(new Day(26, MonthConstants.OCTOBER, 2001), new Double JavaDoc(176.4207));
1025            t1.add(new Day(29, MonthConstants.OCTOBER, 2001), new Double JavaDoc(177.0540));
1026            t1.add(new Day(30, MonthConstants.OCTOBER, 2001), new Double JavaDoc(177.1128));
1027            t1.add(new Day(31, MonthConstants.OCTOBER, 2001), new Double JavaDoc(177.9818));
1028            t1.add(new Day(1, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(177.9595));
1029            t1.add(new Day(2, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(177.9251));
1030            t1.add(new Day(5, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(177.2003));
1031            t1.add(new Day(6, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(176.6169));
1032            t1.add(new Day(7, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(177.3191));
1033            t1.add(new Day(8, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.7736));
1034            t1.add(new Day(9, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.2104));
1035            t1.add(new Day(12, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.0749));
1036            t1.add(new Day(13, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.2402));
1037            t1.add(new Day(14, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.3503));
1038            t1.add(new Day(15, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.2810));
1039            t1.add(new Day(16, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.4077));
1040            t1.add(new Day(19, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(174.3462));
1041            t1.add(new Day(20, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(173.8177));
1042            t1.add(new Day(21, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(174.0356));
1043            t1.add(new Day(22, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.0548));
1044            t1.add(new Day(23, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.2207));
1045            t1.add(new Day(26, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.4978));
1046            t1.add(new Day(27, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.2191));
1047            t1.add(new Day(28, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.4236));
1048            t1.add(new Day(29, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(176.2304));
1049            t1.add(new Day(30, MonthConstants.NOVEMBER, 2001), new Double JavaDoc(175.6119)); }
1050        catch (Exception JavaDoc e) {
1051            System.err.println(e.getMessage());
1052        }
1053        return t1;
1054    }
1055
1056    /**
1057     * Returns a sample signal dataset.
1058     *
1059     * @return a sample signal dataset.
1060     */

1061    public static SignalsDataset createSampleSignalDataset() {
1062        return new SampleSignalDataset();
1063    }
1064
1065    /**
1066     * Creates a sample high low dataset.
1067     *
1068     * @return a sample high low dataset.
1069     */

1070    public static HighLowDataset createHighLowDataset() {
1071
1072        Date JavaDoc[] date = new Date JavaDoc[47];
1073        double[] high = new double[47];
1074        double[] low = new double[47];
1075        double[] open = new double[47];
1076        double[] close = new double[47];
1077        double[] volume = new double[47];
1078
1079        int jan = 1;
1080        int feb = 2;
1081
1082        date[0] = DateUtilities.createDate(2001, jan, 4, 12, 0);
1083        high[0] = 47.0;
1084        low[0] = 33.0;
1085        open[0] = 35.0;
1086        close[0] = 33.0;
1087        volume[0] = 100.0;
1088
1089        date[1] = DateUtilities.createDate(2001, jan, 5, 12, 0);
1090        high[1] = 47.0;
1091        low[1] = 32.0;
1092        open[1] = 41.0;
1093        close[1] = 37.0;
1094        volume[1] = 150.0;
1095
1096        date[2] = DateUtilities.createDate(2001, jan, 6, 12, 0);
1097        high[2] = 49.0;
1098        low[2] = 43.0;
1099        open[2] = 46.0;
1100        close[2] = 48.0;
1101        volume[2] = 70.0;
1102
1103        date[3] = DateUtilities.createDate(2001, jan, 7, 12, 0);
1104        high[3] = 51.0;
1105        low[3] = 39.0;
1106        open[3] = 40.0;
1107        close[3] = 47.0;
1108        volume[3] = 200.0;
1109
1110        date[4] = DateUtilities.createDate(2001, jan, 8, 12, 0);
1111        high[4] = 60.0;
1112        low[4] = 40.0;
1113        open[4] = 46.0;
1114        close[4] = 53.0;
1115        volume[4] = 120.0;
1116
1117        date[5] = DateUtilities.createDate(2001, jan, 9, 12, 0);
1118        high[5] = 62.0;
1119        low[5] = 55.0;
1120        open[5] = 57.0;
1121        close[5] = 61.0;
1122        volume[5] = 110.0;
1123
1124        date[6] = DateUtilities.createDate(2001, jan, 10, 12, 0);
1125        high[6] = 65.0;
1126        low[6] = 56.0;
1127        open[6] = 62.0;
1128        close[6] = 59.0;
1129        volume[6] = 70.0;
1130
1131        date[7] = DateUtilities.createDate(2001, jan, 11, 12, 0);
1132        high[7] = 55.0;
1133        low[7] = 43.0;
1134        open[7] = 45.0;
1135        close[7] = 47.0;
1136        volume[7] = 20.0;
1137
1138        date[8] = DateUtilities.createDate(2001, jan, 12, 12, 0);
1139        high[8] = 54.0;
1140        low[8] = 33.0;
1141        open[8] = 40.0;
1142        close[8] = 51.0;
1143        volume[8] = 30.0;
1144
1145        date[9] = DateUtilities.createDate(2001, jan, 13, 12, 0);
1146        high[9] = 47.0;
1147        low[9] = 33.0;
1148        open[9] = 35.0;
1149        close[9] = 33.0;
1150        volume[9] = 100.0;
1151
1152        date[10] = DateUtilities.createDate(2001, jan, 14, 12, 0);
1153        high[10] = 54.0;
1154        low[10] = 38.0;
1155        open[10] = 43.0;
1156        close[10] = 52.0;
1157        volume[10] = 50.0;
1158
1159        date[11] = DateUtilities.createDate(2001, jan, 15, 12, 0);
1160        high[11] = 48.0;
1161        low[11] = 41.0;
1162        open[11] = 44.0;
1163        close[11] = 41.0;
1164        volume[11] = 80.0;
1165
1166        date[12] = DateUtilities.createDate(2001, jan, 17, 12, 0);
1167        high[12] = 60.0;
1168        low[12] = 30.0;
1169        open[12] = 34.0;
1170        close[12] = 44.0;
1171        volume[12] = 90.0;
1172
1173        date[13] = DateUtilities.createDate(2001, jan, 18, 12, 0);
1174        high[13] = 58.0;
1175        low[13] = 44.0;
1176        open[13] = 54.0;
1177        close[13] = 56.0;
1178        volume[13] = 20.0;
1179
1180        date[14] = DateUtilities.createDate(2001, jan, 19, 12, 0);
1181        high[14] = 54.0;
1182        low[14] = 32.0;
1183        open[14] = 42.0;
1184        close[14] = 53.0;
1185        volume[14] = 70.0;
1186
1187        date[15] = DateUtilities.createDate(2001, jan, 20, 12, 0);
1188        high[15] = 53.0;
1189        low[15] = 39.0;
1190        open[15] = 50.0;
1191        close[15] = 49.0;
1192        volume[15] = 60.0;
1193
1194        date[16] = DateUtilities.createDate(2001, jan, 21, 12, 0);
1195        high[16] = 47.0;
1196        low[16] = 33.0;
1197        open[16] = 41.0;
1198        close[16] = 40.0;
1199        volume[16] = 30.0;
1200
1201        date[17] = DateUtilities.createDate(2001, jan, 22, 12, 0);
1202        high[17] = 55.0;
1203        low[17] = 37.0;
1204        open[17] = 43.0;
1205        close[17] = 45.0;
1206        volume[17] = 90.0;
1207
1208        date[18] = DateUtilities.createDate(2001, jan, 23, 12, 0);
1209        high[18] = 54.0;
1210        low[18] = 42.0;
1211        open[18] = 50.0;
1212        close[18] = 42.0;
1213        volume[18] = 150.0;
1214
1215        date[19] = DateUtilities.createDate(2001, jan, 24, 12, 0);
1216        high[19] = 48.0;
1217        low[19] = 37.0;
1218        open[19] = 37.0;
1219        close[19] = 47.0;
1220        volume[19] = 120.0;
1221
1222        date[20] = DateUtilities.createDate(2001, jan, 25, 12, 0);
1223        high[20] = 58.0;
1224        low[20] = 33.0;
1225        open[20] = 39.0;
1226        close[20] = 41.0;
1227        volume[20] = 80.0;
1228
1229        date[21] = DateUtilities.createDate(2001, jan, 26, 12, 0);
1230        high[21] = 47.0;
1231        low[21] = 31.0;
1232        open[21] = 36.0;
1233        close[21] = 41.0;
1234        volume[21] = 40.0;
1235
1236        date[22] = DateUtilities.createDate(2001, jan, 27, 12, 0);
1237        high[22] = 58.0;
1238        low[22] = 44.0;
1239        open[22] = 49.0;
1240        close[22] = 44.0;
1241        volume[22] = 20.0;
1242
1243        date[23] = DateUtilities.createDate(2001, jan, 28, 12, 0);
1244        high[23] = 46.0;
1245        low[23] = 41.0;
1246        open[23] = 43.0;
1247        close[23] = 44.0;
1248        volume[23] = 60.0;
1249
1250        date[24] = DateUtilities.createDate(2001, jan, 29, 12, 0);
1251        high[24] = 56.0;
1252        low[24] = 39.0;
1253        open[24] = 39.0;
1254        close[24] = 51.0;
1255        volume[24] = 40.0;
1256
1257        date[25] = DateUtilities.createDate(2001, jan, 30, 12, 0);
1258        high[25] = 56.0;
1259        low[25] = 39.0;
1260        open[25] = 47.0;
1261        close[25] = 49.0;
1262        volume[25] = 70.0;
1263
1264        date[26] = DateUtilities.createDate(2001, jan, 31, 12, 0);
1265        high[26] = 53.0;
1266        low[26] = 39.0;
1267        open[26] = 52.0;
1268        close[26] = 47.0;
1269        volume[26] = 60.0;
1270
1271        date[27] = DateUtilities.createDate(2001, feb, 1, 12, 0);
1272        high[27] = 51.0;
1273        low[27] = 30.0;
1274        open[27] = 45.0;
1275        close[27] = 47.0;
1276        volume[27] = 90.0;
1277
1278        date[28] = DateUtilities.createDate(2001, feb, 2, 12, 0);
1279        high[28] = 47.0;
1280        low[28] = 30.0;
1281        open[28] = 34.0;
1282        close[28] = 46.0;
1283        volume[28] = 100.0;
1284
1285        date[29] = DateUtilities.createDate(2001, feb, 3, 12, 0);
1286        high[29] = 57.0;
1287        low[29] = 37.0;
1288        open[29] = 44.0;
1289        close[29] = 56.0;
1290        volume[29] = 20.0;
1291
1292        date[30] = DateUtilities.createDate(2001, feb, 4, 12, 0);
1293        high[30] = 49.0;
1294        low[30] = 40.0;
1295        open[30] = 47.0;
1296        close[30] = 44.0;
1297        volume[30] = 50.0;
1298
1299        date[31] = DateUtilities.createDate(2001, feb, 5, 12, 0);
1300        high[31] = 46.0;
1301        low[31] = 38.0;
1302        open[31] = 43.0;
1303        close[31] = 40.0;
1304        volume[31] = 70.0;
1305
1306        date[32] = DateUtilities.createDate(2001, feb, 6, 12, 0);
1307        high[32] = 55.0;
1308        low[32] = 38.0;
1309        open[32] = 39.0;
1310        close[32] = 53.0;
1311        volume[32] = 120.0;
1312
1313        date[33] = DateUtilities.createDate(2001, feb, 7, 12, 0);
1314        high[33] = 50.0;
1315        low[33] = 33.0;
1316        open[33] = 37.0;
1317        close[33] = 37.0;
1318        volume[33] = 140.0;
1319
1320        date[34] = DateUtilities.createDate(2001, feb, 8, 12, 0);
1321        high[34] = 59.0;
1322        low[34] = 34.0;
1323        open[34] = 57.0;
1324        close[34] = 43.0;
1325        volume[34] = 70.0;
1326
1327        date[35] = DateUtilities.createDate(2001, feb, 9, 12, 0);
1328        high[35] = 48.0;
1329        low[35] = 39.0;
1330        open[35] = 46.0;
1331        close[35] = 47.0;
1332        volume[35] = 70.0;
1333
1334        date[36] = DateUtilities.createDate(2001, feb, 10, 12, 0);
1335        high[36] = 55.0;
1336        low[36] = 30.0;
1337        open[36] = 37.0;
1338        close[36] = 30.0;
1339        volume[36] = 30.0;
1340
1341        date[37] = DateUtilities.createDate(2001, feb, 11, 12, 0);
1342        high[37] = 60.0;
1343        low[37] = 32.0;
1344        open[37] = 56.0;
1345        close[37] = 36.0;
1346        volume[37] = 70.0;
1347
1348        date[38] = DateUtilities.createDate(2001, feb, 12, 12, 0);
1349        high[38] = 56.0;
1350        low[38] = 42.0;
1351        open[38] = 53.0;
1352        close[38] = 54.0;
1353        volume[38] = 40.0;
1354
1355        date[39] = DateUtilities.createDate(2001, feb, 13, 12, 0);
1356        high[39] = 49.0;
1357        low[39] = 42.0;
1358        open[39] = 45.0;
1359        close[39] = 42.0;
1360        volume[39] = 90.0;
1361
1362        date[40] = DateUtilities.createDate(2001, feb, 14, 12, 0);
1363        high[40] = 55.0;
1364        low[40] = 42.0;
1365        open[40] = 47.0;
1366        close[40] = 54.0;
1367        volume[40] = 70.0;
1368
1369        date[41] = DateUtilities.createDate(2001, feb, 15, 12, 0);
1370        high[41] = 49.0;
1371        low[41] = 35.0;
1372        open[41] = 38.0;
1373        close[41] = 35.0;
1374        volume[41] = 20.0;
1375
1376        date[42] = DateUtilities.createDate(2001, feb, 16, 12, 0);
1377        high[42] = 47.0;
1378        low[42] = 38.0;
1379        open[42] = 43.0;
1380        close[42] = 42.0;
1381        volume[42] = 10.0;
1382
1383        date[43] = DateUtilities.createDate(2001, feb, 17, 12, 0);
1384        high[43] = 53.0;
1385        low[43] = 42.0;
1386        open[43] = 47.0;
1387        close[43] = 48.0;
1388        volume[43] = 20.0;
1389
1390        date[44] = DateUtilities.createDate(2001, feb, 18, 12, 0);
1391        high[44] = 47.0;
1392        low[44] = 44.0;
1393        open[44] = 46.0;
1394        close[44] = 44.0;
1395        volume[44] = 30.0;
1396
1397        date[45] = DateUtilities.createDate(2001, feb, 19, 12, 0);
1398        high[45] = 46.0;
1399        low[45] = 40.0;
1400        open[45] = 43.0;
1401        close[45] = 44.0;
1402        volume[45] = 50.0;
1403
1404        date[46] = DateUtilities.createDate(2001, feb, 20, 12, 0);
1405        high[46] = 48.0;
1406        low[46] = 41.0;
1407        open[46] = 46.0;
1408        close[46] = 41.0;
1409        volume[46] = 100.0;
1410
1411        return new DefaultHighLowDataset("Series 1", date, high, low, open, close, volume);
1412
1413    }
1414
1415    /**
1416     * Creates a sample high low dataset for a SegmentedTimeline
1417     *
1418     * @param timeline SegmenteTimeline that will use this dataset.
1419     * @param start Date from where the dataset will be generated. Actual dates will
1420     * be generated dynamically based on the timeline.
1421     *
1422     * @return a sample high low dataset.
1423     */

1424    public static HighLowDataset createSegmentedHighLowDataset(
1425        SegmentedTimeline timeline, Date JavaDoc start) {
1426
1427        // some open-high-low-close data
1428
double[][] data =
1429               {{248.1999, 249.3999, 247.0499, 247.6999},
1430                {247.4999, 250.6499, 246.7999, 249.3999},
1431                {249.5999, 249.7499, 247.4999, 248.5999},
1432                {248.5999, 251.5499, 248.4999, 248.6499},
1433                {248.8499, 249.4499, 247.8499, 248.7999},
1434                {249.1999, 250.5499, 248.4999, 248.7999},
1435                {249.2999, 251.1499, 248.9499, 249.1499},
1436                {248.1499, 249.8999, 247.2999, 249.0499},
1437                {248.5999, 248.8999, 246.2999, 246.9499},
1438                {247.1999, 248.3999, 246.6499, 248.3499},
1439                {246.0999, 246.5999, 244.4999, 244.5999},
1440                {243.1999, 243.3999, 240.9499, 242.3499},
1441                {243.5999, 243.5999, 242.2499, 242.8999},
1442                {242.4999, 243.1499, 241.5999, 242.8499},
1443                {244.1999, 247.0499, 243.7499, 246.9999},
1444                {246.9499, 247.6499, 245.2999, 246.0499},
1445                {245.5999, 248.0999, 245.1999, 247.8999},
1446                {247.9499, 247.9499, 243.8499, 243.9499},
1447                {242.1999, 245.9499, 242.1999, 244.7499},
1448                {244.6499, 246.5999, 244.4999, 245.5999},
1449                {245.4499, 249.1999, 245.0999, 249.0999},
1450                {249.0999, 250.2999, 248.4499, 249.2499},
1451                {249.4999, 249.8499, 246.7499, 246.8499},
1452                {246.8499, 247.6499, 245.8999, 246.8499},
1453                {247.6999, 250.7999, 247.6999, 250.6999},
1454                {250.8999, 251.4499, 249.0999, 249.4999},
1455                {249.6499, 252.4999, 249.5999, 251.6499},
1456                {251.9499, 252.2999, 249.4999, 250.0499},
1457                {251.2499, 251.6999, 248.7999, 248.9499},
1458                {249.0999, 250.2499, 247.9499, 249.7499},
1459                {250.0499, 251.1499, 249.4499, 249.9499},
1460                {250.0499, 251.1499, 249.4499, 249.9499},
1461                {249.9999, 250.3499, 246.5999, 246.9499},
1462                {247.0999, 249.6999, 246.8999, 249.2999},
1463                {249.8999, 252.9499, 249.8499, 252.3999},
1464                {252.7999, 253.3499, 251.1999, 251.6999},
1465                {250.4999, 251.2999, 248.9499, 249.8999},
1466                {250.6999, 253.4499, 250.6999, 253.1999},
1467                {252.9999, 253.8999, 252.2999, 253.2499},
1468                {253.6999, 255.1999, 253.4999, 253.9499},
1469                {253.4499, 254.7999, 252.7999, 254.3499},
1470                {253.4499, 254.5999, 252.4999, 254.2999},
1471                {253.5999, 253.8999, 251.6999, 251.7999},
1472                {252.3499, 253.6999, 251.7999, 253.5499},
1473                {253.5499, 254.2499, 251.1999, 251.3499},
1474                {251.2499, 251.9499, 249.9999, 251.5999},
1475                {251.9499, 252.5999, 250.2499, 251.9999},
1476                {251.2499, 252.7499, 251.0999, 252.1999},
1477                {251.6499, 252.5499, 248.8499, 248.9499},
1478                {249.6499, 249.8999, 248.5499, 249.0999},
1479                {249.3499, 250.4499, 248.9499, 250.0999},
1480                {249.5499, 252.1499, 249.2999, 252.0499},
1481                {252.1499, 252.1499, 250.2499, 250.8499},
1482                {251.2499, 254.9499, 250.9999, 254.4499},
1483                {254.0999, 255.1999, 253.4499, 254.5999},
1484                {254.4999, 254.9499, 252.3999, 252.8999},
1485                {253.2999, 253.6499, 252.1499, 252.8999},
1486                {253.4999, 254.1499, 251.8999, 252.0499},
1487                {252.3499, 254.4499, 252.3499, 254.2999},
1488                {254.6499, 255.7499, 251.4499, 251.6499},
1489                {254.6499, 255.7499, 251.4499, 251.6499},
1490                {252.2499, 253.1499, 251.5999, 252.9499},
1491                {253.4499, 253.9499, 251.0999, 251.4999},
1492                {251.7499, 251.8499, 249.4499, 251.0999},
1493                {250.8499, 251.7999, 249.9499, 251.5499},
1494                {251.5499, 252.1499, 250.3499, 251.5999},
1495                {252.9999, 254.9499, 252.7999, 254.8499},
1496                {254.6999, 255.4499, 253.8999, 255.3499},
1497                {254.9999, 256.9500, 254.9999, 256.0999},
1498                {256.4500, 258.2499, 255.3499, 258.1499},
1499                {257.4500, 258.6499, 257.2499, 257.9500},
1500                {257.7499, 259.1499, 257.2000, 258.7999},
1501                {257.8999, 258.2000, 256.7499, 257.7000},
1502                {257.9500, 260.2999, 257.5999, 259.9500},
1503                {259.2499, 260.4500, 258.8499, 259.4999},
1504                {259.4500, 260.2499, 259.1499, 259.5499},
1505                {260.0499, 260.3499, 257.4999, 257.8999},
1506                {257.8999, 261.9999, 257.3999, 261.8999},
1507                {261.8999, 262.5499, 259.8499, 261.6499},
1508                {261.5499, 263.3499, 261.0999, 263.0499},
1509                {263.1499, 264.4500, 262.3499, 263.9999},
1510                {264.1499, 264.2999, 261.8499, 262.7999},
1511                {262.6499, 263.2499, 261.5499, 262.9500},
1512                {263.2999, 264.9500, 262.6499, 263.9500},
1513                {263.5999, 264.8499, 263.4500, 264.5999},
1514                {264.7499, 268.0999, 264.7499, 267.2499},
1515                {266.3499, 267.7499, 265.7000, 266.8499},
1516                {267.0999, 267.6499, 266.6499, 266.8499},
1517                {266.6499, 267.0499, 264.7499, 265.7499},
1518                {265.4500, 265.7499, 264.2499, 264.8999},
1519                {265.3499, 266.4500, 265.2999, 265.5999},
1520                {263.8499, 264.0499, 262.8499, 263.9999},
1521                {263.9500, 264.5499, 262.9500, 264.2999},
1522                {264.5999, 265.5499, 262.7499, 262.7999},
1523                {263.3999, 263.5499, 261.3999, 261.8999},
1524                {262.2000, 262.2000, 260.8499, 261.7000},
1525                {260.2499, 263.8499, 260.0999, 263.7000},
1526                {263.2999, 266.0999, 263.2999, 265.8999},
1527                {266.2000, 266.9999, 264.8499, 266.6499}};
1528
1529            int m = data.length;
1530
1531            Date JavaDoc[] date = new Date JavaDoc[m];
1532            double[] high = new double[m];
1533            double[] low = new double[m];
1534            double[] open = new double[m];
1535            double[] close = new double[m];
1536            double[] volume = new double[m];
1537
1538            SegmentedTimeline.Segment segment = timeline.getSegment(start);
1539            for (int i = 0; i < m; i++) {
1540                while (!segment.inIncludeSegments()) {
1541                    segment.inc();
1542                }
1543                date[i] = segment.getDate();
1544                open[i] = data[i][0];
1545                high[i] = data[i][1];
1546                low[i] = data[i][2];
1547                close[i] = data[i][3];
1548
1549                segment.inc();
1550            }
1551
1552            return new DefaultHighLowDataset("Series 1", date, high, low, open, close, volume);
1553
1554    }
1555
1556    /**
1557     * Creates a sample wind dataset.
1558     *
1559     * @return a sample wind dataset.
1560     */

1561    public static WindDataset createWindDataset1() {
1562
1563        int jan = 1;
1564        Object JavaDoc[][][] data = new Object JavaDoc[][][] {{
1565            {DateUtilities.createDate(1999, jan, 3), new Double JavaDoc(0.0), new Double JavaDoc(10.0)},
1566            {DateUtilities.createDate(1999, jan, 4), new Double JavaDoc(1.0), new Double JavaDoc(8.5)},
1567            {DateUtilities.createDate(1999, jan, 5), new Double JavaDoc(2.0), new Double JavaDoc(10.0)},
1568            {DateUtilities.createDate(1999, jan, 6), new Double JavaDoc(3.0), new Double JavaDoc(10.0)},
1569            {DateUtilities.createDate(1999, jan, 7), new Double JavaDoc(4.0), new Double JavaDoc(7.0)},
1570            {DateUtilities.createDate(1999, jan, 8), new Double JavaDoc(5.0), new Double JavaDoc(10.0)},
1571            {DateUtilities.createDate(1999, jan, 9), new Double JavaDoc(6.0), new Double JavaDoc(8.0)},
1572            {DateUtilities.createDate(1999, jan, 10), new Double JavaDoc(7.0), new Double JavaDoc(11.0)},
1573            {DateUtilities.createDate(1999, jan, 11), new Double JavaDoc(8.0), new Double JavaDoc(10.0)},
1574            {DateUtilities.createDate(1999, jan, 12), new Double JavaDoc(9.0), new Double JavaDoc(11.0)},
1575            {DateUtilities.createDate(1999, jan, 13), new Double JavaDoc(10.0), new Double JavaDoc(3.0)},
1576            {DateUtilities.createDate(1999, jan, 14), new Double JavaDoc(11.0), new Double JavaDoc(9.0)},
1577            {DateUtilities.createDate(1999, jan, 15), new Double JavaDoc(12.0), new Double JavaDoc(11.0)},
1578            {DateUtilities.createDate(1999, jan, 16), new Double JavaDoc(0.0), new Double JavaDoc(0.0)} } };
1579
1580        return new DefaultWindDataset(new String JavaDoc[] {"Wind!!"}, data);
1581    }
1582
1583}
1584
Popular Tags