Focal Point
[CASE-CLOSED]PDF Chart Series Color Not Matching JSCHART Color

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

September 19, 2018, 03:25 PM
MartinY
[CASE-CLOSED]PDF Chart Series Color Not Matching JSCHART Color
Hi folks,

I have an issue where I want to produce a chart in PDF that will color the series the same way as in JSCHART.

When running sample-1 1996 is displayed in orange and 1997 in green even for Region West where no 1996 exist

When running sample-2 1996 is displayed in orange and 1997 in green. But for Region West where no 1996 exist, it's displayed in orange.

I have tried several ways to have it work as in sample-1 but no success.

Does someone has the magic trick to do it ?

Sample-1 (JSCHART)
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_TITLE='WebFOCUS Report';

DEFINE FILE GGSALES
YR /YY = DATE;
MTH /MONTH = DATE;
DOL /I8 = IF REGION EQ 'West' AND YR EQ 1996 THEN 0 ELSE DOLLARS;
END
TABLE FILE GGSALES
SUM DOL
BY REGION
BY YR
BY MTH
WHERE DOL NE 0;
ON TABLE HOLD AS EXTDATA
END
-RUN

GRAPH FILE EXTDATA
SUM DOL AS '$'
BY REGION AS 'Region'
BY YR  AS 'Year'
BY MTH AS 'Month'

ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 3
ON GRAPH SET UNITS PIXELS
ON GRAPH SET HAXIS '320.0'
ON GRAPH SET VAXIS '175.0'
ON GRAPH SET LOOKGRAPH LINE
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setUseSeriesShapes(true);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
DEFMACRO=PREVYR,    MACTYPE=RULE, WHEN=YR EQ '1996', $
DEFMACRO=THISYR,    MACTYPE=RULE, WHEN=YR EQ '1997', $
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
TYPE=DATA, COLUMN=N1,  BUCKET=page,    $
TYPE=DATA, COLUMN=N2,  BUCKET=color,   $
TYPE=DATA, COLUMN=N3,  BUCKET=x-axis,  $
TYPE=DATA, COLUMN=N4,  BUCKET=y-axis,  $
TYPE=DATA, COLUMN=N4,  MACRO=PREVYR, COLOR=RGB(217 137 17), $
TYPE=DATA, COLUMN=N4,  MACRO=THISYR, COLOR=RGB(8 97 74), $
TYPE=HEADING, JUSTIFY=CENTER, FONT='TIMES NEW ROMAN', SIZE=10, COLOR=RGB(8 97 74), STYLE=NORMAL, $
TYPE=FOOTING, JUSTIFY=RIGHT, FONT='TIMES NEW ROMAN', SIZE=8, COLOR=RGB(32 0 32), STYLE=NORMAL, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setDisplay(getY1Title(),false);
setDisplay(getY1Label(),false);
setDisplay(getY1AxisLine(),false);
setDisplay(getY1MajorTick(),false);
setLabelStagger(getO1Label(),true);
setMarkerShape(getAllSeries(),2);
setDisplay(getLegendArea(),false);
setTextRotation(getO1Label(),3);
*END
*GRAPH_JS_FINAL
"blaProperties": {
    "seriesLayout": 'absolute',
},
"agnosticSettings": {
    "chartTypeFullName": "Line_Absolute"
}
*END
ENDSTYLE
END
-RUN


Sample-2 (PDF)
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET GRAPHDEFAULT=OFF
-DEFAULTH &WF_TITLE='WebFOCUS Report';

DEFINE FILE GGSALES
YR /YY = DATE;
MTH /MONTH = DATE;
DOL /I8 = IF REGION EQ 'West' AND YR EQ 1996 THEN 0 ELSE DOLLARS;
END
TABLE FILE GGSALES
SUM DOL
BY REGION
BY YR
BY MTH
WHERE DOL NE 0;
ON TABLE HOLD AS EXTDATA
END
-RUN

GRAPH FILE EXTDATA
SUM DOL AS '$'
BY REGION AS 'Region'
BY YR AS 'Year'
ACROSS MTH AS 'Month'
ON GRAPH PCHOLD FORMAT PDF
ON GRAPH SET VZERO OFF
ON GRAPH SET GRWIDTH 1
ON GRAPH SET HAXIS 10.0
ON GRAPH SET VAXIS 8.0
ON GRAPH SET UNITS INCHES
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 1
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setDepthRadius(0);
setUseSeriesShapes(true);
setPlace(true);
setPieDepth(0);
setPieTilt(0);
setCurveFitEquationDisplay(false);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, LEFTMARGIN=0.005208333333333333, TOPMARGIN=0.005208333333333333, RIGHTMARGIN=0.005208333333333333, BOTTOMMARGIN=0.005208333333333333, ORIENTATION=LANDSCAPE, $
TYPE=HEADING, JUSTIFY=CENTER, FONT='TIMES NEW ROMAN', SIZE=10, COLOR=RGB(8 97 74), STYLE=NORMAL, $
TYPE=FOOTING, JUSTIFY=RIGHT, FONT='TIMES NEW ROMAN', SIZE=8, COLOR=RGB(32 0 32), STYLE=NORMAL, $
*GRAPH_SCRIPT
setMarkerSizeDefault(50);
setReportParsingErrors(false);
setSelectionEnableMove(false);
setTextRotation(getO1Label(),3);
setLegendPosition(1);
setMarkerShape(getAllSeries(),2);
setFillColor(getSeries(0),new Color(242,148,47));
setTransparentBorderColor(getSeries(0), true);
setFillColor(getSeries(1),new Color(8,97,74));
setTransparentBorderColor(getSeries(1), true);
setFontSizeAbsolute(getLegendText(),true);
setAutofit(getLegendText(),false);
setFontSizeInPoints(getLegendText(),9);
setPlaceResize(getLegendText(),0);
*GRAPH_JS_FINAL
"pieProperties": {
    "holeSize": "0%"
},
"blaProperties": {
    "seriesLayout": "stacked"
},
"agnosticSettings": {
    "chartTypeFullName": "Line_Stacked"
}
*END
ENDSTYLE
END
-RUN

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


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
September 20, 2018, 04:38 AM
Frans
Not a direct help, but there is a case to have JSCHART output with PDF. Somewhere targeted post 8204, if more people open a case for this we might get it quicker and we don't need separate styling for PDF and JSCHART anymore Smiler


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
September 20, 2018, 07:29 AM
MartinY
Thanks Frans for the info.

Before someone else notice I forget to mentioned that : I know that I don't have any styling condition in the Sample-2 (PDF) but no matter what I try the condition is never properly evaluated in PDF format.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
September 24, 2018, 01:52 PM
FP Mod Chuck
Martin

I suggest you open a case to get to the bottom of this one.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
September 25, 2018, 09:40 AM
MartinY
Hi Chuck,

The case is already open, I was just looking if I can have an answer from the community.
Sometime, someone already know the answer.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 04, 2018, 03:29 PM
MartinY
Here is the answer from Tech Support
The reason this does not work in PDF is due to the use of different engines to generate the graphs.
There appears to be an issue with this type of traffic lighting in the charts that use the old engine (PNG, PDF, SVG, etc.)
This is something that should be corrected when formats like PDF begin being generated by the same engine as JSCHART graphs, which is currently being worked on for 8205. 

Programming is not accepting any requests for changes to this old engine at this time.
Unfortunately all that I can recommend at this time is that you use a JSCHART graph when trying to traffic light a multigraph as in your example here. 



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007