cancel
Showing results for 
Search instead for 
Did you mean: 

Design studio - assign measure and axis type for dual axis chart in script

Former Member
0 Kudos

Hello,

In my application i need to use dual axis chart - two measures must be in columns (axis 1), third in line (axis 2).

If Data source property Load in script = false, it can be asily achieved by Additional properties of Chart:


But i have to use Data source (Load in script = true).

In that case there is no possibility to manage which measures should be assigned to which axis using script.


For example my script:


// Selecting 2 measures

DS_1.setFilter("6JW7K7JQYJR263T2MGQ78RZNN",["6JW7K7JQYJR263T2MGQ78TKJN","6JW7K7JQYJR263T2MGQ78TQV7"]);

//Setting Chart type

CHART_1.setChartType(ChartType.DUAL_COLUMN);

As shown each measures are in different Axis, but same type - column

Now add third measure:


// Selecting 3 measures

DS_1.setFilter("6JW7K7JQYJR263T2MGQ78RZNN",["6JW7K7JQYJR263T2MGQ78TKJN","6JW7K7JQYJR263T2MGQ78TQV7","6JW7K7JQYJR263T2MGQ78TX6R"]);

//Set Chart type

CHART_1.setChartType(ChartType.DUAL_COLUMN);

Now there are first measure in Axis 1 and the other two in Axis 2 and axis type column:

Is there any solution to control measure assignment and type of axis by scripting using standard functions?

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Yaroslav,

If your 3 measures are fixed, then you can make the chart "remember" the axis assignments without scripting as follows:

1)  Initially set the Load in Script property of your data source to false;

2)  Assign the measures to the axes in the Advanced Properties Sheet as you have shown above;

3)  Now set the Load in Script property of your data source to true;

4)  Do not define any measure filtering using scripting (i.e. do not use setFilter or setChartType as you have shown above).

5)  Define the loadDataSource() method in the appropriate section of your script.

With this approach, the chart should remember your original axis assignment settings when the application is executed.

Regards,

Mustafa.

Former Member
0 Kudos

Hi Mustafa,

Thank you for your solution. It helped me.

I hope in further releases SAP will add a possibility to control measure assignment and type of axis in script.

MustafaBensan
Active Contributor
0 Kudos

Hi Yaroslav,

I'm glad the approach worked for you.  You might also consider raising your scripting requirement in the Design Studio Idea Place.

Regards,

Mustafa.

Former Member
0 Kudos

Hi Mustafa,

I submitted the idea https://ideas.sap.com/SBODesignStudio/D25994

Please promote.

Answers (0)