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] Getting rid of extra spacing befor and after a graph

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Getting rid of extra spacing befor and after a graph
 Login/Join
 
Guru
posted
Here is a fex that creates html output
It has several items, but the basic structure is:
text
graph
text

  
-SET &ECHO=ALL;

-* Get the index data
-SET &ERRTXT='No Index Data';
SET EQTEST = EXACT
TABLE FILE CAR
SUM
 CAR AS 'SHORTNAME'
 COMPUTE WGT/P9.2%=SALES / 100000;
 COMPUTE JFIELD/I1=1;
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS SLIST2 FORMAT FOCUS INDEX JFIELD
END
-RUN
-IF &LINES EQ 0 THEN GOTO ERR;
-SET &IDXLINES=&LINES;

TABLE FILE CAR
PRINT
 COMPUTE JFIELD/I1=1;
 COMPUTE TCOM/A1000=COUNTRY;
 WHERE RECORDLIMIT EQ 1
ON TABLE HOLD SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HCOM FORMAT FOCUS INDEX JFIELD
END
-RUN
-SET &CTEST=&LINES;
-SET &COMTLINES=&LINES;
-SET &ERRTXT='No Data';

TABLEF FILE CAR
PRINT
 SALES AS 'AMVALUE'
 COUNTRY AS 'CATEGORYNAME'
ON TABLE SET HOLDATTR ON
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS HAMRPT1
END
-RUN
-IF &LINES EQ 0 THEN GOTO ERR;

TABLE FILE HAMRPT1
SUM
 AMVALUE AS 'DISPLAYVALUE'
BY CATEGORYNAME
ON TABLE SET HOLDMISS ON
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS HSHRP1
END
-RUN
-SET &AMLINES=&LINES;
-IF &LINES EQ 0 THEN GOTO ERR;

-SET &LN1=' ';
-SET &LN2=' ';
TABLE FILE HSHRP1
PRINT
 COMPUTE CNT/I5=CNT + 1; NOPRINT
 COMPUTE MVAL/D9.1=DISPLAYVALUE; NOPRINT
 COMPUTE AMVAL/A9=FTOA (MVAL, '(D8.1)', AMVAL); NOPRINT
 COMPUTE BMVAL/A9=LJUST(9, AMVAL, BMVAL); NOPRINT
 COMPUTE LN1/A19=IF &CTEST NE 1 THEN '$' || BMVAL || (' ' | 'Billion*') ELSE '$' || BMVAL || (' ' | 'Billion '); NOPRINT
 COMPUTE LN2/A19=IF CNT EQ 1 THEN LN1 ELSE LN1;
 DISPLAYVALUE NOPRINT
IF RECORDLIMIT EQ 2
IF READLIMIT EQ 2
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS HSHAM FORMAT ALPHA
END
-RUN
-READ HSHAM NOCLOSE &LN1.A19.
-READ HSHAM NOCLOSE &LN2.A19.
-CLOSE HSHAME

-SET &TLN1=TRUNCATE('&LN1.EVAL');
-SET &TLN2=TRUNCATE('&LN2.EVAL');

-SET &OUTAPP = '\\' || &MYSERV || '\apps\DD\';
APP MAP OUTAPP &OUTAPP
-RUN

-* Create the chart portion
SET GRAPHSERVURL=' '
GRAPH FILE HSHRP1
SUM
 DISPLAYVALUE AS ''
