<?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 How to replicate functionalities from vbar with barchart in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-replicate-functionalities-from-vbar-with-barchart/m-p/882970#M23924</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Normally I am using VBAR from the SGPLOT Procedure to create single bar charts. &amp;nbsp;Now I want to build a chart matrix with several plots using the SAS Graph template. Everything works fine except that I can not replicate some functionality from VBAR statement with the BARCHART Statement.&lt;/P&gt;&lt;P&gt;I want to order a stacked bar chart in a descending order, which means the bars should be ordered from the largest to the smallest, as well as each stacked bar should be ordered by the size of each categorical level.&lt;/P&gt;&lt;P&gt;VBAR provides the “CATEGORYORDER = RESPDESC” option which solves my problem, but the same option is not working with the BARCHART Statement. Does anyone knows a workaround which leads to the same solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;TSAS&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jun 2023 16:25:25 GMT</pubDate>
    <dc:creator>TSAS2</dc:creator>
    <dc:date>2023-06-29T16:25:25Z</dc:date>
    <item>
      <title>How to replicate functionalities from vbar with barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-replicate-functionalities-from-vbar-with-barchart/m-p/882970#M23924</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Normally I am using VBAR from the SGPLOT Procedure to create single bar charts. &amp;nbsp;Now I want to build a chart matrix with several plots using the SAS Graph template. Everything works fine except that I can not replicate some functionality from VBAR statement with the BARCHART Statement.&lt;/P&gt;&lt;P&gt;I want to order a stacked bar chart in a descending order, which means the bars should be ordered from the largest to the smallest, as well as each stacked bar should be ordered by the size of each categorical level.&lt;/P&gt;&lt;P&gt;VBAR provides the “CATEGORYORDER = RESPDESC” option which solves my problem, but the same option is not working with the BARCHART Statement. Does anyone knows a workaround which leads to the same solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;TSAS&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 16:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-replicate-functionalities-from-vbar-with-barchart/m-p/882970#M23924</guid>
      <dc:creator>TSAS2</dc:creator>
      <dc:date>2023-06-29T16:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate functionalities from vbar with barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-replicate-functionalities-from-vbar-with-barchart/m-p/883110#M23927</link>
      <description>Have you tried using the statement that helps find code for SAS Graph Template that can replicate something SGPLOT does?&lt;BR /&gt;&lt;A href="https://sasnrd.com/sas-tmplout-option/" target="_blank"&gt;https://sasnrd.com/sas-tmplout-option/&lt;/A&gt;</description>
      <pubDate>Fri, 30 Jun 2023 14:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-replicate-functionalities-from-vbar-with-barchart/m-p/883110#M23927</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2023-06-30T14:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate functionalities from vbar with barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-replicate-functionalities-from-vbar-with-barchart/m-p/883158#M23931</link>
      <description>&lt;P&gt;The SGPLOT and SGPANEL procedures do some extra processing to support this feature. There is not a direct option in GTL to do it. To do this GTL, there four key items:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Pre-summarize your data using PROC MEANS or PROC SUMMARY&lt;/LI&gt;
&lt;LI&gt;Sort the data in ascending or descending order using PROC SORT&lt;/LI&gt;
&lt;LI&gt;Use a BARPARM statement to render the bar chart in GTL&lt;/LI&gt;
&lt;LI&gt;On the category axis (either X to Y), specify SORTORDER=DATA in the DISCRETEOPTS&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Let me know if you still have issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2023 18:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-replicate-functionalities-from-vbar-with-barchart/m-p/883158#M23931</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2023-06-30T18:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to replicate functionalities from vbar with barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-replicate-functionalities-from-vbar-with-barchart/m-p/883437#M23941</link>
      <description>&lt;P&gt;I solved my issue. I forgot to mention that my dataset contains two columns with data which need so be sorted independently first. @&amp;nbsp;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130" target="_blank"&gt;DanH_sas&lt;/A&gt; your suggestion did not work completely for my problem but put me on the right track. Thanks for that! I solved my issue by following your logic with proc sql in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 12:15:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-replicate-functionalities-from-vbar-with-barchart/m-p/883437#M23941</guid>
      <dc:creator>TSAS2</dc:creator>
      <dc:date>2023-07-04T12:15:07Z</dc:date>
    </item>
  </channel>
</rss>

