protected double calculateCategorySize(int categoryCount,Rectangle2D area,RectangleEdge edge){
  double result;
  double available=0.0;
  if ((edge == RectangleEdge.TOP) || (edge == RectangleEdge.BOTTOM)) {
    available=area.getWidth();
  }
 else   if ((edge == RectangleEdge.LEFT) || (edge == RectangleEdge.RIGHT)) {
    available=area.getHeight();
  }
  if (categoryCount > 1) {
    result=available * (1 - getLowerMargin() - getUpperMargin()- getCategoryMargin());
    result=result / categoryCount;
  }
 else {
    result=available * (1 - getLowerMargin() - getUpperMargin());
  }
  return result;
}

protected double calculateCategorySize ( int categoryCount , Rectangle2D area , RectangleEdge edge ) { double result ; double available = 0.0 ; if ( ( edge == RectangleEdge . TOP ) || ( edge == RectangleEdge . BOTTOM ) ) { available = area . getWidth ( ) ; } else if ( ( edge == RectangleEdge . LEFT ) || ( edge == RectangleEdge . RIGHT ) ) { available = area . getHeight ( ) ; } if ( categoryCount > 1 ) { result = available * ( 1 - getLowerMargin ( ) - getUpperMargin ( ) - getCategoryMargin ( ) ) ; result = result / categoryCount ; } else { result = available * ( 1 - getLowerMargin ( ) - getUpperMargin ( ) ) ; } return result ; }
calculates the size ( width or height , depending on the location of the axis ) of a category .
