Eclipse Integration

The Chart FX for Java plugin for Eclipse allows you to visually design the Chart. Similar to the Chart FX for Java Designer, it will generate a configuration file in XML format, called chart template, which can be imported at run time, to produce a Chart with the desired visual attributes.

Requirements and Installation

The Chart FX for Java plugin for Eclipse requires Eclipse 3.1 and WTP 1.0M4 or later. The plugin source, softwarefx.chartfx.designer_1.0.0.jar, is installed as part of Chart FX for Java, and can be found in the Plugins/Eclipse folder in your installation location.

To install the plugin, just copy the softwarefx.chartfx.designer_1.0.0.jar in inside the plugins folder in your Eclipse installation.

Using the Plugin

1 . In order to create a chart template you need to be inside a project. Select File / New / Other or simply press CRTL-N.

2. Select Chart FX for Java / CFX file and click Next.

3. Select the location (project folder) and name of the chart template and click Finish.

4. The chart template will be added to to project and the Designer will show a default chart.

Integrating the chart template to your application

Once the chart template is configured and saved with the desired visual attributes, it may be imported into any pre-populated Chart FX chart to produce the desired look and feel with just one line of code:


chart1.importChart(FileFormat.XML, application.getRealPath("/cfxjava")
+ "/plugin/new_chart.cfx");

Bellow is a complete code to create a chart, import the template and generate the chart image in png format:


<%@page import="SoftwareFX.ChartFX.*"%>
<%
ChartServer chart1 = new ChartServer(application,request,response);
chart1.importChart(FileFormat.XML, application.getRealPath("/cfxjava") +
"plugin/new_chart.cfx"));
%>
<%=chart1.getHtmlTag("450","280","PNG")%>