Skip to Content
avatar image
Former Member

replace multiple dimensions in different charts

Hello All,

I have searched this topic, but wasn't able to find a proper answer.

I have a datasource with four dimensions(rows) and multiple measures(columns). I have four chart types like line, bar etc. Each chart has same dimension but with a different measure. I am trying to put a dropdown or listbox which contains list of four dimension names like dim1, dim2, dim3 and dim4. I will select or choose dim1 from dropdown and should reflect the data in all four charts with the same dim1.

If i choose dim3, it should reflect the data in all four charts with dim3 and so on. i do not want to use navigation panel/filter panel component. i have tried some scripting but did not work fully. any ideas? thanks for your help.

regards, baggi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 03, 2017 at 07:48 AM

    Hi Baggi,

    Your requirement can be implemented with the following steps:

    1. In the data source Initial View, make sure you have only the default dimension in the Rows pane and the measures in the columns, as shown in the example below:

    2. Define a Global Script Variable of type String named vCurrentDim;

    3. Define your Dropdown Box items to include your dimension value/text pairs as shown below:

    4. Apply the following script code in the "On Startup" event of the application:

    var myRowDims = DS_1.getDimensions(Axis.ROWS);
    var myRowDim = myRowDims.pop();  // Assume only one dimension in row axis
    vCurrentDim = myRowDim.name;
    
    DROPDOWN_1.setSelectedValue(vCurrentDim);
    

    5. Apply the following script code in the "On Select" event of your Dropdown Box:

    var newDim = me.getSelectedValue();
    DS_1.swapDimensions(newDim, vCurrentDim);
    vCurrentDim = newDim;
    

    6. The result looks like this:

    Changing the dropdown selection should update the chart dimension axes accordingly.

    Regards.

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 03, 2017 at 01:22 PM

    Hi Mustafa,

    Thanks for the quick reply. ds_1 initialview image contain all measures, have you used same ds_1 or multiple datasources to show different measur?. I selected toggle members(measures) to show different measurs on charts. regards,baggi

    Add comment
    10|10000 characters needed characters exceeded