Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved]Remove 0% value from a PIE graph in PDF format

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved]Remove 0% value from a PIE graph in PDF format
 Login/Join
 
Gold member
posted
I don't want to display 0% value for a Pie graph in PDF format.
Suppose if one value is 95%, another is 5% and last value is 0%, then i should display only the values of 95% and 5%. O% value should not get displayed in Pie graph.

But I'm getting 0% value in my pie graph. Suggest me some solution to ignore 0% value.

This message has been edited. Last edited by: SriAravind,


WebFocus Version 7.7.05
Windows, HTML/PDF/EXL2K/AHTML
 
Posts: 63 | Registered: January 12, 2011Report This Post
Member
posted Hide Post
Try adding the statement:

WHERE TOTAL (name of % field) GT 0;
 
Posts: 14 | Registered: December 30, 2005Report This Post
Expert
posted Hide Post
My guess is that its not 0, but 0.something.

How are you getting the percentage ?

Is it a calc, if so, is the amount zero ?, then remove it at that stage.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
WHERE TOTAL (name of % field) GT 0 is also not working.

Actually the value is not zero. But the % is showing as zero.

I'll give u similar sample code of the issue:

TABLE FILE CAR
SUM DEALER_COST AS 'DCOST'
BY CAR
WHERE CAR EQ 'BMW' OR 'JAGUAR'
END

RESULT:

CAR DCOST
----- -------
BMW 50000.000
JAGUAR 100.000

But while using the same for PIE graph, getting 0% for Jaguar and 100% for BMW
GRAPH FILE CAR
SUM DEALER_COST AS 'DCOST'
BY CAR
WHERE CAR EQ 'BMW' OR 'JAGUAR'
HEADING CENTER
"CAR SAMPLE GRAPH"
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 200
ON GRAPH SET VAXIS 200
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIESINGL
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET GRAPHSTYLE *
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(5);
setTransparentBorderColor(getSeries(0),true);
setTransparentBorderColor(getSeries(1),true);
setTransparentBorderColor(getSeries(2),true);
setTransparentBorderColor(getSeries(3),true);
setTransparentBorderColor(getSeries(4),true);
setTransparentBorderColor(getSeries(5),true);
setTransparentBorderColor(getSeries(6),true);
setTransparentBorderColor(getSeries(7),true);
setTransparentBorderColor(getSeries(8),true);
setTransparentBorderColor(getSeries(9),true);
setTransparentBorderColor(getSeries(10),true);
setPieDepth(10);
setPlace(true);
setPieLabelDisplay(3);
setDisplay(getLegendArea(),false);
setOtherPieLabelDisplay(3);
setFontName(getTitle(),"SansSerif");
setFillColor(getTitle(),new Color(32,0,32));
setFontStyle(getTitle(),2);
setFontSizeAbsolute(getTitle(),true);
setFontSizeInPoints(getTitle(),10);
setPlaceResize(getTitle(),0);
setTextWrap(getPieLabel(),true);
setGradientDirection(getSeries(0),9);
setFillType(getSeries(0),1);
setFillColor(getSeries(1),new Color(66,102,179));
setFillColor(getSeries(2),new Color(211,203,79));
setFillColor(getSeries(3),new Color(78,143,109));
setFillColor(getSeries(4),new Color(214,130,40));
setFillColor(getSeries(5),new Color(164,120,90));
setFillColor(getSeries(6),new Color(191,68,62));
setFillColor(getSeries(7),new Color(153,102,51));
setFillColor(getSeries(8),new Color(145,165,65));
setFillColor(getSeries(9),new Color(95,160,160));
setFillColor(getSeries(10),new Color(176,96,140));

setFontSizeAbsolute(getPieSliceLabel(),true);
setFontSizeInPoints(getPieSliceLabel(),8);
setPlaceResize(getPieSliceLabel(),0);
setFontSizeAbsolute(getPieLabel(),true);
setFontSizeInPoints(getPieLabel(),8);
setPlaceResize(getPieLabel(),0);
setFillColor(getSeries(0),new Color(118,101,188));
setFontStyle(getPieSliceLabel(),0);
setFontStyle(getPieLabel(),0);
setTransparentBorderColor(getChartBackground(),false);
setPieFeelerTextDisplay(1);
setRect(getPieFrame(),new Rectangle(-15520.0,-13672.0,36373.0,26084.0));
setTextString(getSubtitle(),"\n\n\n");
setTextString(getTitle()," \n");
setDisplay(getTitle(),true);
ENDSTYLE
ON GRAPH SET STYLE *
TYPE=HEADING, LINE=1, ITEM=1, OBJECT=TEXT, SIZE=10, STYLE=BOLD, FONT='ARIAL', JUSTIFY=CENTER, $
ENDSTYLE
END


WebFocus Version 7.7.05
Windows, HTML/PDF/EXL2K/AHTML
 
Posts: 63 | Registered: January 12, 2011Report This Post
Virtuoso
posted Hide Post
I'm sure there should be a more "direct" way to get what you need but this may work for now.

DEFINE FILE CAR
DEAL/D12.2=IF CAR EQ 'DATSUN' THEN 100 ELSE DEALER_COST;
END
TABLE FILE CAR
SUM 
     CAR.BODY.DEAL
COMPUTE PCT_DEAL/I3% = PCT.CAR.BODY.DEAL;
BY  CAR.COMP.CAR
WHERE CAR EQ 'BMW' OR 'DATSUN' OR 'JAGUAR';
ON TABLE NOTOTAL
END


Will give you these results:



By HOLDing those results and excluding the one with 0% would give you:

