Focal Point
[CLOSED] Styling multiple heading lines in graph

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

September 06, 2017, 08:39 AM
CuriousDev
[CLOSED] Styling multiple heading lines in graph
Hi All,

I am facing an issue with headings in graph.

Case1: Graph headings in “HEADING” part of the code with ON GRAPH SET EMBEDHEADING ON option.
It ignores the different styling of the heading lines and left aligned.

Case2: Graph headings in “HEADING” part of the code with ON GRAPH SET EMBEDHEADING OFF option.
Heading styling applied to all the lines as expected but headings are centered according to the page instead of graph.

Case3: Graph headings using JSON properties can add only 2 line of heading 3rd line of heading not possible using JSON properties

title: {
text: 'Heading line 1,
visible: true,
align: 'center',
font: 'Bold 14pt Arial',
color: '#e1e1e1',
},
subtitle: {
text: ‘Heading line 2’,
visible: true,
font: 'Bold italic 12pt Arial',
color: '#A2C5F6',
},

Question: Is there a way to add 3rd line using JSON or is there a way to apply different styling to heading lines and center them according to the graph?

Please refer to the sample graph code below using car file.
-******************************************************************
ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE car
SUM CAR.BODY.SALES
BY CAR.ORIGIN.COUNTRY
HEADING
"This is First Line"
" "
"This is Second Line"
" "
"This is Third Line"
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRWIDTH 1

ON GRAPH SET EMBEDHEADING ON

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 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET AUTOFIT OFF
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setReportParsingErrors(false);
setSelectionEnableMove(false);
*END

TYPE=HEADING, LINE= 1,JUSTIFY=CENTER, FONT='ARIAL', SIZE=14, COLOR=RGB(255 50 100), STYLE=NORMAL, $
TYPE=HEADING,LINE= 3, JUSTIFY=CENTER, FONT='ARIAL', SIZE=12, COLOR=RGB(30 128 245), STYLE=NORMAL, $
TYPE=HEADING, LINE= 5,JUSTIFY=CENTER, FONT='ARIAL', SIZE=10, COLOR=RGB(150 80 192), STYLE=NORMAL, $

ENDSTYLE
END
-RUN
-********************************************************************************

Thanks

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
September 08, 2017, 04:06 PM
ebaig
Could try holding your chart, then calling it using the !IBI.FIL command:

ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
GRAPH FILE car
SUM CAR.BODY.SALES
BY CAR.ORIGIN.COUNTRY
ON GRAPH HOLD AS BAR_CHART FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET EMBEDHEADING ON
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 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET AUTOFIT OFF
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setReportParsingErrors(false);
setSelectionEnableMove(false);
*END
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
<TABLE>
<TR><TD ALIGN=CENTER><div style="color:blue;font-size:25px">line block 1</div></TD></TR>
<TR><TD ALIGN=CENTER style="color:red">line block 2</TD></TR>
<TR><TD>!IBI.FIL.BAR_CHART;</TD></TR>
</TABLE>

-HTMLFORM END


Erfan


WebFOCUS 77, Windows, HTML PDF EXCEL
September 12, 2017, 04:24 PM
Mike in DeLand
Try your Case#2, but set AUTOFIT ON. The graph and centered titles line up nice, and the left-justified lines stay on the left. I had the same dilema - I wanted some heading lines centered, but my last 2 lines I wanted on the left. Works!


Webfocus 8
Windows, Linux