Package org.jfree.data.time

Examples of org.jfree.data.time.Month


        int monthInt=Integer.valueOf(month).intValue();
        int yearInt=Integer.valueOf(year).intValue();

        double valueD=Double.valueOf(valueS);
        Month monthTo=new Month(monthInt,yearInt);
        timeSeries.add(monthTo,valueD);
      }
      //close run rows

View Full Code Here


    int separator=columnKey.indexOf('-');
    String month=columnKey.substring(0,separator);
    String year=columnKey.substring(separator+1);
    Number value=dataset.getValue(row, column);     // value put in dataset (- 0.5 or 0.5)

    Month currentMonth=new Month(Integer.valueOf(month),Integer.valueOf(year));   // value for that month
    TimeSeriesDataItem item = timeSeries.getDataItem(currentMonth);

    if(nullValues.contains(columnKey)){
      return background;
    }
View Full Code Here

            case (DateTickUnit.MONTH) :
                years = calendar.get(Calendar.YEAR);
                calendar.clear(Calendar.MILLISECOND);
                calendar.set(years, value, 1, 0, 0, 0);
                Month month = new Month(calendar.getTime(), this.timeZone,
                        this.locale);
                Date standardDate = calculateDateForPosition(
                        month, this.tickMarkPosition);
                long millis = standardDate.getTime();
                if (millis >= date.getTime()) {
                    month = (Month) month.previous();
                    // need to peg the month in case the time zone isn't the
                    // default - see bug 2078057
                    month.peg(Calendar.getInstance(this.timeZone));
                    standardDate = calculateDateForPosition(
                            month, this.tickMarkPosition);
                }
                return standardDate;
View Full Code Here

            case (DateTickUnit.MINUTE) :
            case (DateTickUnit.HOUR) :
            case (DateTickUnit.DAY) :
                break;
            case (DateTickUnit.MONTH) :
                result = calculateDateForPosition(new Month(time,
                        this.timeZone, this.locale), position);
                break;
            case(DateTickUnit.YEAR) :
                result = calculateDateForPosition(new Year(time,
                        this.timeZone, this.locale), position);
View Full Code Here

     * @param args  ignored.
     */
    public static void main(String[] args) {
        MonthDateFormat mdf = new MonthDateFormat(Locale.UK, 2);
        System.out.println("UK:");
        System.out.println(mdf.format(new Month(1, 2005).getStart()));
        System.out.println(mdf.format(new Month(2, 2005).getStart()));
        System.out.println(mdf.format(new Month(3, 2005).getStart()));
        System.out.println(mdf.format(new Month(4, 2005).getStart()));
        System.out.println(mdf.format(new Month(5, 2005).getStart()));
        System.out.println(mdf.format(new Month(6, 2005).getStart()));
        System.out.println(mdf.format(new Month(7, 2005).getStart()));
        System.out.println(mdf.format(new Month(8, 2005).getStart()));
        System.out.println(mdf.format(new Month(9, 2005).getStart()));
        System.out.println(mdf.format(new Month(10, 2005).getStart()));
        System.out.println(mdf.format(new Month(11, 2005).getStart()));
        System.out.println(mdf.format(new Month(12, 2005).getStart()));
        System.out.println();

        mdf = new MonthDateFormat(Locale.GERMANY, 2);
        System.out.println("GERMANY:");
        System.out.println(mdf.format(new Month(1, 2005).getStart()));
        System.out.println(mdf.format(new Month(2, 2005).getStart()));
        System.out.println(mdf.format(new Month(3, 2005).getStart()));
        System.out.println(mdf.format(new Month(4, 2005).getStart()));
        System.out.println(mdf.format(new Month(5, 2005).getStart()));
        System.out.println(mdf.format(new Month(6, 2005).getStart()));
        System.out.println(mdf.format(new Month(7, 2005).getStart()));
        System.out.println(mdf.format(new Month(8, 2005).getStart()));
        System.out.println(mdf.format(new Month(9, 2005).getStart()));
        System.out.println(mdf.format(new Month(10, 2005).getStart()));
        System.out.println(mdf.format(new Month(11, 2005).getStart()));
        System.out.println(mdf.format(new Month(12, 2005).getStart()));
        System.out.println();

        mdf = new MonthDateFormat(Locale.FRANCE, 2);
        System.out.println("FRANCE:");
        System.out.println(mdf.format(new Month(1, 2005).getStart()));
        System.out.println(mdf.format(new Month(2, 2005).getStart()));
        System.out.println(mdf.format(new Month(3, 2005).getStart()));
        System.out.println(mdf.format(new Month(4, 2005).getStart()));
        System.out.println(mdf.format(new Month(5, 2005).getStart()));
        System.out.println(mdf.format(new Month(6, 2005).getStart()));
        System.out.println(mdf.format(new Month(7, 2005).getStart()));
        System.out.println(mdf.format(new Month(8, 2005).getStart()));
        System.out.println(mdf.format(new Month(9, 2005).getStart()));
        System.out.println(mdf.format(new Month(10, 2005).getStart()));
        System.out.println(mdf.format(new Month(11, 2005).getStart()));
        System.out.println(mdf.format(new Month(12, 2005).getStart()));
        System.out.println();

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
        sdf.setNumberFormat(null);
    }
