cancel
Showing results for 
Search instead for 
Did you mean: 

Business Graphic.

Former Member
0 Kudos

I have to put a pie chart for the data coming in form the Value Node.

I have to create a pie chart taking into consideration 2 attributes.

Sales Order and the No.of days.(1,2,3,4,5 days)

The sales orders are to be ordered the days they are away from delivey as in 1,2 3 etc.

Can some one give me detailed steps as to how this can be done?Not the blogs please.

Please help.

Thanks,

Sneha Singh.

Accepted Solutions (1)

Accepted Solutions (1)

Hullen
Advisor
Advisor
0 Kudos

Hi Sneha,

you want to display the amount of Sales Orders that are <i>n</i> days away from delivery in your Pie Chart BusinessGraphic, right? For example, 5 Sales Orders are 3 days away, another 8 are 2 days away and 4 more Sales Orders are 1 day from delivery?

Well, for your BusinessGraphic, you need to store the data in a context node. As you want to have the amount of Sales Orders that are <i>n</i> days away, you need to create a <i>Category</i> for each <i>n</i>. Additionally, you have to calculate the value for each category (for example, loop over all Sales Orders and increment counters for each amount of days), which will be stored it in a context attribute as well later. So your context for this BusinessGraphic would be a node of Cardinality 0..n which contains 2 Attributes: one for the Categories of type String and one for the Values of type integer.

Now you add the BusinessGraphic to your view and add a <i>Category</i> and a <i>SimpleSeries</i> to it. You bind the Category to the according Attribute and the Series' value property to the Value Attribute of the context.

Finally, you have to fill the values. For that, create as many <i>nodeElements</i> as you have Categories and for each element, fill the according values that you have retrieved/calculated. For example, for 5 categories, assuming that you have the calculated values in an array called values:

		for(int i = 0; i < 5; i++){
			IWDNodeElement el = wdContext.nodeBGElement().createElement();
			el.setAttributeValue("Category", "" +  i + " days away from delivery");
			el.setAttributeValue("Value", values<i>);
			wdContext.nodeBGElement().addElement(el);
		}

I hope you understand the concepts now. One addition: I believe that the <i>histogram charttype</i> would fit your requirements better, maybe you could take a look at that as well; it would probably allow you to use the current Value Node you have instead of making you create another one.

regards,

Ulrich

Answers (0)