Graph: ezcGraphDriver
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcGraphDriver
|
Abstract class to be extended for ezcGraph output drivers. [
source]
Descendents
| Child Class |
Description |
| ezcGraphFlashDriver |
Driver to create Flash4 (SWF) files as graph output.
|
| ezcGraphSvgDriver |
Extension of the basic Driver package to utilize the SVGlib.
|
| ezcGraphGdDriver |
Driver using PHPs ext/gd to draw images. The GD extension is available on nearly all PHP installations, but slow and produces slightly incorrect results.
|
Member Variables
|
protected ezcDriverOptions |
$options
Drveroptions |
Method Summary
|
public abstract void |
drawCircle(
$center, $width, $height, $color, [$filled = true] )
Draw circle |
|
public abstract void |
drawCircleSector(
$center, $width, $height, $startAngle, $endAngle, $color, [$filled = true] )
Draws a sector of cirlce |
|
public abstract void |
drawCircularArc(
$center, $width, $height, $size, $startAngle, $endAngle, $color, [$filled = true] )
Draws a circular arc |
|
public abstract void |
drawImage(
$file, $position, $width, $height )
Draw an image |
|
public abstract void |
drawLine(
$start, $end, $color, [$thickness = 1] )
Draws a line |
|
public abstract void |
drawPolygon(
$points, $color, [$filled = true], [$thickness = 1] )
Draws a single polygon. |
|
public abstract void |
drawTextBox(
$string, $position, $width, $height, $align )
Writes text in a box of desired size |
|
public abstract string |
getMimeType(
)
Return mime type for current image format |
|
protected abstract ezcGraphBoundings |
getTextBoundings(
$size, $font, $text )
Returns boundings of text depending on the available font extension |
|
public abstract void |
render(
$file )
Finally save image |
|
public void |
renderToOutput(
)
Render image directly to output |
|
protected mixed |
testFitStringInTextBox(
$string, $position, $width, $height, $size )
Test if string fits in a box with given font size |
Methods
drawCircle
Draw circle
Parameters
| Name |
Type |
Description |
$center |
ezcGraphCoordinate |
Center of ellipse |
$width |
mixed |
Width of ellipse |
$height |
mixed |
height of ellipse |
$color |
ezcGraphColor |
Color |
$filled |
mixed |
Filled |
Redefined in descendants as
drawCircleSector
void drawCircleSector(
ezcGraphCoordinate
$center, mixed
$width, mixed
$height, mixed
$startAngle, mixed
$endAngle,
ezcGraphColor
$color, [mixed
$filled = true] )
Draws a sector of cirlce
Parameters
| Name |
Type |
Description |
$center |
ezcGraphCoordinate |
Center of circle |
$width |
mixed |
Width |
$height |
mixed |
Height |
$startAngle |
mixed |
Start angle of circle sector |
$endAngle |
mixed |
End angle of circle sector |
$color |
ezcGraphColor |
Color |
$filled |
mixed |
Filled |
Redefined in descendants as
drawCircularArc
void drawCircularArc(
ezcGraphCoordinate
$center, integer
$width, integer
$height, integer
$size, float
$startAngle, float
$endAngle,
ezcGraphColor
$color, [
$filled = true] )
Draws a circular arc
Parameters
| Name |
Type |
Description |
$center |
ezcGraphCoordinate |
Center of ellipse |
$width |
integer |
Width of ellipse |
$height |
integer |
Height of ellipse |
$size |
integer |
Height of border |
$startAngle |
float |
Starting angle of circle sector |
$endAngle |
float |
Ending angle of circle sector |
$color |
ezcGraphColor |
Color of Border |
$filled |
|
|
Redefined in descendants as
drawImage
Draw an image
Parameters
| Name |
Type |
Description |
$file |
mixed |
Image file |
$position |
ezcGraphCoordinate |
Top left position |
$width |
mixed |
Width of image in destination image |
$height |
mixed |
Height of image in destination image |
Redefined in descendants as
drawLine
Draws a line
Parameters
Redefined in descendants as
drawPolygon
void drawPolygon(
$points,
ezcGraphColor
$color, [mixed
$filled = true], [float
$thickness = 1] )
Draws a single polygon.
Parameters
| Name |
Type |
Description |
$points |
array |
Point array |
$color |
ezcGraphColor |
Polygon color |
$filled |
mixed |
Filled |
$thickness |
float |
Line thickness |
Redefined in descendants as
drawTextBox
void drawTextBox(
string
$string,
ezcGraphCoordinate
$position, float
$width, float
$height, int
$align )
Writes text in a box of desired size
Parameters
| Name |
Type |
Description |
$string |
string |
Text |
$position |
ezcGraphCoordinate |
Top left position |
$width |
float |
Width of text box |
$height |
float |
Height of text box |
$align |
int |
Alignement of text |
Redefined in descendants as
getMimeType
string getMimeType(
)
Return mime type for current image format
Redefined in descendants as
getTextBoundings
Returns boundings of text depending on the available font extension
Parameters
Redefined in descendants as
render
void render(
string
$file )
Finally save image
Parameters
| Name |
Type |
Description |
$file |
string |
Destination filename |
Redefined in descendants as
renderToOutput
void renderToOutput(
)
Render image directly to output
The method renders the image directly to the standard output. You normally do not want to use this function, because it makes it harder to proper cache the generated graphs.
Redefined in descendants as
testFitStringInTextBox
mixed testFitStringInTextBox(
string
$string,
ezcGraphCoordinate
$position, float
$width, float
$height, int
$size )
Test if string fits in a box with given font size
This method splits the text up into tokens and tries to wrap the text in an optimal way to fit in the Box defined by width and height.
If the text fits into the box an array with lines is returned, which can be used to render the text later: array( // Lines array( 'word', 'word', .. ), ) Otherwise the function will return false.
Parameters
| Name |
Type |
Description |
$string |
string |
Text |
$position |
ezcGraphCoordinate |
Topleft position of the text box |
$width |
float |
Width of textbox |
$height |
float |
Height of textbox |
$size |
int |
Fontsize |
Last updated: Thu, 01 Nov 2007