View Full Code Here

     * @return The dataset.
     */
    private static XYDataset createDataset() {

        TimeSeries s1 = new TimeSeries("L&G European Index Trust");
        s1.add(new Month(2, 2001), 181.8);
        s1.add(new Month(3, 2001), 167.3);
        s1.add(new Month(4, 2001), 153.8);
        s1.add(new Month(5, 2001), 167.6);
        s1.add(new Month(6, 2001), 158.8);
        s1.add(new Month(7, 2001), 148.3);
        s1.add(new Month(8, 2001), 153.9);
        s1.add(new Month(9, 2001), 142.7);
        s1.add(new Month(10, 2001), 123.2);
        s1.add(new Month(11, 2001), 131.8);
        s1.add(new Month(12, 2001), 139.6);
        s1.add(new Month(1, 2002), 142.9);
        s1.add(new Month(2, 2002), 138.7);
        s1.add(new Month(3, 2002), 137.3);
        s1.add(new Month(4, 2002), 143.9);
        s1.add(new Month(5, 2002), 139.8);
        s1.add(new Month(6, 2002), 137.0);
        s1.add(new Month(7, 2002), 132.8);

        TimeSeries s2 = new TimeSeries("L&G UK Index Trust");
        s2.add(new Month(2, 2001), 129.6);
        s2.add(new Month(3, 2001), 123.2);
        s2.add(new Month(4, 2001), 117.2);
        s2.add(new Month(5, 2001), 124.1);
        s2.add(new Month(6, 2001), 122.6);
        s2.add(new Month(7, 2001), 119.2);
        s2.add(new Month(8, 2001), 116.5);
        s2.add(new Month(9, 2001), 112.7);
        s2.add(new Month(10, 2001), 101.5);
        s2.add(new Month(11, 2001), 106.1);
        s2.add(new Month(12, 2001), 110.3);
        s2.add(new Month(1, 2002), 111.7);
        s2.add(new Month(2, 2002), 111.0);
        s2.add(new Month(3, 2002), 109.6);
        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);

        // ******************************************************************
        //  More than 150 demo applications are included with the JFreeChart
        //  Developer Guide...for more information, see:
        //
View Full Code Here

            case (DateTickUnit.MONTH) :
                years = calendar.get(Calendar.YEAR);
                calendar.clear(Calendar.MILLISECOND);
                calendar.set(years, value, 1, 0, 0, 0);
                Month month = new Month(calendar.getTime(), this.timeZone,
                        this.locale);
                Date standardDate = calculateDateForPosition(
                        month, this.tickMarkPosition);
                long millis = standardDate.getTime();
                if (millis >= date.getTime()) {
                    month = (Month) month.previous();
                    // need to peg the month in case the time zone isn't the
                    // default - see bug 2078057
                    month.peg(Calendar.getInstance(this.timeZone));
                    standardDate = calculateDateForPosition(
                            month, this.tickMarkPosition);
                }
                return standardDate;
View Full Code Here

            case (DateTickUnit.MINUTE) :
            case (DateTickUnit.HOUR) :
            case (DateTickUnit.DAY) :
                break;
            case (DateTickUnit.MONTH) :
                result = calculateDateForPosition(new Month(time,
                        this.timeZone, this.locale), position);
                break;
            case(DateTickUnit.YEAR) :
                result = calculateDateForPosition(new Year(time,
                        this.timeZone, this.locale), position);
View Full Code Here

     */
    private static IntervalXYDataset createDataset1() {

        // create dataset 1...
        TimeSeries series1 = new TimeSeries("Series 1");
        series1.add(new Month(1, 2005), 7627.743);
        series1.add(new Month(2, 2005), 7713.138);
        series1.add(new Month(3, 2005), 6776.939);
        series1.add(new Month(4, 2005), 5764.537);
        series1.add(new Month(5, 2005), 4777.880);
        series1.add(new Month(6, 2005), 4836.496);
        series1.add(new Month(7, 2005), 3887.618);
        series1.add(new Month(8, 2005), 3926.933);
        series1.add(new Month(9, 2005), 4932.710);
        series1.add(new Month(10, 2005), 4027.123);
        series1.add(new Month(11, 2005), 8092.322);
        series1.add(new Month(12, 2005), 8170.414);
        series1.add(new Month(1, 2006), 8196.070);
        series1.add(new Month(2, 2006), 8269.886);
        series1.add(new Month(3, 2006), 5371.156);
        series1.add(new Month(4, 2006), 5355.718);
        series1.add(new Month(5, 2006), 5356.777);
        series1.add(new Month(6, 2006), 8420.042);
        series1.add(new Month(7, 2006), 8444.347);
        series1.add(new Month(8, 2006), 8515.034);
        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

     */
    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

TOP

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

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.