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.

Clicking on Analytical Controls

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


Overview

This article presents scripting examples related to clicking or dragging within an analytical control.

Click on a cell in an analytical grid

This example shows how to handle when the user clicks on 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.Click

Add the following script for the AnalyticalGrid1.Click interaction:

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

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


To test the example, view the dashboard and click on a grid cell.

Clicking on a cell in an analytical grid.

Clicking on a cell in an analytical grid.


See also:


Switch between chart and grid view

This example shows how to handle when the user switches between chart and grid view by clicking on the tabs in an analytical combo control.

A possible use for this interaction is to update other data visualizations on your dashboard when the view is changed. For example, you can change the dashboard to show all grid controls instead of chart controls when the grid view is selected.

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.TabChanged

Add the following script for the AnalyticalCombo1.TabChanged interaction:

// AnalyticalCombo1.TabChanged(sender, e) // sender is type DashboardAnalyticalCombo // e is type AnalyticalControlEventArgs

if ( e.ChangeType == AnalyticalControlChangeType.ChartActivated ) { services.ShowMessage("Chart clicked!"); } else if ( e.ChangeType == AnalyticalControlChangeType.GridActivated ) { services.ShowMessage("Grid clicked!"); }


To test the example, view the dashboard and click on the grid or chart tab.

Switching tabs in an analytical combo control.

Switching tabs in an analytical combo control.


See also:


Click different areas of an analytical combo

This example shows how to handle when the user clicks on 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.Click

Add the following script for the AnalyticalCombo1.Click interaction:

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

    // AnalyticalCombo1.Click(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("Clicked " + t.ToString() + " Axis"); } else if ( e.TargetObjectType == AnalyticalObjectType.Chart ) { // e is type AnalyticalOlapCellEventArgs if ( e.VisualElementArgs == null ) { services.ShowMessage("Clicked Chart"); } else { DashboardDataPoint dp = e.VisualElementArgs; services.ShowMessage("Clicked DataPoint with Y Value: " + dp.YValues0); } } else if ( e.TargetObjectType == AnalyticalObjectType.Combo ) { // Clicked somewhere else on the analytical combo. services.ShowMessage("Clicked Combo"); } else if ( e.TargetObjectType == AnalyticalObjectType.CubeTree ) { // e is type AnalyticalCubeTreeEventArgs AnalyticalCubeTreeEventArgs args = e; AnalyticalMetadataObject meta = args.MetadataObject; if ( meta == null ) { services.ShowMessage("Clicked CubeTree"); } else { services.ShowMessage("Clicked " + meta.Caption + " in CubeTree"); } } else if ( e.TargetObjectType == AnalyticalObjectType.Grid ) { // e is type AnalyticalOlapCellEventArgs AnalyticalOlapCellEventArgs args = e; if ( args.TargetCell == null ) { services.ShowMessage("Clicked Grid"); } else { AnalyticalCell cell = args.TargetCell; services.ShowMessage("Clicked Cell with Value: " + cell.FormattedValue); } }


To test the example, view the dashboard and click on different parts of the analytical combo control.

Click on different parts of the analytical combo.

Click on different parts of the analytical combo.


See also:


Drag and drop objects within an analytical combo

This example shows how to handle when the user drags or drops an object such as a measure or dimension within an analytical combo control.

A possible use for these interactions is to update other controls on your dashboard when new dimensions or measures are dragged onto axes. (For example, your analytical control may be housed in a dashblock and placed on the same dashboard as some performance controls.)

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.Drag

Add the following script for the AnalyticalCombo1.Drag interaction:

// AnalyticalCombo1.Drag(sender, e) // sender is type DashboardAnalyticalCombo // e is type AnalyticalDragDropEventArgs AnalyticalDragDropEventArgs args = e;

// MetadataObject is the object being dragged. AnalyticalMetadataObject meta = args.MetadataObject;
  1. TRACE("Dragging object: " + meta.Caption);


To test the example, preview the dashboard, and enable the Script Console. This lets you see trace messages. Drag an item from the Cube Tree to see the messages in the trace window.

Drag an object within an analytical combo.

Drag an object within an analytical combo.


Script - AnalyticalCombo.Drop

Add the following script for the AnalyticalCombo1.Drop interaction:

// AnalyticalCombo1.Drop(sender, e) // sender is type DashboardAnalyticalCombo // e is type AnalyticalDragDropEventArgs AnalyticalDragDropEventArgs args = e;