DEFINE FILE CAR
DEAL/D12.2=IF CAR EQ 'DATSUN' THEN 100 ELSE DEALER_COST;
END
TABLE FILE CAR
SUM 
     CAR.BODY.DEAL
COMPUTE PCT_DEAL/I3% = PCT.CAR.BODY.DEAL;
BY  CAR.COMP.CAR
WHERE CAR EQ 'BMW' OR 'DATSUN' OR 'JAGUAR';
ON TABLE NOTOTAL
ON TABLE HOLD AS HDATA
ON TABLE SET ASNAMES ON
END
GRAPH FILE HDATA
SUM DEAL
BY CAR
WHERE PCT_DEAL GT 0
HEADING CENTER
"CAR SAMPLE GRAPH"
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 200
ON GRAPH SET VAXIS 200
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIESINGL
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET GRAPHSTYLE *
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(5);
setTransparentBorderColor(getSeries(0),true);
setTransparentBorderColor(getSeries(1),true);
setTransparentBorderColor(getSeries(2),true);
setTransparentBorderColor(getSeries(3),true);
setTransparentBorderColor(getSeries(4),true);
setTransparentBorderColor(getSeries(5),true);
setTransparentBorderColor(getSeries(6),true);
setTransparentBorderColor(getSeries(7),true);
setTransparentBorderColor(getSeries(8),true);
setTransparentBorderColor(getSeries(9),true);
setTransparentBorderColor(getSeries(10),true);
setPieDepth(10);
setPlace(true);
setPieLabelDisplay(3);
setDisplay(getLegendArea(),false);
setOtherPieLabelDisplay(3);
setFontName(getTitle(),"SansSerif");
setFillColor(getTitle(),new Color(32,0,32));
setFontStyle(getTitle(),2);
setFontSizeAbsolute(getTitle(),true);
setFontSizeInPoints(getTitle(),10);
setPlaceResize(getTitle(),0);
setTextWrap(getPieLabel(),true);
setGradientDirection(getSeries(0),9);
setFillType(getSeries(0),1);
setFillColor(getSeries(1),new Color(66,102,179));
setFillColor(getSeries(2),new Color(211,203,79));
setFillColor(getSeries(3),new Color(78,143,109));
setFillColor(getSeries(4),new Color(214,130,40));
setFillColor(getSeries(5),new Color(164,120,90));
setFillColor(getSeries(6),new Color(191,68,62));
setFillColor(getSeries(7),new Color(153,102,51));
setFillColor(getSeries(8),new Color(145,165,65));
setFillColor(getSeries(9),new Color(95,160,160));
setFillColor(getSeries(10),new Color(176,96,140));

setFontSizeAbsolute(getPieSliceLabel(),true);
setFontSizeInPoints(getPieSliceLabel(),8);
setPlaceResize(getPieSliceLabel(),0);
setFontSizeAbsolute(getPieLabel(),true);
setFontSizeInPoints(getPieLabel(),8);
setPlaceResize(getPieLabel(),0);
setFillColor(getSeries(0),new Color(118,101,188));
setFontStyle(getPieSliceLabel(),0);
setFontStyle(getPieLabel(),0);
setTransparentBorderColor(getChartBackground(),false);
setPieFeelerTextDisplay(1);
setRect(getPieFrame(),new Rectangle(-15520.0,-13672.0,36373.0,26084.0));
setTextString(getSubtitle(),"\n\n\n");
setTextString(getTitle()," \n");
setDisplay(getTitle(),true);
ENDSTYLE
ON GRAPH SET STYLE *
TYPE=HEADING, LINE=1, ITEM=1, OBJECT=TEXT, SIZE=10, STYLE=BOLD, FONT='ARIAL', JUSTIFY=CENTER, $
ENDSTYLE
END





Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Gold member
posted Hide Post
Thanks njsden...ur code is working.Now i'm not getting 0% in graph.

But i need one clarification: My TABLE FILE request output retrieves two records one is 99% other is 0%. But on holding these values and displaying in graph it shows 100%.
How 99% from TABLE FILE request is changed to 100% in graph?


WebFocus Version 7.7.05
Windows, HTML/PDF/EXL2K/AHTML
 
Posts: 63 | Registered: January 12, 2011Report This Post
Virtuoso
posted Hide Post
Because you're not really plotting the 0% value anymore (the WHERE took that record out), so the remaining dealer cost you put in the pie chart now represents 100% of what's in the graph.

This message has been edited. Last edited by: njsden,



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Gold member
posted Hide Post
Appreciate ur help in providing a solution.Thanks


WebFocus Version 7.7.05
Windows, HTML/PDF/EXL2K/AHTML
 
Posts: 63 | Registered: January 12, 2011Report This Post
Expert
posted Hide Post
I assume that you only want to show whole percentage amounts.

If you want more detail, then try adding this to the graph styling.
setPieFeelerTextFormat(3);


You will find that your example will show Jaguar (.2%) and BMW (99.8%)


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Try:
WHERE TOTAL (name of % field) GE 1;
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Gold member
posted Hide Post
Waz...., setPieFeelerTextFormat(3) is also working. But i need % as a whole number only for my graph.

Doug..., WHERE TOTAL (name of % field) GE 1 is not working


WebFocus Version 7.7.05
Windows, HTML/PDF/EXL2K/AHTML
 
Posts: 63 | Registered: January 12, 2011Report This Post
Expert
posted Hide Post
The reason WHERE TOTAL (name of % field) GE 1 is not working, is that the Graph is calculating the percentage.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved]Remove 0% value from a PIE graph in PDF format

Copyright © 1996-2020 Information Builders