common
[ class tree: common ] [ index: common ] [ all elements ]

Class: Image_Graph

Source Location: /Graph.php

Class Overview

Image_Graph_Common
   |
   --Image_Graph_Element
      |
      --Image_Graph

The Graph Object - the 1st (or last) object.


Methods


Inherited Methods

Class: Image_Graph_Element

Image_Graph_Element::height()
The height of the element on the canvas
Image_Graph_Element::setBackground()
Sets the background fill style of the element
Image_Graph_Element::setBackgroundColor()
Sets the background color of the element
Image_Graph_Element::setBorderColor()
Sets the border color of the element
Image_Graph_Element::setBorderStyle()
Sets the border line style of the element
Image_Graph_Element::setFillColor()
Sets the fill color of the element
Image_Graph_Element::setFillStyle()
Sets the fill style of the element
Image_Graph_Element::setFont()
Sets the font of the element
Image_Graph_Element::setLineColor()
Sets the line color of the element
Image_Graph_Element::setLineStyle()
Sets the line style of the element
Image_Graph_Element::setPadding()
Sets padding of the element
Image_Graph_Element::showShadow()
Shows shadow on the element
Image_Graph_Element::width()
The width of the element on the canvas

Class: Image_Graph_Common

Image_Graph_Common::Image_Graph_Common()
Creates an a instance of Image_Graph_Common.
Image_Graph_Common::add()
Adds an element to the objects element list, the new Image_Graph_elements parent is automatically set
Image_Graph_Common::addColor()
Add a color. Ultimately it should call addColor() from the Image_Graph object
Image_Graph_Common::newColor()
Create a new Image_Graph_color.
Image_Graph_Common::setName()
Sets the name

Class Details

[line 54]
The Graph Object - the 1st (or last) object.

This is the main object. The GraPHP class holds the canvas and performs the final output by sending the http headers and making sure the elements are outputted.




[ Top ]


Class Methods


constructor Image_Graph [line 139]

Image_Graph &Image_Graph( int $width, int $height)

GraPHP [Constructor]



Parameters:

int   $width   The width of the graph in pixels
int   $height   The height of the graph in pixels

[ Top ]

method addColor [line 218]

void &addColor( Image_Graph_Color &$color)

Add a color.

This method adds a color to the graph. This causes the GD image to allocate the color if necessary (i.e. using GD1 TrueColor images are not supported). This is not necessary perhaps use {@see Image_Graph::newColor()} or the named color constants.




Overrides Image_Graph_Common::addColor() (Add a color. Ultimately it should call addColor() from the Image_Graph object)

Parameters:

Image_Graph_Color   $color   A representation of the color

[ Top ]

method addFont [line 254]

void &addFont( Font &$font)

Add a font.



Parameters:

Font   $font   A representation of the font

[ Top ]

method antialias [line 399]

void antialias( [int $percent = 5])

Antialias on the graph



Parameters:

int   $percent   The percentage "to" antialias

[ Top ]

method done [line 408]

void done( [int $type = IMG_PNG])

Output to the canvas



Parameters:

int   $type   The type of image to output, i.e. IMG_PNG (default) and IMG_JPEG

[ Top ]

method height [line 273]

int height( )

The height of the graph



Tags:

return:  Number of pixels representing the height of the graph


Overrides Image_Graph_Element::height() (The height of the element on the canvas)

[ Top ]

method hideLogo [line 206]

void hideLogo( )

Hides the GraPHPite logo from the output



[ Top ]

method newColor [line 235]

void &newColor( int $red, [int $green = false], [int $blue = false], [int $alpha = false])

Create a new Image_Graph_color.

This method creates and add a color to the graph. {@see Image_Graph::addColor()}. Use this only if it is strictly necessary to use a {@see Image_Graph_Color} object, fx. for alpha-blending otherwise use the named colors or the 24-bit RGB color values.




Overrides Image_Graph_Common::newColor() (Create a new Image_Graph_color.)

Parameters:

int   $red   The red part or the whole part
int   $green   The green part (or nothing), or the alpha channel
int   $blue   The blue part (or nothing)
int   $alpha   The alpha channel (or nothing)

[ Top ]

method rotate [line 282]

void rotate( mixed $rotation, int $Rotation)

Rotate the final graph



Parameters:

int   $Rotation   Number of degrees to rotate the canvas counter-clockwise

[ Top ]

method saveAs [line 314]

void saveAs( string $fileName, [bool $outputImage = false])

Save the output as a file



Parameters:

string   $fileName   The filename and path of the file to save output in
bool   $outputImage   Output the image to the browser as well

[ Top ]

method thumbnail [line 326]

void thumbnail( [int $width = 80], [int $height = 60], [string $fileName = ""])

Create the output as a thumbnail



Parameters:

int   $width   The width of the thumbnail
int   $height   The height of the thumbnail
string   $fileName   The filename and path of the file to save the thumbnail in, if specified the thumbnail will be saved and the output will be the normal graph

[ Top ]

method width [line 264]

int width( )

The width of the graph



Tags:

return:  Number of pixels representing the width of the graph


Overrides Image_Graph_Element::width() (The width of the element on the canvas)

[ Top ]


Documentation generated on Fri, 12 Nov 2004 08:25:23 +0100 by phpDocumentor 1.3.0RC3