<?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: PROC SGPLOT BLOCK options in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SGPLOT-BLOCK-options/m-p/738729#M230476</link>
    <description>VBARPARM is usually required when you want to combine different graph types. Can you show a bit of what you're trying to do?</description>
    <pubDate>Mon, 03 May 2021 22:20:34 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-05-03T22:20:34Z</dc:date>
    <item>
      <title>PROC SGPLOT BLOCK options</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SGPLOT-BLOCK-options/m-p/738727#M230475</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I use the "BLOCK" option with VBAR statement in PROC SGPLOT? The example below shows that it works with SCATTER but I could not make it work with VBAR?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recep&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA test;&lt;BR /&gt;INPUT Hospital $ age_group $ count level $;&lt;BR /&gt;CARDS;&lt;BR /&gt;Hosp1 0-16 0 Level1&lt;BR /&gt;Hosp1 17-74 10 Level1&lt;BR /&gt;Hosp1 75+ 1 Level1&lt;BR /&gt;Hosp2 0-16 14 Level1&lt;BR /&gt;Hosp3 0-16 1 Level1&lt;BR /&gt;Hosp3 17-74 16 Level1&lt;BR /&gt;Hosp4 0-16 1 Level2&lt;BR /&gt;Hosp4 17-74 4 Level2&lt;BR /&gt;Hosp5 17-74 7 Level2&lt;BR /&gt;Hosp6 17-74 80 Level2&lt;BR /&gt;Hosp6 75+ 2 Level2&lt;BR /&gt;Hosp7 17-74 4 Level3&lt;BR /&gt;Hosp8 17-74 9 Level3&lt;BR /&gt;Hosp9 17-74 95 Level3&lt;BR /&gt;Hosp9 75+ 1 Level3&lt;BR /&gt;Hosp10 0-16 1 Level3&lt;BR /&gt;Hosp10 17-74 27 Level3&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;proc sgplot data=test;&lt;BR /&gt;block x=hospital block=level / filltype=alternate fillattrs=GraphAltBlock altfillattrs=GraphBlock transparency=0.7;&lt;BR /&gt;scatter x=hospital y=count/ group=age_group&lt;BR /&gt;grouporder=ascending&lt;BR /&gt;MARKERATTRS=(symbol=circlefilled size=10)&lt;BR /&gt;LEGENDLABEL= "Hospitalizations"&lt;BR /&gt;datalabel&lt;BR /&gt;datalabelpos=top;&lt;/P&gt;&lt;P&gt;xaxis display=all fitpolicy=rotate grid;&lt;BR /&gt;yaxis offsetmin=0.02 grid;&lt;BR /&gt;title ' ';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sgplot data=test;&lt;BR /&gt;block x=hospital block=level / filltype=alternate fillattrs=GraphAltBlock altfillattrs=GraphBlock transparency=0.7;&lt;BR /&gt;vbar hospital / response=count&lt;BR /&gt;group=age_group&lt;BR /&gt;stat=sum&lt;BR /&gt;datalabel&lt;BR /&gt;datalabelattrs=(weight=bold)&lt;BR /&gt;nooutline&lt;BR /&gt;barwidth=0.5;&lt;BR /&gt;xaxis display=(nolabel);&lt;BR /&gt;yaxis grid label='Number of hospitalizations';&lt;BR /&gt;title ' ';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 22:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SGPLOT-BLOCK-options/m-p/738727#M230475</guid>
      <dc:creator>Recep</dc:creator>
      <dc:date>2021-05-03T22:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT BLOCK options</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SGPLOT-BLOCK-options/m-p/738729#M230476</link>
      <description>VBARPARM is usually required when you want to combine different graph types. Can you show a bit of what you're trying to do?</description>
      <pubDate>Mon, 03 May 2021 22:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SGPLOT-BLOCK-options/m-p/738729#M230476</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-05-03T22:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT BLOCK options</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SGPLOT-BLOCK-options/m-p/738731#M230478</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;! I'm trying to replicate the BLOCK option in the first SGPLOT example with SCATTER in the second example with VBAR. If you run the examples you can see that hospitals are grouped by their "Levels" in the SGPLOT with SCATTER but not with the VBAR.&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 22:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SGPLOT-BLOCK-options/m-p/738731#M230478</guid>
      <dc:creator>Recep</dc:creator>
      <dc:date>2021-05-03T22:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT BLOCK options</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SGPLOT-BLOCK-options/m-p/738818#M230512</link>
      <description>&lt;P&gt;Have a look here for the&amp;nbsp;Plot Type Compatibility:&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/p0yud64khw8fuin1xgr85dgxbb7t.htm" target="_blank" rel="noopener"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/p0yud64khw8fuin1xgr85dgxbb7t.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;mentioned to combine SCATTER, BLOCK and a bar chart you have to use VBARPARM or VBARBASIC.&lt;/P&gt;
&lt;P&gt;For VBARPARM you need to precalculate the values you want to plot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change VBAR to VBARBASIC&amp;nbsp; in your second SGPLOT and you should get what you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also have a look at this blog post&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2021/04/14/overlay-graphs-basic-bar-chart.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2021/04/14/overlay-graphs-basic-bar-chart.html&lt;/A&gt;&amp;nbsp;by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 09:18:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SGPLOT-BLOCK-options/m-p/738818#M230512</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2021-05-04T09:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT BLOCK options</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SGPLOT-BLOCK-options/m-p/738984#M230590</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32"&gt;@BrunoMueller&lt;/a&gt;&amp;nbsp;! Simply changing the VBAR statement to VBARBASIC helped what I wanted to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recep&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 16:46:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SGPLOT-BLOCK-options/m-p/738984#M230590</guid>
      <dc:creator>Recep</dc:creator>
      <dc:date>2021-05-04T16:46:40Z</dc:date>
    </item>
  </channel>
</rss>

