Libchart

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

PieChart Class Reference

List of all members.

Public Member Functions

 PieChart ($width=600, $height=250)
 render ($fileName=null)

Protected Member Functions

 computeLayout ()
 sortPie ($v1, $v2)
 computePercent ()
 createImage ()
 printCaption ()
 drawDisc ($cy, $colorArray, $mode)
 drawPercent ()
 printPie ()

Protected Attributes

 $pieCenterX
 $pieCenterY

Detailed Description

Pie chart.

Author:
Jean-Marc Trémeaux (jm.tremeaux at gmail.com)


Member Function Documentation

PieChart::PieChart ( $  width = 600,
$  height = 250 
)

Constructor of a pie chart.

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

PieChart::computeLayout (  )  [protected]

Computes the layout.

PieChart::sortPie ( $  v1,
$  v2 
) [protected]

Compare two sampling point values, order from biggest to lowest value.

Parameters:
double first value
double second value
Returns:
integer result of the comparison

PieChart::computePercent (  )  [protected]

Compute pie values in percentage and sort them.

PieChart::createImage (  )  [protected]

Creates the pie chart image.

PieChart::printCaption (  )  [protected]

Renders the caption.

PieChart::drawDisc ( $  cy,
$  colorArray,
$  mode 
) [protected]

Draw a 2D disc.

Parameters:
integer center coordinate (y)
array colors for each portion
bitfield drawing mode

PieChart::drawPercent (  )  [protected]

Print the percentage text.

PieChart::printPie (  )  [protected]

Print the pie chart.

PieChart::render ( $  fileName = null  ) 

Render the chart image.

Parameters:
string name of the file to render the image to (optional)


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

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