Package org.jsflot.xydata

Examples of org.jsflot.xydata.XYDataList


    @Test
    @Ignore
    public void test_that_XYDataCollection_returns_correct_json() throws JSONException {
        XYDataSetCollection xyCollection = new XYDataSetCollection();
        XYDataList xyList = new XYDataList();
        xyList.setLabel("Set1");
        xyList.addDataPoint(new XYDataPoint(1, 1));
        xyList.addDataPoint(new XYDataPoint(2, 2));
        xyList.addDataPoint(new XYDataPoint(3, 3));
        xyList.addDataPoint(new XYDataPoint(5, 5));
        xyCollection.addDataList(xyList);

        StringBuilder expected = new StringBuilder();
        expected.append("{\"chart\": [ {\"label\": \"Set1\", \"data\": [[1,1], [2,2], [3,3], [5,5]]}],\"instrumentationNode\":\"chartId\"}");
        String jsonString = BuildJsonObjectsUtil.generateChartData("chartId", "something", xyCollection, 0l);
View Full Code Here


    @Ignore
    public void test_that_chart_generator_generates_correct_data_for_data_with_no_holes_and_30_second_resolution() {
        XYDataSetCollection xyDataSetCollection = ChartUtil.generateChart(liveStatisticsList, "name", dateFrom.getTime(), dateTo.getTime(), 30);
        assertNotNull(xyDataSetCollection.getDataList().get(0));

        XYDataList xyDataList = xyDataSetCollection.getDataList().get(0);
        assertNotNull(xyDataList.getDataPointList());

        assertEquals(xyDataList.getDataPointList().get(0).getX().doubleValue(), 1295540055000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(0).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(1).getX().doubleValue(), 1295540085000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(1).getY(), 8d);

        assertEquals(xyDataList.getDataPointList().get(2).getX().doubleValue(), 1295540115000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(2).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(3).getX().doubleValue(), 1295540145000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(3).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(4).getX().doubleValue(), 1295540175000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(4).getY(), 11d);

        assertEquals(xyDataList.getDataPointList().get(5).getX().doubleValue(), 1295540205000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(5).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(6).getX().doubleValue(), 1295540235000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(6).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(7).getX().doubleValue(), 1295540265000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(7).getY(), 11d);

        assertEquals(xyDataList.getDataPointList().get(8).getX().doubleValue(), 1295540295000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(8).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(9).getX().doubleValue(), 1295540325000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(9).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(10).getX().doubleValue(), 1295540355000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(10).getY(), 8d);

        assertEquals(xyDataList.getDataPointList().get(11).getX().doubleValue(), 1295540385000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(11).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(12).getX().doubleValue(), 1295540415000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(12).getY(), 8d);

        assertEquals(xyDataList.getDataPointList().get(13).getX().doubleValue(), 1295540445000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(13).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(14).getX().doubleValue(), 1295540475000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(14).getY(), 8d);

        //The last tick is not included to account for lag between agent and server
        //assertEquals(xyDataList.getDataPointList().get(15).getX().doubleValue(), 1295540505000d, 0.0d);
        //assertEquals(xyDataList.getDataPointList().get(15).getY(), 9d);
    }
View Full Code Here

    @Ignore
    public void test_that_chart_generator_generates_correct_data_for_data_with_no_holes_and_180_second_resolution() {
        XYDataSetCollection xyDataSetCollection = ChartUtil.generateChart(liveStatisticsList, "name", dateFrom.getTime(), dateTo.getTime(), 180);
        assertNotNull(xyDataSetCollection.getDataList().get(0));

        XYDataList xyDataList = xyDataSetCollection.getDataList().get(0);
        assertNotNull(xyDataList.getDataPointList());

        //108 / 12 = 9
        assertEquals(xyDataList.getDataPointList().get(0).getX().doubleValue(), 1295540055000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(0).getY(), 9d);

        // 116 / 12 = 9
        assertEquals(xyDataList.getDataPointList().get(1).getX().doubleValue(), 1295540235000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(1).getY(), 9d);

        //The last tick is not included to account for lag between agent and server

    }
View Full Code Here

        }

        XYDataSetCollection xyDataSetCollection = ChartUtil.generateChart(newStats, "name", dateFrom.getTime(), dateTo.getTime(), 15);
        assertNotNull(xyDataSetCollection.getDataList().get(0));

        XYDataList xyDataList = xyDataSetCollection.getDataList().get(0);
        assertNotNull(xyDataList.getDataPointList());

        assertEquals(xyDataList.getDataPointList().get(0).getX().doubleValue(), 1295540055000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(0).getY(), 6d);
        assertEquals(xyDataList.getDataPointList().get(1).getX().doubleValue(), 1295540070000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(1).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(2).getX().doubleValue(), 1295540085000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(2).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(3).getX().doubleValue(), 1295540100000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(3).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(4).getX().doubleValue(), 1295540115000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(4).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(5).getX().doubleValue(), 1295540130000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(5).getY(), null);

        assertEquals(xyDataList.getDataPointList().get(6).getX().doubleValue(), 1295540145000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(6).getY(), 12d);
        assertEquals(xyDataList.getDataPointList().get(7).getX().doubleValue(), 1295540160000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(7).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(8).getX().doubleValue(), 1295540175000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(8).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(9).getX().doubleValue(), 1295540190000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(9).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(10).getX().doubleValue(), 1295540205000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(10).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(11).getX().doubleValue(), 1295540220000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(11).getY(), null);

        assertEquals(xyDataList.getDataPointList().get(12).getX().doubleValue(), 1295540235000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(12).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(13).getX().doubleValue(), 1295540250000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(13).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(14).getX().doubleValue(), 1295540265000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(14).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(15).getX().doubleValue(), 1295540280000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(15).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(16).getX().doubleValue(), 1295540295000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(16).getY(), 8d);
        assertEquals(xyDataList.getDataPointList().get(17).getX().doubleValue(), 1295540310000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(17).getY(), null);

        assertEquals(xyDataList.getDataPointList().get(18).getX().doubleValue(), 1295540325000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(18).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(19).getX().doubleValue(), 1295540340000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(19).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(20).getX().doubleValue(), 1295540355000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(20).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(21).getX().doubleValue(), 1295540370000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(21).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(22).getX().doubleValue(), 1295540385000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(22).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(23).getX().doubleValue(), 1295540400000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(23).getY(), null);

        assertEquals(xyDataList.getDataPointList().get(24).getX().doubleValue(), 1295540415000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(24).getY(), 7d);
        assertEquals(xyDataList.getDataPointList().get(25).getX().doubleValue(), 1295540430000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(25).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(26).getX().doubleValue(), 1295540445000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(26).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(27).getX().doubleValue(), 1295540460000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(27).getY(), null);
        assertEquals(xyDataList.getDataPointList().get(28).getX().doubleValue(), 1295540475000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(28).getY(), 7d);
        assertEquals(xyDataList.getDataPointList().get(29).getX().doubleValue(), 1295540490000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(29).getY(), null);

        assertEquals(xyDataList.getDataPointList().get(30).getX().doubleValue(), 1295540505000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(30).getY(), 9d);

        //The last tick is not included to account for lag between agent and server
        //assertEquals(xyDataList.getDataPointList().get(31).getX().doubleValue(), 1295540520000d, 0.0d);
        //assertEquals(xyDataList.getDataPointList().get(31).getY(), 10d);
