IP.Board  3.3.0
classGraph Class Reference

Public Member Functions

 __construct ($debug=0)
 addLabels ($data=array())
 addSeries ($name= '', $data=array(), $color= '')
 display ()

Data Fields

 $options

Protected Member Functions

 _checkColor ($color='')
 _checkSeries ($minseries=0, $labelsRequired=0)
 _drawArea ()
 _drawAxes ()
 _drawBars ()
 _drawBubble ()
 _drawDoughnut ()
 _drawFunnel ()
 _drawHorizontalBars ()
 _drawLegend ()
 _drawLines ()
 _drawPie ()
 _drawRadar ()
 _drawTitle ()
 _drawXY ()
 _error ($msg='')
 _getMax ($data=array())
 _getSliceColor ($force_color='')

Protected Attributes

 $black = null
 $color = array()
 $colors
 $data = array()
 $debug = 0
 $fontsize = 3
 $grapharea = array()
 $image = null
 $legend = array()
 $starttime = 0
 $titlesize = 0
 $use_ttf = 0
 $used_colors = array( 0 => '0,0,0' )
 $x_axis = array()
 $y_axis = array()
 $yaxis_count = 0

Constructor & Destructor Documentation

__construct ( debug = 0)

Constructor

Parameters:
boolean[Optional] Enable Debug Mode
Returns:
void

Member Function Documentation

_checkColor ( color = '') [protected]

Check if a color string is valid

Parameters:
stringColor HEX
Returns:
boolean
_checkSeries ( minseries = 0,
labelsRequired = 0 
) [protected]

Check the series required for graph

Parameters:
intMinimum number of series
booleanCheck labels exist
Returns:
boolean
_drawArea ( ) [protected]

Generate Area Chart

Returns:
void
_drawAxes ( ) [protected]

Draw X and Y axes

Returns:
void
_drawBars ( ) [protected]

Generate Bar Chart

Returns:
void
_drawBubble ( ) [protected]

Generate Bubble Plot

Returns:
void
_drawDoughnut ( ) [protected]

Generate Doughnut Chart

Returns:
void
_drawFunnel ( ) [protected]

Generate Funnel Chart

Returns:
void
_drawHorizontalBars ( ) [protected]

Generate Horizontal Bar Charts

Returns:
void
_drawLegend ( ) [protected]

Draw the legend

Returns:
void
_drawLines ( ) [protected]

Generate Line Chart

Returns:
void
_drawPie ( ) [protected]

Generate Pie Chart

Returns:
void
_drawRadar ( ) [protected]

Generate Radar Chart

Returns:
void
_drawTitle ( ) [protected]

Draw the graph title

Returns:
void
_drawXY ( ) [protected]

Generate Scatter Plot (XY Chart)

Returns:
void
_error ( msg = '') [protected]

Error routine, display the error message in debug mode

Parameters:
stringError message
Returns:
void
_getMax ( data = array()) [protected]

Get maximum value from the y-axis data array's

Parameters:
arrayArray of Y-axis data serie(s)
Returns:
int
_getSliceColor ( force_color = '') [protected]

Get a random color

Returns:
string
addLabels ( data = array())

Add labels to the graph data

Parameters:
arrayArray of data labels
Returns:
void
addSeries ( name = '',
data = array(),
color = '' 
)

Add a serie to the graph data

Parameters:
stringName of the data series
arrayArray of data values
stringHex color code to use for this series
Returns:
void
display ( )

Output the graph as png image

Returns:
bool

Field Documentation

$colors [protected]
Initial value:
 array( '80,120,200',
                                                                 '160,80,160',
                                                                         '0,120,80',
                                                                         '240,160,60',
                                                                         '40,160,240',
                                                                         '200,100,100',
                                                                         '100,200,100',
                                                                         '240,200,100',
                                                                         '60,60,160',
                                                                         '240,240,100'
                                                                   )
int Holds the number of y axis data array s in $data = array() [protected]

Number of Y-axis data array's

$options
Initial value:
 array( 'titlecolor'            => '#000000',                   
                                                                         'title'                        => 'Graph',                             
                                                                         'titleshadow'          => '#AAAAAA',                   
                                                                 'titlesize'            => 16,                                  
                                                                         'width'                        => 600,                                 
                                                                         'height'                       => 400,                                 
                                                                         'charttype'            => 'Pie',                               
                                                                         'style3D'                      => 1,                                   
                                                                 'bgcolor'                      => '#FFFFFF',                   
                                                                         'textcolor'            => '#FFFFFF',                   
                                                                         'font'                         => 'fonts/xsuni.ttf',   
                                                                         'xaxistitle'           => '',                                  
                                                                         'yaxistitle'           => '',                                  
                                                                         'showdatalabels'       => 1,                                   
                                                                         'showlegend'           => 1,                                   
                                                                         'maxlegendwidth'       => 20,                                  
                                                                         'showgridlinesx'       => 1,                                   
                                                                         'showgridlinesy'       => 1,                                   
                                                                         'numticks'                     => 5,                                   
                                                                         'xaxisskip'            => 0,                                   
                                                                   )

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables