Table of Contents
The initial obstacle that must be negotiated is to get hold of the data to be displayed since the library itself is completely agnostic to where the data comes from. The library will use data supplied in one or more arrays and it is up to the user of the library to get hold of the data to populate these arrays with proper data. In principle the data can come from one of the following places
Hard-coded data in the script. This is the least flexible and can only really be recommended for examples and really static data.
Data stored in plain text files.
Data stored in binary format in flat files.
Data stored in a database
Data sent to the script via URI parameter passing (either GET or POST HTTP constructs can be used).
In the following sections we will shortly discuss each of these methods.
The library assumes that the data available in an array that starts with index 0
This is the simplest way and consists of only specifying the data in one or several usual PHP arrays directly in the graph script. For example to specify data for a Pieplot one could use the following constructions
$data = array(1,8,5,4,12,18); $pieplot = new PiePlot ($data);
This is the method used for all examples under the "