Focal Point
[CLOSED]Graphing Time

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

March 29, 2016, 02:27 PM
Tim P.
[CLOSED]Graphing Time
In WF8, I'm trying to graph a time field by date on a vertical bar chart. I've tried a few different formats for time but none of them seem to work. The report just shows up blank with no data.

Has anyone tried this before? Is there a specific format I have to use? I feel like this should be a simple thing to do but it is escaping me.

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
March 29, 2016, 02:34 PM
MartinY
Have you tried to convert the time field as a plain text (using FPRINT) ?


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
March 31, 2016, 07:15 AM
Tim P.
I have to be honest I'm a bit naïve on FPRINT but I can give it a shot.


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
March 31, 2016, 07:30 AM
MartinY
But attention on the fact that it will become an alpha, so it will be ordered alphabetically.
You may need to add a BY ... NOPRINT using the original value (time field) to have it in the proper order on the graph.
Such as:
BY time_fld NOPRINT
BY time_fld_x

Tim, you have changed your original post, so the request is not exactly the same as it was when I first answer and may not respond to your request.

Can you be more specific and give us a sample of what is your issue ?


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
April 07, 2016, 08:59 AM
Tim P.
Sorry hopping back on this. What should happen is there is a 1:1 relationship between date and time. Date was MDYY and time was, I think, HHIS1. I figured I could just bring out time by date and it would be fine but that doesn't seem to be the case. Any ideas?

There is no other criteria for HOLD_TIME, just two fields.

 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 HOLD_TIME
-* Created by Info Assist for Graph
SUM
	TIME
BY DATE
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 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setUseSeriesShapes(true);
setMarkerSizeDefault(50);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*END
ENDSTYLE
END
-RUN 



WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
April 19, 2016, 09:51 AM
<Emily McAllister>
Hello Tim,

I spoke with one of our graphing experts about this and he is not sure why this wouldn't work for you. His theory is that there may be something in your dataset causing this issue. Can you replicate something similar with a test file like CAR or WF_RETAIL?

Thanks,
Emily McAllister
Focal Point Moderator
May 04, 2016, 06:01 PM
eric.woerle
I'm going to ressurect this thread as I'm having the same issue. please find below an example using CAR

TABLE FILE CAR
PRINT  
	COMPUTE TIME_STRT/HHIS='00:00:00';
	COMPUTE DTE/YYMD=&YYMD;
	COMPUTE TIME/HHIS = HADD(TIME_STRT,'MINUTE',SEAT,8,'HHIS');
	COMPUTE DATE/YYMD=DATEADD(DTE,'DAY',MPG);
BY CAR
ON TABLE HOLD AS TIME_TEST
END

-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
GRAPH FILE TIME_TEST
-* Created by Info Assist for Graph
SUM TIME
BY DATE
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
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 ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT='WebFOCUS Report', $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setSeriesType(0,2);
setSeriesType(1,2);
setSeriesType(2,2);
setSeriesType(3,1);
*END
*GRAPH_JS
yaxis: {mode: 'time'}
*END
ENDSTYLE
END  


I did find that removing the "ON GRAPH PCHOLD FORMAT JSCHART" Allowed the graph to work properly, but as Francis points out in this thread: Graph Y-axis label format for HHIS (time), The y-axis has a AM/PM designation. Like Francis I would like to have the times formatted as 00:00:00 not 12:00:00 AM. I'm graphing elapsed time, not time of day. Has anyone figured out how to do this using either JSCHART or the old graphing? Any thoughts would be appreciated!

Emily,

If you could bring this up with your graphing expert, that would be great!

Thanks!


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
July 07, 2016, 04:27 PM
Squatch
quote:
Originally posted by eric.woerle:
I'm going to ressurect this thread as I'm having the same issue. please find below an example using CAR

Your example generates this scripting code for the number of minutes:

script += 'setDateData(0,0,"00:02:00","HHIS");';
script += 'setDateData(0,1,"00:05:00","HHIS");';
script += 'setDateData(0,2,"00:04:00","HHIS");';
script += 'setDateData(0,3,"00:02:00","HHIS");';
script += 'setDateData(0,4,"00:05:00","HHIS");';
script += 'setDateData(0,5,"00:05:00","HHIS");';
script += 'setDateData(0,6,"00:05:00","HHIS");';
script += 'setDateData(0,7,"00:04:00","HHIS");';
script += 'setDateData(0,8,"00:02:00","HHIS");';
script += 'setDateData(0,9,"00:04:00","HHIS");';

(There are really more minutes coming out of the CAR file than that, but when you sum "TIME BY DATE" it doesn't really look like anything is being summed.)

WebFOCUS doesn't see your computed "TIME" as a measure. But it let's you specify it as a measure because you might want to do a count or distinct count on it. In any case, it doesn't complain and passes it on to the charting software, which then gets very confused.

I modified your code to compute minutes as an integer named "DT_MINUTES". Then I summed "DT_MINUTES BY DATE" and now there is at least a valid graph.

Here is what is being passed into the charting software now:

script += 'setData(0,0,6.00);';
script += 'setData(0,1,5.00);';
script += 'setData(0,2,4.00);';
script += 'setData(0,3,2.00);';
script += 'setData(0,4,20.00);';
script += 'setData(0,5,13.00);';
script += 'setData(0,6,5.00);';
script += 'setData(0,7,9.00);';
script += 'setData(0,8,2.00);';
script += 'setData(0,9,4.00);';

And here is the modified code:

TABLE FILE CAR
PRINT
	COMPUTE TIME_STRT/HHIS='00:00:00';
	COMPUTE DTE/YYMD=&YYMD;
	COMPUTE TIME/HHIS = HADD(TIME_STRT,'MINUTE',SEAT,8,'HHIS');
	COMPUTE DT_MINUTES/I2 = HPART(TIME,'MINUTE','I2');
	COMPUTE DATE/YYMD=DATEADD(DTE,'DAY',MPG);
BY CAR
ON TABLE HOLD AS TIME_TEST
END

-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
GRAPH FILE TIME_TEST
-* Created by Info Assist for Graph
SUM DT_MINUTES
BY DATE
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
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 ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
*END
-*INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,$
TYPE=REPORT, TITLETEXT='WebFOCUS Report', $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setSeriesType(0,2);
setSeriesType(1,2);
setSeriesType(2,2);
setSeriesType(3,1);
*END
*GRAPH_JS
yaxis: {mode: 'time'}
*END
ENDSTYLE
END



App Studio
WebFOCUS 8.1.05M
Windows, All Outputs