ACROSS CATEGORYNAME
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 210
ON GRAPH SET VAXIS 255
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIERING
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON TABLE HOLD AS OUTAPP/SHAMG2 FORMAT PNG
ON GRAPH SET GRAPHSTYLE *
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDepthRadius(5);
setFillColor(getSeries(0),new Color(61,128,161));
setFillColor(getSeries(1),new Color(86,155,190));
setFillColor(getSeries(2),new Color(140,186,212));
setFillColor(getSeries(3),new Color(209,117,25));
setFillColor(getSeries(4),new Color(182,102,22));
setPieDepth(10);
setPieFeelerTextDisplay(1);
setTransparentBorderColor(getChartBackground(),true);
setFontName(getPieSliceLabel(),"CALIBRI");
setFontSizeAbsolute(getPieSliceLabel(), true);
setFontSizeInPoints(getPieSliceLabel(), 9);
setPlaceResize(getPieSliceLabel(), 0);
setLegendAutomatic(true);
setDisplay(getLegendArea(),true);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setPieRingSize(55);
setTextAntialiasing(true);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setTextFormatPattern(getY1Label(),"#.##");
setTextFormatPreset(getPieSliceLabel(),4);
setFontName(getLegendText(),"CALIBRI");
setFontSizeAbsolute(getLegendText(), true);
setFontSizeInPoints(getLegendText(), 9);
setPlaceResize(getLegendText(), 0);
setLegendTextAutofit(false);
setLegendMarkersPerRow(3);
setDisplay(getPieRingLabel(),false);
setRect(getPieFrame(),new Rectangle(-16000.0,-10000.0,32000.0,25000.0));
setPieLabelDisplay(1);
setPlace(false);
-*setRect(getLegendArea(),new Rectangle(-15000.0,-14000.0,31000.0,8000.0));
setRect(getLegendArea(),new Rectangle(-15000.0,-12000.0,31000.0,6000.0));
setLegendAutomatic(false);
setLegendPosition(-1);
ENDSTYLE
END
-RUN
-*-IF &RECORDS EQ 0 THEN GOTO ERR;
-SET &GRLINES=&LINES;

SET CSSURL=http://&MYSERV.EVAL/DD/WFSNAP.css
-* Create the report
-SET &ERRTXT='No Report Data';

JOIN JFIELD IN SLIST2 TO JFIELD IN HCOM AS J0.
DEFINE FILE SLIST2
 TDAY/I8YYMD=&YMD;
 BUSINESSDATE/YYMD=TDAY;
 ABDATE/A26='As of: ' | DATETRAN(BUSINESSDATE, '(MDYY)', '(BtrdD)', 'EN', 19, 'A19');
 IMG/A100='[IMG]http://&MYSERV.EVAL/DD/SHAMG2.PNG[/IMG]';
 BL/A1=' ';
END
TABLE FILE SLIST2
PRINT
 BL AS ''
 SHORTNAME AS ''
 WGT AS ''
 COMPUTE DIR/A12=IF WGT GT 0 THEN 'arrows_06' ELSE IF WGT LT 0 THEN 'arrows_03' ELSE 'arrows_04'; NOPRINT
 COMPUTE IMG/A255 = '<IMG SRC="http://&MYSERV.EVAL/DD/' || DIR || '.jpg" style="vertical-align:middle">'; AS ''
 BL AS ''
 TCOM NOPRINT
BY HIGHEST 1 BUSINESSDATE NOPRINT
ON TABLE SUBHEAD
"Spacing Report"
"&TLN1.EVAL"
"&TLN2.EVAL"
"<IMG"
"<TCOM"
""
"Extra Sales"
"<ABDATE"
ON TABLE SET PAGE NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS OUTAPP/WFSNAP FORMAT HTML
ON TABLE SET HTMLCSS OFF
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
LEFTMARGIN=0.000005,
RIGHTMARGIN=0.000005,
TOPMARGIN=0.000005,
BOTTOMMARGIN=0.000005,
$
TYPE=REPORT,
GRID=OFF,
BACKCOLOR='NONE',
CLASS=report8,
STYLE=NORMAL,
$
TYPE=TABHEADING,
LINE=1,
CLASS=heading20c,
$
TYPE=TABHEADING,
LINE=2,
TARGET=_top,
CLASS=heading11c,
$
TYPE=TABHEADING,
LINE=3,
CLASS=heading11c,
$
TYPE=TABHEADING,
LINE=4,
CLASS=graph1,
$
TYPE=TABHEADING,
LINE=5,
CLASS=wheading8,
$
TYPE=TABHEADING,
LINE=6,
CLASS=heading8,
$
TYPE=TABHEADING,
LINE=7,
CLASS=heading11c,
$
TYPE=TABHEADING,
LINE=8,
CLASS=heading11c,
$
TYPE=TABHEADING,
LINE=9,
CLASS=heading8c,
$
TYPE=DATA,
CLASS=data8,
$
TYPE=TABFOOTING,
LINE=2,
CLASS=foot8,
$
ENDSTYLE
END
-RUN
-SET &IDXLINES2=&LINES;
-IF &LINES EQ 0 THEN GOTO ERR;

