Focal Point
(SOLVED) Need help with creating a combined chart - bar and line

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

August 04, 2016, 12:25 PM
KellyT
(SOLVED) Need help with creating a combined chart - bar and line
I have a chart that runs and it will display the correct line but the bar is displaying the wrong piece of data.
I can not open this chart in info assist for graph because I am using sql pass thru.

Using App Studio 8104


Here is what I would like my chart to look like:

Only one Y axis on the left should be the idlePercent (this will also be the bars)
The X axis is the department name (this is working correctly)

the Line chart will be the YTDCompanyIdle (this line will be just a straight line across) for all of the departments's average but they want it to show where the bars line up with the overall company

The yearNumber is the current year. (I tried removing this but was getting an error saying undetermined string constant)


<
ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='INCHES';
-DEFAULTH &WF_STYLE_HEIGHT='6.21875';
-DEFAULTH &WF_STYLE_WIDTH='10.020833';
-DEFAULTH &WF_TITLE='Idle Percent Monitor';

ENGINE SQLSYB SET DEFAULT_CONNECTION SYBASE
SQL SQLSYB
EX mastersys..IdlePercentMonitor 'N', 'Y'
;
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS IDLEDETAIL
END

DEFINE FILE IDLEDETAIL
convertDate/YYMD=HDATE( IDLEDETAIL.IDLEDETA.incidentDate,'YYMD');
Week/MDYY=(convertDate);
yearNumber/I2=DTPART(convertDate, YEAR);
END

TABLE FILE IDLEDETAIL
SUM
COMPUTE idlePercent/D12.2 = ( IDLEDETAIL.IDLEDETA.interTripIdle / IDLEDETAIL.IDLEDETA.engineTime ) * 100; AS 'Idle %'
BY LOWEST IDLEDETAIL.IDLEDETA.department
BY LOWEST IDLEDETAIL.IDLEDETA.departmentName AS 'Profit Center'
BY IDLEDETAIL.IDLEDETA.YTDCompanyIdle
BY yearNumber
WHERE IDLEDETAIL.IDLEDETA.departmentIncluded EQ 'YES';
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE HOLD AS YTDIDLEDETAIL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = ENblue_theme,
$
TYPE=REPORT,
LINES-PER-PAGE=20,
ARGRAPHENGINE=JSCHART,
$
ENDSTYLE
END


GRAPH FILE YTDIDLEDETAIL
PRINT YTDIDLEDETAIL.YTDIDLED.idlePercent
YTDIDLEDETAIL.YTDIDLED.yearNumber
YTDIDLEDETAIL.YTDIDLED.YTDCompanyIdle
BY YTDIDLEDETAIL.YTDIDLED.departmentName
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 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 VBAR2AX
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setLegendTextAutosize(true);
setUseSeriesShapes(true);
setMarkerSizeDefault(50);
*END
INCLUDE=ENblue_Medium2.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setSeriesType(3,2);
setAxisAssignment( $0, 0);
setAxisAssignment( $1, 0);
setAxisAssignment( $2, 1);
setSeriesType(2,2);

*END
ENDSTYLE
END
-RUN

-*IA_GRAPH_FINISH

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


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
August 05, 2016, 08:25 AM
gregv
KellyT,
Here's one technique you can use, in this situation with SQL pass-through, so you can open the graph in the GUI:
Create a HOLD file from your SQL output and save it with the master in an APP folder then assign the GRAPH to use this hold file. Once you get the look you want you can delete the APP HOLD line and run it with the SQL.
Good luck.



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
August 05, 2016, 11:11 AM
KellyT
Thanks Greg that is a great idea. I ended up just creating a Car File graph and then looking at the code to adjust my report.

I'm still have the same issue. BUT I found a work around. The one set of data that I don't want to show on the report but I have to have in my print statement I just set to be transparent. That way the user won't see the column.

Kind of a weird work around but I had tried everything.

Thanks,
Kelly


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
August 05, 2016, 02:13 PM
susannah
-*[d] charttype 2 is line, 1 is bar; 3 is solid underneath line
setSeriesType(0,2);
setSeriesType(1,&CHARTTYPE );

this works in all my grafs. I have one series always as a line, and the other series the user can pic line bar or solid

does this help?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID