Overview

Namespaces

  • SamChristy
    • PieChart

Classes

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

Class PieChartGD

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

SamChristy\PieChart\PieChart
Extended by SamChristy\PieChart\PieChartGD
Namespace: SamChristy\PieChart
Package: PieChart
Copyright: © Sam Christy 2013
Author: Sam Christy <sam_christy@hotmail.co.uk>
Version: v2.0.0
Licence: GNU GPL v3.0 <http://www.gnu.org/licenses/gpl-3.0.html>
Located at SamChristy/PieChart/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

SamChristy\PieChart\PieChart::destroy()
public
# draw( integer $aa = 4 )

Draws the pie chart, with optional supersampled anti-aliasing.

Draws the pie chart, with optional supersampled anti-aliasing.

Parameters

$aa
integer
$aa

Overrides

SamChristy\PieChart\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

SamChristy\PieChart\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 SamChristy\PieChart\PieChart
__construct(), addSlice(), forceDownloadGIF(), forceDownloadJPEG(), forceDownloadPNG(), outputGIF(), outputJPEG(), outputPNG(), removeSlice(), saveGIF(), saveJPEG(), savePNG(), setLegend(), setOutputQuality(), setTitle()
Constants inherited from SamChristy\PieChart\PieChart
FORMAT_GIF, FORMAT_JPEG, FORMAT_PNG, OUTPUT_DOWNLOAD, OUTPUT_INLINE, OUTPUT_SAVE
Properties inherited from SamChristy\PieChart\PieChart
$backgroundColor, $canvas, $hasLegend, $height, $legendFont, $quality, $slices, $textColor, $title, $titleFont, $width
API documentation generated by ApiGen 2.8.0