Focal Point
[SOLVED] Line Graph

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

July 08, 2009, 11:56 AM
Michele
[SOLVED] Line Graph
Does anyone know if a line graph can be saved to an svg image after changing the solid line display to a dotted line display? This is sample code against the Car File. When you run the code below, it will display with solid lines. When you comment out the line that says "ON GRAPH HOLD AS CARGPH FORMAT SVG" the graph will display with dotted lines. Thanks.

GRAPH FILE CAR
SUM SALES RC DC
ACROSS CAR
ON GRAPH HOLD AS CARGPH FORMAT SVG
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRAPHSTYLE *
setDepthRadius(0);
setLineWidth(getSeries(0), 1);
setLineBasicStrokeType(getSeries(0), 5);
setLineWidth(getSeries(1), 1);
setLineBasicStrokeType(getSeries(1), 5);
setLineWidth(getSeries(2), 1);
setLineBasicStrokeType(getSeries(2), 5);
setMarkerDisplay(false);
setPlace(true);
ENDSTYLE
END
-RUN
TABLE FILE CAR
HEADING
"Car File Graph "
SUM CAR NOPRINT
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
LEFTMARGIN=0.500000,
RIGHTMARGIN=0.500000,
TOPMARGIN=0.250000,
BOTTOMMARGIN=0.000000,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=12,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=HEADING,
BACKCOLOR='BLUE',
COLOR='WHITE',
$
TYPE=REPORT,
IMAGE=cargph.svg,
POSITION=(0.597222 1.241667),
SIZE=(8.375000 4.166667),
$
ENDSTYLE
END
-RUN


Michele Brooks
W.F.V. 7.1.7
Operating Sysetms Widows XP 5.1

This message has been edited. Last edited by: Kerry,
July 08, 2009, 03:43 PM
GamP
I tried this and also can not get SVG graph to show in a dotted line in the pdf. It does show in html.
But if you save it as a gif and include the gif in the pdf, then the dotted line is shown like in html.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
July 09, 2009, 09:24 AM
Michele
Can you send me your code? Thanks so much for taking the time. I really appreciate it.
July 09, 2009, 10:19 AM
Francis Mariani
Michele,

Just change
ON GRAPH HOLD AS CARGPH FORMAT SVG
to
ON GRAPH HOLD AS CARGPH FORMAT GIF
and
IMAGE=cargph.svg
to
IMAGE=cargph.gif

This will embed a GIF image instead of the SVG image and you will get the dashed lines.
Unfortunately, GIF files are not as high-quality as SVG files.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
July 09, 2009, 10:46 AM
Michele
I must be missing a command because I got an error when I ran the code below. Thanks.

GRAPH FILE CAR
HEADING
"Car File Graph "
SUM SALES RC DC
ACROSS CAR
ON GRAPH HOLD AS CARGPH FORMAT GIF
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRAPHSTYLE *
setDepthRadius(0);
setLineWidth(getSeries(0), 1);
setLineBasicStrokeType(getSeries(0), 5);
setLineWidth(getSeries(1), 1);
setLineBasicStrokeType(getSeries(1), 5);
setLineWidth(getSeries(2), 1);
setLineBasicStrokeType(getSeries(2), 5);
setMarkerDisplay(false);
setPlace(true);
ENDSTYLE
END
ON GRAPH SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
LEFTMARGIN=0.500000,
RIGHTMARGIN=0.500000,
TOPMARGIN=0.250000,
BOTTOMMARGIN=0.000000,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=12,
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=HEADING,
BACKCOLOR='BLUE',
COLOR='WHITE',
$
TYPE=REPORT,
IMAGE=cargph.gif,
POSITION=(0.597222 1.241667),
SIZE=(8.375000 4.166667),
$
ENDSTYLE
END
-RUN
July 09, 2009, 11:04 AM
Francis Mariani
The END after the first ENDSTYLE should not be there.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
July 09, 2009, 11:12 AM
Michele
I getting this error message

HTTP REQUEST FOR GRAPHSERVURL RETURNED ERROR:
July 09, 2009, 11:13 AM
Francis Mariani
I'd be surprised if you are getting this for GIF files only. Just take the original code you posted and change SVG for GIF.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
July 09, 2009, 11:19 AM
Michele
I tried your suggestion but all I get is the heading. The graph image does not appear.
July 10, 2009, 06:25 AM
<JG>
Michele,

The code you have posted is totally incorect.

You have no TABLE request so the second part of the styling is not possible.

A graph cannot include its self into its self.

