/** * Returns the range of values in the domain (x-values) of a dataset. * * @param dataset the dataset ({@code null} not permitted). * * @return The range of values (possibly {@code null}). */ public static Range findDomainBounds(XYDataset dataset) { return findDomainBounds(dataset, true); }
/** * Returns the lower and upper bounds (range) of the x-values in the * specified dataset. * * @param dataset the dataset ({@code null} permitted). * @param includeInterval include the interval (if any) for the dataset? * * @return The range ({@code null} if the dataset is {@code null} * or empty). * * @since 1.0.13 */ protected Range findDomainBounds(XYDataset dataset, boolean includeInterval) { if (dataset == null) { return null; } if (getDataBoundsIncludesVisibleSeriesOnly()) { List visibleSeriesKeys = new ArrayList(); int seriesCount = dataset.getSeriesCount(); for (int s = 0; s < seriesCount; s++) { if (isSeriesVisible(s)) { visibleSeriesKeys.add(dataset.getSeriesKey(s)); } } return DatasetUtils.findDomainBounds(dataset, visibleSeriesKeys, includeInterval); } return DatasetUtils.findDomainBounds(dataset, includeInterval); }
/** * Returns the lower and upper bounds (range) of the x-values in the * specified dataset. * * @param dataset the dataset ({@code null} permitted). * * @return The range ({@code null} if the dataset is {@code null} * or empty). */ @Override public Range findDomainBounds(XYDataset dataset) { if (dataset == null) { return null; } Range r = DatasetUtils.findDomainBounds(dataset, false); if (r == null) { return null; } double offset = 0; // TODO getSeriesShape(n).getBounds().width / 2; return new Range(r.getLowerBound() + offset, r.getUpperBound() + offset); }
/** * Returns the lower and upper bounds (range) of the x-values in the * specified dataset. * * @param dataset the dataset ({@code null} permitted). * * @return The range ({@code null} if the dataset is {@code null} * or empty). * * @see #findRangeBounds(XYDataset) */ @Override public Range findDomainBounds(XYDataset dataset) { if (dataset == null) { return null; } Range r = DatasetUtils.findDomainBounds(dataset, false); if (r == null) { return null; } return new Range(r.getLowerBound() + this.xOffset, r.getUpperBound() + this.blockWidth + this.xOffset); }
DatasetUtils.findDomainBounds(d));
/** * Returns the range of the values in the dataset's domain, including * or excluding the interval around each x-value as specified. * * @param includeInterval a flag that determines whether or not the * x-interval should be taken into account. * * @return The range. */ @Override public Range getDomainBounds(boolean includeInterval) { // first get the range without the interval, then expand it for the // interval width Range range = DatasetUtils.findDomainBounds(this.dataset, false); if (includeInterval && range != null) { double lowerAdj = getIntervalWidth() * getIntervalPositionFactor(); double upperAdj = getIntervalWidth() - lowerAdj; range = new Range(range.getLowerBound() - lowerAdj, range.getUpperBound() + upperAdj); } return range; }