public static double calculateStackTotal(TableXYDataset dataset,int item){
  double total=0.0;
  int seriesCount=dataset.getSeriesCount();
  for (int s=0; s < seriesCount; s++) {
    double value=dataset.getYValue(s,item);
    if (!Double.isNaN(value)) {
      total=total + value;
    }
  }
  return total;
}

public static double calculateStackTotal ( TableXYDataset dataset , int item ) { double total = 0.0 ; int seriesCount = dataset . getSeriesCount ( ) ; for ( int s = 0 ; s < seriesCount ; s ++ ) { double value = dataset . getYValue ( s , item ) ; if ( ! Double . isNaN ( value ) ) { total = total + value ; } } return total ; }
calculates the total for the y - values in all series for a given item index .
