PHP Class Pop\Graph\Graph

Author: Nick Sagona, III ([email protected])
Show file Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$adapter mixed Graph graphic adapter interface
$axisColor mixed Axis color
$axisWidth integer Axis width
$barWidth integer Bar width
$fillColor mixed Fill color
$font string Current font to use
$fontColor mixed Font color
$fontSize integer Font size
$fonts array Available fonts
$height integer Graph canvas height
$padding integer Graph canvas padding
$reverseFontColor mixed Reverse font color
$showText boolean Show data text flag
$showX boolean Show X-axis increment lines flag
$showXColor mixed Show X-axis color
$showY boolean Show Y-axis increment lines flag
$showYColor mixed Show X-axis color
$strokeColor mixed Stroke color
$strokeWidth integer Stroke width
$width integer Graph canvas width

Public Methods

Method Description
__construct ( array $options, boolean $forceGd = false ) : Graph Constructor
adapter ( ) : mixed Get the graph graphic adapter
addFont ( string $font ) : Graph Add a font to available fonts
createHBarGraph ( array $dataPoints, array $xAxis, array $yAxis ) : Graph Create a horizontal bar graph
createLineGraph ( array $dataPoints, array $xAxis, array $yAxis ) : Graph Create a line graph
createPieChart ( array $pie, array $percents, integer $explode ) : Graph Create a horizontal bar graph
createVBarGraph ( array $dataPoints, array $xAxis, array $yAxis ) : Graph Create a vertical bar graph
getAxisColor ( ) : Pop\Color\Space\ColorInterface Get the axis color
getAxisWidth ( ) : integer Get the axis width
getBarWidth ( ) : integer Get the bar width
getFillColor ( ) : mixed Get the fill color
getFont ( ) : string Get the font
getFontColor ( ) : mixed Get the font color
getFontSize ( ) : integer Get the font size
getFonts ( string $font = null ) : string Get the fonts
getHeight ( ) : integer Get the height
getPadding ( ) : integer Get the graph canvas padding
getReverseFontColor ( ) : mixed Get the reverse font color
getShowText ( ) : boolean Get the 'show data text' flag
getShowX ( ) : boolean Get the show X flag
getShowY ( ) : boolean Get the show Y flag
getStrokeColor ( ) : mixed Get the stroke color
getStrokeWidth ( ) : integer Get the stroke width
getWidth ( ) : integer Get the width
getXColor ( ) : Pop\Color\Space\ColorInterface Get the show X color
getYColor ( ) : Pop\Color\Space\ColorInterface Get the show Y color
output ( boolean $download = false ) : void Output the graph
save ( string $to = null, boolean $append = false ) : Graph Save the graph image to disk
setAxisOptions ( Pop\Color\Space\ColorInterface $color = null, integer $width = 2 ) : Graph Set the axis options
setBarWidth ( integer $width ) : Graph Set the bar width
setFillColor ( Pop\Color\Space\ColorInterface $color ) : Graph Set the fill color
setFont ( string $font = null ) : Graph Set the font to use from the available fonts
setFontColor ( Pop\Color\Space\ColorInterface $color ) : Graph Set the font color
setFontSize ( integer $size ) : Graph Set the font size
setPadding ( integer $pad ) : Graph Set the graph canvas padding
setReverseFontColor ( Pop\Color\Space\ColorInterface $color ) : Graph Set the reverse font color
setStrokeColor ( Pop\Color\Space\ColorInterface $color ) : Graph Set the stroke color
setStrokeWidth ( integer $width = 1 ) : Graph Set the stroke width
showText ( boolean $showText ) : Graph Set the 'show data text' flag
showX ( boolean $showX, Pop\Color\Space\ColorInterface $color = null ) : Graph Set the 'show X-axis increment lines' flag
showY ( boolean $showY, Pop\Color\Space\ColorInterface $color = null ) : Graph Set the 'show Y-axis increment lines' flag

Method Details

__construct() public method

Instantiate the graph object.
public __construct ( array $options, boolean $forceGd = false ) : Graph
$options array
$forceGd boolean
return Graph

adapter() public method

Get the graph graphic adapter
public adapter ( ) : mixed
return mixed

addFont() public method

Add a font to available fonts
public addFont ( string $font ) : Graph
$font string
return Graph

createHBarGraph() public method

Create a horizontal bar graph
public createHBarGraph ( array $dataPoints, array $xAxis, array $yAxis ) : Graph
$dataPoints array
$xAxis array
$yAxis array
return Graph

createLineGraph() public method

Create a line graph
public createLineGraph ( array $dataPoints, array $xAxis, array $yAxis ) : Graph
$dataPoints array
$xAxis array
$yAxis array
return Graph

createPieChart() public method

Create a horizontal bar graph
public createPieChart ( array $pie, array $percents, integer $explode ) : Graph
$pie array
$percents array
$explode integer
return Graph

createVBarGraph() public method

Create a vertical bar graph
public createVBarGraph ( array $dataPoints, array $xAxis, array $yAxis ) : Graph
$dataPoints array
$xAxis array
$yAxis array
return Graph

getAxisColor() public method

Get the axis color
public getAxisColor ( ) : Pop\Color\Space\ColorInterface
return Pop\Color\Space\ColorInterface

getAxisWidth() public method

Get the axis width
public getAxisWidth ( ) : integer
return integer

getBarWidth() public method

Get the bar width
public getBarWidth ( ) : integer
return integer

getFillColor() public method

