PropertyHandle computedSet = eih.getColumnBindings( ); cs1.setExpression( "dataSetRow[\"Month\"]" ); computedSet.addItem( cs1 ); cs2.setExpression( "dataSetRow[\"Product\"]" ); computedSet.addItem( cs2 ); cs3.setExpression( "dataSetRow[\"Amount\"]" ); computedSet.addItem( cs3 );
	private ExtendedItemHandle createPieChart( )	{		ExtendedItemHandle eih = elementFactory.newExtendedItem( null, "Chart" );//$NON-NLS-1$		try		{			eih.setHeight( "288pt" );//$NON-NLS-1$			eih.setWidth( "252pt" );//$NON-NLS-1$			eih.setProperty( ExtendedItemHandle.DATA_SET_PROP, "Data Set" );//$NON-NLS-1$		}		catch ( SemanticException e )		{			e.printStackTrace( );		}		ChartWithoutAxes cwoaPie = ChartWithoutAxesImpl.create( );		cwoaPie.setType( "Pie Chart" );//$NON-NLS-1$		cwoaPie.setSubType( "Standard Pie Chart" );//$NON-NLS-1$		cwoaPie.getTitle( ).setVisible( false );		cwoaPie.getBlock( ).setBounds( BoundsImpl.create( 0, 0, 252, 288 ) );		cwoaPie.getBlock( ).getOutline( ).setVisible( true );		cwoaPie.getBlock( )				.setBackground( GradientImpl.create( ColorDefinitionImpl.create( 204,						254,						204 ),						ColorDefinitionImpl.create( 254, 226, 240 ),						-35,						false ) );		cwoaPie.getPlot( )				.getClientArea( )				.setBackground( ColorDefinitionImpl.TRANSPARENT( ) );		cwoaPie.getLegend( ).setBackground( ColorDefinitionImpl.TRANSPARENT( ) );		cwoaPie.getLegend( )				.getClientArea( )				.setBackground( ColorDefinitionImpl.TRANSPARENT( ) );		SampleData sd = DataFactory.eINSTANCE.createSampleData( );		BaseSampleData sdBase = DataFactory.eINSTANCE.createBaseSampleData( );		sdBase.setDataSetRepresentation( "Category-A, Category-B" );//$NON-NLS-1$		sd.getBaseSampleData( ).add( sdBase );		OrthogonalSampleData sdOrthogonal = DataFactory.eINSTANCE.createOrthogonalSampleData( );		sdOrthogonal.setDataSetRepresentation( "4,12" );//$NON-NLS-1$		sdOrthogonal.setSeriesDefinitionIndex( 0 );		sd.getOrthogonalSampleData( ).add( sdOrthogonal );		cwoaPie.setSampleData( sd );		Series seCategory = SeriesImpl.create( );		Query query = QueryImpl.create( "row[\"Product\"]" );//$NON-NLS-1$		seCategory.getDataDefinition( ).add( query );		SeriesDefinition series = SeriesDefinitionImpl.create( );		series.getSeries( ).add( seCategory );		cwoaPie.getSeriesDefinitions( ).add( series );		PieSeries ps = (PieSeries) PieSeriesImpl.create( );		Query query2 = QueryImpl.create( "row[\"Amount\"]" );//$NON-NLS-1$		ps.getDataDefinition( ).add( query2 );		SeriesDefinition seGroup = SeriesDefinitionImpl.create( );		Query query1 = QueryImpl.create( "row[\"Month\"]" );//$NON-NLS-1$		seGroup.setQuery( query1 );		series.getSeriesPalette( ).update( -2 );		series.getSeriesDefinitions( ).add( seGroup );		seGroup.getSeries( ).add( ps );		DataPointComponent dpc = DataPointComponentImpl.create( DataPointComponentType.ORTHOGONAL_VALUE_LITERAL,				JavaNumberFormatSpecifierImpl.create( "###,###" ) );//$NON-NLS-1$		ps.getDataPoint( ).getComponents( ).clear( );		ps.getDataPoint( ).getComponents( ).add( dpc );		ps.getLabel( ).setVisible( true );		ChartReportItemImpl crii;		try		{			//Add ChartReportItemImpl to ExtendedItemHandle			crii = (ChartReportItemImpl) eih.getReportItem( );			//Add chart instance to ChartReportItemImpl			crii.setProperty( "chart.instance", cwoaPie );//$NON-NLS-1$		}		catch ( ExtendedElementException e )		{			e.printStackTrace( );		}		return eih;	}