Examples of XYDataItem


Examples of com.positive.charts.data.xy.XYDataItem

    final RectangleEdge xAxisLocation = plot.getDomainAxisEdge();
    final RectangleEdge yAxisLocation = plot.getRangeAxisEdge();

    for (final Iterator iter = items.iterator(); iter.hasNext();) {
      final XYDataItem item = (XYDataItem) iter.next();
      // get the data point...
      final double x1 = item.getX().doubleValue();
      final Number yValue = item.getY();
      if (yValue == null) {
        s.setLastPointGood(false);
        continue;
      }
      final double y1 = item.getY().doubleValue();
      final double transX1 = domainAxis.valueToJava2D(x1, dataArea,
          xAxisLocation);
      final double transY1 = rangeAxis.valueToJava2D(y1, dataArea,
          yAxisLocation);
View Full Code Here

Examples of com.positive.charts.data.xy.XYDataItem

      final List items = s.getItems();
      if (items.size() == 0) {
        continue;
      }

      int fromIndex = Collections.binarySearch(items, new XYDataItem(
          lowerBound, 0));
      if (fromIndex < 0) {
        fromIndex = -fromIndex - 2;
      }
      if (fromIndex < 0) {
        fromIndex = 0;
      }
      int toIndex = Collections.binarySearch(items, new XYDataItem(
          upperBound, 0));
      if (toIndex < 0) {
        toIndex = -toIndex;
      }
      if (toIndex >= items.size()) {
View Full Code Here

Examples of org.jfree.data.xy.XYDataItem

        if (stats == null) {
            statsCollection.newStats(name, maxSeries);
        } else {
            statsCollection.lockForUpdate();
            try {
                stats.add(new XYDataItem(time, value));
                houseKeepStats(stats);
            } finally {
                statsCollection.releaseLock();
            }
        }
View Full Code Here

Examples of org.jfree.data.xy.XYDataItem

            try {
                List stats = statsCollection.getStats(name);
                if (stats == null) {
                    stats = statsCollection.newStats(name, maxSeries);
                }
                stats.add(stats.size(), new XYDataItem(time, statValue));
                houseKeepStats(stats);
            } finally {
                statsCollection.releaseLock();
            }
        }
View Full Code Here

Examples of org.jfree.data.xy.XYDataItem

            synchronized (stats) {
                boolean useMovingAvg = getMovingAvgFrame() > 0 && getMovingAvgFrame() < stats.size();

                for (Iterator i = stats.iterator(); i.hasNext();) {
                    XYDataItem xy = (XYDataItem) i.next();
                    sum += xy.getY().longValue();

                    if ((useMovingAvg && count % getMovingAvgFrame() == 0) || ! i.hasNext()) {
                        double a = (double) sum / count;
                        if (a > avg) {
                            avg = a;
View Full Code Here

Examples of org.jfree.data.xy.XYDataItem

    protected XYSeries toSeries(String legend, List stats) {
        XYSeries xySeries = new XYSeries(legend, true, false);
        synchronized (stats) {
            for (int i = 0; i < stats.size(); i++) {
                XYDataItem item = (XYDataItem) stats.get(i);
                xySeries.addOrUpdate(item.getX(), item.getY());
            }
        }
        return xySeries;
    }
View Full Code Here

Examples of org.jfree.data.xy.XYDataItem

    public long getLastValueForStat(String statName) {
        long statValue = 0;

        List stats = getStats(statName);
        if (stats != null && ! stats.isEmpty()) {
            XYDataItem xy = (XYDataItem) stats.get(stats.size() - 1);
            if (xy != null && xy.getY() != null) {
                statValue = xy.getY().longValue();
            }
        }

        return statValue;
    }
View Full Code Here

Examples of org.jfree.data.xy.XYDataItem

                        // regular stats collection cycle will do it

                        for (Iterator it = stats.keySet().iterator(); it.hasNext();) {
                            List l = (List) stats.get(it.next());
                            if (l.size() > 0) {
                                XYDataItem xy = (XYDataItem) l.get(l.size() - 1);
                                l.add(new XYDataItem(xy.getX().longValue() + 1, 0));
                                l.add(new XYDataItem(System.currentTimeMillis(), 0));
                            }
                        }
                    }
                } finally {
                    fis.close();
View Full Code Here

Examples of org.jfree.data.xy.XYDataItem

      final XYSeries timeSeries = xyDataset.getSeries(i);
      final Comparable key = timeSeries.getKey();
      final int itemCount = timeSeries.getItemCount();
      for (int ic = 0; ic < itemCount; ic++)
      {
        final XYDataItem seriesDataItem = timeSeries.getDataItem(ic);
        tableXYDataset.add(seriesDataItem.getX(), seriesDataItem.getY(), key, false);
      }
    }
    return tableXYDataset;
  }
View Full Code Here

Examples of org.jfree.data.xy.XYDataItem

    MyActivityRenderer problemRenderer = new MyActivityRenderer(problem, activitiesByDataItem,firstActivities);
    problemRenderer.setBaseItemLabelGenerator(new XYItemLabelGenerator() {
     
      @Override
      public String generateLabel(XYDataset arg0, int arg1, int arg2) {
        XYDataItem item = problem.getSeries(arg1).getDataItem(arg2);
        return labelsByDataItem.get(item);
      }
     
    });
    problemRenderer.setBaseItemLabelsVisible(true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.