Showing results for 
Search instead for 
Did you mean: 

Dynamically change the Dimension of a chart

Former Member
0 Kudos

Hi All,

I am new to BEx Design studio. i have a requirement where i have to show a pie chart based on the dimension selected in the Drop down.

Ex: 1st Pie chart - Headcount by Selected Dimension such Employee group.

      2nd Pie chart - Headcount by Employee sub group.

      3rd pie chart - Headcount by Worker Type.

      4th pie chart -  Headcount by Age Group.

Drop down has entries - Employee group, Employee Sub group,Worker type and Age group.

Can i achieve using one pie chart to get the above solution. if so, can you guide me.

Thanks in advance.

Jethendra Ravi

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Jethendra,

in order to do so, you need to use global variable. add a string variable to the application level (Ex. "state" and give it a default = the first dimension used in the pie chart, you need to write the technical name of the dimension, in your example I believe it will be "0EMPLGROUP")

Then write a script in the "onClick" of the Drop down, inside write the following code:

CHART1.swapDimension (0EMPLGROUP, DROPDOWN.getSelectedValue());

state = DROPDOWN.getSelectedValue();

the global variable will be change based on the dimension selected in the Drop down.

good lack


Former Member
0 Kudos

Hi Amit,

Thanks for your Response.I have created custom LOV's for the drop down.

In the Formula for swapdimension it asks for a dimension objects but not custom LOV's created.

so is there any alternative to achieve.



Former Member
0 Kudos

Hi Jethendra,

to further explain the suggestion from Amit:

In the initial view of the data source you have only 1 dimension in the rows "Employee group". Then you assign this data source to your pie chart. Then you use the swapDimensions() method with your data source and with global variables to save the previous dimension and the selected dimension.

You just have to make sure that you define the items for your drop down in a correct way: the "Value" needs to be the technical name of the dimension object and the "Text (optional)" is the text that the user will see in the drop down.

In the on select event of the drop down you would use:

gv_chart1_selected_value = DROPDOWN_1.getSelectedValue();

if (gv_chart1_current_value != gv_chart1_selected_value) {

  DS_1.swapDimensions(gv_chart1_current_value, gv_chart1_selected_value);

  gv_chart1_current_value = DROPDOWN_1.getSelectedValue();


Where the following 2 global variables (gv_chart1_current_value , gv_chart1_current_value) have an initial value the technical name of your dimension "Employee group" (the first item of your drop down box which is set to "Default").



Former Member
0 Kudos

Hi David,

Thanks for suggesting.i feel i can achieve..

Will try thanks for your help.