BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
invalid
Fluorite | Level 6

Hi!

 

When i try to use Google Charts to make a Sankey Diagram in SAS eg i cant view it in the "SAS EG browser". If I right click and choose "open with windows default" then it works fine in Firefox.

 

Am I doing something wrong or are JS visualisations such as google charts not supported by the SAS eg ouput viewer browser? 

 

My code:

filename _webout "out2.html";
data _null_;
 file _webout;
put ' <html>
  <head>
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">
      google.charts.load("current", {"packages":["sankey"]});
      google.charts.setOnLoadCallback(drawChart);

      function drawChart() {
        var data = new google.visualization.DataTable();
        data.addColumn("string", "From");
        data.addColumn("string", "To");
        data.addColumn("number", "Weight");
        data.addRows([
          [ "A", "X", 5 ],
          [ "A", "Y", 7 ],
          [ "A", "Z", 0 ],
          [ "B", "X", 2 ],
          [ "B", "Y", 9 ],
          [ "B", "Z", 4 ]
        ]);
       
        var options = {
          width: 600,
        };

        var chart = new google.visualization.Sankey(document.getElementById("sankey_basic"));
        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id="sankey_basic" style="width: 900px; height: 300px;"></div>
  </body>
</html>'
;;;;;;;
run;

The error I get in SAS EG when viewing the ouput there:

image.png

 

Best regards

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

The embedded browser in EG is a hosted version of the Microsoft IE component that's built into Windows.  You can change your EG preferences to always open HTML output in an external window (Chrome or FF).  The embedded browser won't be able to run your scripts.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

View solution in original post

3 REPLIES 3
ChrisHemedinger
Community Manager

The embedded browser in EG is a hosted version of the Microsoft IE component that's built into Windows.  You can change your EG preferences to always open HTML output in an external window (Chrome or FF).  The embedded browser won't be able to run your scripts.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
snoopy369
Barite | Level 11
Ahah, I figured you'd come the moment I hit my answer button... Is the hosted version available somewhere to run (in order to test things) or is it hidden in a DLL and unaccessible outside? I expected to find an "iexplore.exe" or something similar hanging around somewhere in the SAS folders, but I couldn't find it.
ChrisHemedinger
Community Manager

@snoopy369 - it's wrapped up in the WebBrowser control that's part of the .NET Framework.  Under the surface, it is using some DLLs that are shared with IE.  It would be simple to build a small app that could be used for testing, but there isn't a way (that I know of) to drive EG to do this for you.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2039 views
  • 3 likes
  • 3 in conversation