class SeriesUtils {

    public static Region iBounds(XYSeries series, RectRegion visibleBounds) {
        final float step = series.size() >= 200 ? 50 : 1;
        final int iBoundsMin = iBoundsMin(series, visibleBounds.getMinX().doubleValue(), step);
        final int iBoundsMax = iBoundsMax(series, visibleBounds.getMaxX().doubleValue(), step);
        return new Region(iBoundsMin, iBoundsMax);
    }

}