and
here is the HTML code for the applet ( note that 'mayscript'
has been added to the APPLET tag ),
<APPLET
CODE="PiechartApplet.class" WIDTH="420"
HEIGHT="420" ARCHIVE="Piechart.jar"
MAYSCRIPT>
<!--
Start Up Parameters -->
<PARAM NAME="LOADINGMESSAGE" VALUE="Pie
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="piepropsjs.txt">
<PARAM NAME="chartdata" VALUE="piedatajs.txt">
</APPLET>
The
configuration parameters are taken from the text file
piepropsjs.txt ( click here to
view )
and the graph data is read from the text file piedatajs.txt
( click here to view )
If
you "right click" and view source of this page
you will see that we have the following javascript function
within the page which is able to act upon the three tables,
"c1", "c2" and "c3".
<SCRIPT
LANGUAGE="JavaScript">
var
table='c1';
function combo(table) {
if (table=='c1') {
if (document.all.c1.style.visibility=="hidden")
{
document.all.c1.style.visibility="visible";
}
else {document.all.c1.style.visibility="hidden";}
}
if (table=='c2') {
if (document.all.c2.style.visibility=="hidden")
{
document.all.c2.style.visibility="visible";
}
else {document.all.c2.style.visibility="hidden";}
}
if (table=='c3') {
if (document.all.c3.style.visibility=="hidden")
{
document.all.c3.style.visibility="visible";
}
else {document.all.c3.style.visibility="hidden";}
}
}
</script>
In
the piedatajs.txt ( click here
to view ) file you will see that each of our data
elements has the word "javascript" entered in
the target field and the javascript function name with
the relevant value entered in the URL field.