Focal Point
Graph Percentage [SOLVED]

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

July 22, 2009, 05:51 PM
Dgraff
Graph Percentage [SOLVED]
I have a file with many fields that are either '1' or '0' and need to produce a sieries of Graphs. Not a problem simply do a sum of the columns to graph. Kicker is I need to display the percentage of column 1 to column 2 and display this percentage on the report. In other words if column 1 is the number of cases of oranges and column 2 is the total cases of all fruit the percentage I want to display is CASES of ORanges / Total Cases. Now they would like this percentage displayed above the 2 columns. Not another column just the number. Any sugestions.

As another question I once saw a Manuel that listed and described all the styling for Graphs anyone no the name and or a link to the manual.

Thanks

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


Duane

WebFOCUS 8.0.7
DS 8.0.7 AS 8.0.7
Windows
Output: Excel, HTML, PDF, AHTML,Mobile
In Focus 1982
July 22, 2009, 11:41 PM
Doug
About
quote:
I once saw a Manuel that listed and described all the styling for Graphs anyone no the name and or a link to the manual.
Check out threedgraphics.com.

This message has been edited. Last edited by: Doug,
July 23, 2009, 05:18 AM
Danny-SRL
Duane,

By playing a bit with the DS advanced graphics, I came up with the following, using the CAR file. I suppose you could adapt this to your problem:
  
-* File Duane1.fex
-SET &ECHO=ALL;
SET HOLDLIST=PRINTONLY, CENT-ZERO=ON
DEFINE FILE CAR
SALES10/I3=IF SALES GT 10000 THEN 1 ELSE 0;
SALESC/I3 WITH SALES = 1;
END
TABLE FILE CAR
SUM
COMPUTE PC/D6.2%=SALES10 / SALESC * 100;
BY COUNTRY NOPRINT
ON TABLE SAVE
END
-RUN
-SET &RECS=&LINES;
-REPEAT #GETPCT FOR &I FROM 1 TO &RECS;
-READ SAVE,&PC.&I
-TYPE &PC.&I.%
-#GETPCT 
-RUN
-*
-*INTERNAL_PROPERTIES$fieldDisplayMode=label;OBJECTID=GLOBAL
-*INTERNAL_PROPERTIES$enablePreview=true;OBJECTID=GLOBAL
-*INTERNAL_PROPERTIES$prefixDisplayMode=;OBJECTID=GLOBAL
-*INTERNAL_PROPERTIES$GlobalRecordLimit=500;OBJECTID=GLOBAL
-*INTERNAL_PROPERTIES$SampleData=false;OBJECTID=GLOBAL
GRAPH FILE CAR
-* Created by Advanced Graph Assistant
SUM CAR.BODY.SALES10
CAR.BODY.SALESC
BY CAR.ORIGIN.COUNTRY
ON GRAPH PCHOLD AS HOLD FORMAT PNG
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
setReportParsingErrors(false);
setSelectionEnableMove(false);
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setAxisAssignment(1,0);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
-REPEAT #ANNOT FOR &I FROM 1 TO &RECS;
-SET &J=&I - 1;
-SET &XPOS=-16000 + 5800 * &J;
setTextString(getAnnotation(&J),"&PC.&I.%");
setDisplay(getAnnotation(&J),true);
setRect(getAnnotation(&J),new Rectangle(&XPOS,11636.0,8000.0,2036.0));
-#ANNOT
ENDSTYLE
ON GRAPH SET STYLE *
TYPE=REPORT, FONT='TIMES NEW ROMAN', SIZE=10, GRID=OFF, SQUEEZE=ON, $
ENDSTYLE
END

This message has been edited. Last edited by: Danny-SRL,


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

July 24, 2009, 07:20 PM
Doug
Thanks Danny,
Nice innovative use of GRAPHSTYLE looping.
I hope Dgraff can use it. I probably will myself...
July 25, 2009, 02:21 PM
Danny-SRL
You're welcome Doug.
Advanced Graphics has lots of features. Marry that with good old DM and once more WF shows its strength...


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

July 29, 2009, 02:19 PM
Dgraff
Thanks all for the resposes I was able to get it to work and it looks great.


Duane

WebFOCUS 8.0.7
DS 8.0.7 AS 8.0.7
Windows
Output: Excel, HTML, PDF, AHTML,Mobile
In Focus 1982