Skip to Content
0

replace multiple dimensions in different charts

May 02, 2017 at 09:49 PM

54

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Mustafa Bensan May 03, 2017 at 07:48 AM
2

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.


Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 03, 2017 at 01:22 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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.

0