x = da[i];
{ x = da[i] * dZoomFactor; }
	public final boolean checkFit( IDisplayServer xs, Label la,			int iLabelLocation ) throws ChartException	{		if ( iType == TEXT || bCategoryScale )		// !MUST IGNORE the label visibility here.Don't check it!		// || !la.isSetVisible( )		// || ( la.isSetVisible( ) && !la.isVisible( ) ) )		{			return true;		}		final double dAngleInDegrees = la.getCaption( )				.getFont( )				.getRotation( );		double x = 0, y = 0;		int iPointToCheck = 0;		if ( iLabelLocation == ABOVE || iLabelLocation == BELOW )		{			if ( iScaleDirection == BACKWARD )			{				iPointToCheck = ( dAngleInDegrees < 0 && dAngleInDegrees > -90 ) ? 1						: 2;			}			else			{				iPointToCheck = ( dAngleInDegrees < 0 && dAngleInDegrees > -90 ) ? 3						: 0;			}		}		else if ( iLabelLocation == LEFT || iLabelLocation == RIGHT )		{			if ( iScaleDirection == FORWARD )			{				iPointToCheck = ( dAngleInDegrees < 0 && dAngleInDegrees > -90 ) ? 0						: 1;			}			else			{				iPointToCheck = ( dAngleInDegrees < 0 && dAngleInDegrees > -90 ) ? 2						: 3;			}		}		double[] da = daTickCoordinates;		RotatedRectangle rrPrev = null, rrPrev2 = null, rr;		if ( ( iType & ( NUMERICAL | LINEAR ) ) == ( NUMERICAL | LINEAR ) )		{			double dAxisValue = asDouble( getMinimum( ) ).doubleValue( );			final double dAxisStep = asDouble( getStep( ) ).doubleValue( );			String sText;			DecimalFormat df = null;			if ( fs == null ) // CREATE IF FORMAT SPECIFIER IS UNDEFINED			{				df = new DecimalFormat( getNumericPattern( ) );			}			final NumberDataElement nde = NumberDataElementImpl.create( 0 );			for ( int i = 0; i < da.length; i++ )			{				// TODO special logic for last datapoint in non-equal scale unit				// case.				nde.setValue( dAxisValue );				try				{					sText = ValueFormatter.format( nde,							fs,							rtc.getULocale( ),							df );				}				catch ( ChartException dfex )				{					logger.log( dfex );					sText = NULL_STRING;				}				if ( iLabelLocation == ABOVE || iLabelLocation == BELOW )				{					x = da[i];				}				else if ( iLabelLocation == LEFT || iLabelLocation == RIGHT )				{					y = da[i];				}				la.getCaption( ).setValue( sText );				try				{					rr = computePolygon( xs, iLabelLocation, la, x, y );				}				catch ( IllegalArgumentException uiex )				{					throw new ChartException( ChartEnginePlugin.ID,							ChartException.GENERATION,							uiex );				}				Point p = rr.getPoint( iPointToCheck );				if ( isAxisLabelStaggered( ) && baTickLabelStaggered[i] )				{					if ( rrPrev2 != null							&& ( rrPrev2.contains( p )									|| rrPrev2.getPoint( iPointToCheck )											.equals( p ) || ChartUtil.intersects( rr,									rrPrev2 ) ) )					{						return false;					}					rrPrev2 = rr;				}				else				{					if ( rrPrev != null							&& ( rrPrev.contains( p )									|| rrPrev.getPoint( iPointToCheck )											.equals( p ) || ChartUtil.intersects( rr,									rrPrev ) ) )					{						return false;					}					rrPrev = rr;				}				dAxisValue += dAxisStep;			}		}		else if ( ( iType & ( NUMERICAL | LOGARITHMIC ) ) == ( NUMERICAL | LOGARITHMIC ) )		{			double dAxisValue = asDouble( getMinimum( ) ).doubleValue( );			final double dAxisStep = asDouble( getStep( ) ).doubleValue( );			String sText;			NumberDataElement nde = NumberDataElementImpl.create( 0 );			DecimalFormat df = null;			for ( int i = 0; i < da.length; i++ )			{				nde.setValue( dAxisValue );				if ( fs == null )				{					df = new DecimalFormat( getNumericPattern( dAxisValue ) );				}				try				{					sText = ValueFormatter.format( nde,							fs,							rtc.getULocale( ),							df );				}				catch ( ChartException dfex )				{					logger.log( dfex );					sText = NULL_STRING;				}				if ( iLabelLocation == ABOVE || iLabelLocation == BELOW )				{					x = da[i];				}				else if ( iLabelLocation == LEFT || iLabelLocation == RIGHT )				{					y = da[i];				}				la.getCaption( ).setValue( sText );				try				{					rr = computePolygon( xs, iLabelLocation, la, x, y );				}				catch ( IllegalArgumentException uiex )				{					throw new ChartException( ChartEnginePlugin.ID,							ChartException.GENERATION,							uiex );				}				Point p = rr.getPoint( iPointToCheck );				if ( isAxisLabelStaggered( ) && baTickLabelStaggered[i] )				{					if ( rrPrev2 != null							&& ( rrPrev2.contains( p )									|| rrPrev2.getPoint( iPointToCheck )											.equals( p ) || ChartUtil.intersects( rr,									rrPrev2 ) ) )					{						return false;					}					rrPrev2 = rr;				}				else				{					if ( rrPrev != null							&& ( rrPrev.contains( p ) || rrPrev.getPoint( iPointToCheck )									.equals( p ) ) )					{						return false;					}					rrPrev = rr;				}				dAxisValue *= dAxisStep;			}		}		else if ( iType == DATE_TIME )		{			CDateTime cdt, cdtAxisValue = asDateTime( oMinimum );			final int iUnit = asInteger( oUnit );			final int iStep = asInteger( oStep );			final IDateFormatWrapper sdf = DateFormatWrapperFactory.getPreferredDateFormat( iUnit,					rtc.getULocale( ) );			String sText;			cdt = cdtAxisValue;			for ( int i = 0; i < da.length; i++ )			{				sText = sdf.format( cdt.getTime( ) );				if ( iLabelLocation == ABOVE || iLabelLocation == BELOW )					x = da[i];				else if ( iLabelLocation == LEFT || iLabelLocation == RIGHT )					y = da[i];				la.getCaption( ).setValue( sText );				try				{					rr = computePolygon( xs, iLabelLocation, la, x, y );				}				catch ( IllegalArgumentException uiex )				{					throw new ChartException( ChartEnginePlugin.ID,							ChartException.GENERATION,							uiex );				}				Point p = rr.getPoint( iPointToCheck );				if ( isAxisLabelStaggered( ) && baTickLabelStaggered[i] )				{					if ( rrPrev2 != null							&& ( rrPrev2.contains( p )									|| rrPrev2.getPoint( iPointToCheck )											.equals( p ) || ChartUtil.intersects( rr,									rrPrev2 ) ) )					{						return false;					}					rrPrev2 = rr;				}				else				{					if ( rrPrev != null							&& ( rrPrev.contains( p ) || rrPrev.getPoint( iPointToCheck )									.equals( p ) ) )					{						return false;					}					rrPrev = rr;				}				cdt = cdtAxisValue.forward( iUnit, iStep * ( i + 1 ) ); // ALWAYS				// W.R.T				// START				// VALUE			}		}		return true;	}