<?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: Bar Charts- SGPLOT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Bar-Charts-SGPLOT/m-p/563339#M157916</link>
    <description>&lt;P&gt;Try adding a BY statement for the ORIGIN. You may need to sort the data by origin before you can do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing style=listing;
ods graphics / width=5in height=2.81in;

proc sort data=sashelp.cars out=cars; by origin;
run;

title 'Mileage by Origin and Type';
proc sgplot data=cars(where=(type ne 'Hybrid'));
by origin;
  vbar type/ response=mpg_city
    stat=mean dataskin=gloss;
  xaxis display=(nolabel noticks);
  yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Making a random guess, that's what I think you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215179"&gt;@david27&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have this code from --&amp;nbsp;&lt;A href="https://support.sas.com/rnd/datavisualization/yourGraphs/businessQuick/vbar/#s1=2" target="_blank" rel="noopener"&gt;https://support.sas.com/rnd/datavisualization/yourGraphs/businessQuick/vbar/#s1=2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing style=listing;
ods graphics / width=5in height=2.81in;

title 'Mileage by Origin and Type';
proc sgplot data=sashelp.cars(where=(type ne 'Hybrid'));
  vbar origin / response=mpg_city group=type groupdisplay=cluster 
    stat=mean dataskin=gloss;
  xaxis display=(nolabel noticks);
  yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can we have the exact same chart but with &lt;STRONG&gt;vbar=origin one followed by other.&lt;/STRONG&gt;-- Not Stacked.&lt;/P&gt;
&lt;P&gt;So a bar chart for Asia followed by Europe followed by USA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2019 17:12:28 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-06-03T17:12:28Z</dc:date>
    <item>
      <title>Bar Charts- SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bar-Charts-SGPLOT/m-p/563336#M157914</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have this code from --&amp;nbsp;&lt;A href="https://support.sas.com/rnd/datavisualization/yourGraphs/businessQuick/vbar/#s1=2" target="_blank"&gt;https://support.sas.com/rnd/datavisualization/yourGraphs/businessQuick/vbar/#s1=2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing style=listing;
ods graphics / width=5in height=2.81in;

title 'Mileage by Origin and Type';
proc sgplot data=sashelp.cars(where=(type ne 'Hybrid'));
  vbar origin / response=mpg_city group=type groupdisplay=cluster 
    stat=mean dataskin=gloss;
  xaxis display=(nolabel noticks);
  yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Can we have the exact same chart but with &lt;STRONG&gt;vbar=origin one followed by other.&lt;/STRONG&gt;-- Not Stacked.&lt;/P&gt;&lt;P&gt;So a bar chart for Asia followed by Europe followed by USA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 17:06:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bar-Charts-SGPLOT/m-p/563336#M157914</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2019-06-03T17:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Bar Charts- SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bar-Charts-SGPLOT/m-p/563339#M157916</link>
      <description>&lt;P&gt;Try adding a BY statement for the ORIGIN. You may need to sort the data by origin before you can do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing style=listing;
ods graphics / width=5in height=2.81in;

proc sort data=sashelp.cars out=cars; by origin;
run;

title 'Mileage by Origin and Type';
proc sgplot data=cars(where=(type ne 'Hybrid'));
by origin;
  vbar type/ response=mpg_city
    stat=mean dataskin=gloss;
  xaxis display=(nolabel noticks);
  yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Making a random guess, that's what I think you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215179"&gt;@david27&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have this code from --&amp;nbsp;&lt;A href="https://support.sas.com/rnd/datavisualization/yourGraphs/businessQuick/vbar/#s1=2" target="_blank" rel="noopener"&gt;https://support.sas.com/rnd/datavisualization/yourGraphs/businessQuick/vbar/#s1=2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing style=listing;
ods graphics / width=5in height=2.81in;

title 'Mileage by Origin and Type';
proc sgplot data=sashelp.cars(where=(type ne 'Hybrid'));
  vbar origin / response=mpg_city group=type groupdisplay=cluster 
    stat=mean dataskin=gloss;
  xaxis display=(nolabel noticks);
  yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can we have the exact same chart but with &lt;STRONG&gt;vbar=origin one followed by other.&lt;/STRONG&gt;-- Not Stacked.&lt;/P&gt;
&lt;P&gt;So a bar chart for Asia followed by Europe followed by USA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 17:12:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bar-Charts-SGPLOT/m-p/563339#M157916</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-03T17:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Bar Charts- SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bar-Charts-SGPLOT/m-p/563343#M157920</link>
      <description>&lt;P&gt;Are you asking for 3 separate charts with each one showing Asia, one Europe and one USA or something else?&lt;/P&gt;
&lt;P&gt;Maybe&lt;/P&gt;
&lt;PRE&gt;proc sgpanel data=sashelp.cars(where=(type ne 'Hybrid'));
  panelby origin/ rows=3;
  vbar type / response=mpg_city groupdisplay=cluster 
    stat=mean dataskin=gloss;
  colaxis display=(nolabel noticks);
  rowaxis grid;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Jun 2019 17:28:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bar-Charts-SGPLOT/m-p/563343#M157920</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-03T17:28:02Z</dc:date>
    </item>
  </channel>
</rss>

