Advanced Dashboard Scripting
Certain Dashboard applications require a degree of flexibility that can only be achieved with programmatic logic. For example, you may need to hide or show certain Dashboard components under particular conditions, such as when a user’s selections return no data, or you might wish to present an alert message if a certain key indicator does not meet its target.
The Dashboard scripting environment allows you to easily implement such event-driven behavior. The scripting language is based on the popular JavaScript language (ECMA-262 standard). The following sections provide a short introduction to JavaScript, concentrating on the Dashboard environment and examples of common Dashboard scripting.
These sections are intended for advanced Dashboard designers who are familiar with programming concepts and languages.
-
Introduction to Programming: Basic JavaScript programming syntax and programming constructs such as loops, variables, and functions.
-
Add Script to a Dashboard: Describes the different places that you can add script to a Dashboard, at the Dashboard-level, component-level, or property-level.
-
Create a Custom Function: Create a reusable script function that can be accessed in any Dashboard.
-
Access Component Data: Access component values, such as Filter values, Table cell values, or KPI values, within a scripted expression. This allows you to adapt Dashboard properties or appearance in response to displayed data.
-
Access Datasource Data: Access and aggregate data from the Dashboard data source using scripted expressions.
-
Run a Query from Script: Retrieve data from an arbitrary Data Worksheet using a scripted expression.
-
Reference Query Data: Access the data retrieved by the
runQueryfunction in script. These techniques are mainly useful in Freehand Tables (see Create a Freehand Table). -
Special Freehand Table Functions: Special functions that are mainly useful when scripting a Freehand Table.
-
Change Images with Script: Use script to dynamically change the image in an Image component .
-
Dashboard Object Reference: Reference descriptions of all Dashboard properties that can be modified in script.