12.3. Deploying without EspressManager

This section deals with deploying components that work independent of EspressChart. To learn more about the interaction, please refer to the Interaction with EspressManager section under the EspressChart API Overview chapter.

Generating charts independently of EspressManager results in a slightly better performance as the interaction of EspressManager and the chart or chart component is removed.

An important consideration is that any references to a data source or to a chart source, that is relative (i.e. for example help\examples\data\sample.dat) are relative to the working directory from where the JSP, JNLP file or the class file (in an application) is being executed. In a servlet/jsp environment, the working directory typically differs from the directory where the class resides. To find out the working directory, have the following line of code in your servlet/jsp:

System.out.println("The working directory is " + System.getProperty("user.dir") + ". ");

By having the above line of code and executing the servlet/jsp, the working directory is ascertained and the data files and chart templates can be moved to locations relative to the working directory, as dictated by the code.

12.3.1. Chart Viewer

To deploy Chart Viewer, EspressViewer.jar must be included in the HTML file as the archive. Depending on what functionality you are using, you have to include additional jars as necessary.

Chart Viewer can be used independently of EspressManager with the addition of one more parameter in the applet code:

<param name="EspressManagerUsed" value="false">

Note that any relative references to the chart location and/or data are relative to the directory where the HTML file is located. For example, if the data source specified in the .rpt file is help\examples\data\sample.dat and if the HTML file is located in D:\EspressChart\TestApplet, then for the chart to be displayed successfully, help\examples\data\sample.dat must exist within D:\EspressChart\TestApplet (i.e., D:\EspressChart\TestApplet\help\examples\data\sample.dat must exist).

12.3.2. Chart API

To deploy Chart API, EspressAPI.jar and ExportLib.jar must be in the CLASSPATH (for application and servlet/jsp environment) or included in the JSP or JNLP file.

Chart API can also be used without connecting to EspressManager by adding the line of code below:

QbChart.setEspressManagerUsed(false);

This method must be called prior to any QbChart instantiation.

As with Chart Viewer, any relative references to the chart location and/or data are relative to the working directory from where class file is being executed. For example, if the data source specified is help\examples\data\sample.dat and if the class file is located in D:\EspressChart\TestApplication, then for the chart to be displayed successfully, help\examples\data\sample.dat must exist within D:\EspressChart\TestApplication (i.e., D:\EspressChart\TestApplicationhelp\examples\data\sample.dat must exist).