View Full Code Here

        }

        XYDataSetCollection xyDataSetCollection = ChartUtil.generateChart(newStats, "name", dateFrom.getTime(), dateTo.getTime(), 45);
        assertNotNull(xyDataSetCollection.getDataList().get(0));

        XYDataList xyDataList = xyDataSetCollection.getDataList().get(0);
        assertNotNull(xyDataList.getDataPointList());

        assertEquals(xyDataList.getDataPointList().get(0).getX().doubleValue(), 1295540055000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(0).getY(), 6d);

        assertEquals(xyDataList.getDataPointList().get(1).getX().doubleValue(), 1295540100000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(1).getY(), 11d);

        assertEquals(xyDataList.getDataPointList().get(2).getX().doubleValue(), 1295540145000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(2).getY(), 11d);

        assertEquals(xyDataList.getDataPointList().get(3).getX().doubleValue(), 1295540190000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(3).getY(), 11d);

        assertEquals(xyDataList.getDataPointList().get(4).getX().doubleValue(), 1295540235000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(4).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(5).getX().doubleValue(), 1295540280000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(5).getY(), 8d);

        assertEquals(xyDataList.getDataPointList().get(6).getX().doubleValue(), 1295540325000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(6).getY(), 8d);

        assertEquals(xyDataList.getDataPointList().get(7).getX().doubleValue(), 1295540370000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(7).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(8).getX().doubleValue(), 1295540415000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(8).getY(), 8d);

        assertEquals(xyDataList.getDataPointList().get(9).getX().doubleValue(), 1295540460000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(9).getY(), 7d);

        //The last tick is not included to account for lag between agent and server

    }
