org.jfree.data.xy.XYSeries.getMaxY()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.jfree.data.xy.XYSeries.getMaxY()方法的一些代码示例,展示了XYSeries.getMaxY()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XYSeries.getMaxY()方法的具体详情如下:
包路径:org.jfree.data.xy.XYSeries
类名称:XYSeries
方法名:getMaxY

XYSeries.getMaxY介绍

[英]Returns the largest y-value in the series, ignoring any Double.NaN values. This method returns Double.NaN if there is no largest y-value (for example, when the series is empty).
[中]返回序列中最大的y值,忽略任何双精度值。南的价值观。此方法返回Double。如果没有最大y值,则为NaN(例如,当序列为空时)。

代码示例

代码示例来源:origin: jfree/jfreechart

/**
 * Returns the maximum y-value in the dataset.
 *
 * @param includeInterval  a flag that determines whether or not the
 *                         y-interval is taken into account.
 *
 * @return The maximum value.
 */
@Override
public double getRangeUpperBound(boolean includeInterval) {
  double result = Double.NaN;
  int seriesCount = getSeriesCount();
  for (int s = 0; s < seriesCount; s++) {
    XYSeries series = getSeries(s);
    double hiY = series.getMaxY();
    if (Double.isNaN(result)) {
      result = hiY;
    }
    else {
      if (!Double.isNaN(hiY)) {
        result = Math.max(result, hiY);
      }
    }
  }
  return result;
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the maximum y-value in the dataset.
 *
 * @param includeInterval  a flag that determines whether or not the
 *                         y-interval is taken into account.
 *
 * @return The maximum value.
 */
public double getRangeUpperBound(boolean includeInterval) {
  double result = Double.NaN;
  int seriesCount = getSeriesCount();
  for (int s = 0; s < seriesCount; s++) {
    XYSeries series = getSeries(s);
    double hiY = series.getMaxY();
    if (Double.isNaN(result)) {
      result = hiY;
    }
    else {
      if (!Double.isNaN(hiY)) {
        result = Math.max(result, hiY);
      }
    }
  }
  return result;
}

代码示例来源:origin: jfree/jfreechart

lower = Math.min(lower, minY);
double maxY = series.getMaxY();
if (!Double.isNaN(maxY)) {
  upper = Math.max(upper, maxY);

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the range of the values in this dataset's range.
 *
 * @param includeInterval  ignored.
 *
 * @return The range (or <code>null</code> if the dataset contains no
 *     values).
 */
public Range getRangeBounds(boolean includeInterval) {
  double lower = Double.POSITIVE_INFINITY;
  double upper = Double.NEGATIVE_INFINITY;
  int seriesCount = getSeriesCount();
  for (int s = 0; s < seriesCount; s++) {
    XYSeries series = getSeries(s);
    double minY = series.getMinY();
    if (!Double.isNaN(minY)) {
      lower = Math.min(lower, minY);
    }
    double maxY = series.getMaxY();
    if (!Double.isNaN(maxY)) {
      upper = Math.max(upper, maxY);
    }
  }
  if (lower > upper) {
    return null;
  }
  else {
    return new Range(lower, upper);
  }
}

代码示例来源:origin: org.gephi/statistics-plugin

public static void scaleChart(JFreeChart chart, XYSeries dSeries, boolean normalized) {
  XYPlot plot = (XYPlot) chart.getPlot();
  ValueAxis domainAxis = plot.getDomainAxis();
  domainAxis.setLowerMargin(1.0);
  domainAxis.setUpperMargin(1.0);
  domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
  if (normalized) {
    domainAxis.setRange(-0.05, 1.05);
  } else {
    domainAxis.setRange(dSeries.getMinX() - 1, dSeries.getMaxX() + 1);
  }
  NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
  rangeAxis.setRange(-0.1 * Math.sqrt(dSeries.getMaxY()), dSeries.getMaxY() + 0.1 * Math.sqrt(dSeries.getMaxY()));
}

代码示例来源:origin: hazelcast/hazelcast-jet-code-samples

private void startGui() {
  XYSeries series = new XYSeries("Rate", false);
  XYPlot plot = createChartFrame(series);
  ValueAxis xAxis = plot.getDomainAxis();
  ValueAxis yAxis = plot.getRangeAxis();
  xAxis.setRange(0, TIME_RANGE);
  yAxis.setRange(Y_RANGE_MIN, Y_RANGE_UPPER_INITIAL);
  long initialTimestamp = System.currentTimeMillis();
  hzMap.addEntryListener((EntryAddedListener<Long, Double>) event -> {
    long x = event.getKey() - initialTimestamp;
    double y = event.getValue() / SCALE_Y;
    EventQueue.invokeLater(() -> {
      series.add(x, y);
      xAxis.setRange(max(0, x - TIME_RANGE), max(TIME_RANGE, x));
      yAxis.setRange(Y_RANGE_MIN, max(series.getMaxY(), Y_RANGE_UPPER_INITIAL));
    });
    hzMap.remove(event.getKey());
  }, true);
}

代码示例来源:origin: stackoverflow.com

System.out.println(seriesX.getMaxX() + "; " + seriesX.getMaxY());

相关文章