JClass Chart Overview

Introduction · Feature Overview · Setting CLASSPATH

Using the Java Programming Language · Compiling a Program

Distributing JClass Chart Applications


Introduction

JClass Chart is a charting/graphing component written entirely in Java. JClass Chart is based on the award winning XRT/graph and Olectra Chart products from KL Group. However, JClass Chart is not a simple "port" of those products. JClass Chart has been designed from the ground up to take advantage of object-oriented techniques, but not at the expense of usability or efficiency.

JClass Chart offers users a choice of interaction techniques that simply aren't available in other components. In all, there are four different ways of interacting with JClass Chart:

JClass Chart is available as either a JDK 1.0.2 Transitional Bean or a JDK 1.1 Java Bean. The API and event handling is identical for both versions, eliminating the need to re-code your Java programs.


Feature Overview

JClass Chart is remarkably flexible. Shown below are just some of the unique things that can be done with JClass Chart:

The chart types supported by this release of JClass Chart are shown below:

Chart Types Supported by JClass Chart
Chart TypeDescription
Plot Linear graph of data as connected points.
Scatter Plot Same as Plot, but the data points are not connected by lines.
Bar Each data set value at each point is plotted as a bar of a particular color. If the 3D property is set, the bars are rendered to give them a 3D appearance, and the chart can be rotated.
Stacking Bar Similar to a bar chart, only the data set bars are stacked on top of each other.
Pie A total is determined for each point across data sets, and each data set is shown as a slice of a pie expressing its percentage of the "total". An "other" slice is used to show data sets that are too small to appear. As with bar charts, pie charts can take on a 3D appearance.

Each of these chart types can be controlled and modified in a number of ways. Each data series has a chart "style" associated with it that controls the appearance of the data series, including the fill color for bar charts, the point style for plot charts, and so on. Bar, stacking bar and pie charts all have three-dimensional attributes that can be used to give depth and perspective to the chart.

JClass Chart supports external data sources. This means that an existing data object can be attached to JClass Chart. The data object can be loosely-coupled or tightly-coupled to JClass Chart. In the loosely-coupled case, the data is retrieved from the data source when the data source is attached. If desired, the chart can update the data source when values are changed. In the tightly-coupled case, the data source can inform chart when data has changed.


Setting CLASSPATH

Note: If you are using the MS-Windows version of JClass Chart that is self-installing, your CLASSPATH statement is automatically set up during the installation process.

The jcchart[xxx]-classes.zip file can be located anywhere on a user's computer or on a Local Area Network (LAN), but you must indicate to the Java interpreter where it can find the Java classes it contains. This is done by setting the CLASSPATH environment variable. The CLASSPATH environment variable consists of the names of directories containing compiled Java classes. The following examples will help you set CLASSPATH properly on your system.

If you are using JClass Chart in a development environment, do not unarchive the contents of the jcchart[xxx]-classes.zip file--its contents are automatically read by Java.

If your CLASSPATH environment variable is not set up correctly, see your system administrator or the "Update environment variables" section specific to your computing platform. This information can be found through the Java Developers Kit Web page at http://www.javasoft.com/products/jdk/.

Before attempting to use JClass Chart, you must be able to compile Java applications or applets. Make sure you can compile and run simple Java applications or applets before you begin to use JClass JClass Chart. Consult the Java JDK documentation for assistance in determining the location of the Java compiler (javac) and the Java class files.

The following are descriptions for configuring CLASSPATH for specific operating systems:

Windows 95

Add a line to your AUTOEXEC.BAT file that points to the directory where jcchart[xxx]-classes.zip is installed. If jcchart[xxx]-classes.zip is installed in a directory called \foo, you would add something similar to the following to your AUTOEXEC.BAT file:
	set CLASSPATH={references to other 
	programs};C:\foo\jcchart[xxx]-classes.zip 

Windows NT (3.51 and higher)

Assuming that jcchart[xxx]-classes.zip is installed in a directory called \foo, add the CLASSPATH statement to a Windows NT system by doing the following:
  1. Double click Control Panel. The Control Panel window opens.
  2. If you are using Windows NT 3.51, Double click System. The System dialog is displayed. If you are using Windows NT 4.0, double click System. The System Properties dialog appears. Click Environment.
  3. Search the User Environment Variables (or User Variables in Windows NT 4.0) list for an existing CLASSPATH statement.

    If a CLASSPATH statement exists, select it. In the Value field, add the following to the existing statement:

    		C:\foo\jcchart[xxx]-classes.zip
    
    If no CLASSPATH statement exists, in the Variable field, type:
    		CLASSPATH
    
    and in the Value field, type:
    		C:\foo\jcchart[xxx]-classes.zip
    
  4. Click OK.

Tip: If you are going to compile Java programs in the same directory that contains Java .class files, add a period to the CLASSPATH statement to point the Java compiler to look for .class files in the current directory, as in the following example:

	C:\foo\jcchart[xxx]-classes.zip;.
This method will work on all computing platforms.

Note to Browser Users: If you set the CLASSPATH for your entire session, the CLASSPATH will be picked up by the Web browser as well.


Using the Java Programming Language

Java is both a compiled and an interpreted language. After writing a Java program using a text editor, save it as a source file with the extension .java. When this source file is run through the Java compiler, it compiles the file into a .class file. Unlike .exe or .com files, these compiled .class files are not directly executable under any operating system, because they do not contain machine-language code that can be understood directly by the microprocessor. Instead, they are compiled into a byte-code format consisting of machine-language instructions designed for a virtual microprocessor. This virtual microprocessor is the Java Virtual Machine, which interprets the byte-code into a machine-language code that can be understood by your systemÆs microprocessor. As long as the Java Virtual Machine software exists for a computing platform, any Java programs you create will be able to run on that platform.

If the Java compiler and class files are installed in the standard places (typically \JDK1.1.1\bin\) can be compiled by entering the following at a prompt:

	javac foo.java


Compiling a Program

Java allows for two distinct program types: stand-alone applications and applets. Stand-alone applications can be run directly on a system containing the Java interpreter program (java), while applets can be inserted and run from Web pages when viewed through a Java-capable browser. JClass components can be used with both types of Java programs. Ensure you can compile and run simple Java applications or applets before you begin to use JClass Chart. Consult the Java JDK documentation for assistance in determining the location of the Java compiler (javac) and the Java .class files.


Distributing JClass Chart Applications

You can freely distribute end-user Java applications or applets you build with JClass Chart components under certain restrictions.

For more information, read the License Agreement at the beginning of this manual for complete details.