2 // Copyright (c) 2010 Anthony Towns
9 import org.jfree.chart.JFreeChart;
10 import org.jfree.chart.ChartUtilities;
12 abstract class AltosGraph {
13 public String filename;
14 public abstract void addData(AltosDataPoint d);
15 public abstract JFreeChart createChart();
17 public void toPNG() throws java.io.IOException { toPNG(300, 500); }
18 public void toPNG(int width, int height)
19 throws java.io.IOException
21 File pngout = new File(filename);
22 JFreeChart chart = createChart();
23 ChartUtilities.saveChartAsPNG(pngout, chart, width, height);
24 System.out.println("Created " + filename);