int nTicks = 0; double dLength = 0; double dTickGap = 0; int iDirection = ( iScaleDirection == AUTO ) ? ( ( iOrientation == HORIZONTAL ) ? FORWARD : BACKWARD ) : iScaleDirection; DataSetIterator dsi = getData( );  if ( bConsiderStartEndLabels ) { computeAxisStartEndShifts( xs, la, iOrientation, iLabelLocation, aax ); dStart += dStartShift * iDirection; dEnd += dEndShift * -iDirection; }  if ( ( iType & TEXT ) == TEXT || bCategoryScale ) { nTicks = dsi.size( ) + 1; dLength = Math.abs( dStart - dEnd ); } else if ( ( iType & NUMERICAL ) == NUMERICAL ) { nTicks = getTickCount( ); dLength = Math.abs( dStart - dEnd ); } else if ( ( iType & DATE_TIME ) == DATE_TIME ) { final CDateTime cdt1 = (CDateTime) oMinimum; final CDateTime cdt2 = (CDateTime) oMaximum; final double dNumberOfSteps = Math.ceil( CDateTime.computeDifference( cdt2, cdt1, asInteger( oUnit ) ) ); nTicks = (int) ( dNumberOfSteps / asInteger( oStep ) ) + 1; dLength = Math.abs( dStart - dEnd ); } else { throw new ChartException( ChartEnginePlugin.ID, ChartException.GENERATION, "exception.unknown.axis.type.tick.computations", Messages.getResourceBundle( rtc.getULocale( ) ) ); }  if ( !bCategoryScale && ( iType & NUMERICAL ) == NUMERICAL && ( iType & LINEAR ) == LINEAR ) { double dMax = asDouble( oMaximum ).doubleValue( ); double dMin = asDouble( oMinimum ).doubleValue( ); double dStep = asDouble( oStep ).doubleValue( );  dTickGap = Math.min( Math.abs( dStep / ( dMax - dMin ) * dLength ), dLength ) * iDirection; } else { dTickGap = dLength / ( nTicks - 1 ) * iDirection; }  double d = dStart + dTickGap; final double[] da = new double[nTicks];  for ( int i = 1; i < nTicks - 1; i++, d += dTickGap ) { da[i] = d; } da[0] = dStart; da[nTicks - 1] = dEnd; setTickCordinates( null ); setEndPoints( dStart, dEnd ); setTickCordinates( da );  baTickLabelVisible = checkTickLabelsVisibility( xs, la, iLabelLocation );  return nTicks;
return computeTicks( xs, la, iLabelLocation, iOrientation, dStart, dEnd, bConsiderStartEndLabels, bConsiderStartEndLabels, aax );
	public final int computeTicks( IDisplayServer xs, Label la,			int iLabelLocation, int iOrientation, double dStart, double dEnd,			boolean bConsiderStartEndLabels, AllAxes aax )			throws ChartException	{		int nTicks = 0;		double dLength = 0;		double dTickGap = 0;		int iDirection = ( iScaleDirection == AUTO ) ? ( ( iOrientation == HORIZONTAL ) ? FORWARD				: BACKWARD )				: iScaleDirection;		DataSetIterator dsi = getData( );		if ( bConsiderStartEndLabels )		{			computeAxisStartEndShifts( xs,					la,					iOrientation,					iLabelLocation,					aax );			dStart += dStartShift * iDirection;			dEnd += dEndShift * -iDirection;		}		if ( ( iType & TEXT ) == TEXT || bCategoryScale )		{			nTicks = dsi.size( ) + 1;			dLength = Math.abs( dStart - dEnd );		}		else if ( ( iType & NUMERICAL ) == NUMERICAL )		{			nTicks = getTickCount( );			dLength = Math.abs( dStart - dEnd );		}		else if ( ( iType & DATE_TIME ) == DATE_TIME )		{			final CDateTime cdt1 = (CDateTime) oMinimum;			final CDateTime cdt2 = (CDateTime) oMaximum;			final double dNumberOfSteps = Math.ceil( CDateTime.computeDifference( cdt2,					cdt1,					asInteger( oUnit ) ) );			nTicks = (int) ( dNumberOfSteps / asInteger( oStep ) ) + 1;			dLength = Math.abs( dStart - dEnd );		}		else		{			throw new ChartException( ChartEnginePlugin.ID,					ChartException.GENERATION,					"exception.unknown.axis.type.tick.computations", //$NON-NLS-1$					Messages.getResourceBundle( rtc.getULocale( ) ) );		}		if ( !bCategoryScale				&& ( iType & NUMERICAL ) == NUMERICAL				&& ( iType & LINEAR ) == LINEAR )		{			double dMax = asDouble( oMaximum ).doubleValue( );			double dMin = asDouble( oMinimum ).doubleValue( );			double dStep = asDouble( oStep ).doubleValue( );			dTickGap = Math.min( Math.abs( dStep / ( dMax - dMin ) * dLength ),					dLength )					* iDirection;		}		else		{			dTickGap = dLength / ( nTicks - 1 ) * iDirection;		}		double d = dStart + dTickGap;		final double[] da = new double[nTicks];		for ( int i = 1; i < nTicks - 1; i++, d += dTickGap )		{			da[i] = d;		}		da[0] = dStart;		da[nTicks - 1] = dEnd;		setTickCordinates( null );		setEndPoints( dStart, dEnd );		setTickCordinates( da );		baTickLabelVisible = checkTickLabelsVisibility( xs, la, iLabelLocation );		return nTicks;	}