<?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: Sgplot/Sgpanel: Create clustered stacked bar chart or specify 2 variables in &amp;quot;Group&amp;quot; o in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/814377#M22839</link>
    <description>&lt;P&gt;Building on&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;'s example, would this kind of display work for you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html file="gridded.html";
ods layout gridded advance=bygroup rowgutter=0;
ods region;
ods graphics / width=100% height=150px;

proc sgpanel data=sashelp.heart noautolegend;
by chol_status;
panelby status/layout=columnlattice onepanel novarname HEADERBACKCOLOR=white noborder
NOHEADERBORDER COLHEADERPOS=bottom;
vbar sex/group=bp_status BARWIDTH=0.95;
colaxis display=(nolabel) offsetmin=0.4 offsetmax=0.4;
run;

ods layout end;
ods html close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 19 May 2022 22:46:54 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2022-05-19T22:46:54Z</dc:date>
    <item>
      <title>Sgplot/Sgpanel: Create clustered stacked bar chart or specify 2 variables in "Group" option</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/814249#M22832</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to create a vertical bar chart that looks like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="James_Yu_0-1652952181222.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71625i5E105F474FCFEC5B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="James_Yu_0-1652952181222.png" alt="James_Yu_0-1652952181222.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In the chart, I would like to group 2 variables (Sex and Category) but the "Group" option in the Vbar statement only accepts 1 variable. I have tried to use sgpanel but I need 2 columns close together and I think I will use another variable (like age group) in the "panelby"&amp;nbsp;statement to make comparison&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The final chart should be like this (an example from an article)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="James_Yu_0-1652969163501.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71636i4D8F6078E19FEAB1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="James_Yu_0-1652969163501.png" alt="James_Yu_0-1652969163501.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you any idea to create this chart&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 14:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/814249#M22832</guid>
      <dc:creator>James_Yu</dc:creator>
      <dc:date>2022-05-19T14:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot/Sgpanel: Create clustered stacked bar chart or specify 2 variables in "Group" o</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/814265#M22834</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgpanel data=sashelp.heart noautolegend;
panelby status/layout=columnlattice onepanel novarname HEADERBACKCOLOR=white noborder
NOHEADERBORDER COLHEADERPOS=bottom;
vbar sex/group=bp_status BARWIDTH=0.95;
colaxis display=(nolabel) offsetmin=0.4 offsetmax=0.4;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1652957695854.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71629i1332AED2C9397949/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1652957695854.png" alt="Ksharp_0-1652957695854.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 10:55:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/814265#M22834</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-05-19T10:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot/Sgpanel: Create clustered stacked bar chart or specify 2 variables in "Group" o</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/814294#M22835</link>
      <description>&lt;P&gt;Thanks for the code&lt;/P&gt;
&lt;P&gt;But I think this only solves half of my problem. After that code, I could not find out how to add another variable into the chart&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me take an example of the chart from an article. I think that would be complex but I need to add 3 grouping variables into my chart.&lt;/P&gt;
&lt;P&gt;Could we do it on SAS ?&lt;/P&gt;
&lt;DIV id="tinyMceEditorJames_Yu_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tinyMceEditorJames_Yu_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="James_Yu_2-1652969006463.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71635i16521F2F525FF88A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="James_Yu_2-1652969006463.png" alt="James_Yu_2-1652969006463.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 14:05:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/814294#M22835</guid>
      <dc:creator>James_Yu</dc:creator>
      <dc:date>2022-05-19T14:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot/Sgpanel: Create clustered stacked bar chart or specify 2 variables in "Group" o</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/814377#M22839</link>
      <description>&lt;P&gt;Building on&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;'s example, would this kind of display work for you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html file="gridded.html";
ods layout gridded advance=bygroup rowgutter=0;
ods region;
ods graphics / width=100% height=150px;

proc sgpanel data=sashelp.heart noautolegend;
by chol_status;
panelby status/layout=columnlattice onepanel novarname HEADERBACKCOLOR=white noborder
NOHEADERBORDER COLHEADERPOS=bottom;
vbar sex/group=bp_status BARWIDTH=0.95;
colaxis display=(nolabel) offsetmin=0.4 offsetmax=0.4;
run;

ods layout end;
ods html close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 May 2022 22:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/814377#M22839</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2022-05-19T22:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot/Sgpanel: Create clustered stacked bar chart or specify 2 variables in "Group" o</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/814425#M22840</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgpanel data=sashelp.heart noautolegend;
panelby Smoking_Status bp_status/layout=lattice onepanel novarname HEADERBACKCOLOR=white  noborder
NOHEADERBORDER COLHEADERPOS=bottom;
vbar sex/group=Weight_Status BARWIDTH=0.9;
colaxis display=(nolabel) offsetmin=0.4 offsetmax=0.4;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1653051194653.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71661iEAFA5A01E615856B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1653051194653.png" alt="Ksharp_0-1653051194653.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 12:53:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/814425#M22840</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-05-20T12:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot/Sgpanel: Create clustered stacked bar chart or specify 2 variables in "Group" o</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/816012#M22884</link>
      <description>Thanks for the codes,&lt;BR /&gt;Your idea guide me a lot to modify my code</description>
      <pubDate>Wed, 01 Jun 2022 09:40:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Sgplot-Sgpanel-Create-clustered-stacked-bar-chart-or-specify-2/m-p/816012#M22884</guid>
      <dc:creator>James_Yu</dc:creator>
      <dc:date>2022-06-01T09:40:06Z</dc:date>
    </item>
  </channel>
</rss>

