Advanced
Stacked Vertical Bar Graph, version 3.2
by Sirius Computer Consultants Limited
Applet
Example 5
The
applet is setup here to read both the configuration data
and the graph data from a server side processes, in this
case a Java Servlets running on our web server.
and
here is the HTML code,
<applet
code="SVbarchartApplet.class" archive="SVbargraph.jar"
width="500" height="420">
<!--
Start Up Parameters -->
<PARAM name="LOADINGMESSAGE" value="Column
Chart Loading - Please Wait.">
<PARAM name="STEXTCOLOR" value="0,0,100">
<!-- Message Text Color-->
<PARAM name="STARTUPCOLOR" value="255,255,255">
<!-- Applet Background color -->
<!--
Data files -->
<PARAM name="chartproperties" value="http://www.jpowered.com/siriusjava/servlet/svConfigServlet">
<PARAM name="chartdata" value="http://www.jpowered.com/siriusjava/servlet/DataServlet">
</applet>
The DataServlet
( click here
to view code ) is a simple servlet designed to demonstrate
how a servlet can be used to return data to either the graphing
applet or servlet. As you will see the main routine ( doGet()
) uses the method GraphData() to construct the return data.
Although in this example the GraphData() routine simply builds
the return data from 'hard coded' values, in practice this
routine would be expanded to first gather data from any number
of datasources. eg. databases, files other server processes.
The
ConfigServlet ( click
here to view code ) again is just a simple servlet to
demonstrate the method. The routine ConfigData() is used
to construct the return data from 'hard coded' values. Again,
in practice this method would be expanded to derive data
from a number of datasources.