public void calcMajorTick(){
  fraction=UNIT;
  double u=majorTick;
  double r=maxTick - minTick;
  majorTickCount=(int)(r / u);
  while (majorTickCount < prefMajorTickCount) {
    u=majorTick / 2;
    if (!isDiscrete || u == Math.floor(u)) {
      majorTickCount=(int)(r / u);
      fraction=HALFS;
      if (majorTickCount >= prefMajorTickCount)       break;
    }
    u=majorTick / 4;
    if (!isDiscrete || u == Math.floor(u)) {
      majorTickCount=(int)(r / u);
      fraction=QUARTERS;
      if (majorTickCount >= prefMajorTickCount)       break;
    }
    u=majorTick / 5;
    if (!isDiscrete || u == Math.floor(u)) {
      majorTickCount=(int)(r / u);
      fraction=FIFTHS;
      if (majorTickCount >= prefMajorTickCount)       break;
    }
    if (isDiscrete && (majorTick / 10) != Math.floor(majorTick / 10)) {
      u=majorTick;
      majorTickCount=(int)(r / u);
      break;
    }
    majorTick/=10;
    u=majorTick;
    majorTickCount=(int)(r / u);
    fraction=UNIT;
  }
  majorTick=u;
  if (isDiscrete && majorTick < 1.0) {
    majorTick=1.0;
    majorTickCount=(int)(r / majorTick);
    fraction=UNIT;
  }
  majorTickCount++;
  while ((minTick + majorTick - epsilon) < minData) {
    minTick+=majorTick;
    majorTickCount--;
  }
  while ((maxTick - majorTick + epsilon) > maxData) {
    maxTick-=majorTick;
    majorTickCount--;
  }
}

public void calcMajorTick ( ) { fraction = UNIT ; double u = majorTick ; double r = maxTick - minTick ; majorTickCount = ( int ) ( r / u ) ; while ( majorTickCount < prefMajorTickCount ) { u = majorTick / 2 ; if ( ! isDiscrete || u == Math . floor ( u ) ) { majorTickCount = ( int ) ( r / u ) ; fraction = HALFS ; if ( majorTickCount >= prefMajorTickCount ) break ; } u = majorTick / 4 ; if ( ! isDiscrete || u == Math . floor ( u ) ) { majorTickCount = ( int ) ( r / u ) ; fraction = QUARTERS ; if ( majorTickCount >= prefMajorTickCount ) break ; } u = majorTick / 5 ; if ( ! isDiscrete || u == Math . floor ( u ) ) { majorTickCount = ( int ) ( r / u ) ; fraction = FIFTHS ; if ( majorTickCount >= prefMajorTickCount ) break ; } if ( isDiscrete && ( majorTick / 10 ) != Math . floor ( majorTick / 10 ) ) { u = majorTick ; majorTickCount = ( int ) ( r / u ) ; break ; } majorTick /= 10 ; u = majorTick ; majorTickCount = ( int ) ( r / u ) ; fraction = UNIT ; } majorTick = u ; if ( isDiscrete && majorTick < 1.0 ) { majorTick = 1.0 ; majorTickCount = ( int ) ( r / majorTick ) ; fraction = UNIT ; } majorTickCount ++ ; while ( ( minTick + majorTick - epsilon ) < minData ) { minTick += majorTick ; majorTickCount -- ; } while ( ( maxTick - majorTick + epsilon ) > maxData ) { maxTick -= majorTick ; majorTickCount -- ; } }
calculate the optimum major tick distance . override to change default behaviour
