double maximum = Double.NEGATIVE_INFINITY;
int seriesCount = dataset.getSeriesCount();
double lvalue;
double uvalue;
if (dataset instanceof VectorXYDataset) {
VectorXYDataset vdataset = (VectorXYDataset) dataset;
for (int series = 0; series < seriesCount; series++) {
int itemCount = dataset.getItemCount(series);
for (int item = 0; item < itemCount; item++) {
double delta = vdataset.getVectorYValue(series, item);
if (delta < 0.0) {
uvalue = vdataset.getYValue(series, item);
lvalue = uvalue + delta;
}
else {
lvalue = vdataset.getYValue(series, item);
uvalue = lvalue + delta;
}
minimum = Math.min(minimum, lvalue);
maximum = Math.max(maximum, uvalue);
}