Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 31 at 09:42 AM

    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"));
    }
    
    Add comment
    10|10000 characters needed characters exceeded

    • 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 :-)

  • Jan 30 at 08:59 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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.