cancel
Showing results for 
Search instead for 
Did you mean: 

Removing 0 from stacked column graph in Business Graphics

sweetysingh
Participant
0 Kudos

I am using WebDynpro business graphics stacked column graph, in that i need to show Label values. Values are comming from backend. I am getting my Label value correctly but some of the data is of 0 (zero) value.

I dont want to show 0 value on business graphics bar. I am unable to remove the 0 value from the Stacked Graph.

Please guide me on how to exclude the 0 value data from the stacked graph as my task deadline is drawing close.

Please advice.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Which type of series are you using(Simple Series Or Series). If Simpleseries is used then this is not possible. But with Series there is a workaround to not to show 0 Value on the stacked graph.

If Series UI is used, then while you are creating the Point element, check if the value is zero. If not Zero, only then create the point element and populate the value, else dont even create the point element.

Revert back if you have any queries.

Regards,

Vishweshwara P.K.M.

sweetysingh
Participant
0 Kudos

Hi,

Thank you so much for your reply..

I am using Simple Series. I tried to create Series type dynamically using http://wiki.sdn.sap.com/wiki/display/WDJava/WebDynproDynamicBusiness+Graphics link

but was not able to create.

Please let me know whether I need to create businessGraphics dynamically or how...

Please suggest me link for creation of Series type of BusinessGraphics as first time I am creating BusinessGraphics.

Thanks in advance.

Former Member
0 Kudos

Hi,

See my last replay in the below thread, I had explained the procedure with an example. Creating UI is at design time but populating values will be at runtime.

