cancel
Showing results for 
Search instead for 
Did you mean: 

Infochart.clearSelection(); ---> is this a bug?

former_member197738
Participant
0 Kudos

Hello Everyone,

Background Version DS1.6 SP3

I am working on this simple requirement where i have 2 column chart on top and detail cross-tab the the bottom.

Cross-tab get triggered from above 2 columns charts, that are independent and don't share filters through script across.

Issue

When user click on column of any chart, it is expected to 'clear the selection' from another chart, eliminating the confusion of dual selection.

In my observation, the moment i script to "clear selection" from other chart vise-versa, it looses the selection and reset the data-source with first click, with another click on same chart it gets registered.

Even thought the script is strictly encoded to clear selection from the other chart, for some reason it removes from the current as well. Seems like a bug to me so far.

Appreciate if you can shed some light on this, thanks

Please find below screenshot for further understanding.

clear-selection.png

Accepted Solutions (1)

Accepted Solutions (1)

arijit_das
Active Contributor
0 Kudos

As a workaround, you can try the following:

  • Create a global variable as below:

  • On-select event of INFOCHART_1:
if(gv_Counter == 2 || gv_Counter == 0){
    gv_Counter = 1;
    
    DS_1.clearFilter("STAT");
    DS_1.setFilter("CAT", INFOCHART_1.getSelectedMember("CAT"));

    if(INFOCHART_2.getSelectedMember("STAT").text.length == 0){
    
    }
    else{
        gv_Counter = 3;
        INFOCHART_2.clearSelection();
    }
}
else if(gv_Counter == 3){
    gv_Counter = 2;
}
else{
    DS_1.clearFilter("STAT");
    DS_1.setFilter("CAT", INFOCHART_1.getSelectedMember("CAT"));
}
  • On-select event of INFOCHART_2:
if(gv_Counter == 1 || gv_Counter == 0){
    gv_Counter = 2;
    
    DS_1.clearFilter("CAT");
    DS_1.setFilter("STAT", INFOCHART_2.getSelectedMember("STAT"));

    if(INFOCHART_1.getSelectedMember("CAT").text.length == 0){
    
    }
    else{
        gv_Counter = 3;
        INFOCHART_1.clearSelection();
    }
}
else if(gv_Counter == 3){
    gv_Counter = 1;
}
else{
    DS_1.clearFilter("CAT");
    DS_1.setFilter("STAT", INFOCHART_2.getSelectedMember("STAT"));
}
former_member197738
Participant
0 Kudos

Hi Das,

I tried with similar code, didn't work that time, before i script simple standard one i posted.

Your code worked flawless, thanks for sharing. I see now where my counter didn't work before 🙂

Answers (1)

Answers (1)

arijit_das
Active Contributor
0 Kudos

When you execute INFOCHART_01.clearSelection() then the on-select event of INFOCHART_01 is automatically triggered if there is already a selection.

I guess this is by design as the same behavior is observed in later versions as well.

former_member197738
Participant
0 Kudos

Hi Das thanks for your input.

I learned that to on other post related to .clearSelection (automatically triggered) the same script, which is still fine.

The problem is why it will trigger same chart "onclick" script, when the code strictly for the other chart "Info02.clearSelection.

script on info01 chart to trigger info02 chart, but it clear the selection from info01 as well. if thats by design seems to be a bug to me.

arijit_das
Active Contributor
0 Kudos

INFOCHART_02.clearSelection() is executed in on-select event of INFOCHART_01 which triggers the on-select event of INFOCHART_02. Now, in on-select event of INFOCHART_02, INFOCHART_01.clearSelection() is executed. Thus the recursive call continues until both charts have no selected item.