Overview

Packages

  • None
  • PieChart

Classes

  • PieChart
  • PieChartColor
  • PieChartGD
  • PieChartImagick
  • Overview
  • Package
  • Class
  • Tree

Class PieChartGD

A lightweight class for drawing pie charts, using the GD library.

PieChart
Extended by PieChartGD
Package: PieChart
Copyright: © Sam Christy 2013
Author: Sam Christy <sam_christy@hotmail.co.uk>
Version: v1.2
Licence: GNU GPL v3.0 <http://www.gnu.org/licenses/gpl-3.0.html>
Located at PieChartGD.php
Methods summary
public
# destroy( )

Frees the memory that was allocated to the image. Use this function to clean up after your pie chart when you're finished with it.

Frees the memory that was allocated to the image. Use this function to clean up after your pie chart when you're finished with it.

Overrides

PieChart::destroy()
public
# draw( )

Draws the chart so that it is ready for output.

Draws the chart so that it is ready for output.

Overrides

PieChart::draw()
protected
# _output( integer $method, integer $format, string $filename )

For child classes to override, so that the output functions work.

For child classes to override, so that the output functions work.

Parameters

$method
integer
$method
$format
integer
$format
$filename
string
$filename

Overrides

PieChart::_output()
protected integer
# _drawLegend( integer $legendOffset )

Draws the legend for the pieChart, if $this->hasLegend is true.

Draws the legend for the pieChart, if $this->hasLegend is true.

Parameters

$legendOffset
integer
$legendOffset The number of pixels the legend is offset by the title.

Returns

integer
The width of the legend and its padding.
protected
# _drawLegendKey( integer $x, integer $y, object $color, string $label, integer $squareSize, integer $labelPadding, integer $fontSize )

Draws the legend key at the specific location.

Draws the legend key at the specific location.

Parameters

$x
integer
$x The x coordinate for the key's top, left corner.
$y
integer
$y The y coordinate for the key's top, left corner.
$color
object
$color The GD colour identifier, created with imageColorAllocate().
$label
string
$label
$squareSize
integer
$squareSize The size of the square, in pixels.
$labelPadding
integer
$labelPadding
$fontSize
integer
$fontSize
protected integer
# _maxLabelWidth( mixed $fontSize )

Returns the width, in pixels, of the chart's widest label.

Returns the width, in pixels, of the chart's widest label.

Returns

integer
protected integer
# _drawTitle( mixed $x = 0, mixed $y = 0 )

Draws and returns the height of the title and its padding (in pixels). If no title is specified, then nothing is drawn and 0 is returned.

Draws and returns the height of the title and its padding (in pixels). If no title is specified, then nothing is drawn and 0 is returned.

Returns

integer
The height of the title + padding.

Var

float x location
float y location
Methods inherited from PieChart
__construct(), addSlice(), forceDownloadGIF(), forceDownloadJPEG(), forceDownloadPNG(), outputGIF(), outputJPEG(), outputPNG(), removeSlice(), saveGIF(), saveJPEG(), savePNG(), setLegend(), setOutputQuality(), setTitle()
Constants inherited from PieChart
FORMAT_GIF, FORMAT_JPEG, FORMAT_PNG, OUTPUT_DOWNLOAD, OUTPUT_INLINE, OUTPUT_SAVE
Properties inherited from PieChart
$backgroundColor, $canvas, $hasLegend, $height, $legendFont, $quality, $slices, $textColor, $title, $titleFont, $width
PieChart API documentation generated by ApiGen 2.8.0