<?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 Center axis label along horizontal axis (and legend along vertical axis) in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Center-axis-label-along-horizontal-axis-and-legend-along/m-p/253633#M9178</link>
    <description>&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to center the horizontal axis label (along the axis) and center the legend along the vertical axis with proc gchart in this example but with no luck ... &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code modified from here: &amp;nbsp;&lt;A href="http://support.sas.com/kb/41/976.html" target="_blank"&gt;http://support.sas.com/kb/41/976.html&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/* Set the graphics environment */ &lt;BR /&gt;goptions reset=all cback=white border htitle=12pt htext=10pt; &lt;BR /&gt; &lt;BR /&gt;/* Create sample data */ &lt;BR /&gt;data test; &lt;BR /&gt; input midpnt category $ count; &lt;BR /&gt; datalines; &lt;BR /&gt;1 cat1 60 &lt;BR /&gt;1 cat2 40 &lt;BR /&gt;2 cat1 30 &lt;BR /&gt;2 cat2 70 &lt;BR /&gt;3 cat1 80 &lt;BR /&gt;3 cat2 20 &lt;BR /&gt;; &lt;BR /&gt;run; &lt;BR /&gt; &lt;BR /&gt;/* Define a title for the graph */ &lt;BR /&gt;title1 'Subgroups for Each Midpoint Total 100%'; &lt;BR /&gt; &lt;BR /&gt;/* Suppress the group axis label and values */ &lt;BR /&gt;axis1 label=none value=none; &lt;BR /&gt; &lt;BR /&gt;/* Angle the label for the response axis */ &lt;BR /&gt;axis2 label=(angle=90 'Percent'); &lt;BR /&gt;&lt;BR /&gt;/* midpoint axis */&lt;BR /&gt;axis3 label=(position=middle "Mid Point Label"); &lt;BR /&gt; &lt;BR /&gt;/* Define legend characteristics */ &lt;BR /&gt;legend1 label=(position=top justify=center 'Category') position=(center right outside) mode=reserve across=1; &lt;BR /&gt; &lt;BR /&gt;proc gchart data=test; &lt;BR /&gt; vbar midpnt / discrete subgroup=category &lt;BR /&gt; group=midpnt g100 nozero &lt;BR /&gt; freq=count type=percent &lt;BR /&gt; inside=percent width=20 &lt;BR /&gt; gaxis=axis1 raxis=axis2 maxis=axis3 &lt;BR /&gt; legend=legend1; &lt;BR /&gt;run; &lt;BR /&gt;quit;      &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2130i6077575145D02F74/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" width="617" height="477" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help much appreciated!d&lt;/P&gt;</description>
    <pubDate>Tue, 01 Mar 2016 23:14:41 GMT</pubDate>
    <dc:creator>mduarte</dc:creator>
    <dc:date>2016-03-01T23:14:41Z</dc:date>
    <item>
      <title>Center axis label along horizontal axis (and legend along vertical axis)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Center-axis-label-along-horizontal-axis-and-legend-along/m-p/253633#M9178</link>
      <description>&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to center the horizontal axis label (along the axis) and center the legend along the vertical axis with proc gchart in this example but with no luck ... &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code modified from here: &amp;nbsp;&lt;A href="http://support.sas.com/kb/41/976.html" target="_blank"&gt;http://support.sas.com/kb/41/976.html&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/* Set the graphics environment */ &lt;BR /&gt;goptions reset=all cback=white border htitle=12pt htext=10pt; &lt;BR /&gt; &lt;BR /&gt;/* Create sample data */ &lt;BR /&gt;data test; &lt;BR /&gt; input midpnt category $ count; &lt;BR /&gt; datalines; &lt;BR /&gt;1 cat1 60 &lt;BR /&gt;1 cat2 40 &lt;BR /&gt;2 cat1 30 &lt;BR /&gt;2 cat2 70 &lt;BR /&gt;3 cat1 80 &lt;BR /&gt;3 cat2 20 &lt;BR /&gt;; &lt;BR /&gt;run; &lt;BR /&gt; &lt;BR /&gt;/* Define a title for the graph */ &lt;BR /&gt;title1 'Subgroups for Each Midpoint Total 100%'; &lt;BR /&gt; &lt;BR /&gt;/* Suppress the group axis label and values */ &lt;BR /&gt;axis1 label=none value=none; &lt;BR /&gt; &lt;BR /&gt;/* Angle the label for the response axis */ &lt;BR /&gt;axis2 label=(angle=90 'Percent'); &lt;BR /&gt;&lt;BR /&gt;/* midpoint axis */&lt;BR /&gt;axis3 label=(position=middle "Mid Point Label"); &lt;BR /&gt; &lt;BR /&gt;/* Define legend characteristics */ &lt;BR /&gt;legend1 label=(position=top justify=center 'Category') position=(center right outside) mode=reserve across=1; &lt;BR /&gt; &lt;BR /&gt;proc gchart data=test; &lt;BR /&gt; vbar midpnt / discrete subgroup=category &lt;BR /&gt; group=midpnt g100 nozero &lt;BR /&gt; freq=count type=percent &lt;BR /&gt; inside=percent width=20 &lt;BR /&gt; gaxis=axis1 raxis=axis2 maxis=axis3 &lt;BR /&gt; legend=legend1; &lt;BR /&gt;run; &lt;BR /&gt;quit;      &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2130i6077575145D02F74/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" width="617" height="477" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help much appreciated!d&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 23:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Center-axis-label-along-horizontal-axis-and-legend-along/m-p/253633#M9178</guid>
      <dc:creator>mduarte</dc:creator>
      <dc:date>2016-03-01T23:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Center axis label along horizontal axis (and legend along vertical axis)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Center-axis-label-along-horizontal-axis-and-legend-along/m-p/253635#M9179</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Do you need to show the percentages in the barchart, and does the legend have to be centered vertically? If not here is a quick solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data = test;
