on 04-11-2008 1:23 PM
Hi all:
I got a List form RFC. I want to show in a pie chart.
I can't sure the List size.
My idea is dynamic add attribute, and create element.
But it does't work.
my code is like this
List list = wdContext.currentZmtk_Hr_Demo_InputElement().modelObject().getOutput().getIt_Depart();
int a = list.size();
IWDNodeInfo rootNodeInfo = wdContext.getNodeInfo();
IWDNodeInfo categoryNodeInfo = rootNodeInfo.getChild("category");
for (int i = 0; i < list.size(); i++) {
categoryNodeInfo.addAttribute("seriesValue"+(i+1), "ddic:com.sap.dictionary.double");
Zmtk_Hr_01 z = (Zmtk_Hr_01) list.get(i);
String category = z.getDepart();
short number = z.getNumber();
ICategoryElement ele = wdContext.createCategoryElement();
wdContext.nodeCategory().addElement(ele);
ele.setCategorytext(category);
ele.setAttributeValue("seriesValue"+(i+1),(double) number+"");
//ele.setSeriesValue((double) number);
}
I know this is wrong.
Could anyone show me what to do?
Hi Allen,
1. Have you executed RFC as follows:
wdContext.currentZmtk_Hr_Demo_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
Because only after execute you will get output in to your modal node.
2. I have not worked in dynamic programming much but i believe that code
categoryNodeInfo.addAttribute("seriesValue", "ddic:com.sap.dictionary.double");
must be before for loop. And for setting data into this attribute inside for loop code will be
ele.setAttributeValue("seriesValue",(double) number+"");
Regards,
Gopal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Gopal .
I finally solved this problem.
I was misunderstanding the meaning of "series".
Anyway I solved this, Thanks.
Now I got another question.
I want to show a pie chart, and hope the labels could be shown not olny on the buttom, but also on the side of pie.
I opend chart desingner, and in the attributes tree I found an element named "Series".
I checked the "show labels" in the "Default Series".
The preview shown left is what I want.
But when I deployed, the result on the web page didn't show as that preview.
Does anybody know how to fix this?
tks.
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.