Package org.jfree.data.time

Examples of org.jfree.data.time.Day


  {
    if (sampleTimePeriodDataset == null)
    {
      TimePeriodValuesCollection dataset = new TimePeriodValuesCollection();

      Day today = new Day();
      TimePeriodValues series1 = new TimePeriodValues("First");
      TimePeriodValues series2 = new TimePeriodValues("Second");
     
      for (int i = 0; i < 24; i++)
      {
View Full Code Here


    }

    private static TimeSeries createEURTimeSeries() {
        TimeSeries timeseries = new TimeSeries("EUR/GBP");
        try {
            timeseries.add(new Day(2, 1, 2001), new Double(1.5788D));
            timeseries.add(new Day(3, 1, 2001), new Double(1.5912999999999999D));
            timeseries.add(new Day(4, 1, 2001), new Double(1.5807D));
            timeseries.add(new Day(5, 1, 2001), new Double(1.5710999999999999D));
            timeseries.add(new Day(8, 1, 2001), new Double(1.5778000000000001D));
            timeseries.add(new Day(9, 1, 2001), new Double(1.5851D));
            timeseries.add(new Day(10, 1, 2001), new Double(1.5846D));
            timeseries.add(new Day(11, 1, 2001), new Double(1.5727D));
            timeseries.add(new Day(12, 1, 2001), new Double(1.5585D));
            timeseries.add(new Day(15, 1, 2001), new Double(1.5693999999999999D));
            timeseries.add(new Day(16, 1, 2001), new Double(1.5629D));
            timeseries.add(new Day(17, 1, 2001), new Double(1.5831D));
            timeseries.add(new Day(18, 1, 2001), new Double(1.5624D));
            timeseries.add(new Day(19, 1, 2001), new Double(1.5693999999999999D));
            timeseries.add(new Day(22, 1, 2001), new Double(1.5615000000000001D));
            timeseries.add(new Day(23, 1, 2001), new Double(1.5656000000000001D));
            timeseries.add(new Day(24, 1, 2001), new Double(1.5794999999999999D));
            timeseries.add(new Day(25, 1, 2001), new Double(1.5851999999999999D));
            timeseries.add(new Day(26, 1, 2001), new Double(1.5797000000000001D));
            timeseries.add(new Day(29, 1, 2001), new Double(1.5862000000000001D));
            timeseries.add(new Day(30, 1, 2001), new Double(1.5803D));
            timeseries.add(new Day(31, 1, 2001), new Double(1.5713999999999999D));
            timeseries.add(new Day(1, 2, 2001), new Double(1.5717000000000001D));
            timeseries.add(new Day(2, 2, 2001), new Double(1.5734999999999999D));
            timeseries.add(new Day(5, 2, 2001), new Double(1.5690999999999999D));
            timeseries.add(new Day(6, 2, 2001), new Double(1.5676000000000001D));
            timeseries.add(new Day(7, 2, 2001), new Double(1.5677000000000001D));
            timeseries.add(new Day(8, 2, 2001), new Double(1.5737000000000001D));
            timeseries.add(new Day(9, 2, 2001), new Double(1.5653999999999999D));
            timeseries.add(new Day(12, 2, 2001), new Double(1.5621D));
            timeseries.add(new Day(13, 2, 2001), new Double(1.5761000000000001D));
            timeseries.add(new Day(14, 2, 2001), new Double(1.5898000000000001D));
            timeseries.add(new Day(15, 2, 2001), new Double(1.6045D));
            timeseries.add(new Day(16, 2, 2001), new Double(1.5851999999999999D));
            timeseries.add(new Day(19, 2, 2001), new Double(1.5704D));
            timeseries.add(new Day(20, 2, 2001), new Double(1.5891999999999999D));
            timeseries.add(new Day(21, 2, 2001), new Double(1.5844D));
            timeseries.add(new Day(22, 2, 2001), new Double(1.5933999999999999D));
            timeseries.add(new Day(23, 2, 2001), new Double(1.5951D));
            timeseries.add(new Day(26, 2, 2001), new Double(1.5848D));
            timeseries.add(new Day(27, 2, 2001), new Double(1.5706D));
            timeseries.add(new Day(28, 2, 2001), new Double(1.5680000000000001D));
            timeseries.add(new Day(1, 3, 2001), new Double(1.5645D));
            timeseries.add(new Day(2, 3, 2001), new Double(1.5753999999999999D));
            timeseries.add(new Day(5, 3, 2001), new Double(1.5808D));
            timeseries.add(new Day(6, 3, 2001), new Double(1.5766D));
            timeseries.add(new Day(7, 3, 2001), new Double(1.5755999999999999D));
            timeseries.add(new Day(8, 3, 2001), new Double(1.5760000000000001D));
            timeseries.add(new Day(9, 3, 2001), new Double(1.5748D));
            timeseries.add(new Day(12, 3, 2001), new Double(1.5779000000000001D));
            timeseries.add(new Day(13, 3, 2001), new Double(1.5837000000000001D));
            timeseries.add(new Day(14, 3, 2001), new Double(1.5886D));
            timeseries.add(new Day(15, 3, 2001), new Double(1.5931D));
            timeseries.add(new Day(16, 3, 2001), new Double(1.5945D));
            timeseries.add(new Day(19, 3, 2001), new Double(1.5880000000000001D));
            timeseries.add(new Day(20, 3, 2001), new Double(1.5817000000000001D));
            timeseries.add(new Day(21, 3, 2001), new Double(1.5927D));
            timeseries.add(new Day(22, 3, 2001), new Double(1.6065D));
            timeseries.add(new Day(23, 3, 2001), new Double(1.6006D));
            timeseries.add(new Day(26, 3, 2001), new Double(1.6007D));
            timeseries.add(new Day(27, 3, 2001), new Double(1.5989D));
            timeseries.add(new Day(28, 3, 2001), new Double(1.6134999999999999D));
            timeseries.add(new Day(29, 3, 2001), new Double(1.6282000000000001D));
            timeseries.add(new Day(30, 3, 2001), new Double(1.609D));
            timeseries.add(new Day(2, 4, 2001), new Double(1.6107D));
            timeseries.add(new Day(3, 4, 2001), new Double(1.6093D));
            timeseries.add(new Day(4, 4, 2001), new Double(1.5880000000000001D));
            timeseries.add(new Day(5, 4, 2001), new Double(1.5931D));
            timeseries.add(new Day(6, 4, 2001), new Double(1.5968D));
            timeseries.add(new Day(9, 4, 2001), new Double(1.6072D));
            timeseries.add(new Day(10, 4, 2001), new Double(1.6167D));
            timeseries.add(new Day(11, 4, 2001), new Double(1.6214D));
            timeseries.add(new Day(12, 4, 2001), new Double(1.6120000000000001D));
            timeseries.add(new Day(17, 4, 2001), new Double(1.6229D));
            timeseries.add(new Day(18, 4, 2001), new Double(1.6297999999999999D));
            timeseries.add(new Day(19, 4, 2001), new Double(1.6158999999999999D));
            timeseries.add(new Day(20, 4, 2001), new Double(1.5995999999999999D));
            timeseries.add(new Day(23, 4, 2001), new Double(1.6042000000000001D));
            timeseries.add(new Day(24, 4, 2001), new Double(1.6061000000000001D));
            timeseries.add(new Day(25, 4, 2001), new Double(1.6045D));
            timeseries.add(new Day(26, 4, 2001), new Double(1.597D));
            timeseries.add(new Day(27, 4, 2001), new Double(1.6094999999999999D));
            timeseries.add(new Day(30, 4, 2001), new Double(1.6141000000000001D));
            timeseries.add(new Day(1, 5, 2001), new Double(1.6075999999999999D));
            timeseries.add(new Day(2, 5, 2001), new Double(1.6076999999999999D));
            timeseries.add(new Day(3, 5, 2001), new Double(1.6034999999999999D));
            timeseries.add(new Day(4, 5, 2001), new Double(1.6060000000000001D));
            timeseries.add(new Day(8, 5, 2001), new Double(1.6177999999999999D));
            timeseries.add(new Day(9, 5, 2001), new Double(1.6083000000000001D));
            timeseries.add(new Day(10, 5, 2001), new Double(1.6107D));
            timeseries.add(new Day(11, 5, 2001), new Double(1.6209D));
            timeseries.add(new Day(14, 5, 2001), new Double(1.6228D));
            timeseries.add(new Day(15, 5, 2001), new Double(1.6184000000000001D));
            timeseries.add(new Day(16, 5, 2001), new Double(1.6167D));
            timeseries.add(new Day(17, 5, 2001), new Double(1.6223000000000001D));
            timeseries.add(new Day(18, 5, 2001), new Double(1.6305000000000001D));
            timeseries.add(new Day(21, 5, 2001), new Double(1.6419999999999999D));
            timeseries.add(new Day(22, 5, 2001), new Double(1.6484000000000001D));
            timeseries.add(new Day(23, 5, 2001), new Double(1.6547000000000001D));
            timeseries.add(new Day(24, 5, 2001), new Double(1.6444000000000001D));
            timeseries.add(new Day(25, 5, 2001), new Double(1.6577D));
            timeseries.add(new Day(29, 5, 2001), new Double(1.6606000000000001D));
            timeseries.add(new Day(30, 5, 2001), new Double(1.6604000000000001D));
            timeseries.add(new Day(31, 5, 2001), new Double(1.6772D));
            timeseries.add(new Day(1, 6, 2001), new Double(1.6717D));
            timeseries.add(new Day(4, 6, 2001), new Double(1.6685000000000001D));
            timeseries.add(new Day(5, 6, 2001), new Double(1.6620999999999999D));
            timeseries.add(new Day(6, 6, 2001), new Double(1.6459999999999999D));
            timeseries.add(new Day(7, 6, 2001), new Double(1.6333D));
            timeseries.add(new Day(8, 6, 2001), new Double(1.6265000000000001D));
            timeseries.add(new Day(11, 6, 2001), new Double(1.6311D));
            timeseries.add(new Day(12, 6, 2001), new Double(1.6237999999999999D));
            timeseries.add(new Day(13, 6, 2001), new Double(1.6299999999999999D));
            timeseries.add(new Day(14, 6, 2001), new Double(1.6289D));
            timeseries.add(new Day(15, 6, 2001), new Double(1.6275999999999999D));
            timeseries.add(new Day(18, 6, 2001), new Double(1.6298999999999999D));
            timeseries.add(new Day(19, 6, 2001), new Double(1.6353D));
            timeseries.add(new Day(20, 6, 2001), new Double(1.6377999999999999D));
            timeseries.add(new Day(21, 6, 2001), new Double(1.6567000000000001D));
            timeseries.add(new Day(22, 6, 2001), new Double(1.6523000000000001D));
            timeseries.add(new Day(25, 6, 2001), new Double(1.6417999999999999D));
            timeseries.add(new Day(26, 6, 2001), new Double(1.6429D));
            timeseries.add(new Day(27, 6, 2001), new Double(1.6438999999999999D));
            timeseries.add(new Day(28, 6, 2001), new Double(1.6605000000000001D));
            timeseries.add(new Day(29, 6, 2001), new Double(1.6598999999999999D));
            timeseries.add(new Day(2, 7, 2001), new Double(1.6727000000000001D));
            timeseries.add(new Day(3, 7, 2001), new Double(1.6619999999999999D));
            timeseries.add(new Day(4, 7, 2001), new Double(1.6628000000000001D));
            timeseries.add(new Day(5, 7, 2001), new Double(1.673D));
            timeseries.add(new Day(6, 7, 2001), new Double(1.6649D));
            timeseries.add(new Day(9, 7, 2001), new Double(1.6603000000000001D));
            timeseries.add(new Day(10, 7, 2001), new Double(1.6489D));
            timeseries.add(new Day(11, 7, 2001), new Double(1.6420999999999999D));
            timeseries.add(new Day(12, 7, 2001), new Double(1.6497999999999999D));
            timeseries.add(new Day(13, 7, 2001), new Double(1.6447000000000001D));
            timeseries.add(new Day(16, 7, 2001), new Double(1.6373D));
            timeseries.add(new Day(17, 7, 2001), new Double(1.6443000000000001D));
            timeseries.add(new Day(18, 7, 2001), new Double(1.6246D));
            timeseries.add(new Day(19, 7, 2001), new Double(1.6294999999999999D));
            timeseries.add(new Day(20, 7, 2001), new Double(1.6362000000000001D));
            timeseries.add(new Day(23, 7, 2001), new Double(1.6348D));
            timeseries.add(new Day(24, 7, 2001), new Double(1.6242000000000001D));
            timeseries.add(new Day(25, 7, 2001), new Double(1.6241000000000001D));
            timeseries.add(new Day(26, 7, 2001), new Double(1.6281000000000001D));
            timeseries.add(new Day(27, 7, 2001), new Double(1.6295999999999999D));
            timeseries.add(new Day(30, 7, 2001), new Double(1.6278999999999999D));
            timeseries.add(new Day(31, 7, 2001), new Double(1.6299999999999999D));
            timeseries.add(new Day(1, 8, 2001), new Double(1.629D));
            timeseries.add(new Day(2, 8, 2001), new Double(1.6236999999999999D));
            timeseries.add(new Day(3, 8, 2001), new Double(1.6137999999999999D));
            timeseries.add(new Day(6, 8, 2001), new Double(1.6121000000000001D));
            timeseries.add(new Day(7, 8, 2001), new Double(1.617D));
            timeseries.add(new Day(8, 8, 2001), new Double(1.6134999999999999D));
            timeseries.add(new Day(9, 8, 2001), new Double(1.5995999999999999D));
            timeseries.add(new Day(10, 8, 2001), new Double(1.5931D));
            timeseries.add(new Day(13, 8, 2001), new Double(1.5828D));
            timeseries.add(new Day(14, 8, 2001), new Double(1.5824D));
            timeseries.add(new Day(15, 8, 2001), new Double(1.5783D));
            timeseries.add(new Day(16, 8, 2001), new Double(1.581D));
            timeseries.add(new Day(17, 8, 2001), new Double(1.5761000000000001D));
            timeseries.add(new Day(20, 8, 2001), new Double(1.5831D));
            timeseries.add(new Day(21, 8, 2001), new Double(1.587D));
            timeseries.add(new Day(22, 8, 2001), new Double(1.5808D));
            timeseries.add(new Day(23, 8, 2001), new Double(1.5845D));
            timeseries.add(new Day(24, 8, 2001), new Double(1.5844D));
            timeseries.add(new Day(28, 8, 2001), new Double(1.5924D));
            timeseries.add(new Day(29, 8, 2001), new Double(1.595D));
            timeseries.add(new Day(30, 8, 2001), new Double(1.5941000000000001D));
            timeseries.add(new Day(31, 8, 2001), new Double(1.5968D));
            timeseries.add(new Day(3, 9, 2001), new Double(1.6020000000000001D));
            timeseries.add(new Day(4, 9, 2001), new Double(1.6235999999999999D));
            timeseries.add(new Day(5, 9, 2001), new Double(1.6352D));
            timeseries.add(new Day(6, 9, 2001), new Double(1.6302000000000001D));
            timeseries.add(new Day(7, 9, 2001), new Double(1.6180000000000001D));
            timeseries.add(new Day(10, 9, 2001), new Double(1.6217999999999999D));
            timeseries.add(new Day(11, 9, 2001), new Double(1.6182000000000001D));
            timeseries.add(new Day(12, 9, 2001), new Double(1.6156999999999999D));
            timeseries.add(new Day(13, 9, 2001), new Double(1.6171D));
            timeseries.add(new Day(14, 9, 2001), new Double(1.5960000000000001D));
            timeseries.add(new Day(17, 9, 2001), new Double(1.5952D));
            timeseries.add(new Day(18, 9, 2001), new Double(1.5863D));
            timeseries.add(new Day(19, 9, 2001), new Double(1.579D));
            timeseries.add(new Day(20, 9, 2001), new Double(1.5810999999999999D));
            timeseries.add(new Day(21, 9, 2001), new Double(1.5916999999999999D));
            timeseries.add(new Day(24, 9, 2001), new Double(1.6005D));
            timeseries.add(new Day(25, 9, 2001), new Double(1.5914999999999999D));
            timeseries.add(new Day(26, 9, 2001), new Double(1.6012D));
            timeseries.add(new Day(27, 9, 2001), new Double(1.6032D));
            timeseries.add(new Day(28, 9, 2001), new Double(1.6133D));
            timeseries.add(new Day(1, 10, 2001), new Double(1.6147D));
            timeseries.add(new Day(2, 10, 2001), new Double(1.6002000000000001D));
            timeseries.add(new Day(3, 10, 2001), new Double(1.6041000000000001D));
            timeseries.add(new Day(4, 10, 2001), new Double(1.6172D));
            timeseries.add(new Day(5, 10, 2001), new Double(1.6121000000000001D));
            timeseries.add(new Day(8, 10, 2001), new Double(1.6044D));
            timeseries.add(new Day(9, 10, 2001), new Double(1.5973999999999999D));
            timeseries.add(new Day(10, 10, 2001), new Double(1.5914999999999999D));
            timeseries.add(new Day(11, 10, 2001), new Double(1.6022000000000001D));
            timeseries.add(new Day(12, 10, 2001), new Double(1.6013999999999999D));
            timeseries.add(new Day(15, 10, 2001), new Double(1.5942000000000001D));
            timeseries.add(new Day(16, 10, 2001), new Double(1.5925D));
            timeseries.add(new Day(17, 10, 2001), new Double(1.6007D));
            timeseries.add(new Day(18, 10, 2001), new Double(1.6000000000000001D));
            timeseries.add(new Day(19, 10, 2001), new Double(1.603D));
            timeseries.add(new Day(22, 10, 2001), new Double(1.6013999999999999D));
            timeseries.add(new Day(23, 10, 2001), new Double(1.5994999999999999D));
            timeseries.add(new Day(24, 10, 2001), new Double(1.5951D));
            timeseries.add(new Day(25, 10, 2001), new Double(1.5952999999999999D));
            timeseries.add(new Day(26, 10, 2001), new Double(1.6056999999999999D));
            timeseries.add(new Day(29, 10, 2001), new Double(1.6051D));
            timeseries.add(new Day(30, 10, 2001), new Double(1.6027D));
            timeseries.add(new Day(31, 10, 2001), new Double(1.6144000000000001D));
            timeseries.add(new Day(1, 11, 2001), new Double(1.6138999999999999D));
            timeseries.add(new Day(2, 11, 2001), new Double(1.6189D));
            timeseries.add(new Day(5, 11, 2001), new Double(1.6248D));
            timeseries.add(new Day(6, 11, 2001), new Double(1.6267D));
            timeseries.add(new Day(7, 11, 2001), new Double(1.6281000000000001D));
            timeseries.add(new Day(8, 11, 2001), new Double(1.631D));
            timeseries.add(new Day(9, 11, 2001), new Double(1.6313D));
            timeseries.add(new Day(12, 11, 2001), new Double(1.6272D));
            timeseries.add(new Day(13, 11, 2001), new Double(1.6361000000000001D));
            timeseries.add(new Day(14, 11, 2001), new Double(1.6323000000000001D));
            timeseries.add(new Day(15, 11, 2001), new Double(1.6252D));
            timeseries.add(new Day(16, 11, 2001), new Double(1.6141000000000001D));
            timeseries.add(new Day(19, 11, 2001), new Double(1.6086D));
            timeseries.add(new Day(20, 11, 2001), new Double(1.6054999999999999D));
            timeseries.add(new Day(21, 11, 2001), new Double(1.6132D));
            timeseries.add(new Day(22, 11, 2001), new Double(1.6073999999999999D));
            timeseries.add(new Day(23, 11, 2001), new Double(1.6065D));
            timeseries.add(new Day(26, 11, 2001), new Double(1.6061000000000001D));
            timeseries.add(new Day(27, 11, 2001), new Double(1.6039000000000001D));
            timeseries.add(new Day(28, 11, 2001), new Double(1.6069D));
            timeseries.add(new Day(29, 11, 2001), new Double(1.6044D));
            timeseries.add(new Day(30, 11, 2001), new Double(1.5928D));
        } catch (Exception exception) {
            System.err.println(exception.getMessage());
        }
        return timeseries;
    }
View Full Code Here

        setContentPane(chartPanel);
    }

    private static JFreeChart createChart() {
        int giorniScala = 365;
        XYDataset dataset1 = createDataset("Rss", 100.0, new Day(), giorniScala);

        JFreeChart chart = ChartFactory.createTimeSeriesChart("Sinossi", "Mesi", "Scala Rss", dataset1, true, true, false);
        chart.setBackgroundPaint(Color.white);

        XYPlot plot = (XYPlot) chart.getPlot();
        plot.setOrientation(PlotOrientation.VERTICAL);
        plot.setBackgroundPaint(Color.white);
        plot.setDomainGridlinePaint(Color.white);
        plot.setRangeGridlinePaint(Color.white);

        // plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
        // plot.getRangeAxis().setFixedDimension(15.0);

        XYItemRenderer renderer = plot.getRenderer();
        renderer.setSeriesPaint(0, Color.green);

        // Mail
        NumberAxis axis2 = new NumberAxis("Scala Mail");
        axis2.setFixedDimension(10.0);
        axis2.setAutoRangeIncludesZero(false);
        axis2.setLabelPaint(Color.red);
        axis2.setTickLabelPaint(Color.red);
        plot.setRangeAxis(1, axis2);
        plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_LEFT);

        XYDataset dataset2 = createDataset("Mail", 1000.0, new Day(), 170);
        plot.setDataset(1, dataset2);
        plot.mapDatasetToRangeAxis(1, 1);

        XYItemRenderer renderer2 = new StandardXYItemRenderer();
        renderer2.setSeriesPaint(0, Color.red);
        plot.setRenderer(1, renderer2);

        // Sms
        NumberAxis axis3 = new NumberAxis("Scala Sms");
        axis3.setLabelPaint(Color.blue);
        axis3.setTickLabelPaint(Color.blue);
        plot.setRangeAxis(2, axis3);

        XYDataset dataset3 = createDataset("Sms", 10000.0, new Day(), 170);
        plot.setDataset(2, dataset3);
        plot.mapDatasetToRangeAxis(2, 2);

        XYItemRenderer renderer3 = new StandardXYItemRenderer();
        renderer3.setSeriesPaint(0, Color.blue);
View Full Code Here

  public ListLongSumBean<DummyBean> getDailyCountByCountries(Date aDate) {
    /**
     * we set the dateFrom time manually to hh/mm/ss = 00:00:01 and the
     * dateTo time manually to date + hh/mm/SS = 23:59:59.<br>
     */
    Day day = new Day(aDate);
    Date dateFrom = day.getStart();
    Date dateTo = day.getEnd();

    String str1 = " SELECT DISTINCT (countrycode.ccdCode2), countrycode.ccdName, count(*) as count ";
    String str2 = " FROM Ip2Country AS log_ip2country, CountryCode AS countrycode ";
    String str3 = " , SecLoginlog as secLoginLog ";
    String str4 = " WHERE secLoginLog.ip2Country = log_ip2country.id ";
View Full Code Here

        super(title);
        JPanel panel = new JPanel(new GridLayout(2, 2));
        panel.setPreferredSize(new java.awt.Dimension(800, 600));

        Day today = new Day();
        XYDataset dataset = createDataset("Series 1", 100.0, today, 365);

        JFreeChart chart1 = createChart("Chart 1 : 1 Year", dataset);
        ChartPanel chartPanel1 = new ChartPanel(chart1);
        panel.add(chartPanel1);

        JFreeChart chart2 = createChart("Chart 2 : 6 Months", dataset);
        SerialDate t = today.getSerialDate();
        SerialDate t6m = SerialDate.addMonths(-6, t);
        Day sixMonthsAgo = new Day(t6m);
        DateAxis axis2 = (DateAxis) chart2.getXYPlot().getDomainAxis();
        axis2.setRange(sixMonthsAgo.getStart(), today.getEnd());
        ChartPanel chartPanel2 = new ChartPanel(chart2);
        panel.add(chartPanel2);

        JFreeChart chart3 = createChart("Chart 3 : 3 Months", dataset);
        SerialDate t3m = SerialDate.addMonths(-3, t);
        Day threeMonthsAgo = new Day(t3m);
        DateAxis axis3 = (DateAxis) chart3.getXYPlot().getDomainAxis();
        axis3.setRange(threeMonthsAgo.getStart(), today.getEnd());
        ChartPanel chartPanel3 = new ChartPanel(chart3);
        panel.add(chartPanel3);

        JFreeChart chart4 = createChart("Chart 4 : 1 Month", dataset);
        SerialDate t1m = SerialDate.addMonths(-1, t);
        Day oneMonthsAgo = new Day(t1m);
        DateAxis axis4 = (DateAxis) chart4.getXYPlot().getDomainAxis();
        axis4.setRange(oneMonthsAgo.getStart(), today.getEnd());
        ChartPanel chartPanel4 = new ChartPanel(chart4);
        panel.add(chartPanel4);

        setContentPane(panel);
View Full Code Here

     * Creates a new axis.
     *
     * @param label  the axis label.
     */
    public PeriodAxis(String label) {
        this(label, new Day(), new Day());
    }
View Full Code Here

        int[] result = collection.getSurroundingItems(0, 1000L);
        assertTrue(result[0] == -1);
        assertTrue(result[1] == -1);

        // now test with a single value in the series...
        Day today = new Day();
        long start1 = today.getFirstMillisecond();
        long middle1 = today.getMiddleMillisecond();
        long end1 = today.getLastMillisecond();

        series.add(today, 99.9);
        result = collection.getSurroundingItems(0, start1);
        assertTrue(result[0] == -1);
        assertTrue(result[1] == 0);

        result = collection.getSurroundingItems(0, middle1);
        assertTrue(result[0] == 0);
        assertTrue(result[1] == 0);

        result = collection.getSurroundingItems(0, end1);
        assertTrue(result[0] == 0);
        assertTrue(result[1] == -1);

        // now add a second value to the series...
        Day tomorrow = (Day) today.next();
        long start2 = tomorrow.getFirstMillisecond();
        long middle2 = tomorrow.getMiddleMillisecond();
        long end2 = tomorrow.getLastMillisecond();

        series.add(tomorrow, 199.9);
        result = collection.getSurroundingItems(0, start2);
        assertTrue(result[0] == 0);
        assertTrue(result[1] == 1);

        result = collection.getSurroundingItems(0, middle2);
        assertTrue(result[0] == 1);
        assertTrue(result[1] == 1);

        result = collection.getSurroundingItems(0, end2);
        assertTrue(result[0] == 1);
        assertTrue(result[1] == -1);

        // now add a third value to the series...
        Day yesterday = (Day) today.previous();
        long start3 = yesterday.getFirstMillisecond();
        long middle3 = yesterday.getMiddleMillisecond();
        long end3 = yesterday.getLastMillisecond();

        series.add(yesterday, 1.23);
        result = collection.getSurroundingItems(0, start3);
        assertTrue(result[0] == -1);
        assertTrue(result[1] == 0);
View Full Code Here

     * Creates a time series for testing.
     *
     * @return A time series.
     */
    private TimeSeries createSeries() {
        RegularTimePeriod t = new Day();
        TimeSeries series = new TimeSeries("Test");
        series.add(t, 1.0);
        t = t.next();
        series.add(t, 2.0);
        t = t.next();
        series.add(t, null);
        t = t.next();
        series.add(t, 4.0);
        return series;
    }
View Full Code Here

    /**
     * Tests the equals method.
     */
    public void testEquals() {
        Day day1 = new Day(29, MonthConstants.MARCH, 2002);
        Hour hour1 = new Hour(15, day1);
        Minute minute1 = new Minute(15, hour1);
        Second second1 = new Second(34, minute1);
        Millisecond milli1 = new Millisecond(999, second1);
        Day day2 = new Day(29, MonthConstants.MARCH, 2002);
        Hour hour2 = new Hour(15, day2);
        Minute minute2 = new Minute(15, hour2);
        Second second2 = new Second(34, minute2);
        Millisecond milli2 = new Millisecond(999, second2);
        assertTrue(milli1.equals(milli2));
View Full Code Here

    /**
     * Tests the equals method.
     */
    public void testEquals() {
        Day day1 = new Day(29, MonthConstants.MARCH, 2002);
        Hour hour1 = new Hour(15, day1);
        Minute minute1 = new Minute(15, hour1);
        Second second1 = new Second(34, minute1);
        Day day2 = new Day(29, MonthConstants.MARCH, 2002);
        Hour hour2 = new Hour(15, day2);
        Minute minute2 = new Minute(15, hour2);
        Second second2 = new Second(34, minute2);
        assertTrue(second1.equals(second2));
    }
View Full Code Here

TOP

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

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.