JetChart is comprised of several classes that can be compiled together and jarred into a single jar file
or split into differents groups according to the type of charts these distinct sets of classes generate,
resulting in smaller and independent jar files. For example, the classes used to generate pie charts
can be packed into a file named PieChart.jar, whereas the classes used to generate scatter charts can
be packed into a separate file named ScatterChart.jar.
These two jar files are completely independent one from the other. However, some of these distinct
classes have common ancestors, what makes necessary to include the superclasses they are inherited from
in their jar files to avoid dependence between them.
The instructions below outline the steps to generate one single jar file or those ones that come
with the JetChart package.
Generating a single jar file
JetChart Java files can be found in the folder JetChart/source/jetchart. From within the JetChart/source
folder execute the following command:
javac -d . jetchart/core/*.java jetchart/xy/*.java jetchart/encoders/*.java jetchart/graph/*.java
jetchart/scatter/*.java jetchart/pie/*.java
or
javac -d . jetchart\core\*.java jetchart\xy\*.java jetchart\encoders\*.java jetchart\graph\*.java
jetchart\scatter\*.java jetchart\pie\*.java, in a Windows operating system.
A directory structure corresponding to the JetChart package(com.jinsight.jetchart) and the SVG encoder
package(com.jinsight.svg) is created under the JetChart/source folder. The last step is to compress the
entire structure into a jar file, as below:
jar -cf JetChart.jar com
Generating multiple jar files
Classes belonging to different groups were copied into separate folders to facilitate the process of generating
smaller and independent jar files. The directory structure we suggest is the following, based on the
characteristic of each group of classes:
The diagram below shows the dependence between classes living in different folders, with respect
to the generation of multiple jar files.
JetChart comes with the jar files GraphChart.jar, PieChart.jar, ScatterChart.jar and Encoders.jar,
as well as Swing versions of these files. They can be found in the directory JetChart/lib. The AWT versions are located
at JetChart/lib/AWT, and the Swing versions at JetChart/lib/Swing.
JetChart classes were compiled and obfuscated
before being jarred. The obfuscation process reduces the classes sizes significantly, therefore the sizes of the pre-built
jar files are smaller than those created following the steps below.
The file GraphChart.jar is made up of the classes located at the folders
jetchart/core, jetchart/xy and jetchart/graph. It is used to generate line charts,
bar charts, stacked bar charts, area charts, point charts, image charts and financial charts, as well
as any combination of these charts. Here are the steps to generate GraphChart.jar:
The file PieChart.jar is made up of the classes located at the folders
jetchart/core, and jetchart/pie. It is used to generate pie charts. Here are the steps
to generate PieChart.jar:
The file ScatterChart.jar is made up of the classes located at the folders
jetchart/core, jetchart/xy and jetchart/scatter. It is used to generate xy charts,
xy line charts, xy image charts and bubble charts, as well as combinations of any of these charts. Here
are the steps to generate ScatterChart.jar:
The file Encoders.jar is made up of the classes located at the folders
jetchart/core and jetchart/encoders. It is used to generate JPEG, GIF, PNG and
SVG images of any of the charts generated by JetChart. Here are the steps
to generate Encoders.jar:
GraphApplet - Generates line charts, bar charts, stacked bars charts, area charts,
point charts, image charts and OHLC charts, as well as combinations of any of these charts. It requires
GraphChart.jar to be included in the archive attribute of the applet tag.
PieApplet - Generates pie charts. It requires PieChart.jar to be included
in the archive attribute of the applet tag.
ScatterApplet - Generates xy charts, xy line charts, xy image charts and bubble
charts, as well as combinations of any of these charts. It requires ScatterChart.jar to be included
in the archive attribute of the applet tag.
The source codes of the applets above can be found in the folder JetChart/source/applets.
Unlike the class library, the applets source codes are delivered to all registered users.
JetChart is fully compatible with JVMs prior to Java 1.2, no Java plugin is required to run the applets.
Generating Swing compatible jar files
The jar files generated as described above are only AWT compatible, it is necessary to change
the source code of some classes to turn them into Swing compatible files. The classes Graph,
PieGraph and ScatterGraph are subclasses of java.awt.Panel, which is a heavyweight component.
The hierarchical structure ascending above these classes and reaching java.awt.Panel is the
following: