Methods

This page describes the available methods within the HTML Canvas class

HTML Canvas methods

MethodDescription

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.

setDashboardDevice

Changes the currently selected device in a dynamic dashboard.

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.

getHeaders

Arguments: None

Signature: ubidots.getHeaders()

Return:

{
  Authorization: "Bearer receivedJWTToken",
  Content-type: "application/json"
}

openDrawer

Arguments: options: Object [mandatory] => An object containing the content's url and the drawer's width in px:

{
    url: "https://url.com",
    width: 500 // Read as 500px
}

Signature:

ubidots.openDrawer(
    {
        url: "https://some-url",
        width: <width>
    }
);
    

Return: None

setDashboardDevice

Arguments: deviceId: string [Mandatory] =>The ID of the device that you want to set.

Signature: ubidots.setDashboardDevice(<deviceId>)

Return: None

setDashboardDateRange

Arguments: timeframe: Object [Mandatory] => An object containing the start and end timestamps:

Copy

{
    "startTime": 1642282088000,
    "endTime": 1673818088000
}

Signature: ubidots.setDashboardDateRange(<timeframe>)

Return: None

setRealTime

Arguments: rt: Bool [Mandatory] => A boolean indicating the real time update setting

Signature: ubidots.setRealTime(<rt>)

Return: None

refreshDashboard

Arguments: None

Signature: ubidots.refreshDashboard()

Return: None

setFullScreen

Arguments: screenSetting: string(toggle | enable | disabled) [Mandatory] => A string representing the full screen setting.

Signature: ubidots.setFullScreen(<screenSetting>)

Return: None

Last updated