Both
applet and servlet may be set to acquire the configuration
and graph data from a server side process/script.
This is done by simply entering the URL of the server
side process into the parameters of the pie chart.
This method gives the pie chart enormous flexibility
in terms of data acquisition and in the next section
you will see how to use this method to retrieve data
from a database.
Creating
the Server Side Process
The server side process can be created in any language
of your choice and the only criteria is that the output
must follow the format of the data files (see Retrieving
Graph Data from files). To help you create your
own server side scripts we have created some template
scripts in the ServerTemplateScripts directory. We
recommend using these scripts as a starting point
for your own.
Configuring
the Applet to use Server Side Scripts.
To set the applet to acquire data from a server process
simply, add the following parameters to your html,
between the <applet> and </applet> tags.
<PARAM
name="chartproperties" value="[URL
of Server Process]">
<PARAM name="chartdata" value="[URL
of Server Process]"
replacing
[URL of Server Process] with the URL of your
server process.
For example if we have two java servlets (configServlet
and DataServlet) which create the config properties
and supply the graph data at URLs,
http://www.yourdomain.com/servlet/configServlet
http://www.yourdomain.com/servlet/DataServlet
then
the html parameters would be,
<PARAM
name="chartproperties" value="http://www.yourdomain.com/servlet/configServlet">
<PARAM name="chartdata" value="http://www.yourdomain.com/servlet/DataServlet"
For example server scripts (in ASP, PHP, JSP
and Servlet) please see the
Script
Interface section or
click here.
Configuring
the Servlet to use Server Side Scripts.
To
set the servlet to acquire data from a server process,
simply insert the URLs of the server processes into
the <IMG> tag in your html page.
<img
src="[ServletEngineURL]/PiechartServlet?
config=[URLconfigFile]&
data=[URLdataFile]" width="500" height="420">
replacing
[URLconfigfile] and [URLdataFile] with
the URLs of your server processes. For example if
we have two java servlets (configServlet and DataServlet)
which create the config properties and supply the
graph data at URLs,
http://www.yourdomain.com/servlet/configServlet
http://www.yourdomain.com/servlet/DataServlet
then
the html <IMG> tag would be,
<img
src="http://www.yourdomain.com/servlet/PiechartServlet?
config=http://www.yourdomain.com/servlet/configServlet&
data=http://www.yourdomain.com/servlet/DataServlet"
width="500" height="300">
For example server scripts (in ASP, PHP, JSP
and Servlet) please see the
Script
Interface section or
click here.
The
Graphing Software provides several methods by which
data can be acquired from databases. For a full discussion
on the various methods and Template Scripts please
see the Tutorial
Section.
|