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.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

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.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
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.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1635 views
  • 3 likes
  • 3 in conversation