-DONE
-EXIT

-ERR
TABLE FILE CAR
PRINT
 COMPUTE ERR/A256='&ERRTXT';
 CAR NOPRINT
 IF RECORDLIMIT EQ 1
END
-RUN



css is:

  
.report1 { font-family:CALIBRI; font-size:1pt; }
.report4 { font-family:CALIBRI; font-size:4pt; }
.report8 { font-family:CALIBRI; font-size:8pt; }

.heading4 { font-family:CALIBRI; font-size:4pt; }
.heading8 { font-family:CALIBRI; font-size:8pt; }
.heading8c { font-family:CALIBRI; font-size:8pt; text-align:center; }
.heading11 { font-family:CALIBRI; font-size:11pt; }
.heading11c { font-family:CALIBRI; font-size:11pt; text-align:center; }
.heading16c { font-family:CALIBRI; font-size:16pt; text-align:center; }
.heading20c { font-family:CALIBRI; font-size:20pt; text-align:left; color: #367a99; border-bottom: 1px solid; border-bottom-color: #529cbe;}

.data8 { font-family:CALIBRI; font-size:8pt; }

.foot8 { font-family:CALIBRI; font-size:8pt; }
.foot8c { font-family:CALIBRI; font-size:8pt; text-align:center;}

a:link { color:#529CBE; text-decoration:underline; }
a:visited { color:#b6b6b6; text-decoration:none; }
a:hover { color:#529cbe; text-decoration:underline; }
a:active { color:#b6b6b6; text-decoration:none; }
body { padding: 0; margin: 0; }

.graph1 {margin: 0px; vertical-align:top; padding:0px; border-top: 1px solid; border-bottom: 1px solid; border-top-color: #529cbe; border-bottom-color: #529cbe;}

.wheading8 {font-family:CALIBRI; font-size:8pt; text-wrap: normal; word-wrap: break-word; max-width:50px; word-wrap: break-word; word-break: break-all; white-space: normal;}



If you run it you will see that there is extra space at the top of the graph and at the bottom.

I create png file via the graph command and then save it to a directory that has an alias.

MYSERV is a variable containing the name of my server.

How can I get rid of it?

Fernando

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


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
 
Posts: 278 | Registered: October 10, 2006Report This Post
Gold member
posted Hide Post
Sorry I didn't ran your code. But while looking at it I think you can try something like this:-

IMAGE /A255 = '"YOUR IMAGE SCR"  style="vertical-align:middle; margin-top :-10px; margin-bottom: -10px;">';  
 


You might have to adjust top and bottom pixel.


WebFOCUS 7.7. Windows Server 2008. All Outputs.

WEBFOCUS 7.6.11. Windows Server 2003. All Outputs.
 
Posts: 60 | Registered: July 10, 2012Report This Post
Guru
posted Hide Post
I have tried to adjust the margins. The graph contains the extra spaces.

Note: I am using IE 9 in case that matters.

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
 
Posts: 278 | Registered: October 10, 2006Report This Post
Virtuoso
posted Hide Post
setPlace(true);

Yours is set to false. See if that helps.
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Gold member
posted Hide Post
How many across value do you have ? If there are only few then I will try reducing
 ON GRAPH SET VAXIS 
value, because you graph might not need 255 pixel of height.


WebFOCUS 7.7. Windows Server 2008. All Outputs.

WEBFOCUS 7.6.11. Windows Server 2003. All Outputs.
 
Posts: 60 | Registered: July 10, 2012Report This Post
Guru
posted Hide Post
Using

setPlace(true);  


makes it ignore my movement and sizing of the frame.


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
 
Posts: 278 | Registered: October 10, 2006Report This Post
Guru
posted Hide Post
quote:
ON GRAPH SET VAXIS


The on graph set ... worked


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
 
Posts: 278 | Registered: October 10, 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] Getting rid of extra spacing befor and after a graph

Copyright © 1996-2020 Information Builders