cancel
Showing results for 
Search instead for 
Did you mean: 

Business Graphics from Table and Series UI Element

0 Kudos

Hallo experts,

i try to provide a business graph, but have some problems with functionality of Series UI Element as i suppose.

At design Time i don't know how many series i have, it's depend on data wich i get from table. So as i found for this i can use Series UI Element instead of SimpleSeries.

So i in Layout i have following structure:

Categorie

Series(List)->SeriesPoint->Numeric Value

In Context:

MainNode with following children:

Date attribute (String)

SeriesNode with following children:

Name(String)

PoinNode with attribute:

(Integer) Summe

I set singelton of PointNode and SeriesNode to false;

Date Attribute is mapped to Catergorie

(Integer)Summe to Point Value

SeriesNode to to Series(List)

Here is part of code how i generate elements of some Node:

for(int m=0;m<allCodelineNames.size();m++){

String name=(String)allCodelineNames.get(m)

IPublicChangeList.ISeriesElement elem=

(IPublicChangeList.ISeriesElement)

wdThis.wdGetChangeListController().wdGetContext().nodeSeries().createSeriesElement();

IPublicChangeList.ISeriesPointElement elem2=

(IPublicChangeList.ISeriesPointElement)

wdThis.wdGetChangeListController().wdGetContext().nodeSeriesPoint().createSeriesPointElement();

LinkedHashMap result=(LinkedHashMap)codelineMap.get(name);

elem.setCodelineName(name);

int changeLists=Integer.parseInt((String)result.get(date));

elem2.setChangelistSum(changeLists);

wdThis.wdGetChangeListController().wdGetContext().nodeSeriesPoint().addElement(elem2);

wdThis.wdGetChangeListController().wdGetContext().nodeSeries().addElement(elem);

}

The problem is so that i still don't see different series i see only the first one.

Also it's not clear how the mainNode knew which nodeSeries elemnts it had

i also tried to implement this way;

statElem.node().getChildNode("Series",i).addElement(elem);

where statElem is element of mainNode, but it makes no difference

Have you have any ideas, could it be that i make something generell wrong with this UI Element?

Thank you in advance!!

Best Regards,

Daria

Edited by: Daria Sosunova on May 30, 2008 8:56 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daria

Good news so far: layout structure is correct

>

> So i in Layout i have following structure:

> Categorie

> Series(List)->SeriesPoint->Numeric Value

However the context structure should be a little bit different (if I understand your structure correctly)

>

> In Context:

> MainNode with following children:

> Date attribute (String)

> SeriesNode with following children:

> Name(String)

> PoinNode with attribute:

> (Integer) Summe

This is how it should be:

<ul>

<li>MainNode (for categories, singleton=true)</li>

<ul><li>Date attr (String)</li></ul>

<li>SeriesNode (for series, singleton=true)</li>

<ul>

<li>Name attr (String)</li>

<li>PointNode(for points, singleton=false)</li>

<ul><li>Summe attr (Integer)</li></ul>

</ul>

</ul>

Mapping should be done like this:

<ul>

<li>Date attr to Category->Description</li>

<li>SeriesNode to BusinessGraphic->seriesSource</li>

<li>PointNode to SeriesList->PointSource</li>

<li>PointNode to SeriesPoint->ValueSource</li>

<li>Summe attr to Values->Value</li>

</ul>

That's it for design time. As for code it should generate series like this:


        ISeriesNode nodeSeries = wdContext.nodeSeries();
	for(int j =0; j<seriesAmount; j++){
		ISeriesElement seriesElement = nodeSeries.createSeriesElement();
		nodeSeries.addElement(seriesElement);
		seriesElement.setName("Test "+j);
		
		IPoint2Node nodePoint2 = seriesElement.nodePoint2();
		for(int k=0; k<pointsAmount; k++){
			IPoint2Element point2Element = nodePoint2.createPoint2Element();
			nodePoint2.addElement(point2Element);
			if(k==4 && j==0)continue; // skip fifth element
			point2Element.setValue(""+(1+j*10 + k));
		}
	}

Set seriesAmount=allCodelineNames.size() and pointsAmount=amountOfCategories to get what you want.

I know that it's not very easy to understand but it works

Regards

Ivan Dulko

Answers (1)

Answers (1)

0 Kudos

Hi,

Thank you very much!!!!!!!

I have a problem also with mapping of Business UI Element.

Now everithing is working fine!!!

Thank you!

Kind regards,

Daria