Hi Kris,
Here is another piece of code that I found usefull in some ocasions. The script is about a click on a category on a pie chart that, depending on the category name jumps to different dashboards.
var args = dundas.Utility.getAdapterHitTestArguments(e.originalEvent, chart1); // Handles touch, zooming, etc.
var result = chart1.control.hitTest(args.offsetX, args.offsetY, args.target);
/**************************************************************
Navigation
**************************************************************/
var url = '';
//var siteUrl = "Dashboard/";
var siteUrl = "";
// navigation object
var navigation = new dundas.view.NavigateAction();
// opens the target in the same window; use NEW_WINDOW to open it in a new window
navigation.actionTarget = dundas.view.ActionTarget.SAME_WINDOW;
// specifies that it will navigate to a URL
navigation.navigateType = dundas.view.DataActionNavigateType.URL;
if (result && result.point) {
var tipocons = result.point.xValues[0];
var value = result.point.yValues[0];
switch(tipocons.toString())
{
case "DIVERSOS.tipo_consumo":
//url = "c229df6e-d393-4d57-973f-fb4e2b03b679?e=false&vo=viewonly";
url = "c229df6e-d393-4d57-973f-fb4e2b03b679";
break;
case "UNIDADES ORGĂNICAS.tipo_consumo":
url = "fd411302-dd9e-427e-bce8-e12aac48c3b5";
break;
case "OBRAS.tipo_consumo":
url = "01a0099f-b029-4144-9d5d-f6f88bfc96ae";
break;
case "MĂQUINAS.tipo_consumo":
url = "df7fdd3c-b3e7-45b4-b001-138ecf63415b";
break;
}
// URL for another dashboard, change it to your own dashboard URL
navigation.targetUrl = siteUrl + url;
navigation.execute(new dundas.view.ActionEventArgs());
}
Luis