The Applet form of the Graph has several methods exposed
which enable the properties and data of the graph to
be updated dynamically from other page objects.
So that the Graph may be referenced from other page
objects it must first be named. This is done by adding
the 'name' parameter to the <applet> tag. i.e,
<applet
name="GRAPH"
code="LineGraphApplet.class"
archive="Linegraph.jar" width="500"
height="420" mayscript>
The methods are,
Restart
Set a Data Value
Reload Data
Set a Parameter
Restart
restart()
This method will restart the line graph. The
data and property files will be re-read the graph
re-created.
This method would be useful where it is necessary
to refresh the graph display without reloading
the entire HTML page.
e.g. to add a button to your web page which will
force the graph to refresh:-
<input
type="button" value="Refresh"
onclick="document.applets['GRAPH'].restart();">
^back to top
|
Set a Data Value
set_datavalue(int
datanum, int series, String value, boolean re_paint)
This method enables any of the graph data values
to be changed.
datanum - this specifies the bar number
within the series to be changed.
series - this specifies which series
is to be changed.
value - the value to which this data
item should be set.
re-paint - specifies whether the graph
should be re-drawn once the data value is set.
Value can be either "true" or "false"
e.g. to add a button to your web page which will
update the second data value of series 1,
<input
type="button" value="Update Data
Item" onclick="document.applets['GRAPH'].set_datavalue(2,1,"52.4",
true);">
^back to top
|
Reload Data
reload_data(String
value, boolean re_paint)
This method enables all the graph data to be
reloaded from a file or server side process. This
method is particularly useful where you wish the
chart data to be refreshed either by a user action
or time interval.
value - the URL specifyig the location
of the data file or server side process supplying
the data
re-paint - specifies whether the graph
should be re-drawn once the data is loaded.
Values may be either "true" or "false".
^back to top
|
Set a Parameter (graph property)
set_parameter(String
parmname, String value, boolean re_paint)
This method enables any of the Graph Parameters
to be modified dynamically during runtime.
parmname - this is the property name
as defined in the Parameters
section.
value - the value which this property
should be set.
re-paint - specifies whether the graph
should be re-drawn once the parameter is set.
Value can be either "true" or "false"
e.g. to add a button to your web page which will
turn the 3D effect off,
<input
type="button" value="3D Off"
onclick="document.applets['GRAPH'].set_param('3D',
'false', true);">
^back to top
|
|