chartModel.getSampleData( ) .getOrthogonalSampleData( ) .add( sdOrthogonal );
SampleData sd = chartModel.getSampleData( );   int currentSize = sd.getOrthogonalSampleData( ).size( ); for ( int i = 0; i < currentSize; i++ ) { OrthogonalSampleData sdOrthogonal = (OrthogonalSampleData) EcoreUtil.copy( (EObject) chartModel.getSampleData( ) .getOrthogonalSampleData( ) .get( i ) ); sdOrthogonal.setSeriesDefinitionIndex( currentSize + i ); sdOrthogonal.eAdapters( ).addAll( sd.eAdapters( ) ); sd.getOrthogonalSampleData( ).add( sdOrthogonal ); }
	private void addOverlayAxis( )	{		if ( chartModel instanceof ChartWithoutAxes )		{			throw new IllegalArgumentException( Messages.getString( "TaskSelectType.Exception.CannotSupportAxes" ) ); //$NON-NLS-1$		}		// Create a clone of the existing Y Axis		Axis yAxis = (Axis) ( (Axis) ( (ChartWithAxes) chartModel ).getAxes( )				.get( 0 ) ).getAssociatedAxes( ).get( 0 );		Axis overlayAxis = (Axis) EcoreUtil.copy( yAxis );		// Now update overlay axis to set the properties that are different from		// the original		overlayAxis.setPrimaryAxis( false );		overlayAxis.setOrigin( AxisOriginImpl.create( IntersectionType.MAX_LITERAL,				null ) );		overlayAxis.setLabelPosition( Position.RIGHT_LITERAL );		overlayAxis.setTitlePosition( Position.RIGHT_LITERAL );		overlayAxis.getTitle( )				.getCaption( )				.setValue( Messages.getString( "TaskSelectType.Caption.OverlayAxis1" ) ); //$NON-NLS-1$		// Add the notification listeners from the old axis to the new one		overlayAxis.eAdapters( ).addAll( yAxis.eAdapters( ) );		// Update overlay series definition		( (SeriesDefinition) overlayAxis.getSeriesDefinitions( ).get( 0 ) ).getQuery( )				.setDefinition( "" ); //$NON-NLS-1$		( (SeriesDefinition) overlayAxis.getSeriesDefinitions( ).get( 0 ) ).getSeriesPalette( )				.update( 1 );		// Update the sample values for the new overlay series		SampleData sd = chartModel.getSampleData( );		// Create a new OrthogonalSampleData instance from the existing one		OrthogonalSampleData sdOrthogonal = DataFactory.eINSTANCE.createOrthogonalSampleData( );		// TODO: This is HARD CODED sample data...this WILL FAIL for Stock		// series. This should actually be obtained from		// the series data feeder as 'default sample values'		sdOrthogonal.setDataSetRepresentation( "23,61,-12" ); //$NON-NLS-1$		sdOrthogonal.setSeriesDefinitionIndex( yAxis.getSeriesDefinitions( )				.size( ) );		sdOrthogonal.eAdapters( ).addAll( sd.eAdapters( ) );		// Update the chart model with the new Axis		( (Axis) ( (ChartWithAxes) chartModel ).getAxes( ).get( 0 ) ).getAssociatedAxes( )				.add( overlayAxis );		// Update the SampleData		chartModel.getSampleData( )				.getOrthogonalSampleData( )				.add( sdOrthogonal );	}