// MetadataObject is the object being dropped. AnalyticalMetadataObject meta = args.MetadataObject; services.ShowMessage("Drop object: " + meta.Caption);

// args.TargetObject is type DashboardOlapAxisManager.


To test the example, view the dashboard, and then drag a measure from the Cube Tree and drop it on the Measures Axis.

Drop an object within an analytical combo.

Drop an object within an analytical combo.


Click on a paging control

This example shows how to handle when the user clicks on a paging control to go to another page. The CellSetChanging and CellSetChanged interactions are called when a new page is loaded. You can retrieve the current page (cellset) as well as figure out the current page number and other paging information.

Setup

  1. Create a virtual cube and define a report.
  2. Set up your report so that there will be enough data in the grid for paging to be enabled automatically on the categorical axis.
  3. Check in your virtual cube.
  4. Create a new analytical dashboard.
  5. Drag the virtual cube report from the toolbox to the canvas; it will appear as an Analytical Combo control.
  6. Save and preview the dashboard.

Script - AnalyticalCombo.CellSetChanged

Add the following script for the AnalyticalCombo1.CellSetChanged interaction:

// AnalyticalCombo1.CellSetChanged(sender, e) // sender is type DashboardAnalyticalCombo // e is type AnalyticalCellSetChangedEventArgs

// Get the cellset for this page. AnalyticalCellSet cellset = e.CellSet;

// Get the first cell in this cellset. int categoricalAxisIndex = 1; int seriesAxisIndex = 0; AnalyticalCell cell = cellset.Get(categoricalAxisIndex, seriesAxisIndex);

// Get the current page size and page number. int pageSize = AnalyticalCombo1.Report.PagingInfo.CategoricalPageSize; int pageNum = AnalyticalCombo1.Report.PagingInfo.CategoricalStart / pageSize + 1;

string msg = "CellSet changed\nFirst cell is: " + cell.FormattedValue + "\n"; msg += "Page size: " + pageSize.ToString() + "\n"; msg += "Page number: " + pageNum.ToString(); services.ShowMessage(msg);


To test the example, view the dashboard, and then use the paging control to navigate between pages.

Clicking on the next page.

Clicking on the next page.


See also:


Click on a data point and change its appearance

This example shows how to handle when the user clicks on a data point. Within the click interaction, the properties of the data point can be modified, including appearance settings.

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.Click

Add the following script for the AnalyticalCombo1.Click interaction:

// AnalyticalCombo1.Click(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.Chart ) { // e is type AnalyticalOlapCellEventArgs if ( e.VisualElementArgs == null ) { services.ShowMessage("Clicked Chart"); } else { // Get the data point that was clicked. DashboardDataPoint dp = e.VisualElementArgs; // Change the appearance of the data point. dp.Fill = new DashboardSolidColorBrush(Color.FromString("Red")); dp.StrokeThickness = 3; dp.Stroke = new DashboardSolidColorBrush(Color.FromString("Cyan")); } }


To test this example, view the dashboard. Click on a data point in the chart view and see it change color.

Click on a data point to change its appearance.

Click on a data point to change its appearance.


See also:


Click on a data point and get its dimension values

This example shows how to handle when the user clicks on a data point. Within the click interaction, you can get the value of the data point (&ie; measure) and its dimensions.

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.Click

Add the following script for the AnalyticalCombo1.Click interaction:

// AnalyticalCombo1.Click(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.Chart ) { // e is type AnalyticalOlapCellEventArgs if ( e.VisualElementArgs == null ) { services.ShowMessage("Clicked Chart"); } else { // Get the data point that was clicked and its value. DashboardDataPoint dp = e.VisualElementArgs; string dvalue = dp.YValues0.ToString(); // Highlight the border of the data point. dp.StrokeThickness = 3; dp.Stroke = new DashboardSolidColorBrush(Color.FromString("Red")); // Get the dimension member. AnalyticalOlapCellEventArgs cellEventArgs = e; AnalyticalCell cell = cellEventArgs.TargetCell; AnalyticalMetadataObject meta = cell.CategoricalTuple.MemberCollection0; // Display info about data point. services.ShowMessage("UniqueName=" + meta.UniqueName + ", Caption=" + meta.Caption + ", Value=" + dvalue); } }


To test this example, view the dashboard, and then click on a data point in the chart view.

Click on a data point to see its info.

Click on a data point to see its info.


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.