Class ChartComponent

new ChartComponent($id)

inherits from Component

NameTypeDescription
$id String Uniquely identifies the instance of this class

Methods

PermalinkaddSeries


addSeries($id, $name, $seriesData, $opts)

Adds a series to the chart. The number of data points provided using the seriesData array should be the same as the other series and the number of labels

Params
NameTypeDescription
$id String Unique id of the series. This will be used for updating the series data
$name String The name of this series
$seriesData Array The series data
$opts Array A bunch of options passed to as an associative array
Example
$chart1 = new ChartComponent('my_chart1');
$chart1->addSeries('sales', 'Sales', array(826.25, 382.14, 261.36, 241.56, 93.53, 79.20, 60.39, 57.71, 40.59, 40.59));

PermalinksetPieValues


setPieValues($seriesData, $opts)

Set an array of data points which will be used for the pie chart

Params
NameTypeDescription
$seriesData Array The series data array
$opts Array The series options as an associative array

PermalinkupdateSeries


updateSeries($id, $newData)

Updates a series

Params
NameTypeDescription
$id String The id of the series
$newData Array The update data array

PermalinksetLables


setLables($labelArray)

Set the labels of the chart, which are the names on the X-Axis

Params
NameTypeDescription
$labelArray Array An array of labels as strings

PermalinksetYAxis


setYAxis($name, $options)

Configure the Y-Axis of the chart

Params
NameTypeDescription
$name String The name of the y axis
$options Array Options array. See the guide for available options

PermalinksetXAxis


setXAxis($name, $options)

Configure the X-Axis of the chart

Params
NameTypeDescription
$name String The name of the x axis
$options Array Options array. See the guide for available options

PermalinkaddYAxis


addYAxis($id, $name, $options)

Configure the Y-Axis of the chart

Params
NameTypeDescription
$id String The unique id of this axis
$name String The name of the y axis
$options Array Options array. See the guide for available options

PermalinkonItemClick


onItemClick($lockedComponents, $func, $db)

Attach a handler for the event when a chart plot item is clicked

Params
NameTypeDescription
$lockedComponents Array Components to be locked
$func String Function name to be executed on item click
$db Object THe dashboard object

PermalinkclearChart


clearChart()

Clears all the data in the chart. Use this function if you want to update the chart with new data and labels. Be sure to lock the component before

Params
None

PermalinkaddDrillStep


addDrillStep($func, $db)

Add a drill step for chart drilldown

Params
NameTypeDescription
$func String Function name to be executed on a drill step
$db Object The dashboard object

PermalinkgetType


getType()

Gets the type of this component

Params
None

Inherited Methods

PermalinksetCaption


setCaption($caption)

Set the caption of this component which is the text displayed on top of the component

Params
NameTypeDescription
$caption String Caption text to be displayed on the component

PermalinksetDimensions


setDimensions($w, $h)

Set the dimensions of the component. The dimensions are based on a 12-column grid

Params
NameTypeDescription
$w Number Width of the Component in Units
$h Number Height of the Component in Units

PermalinkhideComponent


hideComponent()

Hides a component from the dashboard

Params
None

PermalinkshowAsModal


showAsModal()

Show a hidden component in a modal

Params
None

PermalinkaddComponentKPI


addComponentKPI($id, $options)

Add a simple Key Performance Indicator (KPI/Metric) attached to the bottom of the component.

Params
NameTypeDescription
$id String A unique ID to identify the component KPI
$options ComponentKPIProperties The options as an Associative Array
Properties Show
NameTypeDescription
caption string The caption to display for the component KPI
numberFormatFlag boolean If set to true, the number will be formatted as per the options.
numberHumanize boolean Uses K, M and B to denote thousands, millions and billions respectively.
numberPrefix string Adds a string perfix to the number.
numberSuffix string Adds a string suffix to the number.
numberDecimalPoints number Number of decimal places to show.

PermalinkupdateComponentKPI


updateComponentKPI($id, $options)

Updates the Component KPI

Params
NameTypeDescription
$id String A unique ID to identify the component KPI. This has to be the same as the one used to add the component kpi
$options Array Array with the new value to set

PermalinkremoveComponentKPI


removeComponentKPI($id)

Removes a Component KPI

Params
NameTypeDescription
$id String A unique ID to identify the component KPI. This has to be the same as the one used to add the component kpi

PermalinkoverrideDisplayOrderIndex


overrideDisplayOrderIndex($idx)

Sets the index of the component on the dashboard. The component order on the dashboard is based on this index.

Params
NameTypeDescription
$idx Number The index for this component

PermalinksetOption


setOption(key, value)

Set the value to the key passed for the particular component.

Params
NameTypeDescription
key String variable which needs to be assigned
value String value to be assigned to the key

PermalinkgetID


getID()

Get the id for this component

Params
None