on 03-27-2015 10:31 AM
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?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.