class ChartFactory extends JavascriptFactory (View source)

ChartFactory Class

This class takes Charts and uses all of the info to build the complete javascript blocks for outputting into the page.

Constants

JS_OPEN

Opening javascript tag.

JS_CLOSE

Closing javascript tag.

JSAPI

Script block for the Google's Chart API.

Methods

boolean
coreJsRendered()

Returns true|false depending on if the jsapi & lava.js core have been added to the output.

string
getCoreJs()

Gets the Google chart api and lava.js core.

string
getJavascript()

Parses the javascript template and wraps the output in a script tag.

string
getChartJs( Chart $chart, ElementId $elementId)

Checks for an element id to output the chart into and builds the Javascript.

string
getDashboardJs( Dashboard $dashboard, ElementId $elementId)

Checks for an element id to output the chart into and builds the Javascript.

__construct( Chart $chart, ElementId $elementId)

Creates a new ChartFactory with the javascript template.

Details

in JavascriptFactory at line 91
boolean coreJsRendered()

Returns true|false depending on if the jsapi & lava.js core have been added to the output.

Return Value

boolean

in JavascriptFactory at line 102
string getCoreJs()

Gets the Google chart api and lava.js core.

Return Value

string Javascript code blocks.

in JavascriptFactory at line 120
string getJavascript()

Parses the javascript template and wraps the output in a script tag.

Return Value

string Javascript code block.

in JavascriptFactory at line 136
string getChartJs( Chart $chart, ElementId $elementId)

Checks for an element id to output the chart into and builds the Javascript.

Parameters

Chart $chart Chart to render.
ElementId $elementId HTML element id to output the chart into.

Return Value

string Javascript code block.

in JavascriptFactory at line 151
string getDashboardJs( Dashboard $dashboard, ElementId $elementId)

Checks for an element id to output the chart into and builds the Javascript.

Parameters

Dashboard $dashboard Dashboard to render.
ElementId $elementId HTML element id to output the dashboard into.

Return Value

string Javascript code block.

at line 41
__construct( Chart $chart, ElementId $elementId)

Creates a new ChartFactory with the javascript template.

Parameters

Chart $chart Chart to process
ElementId $elementId HTML element id to output into.