class Lavacharts (View source)

Lavacharts - A PHP wrapper library for the Google Chart API

Constants

VERSION

Lavacharts version

Methods

__construct()

Creates Volcano & Javascript Factory

mixed
__call( string $method, array $arguments)

Magic function to reduce repetitive coding and create aliases.

DataTable( string $timezone = null)

Create a new DataTable

Dashboard( string $label)

Create a new Dashboard

ControlWrapper( Filter $filter, string $elementId)

Create a new ControlWrapper from a Filter

ChartWrapper( Chart $chart, string $elementId)

Create a new ChartWrapper from a Chart

string
render( string $type, string $label, string $elementId, mixed $divDimensions = false)

Renders Charts or Dashboards into the page

string
jsapi()

Outputs the link to the Google JSAPI

boolean
exists( string $type, string $label)

Checks to see if the given chart or dashboard exists in the volcano storage.

mixed
fetch( string $type, string $label)

Fetches an existing Chart or Dashboard from the volcano storage.

boolean
store( Chart|Dashboard $lavaObj)

Stores a existing Chart or Dashboard into the volcano storage.

Details

at line 106
Lavacharts __construct()

Creates Volcano & Javascript Factory

Return Value

Lavacharts

at line 133
mixed __call( string $method, array $arguments)

Magic function to reduce repetitive coding and create aliases.

Parameters

string $method Name of method
array $arguments Passed arguments

Return Value

mixed Returns Charts, DataTables, and Config Objects, Events, Filters

Exceptions

InvalidLabel
InvalidLavaObject
InvalidFilterObject
InvalidFunctionParam

at line 174
DataTable DataTable( string $timezone = null)

Create a new DataTable

If the additional DataTablePlus package is available, then one will be created, otherwise a standard DataTable is returned.

Parameters

string $timezone

Return Value

DataTable

at line 196
DataTable Dashboard( string $label)

Create a new Dashboard

Parameters

string $label

Return Value

DataTable

at line 212
ControlWrapper ControlWrapper( Filter $filter, string $elementId)

Create a new ControlWrapper from a Filter

Parameters

Filter $filter Filter to wrap
string $elementId HTML element ID to output the control.

Return Value

ControlWrapper

at line 228
ChartWrapper ChartWrapper( Chart $chart, string $elementId)

Create a new ChartWrapper from a Chart

Parameters

Chart $chart Chart to wrap
string $elementId HTML element ID to output the control.

Return Value

ChartWrapper

at line 251
string render( string $type, string $label, string $elementId, mixed $divDimensions = false)

Renders Charts or Dashboards into the page

Given a type, label, and HTML element id, this will output all of the necessary javascript to generate the chart or dashboard.

Parameters

string $type Type of object to render.
string $label Label of the object to render.
string $elementId HTML element id to render into.
mixed $divDimensions Set true for div creation, or pass an array with height & width

Return Value

string

at line 338
string jsapi()

Outputs the link to the Google JSAPI

Return Value

string Google Chart API and lava.js script blocks

at line 353
boolean exists( string $type, string $label)

Checks to see if the given chart or dashboard exists in the volcano storage.

Parameters

string $type Type of object to check.
string $label Label of the object to check.

Return Value

boolean

at line 374
mixed fetch( string $type, string $label)

Fetches an existing Chart or Dashboard from the volcano storage.

Parameters

string $type Type of Chart or Dashboard.
string $label Label of the Chart or Dashboard.

Return Value

mixed

at line 393
boolean store( Chart|Dashboard $lavaObj)

Stores a existing Chart or Dashboard into the volcano storage.

Parameters

Chart|Dashboard $lavaObj Chart or Dashboard.

Return Value

boolean