public static Range findCumulativeRangeBounds(CategoryDataset dataset){
  ParamChecks.nullNotPermitted(dataset,"dataset");
  boolean allItemsNull=true;
  double minimum=0.0;
  double maximum=0.0;
  for (int row=0; row < dataset.getRowCount(); row++) {
    double runningTotal=0.0;
    for (int column=0; column <= dataset.getColumnCount() - 1; column++) {
      Number n=dataset.getValue(row,column);
      if (n != null) {
        allItemsNull=false;
        double value=n.doubleValue();
        if (!Double.isNaN(value)) {
          runningTotal=runningTotal + value;
          minimum=Math.min(minimum,runningTotal);
          maximum=Math.max(maximum,runningTotal);
        }
      }
    }
  }
  if (!allItemsNull) {
    return new Range(minimum,maximum);
  }
 else {
    return null;
  }
}

public static Range findCumulativeRangeBounds ( CategoryDataset dataset ) { ParamChecks . nullNotPermitted ( dataset , "dataset" ) ; boolean allItemsNull = true ; double minimum = 0.0 ; double maximum = 0.0 ; for ( int row = 0 ; row < dataset . getRowCount ( ) ; row ++ ) { double runningTotal = 0.0 ; for ( int column = 0 ; column <= dataset . getColumnCount ( ) - 1 ; column ++ ) { Number n = dataset . getValue ( row , column ) ; if ( n != null ) { allItemsNull = false ; double value = n . doubleValue ( ) ; if ( ! Double . isNaN ( value ) ) { runningTotal = runningTotal + value ; minimum = Math . min ( minimum , runningTotal ) ; maximum = Math . max ( maximum , runningTotal ) ; } } } } if ( ! allItemsNull ) { return new Range ( minimum , maximum ) ; } else { return null ; } }
calculates the range of values for a dataset where each item is the running total of the items for the current series .
