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. All PHP Global variables ($_REQUEST, $_GET, $_POST, $_SESSION etc) are available to be used within the data function.
A custom data script is specified via the parameter "datascript". For example if your data script is in a file datascript.php then your <IMG> tag would be:-
The data script must be valid PHP code and should contain at least the following function:-
where $lines is a string array containing the data parameters and values.
The contents of the string array should be the format:-
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 should contain:-
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.
The full function would look like this:-
This is a trivial example but as you can see it is now possible to create a function which will construct the data array based upon any parameter held in $_SESSION or other Global. This method can also be used to pull data from a database.
Further information and examples can found in the Online Tutorials here »