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.

Drill Down on a Legend Item

Hide navigation
RSS
Modified on Fri, 31 Aug 2012 04:48 PM Categorized as Legend, Script Library
&dw; Script LibraryPrevious


Use this script to pass the legend text of a legend item as a parameter for a drill down. Don’t forget to change the GUID of the target dashboard.

Note: This script gets attached to the LegendClick interaction of your Legend.

Script

Without passing parameters

If the filter's underlying KPI accepts the text in the Legend:

// Create a new parameter info collection. This is what is used to pass // parameters from one dashboard to another. It's similar to how a // querystring works. ParameterInfoCollection params = new ParameterInfoCollection(); ParameterInfo param = new ParameterInfo();

// Set the target parameter name. This is the parameter on the new // dashboard which will be affected by these settings. param.ParameterName = "Parameter1";

// Add the legend text to the start collection so it goes to the parameter. param.FilterValues.Add(new DashboardFilterValueData()); param.FilterValues[0].SingleValue = e.ParentControlElements[0].LegendText;

// Add this 1 parameter into the parameterinfocollection. params.Add(param);

// Use the services to navigate to the new dashboard, giving it the // parameterinfocollection so that it can set the values. services.NavigateToDashboard("27300102-ad8a-4168-9a15-b4c62dfb9929",params);


Passing parameters

If you need to pass a parameter along to the filter's underlying KPI:

// Create a new parameter info collection. This is what is used to pass // parameters from one dashboard to another. It's similar to how a // querystring works. ParameterInfoCollection params = new ParameterInfoCollection(); ParameterInfo param = new ParameterInfo();

// Set the target parameter name. This is the parameter on the new // dashboard which will be affected by these settings. param.ParameterName = "Parameter1";

// Add the legend text to the start collection so it goes to the parameter. param.FilterlessValue.Add(e.ParentControlElements[0].LegendText);

// Add this 1 parameter into the parameterinfocollection. params.Add(param);

// Use the services to navigate to the new dashboard, giving it the // parameterinfocollection so that it can set the values. services.NavigateToDashboard("27300102-ad8a-4168-9a15-b4c62dfb9929",params);


Then in the receiving dashboard, attach this to the OnLoad interaction:

if (Parameter1.FilterlessValue.Count > 0) { services.ShowMessage(Parameter1.FilterlessValue[0].ToString()); }

Related topics


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

Copyright © 2009-2014 Dundas Data Visualization, Inc.