Understanding the BIRT APIs : About the BIRT Chart Engine API : Using the BIRT Chart Engine API
 
Using the BIRT Chart Engine API
Although there are over 500 classes and interfaces in the BIRT Chart Engine API, most functionality for creating or modifying a chart is concentrated in a small subset of classes and interfaces. The primary interface in the BIRT Chart Engine API is the Chart interface. An object of the Chart type is called the chart instance object. The Chart interface has two subinterfaces, ChartWithAxes and ChartWithoutAxes. DialChart is a third interface that inherits from ChartWithoutAxes. ChartWithoutAxes defines a pie chart and DialChart defines a meter chart. ChartWithAxes defines all other chart types.
To create a chart instance object, call create( ) in ChartWithAxesImpl, ChartWithoutAxesImpl, or DialChartImp, as in the following statement:
ChartWithAxes myChart = ChartWithAxesImpl.create( );
To set the basic properties of a chart, such as its orientation and dimensionality, use setter methods of the Chart interface, such as:
myChart.setOrientation( Orientation.VERTICAL_LITERAL );
myChart.setDimension( ChartDimension.THREE_DIMENSIONAL );
Set more complex properties of a chart, like characteristics of the chart’s axes and series by getting an instance of the object to modify and then setting its properties. For example, to set an x-axis caption, use the following code:
Axis xAxis = myChart.getPrimaryBaseAxes( )[0];
xAxis.getTitle( ).getCaption( ).setValue( "Months" );
Although charts are often identified by type, such as a pie chart or a line chart, a chart with multiple series of differing types cannot be classified as one type. A series has a specific type. Use the BIRT Chart Engine API to create a specific type of series by using the create( ) method of one of the SeriesImpl subclasses. For example, the following code creates a bar series:
BarSeries barSeries1 = ( BarSeries ) BarSeriesImpl.create( );