Focal Point
Remove 'space' between title and graph

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

May 15, 2007, 10:20 AM
GELV
Remove 'space' between title and graph
I've tried to remove an extra 'space' between title and graph. It increases depending on the amount of bars in the graph. The type of graph is HBAR.

I've been trying with setRect(getFrame(),new Rectangle(x,y,w,h)) but the space remains.

Any ideas would be helpful. Thanks.


Win2K --- Webfocus 5.3.3
May 15, 2007, 10:45 AM
mgrackin
You may still have the auto positioning turned on. Look into the setPlace(); command.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
May 16, 2007, 04:08 AM
GELV
Thanks for your help.

When I set setPlace(true), the space is removed but some of 01Labels disappear. If setPlace is false, all labels are showed but the space remains.

I save the graph as .gif format.

My code is similar to this:

-SET &NOMGRAPH = 'PROOF';
-SET &MAX = &LINES;
-SET &CONT = 1;
-SET &NGRAPH = &NOMGRAPH || '.GIF';

FILEDEF &NOMGRAPH DISK C:\IBI\APPS\FOLDER\&NGRAPH
SET GRAPHSERVURL= http://localhost/ibi_apps/IBIGraphServlet

GRAPH FILE T_DATA
SUM PERCENT
BY NAME
ON GRAPH SET LOOKGRAPH HBAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D ON
ON GRAPH SET VZERO ON
ON GRAPH SET HAXIS &HAXIS
ON GRAPH SET VAXIS &VAXIS
ON GRAPH SET GRID ON
ON GRAPH SET GRAPHSTYLE *

setFontName(getO1Label(0),"ARIAL");
setAutofit(getO1Label(0),false);
setFontSizeAbsolute(getO1Label(0),true);
setFontSize(getO1Label(0),12);

setFillType(getSeries(0),1);
setFillColor(getSeries(0),new Color(72 61 139));

-REPEAT LOOP WHILE &CONT LE &MAX
setFillType(getSeries(&CONT),1);
setFillColor(getSeries(&CONT),new Color(70,130,180));

-SET &CONT = &CONT + 1;
-LOOP

setDisplay(getY1AltFmtFrame(),true);

setAltFmtFrameNumColors(getY1AltFmtFrame(),10);
setAltFmtFrameSeparator(getY1AltFmtFrame(0),10.0);
setAltFmtFrameSeparator(getY1AltFmtFrame(1),20.0);
setAltFmtFrameSeparator(getY1AltFmtFrame(2),30.0);
setAltFmtFrameSeparator(getY1AltFmtFrame(3),40.0);
setAltFmtFrameSeparator(getY1AltFmtFrame(4),50.0);
setAltFmtFrameSeparator(getY1AltFmtFrame(5),60.0);
setAltFmtFrameSeparator(getY1AltFmtFrame(6),70.0);
setAltFmtFrameSeparator(getY1AltFmtFrame(7),80.0);
setAltFmtFrameSeparator(getY1AltFmtFrame(8),90.0);
setAltFmtFrameSeparator(getY1AltFmtFrame(9),100.0);
setDisplay(getY1AltFmtFrame(0),true);
setDisplay(getY1AltFmtFrame(1),true);
setDisplay(getY1AltFmtFrame(2),true);
setDisplay(getY1AltFmtFrame(3),true);
setDisplay(getY1AltFmtFrame(4),true);
setDisplay(getY1AltFmtFrame(5),true);
setDisplay(getY1AltFmtFrame(6),true);
setDisplay(getY1AltFmtFrame(7),true);
setDisplay(getY1AltFmtFrame(8),true);
setDisplay(getY1AltFmtFrame(9),true);
setFillColor(getY1AltFmtFrame(9),new Color(237,27,51));
setFillColor(getY1AltFmtFrame(8),new Color(244,115,33));
setFillColor(getY1AltFmtFrame(7),new Color(250,163,27));
setFillColor(getY1AltFmtFrame(6),new Color(255,197,12));
setFillColor(getY1AltFmtFrame(5),new Color(255,225,0));
setFillColor(getY1AltFmtFrame(4),new Color(245,239,40));
setFillColor(getY1AltFmtFrame(3),new Color(210,225,118));
setFillColor(getY1AltFmtFrame(2),new Color(171,214,162));
setFillColor(getY1AltFmtFrame(1),new Color(124,205,201));
setFillColor(getY1AltFmtFrame(0),new Color(21,175,229));

setRiserWidth(68);

setY1ScaleMaxAuto(false);
setY1MajorGridStepAuto(false);
setY1MinorGridStepAuto(false);
setY1ScaleMax(120.0);
setY1ScaleMinAuto(false);
setY1ScaleMin(0.0);
setY1MajorGridStep(10);

setMarkerDisplay(true);

setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,1);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(2);
setY1MinorGridDisplay(false);
setY1MinorGridStyle(0);
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);
setFontSizeAbsolute(getO1Label(),true);

setTitleString("GRAPH.GIF");
setFontSizeAbsolute(getTitle(), true);
setFontSizeInPoints(getTitle(), 8);

ON GRAPH SET STYLE *
PAGESIZE='Letter',
LEFTMARGIN=0.000000,
RIGHTMARGIN=0.000000,
TOPMARGIN=0.000000,
BOTTOMMARGIN=0.000000,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
ENDSTYLE
ON GRAPH HOLD AS &NOMGRAPH FORMAT GIF
END
-RUN

Thank you for any help!


Win2K --- Webfocus 5.3.3
September 10, 2007, 11:22 AM
ypatel
I had the same problem, for our pie graph we needed to set graph values and legend font size customized, and for that we have to use
setplace(false);

Try this to remove space between title and pie graph when you have setplace(false); in your code.
-** To position title where ever we want **
setRect(getTitle(), new Rectangle(-15175,10550,29850,1800));

when setplace(false) is used, by default the Title get placed in the top left corner of the graph area.

It worked for me !! Hope it solves your problem too.


-Yogesh Patel
------------------------------------------------------------------------
PROD: WF 764 on Linux Apache tomcat v5.5
DEV: WF 768 on Linux