KickJava   Java API By Example, From Geeks To Geeks.

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


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  * PriceVolumeDemo.java
24  * --------------------
25  * (C) Copyright 2002, 2003, by Object Refinery Limited.
26  *
27  * Original Author: David Gilbert (for Object Refinery Limited).
28  * Contributor(s): -;
29  *
30  * $Id: PriceVolumeDemo.java,v 1.11 2003/11/28 10:57:34 mungady Exp $
31  *
32  * Changes
33  * -------
34  * 28-Mar-2002 : Version 1 (DG);
35  * 23-Apr-2002 : Modified to use new CombinedXYPlot class (DG);
36  * 25-Jun-2002 : Removed unnecessary imports (DG);
37  * 11-Oct-2002 : Fixed errors reported by Checkstyle (DG);
38  * 21-Nov-2002 : Implemented with dual axes, and used sample data from Chicago Mercantile
39  * Exchange (http://www.cme.com) (DG);
40  *
41  */

42
43 package org.jfree.chart.demo;
44
45 import java.text.DecimalFormat JavaDoc;
46
47 import org.jfree.chart.ChartFactory;
48 import org.jfree.chart.ChartPanel;
49 import org.jfree.chart.JFreeChart;
50 import org.jfree.chart.axis.NumberAxis;
51 import org.jfree.chart.labels.TimeSeriesToolTipGenerator;
52 import org.jfree.chart.plot.XYPlot;
53 import org.jfree.chart.renderer.XYBarRenderer;
54 import org.jfree.chart.renderer.XYItemRenderer;
55 import org.jfree.data.IntervalXYDataset;
56 import org.jfree.data.XYDataset;
57 import org.jfree.data.time.Day;
58 import org.jfree.data.time.TimeSeries;
59 import org.jfree.data.time.TimeSeriesCollection;
60 import org.jfree.date.MonthConstants;
61 import org.jfree.ui.ApplicationFrame;
62 import org.jfree.ui.RefineryUtilities;
63
64 /**
65  * A demonstration application showing how to create a price-volume chart.
66  *
67  * @author David Gilbert
68  */

69 public class PriceVolumeDemo extends ApplicationFrame {
70
71     /**
72      * Constructs a new demonstration application.
73      *
74      * @param title the frame title.
75      */

76     public PriceVolumeDemo(String JavaDoc title) {
77
78         super(title);
79         JFreeChart chart = createChart();
80         ChartPanel panel = new ChartPanel(chart, true, true, true, false, true);
81         panel.setPreferredSize(new java.awt.Dimension JavaDoc(500, 270));
82         setContentPane(panel);
83
84     }
85
86     /**
87      * Creates a chart.
88      *
89      * @return a chart.
90      */

91     private JFreeChart createChart() {
92
93         XYDataset priceData = createPriceDataset();
94         String JavaDoc title = "Eurodollar Futures Contract (MAR03)";
95         JFreeChart chart = ChartFactory.createTimeSeriesChart(
96             title,
97             "Date",
98             "Price",
99             priceData,
100             true,
101             true,
102             false
103         );
104         XYPlot plot = chart.getXYPlot();
105         NumberAxis rangeAxis1 = (NumberAxis) plot.getRangeAxis();
106         rangeAxis1.setLowerMargin(0.40); // to leave room for volume bars
107
DecimalFormat JavaDoc format = new DecimalFormat JavaDoc("00.00");
108         rangeAxis1.setNumberFormatOverride(format);
109
110         XYItemRenderer renderer1 = plot.getRenderer();
111         renderer1.setToolTipGenerator(new TimeSeriesToolTipGenerator("d-MMM-yyyy", "00.00"));
112
113         NumberAxis rangeAxis2 = new NumberAxis("Volume");
114         rangeAxis2.setUpperMargin(1.00); // to leave room for price line
115
plot.setSecondaryRangeAxis(0, rangeAxis2);
116         plot.setSecondaryDataset(0, createVolumeDataset());
117         plot.setSecondaryRangeAxis(0, rangeAxis2);
118         plot.mapSecondaryDatasetToRangeAxis(0, new Integer JavaDoc(0));
119         XYBarRenderer renderer2 = new XYBarRenderer(0.20);
120         renderer2.setToolTipGenerator(new TimeSeriesToolTipGenerator("d-MMM-yyyy", "0,000.00"));
121         plot.setSecondaryRenderer(0, renderer2);
122         return chart;
123
124     }
125
126     /**
127      * Creates a sample dataset.
128      *
129      * @return A sample dataset.
130      */

131     private XYDataset createPriceDataset() {
132
133         // create dataset 1...
134
TimeSeries series1 = new TimeSeries("Price", Day.class);
135
136         series1.add(new Day(2, MonthConstants.JANUARY, 2002), 95.565);
137         series1.add(new Day(3, MonthConstants.JANUARY, 2002), 95.640);
138         series1.add(new Day(4, MonthConstants.JANUARY, 2002), 95.710);
139
140         series1.add(new Day(7, MonthConstants.JANUARY, 2002), 95.930);
141         series1.add(new Day(8, MonthConstants.JANUARY, 2002), 95.930);
142         series1.add(new Day(9, MonthConstants.JANUARY, 2002), 95.960);
143         series1.add(new Day(10, MonthConstants.JANUARY, 2002), 96.055);
144         series1.add(new Day(11, MonthConstants.JANUARY, 2002), 96.335);
145
146         series1.add(new Day(14, MonthConstants.JANUARY, 2002), 96.290);
147         series1.add(new Day(15, MonthConstants.JANUARY, 2002), 96.275);
148         series1.add(new Day(16, MonthConstants.JANUARY, 2002), 96.240);
149         series1.add(new Day(17, MonthConstants.JANUARY, 2002), 96.080);
150         series1.add(new Day(18, MonthConstants.JANUARY, 2002), 96.145);
151
152         series1.add(new Day(22, MonthConstants.JANUARY, 2002), 96.120);
153         series1.add(new Day(23, MonthConstants.JANUARY, 2002), 96.015);
154         series1.add(new Day(24, MonthConstants.JANUARY, 2002), 95.890);
155         series1.add(new Day(25, MonthConstants.JANUARY, 2002), 95.8650);
156
157         series1.add(new Day(28, MonthConstants.JANUARY, 2002), 95.880);
158         series1.add(new Day(29, MonthConstants.JANUARY, 2002), 96.050);
159         series1.add(new Day(30, MonthConstants.JANUARY, 2002), 96.065);
160         series1.add(new Day(31, MonthConstants.JANUARY, 2002), 95.910);
161         series1.add(new Day(1, MonthConstants.FEBRUARY, 2002), 96.015);
162
163         series1.add(new Day(4, MonthConstants.FEBRUARY, 2002), 96.140);
164         series1.add(new Day(5, MonthConstants.FEBRUARY, 2002), 96.195);
165         series1.add(new Day(6, MonthConstants.FEBRUARY, 2002), 96.245);
166         series1.add(new Day(7, MonthConstants.FEBRUARY, 2002), 96.220);
167         series1.add(new Day(8, MonthConstants.FEBRUARY, 2002), 96.280);
168
169         series1.add(new Day(11, MonthConstants.FEBRUARY, 2002), 96.265);
170         series1.add(new Day(12, MonthConstants.FEBRUARY, 2002), 96.160);
171         series1.add(new Day(13, MonthConstants.FEBRUARY, 2002), 96.120);
172         series1.add(new Day(14, MonthConstants.FEBRUARY, 2002), 96.125);
173         series1.add(new Day(15, MonthConstants.FEBRUARY, 2002), 96.265);
174
175         series1.add(new Day(19, MonthConstants.FEBRUARY, 2002), 96.290);
176         series1.add(new Day(20, MonthConstants.FEBRUARY, 2002), 96.275);
177         series1.add(new Day(21, MonthConstants.FEBRUARY, 2002), 96.280);
178         series1.add(new Day(22, MonthConstants.FEBRUARY, 2002), 96.305);
179
180         series1.add(new Day(25, MonthConstants.FEBRUARY, 2002), 96.265);
181         series1.add(new Day(26, MonthConstants.FEBRUARY, 2002), 96.185);
182         series1.add(new Day(27, MonthConstants.FEBRUARY, 2002), 96.305);
183         series1.add(new Day(28, MonthConstants.FEBRUARY, 2002), 96.215);
184         series1.add(new Day(1, MonthConstants.MARCH, 2002), 96.015);
185
186         series1.add(new Day(4, MonthConstants.MARCH, 2002), 95.970);
187         series1.add(new Day(5, MonthConstants.MARCH, 2002), 95.935);
188         series1.add(new Day(6, MonthConstants.MARCH, 2002), 95.935);
189         series1.add(new Day(7, MonthConstants.MARCH, 2002), 95.705);
190         series1.add(new Day(8, MonthConstants.MARCH, 2002), 95.4850);
191
192         series1.add(new Day(11, MonthConstants.MARCH, 2002), 95.505);
193         series1.add(new Day(12, MonthConstants.MARCH, 2002), 95.540);
194         series1.add(new Day(13, MonthConstants.MARCH, 2002), 95.675);
195         series1.add(new Day(14, MonthConstants.MARCH, 2002), 95.510);
196         series1.add(new Day(15, MonthConstants.MARCH, 2002), 95.500);
197
198         series1.add(new Day(18, MonthConstants.MARCH, 2002), 95.500);
199         series1.add(new Day(19, MonthConstants.MARCH, 2002), 95.535);
200         series1.add(new Day(20, MonthConstants.MARCH, 2002), 95.420);
201         series1.add(new Day(21, MonthConstants.MARCH, 2002), 95.400);
202         series1.add(new Day(22, MonthConstants.MARCH, 2002), 95.375);
203
204         series1.add(new Day(25, MonthConstants.MARCH, 2002), 95.350);
205         series1.add(new Day(26, MonthConstants.MARCH, 2002), 95.505);
206         series1.add(new Day(27, MonthConstants.MARCH, 2002), 95.550);
207         series1.add(new Day(28, MonthConstants.MARCH, 2002), 95.485);
208
209         series1.add(new Day(1, MonthConstants.APRIL, 2002), 95.485);
210         series1.add(new Day(2, MonthConstants.APRIL, 2002), 95.630);
211         series1.add(new Day(3, MonthConstants.APRIL, 2002), 95.735);
212         series1.add(new Day(4, MonthConstants.APRIL, 2002), 95.695);
213         series1.add(new Day(5, MonthConstants.APRIL, 2002), 95.810);
214
215         series1.add(new Day(8, MonthConstants.APRIL, 2002), 95.810);
216         series1.add(new Day(9, MonthConstants.APRIL, 2002), 95.865);
217         series1.add(new Day(10, MonthConstants.APRIL, 2002), 95.885);
218         series1.add(new Day(11, MonthConstants.APRIL, 2002), 95.900);
219         series1.add(new Day(12, MonthConstants.APRIL, 2002), 95.980);
220
221         series1.add(new Day(15, MonthConstants.APRIL, 2002), 96.035);
222         series1.add(new Day(16, MonthConstants.APRIL, 2002), 96.000);
223         series1.add(new Day(17, MonthConstants.APRIL, 2002), 96.035);
224         series1.add(new Day(18, MonthConstants.APRIL, 2002), 96.085);
225         series1.add(new Day(19, MonthConstants.APRIL, 2002), 96.0750);
226
227         series1.add(new Day(22, MonthConstants.APRIL, 2002), 96.105);
228         series1.add(new Day(23, MonthConstants.APRIL, 2002), 96.075);
229         series1.add(new Day(24, MonthConstants.APRIL, 2002), 96.210);
230         series1.add(new Day(25, MonthConstants.APRIL, 2002), 96.255);
231         series1.add(new Day(26, MonthConstants.APRIL, 2002), 96.310);
232
233         series1.add(new Day(29, MonthConstants.APRIL, 2002), 96.310);
234         series1.add(new Day(30, MonthConstants.APRIL, 2002), 96.325);
235         series1.add(new Day(1, MonthConstants.MAY, 2002), 96.345);
236         series1.add(new Day(2, MonthConstants.MAY, 2002), 96.285);
237         series1.add(new Day(3, MonthConstants.MAY, 2002), 96.385);
238
239         series1.add(new Day(6, MonthConstants.MAY, 2002), 96.380);
240         series1.add(new Day(7, MonthConstants.MAY, 2002), 96.485);
241         series1.add(new Day(8, MonthConstants.MAY, 2002), 96.230);
242         series1.add(new Day(9, MonthConstants.MAY, 2002), 96.310);
243         series1.add(new Day(10, MonthConstants.MAY, 2002), 96.445);
244
245         series1.add(new Day(13, MonthConstants.MAY, 2002), 96.355);
246         series1.add(new Day(14, MonthConstants.MAY, 2002), 96.180);
247         series1.add(new Day(15, MonthConstants.MAY, 2002), 96.240);
248         series1.add(new Day(16, MonthConstants.MAY, 2002), 96.325);
249         series1.add(new Day(17, MonthConstants.MAY, 2002), 96.200);
250
251         series1.add(new Day(20, MonthConstants.MAY, 2002), 96.305);
252         series1.add(new Day(21, MonthConstants.MAY, 2002), 96.385);
253         series1.add(new Day(22, MonthConstants.MAY, 2002), 96.445);
254         series1.add(new Day(23, MonthConstants.MAY, 2002), 96.385);
255         series1.add(new Day(24, MonthConstants.MAY, 2002), 96.390);
256
257         series1.add(new Day(28, MonthConstants.MAY, 2002), 96.390);
258         series1.add(new Day(29, MonthConstants.MAY, 2002), 96.475);
259         series1.add(new Day(30, MonthConstants.MAY, 2002), 96.555);
260         series1.add(new Day(31, MonthConstants.MAY, 2002), 96.500);
261
262         series1.add(new Day(3, MonthConstants.JUNE, 2002), 96.540);
263         series1.add(new Day(4, MonthConstants.JUNE, 2002), 96.605);
264         series1.add(new Day(5, MonthConstants.JUNE, 2002), 96.580);
265         series1.add(new Day(6, MonthConstants.JUNE, 2002), 96.610);
266         series1.add(new Day(7, MonthConstants.JUNE, 2002), 96.600);
267
268         series1.add(new Day(10, MonthConstants.JUNE, 2002), 96.615);
269         series1.add(new Day(11, MonthConstants.JUNE, 2002), 96.705);
270         series1.add(new Day(12, MonthConstants.JUNE, 2002), 96.750);
271         series1.add(new Day(13, MonthConstants.JUNE, 2002), 96.830);
272         series1.add(new Day(14, MonthConstants.JUNE, 2002), 96.965);
273
274         series1.add(new Day(17, MonthConstants.JUNE, 2002), 96.945);
275         series1.add(new Day(18, MonthConstants.JUNE, 2002), 96.990);
276         series1.add(new Day(19, MonthConstants.JUNE, 2002), 97.165);
277         series1.add(new Day(20, MonthConstants.JUNE, 2002), 97.030);
278         series1.add(new Day(21, MonthConstants.JUNE, 2002), 97.145);
279
280         series1.add(new Day(24, MonthConstants.JUNE, 2002), 97.120);
281         series1.add(new Day(25, MonthConstants.JUNE, 2002), 97.175);
282         series1.add(new Day(26, MonthConstants.JUNE, 2002), 97.365);
283         series1.add(new Day(27, MonthConstants.JUNE, 2002), 97.245);
284         series1.add(new Day(28, MonthConstants.JUNE, 2002), 97.245);
285
286         series1.add(new Day(1, MonthConstants.JULY, 2002), 97.290);
287         series1.add(new Day(2, MonthConstants.JULY, 2002), 97.380);
288         series1.add(new Day(3, MonthConstants.JULY, 2002), 97.380);
289
290         series1.add(new Day(5, MonthConstants.JULY, 2002), 97.220);
291
292         series1.add(new Day(8, MonthConstants.JULY, 2002), 97.325);
293         series1.add(new Day(9, MonthConstants.JULY, 2002), 97.455);
294         series1.add(new Day(10, MonthConstants.JULY, 2002), 97.580);
295         series1.add(new Day(11, MonthConstants.JULY, 2002), 97.605);
296         series1.add(new Day(12, MonthConstants.JULY, 2002), 97.690);
297
298         series1.add(new Day(15, MonthConstants.JULY, 2002), 97.730);
299         series1.add(new Day(16, MonthConstants.JULY, 2002), 97.580);
300         series1.add(new Day(17, MonthConstants.JULY, 2002), 97.640);
301         series1.add(new Day(18, MonthConstants.JULY, 2002), 97.680);
302         series1.add(new Day(19, MonthConstants.JULY, 2002), 97.715);
303
304         series1.add(new Day(22, MonthConstants.JULY, 2002), 97.815);
305         series1.add(new Day(23, MonthConstants.JULY, 2002), 97.875);
306         series1.add(new Day(24, MonthConstants.JULY, 2002), 97.835);
307         series1.add(new Day(25, MonthConstants.JULY, 2002), 97.925);
308         series1.add(new Day(26, MonthConstants.JULY, 2002), 97.960);
309
310         series1.add(new Day(29, MonthConstants.JULY, 2002), 97.745);
311         series1.add(new Day(30, MonthConstants.JULY, 2002), 97.710);
312         series1.add(new Day(31, MonthConstants.JULY, 2002), 97.930);
313         series1.add(new Day(1, MonthConstants.AUGUST, 2002), 98.000);
314         series1.add(new Day(2, MonthConstants.AUGUST, 2002), 98.170);
315
316         series1.add(new Day(5, MonthConstants.AUGUST, 2002), 98.225);
317         series1.add(new Day(6, MonthConstants.AUGUST, 2002), 98.115);
318         series1.add(new Day(7, MonthConstants.AUGUST, 2002), 98.265);
319         series1.add(new Day(8, MonthConstants.AUGUST, 2002), 98.180);
320         series1.add(new Day(9, MonthConstants.AUGUST, 2002), 98.185);
321
322         series1.add(new Day(12, MonthConstants.AUGUST, 2002), 98.150);
323         series1.add(new Day(13, MonthConstants.AUGUST, 2002), 98.290);
324         series1.add(new Day(14, MonthConstants.AUGUST, 2002), 98.155);
325         series1.add(new Day(15, MonthConstants.AUGUST, 2002), 98.075);
326         series1.add(new Day(16, MonthConstants.AUGUST, 2002), 98.000);
327
328         series1.add(new Day(19, MonthConstants.AUGUST, 2002), 98.040);
329         series1.add(new Day(20, MonthConstants.AUGUST, 2002), 98.135);
330         series1.add(new Day(21, MonthConstants.AUGUST, 2002), 98.110);
331         series1.add(new Day(22, MonthConstants.AUGUST, 2002), 98.005);
332         series1.add(new Day(23, MonthConstants.AUGUST, 2002), 98.055);
333
334         series1.add(new Day(26, MonthConstants.AUGUST, 2002), 98.065);
335         series1.add(new Day(27, MonthConstants.AUGUST, 2002), 97.980);
336         series1.add(new Day(28, MonthConstants.AUGUST, 2002), 98.035);
337         series1.add(new Day(29, MonthConstants.AUGUST, 2002), 98.095);
338         series1.add(new Day(30, MonthConstants.AUGUST, 2002), 98.060);
339
340         series1.add(new Day(3, MonthConstants.SEPTEMBER, 2002), 98.250);
341         series1.add(new Day(4, MonthConstants.SEPTEMBER, 2002), 98.245);
342         series1.add(new Day(5, MonthConstants.SEPTEMBER, 2002), 98.315);
343         series1.add(new Day(6, MonthConstants.SEPTEMBER, 2002), 98.170);
344
345         series1.add(new Day(9, MonthConstants.SEPTEMBER, 2002), 98.080);
346         series1.add(new Day(10, MonthConstants.SEPTEMBER, 2002), 98.090);
347         series1.add(new Day(11, MonthConstants.SEPTEMBER, 2002), 98.030);
348         series1.add(new Day(12, MonthConstants.SEPTEMBER, 2002), 98.105);
349         series1.add(new Day(13, MonthConstants.SEPTEMBER, 2002), 98.135);
350
351         series1.add(new Day(16, MonthConstants.SEPTEMBER, 2002), 98.115);
352         series1.add(new Day(17, MonthConstants.SEPTEMBER, 2002), 98.125);
353         series1.add(new Day(18, MonthConstants.SEPTEMBER, 2002), 98.130);
354         series1.add(new Day(19, MonthConstants.SEPTEMBER, 2002), 98.255);
355         series1.add(new Day(20, MonthConstants.SEPTEMBER, 2002), 98.255);
356
357         series1.add(new Day(23, MonthConstants.SEPTEMBER, 2002), 98.280);
358         series1.add(new Day(24, MonthConstants.SEPTEMBER, 2002), 98.310);
359         series1.add(new Day(25, MonthConstants.SEPTEMBER, 2002), 98.250);
360         series1.add(new Day(26, MonthConstants.SEPTEMBER, 2002), 98.300);
361         series1.add(new Day(27, MonthConstants.SEPTEMBER, 2002), 98.410);
362
363         series1.add(new Day(30, MonthConstants.SEPTEMBER, 2002), 98.495);
364         series1.add(new Day(1, MonthConstants.OCTOBER, 2002), 98.440);
365         series1.add(new Day(2, MonthConstants.OCTOBER, 2002), 98.440);
366         series1.add(new Day(3, MonthConstants.OCTOBER, 2002), 98.440);
367         series1.add(new Day(4, MonthConstants.OCTOBER, 2002), 98.380);
368
369         series1.add(new Day(7, MonthConstants.OCTOBER, 2002), 98.385);
370         series1.add(new Day(8, MonthConstants.OCTOBER, 2002), 98.340);
371         series1.add(new Day(9, MonthConstants.OCTOBER, 2002), 98.420);
372         series1.add(new Day(10, MonthConstants.OCTOBER, 2002), 98.375);
373         series1.add(new Day(11, MonthConstants.OCTOBER, 2002), 98.275);
374
375         series1.add(new Day(14, MonthConstants.OCTOBER, 2002), 98.275);
376         series1.add(new Day(15, MonthConstants.OCTOBER, 2002), 98.135);
377         series1.add(new Day(16, MonthConstants.OCTOBER, 2002), 98.165);
378         series1.add(new Day(17, MonthConstants.OCTOBER, 2002), 98.170);
379         series1.add(new Day(18, MonthConstants.OCTOBER, 2002), 98.165);
380
381         series1.add(new Day(21, MonthConstants.OCTOBER, 2002), 98.105);
382         series1.add(new Day(22, MonthConstants.OCTOBER, 2002), 98.125);
383         series1.add(new Day(23, MonthConstants.OCTOBER, 2002), 98.185);
384         series1.add(new Day(24, MonthConstants.OCTOBER, 2002), 98.245);
385         series1.add(new Day(25, MonthConstants.OCTOBER, 2002), 98.320);
386
387         series1.add(new Day(28, MonthConstants.OCTOBER, 2002), 98.420);
388         series1.add(new Day(29, MonthConstants.OCTOBER, 2002), 98.540);
389         series1.add(new Day(30, MonthConstants.OCTOBER, 2002), 98.545);
390         series1.add(new Day(31, MonthConstants.OCTOBER, 2002), 98.560);
391
392         return new TimeSeriesCollection(series1);
393
394     }
395
396     /**
397      * Creates a sample dataset.
398      *
399      * @return A sample dataset.
400      */

401     private IntervalXYDataset createVolumeDataset() {
402
403         // create dataset 2...
404
TimeSeries series1 = new TimeSeries("Volume", Day.class);
405
406         series1.add(new Day(2, MonthConstants.JANUARY, 2002), 41020);
407         series1.add(new Day(3, MonthConstants.JANUARY, 2002), 45586);
408         series1.add(new Day(4, MonthConstants.JANUARY, 2002), 81672);
409
410         series1.add(new Day(7, MonthConstants.JANUARY, 2002), 81975);
411         series1.add(new Day(8, MonthConstants.JANUARY, 2002), 79692);
412         series1.add(new Day(9, MonthConstants.JANUARY, 2002), 53187);
413         series1.add(new Day(10, MonthConstants.JANUARY, 2002), 87929);
414         series1.add(new Day(11, MonthConstants.JANUARY, 2002), 107047);
415
416         series1.add(new Day(14, MonthConstants.JANUARY, 2002), 86276);
417         series1.add(new Day(15, MonthConstants.JANUARY, 2002), 79005);
418         series1.add(new Day(16, MonthConstants.JANUARY, 2002), 80632);
419         series1.add(new Day(17, MonthConstants.JANUARY, 2002), 88797);
420         series1.add(new Day(18, MonthConstants.JANUARY, 2002), 57179);
421
422         series1.add(new Day(22, MonthConstants.JANUARY, 2002), 36611);
423         series1.add(new Day(23, MonthConstants.JANUARY, 2002), 57063);
424         series1.add(new Day(24, MonthConstants.JANUARY, 2002), 101938);
425         series1.add(new Day(25, MonthConstants.JANUARY, 2002), 87177);
426
427         series1.add(new Day(28, MonthConstants.JANUARY, 2002), 39831);
428         series1.add(new Day(29, MonthConstants.JANUARY, 2002), 67654);
429         series1.add(new Day(30, MonthConstants.JANUARY, 2002), 81162);
430         series1.add(new Day(31, MonthConstants.JANUARY, 2002), 64923);
431         series1.add(new Day(1, MonthConstants.FEBRUARY, 2002), 73481);
432
433         series1.add(new Day(4, MonthConstants.FEBRUARY, 2002), 54723);
434         series1.add(new Day(5, MonthConstants.FEBRUARY, 2002), 76708);
435         series1.add(new Day(6, MonthConstants.FEBRUARY, 2002), 81281);
436         series1.add(new Day(7, MonthConstants.FEBRUARY, 2002), 66553);
437         series1.add(new Day(8, MonthConstants.FEBRUARY, 2002), 53592);
438
439         series1.add(new Day(11, MonthConstants.FEBRUARY, 2002), 29410);
440         series1.add(new Day(12, MonthConstants.FEBRUARY, 2002), 60345);
441         series1.add(new Day(13, MonthConstants.FEBRUARY, 2002), 67339);
442         series1.add(new Day(14, MonthConstants.FEBRUARY, 2002), 40057);
443         series1.add(new Day(15, MonthConstants.FEBRUARY, 2002), 67865);
444
445         series1.add(new Day(19, MonthConstants.FEBRUARY, 2002), 58628);
446         series1.add(new Day(20, MonthConstants.FEBRUARY, 2002), 52109);
447         series1.add(new Day(21, MonthConstants.FEBRUARY, 2002), 50195);
448         series1.add(new Day(22, MonthConstants.FEBRUARY, 2002), 47806);
449
450         series1.add(new Day(25, MonthConstants.FEBRUARY, 2002), 31711);
451         series1.add(new Day(26, MonthConstants.FEBRUARY, 2002), 88328);
452         series1.add(new Day(27, MonthConstants.FEBRUARY, 2002), 95805);
453         series1.add(new Day(28, MonthConstants.FEBRUARY, 2002), 84035);
454         series1.add(new Day(1, MonthConstants.MARCH, 2002), 113584);
455
456         series1.add(new Day(4, MonthConstants.MARCH, 2002), 71872);
457         series1.add(new Day(5, MonthConstants.MARCH, 2002), 83016);
458         series1.add(new Day(6, MonthConstants.MARCH, 2002), 62273);
459         series1.add(new Day(7, MonthConstants.MARCH, 2002), 138508);
460         series1.add(new Day(8, MonthConstants.MARCH, 2002), 139428);
461
462         series1.add(new Day(11, MonthConstants.MARCH, 2002), 80232);
463         series1.add(new Day(12, MonthConstants.MARCH, 2002), 75693);
464         series1.add(new Day(13, MonthConstants.MARCH, 2002), 104068);
465         series1.add(new Day(14, MonthConstants.MARCH, 2002), 72171);
466         series1.add(new Day(15, MonthConstants.MARCH, 2002), 117262);
467
468         series1.add(new Day(18, MonthConstants.MARCH, 2002), 66048);
469         series1.add(new Day(19, MonthConstants.MARCH, 2002), 87079);
470         series1.add(new Day(20, MonthConstants.MARCH, 2002), 116084);
471         series1.add(new Day(21, MonthConstants.MARCH, 2002), 113206);
472         series1.add(new Day(22, MonthConstants.MARCH, 2002), 68326);
473
474         series1.add(new Day(25, MonthConstants.MARCH, 2002), 34340);
475         series1.add(new Day(26, MonthConstants.MARCH, 2002), 104413);
476         series1.add(new Day(27, MonthConstants.MARCH, 2002), 57277);
477         series1.add(new Day(28, MonthConstants.MARCH, 2002), 69936);
478
479         series1.add(new Day(1, MonthConstants.APRIL, 2002), 57282);
480         series1.add(new Day(2, MonthConstants.APRIL, 2002), 74686);
481         series1.add(new Day(3, MonthConstants.APRIL, 2002), 108601);
482         series1.add(new Day(4, MonthConstants.APRIL, 2002), 123381);
483         series1.add(new Day(5, MonthConstants.APRIL, 2002), 106691);
484
485         series1.add(new Day(8, MonthConstants.APRIL, 2002), 118535);
486         series1.add(new Day(9, MonthConstants.APRIL, 2002), 85577);
487         series1.add(new Day(10, MonthConstants.APRIL, 2002), 75441);
488         series1.add(new Day(11, MonthConstants.APRIL, 2002), 88845);
489         series1.add(new Day(12, MonthConstants.APRIL, 2002), 137141);
490
491         series1.add(new Day(15, MonthConstants.APRIL, 2002), 72518);
492         series1.add(new Day(16, MonthConstants.APRIL, 2002), 122100);
493         series1.add(new Day(17, MonthConstants.APRIL, 2002), 136419);
494         series1.add(new Day(18, MonthConstants.APRIL, 2002), 141338);
495         series1.add(new Day(19, MonthConstants.APRIL, 2002), 80274);
496
497         series1.add(new Day(22, MonthConstants.APRIL, 2002), 40449);
498         series1.add(new Day(23, MonthConstants.APRIL, 2002), 72292);
499         series1.add(new Day(24, MonthConstants.APRIL, 2002), 110644);
500         series1.add(new Day(25, MonthConstants.APRIL, 2002), 145142);
501         series1.add(new Day(26, MonthConstants.APRIL, 2002), 139573);
502
503         series1.add(new Day(29, MonthConstants.APRIL, 2002), 51509);
504         series1.add(new Day(30, MonthConstants.APRIL, 2002), 105782);
505         series1.add(new Day(1, MonthConstants.MAY, 2002), 170680);
506         series1.add(new Day(2, MonthConstants.MAY, 2002), 140800);
507         series1.add(new Day(3, MonthConstants.MAY, 2002), 170411);
508
509         series1.add(new Day(6, MonthConstants.MAY, 2002), 46172);
510         series1.add(new Day(7, MonthConstants.MAY, 2002), 137251);
511         series1.add(new Day(8, MonthConstants.MAY, 2002), 220626);
512         series1.add(new Day(9, MonthConstants.MAY, 2002), 175902);
513         series1.add(new Day(10, MonthConstants.MAY, 2002), 128807);
514
515         series1.add(new Day(13, MonthConstants.MAY, 2002), 78208);
516         series1.add(new Day(14, MonthConstants.MAY, 2002), 212048);
517         series1.add(new Day(15, MonthConstants.MAY, 2002), 145643);
518         series1.add(new Day(16, MonthConstants.MAY, 2002), 121520);
519         series1.add(new Day(17, MonthConstants.MAY, 2002), 147820);
520
521         series1.add(new Day(20, MonthConstants.MAY, 2002), 75969);
522         series1.add(new Day(21, MonthConstants.MAY, 2002), 118970);
523         series1.add(new Day(22, MonthConstants.MAY, 2002), 131013);
524         series1.add(new Day(23, MonthConstants.MAY, 2002), 141100);
525         series1.add(new Day(24, MonthConstants.MAY, 2002), 63606);
526
527         series1.add(new Day(28, MonthConstants.MAY, 2002), 78687);
528         series1.add(new Day(29, MonthConstants.MAY, 2002), 86743);
529         series1.add(new Day(30, MonthConstants.MAY, 2002), 164376);
530         series1.add(new Day(31, MonthConstants.MAY, 2002), 150108);
531
532         series1.add(new Day(3, MonthConstants.JUNE, 2002), 132363);
533         series1.add(new Day(4, MonthConstants.JUNE, 2002), 144902);
534         series1.add(new Day(5, MonthConstants.JUNE, 2002), 123834);
535         series1.add(new Day(6, MonthConstants.JUNE, 2002), 125004);
536         series1.add(new Day(7, MonthConstants.JUNE, 2002), 165049);
537
538         series1.add(new Day(10, MonthConstants.JUNE, 2002), 88069);
539         series1.add(new Day(11, MonthConstants.JUNE, 2002), 114146);
540         series1.add(new Day(12, MonthConstants.JUNE, 2002), 149992);
541         series1.add(new Day(13, MonthConstants.JUNE, 2002), 191261);
542         series1.add(new Day(14, MonthConstants.JUNE, 2002), 207444);
543
544         series1.add(new Day(17, MonthConstants.JUNE, 2002), 117081);
545         series1.add(new Day(18, MonthConstants.JUNE, 2002), 135924);
546         series1.add(new Day(19, MonthConstants.JUNE, 2002), 179654);
547         series1.add(new Day(20, MonthConstants.JUNE, 2002), 260936);
548         series1.add(new Day(21, MonthConstants.JUNE, 2002), 140283);
549
550         series1.add(new Day(24, MonthConstants.JUNE, 2002), 199052);
551         series1.add(new Day(25, MonthConstants.JUNE, 2002), 191804);
552         series1.add(new Day(26, MonthConstants.JUNE, 2002), 384936);
553         series1.add(new Day(27, MonthConstants.JUNE, 2002), 313065);
554         series1.add(new Day(28, MonthConstants.JUNE, 2002), 169963);
555
556         series1.add(new Day(1, MonthConstants.JULY, 2002), 109906);
557         series1.add(new Day(2, MonthConstants.JULY, 2002), 140644);
558         series1.add(new Day(3, MonthConstants.JULY, 2002), 150898);
559
560         series1.add(new Day(5, MonthConstants.JULY, 2002), 181355);
561
562         series1.add(new Day(8, MonthConstants.JULY, 2002), 155042);
563         series1.add(new Day(9, MonthConstants.JULY, 2002), 204305);
564         series1.add(new Day(10, MonthConstants.JULY, 2002), 300113);
565         series1.add(new Day(11, MonthConstants.JULY, 2002), 338948);
566         series1.add(new Day(12, MonthConstants.JULY, 2002), 281325);
567
568         series1.add(new Day(15, MonthConstants.JULY, 2002), 256101);
569         series1.add(new Day(16, MonthConstants.JULY, 2002), 348164);
570         series1.add(new Day(17, MonthConstants.JULY, 2002), 242995);
571         series1.add(new Day(18, MonthConstants.JULY, 2002), 200744);
572         series1.add(new Day(19, MonthConstants.JULY, 2002), 181071);
573
574         series1.add(new Day(22, MonthConstants.JULY, 2002), 163266);
575         series1.add(new Day(23, MonthConstants.JULY, 2002), 188508);
576         series1.add(new Day(24, MonthConstants.JULY, 2002), 308070);
577         series1.add(new Day(25, MonthConstants.JULY, 2002), 230901);
578         series1.add(new Day(26, MonthConstants.JULY, 2002), 162577);
579
580         series1.add(new Day(29, MonthConstants.JULY, 2002), 216318);
581         series1.add(new Day(30, MonthConstants.JULY, 2002), 280677);
582         series1.add(new Day(31, MonthConstants.JULY, 2002), 260236);
583         series1.add(new Day(1, MonthConstants.AUGUST, 2002), 242803);
584         series1.add(new Day(2, MonthConstants.AUGUST, 2002), 298490);
585
586         series1.add(new Day(5, MonthConstants.AUGUST, 2002), 182890);
587         series1.add(new Day(6, MonthConstants.AUGUST, 2002), 232273);
588         series1.add(new Day(7, MonthConstants.AUGUST, 2002), 253552);
589         series1.add(new Day(8, MonthConstants.AUGUST, 2002), 165365);
590         series1.add(new Day(9, MonthConstants.AUGUST, 2002), 160382);
591
592         series1.add(new Day(12, MonthConstants.AUGUST, 2002), 118030);
593         series1.add(new Day(13, MonthConstants.AUGUST, 2002), 208807);
594         series1.add(new Day(14, MonthConstants.AUGUST, 2002), 231599);
595         series1.add(new Day(15, MonthConstants.AUGUST, 2002), 343482);
596         series1.add(new Day(16, MonthConstants.AUGUST, 2002), 186116);
597
598         series1.add(new Day(19, MonthConstants.AUGUST, 2002), 96437);
599         series1.add(new Day(20, MonthConstants.AUGUST, 2002), 151735);
600         series1.add(new Day(21, MonthConstants.AUGUST, 2002), 167390);
601         series1.add(new Day(22, MonthConstants.AUGUST, 2002), 127184);
602         series1.add(new Day(23, MonthConstants.AUGUST, 2002), 80205);
603
604         series1.add(new Day(26, MonthConstants.AUGUST, 2002), 79893);
605         series1.add(new Day(27, MonthConstants.AUGUST, 2002), 201723);
606         series1.add(new Day(28, MonthConstants.AUGUST, 2002), 114001);
607         series1.add(new Day(29, MonthConstants.AUGUST, 2002), 188389);
608         series1.add(new Day(30, MonthConstants.AUGUST, 2002), 162801);
609
610         series1.add(new Day(3, MonthConstants.SEPTEMBER, 2002), 200951);
611         series1.add(new Day(4, MonthConstants.SEPTEMBER, 2002), 129229);
612         series1.add(new Day(5, MonthConstants.SEPTEMBER, 2002), 183348);
613         series1.add(new Day(6, MonthConstants.SEPTEMBER, 2002), 216722);
614
615         series1.add(new Day(9, MonthConstants.SEPTEMBER, 2002), 128575);
616         series1.add(new Day(10, MonthConstants.SEPTEMBER, 2002), 224714);
617         series1.add(new Day(11, MonthConstants.SEPTEMBER, 2002), 144224);
618         series1.add(new Day(12, MonthConstants.SEPTEMBER, 2002), 195721);
619         series1.add(new Day(13, MonthConstants.SEPTEMBER, 2002), 160724);
620
621         series1.add(new Day(16, MonthConstants.SEPTEMBER, 2002), 65473);
622         series1.add(new Day(17, MonthConstants.SEPTEMBER, 2002), 141274);
623         series1.add(new Day(18, MonthConstants.SEPTEMBER, 2002), 115084);
624         series1.add(new Day(19, MonthConstants.SEPTEMBER, 2002), 242106);
625         series1.add(new Day(20, MonthConstants.SEPTEMBER, 2002), 130034);
626
627         series1.add(new Day(23, MonthConstants.SEPTEMBER, 2002), 95215);
628         series1.add(new Day(24, MonthConstants.SEPTEMBER, 2002), 229288);
629         series1.add(new Day(25, MonthConstants.SEPTEMBER, 2002), 163672);
630         series1.add(new Day(26, MonthConstants.SEPTEMBER, 2002), 193573);
631         series1.add(new Day(27, MonthConstants.SEPTEMBER, 2002), 170741);
632
633         series1.add(new Day(30, MonthConstants.SEPTEMBER, 2002), 199615);
634         series1.add(new Day(1, MonthConstants.OCTOBER, 2002), 170771);
635         series1.add(new Day(2, MonthConstants.OCTOBER, 2002), 138498);
636         series1.add(new Day(3, MonthConstants.OCTOBER, 2002), 154774);
637         series1.add(new Day(4, MonthConstants.OCTOBER, 2002), 287154);
638
639         series1.add(new Day(7, MonthConstants.OCTOBER, 2002), 111762);
640         series1.add(new Day(8, MonthConstants.OCTOBER, 2002), 172535);
641         series1.add(new Day(9, MonthConstants.OCTOBER, 2002), 148339);
642         series1.add(new Day(10, MonthConstants.OCTOBER, 2002), 178796);
643         series1.add(new Day(11, MonthConstants.OCTOBER, 2002), 153499);
644
645         series1.add(new Day(14, MonthConstants.OCTOBER, 2002), 4589);
646         series1.add(new Day(15, MonthConstants.OCTOBER, 2002), 172088);
647         series1.add(new Day(16, MonthConstants.OCTOBER, 2002), 151267);
648         series1.add(new Day(17, MonthConstants.OCTOBER, 2002), 222680);
649         series1.add(new Day(18, MonthConstants.OCTOBER, 2002), 127019);
650
651         series1.add(new Day(21, MonthConstants.OCTOBER, 2002), 118226);
652         series1.add(new Day(22, MonthConstants.OCTOBER, 2002), 183031);
653         series1.add(new Day(23, MonthConstants.OCTOBER, 2002), 221005);
654         series1.add(new Day(24, MonthConstants.OCTOBER, 2002), 121333);
655         series1.add(new Day(25, MonthConstants.OCTOBER, 2002), 138179);
656
657         series1.add(new Day(28, MonthConstants.OCTOBER, 2002), 162012);
658         series1.add(new Day(29, MonthConstants.OCTOBER, 2002), 237355);
659         series1.add(new Day(30, MonthConstants.OCTOBER, 2002), 161650);
660         series1.add(new Day(31, MonthConstants.OCTOBER, 2002), 207569);
661
662         return new TimeSeriesCollection(series1);
663
664     }
665
666     // ****************************************************************************
667
// * COMMERCIAL SUPPORT / JFREECHART DEVELOPER GUIDE *
668
// * Please note that commercial support and documentation is available from: *
669
// * *
670
// * http://www.object-refinery.com/jfreechart/support.html *
671
// * *
672
// * This is not only a great service for developers, but is a VERY IMPORTANT *
673
// * source of funding for the JFreeChart project. Please support us so that *
674
// * we can continue developing free software. *
675
// ****************************************************************************
676

677     /**
678      * Starting point for the price/volume chart demo application.
679      *
680      * @param args ignored.
681      */

682     public static void main(String JavaDoc[] args) {
683
684         PriceVolumeDemo demo = new PriceVolumeDemo("Price Volume Chart Demo");
685         demo.pack();
686         RefineryUtilities.centerFrameOnScreen(demo);
687         demo.setVisible(true);
688
689     }
690
691 }
692
Popular Tags