[;

Also please reward points if the replay is helpful.

Regards,

Vishweshwara P.K.M.

sweetysingh
Participant
0 Kudos

Hi Vishweswara,

I am using SAP NetWeaver Developer Studio Version: 7.0.14. Is it possible to do in this version.

I dont see some functions in my Developer studio like:

createAndAddVn_SeriesElement(); ,

createAndAddVn_CategoryElement();

elPointElement1 = elSeriesElement1.nodeVn_Point().createAndAddVn_PointElement();

Please suggest me on this

Thanks

Former Member
0 Kudos

Hi,

createAndAddVn_SeriesElement(); is a one step procedure to create and add a new element to a node, and this is supported only in CE 7.1 or higher versions. You can split it into two steps, one to create an element and second step to add it to the node(The usual way you do it for other nodes) as shown in the below examples.


elSeriesElement1 = wdContext.nodeVn_Series().createAndAddVn_SeriesElement();
//Change the above and similar statements to somthing like below
elSeriesElement1 = wdContext.nodeVn_Series().createVn_SeriesElement();
wdContext.nodeVn_Series().addElement(elSeriesElement1);

elPointElement1 = elSeriesElement1.nodeVn_Point().createAndAddVn_PointElement();
//Change the above and similar statements to somthing like below
elPointElement1 = elSeriesElement1.nodeVn_Point().createVn_PointElement();
elSeriesElement1.nodeVn_Point().addElement(elPointElement1);

Other then this there is no difference in implementation.

Regards,

Vishweshwara P.K.M.

sweetysingh
Participant
0 Kudos

Hi,

Thanks for your reply

I tried as you suggested, but in below line I am not able to get elSeriesElement1.nodeVn_Point().

elPointElement1 = elSeriesElement1.nodeVn_Point().createVn_PointElement();

with elSeriesElement1 instance only one class is populating named node()

Can I send you the screenshot to your Email-Id so that It will be easier


	IPrivateBGView.IVn_Series1Element series1Element = null;
	IPrivateBGView.IVn_Series1Element series2Element = null;
	IPrivateBGView.IVn_Series1Element series3Element = null;
	IPrivateBGView.IVn_Series1Element series4Element = null;
		
	series1Element = wdContext.nodeVn_Series1().createVn_Series1Element();
	wdContext.nodeVn_Series1().addElement(series1Element);
	series2Element = wdContext.nodeVn_Series1().createVn_Series1Element();
	wdContext.nodeVn_Series1().addElement(series2Element);
	series3Element = wdContext.nodeVn_Series1().createVn_Series1Element();
	wdContext.nodeVn_Series1().addElement(series3Element);
	series4Element = wdContext.nodeVn_Series1().createVn_Series1Element();
	wdContext.nodeVn_Series1().addElement(series4Element);
		
	IPrivateBGView.IVn_CategoryElement categoryElement = null;
	IPrivateBGView.IVn_Point1Element point1Element = null;
	IPrivateBGView.IVn_Point1Element point2Element = null;
	IPrivateBGView.IVn_Point1Element point3Element = null;
	IPrivateBGView.IVn_Point1Element point4Element = null;
		
	for (int i = 0; i < 5; i++) 
	{
		categoryElement = wdContext.nodeVn_Category().createVn_CategoryElement();
		categoryElement.setVa_CategoryName("Category"+i);
		wdContext.nodeVn_Category().addElement(categoryElement);
			
		point1Element = series1Element.node();
		
	}
 

cardinality Properties for

Vn_Category Node = 0..n

Vn_Series1 Node = 0..n

Vn_Point1 Node = 0..n

Please suggest me where I am wrong

Thanks

Former Member
0 Kudos

Hi,

Set the Singleton property of the child node(Vn_Point) to false. Also make sure that you have created Vn_Point under Vn_Series node.

Regards,

Vishweshwara P.K.M.

sweetysingh
Participant
0 Kudos

Hi Vishweshwara,

I tried as you suggested, below is my code


	IPrivateBGView.IVn_Series1Element series1Element = null;
	IPrivateBGView.IVn_Series1Element series2Element = null;
	IPrivateBGView.IVn_Series1Element series3Element = null;
	IPrivateBGView.IVn_Series1Element series4Element = null;
		
	series1Element = wdContext.nodeVn_Series1().createVn_Series1Element();
	wdContext.nodeVn_Series1().addElement(series1Element);
	series2Element = wdContext.nodeVn_Series1().createVn_Series1Element();
	wdContext.nodeVn_Series1().addElement(series2Element);
	series3Element = wdContext.nodeVn_Series1().createVn_Series1Element();
	wdContext.nodeVn_Series1().addElement(series3Element);
	series4Element = wdContext.nodeVn_Series1().createVn_Series1Element();
	wdContext.nodeVn_Series1().addElement(series4Element);
		
	IPrivateBGView.IVn_CategoryElement categoryElement = null;
	 
	IPrivateBGView.IVn_Point1Element point1Element = null;
	IPrivateBGView.IVn_Point1Element point2Element = null;
	IPrivateBGView.IVn_Point1Element point3Element = null;
	IPrivateBGView.IVn_Point1Element point4Element = null;

	for (int i = 0; i < wdContext.nodeTableNode().size(); i++) 
	{
		categoryElement = wdContext.nodeVn_Category().createVn_CategoryElement();
		categoryElement.setVa_CategoryName(wdContext.nodeTableNode().getTableNodeElementAt(i).getCategoryText());
		wdContext.nodeVn_Category().addElement(categoryElement);
	
		if(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries1()>0)
		{
			point1Element = series1Element.nodeVn_Point1().createVn_Point1Element();
			point1Element.setVa_Value(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries1());
			point1Element.setVa_ToolTip(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries1() +" Black");
			point1Element.setVa_Label("Black");
			series1Element.nodeVn_Point1().addElement(point1Element);	
		}	
		if(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries2()>0)
		{
			point2Element = series2Element.nodeVn_Point1().createVn_Point1Element();
			point2Element.setVa_Value(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries2());
			point2Element.setVa_ToolTip(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries2() +" Red");
			point2Element.setVa_Label("Red");			
			series2Element.nodeVn_Point1().addElement(point2Element);
		}

		if(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries3()>0)
		{
			point3Element = series3Element.nodeVn_Point1().createVn_Point1Element();
			point3Element.setVa_Value(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries3());
			point3Element.setVa_ToolTip(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries3() +" Yellow");
			point3Element.setVa_Label("Yellow");
			series3Element.nodeVn_Point1().addElement(point3Element);
		}

		if(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries4()>0)
		{
			point4Element = series4Element.nodeVn_Point1().createVn_Point1Element();
			point4Element.setVa_Value(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries4());
			point4Element.setVa_ToolTip(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries4() +" Green");
			point4Element.setVa_Label("Green");
			series4Element.nodeVn_Point1().addElement(point4Element);
		}

	}

When I am checking for 0 value (i.e. if(wdContext.nodeTableNode().getTableNodeElementAt(i).getSeries4()>0)

), Point is not showing as expected.

Suppose I have table data mentioned below:

Category Black Red Yellow Green

Series1 : 10 0 10 15

Series2 : 20 10 15 13

Series3 : 0 10 0 15

Series4 : 5 5 10 0

but in my graph the data is like:

Series1 : 10(Black), 10(Red), 10(Yellow), 15(Green)

Series2 : 20(Black), 10(Red), 15(Yellow), 13(Green)

Series3 : 5(Black), 5(Red), 10(Yellow), 15(Green)

Series4 : No data here (This is blank)

If you provide me Email-Id, then I can send you the screenshot.

Thanks and Regards

Sweety Singh

sweetysingh
Participant
0 Kudos

Hi Vishweshwara,

Thanks for your help. My problem solved, I did a bit changes. I have made Va_Value as String, and checking the condition is:

If value is 0 then set null.

Node structure is:

Vn_Series

--Vn_Point(Child Node)

-----Va_Value(Type String)

Thanks!

Answers (0)