416.467.9100 | Dundas Data Visualization | Login
Welcome Guest
This is the support page for the legacy Dundas Dashboard application. For assistance with the current Dundas BI application please click here.
Dashboard v5.0

This site makes extensive use of JavaScript.

Please enable JavaScript in your web browser and reload the page before proceeding.

Overview of the Interactions and Events used for Scripting

Hide navigation
RSS
Modified on Wed, 09 Jul 2014 09:18 AM Categorized as Chart, Data Controls, Data Grid, Export, Level-Beginner, Parameter Controls, Parameters, Script Library, Scripting

Overview

This article provides an overview on the various interactions/events associated with the dashboard and the data controls and will help in understanding which event is fired at what time and in what order. This will make it easier to understand what script to call in what interaction and will also help in designing the dashboard with client side performance in mind.

Sample Project

To make it easier to observe the events, download and import this sample project to your instance: Interactions Overview

The project uses a simple bar chart and a data grid, both of which are filtered using their respective parameters. The execution of the interactions is traced using the #TRACE directive with the related interaction name displayed in the script console. ⪚

  1. TRACE "Dashboard: Load Interaction";


Image

For more information on the #TRACE directive and the script console see these links:
Tip: Follow the steps below and refer to the definitions of each interaction in the following section.

Steps to use the project:
  • Import the sample project using the project manager.
  • Edit the Interactions dashboard and preview it.
  • Check the script console to see all the interactions that run on load.
  • Change the Parameter_BarChart and check the script console to see all the interactions that run on a parameter change for a bar chart.
  • Change the parameter Parameter_DataGrid and check the script console to see all the interactions that run on a parameter change for a data grid.
  • Right click on either the canvas, the chart or the data grid to see the context click interaction.
  • Select Export to see the interactions run while exporting.
  • Select Print to see the interactions run while printing.

Note: The Mouse Move interactions have been disabled in this project because they are executed on every movement of the cursor and clutter the script console. Uncomment the trace script to see how it works in the script console.


Interactions

The following interactions and events are available to the controls. This list covers the interactions for the dashboard canvas, bar chart and the data grid. These interactions are common among all the controls to a large extent. Some controls may not have certain interactions or some may have interactions specific to that control (e.g. Timer control &etc;). Refer to the properties library of the specific control to get a full list: Data visualization controls

Dashboard Canvas

Interaction List
The scripted interactions that can be called by other scripts with the services.RunDashboardInteraction() call.

Load
The Load interaction lets you set up your dashboard when it has finished loading. When this script is called, all dashboard elements and controls have been created and initialized, although they haven't been displayed on-screen yet.

Parameter Changed
The Parameter Changed interaction lets you respond to parameter changes. This occurs after a parameter has changed and all updates have occurred to associated objects.

Parameter Changing
The Parameter Changing interaction lets you respond to parameter changing events. This occurs after a parameter has changed but before all updates have occurred to associated objects which allows cancelling the update or changing the values.

ContextClick
The ContextClick interaction lets you respond to context click (right mouse button up) events on the canvas.

Unload
The Unload interaction lets you respond when the dashboard is unloaded (e.g. user navigates away from the dashboard).

Exported
The Exported interaction lets you respond after the dashboard has been exported. For example, you can write a script to restore the original appearance of controls on the dashboard (which you previously changed via the Exporting interaction).

Exporting
The Exporting interaction lets you respond before the dashboard has been exported. For example, you can write a script that temporarily changes the background color of a control for export purposes, or hides interactive elements such as buttons from the exported image. Note that it is your responsibility to restore the original appearance of controls via the Exported interaction.

Printed
The Printed interaction lets you respond after the dashboard has been printed. For example, you can write a script to restore the original appearance of controls on the dashboard (which you previously changed via the Printing interaction).

Printing
The Printing interaction lets you respond before the dashboard has been printed. For example, you can write a script that temporarily changes the background color of a control for printing purposes, or hides interactive elements such as buttons from the printed dashboard. Note that it is your responsibility to restore the original appearance of controls via the Printed interaction.

SizeChanged
The SizeChanged interaction lets you respond when the viewer resizes this dashboard. You can get the actual (resized) size of the dashboard from the sender argument:

// Use code below in a script for the SizeChanged interaction. string s = "new size: " + sender.ActualWidth + " x " + sender.ActualHeight; ...

Or, use the following code which can also be applied outside of SizeChanged interations:

string s = "new size: " + services.CurrentDashboard.ActualWidth + " x " + services.CurrentDashboard.ActualHeight;

Chart

Click
The Click interaction lets you respond to mouse clicks on the control.

Context Click
The Context Click interaction lets you respond when the right mouse button is released. This interaction is also used to call up the context menu.

Hover
The Hover interaction lets you respond to the user “hovering” their mouse over the control.

Axis Updated
The Axis Updated interaction lets you respond to changes to the data displayed along an axis and its scales.
ImageThis is an Advanced property.

Tip: This interaction can also be set on an axis directly: use the Updated Interaction on the axis. On the chart, this interaction fires once for each axis on the chart that displays data that has changed, including both X and Y axes, so use the Axis property of e to check which axis is updating.

