The charting service provides a generator that takes input in the form of an XML document and generates charts for different rendering devices. A simplified description of the service is illustrated below:
The input to the charting service can either be an XML file or an XML document object model (DOM). In this release, the output can either be an image file, SVG file or a chart rendered in an SWT viewer. By understanding the types of inputs and outputs of the component you can gain a better understanding of the APIs that are provided.
A good starting point is to look at the input format for charting. You should become familiar with this schema to determine what chart options and types are available. Once the format is understood, you are ready to construct a chart. The drawing below illustrates how you would use the chart interfaces to construct a chart for a specific output device. Examples of output devices include svg, jpeg, pdf, and swt viewers.
The interfaces illustrated above can be categorized into three functions:
Refer the the javadoc for more information about these interfaces. For demonstration, use case scenarios are provided:
Within the TPTP CVS repository there exists a java sample program that will help the developer understand how to use the charting service APIs. The sample extends the eclipse extension point to provide a view to display a report that contains a table of data, a pie chart and a stack bar chart.. In addition, the view presents the user with a toolbar action to generate a report with two embedded charts. A good starting point is to look at the org.eclipse.tptp.platform.report.chart.sample.ReportSample java file.
The sample is located under the org.eclipse.tptp.platform.report.sample CVS module.
To run this sample extract the code in your eclipse workspace. Then run eclipse in "self-hosting" mode. Select the Window>Show View>Other... menu item. A "Chart Demo View" should show up in the list of views. Select and launch this view.