[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.
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...
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