cancel
Showing results for 
Search instead for 
Did you mean: 

I want to display total count on the top of a Column in business graphics

udaykumar_kanike
Active Contributor
0 Kudos

Hi All ,

How can I display total count of the column say for example no. of employees in a series of column chart type in business graphics.

Any type of help would be much appreciated.

Thanks

Uday

Accepted Solutions (0)

Answers (1)

Answers (1)

udaykumar_kanike
Active Contributor
0 Kudos

please someone answer my question.

Thanks

Uday

Former Member
0 Kudos

Hi Uday,

Unless the graph is displayed in percentage, the total number will anyway be displayed in the Y-axis. But in case if the columns are displayed in percentage, you can show this total count as tooltip of the category (as each category represents one column in the graph).

To do this along with the attribute bound to description property of* Category*, add another attribute to hold the total count and bind it to Tooltip of Category added under the business graph. Populate this attribute with the total count.

Regards,

Vishweshwara P.K.M.

udaykumar_kanike
Active Contributor
0 Kudos

Hi Vishweshwara,

Thanks for the quick response. But in my case, I have 6 series and one category. Like this there are 4 categories with each of them containing six series. And in my scenario, I am populating data dynamically to this 6 series. So how can I achive this dynamical count setting to tooltip. and more over I could able to bind tooltip only to categories not to series.

Please help me.

Thanks

Uday

Former Member
0 Kudos

Hi Uday,

I assume you are using BusinessGraphics UI, and under this you have added one category and Series-Point or multiple SimpleSeries (in your case 6).

In this case the number of categories represent the number of columns displayed in the graph and number of series in each category represents the blocks in each column.

So what you can do is while populating the series for each category, take the sum of data populated for each series and the total is added to the attribute i was mentioning.

Regards,

Vishweshwara P.K.M.

udaykumar_kanike
Active Contributor
0 Kudos

Hi Vishweshwara,

following is the code i wrote. please check the correctness of the code.

int seriescount = 0;

for(int i=0;i<nodesize;i++){

IGraphDataElement catele = gdNode.createGraphDataElement();

switch(i){

case 0:

if(wdContext.currentContextElement().getQ().equals("Q1")){

catele.setCategory("Q1");

catele.setKRA_Series1(Q1_KRA);

catele.setApp_Pln_Series2(Q1_AP);

catele.setRev_App_Series3(Q1_RA);

catele.setEnd_Rev_Series4(Q1_ERP);

catele.setApp_Procss_Series5(Q1_AIP);

catele.setApp_overall_Series6(Q1_AOP);

seriescount = seriescount+1; break;}

break;

case 1:

if(wdContext.currentContextElement().getQ().equals("Q2")){

catele.setCategory("Q2");

catele.setKRA_Series1(Q2_KRA);

catele.setApp_Pln_Series2(Q2_AP);

catele.setRev_App_Series3(Q2_RA);

catele.setEnd_Rev_Series4(Q2_ERP);

catele.setApp_Procss_Series5(Q2_AIP);

catele.setApp_overall_Series6(Q2_AOP);

seriescount = seriescount+1; break; }

break;

case 2:

if(wdContext.currentContextElement().getQ().equals("Q3")){

catele.setCategory("Q3");

catele.setKRA_Series1(Q3_KRA);

catele.setApp_Pln_Series2(Q3_AP);

catele.setRev_App_Series3(Q3_RA);

catele.setEnd_Rev_Series4(Q3_ERP);

catele.setApp_Procss_Series5(Q3_AIP);

catele.setApp_overall_Series6(Q3_AOP);

seriescount = seriescount+1; break;}

break;

case 3:

if(wdContext.currentContextElement().getQ().equals("Q4")){

catele.setCategory("Q4");

catele.setKRA_Series1(Q4_KRA);

catele.setApp_Pln_Series2(Q4_AP);

catele.setRev_App_Series3(Q4_RA);

catele.setEnd_Rev_Series4(Q4_ERP);

catele.setApp_Procss_Series5(Q4_AIP);

catele.setApp_overall_Series6(Q4_AOP);

seriescount = seriescount+1; break;}

break;

case 4: if(wdContext.currentContextElement().getQ().equals("All")){

wdContext.nodeGraphData().invalidate();

wdContext.currentContextElement().setGraphVisibility(WDVisibility.NONE);

wdThis.onActiondropdownaction(wdEvent);

}default:

wdContext.nodeGraphData().addElement(catele);

}

Thanks

Uday

Former Member
0 Kudos

Hi Uday,

The code you have written looks fine. So now in addition to what you have already done, add another attribute say Tooltip of type String under the node GraphData. Bind this attribute to the tooltip property of the category added under BusinessGraphics UI.

Write the below line outside for loop.

int sumOfSeriesData = 0;

write the below line in each of the switch case.


 //Where X will be 1 for case 0, 2 for case 1 and so on.
sumOfSeriesData =  QX_KRA + QX_AP + QX_RA + QX_ERP + QX_AIP + QX_AOP;

and at the end of FOR loop, before adding the element to node set the sum to the attribute Tooltip i.e. replace the last line with the below code

catele.setTooltip(sumOfSeriesData);
wdContext.nodeGraphData().addElement(catele);

Regards,

Vishweshwara P.K.M.

udaykumar_kanike
Active Contributor
0 Kudos

Hi Vishweshwara ,

I am getting the following type casting error. I tried convering to toString by forcedly typecasting. but could not do that.

http://www.freeimagehosting.net/3hesq

thanks

uday

Former Member
0 Kudos

Hi Uday,

Hey sorry, the sum is of type int and tooltip is of type string, so set it this way

catele.setTooltip(sumOfSeriesData+"");

Also in the attached image i see

sumOfSeriesData = Q1_KRA + Q1_AP + Q1_RA + Q1_ERP + Q1_AIP + Q1_AOP; outside switch case, that is not required, remove that line of code.

Regards,

Vishweshwara P.K.M.

udaykumar_kanike
Active Contributor
0 Kudos

Sorry Vishweshwara,

I dont know why but I am not getting the count on the series.

Please suggest me if I am going wrong anywhere.

Thanks

Uday

Former Member
0 Kudos

Hi Uday,

The sum is populated has tooltip, and hence you will get it when you hover on the category displayed below the X-axis(In your case Q1, Q2 etc). There is no way you can display the text on the graph.

Regards,

Vishweshwara P.K.M.