This feature allows you to create your own custom PHP Data Script function. The function will be included at
run time and used by the graph to acquire the data.
This method provides enormous flexibility for the data acquisition process. In addition any SESSION data (such
as a user ID) that exists will also be available to this data script.
A custom data script is specified via the parameter "datascript". For example if your data
script is in a file datascript.php which resides in the same directory as the graph function then your <IMG>
tag would be:-
<img src="area-graph.php?datascript=datascript.php"
width=500 height=500> |
The data script must be valid PHP code and should contain at least the following function:-
function
datascript() {
return
$lines;
}
|
where $lines is a string array containing the data parameters and values.
The contents of the string array should be the format:-
dataNseriesM: [value]
where N represents the position of the data item in the series and M
represents the series number.
For example, for 3 series of data each containing 6 points the string array contain:-
data1series1: 30
data2series1: 20
data3series1: -10
data4series1: 40
data5series1: 50
data6series1: 60
data4series2: 40
data5series2: 50
data6series2: 60
data1series3: 100
data2series3: 50
data3series3: -25
data4series3: 75
data5series3: 125
data6series3: 150 |
Note: The data script should under no circumstances write out any
information via the print or echo functions. This
would cause the production of the graph image to fail.
For an example datascript.php and further guidance on how to use this method please see the
Tutorial section »
«back to top
|