graph demo

Graph Documentation - Dynamic Methods

graph demo[ Home ] [ Products ] [ Downloads ] [ Purchase ]
[ Support ] [ About Us ]

Dynamic Methods

Overview
The Applet form of the graphing components expose certain methods which allow properties and data to be modified by other page components eg. JavaScript functions.
The following table shows which methods are available in each graphing function:-
(see below for details of each method)
Graph StyleMethods
Line GraphRestart
Set a Data Value
Reload Data
Set a Parameter
Pie ChartSet a Data Value
Reload Data
Set a Parameter
Size Reset
Vertical Bar GraphSet a Data Value
Reload Data
Set a Parameter
Stacked Vertical BarSet a Data Value
Reload Data
Set a Parameter
Horizontal Bar GraphSet a Data Value
Reload Data
Set a Parameter
Stacked Horizontal BarSet a Data Value
Reload Data
Set a Parameter
Area GraphNone Available

Restart

restart()

This method will restart the 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();">

NOTE: The graph applet must be named. In this example this is done by adding NAME="GRAPH" to the applet tag:-

<APPLET NAME="GRAPH" ........

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);">


NOTE: The graph applet must be named. In this example this is done by adding NAME="GRAPH" to the applet tag:-

<APPLET NAME="GRAPH" ........

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 specifying 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".

<input type="button" value="Reload Data"
onclick="document.applets['GRAPH'].reload_data("http://www.domain,com/chartdata.php", true);">


NOTE: The graph applet must be named. In this example this is done by adding NAME="GRAPH" to the applet tag:-

<APPLET NAME="GRAPH" ........

Set a Parameter

set_parameter(String parmname, String value, boolean re_paint)

This method enables any Graph Parameter 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);">


NOTE: The graph applet must be named. In this example this is done by adding NAME="GRAPH" to the applet tag:-

<APPLET NAME="GRAPH" ........

Size Reset

size_reset(int width, int height, boolean repaint)

This method enables the display area (size) of the chart to changed.

width - specifies the new width in pixels
height - specifies the new height in pixels
repaint - specifies whether the graph should be redrawn once the size is changed. Value can be either "true" or "false"

e.g. to add a button to your web page which will change the size to 200x200 pixels,

<input type="button" value="Set Size" onclick="document.applets['GRAPH'].size_reset(200, 200, true);">

NOTE: The graph applet must be named. In this example this is done by adding NAME="GRAPH" to the applet tag:-

<APPLET NAME="GRAPH" ........

Custom Solutions
If would like us to perform the set-up process, create custom built data scripts or help with any other part of your web application then we are pleased to offer you the following services:-
Set-Up, Installation and Configuration Service
Web Site Components Development Service
Web Application Development Service
Custom Software Development
JavaScript CSS Image Gallery