Focal Point
Pie chart: Show slice label, % value AND true value of slice

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

November 16, 2005, 10:18 AM
jbiwer
Pie chart: Show slice label, % value AND true value of slice
Using WebfOCUS 7.1, is it possible, similar to Excel,
to show all of the following on a pie chart slice:
slice label, % value and true value of the slice.
I don't see that combination avaiable. Thanks for your help.
Jim


Jim Biwer
Cemstone
Mendota Heights, MN
November 16, 2005, 11:59 AM
Tony A
Jim,

In theory it should be possible as both Excel and WebFOCUS use the same basic graphing engine from 3D Graphics. However, I think that you will have to resort to Perspective for Java to achieve it.

When I get more time I'll see if I can locate the necessary code for you. But don't hold your breath!!



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
November 16, 2005, 12:06 PM
Prarie
Sounds like a Job for JG. Smiler


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
JG? Thanks.


Jim Biwer
Cemstone
Mendota Heights, MN
Sorry, he is a great Graph and Java forum member. He'll be able to help.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Jim,

As far as I can see, the closest the PfJ can give you at the moment (version with WF 5.3.2), without resorting to building your applet parameters, is slice labels with integer percentages in brackets -

GRAPH FILE GGSALES
SUM DOLLARS
BY ST
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRAPHSTYLE *
setGraphType(55);
-* 0 = No labels, 1 = Show feeler lines and text, 2 = Labels only, no feeler lines, 3 = Labels on slices
setPieFeelerTextDisplay(1);
-* 0 = Absolute (true) value of slice, 1 = Percent value of slice, 2 = Series Label, 3 = Series Label and Percent value
setPieLabelDisplay(3);
ENDSTYLE
END



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
There is no option to have all three within the API.
The only way that you can do it is to generate your own label array and include it into the API code. (it means however that you cannot use the legend, unless you want the legend to display the % and values as well;

Make sure you use setPieLabelDisplay(2);
  
SET HOLDLIST = PRINTONLY
TABLE FILE CAR
SUM 
 COMPUTE PCTVAL/D5.2=PCT.DEALER_COST; NOPRINT
 COMPUTE GVALUES/A50='"' || COUNTRY || ' ' | FTOA(DEALER_COST, '(D7.0)', 'A9') 
         || '\n(' | FTOA(PCTVAL, '(D5.2)', 'A8') || '%)",';
BY COUNTRY NOPRINT
ON TABLE SAVE
END
-RUN

GRAPH FILE CAR
SUM DEALER_COST
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH SET GRAPHSTYLE *
setSeriesLabelArray(
-INCLUDE SAVE
);
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(2);
setTextFormatPreset(getPieSliceLabel(),2);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(false);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
     PAGESIZE='Letter',
     LEFTMARGIN=0.250000,
     RIGHTMARGIN=0.250000,
     TOPMARGIN=0.250000,
     BOTTOMMARGIN=0.250000,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
ENDSTYLE
END

J.G.

Great implementation of an include. Didn't think of that method - one for the archive I think! Smiler



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
A good tip to remember when working with the graph API is to look at the generated code.

If you SET GRAPHEDIT ON instead of SERVER while developing, view source shows you what the API has generated.

Anything in the API generated part of the code can be overridden by what you put in the WebFocus GRAPHSTYLE part of the style sheet.
This includes labels, data, titles etc.

Using view source shows you the exact syntax that you need.

The most important item for text is the ā€œ\nā€ which forces a line break. This is great for labels and annotations.

JG
J.G.

I have been doing precisely that for many years and have usually a local copy of the perspective manual open on my laptop alongside me. I just never thought about using a save file in that manner. Just goes to show that when you think laterally you can leverage more out of WebFOCUS.

The '\n' for newline (and '\r' for carr. return) are very useful when you want to use alt attributes in an image or hyperlink. ALTs can be used instead of the Div via HTML method shown in "Add Pop-Ups" on the FOCUS on Developers topics.

This message has been edited. Last edited by: Tony A,



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
Tony,

The comments were general and hopefully helpful to those who have not been around quite as long as us.

I would suggest that Jim raise a NFR, as it is a perfectly logical requirement that should not need code manipulation. It should be a standard option.

JG
Hi Jim,

To submit a New Feature Request, please contact Information Builders' Customer Support Services and open a case. You can either call at 1-800-736-6130 (press 1 for WebFOCUS), or access the online system InfoResponse at http://techsupport.ibi.com . Please be ready to provide the information listed here: http://techsupport.informationbuilders.com/before_you_call.jsp .

Hope this helps.

Cheers, Big Grin

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
I have submitted a NFR. Thanks to all.


Jim Biwer
Cemstone
Mendota Heights, MN
Hi -
I was wondering if 'showing all of slice label, % value and true value of the Pie chart slice' is possible in any other way with WF7.
I don't still see that combination available.

Any ideas much appreciated, Thanks for the help!

-Kal.


----------------------------------
WFS - V7.6.8 Servlet on Win2k3 VM, Tomcat, ResourceAnalyzer;
DevStudio - R7.6.8, FlexEnable,VisDis; MRE/BID/self-service/Rcaster/ Office2k3;
DB-SQL2005;