cancel
Showing results for 
Search instead for 
Did you mean: 

IGS Pie Graph - colors issue

Former Member
0 Kudos

Hello all,

I'm displaying an IGS Pie graph in a Web-Dynpro application.

Since in a pie graph the different parts of the pie are of the same series in different elements,

I couldn't find a way to set different colors to them using the chart designer.

When choosing a specific color, all the parts appear in the same color.

When choosing an automatic color, they appear in different color,

but then I don't have control over the color.

Is there a way to define the pie so that every part is of a different series?

Otherwise, Is there a way (by using the chart designer or by code)

To achieve an IGS pie graph with the colors of my choice?

Thanks ahead for any help,

Yoav.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Yoav,

Are you using Series or SimpeSeries?

Lets say you have following context structure:

<i>

+ Categories

CategoryText

CategoryID

Value

</i>

Under Pie chart you have one category whichs description is bound to Categories.CategoryText. One series (pointSource bound to Categories), one Point (valueSource bound to Categories AND customizingID bound Categories.CategoryText) and one value (value bound to Categories.Series1Value).

After that in wdDoModifyView put something like:


if (firstTime) {
	final IWDBusinessGraphics gfx = (IWDBusinessGraphics) view.getElement("BusinessGraphic");
	final StringBuffer cuString = new StringBuffer(1024);

	cuString.append("<?xml version="1.0" encoding="ascii"?>"); 
	cuString.append("<SAPChartCustomizing>");
	
	cuString.append("<Values>");
	
	IPrivateSimpleGraphicsView.ICategoriesNode nodeCategories = wdContext.nodeCategories();
	int size = nodeCategories.size();
	
	for (int aIndex = 0; aIndex < size; ++aIndex) {
		IPrivateSimpleGraphicsView.ICategoriesElement catElement = nodeCategories.getCategoriesElementAt(aIndex);
		cuString.append("<Point id="");
		cuString.append( catElement.getCategoryText() );
		cuString.append("">");
		cuString.append("<Color>");
		cuString.append(COLORS[aIndex%4]);
		cuString.append("</Color>");
		cuString.append("</Point>");

	}
	
	cuString.append("</Values>");
	cuString.append("</SAPChartCustomizing>");

	gfx.setDirectCustomizing( cuString.toString() );
}

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi Maksim,

Thanks a lot!

6 points now, and 10 after I'll try it and get it to work.

Yoav.

former_member182372
Active Contributor
0 Kudos

Good luck....I just tried this on my local PC - seems like it works... BTW, I missed something


public static final String[] COLORS = {	"RGB(0,0,0)", 
					"RGB(0,255,0)", 					"RGB(0,0,255)", 
					"RGB(0,255,255)",
					"RGB(255,0,0)", 
					"RGB(255,0,255)",
					"RGB(255,255,0)",
					"RGB(255,255,255)"};

Former Member
0 Kudos

Hi Maksim,

It works perfectly !

Where can I get more documentation on the available options in <SAPChartCustomizing> ?

Thanks,

Yoav.

Former Member
former_member182372
Active Contributor
0 Kudos

Hi Yoav,

I have only XSD file for this. Seems like even in SAP there is no such documentation (checked on http://graphics:1080/2004/ce.htm ).

Mail me to rastchinskym AT mail.ru and I can send you XSD file if necessary.

Best regards, Maksim Rashchynski.

Answers (1)

Answers (1)

Former Member
0 Kudos

Anyone?