Package org.jfree.data.time

Examples of org.jfree.data.time.TimeSeriesCollection


    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        XYItemEntity e1 = new XYItemEntity(new Rectangle2D.Double(1.0, 2.0,
                3.0, 4.0), new TimeSeriesCollection(), 1, 9, "ToolTip", "URL");
        XYItemEntity e2 = null;

        try {
            e2 = (XYItemEntity) e1.clone();
        }
View Full Code Here


    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        XYItemEntity e1 = new XYItemEntity(new Rectangle2D.Double(1.0, 2.0,
                3.0, 4.0), new TimeSeriesCollection(), 1, 9, "ToolTip", "URL");
        XYItemEntity e2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(e1);
View Full Code Here

        s2.add(new Month(4, 2002), 113.2);
        s2.add(new Month(5, 2002), 111.6);
        s2.add(new Month(6, 2002), 108.8);
        s2.add(new Month(7, 2002), 101.6);
       
        TimeSeriesCollection dataset = new TimeSeriesCollection();
        dataset.addSeries(s1);
        dataset.addSeries(s2);
       
        return dataset;
    }
View Full Code Here

            series.add(period, value);   
            period = period.next();
            value = value * (1 + (Math.random() - 0.495) / 10.0);
        }

        TimeSeriesCollection dataset = new TimeSeriesCollection();
        dataset.addSeries(series);

        return dataset;

    }
View Full Code Here

        RegularTimePeriod t = new Day();
        TimeSeries series = new TimeSeries("Series 1");
        series.add(t, 36.4);
        t = t.next();
        series.add(t, 63.5);
        TimeSeriesCollection dataset = new TimeSeriesCollection();
        dataset.addSeries(series);

        JFreeChart c1 = ChartFactory.createTimeSeriesChart("Test", "Date",
                "Value", dataset, true, true, true);
        JFreeChart c2 = null;
View Full Code Here

        series1.add(new Month(9, 2006), 8506.974);
        series1.add(new Month(10, 2006), 8584.329);
        series1.add(new Month(11, 2006), 8633.246);
        series1.add(new Month(12, 2006), 8680.224);
        series1.add(new Month(1, 2007), 8707.561);
        return new TimeSeriesCollection(series1);

    }
View Full Code Here

     * this is the least complicated solution.
     *
     * @return A sample dataset.
     */
    private static IntervalXYDataset createDataset2() {
        TimeSeriesCollection dataset = new TimeSeriesCollection();

        TimeSeries series1 = new TimeSeries("Series 2");
        series1.add(new Month(1, 2005), 1200);
        series1.add(new Month(2, 2005), 1400);
        series1.add(new Month(3, 2005), 1500);
        series1.add(new Month(4, 2005), 1700);
        series1.add(new Month(5, 2005), 1600);
        series1.add(new Month(6, 2005), 2400);
        series1.add(new Month(7, 2005), 2100);
        series1.add(new Month(8, 2005), 2200);
        series1.add(new Month(9, 2005), 800);
        series1.add(new Month(10, 2005), 2350);
        series1.add(new Month(11, 2005), 500);
        series1.add(new Month(12, 2005), 700);
        series1.add(new Month(1, 2006), 900);
        series1.add(new Month(2, 2006), 1500);
        series1.add(new Month(3, 2006), 2100);
        series1.add(new Month(4, 2006), 2200);
        series1.add(new Month(5, 2006), 1900);
        series1.add(new Month(6, 2006), 3000);
        series1.add(new Month(7, 2006), 3780);
        series1.add(new Month(8, 2006), 4000);
        series1.add(new Month(9, 2006), 4500);
        series1.add(new Month(10, 2006), 7000);
        series1.add(new Month(11, 2006), 5500);
        series1.add(new Month(12, 2006), 6000);
        series1.add(new Month(1, 2007), 6500);
        dataset.addSeries(series1);
        return dataset;

    }
View Full Code Here

        RegularTimePeriod t = new Day();
        TimeSeries series = new TimeSeries("Series 1");
        series.add(t, 36.4);
        t = t.next();
        series.add(t, 63.5);
        TimeSeriesCollection dataset = new TimeSeriesCollection();
        dataset.addSeries(series);

        JFreeChart c1 = ChartFactory.createTimeSeriesChart("Test", "Date",
                "Value", dataset, true, true, true);
        JFreeChart c2 = null;
View Full Code Here

            series.add(period, value);
            period = period.next();
            value = value * (1 + (Math.random() - 0.495) / 10.0);
        }

        TimeSeriesCollection dataset = new TimeSeriesCollection();
        dataset.addSeries(series);

        return dataset;

    }
View Full Code Here

        s2.add(new Month(4, 2002), 113.2);
        s2.add(new Month(5, 2002), 111.6);
        s2.add(new Month(6, 2002), 108.8);
        s2.add(new Month(7, 2002), 101.6);
       
        TimeSeriesCollection dataset = new TimeSeriesCollection();
        dataset.addSeries(s1);
        dataset.addSeries(s2);
       
        return dataset;
    }
View Full Code Here

TOP

Related Classes of org.jfree.data.time.TimeSeriesCollection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.