on 12-11-2017 1:55 PM
Hi Pros,
I am getting duplicate legend values for every value i select in Listbox.
I have created two measures and based on a condition the values are getting stored in both measures. These values are generated against a dimension field and as per the condition if a value is generated in one measure then for other measure the value will be null. Now when i select a particular value from listbox i get a single axis against that but two legends. Please find attached the screenshot legend-issue.pngt for the same. I need to have single legend for the axis for which i am getting value. Thanks in advance.
Arpit
This is how I tried to replicate a similar scenario:
I have created 2 css classes as below:
.hideLegend1 .viz-legend-valueLabel g:nth-child(1){
visibility:hidden;
}
.hideLegend2 .viz-legend-valueLabel g:nth-child(2){
visibility:hidden;
}
Now, the on startup event of application, I used the script below. You have to use same script in the on selection event of the listbox as well.
if(DS_1.getData("_GIiL54mPEee2VZjheZxFZQ", {}).formattedValue == ''){ // If the first measure is null
INFOCHART_1.setCSSClass('hideLegend1');
}else{ // If the second measure is null
INFOCHART_1.setCSSClass('hideLegend2');
}
In initial view of the data source, I used Sum to calculate total of the measures so that the total is blank in case all values are null.
Thus, if one measure provides all null values, the legend for the same is hidden in the infochart.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In this case the number of legend items will be dynamic and it will not be possible to hide the correct items from css. Only solution I can think of is to modify the back end to have a single measure and a dimension to toggle between high and low (not sure if it is possible for you to make such a big change in the data model).
I have tried with single measure but as per the requirement the values for some tags are very low and for some are very high so to make all the tag values visible and at some level we need dual axis, but i think due to legend getting duplicate we won't be able to achieve that. I think this is a limitation or some kind of bug in SAP Design Studio 1.6 SP3 base pack.
Thanks
Arpit
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.