Focal Point
[CLOSED] Sankey Chart in Webfocus

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

June 12, 2018, 04:43 PM
Leela Krishna
[CLOSED] Sankey Chart in Webfocus
Hi Everyone,

I have a requirement to create a Sankey chart in Webfocus, I was wondering if it is possible to create a Sankey in Webfocus. Has anyone done this before? Any advise or input on how to create Sankey would be helpful and greatly appreciated.

Regards
Leela krishna

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


WebFOCUS 8
Windows, All Outputs
June 12, 2018, 05:17 PM
jcannavo
Don't have experience with it, but I vaguely remembered reading something about WF extensions and Sankey. Dug up this post from 2017, maybe it will be helpful...good luck!

http://forums.informationbuild...1057331/m/1437042686


JC
WebFOCUS Dev Studio / App Studio
8.2.01
Windows 7
June 13, 2018, 05:00 AM
Frans
Yes this is working, I haven't figured out so far how to get connecting nodes, only source and target nodes so far.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
June 14, 2018, 03:23 AM
Dave
I once made one with Google-graphs...

-HTMLFORM BEGIN
<!DOCTYPE html>
<html>
<body>
<head>
<script type="text/javascript"
  src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['sankey']}]}">
</script>
<div id="sankey_basic" style="width: 400px; height: 600px;"></div>

<script type="text/javascript">
google.setOnLoadCallback(drawChart);

   function drawChart() {
    var data = new google.visualization.DataTable();
    data.addColumn('string', 'From');
    data.addColumn('string', 'To');
    data.addColumn('number', 'Weight');
    data.addRows([
-HTMLFORM END

SET NODATA = 'null'
SET HOLDLIST = PRINTONLY

-* Generate Javascript data
DEFINE FILE CAR
	SEP/A2 = ', ';
END

TABLE FILE CAR
SUM
	COMPUTE LINESTART/A13 = '['; AS ''
	COMPUTE AXIS1/A80 = '''' || EDIT(FST.SEATS) || '''' ; AS ''
	SEP AS ''
	COMPUTE AXIS2/A80 = '''' || FST.COUNTRY || ''''; AS ''
	SEP AS ''
	SALES/D12c	AS ''
	COMPUTE LINEEND/A3 =  '],'; AS ''
	BY	SEATS NOPRINT
	BY	COUNTRY NOPRINT
ON TABLE PCHOLD FORMAT ALPHA
END
-RUN

-HTMLFORM BEGIN
		    ]);

    // Set chart options
    var options = {
      width:400,
	  height:600,
    };

    // Instantiate and draw our chart, passing in some options.
    var chart = new google.visualization.Sankey(document.getElementById('sankey_basic'));
    chart.draw(data, options);
   }
</script>
</head>
</html>



_____________________
WF: 8.0.0.9 > going 8.2.0.5
June 21, 2018, 01:51 PM
Leela Krishna
Hi Dave,

Thanks for sharing the sample code, that's a good one.

Regards
Leela krishna


WebFOCUS 8
Windows, All Outputs