<?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: How to get multiple bar charts in one page ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783807#M250018</link>
    <description>&lt;P&gt;What details do you need that Sgpanel doesn't give you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sgpanel data=sashelp.cars;
   where origin in ('Asia' 'Europe');
   panelby origin/ columns=2;
   vbar drivetrain / response=msrp;
run;&lt;/PRE&gt;</description>
    <pubDate>Fri, 03 Dec 2021 00:56:10 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-12-03T00:56:10Z</dc:date>
    <item>
      <title>How to get multiple bar charts in one page ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783797#M250013</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;BR /&gt;I am trying to get 2 bar charts for Asia and Europe side by side in one page in following sample data.&lt;/P&gt;
&lt;P&gt;Can someone please suggest an option to do this ?&lt;/P&gt;
&lt;P&gt;I am new to figures and don't know how to subset the data for each region and get the bar charts side by side.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
	define statgraph multiple_charts;
 
		begingraph;
			entrytitle "two Charts in One Image";
 
			/* Define Chart Grid */
			layout lattice / rows = 1 columns = 2;
 
				/* Chart 1 is for Europe */
				layout overlay;
					entry "Barchart" / location=outside;
					barchart x=DriveTrain y=msrp;
			
				endlayout;
 
				/* Chart 2 is for Asia */
				layout overlay;
					 	entry "Barchart" / location=outside;
					barchart x=DriveTrain y=msrp;
				endlayout;
			endlayout;
		endgraph;
	end;
run;
 
proc sgrender data=sashelp.cars template=multiple_charts;
/*where  origin in ('Asia' , 'Europe') ;*/
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Dec 2021 22:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783797#M250013</guid>
      <dc:creator>chetan3125</dc:creator>
      <dc:date>2021-12-02T22:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get multiple bar charts in one page ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783798#M250014</link>
      <description>&lt;P&gt;What is your ultimate output destination? HTML/RTF/PDF?&lt;/P&gt;
&lt;P&gt;Do they have to be two plots in one image or would two plots on the same page is enough?&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/282073"&gt;@chetan3125&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi ,&amp;nbsp;&lt;BR /&gt;I am trying to get 2 bar charts for Asia and Europe side by side in one page in following sample data.&lt;/P&gt;
&lt;P&gt;Can someone please suggest an option to do this ?&lt;/P&gt;
&lt;P&gt;I am new to figures and don't know how to subset the data for each region and get the bar charts side by side.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
	define statgraph multiple_charts;
 
		begingraph;
			entrytitle "two Charts in One Image";
 
			/* Define Chart Grid */
			layout lattice / rows = 1 columns = 2;
 
				/* Chart 1 is for Europe */
				layout overlay;
					entry "Barchart" / location=outside;
					barchart x=DriveTrain y=msrp;
			
				endlayout;
 
				/* Chart 2 is for Asia */
				layout overlay;
					 	entry "Barchart" / location=outside;
					barchart x=DriveTrain y=msrp;
				endlayout;
			endlayout;
		endgraph;
	end;
run;
 
proc sgrender data=sashelp.cars template=multiple_charts;
/*where  origin in ('Asia' , 'Europe') ;*/
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 22:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783798#M250014</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-12-02T22:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get multiple bar charts in one page ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783800#M250016</link>
      <description>Destinaition is RTF. &lt;BR /&gt;trying to get 2 plots in same image.</description>
      <pubDate>Thu, 02 Dec 2021 23:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783800#M250016</guid>
      <dc:creator>chetan3125</dc:creator>
      <dc:date>2021-12-02T23:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get multiple bar charts in one page ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783807#M250018</link>
      <description>&lt;P&gt;What details do you need that Sgpanel doesn't give you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sgpanel data=sashelp.cars;
   where origin in ('Asia' 'Europe');
   panelby origin/ columns=2;
   vbar drivetrain / response=msrp;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Dec 2021 00:56:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783807#M250018</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-12-03T00:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to get multiple bar charts in one page ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783813#M250020</link>
      <description>Thanks for this. but my company has a specific styles for graphs. which works with Proc template. &lt;BR /&gt;Hence , I was trying to do this without changing much in the code which we already have.</description>
      <pubDate>Fri, 03 Dec 2021 01:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783813#M250020</guid>
      <dc:creator>chetan3125</dc:creator>
      <dc:date>2021-12-03T01:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get multiple bar charts in one page ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783837#M250032</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282073"&gt;@chetan3125&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks for this. but my company has a specific styles for graphs. which works with Proc template. &lt;BR /&gt;Hence , I was trying to do this without changing much in the code which we already have.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Okay, company policy I understand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suggestion: when asking questions about graphic output provide a picture of the results needed as well as likely/possibly optional appearance needs that may be required sometimes (such as Fonts, standard color lists/orders). Knowing the actual desired appearance means we can make more targeted solutions. A list of likely needed options may head-off approaches that work for the provided example data set but may not work for the "simple" addition of one more graph that goes on a second row.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 04:25:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783837#M250032</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-12-03T04:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get multiple bar charts in one page ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783898#M250069</link>
      <description>&lt;P&gt;Change your data structure ?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
 define statgraph multiple_charts;
 
  begingraph;
   entrytitle "two Charts in One Image";
 
   /* Define Chart Grid */
   layout lattice / rows = 1 columns = 2;
 
    /* Chart 1 is for Europe */
    layout overlay;
     entry "Asia's Barchart" / location=outside;
     barchart x=DriveTrain y=Asia;
   
    endlayout;
 
    /* Chart 2 is for Asia */
    layout overlay;
       entry "Europe's Barchart" / location=outside;
     barchart x=DriveTrain y=Europe;
    endlayout;
   endlayout;
  endgraph;
 end;
run;


proc sort data= sashelp.cars(where=(origin in ('Asia' , 'Europe'))) out=cars(keep=origin DriveTrain msrp);
by DriveTrain origin ;
run;
proc transpose data=cars out=temp;
by DriveTrain origin;
var msrp;
run;
proc transpose data=temp out=temp2;
by DriveTrain ;
id origin;
var col:;
run;


proc sgrender data=temp2 template=multiple_charts;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 12:07:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-multiple-bar-charts-in-one-page/m-p/783898#M250069</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-12-03T12:07:12Z</dc:date>
    </item>
  </channel>
</rss>