View Full Code Here

public class ChartUtil {
  private static Logger log = Logger.getLogger(ChartUtil.class);

    public static XYDataSetCollection generateChart(List<LiveStatistics> liveList, String seriesLabel, Long millisStart, Long millisEnd, int resolution) {
        XYDataSetCollection valueCollection = new XYDataSetCollection();
        XYDataList valueList = new XYDataList();
        valueList.setLabel(seriesLabel);

        //Hashtable is used for quick lookup
        Hashtable<Long, LiveStatistics> liveHash = new Hashtable<Long, LiveStatistics>();
    for (LiveStatistics l : liveList) {
      liveHash.put(l.getTimeperiod() * 15000, l);
    }

        int numTicksInResolution = resolution / 15;

        //Round down to nearest 15 seconds timeperiod
        millisStart = millisStart - (millisStart % 15000);
    millisEnd = millisEnd - (millisEnd % 15000) + 15000;


        Long currentMillis = millisStart;

        //Iterate over the time-range given and average ticks based on resolution
        while (currentMillis <= (millisEnd - (resolution * 1000))) {
            XYDataPoint currentTick = new XYDataPoint();
            currentTick.setX(currentMillis);
            currentTick.setY(null);
            double aggregatedValue = 0.0d;
            double averageValue = 0.0d;
            ValueType valueType = null;

            int numStatsInCurrentTick = 0;

            for (int i = 0; i < numTicksInResolution; i++) {
                LiveStatistics currStat = liveHash.get(currentMillis);
                if (currStat == null || currStat.getValue() == null) {
                    //No stat for this timeperiod, skipping
                } else {
                    if (valueType == null) {
                        valueType = ValueType.fromValue(currStat.getValueType());
                    }
                    //Add to current
                    aggregatedValue += currStat.getValue();
                    numStatsInCurrentTick++;
                }

                currentMillis += 15000;
            }

            if (numStatsInCurrentTick > 0) {
                //If value type is aggregate, return the aggregate value
                if (ValueType.AGGREGATE.equals(valueType)) {
                    currentTick.setY(aggregatedValue);
                } else {
                    //Otherwise return the average
                    currentTick.setY(aggregatedValue / numStatsInCurrentTick);
                }
            }

            valueList.addDataPoint(currentTick);
        }

        valueCollection.addDataList(valueList);
        return valueCollection;
    }
View Full Code Here

        valueCollection.addDataList(valueList);
        return valueCollection;
    }
 
  public static XYDataList buildWarningList(Alert alert, AlertStatus alertStatus, long minXaxis, long maxXaxis) {
    XYDataList errorList = new XYDataList();
    errorList.setLabel("Warning Value");
    if (alertStatus == AlertStatus.CRITICAL ) {
      errorList.setLabel("Error Value");
    }   
   
    if (alert != null) {
      Double warningValue = alert.getWarningValue();
      Double errorValue = alert.getErrorValue();
      XYDataPoint startPoint = new XYDataPoint();
      startPoint.setX(minXaxis);
     
      XYDataPoint endPoint = new XYDataPoint();
      endPoint.setX(maxXaxis);
      if (alertStatus == AlertStatus.CRITICAL) {
        startPoint.setY(errorValue);
        endPoint.setY(errorValue);
      } else {
        startPoint.setY(warningValue);
        endPoint.setY(warningValue);
      }
     
      errorList.setColor("#eeff00");
      if (alertStatus == AlertStatus.CRITICAL) {
        errorList.setColor("#ff0000");
      }
     
      errorList.addDataPoint(startPoint);
      errorList.addDataPoint(endPoint);
     
      errorList.setShowDataPoints(false);
      errorList.setShowLines(true);
      errorList.setFillLines(false);
    }
   
    return errorList;
  }
