IPS PHP Doc
IPS\Helpers\Chart Class Reference
Inheritance diagram for IPS\Helpers\Chart:
IPS\Helpers\Chart\Dynamic

Classes

class  Dynamic
 

Public Member Functions

 addHeader ($label, $type)
 
 addRow ($values)
 
 render ($type, $options=array(), $format=NULL)
 

Public Attributes

 $headers = array()
 Headers. More...
 
 $numbersCanBeNegative = FALSE
 Google Charts will assume numbers can be negative, which can produce graphs showing negative data points if no data is provided. The default baheviour is to set the minimum value to 0. Change this property if the chart should be able to show negative number values. More...
 
 $rows = array()
 Rows. More...
 

Detailed Description

Chart Helper

$chart = new \IPS\Helpers\Chart;
$chart->addHeader( "Year", 'string' );
$chart->addHeader( "Sales", 'number' );
$chart->addHeader( "Expenses", 'number' );
$chart->addRow( array( '2004', 1000, 400 ) );
$chart->addRow( array( '2005', 1170, 460 ) );
$chart->addRow( array( '2006', 660, 1120 ) );
$chart->addRow( array( '2007', 1030, 540 ) );
\IPS\Output::i()->output = $chart->render( 'PieChart', array(
'title' => "Cash Flow",
'is3D' => TRUE
) );

Member Function Documentation

IPS\Helpers\Chart::addHeader (   $label,
  $type 
)

Add Header

Parameters
string$labelLabel
string$typeType of value
  • string
  • number
  • boolean
  • date
  • datetime
  • timeofday
Returns
void

Referenced by IPS\Helpers\Chart\Dynamic\__construct(), and IPS\Helpers\Chart\Dynamic\addSeries().

IPS\Helpers\Chart::addRow (   $values)

Add Row

Parameters
array$valuesValues, in the order that headers were added
Returns
void
Exceptions

Referenced by IPS\Helpers\Chart\Dynamic\__toString().

IPS\Helpers\Chart::render (   $type,
  $options = array(),
  $format = NULL 
)

Render

Parameters
string$typeType
array$optionsOptions
string$formatValue for number formatter
See also
Charts Gallery - Google Charts - Google Developers
Returns
string

References IPS\Patterns\Singleton\i(), and IPS\Output\i().

Referenced by IPS\Helpers\Chart\Dynamic\__toString().

Member Data Documentation

IPS\Helpers\Chart::$headers = array()

Headers.

See also
addHeader();
IPS\Helpers\Chart::$numbersCanBeNegative = FALSE

Google Charts will assume numbers can be negative, which can produce graphs showing negative data points if no data is provided. The default baheviour is to set the minimum value to 0. Change this property if the chart should be able to show negative number values.

IPS\Helpers\Chart::$rows = array()

Rows.

See also
addHeader();

The documentation for this class was generated from the following file: