Image_Canvas_GD &Image_Canvas_GD(
array
$param)
|
|
Create the GD canvas.
Parameters available:
'width' The width of the graph on the canvas
'height' The height of the graph on the canvas
'left' The left offset of the graph on the canvas
'top' The top offset of the graph on the canvas
'antialias' = 'native' enables native GD antialiasing - this method has no severe impact on performance (approx +5%). Requires PHP 4.3.2 (with bundled GD2)
'antialias' = {true|'driver'} Image_Graph implemented method. This method has a severe impact on performance, drawing an antialiased line this way is about XX times slower, with an overall performance impact of about +40%. The justification for this method is that if native support is not available this can be used, it is also a future feature that this method for antialiasing will support line styles.
Use antialiased for best results with a line/area chart having just a few datapoints. Native antialiasing does not provide a good appearance with short lines, as for example with smoothed charts. Antialiasing does not (currently) work with linestyles, neither native nor driver method!
'noalpha' = true If alpha blending is to be disabled
'filename' An image to open, on which the graph is created on
'gd' A GD resource to add the image to, use this option to continue working on an already existing GD resource. Make sure this is passed 'by- reference' (using &)
'usemap' Initialize an image map
'gd' and 'filename' are mutually exclusive with 'gd' as preference
'width' and 'height' are required unless 'filename' or 'gd' are specified, in which case the width and height are taken as the actual image width/height. If the latter is the case and 'left' and/or 'top' was also specified, the actual 'width'/'height' are altered so that the graph fits inside the canvas (i.e 'height' = actual height - top, etc.)
Parameters:
void setFont(
$fontOptions, array
$font)
|
|
Sets the font options.
The $font array may have the following entries:
'ttf' = the .ttf file (either the basename, filename or full path) If 'ttf' is specified, then the following can be specified
'size' = size in pixels
'angle' = the angle with which to write the text
Overrides
Image_Canvas::setFont() (Sets the font options.)
Parameters:
int textHeight(
string
$text, [bool
$force = false])
|
|
Get the height of a text.
Note! This method can give some peculiar results, since ImageTTFBBox() returns the total bounding box of a text, where ImageTTF() writes the text on the baseline of the text, that is 'g', 'p', 'q' and other letters that dig under the baseline will appear to have a larger height than they actually do. Have a look at the tests/text.php test case - the first two columns, 'left and 'center', both look alright, whereas the last column, 'right', appear with a larger space between the first text and the second. This is because the total height is actually smaller by exactly the number of pixels that the 'g' digs under the baseline. Remove the 'g' from the text and they appear correct.
Overrides
Image_Canvas::textHeight() (Get the height of a text,)
Parameters:
Get a canvas specific HTML tag.
This method implicitly saves the canvas to the filename in the filesystem path specified and parses it as URL specified by URL path
Parameter array: 'filename': string 'filepath': string Path to the file on the file system. Remember the final slash 'urlpath': string Path to the file available through an URL. Remember the final slash 'alt': Alternative text on image
Overrides
Image_Canvas::toHtml() (Get a canvas specific HTML tag.)
Parameters: