/** * Gets the value. * * @return the value */ public long getValue() { return getData().getY().longValue(); }
/** * Updates the cached values for the minimum and maximum data values. * * @param item the item added (<code>null</code> not permitted). * * @since 1.0.13 */ private void updateBoundsForAddedItem(XYDataItem item) { double x = item.getXValue(); this.minX = minIgnoreNaN(this.minX, x); this.maxX = maxIgnoreNaN(this.maxX, x); if (item.getY() != null) { double y = item.getYValue(); this.minY = minIgnoreNaN(this.minY, y); this.maxY = maxIgnoreNaN(this.maxY, y); } }
/** * Updates the cached values for the minimum and maximum data values. * * @param item the item added ({@code null} not permitted). * * @since 1.0.13 */ private void updateBoundsForAddedItem(XYDataItem item) { double x = item.getXValue(); this.minX = minIgnoreNaN(this.minX, x); this.maxX = maxIgnoreNaN(this.maxX, x); if (item.getY() != null) { double y = item.getYValue(); this.minY = minIgnoreNaN(this.minY, y); this.maxY = maxIgnoreNaN(this.maxY, y); } }
/** * Gets the last value for stat. * * @param statName the stat name * @return the last value for stat */ public long getLastValueForStat(String statName) { long statValue = 0; List<XYDataItem> stats = getStats(statName); if (stats != null && !stats.isEmpty()) { XYDataItem xy = stats.get(stats.size() - 1); if (xy != null && xy.getY() != null) { statValue = xy.getY().longValue(); } } return statValue; }
if (item.getY() != null) { double y = item.getYValue(); if (!Double.isNaN(y)) {
/** * Calculate avg. */ // calculating an avg value that is used for identifying the top series void calculateAvg() { long sum = 0; int count = 1; synchronized (stats) { boolean useMovingAvg = getMovingAvgFrame() > 0 && getMovingAvgFrame() < stats.size(); for (ListIterator<XYDataItem> it = stats.listIterator(); it.hasNext();) { XYDataItem xy = it.next(); sum += xy.getY().longValue(); if (useMovingAvg && count % getMovingAvgFrame() == 0 || !it.hasNext()) { double thisAvg = (double) sum / count; if (thisAvg > avg) { avg = thisAvg; } sum = 0; count = 1; } else { count++; } } } } }
if (item.getY() != null) { double y = item.getYValue(); if (!Double.isNaN(y)) {
/** * To series. * * @param legend the legend * @param stats the stats * @return the XY series */ protected XYSeries toSeries(String legend, List<XYDataItem> stats) { XYSeries xySeries = new XYSeries(legend, true, false); synchronized (stats) { for (XYDataItem item : stats) { xySeries.addOrUpdate(item.getX(), item.getY()); } } return xySeries; }
/** * Returns the y-value at the specified index. * * @param index the index (zero-based). * * @return The y-value (possibly {@code null}). */ public Number getY(int index) { return getRawDataItem(index).getY(); }
/** * Returns the y-value at the specified index. * * @param index the index (zero-based). * * @return The y-value (possibly <code>null</code>). */ public Number getY(int index) { return getRawDataItem(index).getY(); }
public void showAnnotations() { XYItemRenderer renderer = getChart().getXYPlot().getRenderer(); renderer.removeAnnotations(); for (int i = 0; i < eccSeries.getItemCount(); i++) { XYDataItem item = (XYDataItem) eccSeries.getDataItem(i); XYTextAnnotation annon = new XYTextAnnotation(new Integer(i).toString(), item.getX().longValue(), item .getY().longValue()); renderer.addAnnotation(annon); } }
for (Object o : s.getItems()) { XYDataItem item = (XYDataItem) o; values.add(item.getY() + ",");