This method initializes the Dashboard Viewer options and returns the object for rendering the dashboard.
Example
var dashboard = BoldBI.create({
serverUrl: "http://localhost:51777/bi/site/site1",
dashboardId: "755e99c7-f858-4058-958b-67577b283309",
embedContainerId: "dashboard_container",// This should be the container id where you want to embed the dashboard
embedToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImRldm9wc0Bib2xkYmkuY29tIiwidXBuIjouYm9sZGJpZGVtby5jb20vYmkvc2l0ZS9zaXRlMSIsImF1ZCI6Imh0dHBzOi8vaG90Zml4LXdpbmRvd3MuYm9sZGJpZGVtby5jb20vYmkvc2l0ZS9zaXRlMSJ9.JzbqVr6Brv1mAEvnbHnE-FuShos",
});
NOTE: By default,
BoldBI.Environment.Enterprise
is used for the Environment API member. For Cloud sites, you must set the Environment member value toBoldBI.Environment.Cloud
.
This method will load the widget of the current dashboard.
Example
var dashboard = BoldBI.create(options);
dashboard.loadWidget("Sales by country");
This method will be used to get an instance of that specific widget using its Id. To retrieve the widget details from a specific dashboard, please refer to this REST API.
Example
var dashboard = BoldBI.create(options);
var instance = BoldBI.getInstance("container"); // container -> embed container id
var widgetId = "2583540a-f970-41a1-9fc8-31c0581e7aa3"; // For getting widget ID, refer mentioned REST API in description.
var widgetInstance = instance.widget.getInstance(widgetId);
This method will remove the existing widget instance from the embedded widget. If you are using the widget.getInstance
method along with setFilterParameters
, and you subsequently want to destroy the instance, you can use this method.
Example
var instance = BoldBI.getInstance("container"); //container -> embed container id
instance.widget.dispose(widgetId); // widgetId ->Define the unique id of the widget.
This method will help you get the details of the widget in a clientFnc
method with arguments.
Example
var instance = BoldBI.getInstance("container"); //container -> embed container id
instance.widget.fetchData(widgetName, clientFnc, dashboardId); // widgetName ->Define the name of the widget to get data, clientFnc -> It acts as a method, in this method only details of the widget are passed in an argument. , dashboardId -> Define the unique id of the dashboard if it is present within the multitab dashboard.
This method will load multiple widgets of the current dashboard with a single instance call.
Example
<div id="dashboard"></div>
<div id="widget1" style="height:500px;width:500px"></div>
<div id="widget2" style="height:500px;width:500px"></div>
<div id="widget3" style="height:500px;width:500px"></div>
var dashboard = BoldBI.create({
dashboardId: "5cb065f7-dabb-4b0c-9b45-c60a5730e963",
embedContainerId: "dashboard",
widgetList: [{widgetName: "Medal details by Country", containerId: "widget1" },
{widgetName: "Total Medals by Country", containerId: "widget2" },
{widgetName: "Country", containerId: "widget3" }],
});
dashboard.loadWidgets();
Note: To embed the necessary widgets, the client application should create a container where the widgets will be displayed. Height and Width must be added within the widget container. We have enhanced the performance of loading multiple widgets in the javascript embedding. Please note that support will work and take effect if the embed SDK Wrapper and Bold BI Server are on the same version effectively from v8.1.41
This method will refresh the specific widgets within the current dashboard.
Example
var instance = BoldBI.getInstance("container"); //container -> embed container id
instance.widget.refresh(widgetNames, hideLoader, dashboardId); // widgetnames ->Define the name of the widget to be Refresh , hideLoader -> Define whether to show or hide loading indicator while processing , dashboardId -> Define the unique id of the dashboard if it is present within the multitab dashboard.
This method is used to update the dashboard with applied filter values in the On-Demand case. It can be used for any type of widget filtering cases.
Example for updating the widget filtered values in dashboard
var instance = BoldBI.getInstance("container");
var widgetId1 = "201ce4b3-f2f9-4a3b-98e7-05b5ba01f2ca";
var filtersValue1 = ["Feedback=Average,Good"]; //single column with filter values
instance.widget.getInstance(widgetId1).setFilters(filtersValue1);
var widgetId2= "32ed09f7-49ef-4468-9c56-ccc376dbcaaa";
var filtersValue2 = ["Product=Carnarvon Tigers","Company=Hanari Carnes"]; //multiple columns with filter values
instance.widget.getInstance(widgetId2).setFilters(filtersValue2);
instance.widget.updatefilters("container"); //container -> embed container id
Note: Please apply widget filters on both the initial rendering and on-demand in the dashboard using a web application. For more details, please refer to this documentation.
This method will add the comment widget to the corresponding widget on the dashboard.
Example for adding widget comment in normal dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
var addComment = {content: "Adding widget comment in normal dashboard", widgetId: "7d118d8c-cee9-479e-befc-d2a46abc9aa5", dashboardId: "f3968817-f3e0-4747-9d7a-d89a6098bb12"};
instance.viewer.addComment(addComment, "callBackFnc");
function callBackFnc(args) {
// It will return the updated comments in the widget as arguments.
// Write a code block to perform an operation while adding the widget comment in the normal dashboard.
}
Example for adding widget comment in multitab dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
var addComment = {content: "Adding widget comment in multitab dashboard", widgetId: "7d118d8c-cee9-479e-befc-d2a46abc9aa5", dashboardId: "f3968817-f3e0-4747-9d7a-d89a6098bb12", multitabDashboardId: "59c94463-0da5-4cf5-a5a5-cbc3ed901ad6"};
instance.viewer.addComment(addComment, "callBackFnc");
function callBackFnc(args) {
// It will return the updated comments in the widget as arguments.
// Write a code block to perform an operation while adding the widget comment in the multitab dashboard.
}
Example for replying widget comment in normal dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
var addComment = {content: "Replying widget comment in normal dashboard", widgetId: "7d118d8c-cee9-479e-befc-d2a46abc9aa5", dashboardId: "f3968817-f3e0-4747-9d7a-d89a6098bb12", parentCommentId: "4"};
instance.viewer.addComment(addComment, "callBackFnc");
function callBackFnc(args) {
// It will return the updated comments in the widget as arguments.
// Write a code block to perform an operation while replying the widget comment in the normal dashboard.
}
Example for replying widget comment in multitab dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
var addComment = {content: "Replying widget comment in multitab dashboard", widgetId: "7d118d8c-cee9-479e-befc-d2a46abc9aa5", dashboardId: "f3968817-f3e0-4747-9d7a-d89a6098bb12", parentCommentId: "4", multitabDashboardId: "59c94463-0da5-4cf5-a5a5-cbc3ed901ad6"};
instance.viewer.addComment(addComment, "callBackFnc");
function callBackFnc(args) {
// It will return the updated comments in the widget as arguments.
// Write a code block to perform an operation while replying the widget comment in the multitab dashboard.
}
Parameter | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
addComment |
object |
The object contains the following parameters.
|
||||||||||
callBackFnc |
string |
Denotes the callback method name that must be defined. It will return the updated comments in the widget as arguments. |
This method will delete the comment for the respective widget on the dashboard.
Example for deleting widget comment in normal dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
var deleteComment = {commentId: "6", widgetId: "7d118d8c-cee9-479e-befc-d2a46abc9aa5", dashboardId: "f3968817-f3e0-4747-9d7a-d89a6098bb12"};
instance.viewer.deleteComment(deleteComment, "callBackFnc");
function callBackFnc(args) {
// It will return the updated comments in the widget as arguments.
// Write a code block to perform an operation while deleting the widget comment in the normal dashboard.
}
Example for deleting widget comment in multitab dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
var deleteComment = {commentId: "6", widgetId: "7d118d8c-cee9-479e-befc-d2a46abc9aa5", dashboardId: "f3968817-f3e0-4747-9d7a-d89a6098bb12", multitabDashboardId: "59c94463-0da5-4cf5-a5a5-cbc3ed901ad6"};
instance.viewer.deleteComment(deleteComment, "callBackFnc");
function callBackFnc(args) {
// It will return the updated comments in the widget as arguments.
// Write a code block to perform an operation while deleting the widget comment in the multitab dashboard.
}
Parameter | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
deleteComment |
object |
The object contains the following parameters.
|
||||||||
callBackFnc |
string | Denotes the callback method name that must be defined. It will return the updated comments in the widget as arguments. |
This method will edit the comment of the respective widget on the dashboard.
Example for editing widget comment in normal dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
var editComment = {content: "Editing widget comment in normal dashboard", commentId: "5", widgetId: "7d118d8c-cee9-479e-befc-d2a46abc9aa5", dashboardId: "f3968817-f3e0-4747-9d7a-d89a6098bb12"};
instance.viewer.editComment(editComment, "callBackFnc");
function callBackFnc(args) {
// It will return the updated comments in the widget as arguments.
// Write a code block to perform an operation while editing the widget comment in the normal dashboard.
}
Example for editing widget comment in multitab dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
var editComment = {content: "Editing widget comment in multitab dashboard", commentId: "5", widgetId: "7d118d8c-cee9-479e-befc-d2a46abc9aa5", dashboardId: "f3968817-f3e0-4747-9d7a-d89a6098bb12", multitabDashboardId: "59c94463-0da5-4cf5-a5a5-cbc3ed901ad6"};
instance.viewer.editComment(editComment, "callBackFnc");
function callBackFnc(args) {
// It will return the updated comments in the widget as arguments.
// Write a code block to perform an operation while editing the widget comment in thbe multitab dashboard.
}
Parameter | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
editComment |
object |
The object contains the following parameters.
|
||||||||||
callBackFnc |
Denotes the callback method name that must be defined. It will return the updated comments in the widget as arguments. |
This method will retrieve the specific widget comments from the Bold BI Server.
Example for getting widget comments from normal dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
var args = {'widgetId': "7d118d8c-cee9-479e-befc-d2a46abc9aa5", 'dashboardId': "f3968817-f3e0-4747-9d7a-d89a6098bb12"};
var commentType= "widget";
instance.viewer.fetchComments(commentType, args, "callBackFnc");
function callBackFnc(args) {
// It will return the updated comments in the widget as arguments.
// Write a code block to perform an operation while getting the specific widget comment from the normal dashboard.
}
Example for getting widget comments from multitab dashboard
var instance = BoldBI.getInstance("container"); //container -> embed container id
var args = {'widgetId': "7d118d8c-cee9-479e-befc-d2a46abc9aa5", 'dashboardId': "f3968817-f3e0-4747-9d7a-d89a6098bb12", multitabDashboardId: "59c94463-0da5-4cf5-a5a5-cbc3ed901ad6"};
var commentType= "widget";
instance.viewer.fetchComments(commentType, args, "callBackFnc");
function callBackFnc(args) {
// It will return the updated comments in the widget as arguments.
// Write a code block to perform an operation while getting the specific widget comment from the multitab dashboard.
}
Parameter | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
commentType |
string |
Defines the type of the comment whether it is dashboard or widget . |
||||||
args |
object |
The object contains the following parameters.
|
||||||
callBackFnc |
string |
Denotes the callback method name that must be defined. It will return the updated comments in the dashboard as arguments. |
This method will export the widget as a CSV file.
Example
var instance = BoldBI.getInstance("container"); //container -> embed container
var exportInformation ={'dashboardId':"",'widgetName':"",'fileName':""};
instance.viewer.exportAsCSV(exportInformation);
Parameter | Description |
dashboardId |
Define the unique id of the dashboard if it is present within the multitab dashboard and the widget id if it is present within the pinboard. It is mandatory for the multitab dashboard, pinboard, and empty string for other cases. |
widgetName |
Define the name of the widget to be exported and it is a mandatory parameter of string type. |
fileName |
Define the name of the file to be exported, and it is an optional parameter of string type. |
This method will export the widget as an Excel file.
Example
var instance = BoldBI.getInstance("container"); //container -> embed container
var exportInformation ={'dashboardId':"",'widgetName':"",'fileName':"",'fileType':""};
instance.viewer.exportAsExcel(exportInformation);
Parameter | Description |
dashboardId |
Define the unique id of the dashboard if it is present within the multitab dashboard and the widget id if it is present within the pinboard. It is mandatory for the multitab dashboard, pinboard, and empty string for other cases. |
widgetName |
Define the name of the widget to be exported and its a mandatory parameter of string type. |
fileName |
Define the name of the file to be exported, and it is an optional parameter of string type. |
fileType |
Define the type of file to be exported ('xlsx','xls') and its an optional parameter of string type. |
This method will export the widget as an image.
Example
var instance = BoldBI.getInstance("container"); //container -> embed container
var exportInformation ={'dashboardId':"",'widgetName':"",'fileName':"",'exportImageFormat':"",'resolutionDpi':"",'showAppliedFilters':};
instance.viewer.exportAsImage(exportInformation);
Parameter | Description |
dashboardId |
Define the unique id of the dashboard if it is present within the multitab dashboard and the widget id if it is present within the pinboard. It is mandatory for the multitab dashboard, pinboard, and empty string for other cases. |
widgetName |
Define the name of the widget to be exported and its a mandatory parameter of string type. |
fileName |
Define the name of the file to be exported, and it is an optional parameter of string type. |
exportImageFormat |
Define the format of the image to be exported('jpg','png' and 'bmp') and its an optional parameter of string type. |
resolutionDpi |
Define the resolution of the image (Integer value above 96) and its an optional parameter of integer type. |
showAppliedFilters |
Define whether you need to export the dashboard with or without a filter information, and it is an optional parameter of Boolean type. |
This method will export widget as PDF.
Example
var instance = BoldBI.getInstance("container"); //container -> embed container
var exportInformation ={'dashboardId':"",'widgetName':"",'fileName':"",'pageSize':"",'pageOrientation':"",'showAppliedFilters':};
instance.viewer.exportAsPdf(exportInformation);
Parameter | Description |
dashboardId |
Define the unique id of the dashboard if it is present within the multitab dashboard and the widget id if it is present within the pinboard. It is mandatory for the multitab dashboard, pinboard, and empty string for other cases. |
widgetName |
Define the name of the widget to be exported and its a mandatory parameter of string type. |
fileName |
Define the name of the file to be exported, and it is an optional parameter of string type. |
pageSize |
Define the size of the page ('A3', 'A4', 'A5', 'Letter') and it is an optional parameter of string type. |
pageOrientation |
Define the page orientation ('Landscape,' 'Portrait'), and it is an optional parameter of string type. |
showAppliedFilters |
Define whether you need to export the dashboard with or without a filter information, and it is an optional parameter of Boolean type. |