Get the fill color
public getFillColor ( ) : mixed
return mixed

getFont() public method

Get the font
public getFont ( ) : string
return string

getFontColor() public method

Get the font color
public getFontColor ( ) : mixed
return mixed

getFontSize() public method

Get the font size
public getFontSize ( ) : integer
return integer

getFonts() public method

Get the fonts
public getFonts ( string $font = null ) : string
$font string
return string

getHeight() public method

Get the height
public getHeight ( ) : integer
return integer

getPadding() public method

Get the graph canvas padding
public getPadding ( ) : integer
return integer

getReverseFontColor() public method

Get the reverse font color
public getReverseFontColor ( ) : mixed
return mixed

getShowText() public method

Get the 'show data text' flag
public getShowText ( ) : boolean
return boolean

getShowX() public method

Get the show X flag
public getShowX ( ) : boolean
return boolean

getShowY() public method

Get the show Y flag
public getShowY ( ) : boolean
return boolean

getStrokeColor() public method

Get the stroke color
public getStrokeColor ( ) : mixed
return mixed

getStrokeWidth() public method

Get the stroke width
public getStrokeWidth ( ) : integer
return integer

getWidth() public method

Get the width
public getWidth ( ) : integer
return integer

getXColor() public method

Get the show X color
public getXColor ( ) : Pop\Color\Space\ColorInterface
return Pop\Color\Space\ColorInterface

getYColor() public method

Get the show Y color
public getYColor ( ) : Pop\Color\Space\ColorInterface
return Pop\Color\Space\ColorInterface

output() public method

Output the graph
public output ( boolean $download = false ) : void
$download boolean
return void

save() public method

Save the graph image to disk
public save ( string $to = null, boolean $append = false ) : Graph
$to string
$append boolean
return Graph

setAxisOptions() public method

Set the axis options
public setAxisOptions ( Pop\Color\Space\ColorInterface $color = null, integer $width = 2 ) : Graph
$color Pop\Color\Space\ColorInterface
$width integer
return Graph

setBarWidth() public method

Set the bar width
public setBarWidth ( integer $width ) : Graph
$width integer
return Graph

setFillColor() public method

Set the fill color
public setFillColor ( Pop\Color\Space\ColorInterface $color ) : Graph
$color Pop\Color\Space\ColorInterface
return Graph

setFont() public method

Set the font to use from the available fonts
public setFont ( string $font = null ) : Graph
$font string
return Graph

setFontColor() public method

Set the font color
public setFontColor ( Pop\Color\Space\ColorInterface $color ) : Graph
$color Pop\Color\Space\ColorInterface
return Graph

setFontSize() public method

Set the font size
public setFontSize ( integer $size ) : Graph
$size integer
return Graph

setPadding() public method

Set the graph canvas padding
public setPadding ( integer $pad ) : Graph
$pad integer
return Graph

setReverseFontColor() public method

Set the reverse font color
public setReverseFontColor ( Pop\Color\Space\ColorInterface $color ) : Graph
$color Pop\Color\Space\ColorInterface
return Graph

setStrokeColor() public method

Set the stroke color
public setStrokeColor ( Pop\Color\Space\ColorInterface $color ) : Graph
$color Pop\Color\Space\ColorInterface
return Graph

setStrokeWidth() public method

Set the stroke width
public setStrokeWidth ( integer $width = 1 ) : Graph
$width integer
return Graph

showText() public method

Set the 'show data text' flag
public showText ( boolean $showText ) : Graph
$showText boolean
return Graph

showX() public method

Set the 'show X-axis increment lines' flag
public showX ( boolean $showX, Pop\Color\Space\ColorInterface $color = null ) : Graph
$showX boolean
$color Pop\Color\Space\ColorInterface
return Graph

showY() public method

Set the 'show Y-axis increment lines' flag
public showY ( boolean $showY, Pop\Color\Space\ColorInterface $color = null ) : Graph
$showY boolean
$color Pop\Color\Space\ColorInterface
return Graph

Property Details

$adapter protected property

Graph graphic adapter interface
protected mixed $adapter
return mixed

$axisColor protected property

Axis color
protected mixed $axisColor
return mixed

$axisWidth protected property

Axis width
protected int $axisWidth
return integer

$barWidth protected property

Bar width
protected int $barWidth
return integer

$fillColor protected property

Fill color
protected mixed $fillColor
return mixed

$font protected property

Current font to use
protected string $font
return string

$fontColor protected property

Font color
protected mixed $fontColor
return mixed

$fontSize protected property

Font size
protected int $fontSize
return integer

$fonts protected property

Available fonts
protected array $fonts
return array

$height protected property

Graph canvas height
protected int $height
return integer

$padding protected property

Graph canvas padding
protected int $padding
return integer

$reverseFontColor protected property

Reverse font color
protected mixed $reverseFontColor
return mixed

$showText protected property

Show data text flag
protected bool $showText
return boolean

$showX protected property

Show X-axis increment lines flag
protected bool $showX
return boolean

$showXColor protected property

Show X-axis color
protected mixed $showXColor
return mixed

$showY protected property

Show Y-axis increment lines flag
protected bool $showY
return boolean

$showYColor protected property

Show X-axis color
protected mixed $showYColor
return mixed

$strokeColor protected property

Stroke color
protected mixed $strokeColor
return mixed

$strokeWidth protected property

Stroke width
protected int $strokeWidth
return integer

$width protected property

Graph canvas width
protected int $width
return integer