Focal Point
[SOLVED] JSCHART will not shrink to fit screen.

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

November 14, 2017, 01:30 PM
Starr
[SOLVED] JSCHART will not shrink to fit screen.
I have created a pie chart that I am using on a portal. The chart is formatted 'JSCHART', however I have a PDF icon/image in the header that allows the user to run and format in PDF. The chart runs fine but will not auto fit in the window. I 'AUTOFIT' set to on but the legend is not shown and vertical scroll bars appear. I've tried to adjust the VAXIS, I've tried to adjust size using the responsive panel properties in the portal to no avail.

I found a post that suggested that I set the EMBEDHEADING to ON. This got rid of the scroll bars but then my PDF icon/image in the header does not appear and allow for exporting to PDF.

Has anyone encountered this issue? Does anyone have a clue on how to fix? Thanks in advance for your help.

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


WebFOCUS 8206
Exl2k
November 14, 2017, 02:11 PM
Francis Mariani
Please show us your code. Remember to use code tags:
[code]
YOUR CODE HERE
[/code]



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
November 15, 2017, 09:30 AM
Starr
Here is the code using CAR file:
-SET &PDF_IMG = '<img src="/approot/Images/pdf_icon.png" align="absmiddle" width="32" height="32" title="Export to PDF" border="0">';

ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='200.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
-DEFAULTH &WFFMT = 'JSCHART';

DEFINE FILE CAR
PDF_IMG/A200 = IF '&WFFMT' NE 'JSCHART' THEN ' ' ELSE '&PDF_IMG';
END
GRAPH FILE CAR
 SUM CAR.BODY.DEALER_COST
 BY CAR.COMP.CAR
HEADING
"Cars"
"Car Info "
"<PDF_IMG "
ON GRAPH PCHOLD FORMAT '&WFFMT'
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET EMBEDHEADING OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET LOOKGRAPH PIE
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setPieFeelerTextDisplay(1);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
TYPE=HEADING, LINE = 1, JUSTIFY=CENTER, SIZE=11, FONT='ARIAL, HELVETICA, SANS-SERIF', STYLE=BOLD,$
TYPE=HEADING, LINE = 2, JUSTIFY=CENTER, SIZE=9, FONT='ARIAL, HELVETICA, SANS-SERIF', STYLE=BOLD,$
TYPE=HEADING, LINE = 3, JUSTIFY=RIGHT,$

TYPE=HEADING,
     LINE = 3,
	 	 JUSTIFY=RIGHT,
		 OBJECT=FIELD,
	 ITEM=1,
     TARGET='_blank',
	 FOCEXEC=car_piechart3.fex( \
	 WFFMT = 'PDF' \
     ),
$
*GRAPH_SCRIPT
setUseSeriesShapes(true);
setMarkerSizeDefault(50);
setReportParsingErrors(false);
setSelectionEnableMove(false);
setFillColor(getChartBackground(),new Color(236,236,236));
*END
ENDSTYLE
END
-RUN



WebFOCUS 8206
Exl2k
November 15, 2017, 11:32 AM
Starr
I have a solution. I had to set AUTOFIT OFF and use the PDF image in the style. Thanks for viewing everyone.


WebFOCUS 8206
Exl2k
November 15, 2017, 11:35 AM
Fernando
What happens when you remove this code?

ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT


Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
November 15, 2017, 11:53 AM
Starr
When I removed that code the scroll bars still appeared. It seems as if AUTOFIT has to be set to OFF.


WebFOCUS 8206
Exl2k
November 15, 2017, 11:58 AM
Tony A
quote:
ON GRAPH SET EMBEDHEADING OFF

When you have this setting, the chart heading is rendered outside of the resultant SVG. As a consequence, of placing the chart in a container, the width and height of the SVG is sized according to the container width and height (ish). Because the heading is an additional section to the SVG, it will appear that the AUTOFIT hasn't worked.

You can try using EMBEDHEADING ON but I am not sure how the image tag will be rendered. Give it a go and see.

T



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