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.

Hover over an Analytical Control

Hide navigation
RSS
Modified on Tue, 14 May 2013 04:52 PM Categorized as OLAP, Script Library
Click to return to: Documentation | Dundas Dashboard Script Library


Overview

This article presents scripting examples related to hover over or mouse move interactions within an analytical control. The term “hover over” means moving the mouse to a location and then keeping it still for a short duration.

Hover over a cell in an analytical grid

This example shows how to handle when the user hovers over a cell in an analytical grid control.

Setup

  1. Create a virtual cube and define a report.
  2. Check in your virtual cube.
  3. Create a new analytical dashboard.
  4. Drag an Analytical Grid control from the toolbox to the canvas.
  5. Drag the virtual cube report from the toolbox and drop it over the analytical grid control.
  6. Save and preview the dashboard.

Script - AnalyticalGrid.Hover

Add the following script for the AnalyticalGrid1.Hover interaction:

// AnalyticalGrid1.Hover(sender, e) // sender is type StandaloneDashboardOlapDataGrid // e is type AnalyticalMouseEventArgs // e.VisualElementArgs is type DashboardDataGridCell or type DashboardDataGridRow // e.VisualElementArgs is null if user hovered over a row or column header // e.TargetCell is type AnalyticalCell

if ( e.VisualElementArgs != null ) { // Check if hover over a non-header cell. if ( e.TargetCell != null ) { services.ShowMessage("Hover cell value: " + e.TargetCell.FormattedValue); } }


To test the example, view the dashboard and hover over a grid cell.

Hover over a cell in an analytical grid.

Hover over a cell in an analytical grid.


See also:


Hover over different areas of an analytical combo

This example shows how to handle when the user hovers over different areas of an analytical combo control (both data and non-data areas like axes).

Setup

  1. Create a virtual cube and define a report.
  2. Check in your virtual cube.
  3. Create a new analytical dashboard.
  4. Drag the virtual cube report from the toolbox to the canvas; it will appear as an Analytical Combo control.
  5. Save and preview the dashboard.

Script - AnalyticalCombo.Hover

Add the following script for the AnalyticalCombo1.Hover interaction:

  1. UNSUPPORTED UNLIMITED
    // The above is needed because this is a long script.

    // AnalyticalCombo1.Hover(sender, e)
    // sender is type DashboardAnalyticalCombo
    // e is type AnalyticalMouseEventArgs
    // e.TargetObjectType is type AnalyticalObjectType

// Depending on the target object type, the precise kind // of event args is different. if ( e.TargetObjectType == AnalyticalObjectType.Axis ) { // e is type AnalyticalAxisEventArgs AnalyticalAxisEventArgs args = e; AnalyticalAxisType t = args.AxisType; services.ShowMessage("Hover over " + t.ToString() + " Axis"); } else if ( e.TargetObjectType == AnalyticalObjectType.Chart ) { // e is type AnalyticalOlapCellEventArgs if ( e.VisualElementArgs == null ) { services.ShowMessage("Hover over Chart"); } else { DashboardDataPoint dp = e.VisualElementArgs; services.ShowMessage("Hover over DataPoint with Y Value: " + dp.YValues0); } } else if ( e.TargetObjectType == AnalyticalObjectType.Combo ) { // Clicked somewhere else on the analytical combo. services.ShowMessage("Hover over Combo"); } else if ( e.TargetObjectType == AnalyticalObjectType.CubeTree ) { // e is type AnalyticalCubeTreeEventArgs AnalyticalCubeTreeEventArgs args = e; AnalyticalMetadataObject meta = args.MetadataObject; if ( meta == null ) { services.ShowMessage("Hover over CubeTree"); } else { services.ShowMessage("Hover over " + meta.Caption + " in CubeTree"); } } else if ( e.TargetObjectType == AnalyticalObjectType.Grid ) { // e is type AnalyticalOlapCellEventArgs AnalyticalOlapCellEventArgs args = e; if ( args.TargetCell == null ) { services.ShowMessage("Hover over Grid"); } else { AnalyticalCell cell = args.TargetCell; services.ShowMessage("Hover over Cell with Value: " + cell.FormattedValue); } }


To test the example, view the dashboard and hover over different parts of the analytical combo control.

Hover over different parts of the analytical combo.

Hover over different parts of the analytical combo.


See also:


Entering or leaving an analytical control

Use the Mouse Enter and Mouse Leave interactions to handle when the user moves the mouse into or out of an analytical control.

A possible use for these interactions is to display a help window when the user enters an analytical control.

Setup

  1. Create a virtual cube and define a report.
  2. Check in your virtual cube.
  3. Create a new analytical dashboard.
  4. Drag the virtual cube report from the toolbox to the canvas; it will appear as an Analytical Combo control.
  5. Save and preview the dashboard.

Script - AnalyticalCombo.MouseEnter

Add the following script for the AnalyticalCombo1.MouseEnter interaction:

// AnalyticalCombo1.MouseEnter(sender, e) // sender is type DashboardAnalyticalCombo // e is type AnalyticalMouseEventArgs

  1. TRACE("Mouse Enter");


To test the example, preview the dashboard, and then enable the Script Console. Move the mouse pointer into the area of the control and watch the trace window.

Script - AnalyticalCombo.MouseLeave

Add the following script for the AnalyticalCombo1.MouseLeave interaction:

// AnalyticalCombo1.MouseLeave(sender, e) // sender is type DashboardAnalyticalCombo // e is type AnalyticalMouseEventArgs

  1. TRACE("Mouse Leave");


To test the example, preview the dashboard, and then enable the Script Console. Move the mouse pointer into and then out of the area of the control and watch the trace window.

See also:


Moving the mouse

As you move your mouse across an analytical control, you can determine the exact position of the mouse using the Mouse Move interaction.

Setup

  1. Create a virtual cube and define a report.
  2. Check in your virtual cube.
  3. Create a new analytical dashboard.
  4. Drag the virtual cube report from the toolbox to the canvas; it will appear as an Analytical Combo control.
  5. Save and preview the dashboard.

Script - AnalyticalCombo.MouseMove

Add the following script for the AnalyticalCombo1.MouseMove interaction:

// AnalyticalCombo1.MouseMove(sender, e) // sender is type DashboardAnalyticalCombo // e is AnalyticalMouseEventArgs
  1. TRACE("Mouse Move");

// Absolute position of mouse.
  1. TRACE("PositionAbsolute: " + e.PositionAbsolute.ToString());

// Position of mouse relative to the top-left corner of the analytical combo.
  1. TRACE("PositionRelative: " + e.PositionRelative.ToString());


To test the example, preview the dashboard, and then enable the Script Console. Move the mouse pointer within the area of the control and watch the trace window.

See also:


Related topics


Click to return to: Documentation | Dundas Dashboard Script Library

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

Copyright © 2009-2014 Dundas Data Visualization, Inc.