Libchart

Simple PHP chart drawing library
  • Introduction
  • Download
  • Sample Code
  • Reference API
  • Links
  • Main Page
  • Classes
  • Directories
  • Class List
  • Class Members

Plot Class Reference

List of all members.

Public Member Functions

 Plot ($width, $height)
 computeLayout ()
 createImage ()
 printTitle ()
 printLogo ()
 render ($fileName)
 setTitle ($title)
 setLogoFileName ($logoFileName)
 getImg ()
 getPalette ()
 getText ()
 getPrimitive ()
 getOuterPadding ()
 setOuterPadding ($outerPadding)
 setTitleHeight ($titleHeight)
 setTitlePadding ($titlePadding)
 setGraphPadding ($graphPadding)
 setHasCaption ($hasCaption)
 setCaptionPadding ($captionPadding)
 setGraphCaptionRatio ($graphCaptionRatio)
 getGraphArea ()
 getCaptionArea ()
 getTextColor ()

Protected Attributes

 $title
 $logoFileName
 $outputArea
 $outerPadding
 $imageArea
 $titleHeight
 $titlePadding
 $titleArea
 $hasCaption
 $graphCaptionRatio
 $graphPadding
 $graphArea
 $captionPadding
 $captionArea
 $text
 $palette
 $img
 $primitive
 $backGroundColor
 $textColor

Detailed Description

The plot holds graphical attributes, and is responsible for computing the layout of the graph. The layout is quite simple right now, with 4 areas laid out like that: (of course this is subject to change in the future).

output area------------------------------------------------| | (outer padding) | | image area--------------------------------------------| | | | (title padding) | | | | title area----------------------------------------| | | | | |-------------------------------------------------| | | | | | | | | (graph padding) (caption padding) | | | | graph area----------------| caption area---------| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |-------------------------| |--------------------| | | | | | | | |-----------------------------------------------------| | | | |----------------------------------------------------------|

All area dimensions are known in advance , and the optional logo is drawn in absolute coordinates.

Author:
Jean-Marc Trémeaux (jm.tremeaux at gmail.com) Created on 27 july 2007


Member Function Documentation

Plot::Plot ( $  width,
$  height 
)

Constructor of Plot.

Parameters:
integer width of the image
integer height of the image

Plot::computeLayout (  ) 

Compute the layout of all areas of the graph.

Plot::createImage (  ) 

Creates and initialize the image.

Plot::printTitle (  ) 

Print the title to the image.

Plot::printLogo (  ) 

Print the logo image to the image.

Plot::render ( $  fileName  ) 

Renders to a file or to standard output.

Parameters:
fileName File name (optional)

Plot::setTitle ( $  title  ) 

Sets the title.

Parameters:
string New title

Plot::setLogoFileName ( $  logoFileName  ) 

Sets the logo image file name.

Parameters:
string New logo image file name

Plot::getImg (  ) 

Return the GD image.

Returns:
GD Image

Plot::getPalette (  ) 

Return the palette.

Returns:
palette

Plot::getText (  ) 

Return the text.

Returns:
text

Plot::getPrimitive (  ) 

Return the primitive.

Returns:
primitive

Plot::getOuterPadding (  ) 

Return the outer padding.

Parameters:
integer Outer padding value in pixels

Plot::setOuterPadding ( $  outerPadding  ) 

Set the outer padding.

Parameters:
integer Outer padding value in pixels

Plot::setTitleHeight ( $  titleHeight  ) 

Return the title height.

Parameters:
integer title height

Plot::setTitlePadding ( $  titlePadding  ) 

Return the title padding.

Parameters:
integer title padding

Plot::setGraphPadding ( $  graphPadding  ) 

Return the graph padding.

Parameters:
integer graph padding

Plot::setHasCaption ( $  hasCaption  ) 

Set if the graph has a caption.

Parameters:
boolean graph has a caption

Plot::setCaptionPadding ( $  captionPadding  ) 

Set the caption padding.

Parameters:
integer caption padding

Plot::setGraphCaptionRatio ( $  graphCaptionRatio  ) 

Set the graph/caption ratio.

Parameters:
integer caption padding

Plot::getGraphArea (  ) 

Return the graph area.

Returns:
graph area

Plot::getCaptionArea (  ) 

Return the caption area.

Returns:
caption area

Plot::getTextColor (  ) 

Return the text color.

Returns:
text color


Member Data Documentation

Plot::$text [protected]

Text writer.

Plot::$palette [protected]

Color palette.

Plot::$img [protected]

GD image

Plot::$primitive [protected]

Drawing primitives


The documentation for this class was generated from the following file:
  • Plot.php

Site last modified August 13th, 2007 by Jean-Marc Trémeaux