PropertyHandle computedSet = eih.getColumnBindings( ); cs1.setExpression( "dataSetRow[\"Date\"]" ); computedSet.addItem( cs1 ); cs2.setExpression( "dataSetRow[\"High\"]" ); computedSet.addItem( cs2 ); cs3.setExpression( "dataSetRow[\"Close\"]" ); computedSet.addItem( cs3 ); cs4.setExpression( "dataSetRow[\"Low\"]" ); computedSet.addItem( cs4 ); cs5.setExpression( "dataSetRow[\"Open\"]" ); computedSet.addItem( cs5 ); cs6.setExpression( "dataSetRow[\"Volume\"]" ); computedSet.addItem( cs6 );
	private ExtendedItemHandle createVolumeChart( )	{		ExtendedItemHandle eih = elementFactory.newExtendedItem( null, "Chart" );//$NON-NLS-1$		try		{			eih.setHeight( "175pt" );//$NON-NLS-1$			eih.setWidth( "450pt" );//$NON-NLS-1$			eih.setProperty( ExtendedItemHandle.DATA_SET_PROP, "Data Set" );//$NON-NLS-1$		}		catch ( SemanticException e )		{			e.printStackTrace( );		}		ChartWithAxes cwaBar = ChartWithAxesImpl.create( );		cwaBar.setType( "Bar Chart" );//$NON-NLS-1$		cwaBar.setSubType( "Side-by-side" );//$NON-NLS-1$		cwaBar.getTitle( ).setVisible( false );		cwaBar.getLegend( ).setVisible( false );		cwaBar.setOrientation( Orientation.VERTICAL_LITERAL );		cwaBar.getBlock( ).setBounds( BoundsImpl.create( 0, 0, 450, 175 ) );		cwaBar.getPlot( ).getClientArea( ).getOutline( ).setVisible( true );		cwaBar.getPlot( ).getClientArea( ).setBackground(				ColorDefinitionImpl.create( 254, 251, 233 ) );		Axis xAxisPrimary = cwaBar.getPrimaryBaseAxes( )[0];		xAxisPrimary.setCategoryAxis( true );		xAxisPrimary.getTitle( ).getCaption( ).setValue( "Trading Date" );//$NON-NLS-1$		xAxisPrimary.getMajorGrid( ).getLineAttributes( ).setStyle(				LineStyle.DOTTED_LITERAL );		xAxisPrimary.getMajorGrid( ).getLineAttributes( ).setVisible( true );		xAxisPrimary.getMajorGrid( ).getLineAttributes( ).setColor(				ColorDefinitionImpl.GREY( ) );		xAxisPrimary.setType( AxisType.DATE_TIME_LITERAL );		xAxisPrimary.setFormatSpecifier( JavaDateFormatSpecifierImpl				.create( "MM/dd/yyyy" ) );//$NON-NLS-1$		Axis yAxisPrimary = cwaBar.getPrimaryOrthogonalAxis( xAxisPrimary );		yAxisPrimary.getTitle( ).getCaption( ).setValue( "Volume" );//$NON-NLS-1$		yAxisPrimary.getMajorGrid( ).getLineAttributes( ).setStyle(				LineStyle.DOTTED_LITERAL );		yAxisPrimary.getMajorGrid( ).getLineAttributes( ).setVisible( true );		yAxisPrimary.getMajorGrid( ).getLineAttributes( ).setColor(				ColorDefinitionImpl.GREY( ) );		SampleData sd = DataFactory.eINSTANCE.createSampleData( );		BaseSampleData sdBase = DataFactory.eINSTANCE.createBaseSampleData( );		sdBase.setDataSetRepresentation( "01/25/2005" );//$NON-NLS-1$		sd.getBaseSampleData( ).add( sdBase );		OrthogonalSampleData sdOrthogonal = DataFactory.eINSTANCE				.createOrthogonalSampleData( );		sdOrthogonal.setDataSetRepresentation( "5" );//$NON-NLS-1$		sdOrthogonal.setSeriesDefinitionIndex( 0 );		sd.getOrthogonalSampleData( ).add( sdOrthogonal );		cwaBar.setSampleData( sd );		Series seCategory = SeriesImpl.create( );		Query query = QueryImpl.create( "row[\"Date\"]" );//$NON-NLS-1$		seCategory.getDataDefinition( ).add( query );		SeriesDefinition sdX = SeriesDefinitionImpl.create( );		sdX.getSeries( ).add( seCategory );		xAxisPrimary.getSeriesDefinitions( ).add( sdX );		BarSeries bs = (BarSeries) BarSeriesImpl.create( );		Query query2 = QueryImpl.create( "row[\"Volume\"]" );//$NON-NLS-1$		bs.getDataDefinition( ).add( query2 );		SeriesDefinition sdY = SeriesDefinitionImpl.create( );		sdY.getSeriesPalette( ).update(				ColorDefinitionImpl.create( 168, 225, 253 ) );		sdY.getSeries( ).add( bs );		yAxisPrimary.getSeriesDefinitions( ).add( sdY );		DataPointComponent dpc = DataPointComponentImpl.create(				DataPointComponentType.ORTHOGONAL_VALUE_LITERAL,				JavaNumberFormatSpecifierImpl.create( "###,###" ) );//$NON-NLS-1$		bs.getDataPoint( ).getComponents( ).clear( );		bs.getDataPoint( ).getComponents( ).add( dpc );		bs.getLabel( ).setVisible( true );		ChartReportItemImpl crii;		try		{			// Add ChartReportItemImpl to ExtendedItemHandle			crii = (ChartReportItemImpl) eih.getReportItem( );			// Add chart instance to ChartReportItemImpl			crii.setProperty( "chart.instance", cwaBar );//$NON-NLS-1$		}		catch ( ExtendedElementException e )		{			e.printStackTrace( );		}		return eih;	}