This method is ideal where the chart data is fairly
static.
With this method chart data may be updated without editing
the HTML page.
This method is also useful where both Applet and Servlet
forms of the graph are implemented and it is required
that identical chart images are presented in either
case.
e.g. where both interactive and printing ability must
be presented to the user, See Documentation - Graph
Printing.
This method may be applied to both Applet & Servlet
forms of the graph.
Method Outline
This method involves incorporating the graphing applet
(or Servlet) into your web page and supplying the
data via a seperate plain text file.
Every visitor will see an identical graph whenever
they visit the page.
Implementation
This method involves the following 4 steps,
- Add
the applet (or Servlet) html code to your web
page
-
Set up the Configuration data
-
Set up the Pie Chart data
-
Upload the jar file to your web server
Step
1 - Add the applet html code to your web page
In your web page place the following code, where you
wish the pie chart to appear,
<applet
code="PiechartApplet.class" archive="Piechart.jar"
width="500" height="420">
</applet>
Adjusting
the "width" and "height" element
of this applet tag to specify the size (in pixels)
of the desired graph display.
^^
back to top
Step
2 - Set up the Configuration data.
The applet will read all the configuration parameters
from a specified file. To use this option add the
following PARAM tag to your html code between the
<applet> and </applet> tags,
<PARAM
name="chartproperties" value="pieprops.txt">
where
"pieprops.txt" is the name of the file
containing the configuration data ( click
here for an example file ). As you will see
from the example file each property is specified
on a name, value basis. Note that comments may be
added to this file by placing "<!--"
at the beginning of a line.
Adjust the property values to specify the characteristics
of the pie graph and then place this file in the
same directory as your web page.
For
a full description of each property please see the
"Configuration Options
and Parameters".
^^
back to top
Step
3 - Set up the Pie Chart data
The applet will read all the data from a specified
file. To use this option add the following PARAM tag
to your html code between the <applet> and </applet>
tags,
<PARAM
name="chartdata" value="piedata.txt">
where
"piedata.txt" is the name of the file
containing the data ( click
here for an example file ). As you will see
from the example file each piece of data is specified
on a name, value basis. The first element of each
line represents the data name (specifying the series
and data order) and then the value. (Also note that
comments may be added to this file by placing "<!--"
at the beginning of a line.).
Simply create a similar file, adding your data in
the values. For a full explanation of this file
please see the "Retrieving Data from Files"
under the "Data and Configuration" section
( or click here).
^^
back to top
Step
4 - Upload the jar file to your web server.
The final step is to simply to place the Piechart.jar
file in the same directory as your web page. At only
14kb this jar file contains all the applet code for
producing the graph in your page and as such is very
fast to load and run.
^^ back to top
If
you experience any difficulties implementing then
please do not hesitate to contact us at,
support@jpowered.com