Version

Configuring the RevealView Object

Overview

The $.ig.RevealView component can be instantiated while passing the $.ig.RevealSettings object as a parameter.

The $.ig.RevealSettings object can be used to enable or disable different features towards the end user, including:

  • Showing/Hiding UI Elements - The showFilters property is read by $.ig.RevealView during initialization time and based on its value either shows or hides the Global Filters UI to the user. Other similar properties are _showExportImage, canEdit, showChangeDataSource, and maximizedVisualization.

  • Specifying a Dashboard - The dashboard property is used to specify which dashboard should be rendered. As shown in Instantiating the Web Client SDK, the dashboard must be retrieved by using the $.ig.RevealUtility.loadDashboard method, which receives a dashboardId and a success callback called when the dashboard is loaded.

  • Selecting Global Filter values - You can specify which values are initially selected for existing Global Filters when loading a dashboard.

Code

The following code snippet illustrates how to load a dashboard “AppsStats”. By setting the “application_name” global filter’s selected value to be “App2”, the dashboard will be showing data filtered by “App2”.

var dashboardId = "AppsStats";
var revealSettings = new $.ig.RevealSettings(dashboardId);

$.ig.RevealUtility.loadDashboard(dashboardId, function (dashboard) {
    revealSettings.dashboard = dashboard;

    var applicationNameFilter = dashboard.getFilterByTitle("application_name");
    revealSettings.setFilterSelectedValues(applicationNameFilter, ["App2"]);

    window.revealView = new $.ig.RevealView("#revealView", revealSettings);
}, function (error) {
});

About Timing

$.ig.RevealView applies $.ig.RevealSettings during initialization time, which is a particular time before the dashboard is displayed on screen. This has several implications:

  • If you change the settings object after the dashboard is rendered, it will not affect the already loaded dashboard.

  • You can, however, change the selected values for dashboard filters after the view was created. To do that you need to use the setFilterSelectedValues method in the $.ig.RevealView object.

  • Any change for properties in the $.ig.RevealSettings object (like canEdit, canSaveAs, etc) requires the creation of a new instance of $.ig.RevealView.