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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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