Dashboard in Expression Language: Difference between revisions
Line 67: | Line 67: | ||
* '''Content''' (Dictionary): Dashboard content as dictionary. | * '''Content''' (Dictionary): Dashboard content as dictionary. | ||
Example: Change dashboard | Example: Change dashboard background color to white. | ||
<pre> | <pre> | ||
let dashboard = DashboardById(1); // find dashboard | let dashboard = DashboardById(1); // find dashboard | ||
let content = dashboard.content; // get | let content = dashboard.content; // get dashboard content | ||
content.Set(" | content.Set("backgroundColor", "#ffffff"; // modify content | ||
dashboard.Modify( // store | dashboard.Modify( // store modified content back to the dashboard | ||
#{"Content": content} | #{"Content": content} | ||
); | ); | ||
Line 82: | Line 82: | ||
dashboards.{ // loop through dashboards | dashboards.{ // loop through dashboards | ||
let content = _.content; // get dashboard content | let content = _.content; // get dashboard content | ||
content["variables].Remove("Filter"); // modify | content["variables].Remove("Filter"); // modify content | ||
_.Modify( // store | _.Modify( // store modified content back to the dashboard | ||
#{"Content": content} | #{"Content": content} | ||
); | ); |
Revision as of 16:55, 28 October 2023
In QPR ProcessAnalyzer, dashboard consists of a canvas where charts and other visualization components can be added. Each dashboard belongs to project. Dashboards have a mandatory name and optional identifier. The identifier is used when creating links between dashboards.
Dashboard properties
Dashboard objects in the expression language have the following properties:
Property | Description |
---|---|
Content (Dictionary) | Returns dashboard content (charts and other components contained by the dashboard). |
CreatedBy (User) | Returns user who created the dashboard. |
CreatedDate (DateTime) | Returns date when the dashboard was created. |
Description (String) | Returns description text of the dashboard. |
Id (Integer) | Returns id of the dashboard. |
Identifier (String) | Returns identifier of the dashboard. |
LastModifiedBy (User) | Returns user who last modified this dashboard. |
LastModifiedDate (DateTime) | Returns date when the dashboard was last time modified. |
Name (String) | Returns the name of the dashboard. |
Project (Project) | Returns project object where the dashboard belongs to. |
ProjectId (Integer) | Returns project id where this dashboard belongs to. |
Diagram functions
Dashboard objects in the expression language have the functions described below. To create new dashboards, use function Model.CreateDashboard(), and to list existing dashboards, use property Project.Dashboards.
Function | Parameters | Description |
---|---|---|
DeletePermanently | Deletes the dashboard permanently. EditDashboards permission to the project is required.
Example: delete all dashboards in a project: ProjectById(1).Dashboards.DeletePermanently() | |
Modify |
Modifies the dashboard. The parameter is a dictionary containing dashboard properties to be updated. EditDashboards permission to the project is required. Following properties are supported:
Example: Change dashboard background color to white. let dashboard = DashboardById(1); // find dashboard let content = dashboard.content; // get dashboard content content.Set("backgroundColor", "#ffffff"; // modify content dashboard.Modify( // store modified content back to the dashboard #{"Content": content} ); Example: Remove dashboard variable from all dashboards in project. let dashboards = ProjectById(1).Dashboards; dashboards.{ // loop through dashboards let content = _.content; // get dashboard content content["variables].Remove("Filter"); // modify content _.Modify( // store modified content back to the dashboard #{"Content": content} ); }; |
Function to get diagram by dashboard id:
Function | Parameters | Description |
---|---|---|
DashboardById |
|
Returns dashboard by the given dashboard id. Returns the Dashboard object if such is found. Throws an exception if dashboard doesn't exist or user doesn't have permissions to it. GenericRead permission to the project that contains the dashboard is required. |