<?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 Bargraph with an Axis of Percent in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187196#M6888</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial',sans-serif; background: white;"&gt;Does SAS 9.2 have the ability to display a Bargraph with an Axis of percent?&amp;nbsp; My goal is to show a percent comparison of variable ‘Status’.&amp;nbsp; Like the below image.&amp;nbsp; T&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial',sans-serif; background: white;"&gt;he code would theoretically look something like this.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="percent.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/8751_percent.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc gchart data=enrollment;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hbar enrRepTy /&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type=percent&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inside=subpct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sumvar=STUDENTS_ENROLLED&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pctsum&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subgroup=Status&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; discrete&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gaxis=axis1 maxis=axis2 raxis=axis3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; legend = legend1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run; Quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jan 2015 20:40:48 GMT</pubDate>
    <dc:creator>DavidPhillips2</dc:creator>
    <dc:date>2015-01-16T20:40:48Z</dc:date>
    <item>
      <title>Bargraph with an Axis of Percent</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187196#M6888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial',sans-serif; background: white;"&gt;Does SAS 9.2 have the ability to display a Bargraph with an Axis of percent?&amp;nbsp; My goal is to show a percent comparison of variable ‘Status’.&amp;nbsp; Like the below image.&amp;nbsp; T&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial',sans-serif; background: white;"&gt;he code would theoretically look something like this.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="percent.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/8751_percent.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc gchart data=enrollment;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hbar enrRepTy /&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type=percent&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inside=subpct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sumvar=STUDENTS_ENROLLED&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pctsum&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subgroup=Status&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; discrete&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gaxis=axis1 maxis=axis2 raxis=axis3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; legend = legend1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run; Quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 20:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187196#M6888</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2015-01-16T20:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Bargraph with an Axis of Percent</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187197#M6889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial',sans-serif; background: white;"&gt;What I could do is make a summary dataset that has the percentages hard coded rather than attempting to calculate the percentage when making the graph.&amp;nbsp; It is highly likely there is a built in function for this though.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 20:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187197#M6889</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2015-01-16T20:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Bargraph with an Axis of Percent</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187198#M6890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide sample data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 22:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187198#M6890</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-01-16T22:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Bargraph with an Axis of Percent</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187199#M6891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS 9.4m2&amp;nbsp; supports everything you want via PROC SGPLOT (see below). SAS 9.4 supports everything but the segment labels. At SAS 9.2, you will need to pre-summarize as you suggested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Title "Total Class Weight by Percentage";&lt;/P&gt;&lt;P&gt;proc sgplot data=sashelp.class;&lt;/P&gt;&lt;P&gt;hbar age / response=weight stat=pct group=sex seglabel;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="percentage.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/8752_percentage.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 22:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187199#M6891</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2015-01-16T22:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Bargraph with an Axis of Percent</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187200#M6892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="active_link" href="http://robslink.com/SAS/democd7/aaaindex.htm"&gt;http://robslink.com/SAS/democd7/aaaindex.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Has some examples that should get you started.&lt;/P&gt;&lt;P&gt;A common theme has to do with the AXIS definition in the values part and format chosen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 22:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187200#M6892</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-01-16T22:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Bargraph with an Axis of Percent</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187201#M6893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial',sans-serif; background: white;"&gt;Ballardw, I found this in one of the examples in your link.&amp;nbsp; It is straight forward.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data my_data;&lt;/P&gt;&lt;P&gt;input CATEGORY SERIES $ 3-11 AMOUNT;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 Series A&amp;nbsp; 5.0&lt;/P&gt;&lt;P&gt;2 Series A&amp;nbsp; 6.8&lt;/P&gt;&lt;P&gt;3 Series A&amp;nbsp; 9.2&lt;/P&gt;&lt;P&gt;1 Series B&amp;nbsp; 6.5&lt;/P&gt;&lt;P&gt;2 Series B&amp;nbsp; 6.9&lt;/P&gt;&lt;P&gt;3 Series B&amp;nbsp; 5.6&lt;/P&gt;&lt;P&gt;1 Series C&amp;nbsp; 2.3&lt;/P&gt;&lt;P&gt;2 Series C&amp;nbsp; 3.1&lt;/P&gt;&lt;P&gt;3 Series C&amp;nbsp; 2.3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt; create table my_data as&lt;/P&gt;&lt;P&gt; select *, sum(amount) as bartotal&lt;/P&gt;&lt;P&gt; from my_data&lt;/P&gt;&lt;P&gt; group by category;&lt;/P&gt;&lt;P&gt;quit; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data my_data; set my_data;&lt;/P&gt;&lt;P&gt;format catpct percent6.0;&lt;/P&gt;&lt;P&gt;catpct=amount/bartotal;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data my_data; set my_data;&lt;/P&gt;&lt;P&gt;length htmlvar $500;&lt;/P&gt;&lt;P&gt;htmlvar=&lt;/P&gt;&lt;P&gt; 'title='||quote( &lt;/P&gt;&lt;P&gt;&amp;nbsp; 'Category: '||trim(left(category))||'0D'x||&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'Series: '||trim(left(series))||'0D'x||&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'Amount: '||trim(left(amount))||'0D'x||&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'Percent: '||trim(left(put(catpct,percent6.0)))||' of '||trim(left(bartotal)) &lt;/P&gt;&lt;P&gt;&amp;nbsp; )||&lt;/P&gt;&lt;P&gt; ' href="bar6_info.htm"';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc gchart data=my_data; &lt;/P&gt;&lt;P&gt;hbar category / discrete type=sum sumvar=catpct nostats nolegend&lt;/P&gt;&lt;P&gt; subgroup=series /* this controls the coloring */&lt;/P&gt;&lt;P&gt; autoref clipref cref=graycc space=4.0&lt;/P&gt;&lt;P&gt; maxis=axis1 raxis=axis2&lt;/P&gt;&lt;P&gt; cframe=white coutline=black &lt;/P&gt;&lt;P&gt; html=htmlvar&lt;/P&gt;&lt;P&gt; des='' name="&amp;amp;name";&amp;nbsp; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 13:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Bargraph-with-an-Axis-of-Percent/m-p/187201#M6893</guid>
      <dc:creator>DavidPhillips2</dc:creator>
      <dc:date>2015-01-20T13:52:01Z</dc:date>
    </item>
  </channel>
</rss>