This interaction can be triggered by changes in the values of data points or the number of data points, and happens after a short delay to ensure that all data point changes are handled together efficiently. The following properties may have changed automatically when this interaction is triggered, which can be accessed in script:
The IsUpdatePending property of DashboardAxis can be used to determine if this interaction has yet to be triggered.

Chart Cursor User Changed
The Chart Cursor User Changed interaction lets you respond once the user has interactively changed the chart cursor using the mouse. This interaction is triggered when the mouse button is released.
ImageThis is an Advanced property.

Chart Cursor User Changing
The Chart Cursor User Changing interaction lets you respond as the user interactively changes the chart cursor using the mouse. This interaction is triggered while the mouse button is pressed.
ImageThis is an Advanced property.

Mouse Enter
The Mouse Enter interaction lets you respond to the user moving the mouse into the control's area.
ImageThis is an Advanced property.

Mouse Leave
The Mouse Leave interaction lets you respond to the user moving the mouse out of the control's area.
ImageThis is an Advanced property.

Note: The Mouse Leave event occurs whenever the mouse is no longer directly over the control. For example, if you displayed a message (via the services.ShowMessage method) that appeared under the mouse, the Mouse Leave event would occur even though the mouse hasn't moved.

Mouse Move
The Mouse Move interaction lets you respond to mouse movements in the control's area.
ImageThis is an Advanced property.

Mouse Right Down
The Mouse Right Button Down interaction lets you respond when the right mouse button is pressed on the control.
ImageThis is an Advanced property.

Mouse Up
The Mouse Up interaction lets you respond when the left mouse button is released on the control.
ImageThis is an Advanced property.

On Data Changed
The On Data Changed interaction lets you respond to changes in the control's underlying data.

These interactions run when the data changes in this data visualization control. This could be from a parameter change, or a real-time update. The real-time updates will cause this interaction to fire on the timer, regardless of whether the actual data changed.

Tip: On Data Changed happens only once per update, not once per changed data point. It will also happen if the values did not change.

ImageThis is an Advanced property.

On Layout Updated
The On Layout Updated interaction lets you respond when the layout is updated in the control.

This interaction fires in the same scenarios as the On Data Changed interaction with the exception that it is fired after the control has processed the updated data.
ImageThis is an Advanced property.

Viewport User Changed
The Viewport User Changed interaction lets you respond to the user's interactive changes to the chart's viewport by zooming or scrolling.
ImageThis is an Advanced property.

Data Grid

Click
The Click interaction lets you respond to mouse clicks (e.g. left mouse button down) on the data grid.

Context Click
The Context Click interaction lets you respond to context click events (e.g. right mouse button up) on the data grid.

Hover
The Hover interaction lets you respond to the user “hovering” their mouse over the data grid.

Group Description Collection Changed
The Group Description Collection Changed interaction lets you know when the group description collection has changed.
ImageThis is an Advanced property.

Mouse Enter
The Mouse Enter interaction lets you respond to the user moving the mouse into the data grid's area.
ImageThis is an Advanced property.

Mouse Leave
The Mouse Leave interaction lets you respond to the user moving the mouse out of the data grid's area.
ImageThis is an Advanced property.

Note: The Mouse Leave event occurs whenever the mouse is no longer directly over the control. For example, if you displayed a message (via the services.ShowMessage method) that appeared under the mouse, the Mouse Leave event would occur even though the mouse hasn't moved.

Mouse Move
The Mouse Move interaction lets you respond to mouse movements in the data grid's area.
ImageThis is an Advanced property.

Mouse Right Down
The Mouse Right Down interaction lets you respond to right mouse button down events in the data grid.
ImageThis is an Advanced property.

Mouse Up
The Mouse Up interaction lets you respond to the user releasing the mouse over the control's area.
ImageThis is an Advanced property.

On Data Changed
The On Data Changed interaction lets you respond to changes in the data grid's underlying data.

These interactions run when the data changes in this data visualization control. This could be from a parameter change, or a real-time update. The real-time updates will cause this interaction to fire on the timer, regardless of whether the actual data changed.
ImageThis is an Advanced property.

On Layout Updated
The On Layout Updated interaction lets you respond when the layout is updated in this data visualization control. It is fired in the same scenarios as the On Data Changed Interactions with the exception that it is fired after the control has processed the updated data.
ImageThis is an Advanced property.

Page Index Changed
The Page Index Changed interaction lets you respond when the current page has changed in the data pager.
ImageThis is an Advanced property.

Row Loaded
The Row Loaded interaction lets you respond to the loading of a data grid row.
ImageThis is an Advanced property.

Note: Row Loaded Interaction will fire for each row loaded on the DataGrid. If DataGrid height is zero, or if the DataGrid is hidden, or there's not enough space to display a single row, this Interaction will not get fired at all.

Row Unloaded
The Row Unloaded interaction lets you respond to the unloading of a data grid row.
ImageThis is an Advanced property.

Selection Changed
The Selection Changed interaction lets you know when the selection has changed in the data grid.
ImageThis is an Advanced property.



Related Topics

About Dundas | Contact Us Follow us on Twitter! | Privacy Statement | Report Site Issues

Copyright © 2009-2014 Dundas Data Visualization, Inc.