Hi Mohd,
The reason behind your issue is that when a user clicks outside the donut chart in the chart area, the getSelectedMember() call in the "On Select" event of the chart returns "(ALL_MEMBERS)" as this triggers a "deselection" and your subsequent setFilter() call therefore returns all measures in the second chart, as illustrated below:
Single Selection:
Deselection:
So to workaround the above behaviour, in the "On Select" event of your donut chart you could wrap your setFilter() call in an if-then statement so that you only execute the filter if the selection value is NOT "(ALL_MEMBERS)". Your code would look something like this:
var selectedItem = me.getSelectedMember("<DIMENSION NAME>"); if (selectedItem.internalKey !== "(ALL_MEMBERS)") { DS_2.setFilter("<DIMENSION NAME>", selectedItem); }
The only side-effect is that the donut chart will still appear in a de-selected state when the user clicks outside the chart area or clicks the same donut chart segment that is currently selected, which might seem confusing to the user but this could just be a matter of training, or perhaps you could maintain the selected state with CSS.
Regards,
Mustafa.
Mohd- could you put your donut chart inside a panel/grid and that way navigation outside that area doesn't impact your application?
please see below video, thanks
Add comment