cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Business Graphics

Former Member
0 Kudos

Hello everyone,

I'm customizing a pie chart (UI Element BusinessGraphics) with different colors like this:

On the WdDoModify:

		if (firstTime){
			
			final IWDBusinessGraphics gfx = (IWDBusinessGraphics) view.getElement("BusinessGraphicsChart");
			final StringBuffer cuString = new StringBuffer(1024);
 
			cuString.append("<?xml version="1.0" encoding="ascii"?>"); 
			cuString.append("<SAPChartCustomizing>");
	
			cuString.append("<Values>");
	
			IPrivateGraph.IXptoNode nodeXpto = wdContext.nodeXpto();
			int size = nodeXpto.size();
	
			for (int aIndex = 0; aIndex < size; ++aIndex) {
				IPrivateGraph.IXptoElement catElement = nodeXpto.getXptoElementAt(aIndex);
				cuString.append("<Point id="");
				cuString.append( catElement.getText() );
				cuString.append("">");
				cuString.append("<Color>");
				if ("Category A".equalsIgnoreCase(catElement.getText())) {
					cuString.append("RGB(255,0,0)");
				} else if ("Category B".equalsIgnoreCase(catElement.getText())){
					cuString.append("RGB(255,255,0)");
				} 
				cuString.append("</Color>");
				cuString.append("</Point>");
 
			}
	
			cuString.append("</Values>");
			cuString.append("</SAPChartCustomizing>");
 
			gfx.setDirectCustomizing( cuString.toString() );			
			
		}

Everything works fine, with the colours i want applied to the different cattegories. But Before i customized the chart, i could see the values (in my case, percentages) on small labels pointing to each slice of the pie. Now they disappeared. Do i need to add other label to XML ? Can anyone help?

Thank you,

Nuno

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

<Values>
  <Series>
   <ShowLabel>true</ShowLabel>
  </Series>
.............
 </Values>

Answers (1)

Answers (1)

matthias_gemmel
Active Participant
0 Kudos

Hi Nuno,

the point customizing overwrites the complete series customizing. That's why you need to add the tag <ShowLabel>true</ShowLabel> to your point customizing, in your case:

[...]
cuString.append("<ShowLabel>true</ShowLabel>");
cuString.append("<Color>");
[...]

you may also need to copy the Format to a <Format> tag below the <ShowLabel> tag, e.g.

<Format>0.0 "%"</Format>.

This should work.

Regards

Matthias

Former Member
0 Kudos

Thank you, guys. You've been very helpfull.

Nuno