Look at the original code you posted and you will see your error
July 10, 2009, 07:43 AM
GamP
As JG stated, go back to your original code, change the SVG for GIF and rerun the request.
If that is what you did which then resulted in the graphservurl error message, then add to your code (before the first graph):
SET GRAPHSERVURL=''
and then rerun it. This should resolve the problem.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
July 10, 2009, 09:57 AM
Michele
Pasted below is my revised code. When I run this code I just get the heading of the report, but no graph. Can a graph be inserted into a html report via the stylesheet, or does it have to been inserted another way?

SET GRAPHSERVURL=http://webfoct1/ibi_apps/IBIGraphServlet
APP HOLD ibisamp
FILEDEF CARGPH DISK /webfoc53/ibi/ibcapps/ibisamp/cargph.gif
-RUN
GRAPH FILE CAR
SUM SALES RC DC
ACROSS CAR
ON GRAPH HOLD AS CARGPH FORMAT GIF
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRAPHSTYLE *
setDepthRadius(0);
setLineWidth(getSeries(0), 1);
setLineBasicStrokeType(getSeries(0), 5);
setLineWidth(getSeries(1), 1);
setLineBasicStrokeType(getSeries(1), 5);
setLineWidth(getSeries(2), 1);
setLineBasicStrokeType(getSeries(2), 5);
setMarkerDisplay(false);
setPlace(true);
ENDSTYLE
END
TABLE FILE CAR
HEADING
"Car File Graph "
SUM CAR NOPRINT
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
LEFTMARGIN=0.500000,
RIGHTMARGIN=0.500000,
TOPMARGIN=0.250000,
BOTTOMMARGIN=0.000000,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=12,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=HEADING,
BACKCOLOR='BLUE',
COLOR='WHITE',
$
TYPE=REPORT,
IMAGE=cargph.gif,
POSITION=(0.597222 1.241667),
SIZE=(8.375000 4.166667),
$
ENDSTYLE
END
-RUN
July 12, 2009, 04:48 AM
GamP
The technique of inserting an image in the heading of the report is for PDF only (ok, it could maybe also be used for Excel). For HTML it is sufficient to do a PCHOLD FORMAT GIF, and then folllow it up with the table request without the image in the heading. For HTML the heading technique will not work, as you noticed.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
July 13, 2009, 05:40 AM
Tony A
To help with getting graphs into the various formats used and to reiterate a point made many moons ago when this subject was raised (as it has sooooooooooooooooooo many times Wink)

For PDF - the file has to exist in your APP PATH (including the EDATEMP folder) for WF to be able to include it in the resultant PDF file. This is because the PDF file is compiled on the reporting server and is then sent to your browser as a complete stream.

For HTML - the file has to exist in a location accessible via a URL. This normally means that the file is held on the client server although it could be and web accessible location.

For Excel - the file must be available to the Excel application. This means that the file needs to be accessible via a network share or other local / network folder and referenced correctly internally to the Excel file.

Remember these three main points and direct your output accordingly and you shouldn't have too many problems - but then again I am sure some of you will Razzer

Of course, coding and / or style sheets will be different for each format as well.

T

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 
July 13, 2009, 09:34 AM
Michele
Thanks so much. I followed your suggestion and did get the graph to display in html format. I'm assuming that I can't save a graph in html format and then imbed the graph image into a report. Thanks again.
quote:
Originally posted by GamP:
The technique of inserting an image in the heading of the report is for PDF only (ok, it could maybe also be used for Excel). For HTML it is sufficient to do a PCHOLD FORMAT GIF, and then folllow it up with the table request without the image in the heading. For HTML the heading technique will not work, as you noticed.

July 13, 2009, 09:35 AM
Michele
Thanks Tony. I will save this information for future reference.
quote:
Originally posted by Tony A:
To help with getting graphs into the various formats used and to reiterate a point made many moons ago when this subject was raised (as it has sooooooooooooooooooo many times Wink)

For PDF - the file has to exist in your APP PATH (including the EDATEMP folder) for WF to be able to include it in the resultant PDF file. This is because the PDF file is compiled on the reporting server and is then sent to your browser as a complete stream.

For HTML - the file has to exist in a location accessible via a URL. This normally means that the file is held on the client server although it could be and web accessible location.

For Excel - the file must be available to the Excel application. This means that the file needs to be accessible via a network share or other local / network folder and referenced correctly internally to the Excel file.

Remember these three main points and direct your output accordingly and you shouldn't have too many problems - but then again I am sure some of you will Razzer

Of course, coding and / or style sheets will be different for each format as well.

T