1 37 38 package org.jfree.chart.demo; 39 40 import org.jfree.chart.ChartFactory; 41 import org.jfree.chart.ChartPanel; 42 import org.jfree.chart.JFreeChart; 43 import org.jfree.data.XYDataset; 44 import org.jfree.data.time.TimeSeriesCollection; 45 import org.jfree.ui.ApplicationFrame; 46 import org.jfree.ui.RefineryUtilities; 47 48 53 public class TimeSeriesDemo7 extends ApplicationFrame { 54 55 60 public TimeSeriesDemo7(String title) { 61 62 super(title); 63 64 String chartTitle = "Time Series Demo"; 66 XYDataset dataset = new TimeSeriesCollection(DemoDatasetFactory.createEURTimeSeries()); 67 68 JFreeChart chart = ChartFactory.createTimeSeriesChart( 69 chartTitle, 70 "Date", 71 "Value", 72 dataset, 73 true, 74 true, 75 false 76 ); 77 78 ChartPanel chartPanel = new ChartPanel(chart); 79 chartPanel.setPreferredSize(new java.awt.Dimension (500, 270)); 80 setContentPane(chartPanel); 81 82 } 83 84 95 100 public static void main(String [] args) { 101 102 TimeSeriesDemo7 demo = new TimeSeriesDemo7("Time Series Demo 7"); 103 demo.pack(); 104 RefineryUtilities.centerFrameOnScreen(demo); 105 demo.setVisible(true); 106 107 } 108 109 } 110 | Popular Tags |