<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SAS data into JavaScript in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-data-into-JavaScript/m-p/769717#M15323</link>
    <description>&lt;P&gt;Thanks Keith.&amp;nbsp; This helped a lot.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Sep 2021 21:01:36 GMT</pubDate>
    <dc:creator>dstephens22</dc:creator>
    <dc:date>2021-09-22T21:01:36Z</dc:date>
    <item>
      <title>SAS data into JavaScript</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-data-into-JavaScript/m-p/769600#M15319</link>
      <description>&lt;P&gt;Hi I am using a Google pie chart as a stored procedure in SAS VA.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can get the JS to run fine but I am trying to determine how to add sas values in place of the JS addrows data.&amp;nbsp; I tried using SAS macros but it doesn't work.&amp;nbsp; Is there a way to automatically add the data values from SAS into the data.addRows in JS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to replace the below with SAS values not the hand entered text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&amp;nbsp; I have been all over Google search.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;var data = new google.visualization.DataTable();&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;data.addColumn('string', 'Topping');&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;data.addColumn('number', 'Slices');&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;data.addRows([&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;['Created Cards', 7],&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;['Cards Printed', 1],&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;['Sent Emails', 1],&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;['Unique HCPs', 1],&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;['Engaged', 2]&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;]);&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 17:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-data-into-JavaScript/m-p/769600#M15319</guid>
      <dc:creator>dstephens22</dc:creator>
      <dc:date>2021-09-22T17:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS data into JavaScript</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-data-into-JavaScript/m-p/769606#M15320</link>
      <description>&lt;P&gt;Have you &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Data-Driven-Content-leveraging-third-party-visualizations-in-SAS/ta-p/437303" target="_self"&gt;looked at Data Driven Content Objects&lt;/A&gt; in SAS Visual Analytics? Seems tailor-made for the thing you want to do: drive a 3rd-party visualization but with your SAS report data.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 17:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-data-into-JavaScript/m-p/769606#M15320</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2021-09-22T17:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS data into JavaScript</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-data-into-JavaScript/m-p/769609#M15321</link>
      <description>&lt;P&gt;Thank you for the quick response.&amp;nbsp; Unfortunately I do not have SAS Viya yet.&amp;nbsp; I should have added I am on SAS 9.4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That looks like a great approach, once we have it.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 17:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-data-into-JavaScript/m-p/769609#M15321</guid>
      <dc:creator>dstephens22</dc:creator>
      <dc:date>2021-09-22T17:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS data into JavaScript</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-data-into-JavaScript/m-p/769647#M15322</link>
      <description>&lt;LI-CODE lang="sas"&gt;/* create the sas table */
Data work.toppings;
topping='Mushrooms'; output;
topping='Onions'; output;
topping='Olives'; output;
topping='Zucchini';output;
topping='Pepperoni';output;
run;

/* sort the data */
proc sort data = toppings;
by topping;
run;
data _null_;
  file _webout;
  set work.toppings end=eof;
  by topping;

  if _N_ = 1 then
    do; /* first row */
      put " &amp;lt;html&amp;gt; ";
      put " &amp;lt;head&amp;gt; ";
      put " &amp;lt;!--Load the AJAX API--&amp;gt; ";
      put ' &amp;lt;script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"&amp;gt;&amp;lt;/script&amp;gt; ';
      put ' &amp;lt;script type="text/javascript"&amp;gt; ';
      put " // Load the Visualization API and the corechart package. ";
      put " google.charts.load('current', {'packages':['corechart']}); ";
      put " // Set a callback to run when the Google Visualization API is loaded. ";
      put " google.charts.setOnLoadCallback(drawChart); ";
      put " // Callback that creates and populates a data table, ";
      put " // instantiates the pie chart, passes in the data and ";
      put " // draws it. ";
      put " function drawChart() { ";
      put " // Create the data table. ";
      put " var data = new google.visualization.DataTable(); ";
      put " data.addColumn('string', 'Topping'); ";
      put " data.addColumn('number', 'Slices'); ";
      put " data.addRows([ ";
      put "['" topping "',1],"; /* output the first topping since it is first row. */
    end; /* first row */
  else
    do; /* Not first row */
      put "['" topping "',1],";

      if eof then
        do; /* eof */
          put "['" topping "',2]";
          put " ]); ";
          put " // Set chart options ";
          put " var options = {'title':'How Much Pizza I Ate Last Night', ";
          put " 'width':400, ";
          put " 'height':300}; ";
          put " // Instantiate and draw our chart, passing in some options. ";
          put " var chart = new google.visualization.PieChart(document.getElementById('chart_div')); ";
          put " chart.draw(data, options); ";
          put " } ";
          put " &amp;lt;/script&amp;gt; ";
          put " &amp;lt;/head&amp;gt; ";
          put " &amp;lt;body&amp;gt; ";
          put " &amp;lt;!--Div that will hold the pie chart--&amp;gt; ";
          put ' &amp;lt;div id="chart_div"&amp;gt;&amp;lt;/div&amp;gt; ';
          put " &amp;lt;/body&amp;gt; ";
          put " &amp;lt;/html&amp;gt; ";
        end; /* eof */
    end; /* Not first row */
run;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Sep 2021 22:05:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-data-into-JavaScript/m-p/769647#M15322</guid>
      <dc:creator>KeithM</dc:creator>
      <dc:date>2021-09-22T22:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAS data into JavaScript</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-data-into-JavaScript/m-p/769717#M15323</link>
      <description>&lt;P&gt;Thanks Keith.&amp;nbsp; This helped a lot.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 21:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/SAS-data-into-JavaScript/m-p/769717#M15323</guid>
      <dc:creator>dstephens22</dc:creator>
      <dc:date>2021-09-22T21:01:36Z</dc:date>
    </item>
  </channel>
</rss>

