Focal Point
[SOLVED] WF 8 - JSCHART - How to Fill Missing Data.

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

March 09, 2015, 03:40 PM
David Briars
[SOLVED] WF 8 - JSCHART - How to Fill Missing Data.
APP PREPENDPATH IBISAMP
-*
DEFINE FILE CAR
 SERIES1/D33 MISSING ON = IF COUNTRY EQ 'ITALY' THEN MISSING ELSE DCOST;
 SERIES2/D33            = SALES;
END
-*
GRAPH FILE CAR
SUM SERIES1    AS 'Series 1'
    SERIES2    AS 'Series 2'
BY  COUNTRY    AS 'Country'
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VLINE2
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
-*
*GRAPH_JS
 yaxis: {title: {visible: true, color: 'black', font: 'bold 10pt Verdana',text:'Series 1'}},
 xaxisOrdinal: {title: {visible: true, color: 'black', font: 'bold 10pt Verdana',text:'Country'}},
 y2axis: {title: {visible: true, color: 'black', font: 'bold 10pt Verdana',text:'Series 2'}},
 legend: {markerSize: 14, labels: {color: 'black', font: '10pt Verdana'}}
*END
-*
*GRAPH_SCRIPT
setPlace(true);
setFillMissingData(2);
*END
ENDSTYLE
-*
END
-RUN  


When I run this code I see a line gap between France and Japan for 'Series 1'.

I need a line connecting France to Japan for 'Series 1'.

From my research, manuals and FocalPt, 'setFillMissingData(2);' should get me there.

If someone has a suggestion, I'd be most grateful.

This message has been edited. Last edited by: <Kathryn Henning>,




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
March 09, 2015, 04:52 PM
Shakila Subhan
Include the below line in the graph properties.

ON GRAPH SET VZERO ON


WebFOCUS 8.0.08 - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
Windows, All Outputs
March 09, 2015, 05:18 PM
David Briars
Hi Shakila,

Thanks for your reply.

Switching VZERO from OFF to ON, sets missing data (Italy) to zero.

So, in this instance, the 'line gap' is gone.

However, my requirement is for interpolation, i.e., an interpolated dotted line connecting France and Japan.

Apologies for not being clearer in my original post.

Dave
March 09, 2015, 05:55 PM
David Briars
I also used InfoAssist within WFDS.

Within IA, I clicked the 'Data' menu option, and then the 'Missing Data' icon. Then from the drop down list I changed the default 'Gap' to 'Interpolated Line'.

IA created code very similar to mine, and again no interpolation.
March 10, 2015, 04:46 AM
Tony A
Hi David,

When I run your code, I can see that the data item is not contained within the output script and therefore that is why it is not being displayed as an interpolated line. For that to happen you would need to have a declaration of the series data item like "setData(0,2,);".

There is nothing wrong in the way that you've coded it (from what I can see) and is something I would advise you to raise on InfoResponse.

For info, this is exactly the same in 8.1.03 and 8.0.08 so I am guessing that it is by design? For my "two cents" I would have expected it to function as you expected.

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 
March 10, 2015, 10:16 AM
David Briars
Information about displaying missing values in a graph with an 'interpolated dotted line' can be found in the following two (2) manuals:

1. Creating Reports with the WF Language
Chapter 24 - Creating a Graph
Section - Displaying Missing Data in a Graph

2. WebFOCUS Graphics
Chapter 4 - Properties
Section - FillMissingData
March 10, 2015, 10:21 AM
David Briars
@Tony - Thank you so much for your reply.

I averaged France and Japan and created the setData accordingly: setData(0,2,5071.5); I do see the gap 'going away' in this case.

I've never used setData, so thanks for the tip.

In my real case though, I'm not in a position to create the parms for the setData readily.

Also, I would like the interpolated data to show with a dashed line, to imply that that the data isn't actual.
March 10, 2015, 11:11 AM
Tony A
quote:
I would like the interpolated data to show with a dashed line, to imply that that the data isn't actual.

Off the top of my shiny head Wink I would suggest one way to achieve this (I doubt that you can change the line properties!) would be to have a separate series for the data points either side of the missing data and the interpolated value.

Not a nice way to do this sort of thing but I have achieved similar a long time ago (probably in a WF5 version Frowner).

Good luck!


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 
March 10, 2015, 02:02 PM
<nick z>
Hi David,
setFillMissingData was not supported in WF8008 or below for JSCHART format.
It will be avaialbe in WF8009 and above.
This was a new feature for JSCHART, unfrotunately there is no workaround for this in WF8008.
Do you have any plans of upgrading to a newer WF release?
Thanks.
Nick.
March 10, 2015, 02:14 PM
David Briars
Hi Nick,

Thank you for the information/confirmation.

I always consider it a blessing, when someone tells me I'm not going completely crazy. (Crazy maybe, just not completely. :-))

I'll make a note to look at this again, when/if we move up from 8007.

Dave