Focal Point
[SOLVED] Footnote in graphs in PDF format

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

February 21, 2010, 07:41 AM
Priya
[SOLVED] Footnote in graphs in PDF format
Hi,
I am displaying charts side-by-side in PDF format (6 charts per page).My requirement is to include footnote at the bottom of each chart. This is the command that I am using from the graph pdf help doc:
setFootnoteString("text");
setTextWrap(getFootNote(),true);
Also I have set the position of the footnote using setRect().
When the footnote extends to more than 4 lines,the text gets truncated.I have tried changing setRect's width, height,X and Y axis also.But it does'n work.Is there a way I can enable some scrolling for the footnote,so that the user can scroll and see the entire footnote string .?

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


769
Windows

Using all the above
February 21, 2010, 03:57 PM
Waz
Setting the size of the footing area should work, can you post your code ?.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 22, 2010, 02:30 AM
Priya
Hi,
Please find the code below. I have included the styling for the foot note also. Since the foot note is too large, its getting truncated.

SQL SQLORA SET SERVER DRUTIL
SQL SQLORA

SELECT
START_WEEK,
GROUP_FLD AS GROUP_FLD,
SUM(NETX360_UNI_LOGINS)/SUM(UNIQUE_LOGINS) AS PER
FROM PROD_LOGINS_WEEKLY_TEMP
WHERE GROUP_FLD IS NOT NULL
AND START_WEEK BETWEEN (TRUNC(SYSDATE,'DAY')+1)-70 AND ((TRUNC(SYSDATE,'DAY')+1)-7)+ 6
GROUP BY GROUP_FLD,START_WEEK ORDER BY START_WEEK ;

SQL SQLORA END SESSION;

TABLE FILE SQLOUT
PRINT
*
AND
COMPUTE TIMELINE/HMtD=START_WEEK;
ON TABLE HOLD AS GRAPH1
END


GRAPH FILE GRAPH1
SUM
PER AS ''
ACROSS TIMELINE AS ''
BY GROUP_FLD AS '' NOPRINT
ON GRAPH HOLD AS GRAPH1_IMG FORMAT GIF
ON GRAPH SET LOOKGRAPH VLINE
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 GRMERGE ON
ON GRAPH SET VAXIS 230
ON GRAPH SET HAXIS 431
ON GRAPH SET GRAPHSTYLE *



setFootnoteString("Diagram 6 - illustrates the trend in NetX360 logins at a firm level by Phase.The data captures the number of users within an IBD that logged into NetX360 at least 1x during the week period (M-F).Customer base includes DBS,GSS & NC.Total Phase 1 firms 451.Total Phase 2 firms 240.Total Phase 3 firms 75.Total Phase 4 firms 25.Phase 1 period Aug 09-Dec 09.Phase 2 period Oct 09-Feb 10.Phase 3 period Dec 09-Apr 10.Phase 4 period Dec 09-Jun 10");setFootnoteDisplay(true);
-*setFootnoteAutofit(true);
setFontSizeVC(getFootnote(),1080);
setFontName(getFootnote(),"Courier New");
setRect(getFootnote(),new Rectangle(-13278,-21700,29999,10990));
setTextWrap(getFootnote(), true);

ENDSTYLE
END


TABLE FILE SYSCOLUM
" "
SUM TBNAME NOPRINT
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET PAGE-NUM OFF
IF READLIMIT EQ 1
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE = REPORT,IMAGE=GRAPH1_IMG.gif,POSITION=(0.338 6.83), DIMENSION=(3.8 2.4),$
TYPE=REPORT,PAGE-LOCATION=OFF,$
END


769
Windows

Using all the above
February 22, 2010, 04:09 PM
Waz
From what I can see, you have two options.

1. drop the font size, I tested at 880 instead of 1080, seems to be OK.

2. Make the area for the graph smaller, and the footnote rectangle larger.

If you add the lines below to the graph style, it will show you the size of things.
setDisplay(getFootnoteBox(), true);
setBorderType(getFootnoteBox(), 2);
setFillColor(getChartBackground(),new Color(255,255,0));


As an example, if you change the chart frame size to setRect(getFrame(),new Rectangle(-14000,-7000,29000,21000));, you can change the size and position of the chart, then you can make the footnote larger.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 23, 2010, 12:43 AM
Priya
Hi,

Thanks for the workaround. This way the chart looks much better.

Thanks


769
Windows

Using all the above
February 23, 2010, 03:20 AM
Ram Prasad E
Priya,

Just add the below code, this will enable wordwrap.

setPlaceAlign(getFootnote(),0);
setPlaceWordWrap(getFootnote(),0);
setPlace(true);


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
February 23, 2010, 03:27 PM
Waz
This isn't a workaround, its a way of visualising where things are in the graph, a technique.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 23, 2010, 06:43 PM
Doug
Another technique is to use Annotations. Consider the following. You may be able to work with them a bit easier.
setTextString(getAnnotation(0),"Annotation Text");
setDisplay(getAnnotation(0),true);
setFontSizeAbsolute(getAnnotation(0),true);
setFontSizeInPoints(getAnnotation(0),10);
setDisplay(getAnnotationBox(0),true);
setRect(getAnnotation(0),new Rectangle(-16000.0,-287.0,8000.0,1916.0));

February 24, 2010, 06:20 AM
<JG>
truncation occurs because of the line length

The best solution is to force the wrap of the text by inserting your own line feed. This avoids the truncation

setTextString(getFootnote(),"A very long foootnote line 1\n line 2\n line 3\n line 4\n line 5\n line 6\n line 7\n line etc.");

You do not need any other API calls as the graph will resize automatically
March 02, 2010, 01:00 AM
Priya
Thanks for the update.it works fine.


769
Windows

Using all the above