Focal Point
[CLOSED] Can I remove the () from Pie Chart labels?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8377036176

July 11, 2014, 10:46 AM
Angela Atkinson
[CLOSED] Can I remove the () from Pie Chart labels?
I need to remove the () from around the percentage (17.64%) labels on the pie chart. Is there a graph_script that does this for me?

This message has been edited. Last edited by: <Kathryn Henning>,


7703
July 11, 2014, 11:44 AM
diogopc
quote:
Originally posted by Angela Atkinson:
I need to remove the () from around the percentage (17.64%) labels on the pie chart. Is there a graph_script that does this for me?


Hi Angela,

Welcome to Focal Point!

It's always easier for anyone to help you out if you replicate your problem using any of the sample databases that come with Dev Studio. The most used one is the CAR table.


WebFOCUS App Studio 8103
Windows7
All outputs
July 11, 2014, 12:34 PM
Tom Flynn
Hi Angela,
If you have brackets around a percentage, I will guess that your calculation has a format of something like PROFIT/P9.2BC, which means, the result, if negative, is bracketed.

Is this correct?
Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 14, 2014, 09:44 AM
Angela Atkinson
Correct Tom. But these are not negative numbers nor does my calculation produce negative numbers


7703
July 16, 2014, 09:58 AM
Tom Flynn
Hi Angela,

Well "IF" they are not suppose to be negative, then:
  
COMPUTE NEW_VAL/P7.2% = IF YOUR_COLUMN_NAME LT 0 THEN YOUR_COLUMN_NAME * (-1) ELSE YOUR_COLUMN_NAME;

hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 17, 2014, 10:27 AM
Angela Atkinson
Thanks but I think it has something to do with the setting setPieLabelDisplay(). If I put it as setPieLabelDisplay(0) then it gives me 17.64% but I need more to the label. I need "Trails: 17.64%" which setPieLabelDisplay(4) gives me that but it also adds the () to the percent. I may have to customize my label in the hold file and use it.


7703
July 17, 2014, 01:54 PM
Tom Flynn
Hi Angela,
Well I don't see 4 as a value, but, very good that you are trying things on your own before coming here for answers!!! KUDOS...

Anyway, here is the link that to the guide that IBI uses in their Graph interface...

Perspective for Java Guide

hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 18, 2014, 10:23 PM
David Briars
When you set the PieLabelDisplay property to '3', you will see the series label and then the percent value set off parenthetically:
 APP PREPENDPATH IBISAMP
-RUN
DEFINE FILE CAR
PROFIT/D10.2 = RCOST - DCOST;
END
-*
GRAPH FILE CAR
SUM PROFIT AS ''
BY  COUNTRY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
 INCLUDE=ENgradient_combine.sty,$
-* API methods.
*GRAPH_SCRIPT
 setLegendDisplay(false);
 setPieFeelerTextDisplay(1);
 setPieLabelDisplay(3);
*END
ENDSTYLE
END 


If you want to customize the label, try creating a COMPUTEd field:
 APP PREPENDPATH IBISAMP
-RUN
DEFINE FILE CAR
PROFIT/D10.2 = RCOST - DCOST;
END
-*
TABLE FILE CAR
 SUM PROFIT
 COMPUTE PPERCENT/D10 = PROFIT / TOT.PROFIT * 100;
 COMPUTE CSORT/A50 = 'Country: ' | COUNTRY | 'Percentage: ' | (LJUST(15,(FTOA(PPERCENT,'(D10)','A15')),'A15')) ||
                     '%';
 BY COUNTRY
ON TABLE HOLD AS HLDIT
END
-RUN
-*
GRAPH FILE HLDIT
SUM PROFIT AS ''
BY  CSORT
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
 INCLUDE=ENgradient_combine.sty,$
-* API methods.
*GRAPH_SCRIPT
setLegendDisplay(false);
setPieFeelerTextDisplay(1);
setPieLabelDisplay(2);
*END
ENDSTYLE
END 






Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster