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 |
|
|
} |