ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter2/Test.java
Revision: 1.1
Committed: Sat Feb 3 14:56:14 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Log Message:
A rewrite of the database reporting tools.  These reflect the new way in
which the database stores the original XML rather than parameter and value
pairs.

File Contents

# User Rev Content
1 pjm2 1.1 //---PACKAGE DECLARATION---
2    
3     //---IMPORTS---
4     import java.util.*;
5     import java.awt.image.*;
6    
7     public class Test {
8    
9     public static void main(String[] args){
10    
11     long endDate = DateUtils.startOfToday();
12     long startDate = DateUtils.subtractDays(endDate, 1);
13    
14     PlotData pd = new PlotData(startDate, endDate);
15    
16     pd.addPoint(startDate, 1);
17     pd.addPoint(startDate + 3600, 2);
18     pd.addPoint(startDate + 3600*2, 3);
19     pd.addPoint(startDate + 3600*3, 4);
20     pd.addPoint(startDate + 3600*3, 50);
21     pd.flushPoints();
22    
23     pd.scaleToFitX(SHTMLLayout.CHART_WIDTH, SHTMLLayout.CHART_HEIGHT);
24    
25     IscreamChart chart = new IscreamChart(startDate, endDate);
26    
27     BufferedImage img = chart.drawChart(pd, SHTMLLayout.CHART_WIDTH, SHTMLLayout.CHART_HEIGHT, 24, 10, 50);
28    
29     IscreamChartWriter imgWriter = new IscreamChartWriter();
30     imgWriter.writeChart(img, "test.gif");
31    
32    
33     }
34    
35     }