on 12-23-2016 5:45 AM
As follow picture,I want the bubble color auto changed by data,eg:if the value>0 the color red,else the color blue.
I've use follow code to get data,but if I follow like this,all of bubble will red or blue,not like I want just value less than 0.
How can I do to make it realize?Just the value greater than 0 will red,and others blue?
var va=DS_1.getMembers("ZCQYF", 2000);
va.forEach(function(element, index) {
var v=DS_1.getData("OVERDUE_TTL", {"ZCQYF": element.internalKey}).value;
LISTBOX_1.addItem(v+"", v+"");
if(v>=0){
LISTBOX_1.setCSSClass("red");
}else if(v<0){
LISTBOX_1.setCSSClass("blue");
}
});
Hi Jing,
The scenario you have documented is confusing. It appears that you would like to dynamically change the bubble colours in a geo map via CSS yet your script example is changing the CSS applied to a List Box. Can you clarify?
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 Mustafa.
It's my typo.the code I was used for a List Box,but if I change the LISTBOX_1.setCSSClass("red") to GEOMAP_1.setCSSClass("red") ,it's same mean.So it isn't matter to my result.
And follow code was I changed ,if I add element by html,it's ok.I hope this can help some new ideas.
Thanks.
Jing
var result="";
var va=DS_1.getMembers("ZCQYF", 2000);
va.forEach(function(element, index) {
var v=DS_1.getData("OVERDUE_TTL", {"ZCQYF": element.internalKey}).value;
var style="";
if(v>=0){
result=result+"<span>"+v+"</span><br/>";
}else{
result=result+"<span class='red'>"+v+"</span><br/>";
}
});
FORMATTEDTEXTVIEW_1.setHtmlText(result);
Hi Jing,
I don't see how your script code above relates to the Geo Map component. It looks like the script is generating formatted HTML text which is completely unrelated to the Geo Map. Also, it would be helpful if you provided the custom CSS file you are using where you have defined the "red" CSS class.
Regards,
Mustafa.
Hi Mustafa.
Maybe I'm not express clear.
I want to realize a situation in geomap that when the data less than 0,then "red",else "blue".Above code is just an eg to show that is a way to realize color according to data.But if I use geomap,I can't use html,so whether there have another way to realize color changed by data?
Thanks .
Jing
Hi jing,
How are you using Geo or Leaflet Map??
If leaflet map, Please refer the below URL,
https://blogs.sap.com/2016/01/07/design-studio-16-sdk-leaflet-maps-for-more-mapping-goodness/
Regards,
Vidhya.C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.