This should help you get started,
https://www.dundas.com/Support/developer/script-library/data/get-click-or-interactive-data
That shows you how to capture the click event of clicking on one of the waste streams in the pie chart.
Then depending on what kind of filter parameter you have on the second chart you can then use that to filter the second chart, see these examples to find the best match:
https://www.dundas.com/Support/developer/script-library/filter-and-parameter/
here is one of my scripts that changes the filter on a table:
debugger;
var args = dundas.Utility.getAdapterHitTestArguments(e.originalEvent, managementEffectivenessPieChart); // Handles touch, zooming, etc.
var result = managementEffectivenessPieChart.control.hitTest(args.offsetX, args.offsetY, args.target);
if (result && result.point) {
var status = result.point.xValues[0];
// var value = result.point.yValues[0]; // might be needed
var baseViewService = this.getService(“BaseViewService”);
var myParameter = baseViewService.currentView.control.viewParameters.filter(function(item) {
return item.name === “YOUR_ViewParameter”;
})[0];
myParameter.parameterValue.clearValues();
myParameter.parameterValue.clearTokens();
// what came out was not same as what was to go in so I did a switch statement, this was done early into my dundas careerer, I bet there is an easier way
switch(status.toString())
{
case “Green.Overall”:
var filterValue = new dundas.data.MemberValue({
hierarchyUniqueName: “Overall”,
levelUniqueName: “Overall”,
uniqueName: “Green.Overall”
});
break;
case “Blue.Overall”:
var filterValue = new dundas.data.MemberValue({
hierarchyUniqueName: “Overall”,
levelUniqueName: “Overall”,
uniqueName: “Blue.Overall”
});
break;
case “Yellow.Overall”:
var filterValue = new dundas.data.MemberValue({
hierarchyUniqueName: “Overall”,
levelUniqueName: “Overall”,
uniqueName: “Yellow.Overall”
});
break;
case “Red.Overall”:
var filterValue = new dundas.data.MemberValue({
hierarchyUniqueName: “Overall”,
levelUniqueName: “Overall”,
uniqueName: “Red.Overall”
});
break;
}
myParameter.parameterValue.token = null;
myParameter.parameterValue.values.length = 0;
myParameter.parameterValue.values.push(filterValue);
myParameter.refreshAllAdapters();
}