public static Number findMaximumStackedRangeValue(CategoryDataset dataset){
  ParamChecks.nullNotPermitted(dataset,"dataset");
  Number result=null;
  boolean hasValidData=false;
  double maximum=0.0;
  int categoryCount=dataset.getColumnCount();
  for (int item=0; item < categoryCount; item++) {
    double total=0.0;
    int seriesCount=dataset.getRowCount();
    for (int series=0; series < seriesCount; series++) {
      Number number=dataset.getValue(series,item);
      if (number != null) {
        hasValidData=true;
        double value=number.doubleValue();
        if (value > 0.0) {
          total=total + value;
        }
      }
    }
    maximum=Math.max(maximum,total);
  }
  if (hasValidData) {
    result=new Double(maximum);
  }
  return result;
}

public static Number findMaximumStackedRangeValue ( CategoryDataset dataset ) { ParamChecks . nullNotPermitted ( dataset , "dataset" ) ; Number result = null ; boolean hasValidData = false ; double maximum = 0.0 ; int categoryCount = dataset . getColumnCount ( ) ; for ( int item = 0 ; item < categoryCount ; item ++ ) { double total = 0.0 ; int seriesCount = dataset . getRowCount ( ) ; for ( int series = 0 ; series < seriesCount ; series ++ ) { Number number = dataset . getValue ( series , item ) ; if ( number != null ) { hasValidData = true ; double value = number . doubleValue ( ) ; if ( value > 0.0 ) { total = total + value ; } } } maximum = Math . max ( maximum , total ) ; } if ( hasValidData ) { result = new Double ( maximum ) ; } return result ; }
returns the maximum value in the dataset range , assuming that values in each category are " stacked " .
