Main class for Graph generation
This class is the starting-point if you want to generate graphs. It handles the various objects involved (e.g. axes, title, list of data-elements). It also provides the basic functions to add data-elements (using addData()), for automatic determination of min/max values for the axes, for data-handling and for the final generation of the graph. An instance of Image_Graph is the root for a tree of class-instances that will store data and settings, will provide methods for customizing the appearance of your graph and will finally create the output (graph on a canvas).
Located in /Graph.php (line 100)
X-axis of diagram
first Y-axis of diagram
second Y-axis of diagram
Title of diagram
Constructor for the class
Add new data to the graph
This function generate an instance of the given data representation-type (e.g. it will generate an instance of Image_Graph_Data_Line if you supply "line" for $representation). The new object will automatically be added to an internal list of data-objects. A reference to the object which was added to the graph will also be returned by this function. Using that reference you can e.g. call functions like setColor(), or whatever the specific data-element might support, to customize the data-element. You can use the array $attributes to supply attribute-data to the data-element upon creation. This might be quite handy if you add several data and don't want to call e.g. setColor() on each one separately. But this is up to you ... If no "color" is specified in the attributes-array, the "dataDefaultColor" will be used, which can be set using setDataDefaultColor().
Create a GD-image-resource for the graph
This function will return a truecolor GD-resource. The GD-resource will have the size you supplied when creating the Image_Graph-instance. If you need a palette GD-resource (e.g. for writing of GIF-images) please be sure to downsample the truecolor GD-resource returned by this function yourself. A truecolor-resource is needed for all alpha-channel-features etc. to receive best possible image-quality. It's possible to optionally give this function an already existing gd-resource. It will then be used for drawing. Please note that (at the moment) no solid standard background-fill will be done.
Set color of axes
This function allows you to set the color of all axis (axisX, axisY0 and axisY1) all to the same value. It does the same as setting the color for each of those axes manually. It was added solely for convenience since often you will need to give all axes the same new color.
Sets background color of canvas
Set default color for new data; used by addData()
You can set a new dataDefaultColor using this function. It will be used for all *following* calls to addData if you don't explicitly supply a color.
Set default options for fonts
These options are directly given to the class Image_Text which handles text-output. For a full list of necessary/available font-options please refer to the Image_Text-docs and/or have a look at the examples shipped with the Image_Graph-package. !! Note that the option "font_type" defaults to "ttf" (TrueType-fonts) at the moment. As soon as PHP-internal (bitmap) fonts are also supported by Image_Text this will default to those internal fonts instead. !!
Sets space of graph from each border (of the whole image)
Set option that data should be stacked
Use this function to turn on data-stacking. If $stackWhat is supplied only specific data-types will be stacked. Please note that possibly not all data-types might support stacking, in which case they will simply be left unstacked. But the base-types "bar" and "line" do support it! If you use both Y-axes then only data on the same axis can be stacked (sure!). So if you have e.g. line-data on both axes they will be stacked independently.
Documentation generated on Sat, 21 Feb 2004 23:28:05 +0100 by phpDocumentor 1.3.0RC2