View Full Code Here

    @Ignore
    public void test_that_chart_generator_generates_correct_data_for_data_with_no_holes_and_15_second_resolution() {
        XYDataSetCollection xyDataSetCollection = ChartUtil.generateChart(liveStatisticsList, "name", dateFrom.getTime(), dateTo.getTime(), 15);
        assertNotNull(xyDataSetCollection.getDataList().get(0));

        XYDataList xyDataList = xyDataSetCollection.getDataList().get(0);
        assertNotNull(xyDataList.getDataPointList());
        assertEquals(32, xyDataList.size());

        assertEquals(xyDataList.getDataPointList().get(0).getX().doubleValue(), new Double(1295540055000d), 0.0d);
        assertEquals(xyDataList.getDataPointList().get(0).getY(), 6d);
        assertEquals(xyDataList.getDataPointList().get(1).getX().doubleValue(), 1295540070000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(1).getY(), 8d);
        assertEquals(xyDataList.getDataPointList().get(2).getX().doubleValue(), 1295540085000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(2).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(3).getX().doubleValue(), 1295540100000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(3).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(4).getX().doubleValue(), 1295540115000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(4).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(5).getX().doubleValue(), 1295540130000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(5).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(6).getX().doubleValue(), 1295540145000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(6).getY(), 12d);
        assertEquals(xyDataList.getDataPointList().get(7).getX().doubleValue(), 1295540160000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(7).getY(), 8d);
        assertEquals(xyDataList.getDataPointList().get(8).getX().doubleValue(), 1295540175000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(8).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(9).getX().doubleValue(), 1295540190000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(9).getY(), 12d);
        assertEquals(xyDataList.getDataPointList().get(10).getX().doubleValue(), 1295540205000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(10).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(11).getX().doubleValue(), 1295540220000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(11).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(12).getX().doubleValue(), 1295540235000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(12).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(13).getX().doubleValue(), 1295540250000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(13).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(14).getX().doubleValue(), 1295540265000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(14).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(15).getX().doubleValue(), 1295540280000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(15).getY(), 12d);
        assertEquals(xyDataList.getDataPointList().get(16).getX().doubleValue(), 1295540295000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(16).getY(), 8d);
        assertEquals(xyDataList.getDataPointList().get(17).getX().doubleValue(), 1295540310000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(17).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(18).getX().doubleValue(), 1295540325000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(18).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(19).getX().doubleValue(), 1295540340000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(19).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(20).getX().doubleValue(), 1295540355000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(20).getY(), 7d);

        assertEquals(xyDataList.getDataPointList().get(21).getX().doubleValue(), 1295540370000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(21).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(22).getX().doubleValue(), 1295540385000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(22).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(23).getX().doubleValue(), 1295540400000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(23).getY(), 11d);

        assertEquals(xyDataList.getDataPointList().get(24).getX().doubleValue(), 1295540415000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(24).getY(), 7d);
        assertEquals(xyDataList.getDataPointList().get(25).getX().doubleValue(), 1295540430000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(25).getY(), 9d);
        assertEquals(xyDataList.getDataPointList().get(26).getX().doubleValue(), 1295540445000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(26).getY(), 9d);

        assertEquals(xyDataList.getDataPointList().get(27).getX().doubleValue(), 1295540460000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(27).getY(), 11d);
        assertEquals(xyDataList.getDataPointList().get(28).getX().doubleValue(), 1295540475000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(28).getY(), 7d);
        assertEquals(xyDataList.getDataPointList().get(29).getX().doubleValue(), 1295540490000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(29).getY(), 10d);

        assertEquals(xyDataList.getDataPointList().get(30).getX().doubleValue(), 1295540505000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(30).getY(), 9d);

        //The last tick is not included to account for lag between agent and server
        assertEquals(xyDataList.getDataPointList().get(31).getX().doubleValue(), 1295540520000d, 0.0d);
        assertEquals(xyDataList.getDataPointList().get(31).getY(), 10d);

    }
View Full Code Here

TOP

Related Classes of org.jsflot.xydata.XYDataList

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.