cancel
Showing results for 
Search instead for 
Did you mean: 

replace multiple dimensions in different charts

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor

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.

Answers (1)

Answers (1)

Former Member
0 Kudos

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

MustafaBensan
Active Contributor
0 Kudos

Hi,

My example uses a single datasource DS_1. You can use a single datatsource to apply different measures in different charts via the Data Selection property as shown below:

Regards,

Mustafa.