on 05-31-2007 1:59 PM
Hello everyone,
I have a Business Graphics with a Category Subelement and a SeriesList with a Value inserted.
The Series List is linked to a node, so my series are dinamically created during runtime. My problem is that the number of categories i have are allways different from the number of series, and categories is a discret set of values known at design time. How do i link each category to a set of values from the SeriesList ?
Thank you in advance,
Nuno Santos
Hi ,
A few questions..
Is there just one series of values.. some. which come under one category.. some in another something like that..
Can you elobarate on the real scenario (like wat are u dealin with .. year Vs profits.. give the reall attributes.. ). and how the data is .. and how u want the graph.. leave the category and series for now..
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nuno,
Check this link you will get the code.
http://help.sap.com/saphelp_nw04/helpdata/en/e5/08b6eb35637a44830b9e6df22987aa/frameset.htm
IPrivateGanttTestView.ICategoryNode catNode = wdContext.nodeCategory();
for (int catIndex = 0; catIndex < catLabels.length; ++catIndex)
{
IPrivateGanttTestView.ICategoryElement
catElement = catNode.createCategoryElement();
catNode.addElement(catElement);
catElement.setDescription(catLabels[catIndex]);
}
// loop over series
IPrivateGanttTestView.ISeriesNode seriesNode = wdContext.nodeSeries();
for (int seriesIndex = 0; seriesIndex < timeValues.length; ++seriesIndex)
{
IPrivateGanttTestView.ISeriesElement
seriesElement = seriesNode.createSeriesElement();
seriesNode.addElement(seriesElement);
// set series attributes (...)
IPrivateGanttTestView.IPointNode pointNode = seriesElement.nodePoint();
// loop over points
for (int pointIndex = 0; pointIndex < timeValues[seriesIndex].length;
++pointIndex)
{
IPrivateGanttTestView.IPointElement
pointElement = pointNode.createPointElement();
pointNode.addElement(pointElement);
pointElement.setStartValue(timeValues[seriesIndex][pointIndex][0]);
pointElement.setEndValue(timeValues[seriesIndex][pointIndex][1]);
pointElement.setCuId(pointCustomizing[seriesIndex][pointIndex]);
pointElement.setLabel(pointLabels[seriesIndex][pointIndex]);
}
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your answer, Mithu.
My Context node is like this.
ParentNode (Category) -
> CAT
AttributeValueParentNode-------> Cat_text
ChildNode (Series) -
> SERIES
AttributeValueChildNode----
> Value
AttributeValueChildNode----
> Series_label
Is this a good solution? i'm getting a graphic in wich all bars have the same height, wich is wrong. I should have different color bars with different values, distributed for 5 categories.
Hi Nuno,
I think is is not the correct way.
Don't take SERIES as a child node.Under Context take "CAT" and "SERIES" as a seperate node.And Under "SERIES" take a child Node "POINT" and under "POINT" take attributes.
ParentNode (Category) -
> CAT
AttributeValueParentNode-------> Cat_text
ParentNode(Series) -
> SERIES
Child Node(Point)----
>POINT
AttributeValueChildNode----
> Value
AttributeValueChildNode----
> Series_label
Regards,
Mithu
Message was edited by:
Mithu Ghosh
Thank you for your answer, Mithu.
I did what you said and created two nodes, one with the categories, the other with the series->point. But my problem persists.
Imagine that i have 5 categories and 4 series. So, my node CAT will have size 5, and my node SERIES will also have size 5, corresponding each one of the Series to one category. The Child Node POINT will have size 4, corresponding to each series value.
Is this correct? if your answer is affirmative, then i believe i must be binding the context nodes incorrectly to the properties of the UI Business Graphics, because now i have a vertical bar chart with 4 series (correct), 5 categories (also correct), but the different color bars of each category allways have the same value, as if they were one "giant" bar.
I'm binding context nodes like this:
SeriesSource: SERIES.POINT
Category Description: CAT.category_text
PointSource: SERIES.POINT
ValueSource (in UI SeriesList_Point): SERIES.POINT
Value: SERIES.POINT.value
Please, can you or someone else help ?
Thank you,
Nuno
Message was edited by:
Nuno Santos
Hi Nuno,
Take the binding like this:
categorySource : Category
SeriesSource: SERIES
Category Description: CAT.category_text
PointSource: SERIES.POINT
ValueSource (in UI SeriesList_Point): SERIES.POINT
Value: SERIES.POINT.value
Take a loop to display diff value for each category.Check my Previous posted Code.
Regards,
Mithu
Mithu,
I made the changes you suggested, but now i have the 5 categories (ok), but 5 series (not ok), and in each category, all values are different from serie to serie. But the series appearing are ordered by series, not categories.
I will explain this in a real example:
My graph must have 5 allready known evaluation categories:
-
Very Bad--
Very Good
Then, in each category, i can have as many Companies as i want (created in run-time):
Example: Company C1, Company C2, C3 and C4
C1C2C3C4--
-
Very bad--
Very Good
Now each Company will have a percentage of evaluation for each category. C1 can have, for instance, 0% of Very Bad, and that column will not appear.
What i have right now is:
- All 5 categories appear ok.
- I can see 5 columns, but the Companys created in run-time are 4.
- In each category, i'm seeing the values from each company: In "Very Bad", i see all evaluations for Company C1; in "Bad", i see all values for C2; etc. .... the last evaluation (Very Good) is empty, because there are only 4 companies and 5 categories.
Here's a printing of my nodes:
CAT(0): Very Bad
CAT(1): Bad
...
CAT(4): Very Good
---Evaluations for Category "Very Bad":
SERIES(0):
POINT (0): C1 / Value: 7.69230769
POINT (1): C2 / Value: 0.56497175
POINT (2): C3 / Value: 0.0
POINT (3): C4 / Value: 50.0
---Evaluations for Category "Bad":
SERIES(1):
POINT (0): C1 / Value: 15.3846154
POINT (1): C2 / Value: 0.789
POINT (2): C3 / Value: 11.1111111
POINT (3): C4 / Value: 30.0
...
Message was edited by:
Nuno Santos
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.