&amp;nbsp; vbar midpnt / response = count group = category;
&amp;nbsp; xaxis label = "Mid Point Label";
&amp;nbsp; yaxis label = "Percent";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12334i4CBE24DE10E02FA1/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="barchart1.png" title="barchart1.png" /&gt;</description>
      <pubDate>Tue, 01 Mar 2016 23:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Center-axis-label-along-horizontal-axis-and-legend-along/m-p/253635#M9179</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2016-03-01T23:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Center axis label along horizontal axis (and legend along vertical axis)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Center-axis-label-along-horizontal-axis-and-legend-along/m-p/253639#M9180</link>
      <description>&lt;P&gt;This code, will also help you to get your percentage labels if you want them. It works in SAS 9.4. There may be an easier way in proc gchart to rearrange the labels and the legend but I am not that familiar with proc gchart,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test2;
  set test;
  by midpnt category;
  retain stacked_result;
  if first.midpnt then stacked_result = count;
  else stacked_result = stacked_result + count;
  length perc $4;
  perc = cats(stacked_result, "%");
  stacked_final = stacked_result - (0.05 * stacked_result);
run;

proc sgplot data = test2;
  vbarparm category = midpnt response = count / group = category groupdisplay = stacked;
  scatter x = midpnt y = stacked_final / markerchar=perc;
  xaxis label = "Mid Point Label";
  yaxis label = "Percent";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Mar 2016 00:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Center-axis-label-along-horizontal-axis-and-legend-along/m-p/253639#M9180</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2016-03-02T00:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Center axis label along horizontal axis (and legend along vertical axis)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Center-axis-label-along-horizontal-axis-and-legend-along/m-p/253653#M9181</link>
      <description>Thanks Djrisks and sorry I wasn't more specific in the original post. I did actually have a solution using sgplot. But I wanted to know how to do it in proc gchart. Trying to compare the two methods. .</description>
      <pubDate>Wed, 02 Mar 2016 01:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Center-axis-label-along-horizontal-axis-and-legend-along/m-p/253653#M9181</guid>
      <dc:creator>mduarte</dc:creator>
      <dc:date>2016-03-02T01:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Center axis label along horizontal axis (and legend along vertical axis)</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Center-axis-label-along-horizontal-axis-and-legend-along/m-p/253787#M9184</link>
      <description>&lt;P&gt;That's fine &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67853"&gt;@mduarte﻿&lt;/a&gt;. I'm sure someone else will help you with Proc gchart then. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt; might now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 12:59:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Center-axis-label-along-horizontal-axis-and-legend-along/m-p/253787#M9184</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2016-03-02T12:59:00Z</dc:date>
    </item>
  </channel>
</rss>

