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 krishnaThis 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!
-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.