Axis oldPrimaryAxis = getAxisYForProcessing( (ChartWithAxes) chartModel, axisIndex ); if ( oldPrimaryAxis.isPrimaryAxis( ) ) { int yAxisSize = getOrthogonalAxisNumber( chartModel ); Axis newPrimaryAxis = null; if ( axisIndex + 1 < yAxisSize ) { newPrimaryAxis = getAxisYForProcessing( (ChartWithAxes) chartModel, axisIndex + 1 ); } else { newPrimaryAxis = getAxisYForProcessing( (ChartWithAxes) chartModel, 0 ); }  newPrimaryAxis.setPrimaryAxis( true ); newPrimaryAxis.setOrigin( oldPrimaryAxis.getOrigin( ) ); newPrimaryAxis.setLabelPosition( oldPrimaryAxis.getLabelPosition( ) ); newPrimaryAxis.setTitlePosition( oldPrimaryAxis.getTitlePosition( ) ); } return null;
newPrimaryAxis = getAxisYForProcessing( (ChartWithAxes) chartModel, axisIndex + 1 );
	public static void removeAxis( final Chart chartModel, final int axisIndex )	{		if ( chartModel instanceof ChartWithoutAxes )		{			return;		}		ChartAdapter.changeChartWithoutNotification( new IChangeWithoutNotification( ) {			public Object run( )			{				// Ensure one primary axis existent				Axis oldPrimaryAxis = getAxisYForProcessing( (ChartWithAxes) chartModel,						axisIndex );				if ( oldPrimaryAxis.isPrimaryAxis( ) )				{					int yAxisSize = getOrthogonalAxisNumber( chartModel );					Axis newPrimaryAxis = null;					if ( axisIndex + 1 < yAxisSize )					{						newPrimaryAxis = getAxisYForProcessing( (ChartWithAxes) chartModel,								axisIndex + 1 );					}					else					{						newPrimaryAxis = getAxisYForProcessing( (ChartWithAxes) chartModel,								0 );					}					// Retain the properties of primary axis					newPrimaryAxis.setPrimaryAxis( true );					newPrimaryAxis.setOrigin( oldPrimaryAxis.getOrigin( ) );					newPrimaryAxis.setLabelPosition( oldPrimaryAxis.getLabelPosition( ) );					newPrimaryAxis.setTitlePosition( oldPrimaryAxis.getTitlePosition( ) );				}				return null;			}		} );		// Remove the orthogonal axis		getAxisXForProcessing( (ChartWithAxes) chartModel ).getAssociatedAxes( )				.remove( axisIndex );		// Remove the sample data of the axis		// int iSDIndexFirst = getLastSeriesIndexWithinAxis( chartModel,		// axisIndex - 1 ) + 1;		// int iSDIndexLast = getLastSeriesIndexWithinAxis( chartModel,		// axisIndex );		// EList list = chartModel.getSampleData( ).getOrthogonalSampleData( );		// for ( int i = 0; i < list.size( ); i++ )		// {		// if ( i >= iSDIndexFirst && i <= iSDIndexLast )		// {		// list.remove( i );		// i--;		// iSDIndexLast--;		// }		// }	}