* *       0          1 *         NextLabel *       3          2 * *       0              1    0          1 *         PreviousLabel       NextLabel *       3              2    3          2 *
* * 0 1 NextLabel 3 2 * * 0 1 0 1 PreviousLabel NextLabel 3 2 3 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 );		if ( !vis )		{			// all non-visible label, skip checking.			return ba;		}		if ( iType != TEXT && !bCategoryScale )		{			// Already auto scaled, just return all as true.			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++ )		{			if ( dsi.hasNext( ) )			{				sText = formatCategoryValue( iType, dsi.next( ), iDateTimeUnit );			}			else			{				sText = NULL_STRING;			}			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( ) && i % 2 == 1 )			{								ba[i] = checkOneTickLabelVisibility( rrPrev, 1, iLabelLocation, x, y, iNewPointToCheck, iPrevPointToCheck, la, xs, i );			}			else			{				ba[i] = checkOneTickLabelVisibility( rrPrev, 0, iLabelLocation, x, y, iNewPointToCheck, iPrevPointToCheck, la, xs, i );			}		}		return ba;	}