Class Component

new Component()

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

Inherited Methods