afreechart/src/main/java/org/afree/chart/renderer/xy/AbstractXYItemRenderer.java
/**
     * Returns the range of values the renderer requires to display all the
     * items from the specified dataset.
     * 
     * @param dataset
     *            the dataset (<code>null</code> permitted).
     * 
     * @return The range (<code>null</code> if the dataset is <code>null</code>
     *         or empty).
     * 
     * @since JFreeChart 1.0.13
     */
Returns the range of values the renderer requires to display all the
items from the specified dataset.

@param dataset
the dataset (null permitted).

@return The range (null if the dataset is null
or empty).


Returns the range of values the renderer requires to display all the items from the specified dataset . @param dataset the dataset ( null permitted ) . @return The range ( null if the dataset is null or empty ) .
protected Range findRangeBounds(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));
                }
            }
            Range xRange = null;
            XYPlot p = getPlot();
            if (p != null) {
                ValueAxis xAxis = null;
                int index = p.getIndexOf(this);
                if (index >= 0) {
                    xAxis = plot.getDomainAxisForDataset(index);
                }
                if (xAxis != null) {
                    xRange = xAxis.getRange();
                }
            }
            if (xRange == null) {
                xRange = new Range(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
            }
            return DatasetUtilities.findRangeBounds(dataset, visibleSeriesKeys, xRange,
                    includeInterval);
        } else {
            return DatasetUtilities.findRangeBounds(dataset, includeInterval);
        }
    }
protected Range findRangeBounds ( 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 ) ) ; } } Range xRange = null ; XYPlot p = getPlot ( ) ; if ( p != null ) { ValueAxis xAxis = null ; int index = p . getIndexOf ( this ) ; if ( index >= 0 ) { xAxis = plot . getDomainAxisForDataset ( index ) ; } if ( xAxis != null ) { xRange = xAxis . getRange ( ) ; } } if ( xRange == null ) { xRange = new Range ( Double . NEGATIVE_INFINITY , Double . POSITIVE_INFINITY ) ; } return DatasetUtilities . findRangeBounds ( dataset , visibleSeriesKeys , xRange , includeInterval ) ; } else { return DatasetUtilities . findRangeBounds ( dataset , includeInterval ) ; } }
Returns the range of values the renderer requires to display all the
 items from the specified dataset.
Returns the range of values the renderer requires to display all the items from the specified dataset .
// the bounds should be calculated using just the items within // the current range of the x-axis...if there is one