on 06-27-2006 10:03 PM
Hi,
Can anybody tell me how to show both percentages and value in Pie Chart using Business Graphics?
Regards,
Suresh.
Hi Suresh,
Would you like to have let`s say for category1 - the percentages and for category2 - the value? Or would you like to have for all categories "percentages% (value)" label?
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh,
Well it is not one-click deal actually.
Let`s assume that we have following context ctructure:
DataSource (cardinality 0..n, selection 0..1)
+CategoryID
+CategoryName
+SeriesValue1
UI layout:
We have business graphic with type "pie" ("seriesSource" bound to "DataSource"). We have "Category1" as category under business graphic ("description" bound to "DataSource.CategoryName") and "Series1" as series ("pointSource" biund to "DataSource") and "Series1_Point" as point under series (<b>customizingID bound to "DataSource.CategoryID"</b> !VERY IMPORTANT!, "valueSource" to "DataSource") and NumericValue1 as value under point (type is "y", value bound to "DataSource.SeriesValue1").
View controller:
Method wdDoInit (to initialize DataSource):
[code]IPrivateSimpleGraphicsView.ICategoriesNode catsnode = wdContext.nodeCategories();
for (int aIndex = 0; aIndex <= 5; ++aIndex) {
IPrivateSimpleGraphicsView.ICategoriesElement catelem = catsnode.createCategoriesElement();
catelem.setCategoryText("SOME_TEXT");
catelem.setCategoryID("Point" + aIndex);
catelem.setSeries1Value(aIndex);
catsnode.addElement(catelem);
}[/code]
Method wdDoModifyView (to build customization):
[code]
if(firstTime) {
final IWDBusinessGraphics bg = (IWDBusinessGraphics)view.getElement("BusinessGraphic");
StringBuffer sb = new StringBuffer();
sb.append("<SAPChartCustomizing version=\"1.1\">");
sb.append("<Values>");
for (int aIndex = 0; aIndex <= 5; ++aIndex) {
sb.append("<Point id=\"Point").append(aIndex).append("\">");
sb.append(" <ShowLabel>true</ShowLabel>");
sb.append(" <Format>$Percent0.00 "% ("0.00")"</Format>");
sb.append("</Point>");
}
sb.append("</Values>");
sb.append("</SAPChartCustomizing>");
bg.setDirectCustomizing(sb.toString());
}
[/code]
And that`s it!
Best regards, Maksim Rashchynski.
User | Count |
---|---|
84 | |
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.