protected void selectHorizontalAutoTickUnit(Graphics2D g2,Rectangle2D dataArea,RectangleEdge edge){
  Range range=getRange();
  double logAxisMin=calculateLog(Math.max(this.smallestValue,range.getLowerBound()));
  double logAxisMax=calculateLog(range.getUpperBound());
  double size=(logAxisMax - logAxisMin) / 50;
  TickUnitSource tickUnits=getStandardTickUnits();
  TickUnit candidate=tickUnits.getCeilingTickUnit(size);
  TickUnit prevCandidate=candidate;
  boolean found=false;
  while (!found) {
    this.tickUnit=(NumberTickUnit)candidate;
    double tickLabelWidth=estimateMaximumTickLabelWidth(g2,candidate);
    double candidateWidth=exponentLengthToJava2D(candidate.getSize(),dataArea,edge);
    if (tickLabelWidth < candidateWidth) {
      found=true;
    }
 else     if (Double.isNaN(candidateWidth)) {
      candidate=prevCandidate;
      found=true;
    }
 else {
      prevCandidate=candidate;
      candidate=tickUnits.getLargerTickUnit(prevCandidate);
      if (candidate.equals(prevCandidate)) {
        found=true;
      }
    }
  }
  setTickUnit((NumberTickUnit)candidate,false,false);
}

protected void selectHorizontalAutoTickUnit ( Graphics2D g2 , Rectangle2D dataArea , RectangleEdge edge ) { Range range = getRange ( ) ; double logAxisMin = calculateLog ( Math . max ( this . smallestValue , range . getLowerBound ( ) ) ) ; double logAxisMax = calculateLog ( range . getUpperBound ( ) ) ; double size = ( logAxisMax - logAxisMin ) / 50 ; TickUnitSource tickUnits = getStandardTickUnits ( ) ; TickUnit candidate = tickUnits . getCeilingTickUnit ( size ) ; TickUnit prevCandidate = candidate ; boolean found = false ; while ( ! found ) { this . tickUnit = ( NumberTickUnit ) candidate ; double tickLabelWidth = estimateMaximumTickLabelWidth ( g2 , candidate ) ; double candidateWidth = exponentLengthToJava2D ( candidate . getSize ( ) , dataArea , edge ) ; if ( tickLabelWidth < candidateWidth ) { found = true ; } else if ( Double . isNaN ( candidateWidth ) ) { candidate = prevCandidate ; found = true ; } else { prevCandidate = candidate ; candidate = tickUnits . getLargerTickUnit ( prevCandidate ) ; if ( candidate . equals ( prevCandidate ) ) { found = true ; } } } setTickUnit ( ( NumberTickUnit ) candidate , false , false ) ; }
selects an appropriate tick value for the axis . the strategy is to display as many ticks as possible ( selected from an array of ' standard ' tick units ) without the labels overlapping .
