Methods
This page describes the available methods within the HTML Canvas class
HTML Canvas methods
getHeaders
Returns the available Authentication Headers accordingly if the dashboard is public or not.
openDrawer
Embed a url's content in a drawer and displays it.
setDashboardDevices
Changes the currently selected device(s) in either multiple or single-device dynamic dashboards.
setDashboardDateRange
Changes the selected time range in a dashboard.
setRealTime
Turn on or off the dashboard's real time update.
refreshDashboard
Refreshes the dashboard data in all widget.
setDashboardLayer
Navigates to another layer.
getHeaders
getHeadersArguments: None
Signature: ubidots.getHeaders()
Return:
{
Authorization: "Bearer receivedJWTToken",
Content-type: "application/json"
}{
X-Auth-Token: "BBFF-xxyyzz",
Content-type: "application/json"
}openDrawer
openDrawerArguments: options: Object [mandatory] => An object containing the content's url and the drawer's width in px:
Signature:
Return: None
setDashboardDevices
setDashboardDevicesArguments: deviceIds: string [Mandatory] ⇒ Comma separated string with the Id's of the devices that you want to set.
Signature: ubidots.setDashboardDevices(<deviceIds>)
Return: None
setDashboardDateRange
setDashboardDateRangeArguments: timeframe: Object [Mandatory] => An object containing the start and end timestamps:
Signature: ubidots.setDashboardDateRange(<timeframe>)
Return: None
setRealTime
setRealTimeArguments: rt: Bool [Mandatory] => A boolean indicating the real time update setting
Signature: ubidots.setRealTime(<rt>)
Return: None
refreshDashboard
refreshDashboardArguments: None
Signature: ubidots.refreshDashboard()
Return: None
setFullScreen
setFullScreenArguments: screenSetting: string(toggle | enable | disabled) [Mandatory] => A string representing the full screen setting.
Signature: ubidots.setFullScreen(<screenSetting>)
Return: None
setDashboardLayer
setDashboardLayerArguments:
layer:string[Mandatory] ⇒ layer ID or label.Use ID as a plain string:
"6926000dcb198b4d10067b58"Use label prefixed with
~:"~Layer-2"
queryParams:Object[Optional] ⇒ An object where each key/value pair will be added as a query param.Allowed value types:
string | number | booleanArrays are NOT allowed. If you need multiple values, pass a comma-separated string, e.g.
"id1,id2,id3"
Last updated
Was this helpful?