iNewPointToCheck = isNegativeRotation ? 3 : 0; iPrevPointToCheck = isNegativeRotation ? 0 : 2;
iNewPointToCheck = isNegativeRotation ? ( iScaleDirection == BACKWARD ? 1 : 3 ) : ( iScaleDirection == BACKWARD ? 2 : 0 ); iPrevPointToCheck = isNegativeRotation ? ( iScaleDirection == BACKWARD ? 2 : 0 ) : ( iScaleDirection == BACKWARD ? 0 : 2 );
	final protected boolean[] checkTickLabelsVisibility( IDisplayServer xs,			Label la, int iLabelLocation ) throws ChartException	{		boolean[] ba = new boolean[daTickCoordinates.length];		boolean vis = la.isSetVisible( ) && la.isVisible( );		Arrays.fill( ba, vis );		// initialize stagger state.		baTickLabelStaggered = new boolean[daTickCoordinates.length];		boolean staggerEnabled = isAxisLabelStaggered( );		// all non-visible label, skip checking.		if ( !vis )		{			return ba;		}		// check with showing interval.		if ( iLabelShowingInterval >= 2 )		{			for ( int i = 0, c = 0; i < ba.length; i++ )			{				ba[i] = ( i % iLabelShowingInterval == 0 );				if ( staggerEnabled && ba[i] )				{					c++;					baTickLabelStaggered[i] = ( c % 2 == 0 );				}			}		}		else		{			// no interval applied.			if ( staggerEnabled )			{				for ( int i = 0; i < ba.length; i++ )				{					baTickLabelStaggered[i] = ( i % 2 != 0 );				}			}		}		if ( iType != TEXT && !bCategoryScale )		{			// This should be already auto scaled, just return here.			return ba;		}		final double dAngleInDegrees = la.getCaption( )				.getFont( )				.getRotation( );		double x = 0, y = 0;		int iNewPointToCheck = 0, iPrevPointToCheck = 0;		/*		 * Rectangle points are layed out like this		 * 		 * 0 1 NextLabel 3 2		 * 		 * 0 1 0 1 PreviousLabel NextLabel 3 2 3 2		 * 		 * 		 */		boolean isNegativeRotation = ( dAngleInDegrees < 0 && dAngleInDegrees > -90 );		switch ( iLabelLocation )		{			case ABOVE :				iNewPointToCheck = isNegativeRotation ? 3 : 0;				iPrevPointToCheck = isNegativeRotation ? 1 : 3;				break;			case BELOW :				iNewPointToCheck = isNegativeRotation ? 3 : 0;				iPrevPointToCheck = isNegativeRotation ? 0 : 2;				break;			case LEFT :				iNewPointToCheck = 2;				iPrevPointToCheck = 1;				break;			case RIGHT :				iNewPointToCheck = 3;				iPrevPointToCheck = 0;				break;		}		RotatedRectangle rrPrev[] = new RotatedRectangle[2];		DataSetIterator dsi = getData( );		dsi.reset( );		final int iDateTimeUnit = ( iType == IConstants.DATE_TIME ) ? CDateTime.computeUnit( dsi )				: IConstants.UNDEFINED;		String sText = null;		dsi.reset( );		for ( int i = 0; i < daTickCoordinates.length - 1; i++ )		{			Object oValue = null;						if ( dsi.hasNext( ) )			{				oValue = dsi.next( );			}			// only check visible labels.			if ( ba[i] )			{				sText = formatCategoryValue( iType, oValue, iDateTimeUnit );				if ( iLabelLocation == ABOVE || iLabelLocation == BELOW )				{					x = this.daTickCoordinates[i];				}				else if ( iLabelLocation == LEFT || iLabelLocation == RIGHT )				{					y = this.daTickCoordinates[i];				}				la.getCaption( ).setValue( sText );				if ( isAxisLabelStaggered( ) && baTickLabelStaggered[i] )				{					// check second line.					ba[i] = checkOneTickLabelVisibility( rrPrev,							1,							iLabelLocation,							x,							y,							iNewPointToCheck,							iPrevPointToCheck,							la,							xs,							i );				}				else				{					// check first line.					ba[i] = checkOneTickLabelVisibility( rrPrev,							0,							iLabelLocation,							x,							y,							iNewPointToCheck,							iPrevPointToCheck,							la,							xs,							i );				}			}		}		return ba;	}