<?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: enhancement for my code in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/enhancement-for-my-code/m-p/469280#M16162</link>
    <description>&lt;P&gt;It is always better to use numbers to represent calendar or clock values. So if June is 6 and July is 7 and August is 8, these will automatically plot in the desired order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, instead of data as you have shown it, you could do less programming if you re-organzied the data before you create the SAS data set, something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;&lt;BR /&gt;input study_name $ month value;&lt;BR /&gt;datalines;&lt;BR /&gt;A 6 20&lt;BR /&gt;A 7 16&lt;BR /&gt;A 8 39&lt;BR /&gt;B 6 18&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Jun 2018 15:11:37 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-06-11T15:11:37Z</dc:date>
    <item>
      <title>enhancement for my code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/enhancement-for-my-code/m-p/469277#M16161</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;this code&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;data have;&lt;BR /&gt;input study_name $ June July August;&lt;BR /&gt;datalines;&lt;BR /&gt;A 20 16 39&lt;BR /&gt;B 18 18 6&lt;BR /&gt;C 19 1 5&lt;BR /&gt;D 87 65 115&lt;BR /&gt;E 63 55 62&lt;BR /&gt;F 81 104 87&lt;BR /&gt;G 73 19 49&lt;BR /&gt;H 189 69 79&lt;BR /&gt;I 28 6 8&lt;BR /&gt;J 87 83 52&lt;BR /&gt;K 0 0 0&lt;BR /&gt;L 0 0 0&lt;BR /&gt;M 4 1 1&lt;BR /&gt;N 1 0 2&lt;BR /&gt;O 212 159 304&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;proc transpose data=have out=trans&lt;BR /&gt;   name=Month;&lt;BR /&gt;by study_name;&lt;BR /&gt;var June July August;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Proc sgplot data=trans;&lt;BR /&gt;   vbar month / response=col1 group=study_name;&lt;BR /&gt;    yaxis grid display=(nolabel);&lt;BR /&gt;   Xaxis display=(nolabel);&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which produces this result in the picture.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that&amp;nbsp;the months in the bar chart are not displayed as they are in their order, they have alphabetical&amp;nbsp;order.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to find an option to change that but I couldn't find. Also, I don't need to display the study_name in the chart and don't know how to change the default.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture14.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21156i578E3A5BF925BC14/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture14.PNG" alt="Capture14.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 15:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/enhancement-for-my-code/m-p/469277#M16161</guid>
      <dc:creator>mona4u</dc:creator>
      <dc:date>2018-06-11T15:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: enhancement for my code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/enhancement-for-my-code/m-p/469280#M16162</link>
      <description>&lt;P&gt;It is always better to use numbers to represent calendar or clock values. So if June is 6 and July is 7 and August is 8, these will automatically plot in the desired order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, instead of data as you have shown it, you could do less programming if you re-organzied the data before you create the SAS data set, something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;&lt;BR /&gt;input study_name $ month value;&lt;BR /&gt;datalines;&lt;BR /&gt;A 6 20&lt;BR /&gt;A 7 16&lt;BR /&gt;A 8 39&lt;BR /&gt;B 6 18&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jun 2018 15:11:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/enhancement-for-my-code/m-p/469280#M16162</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-11T15:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: enhancement for my code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/enhancement-for-my-code/m-p/469282#M16163</link>
      <description>&lt;P&gt;Add DISCRETEORDER=DATA to your XAXIS statement, and set the legend title to be "".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;roc sgplot data=trans;
   vbar month / response=col1 group=study_name;
    yaxis grid display=(nolabel);
   Xaxis display=(nolabel) discreteorder=data;
   keylegend / title="";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 15:14:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/enhancement-for-my-code/m-p/469282#M16163</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2018-06-11T15:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: enhancement for my code</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/enhancement-for-my-code/m-p/469288#M16164</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130"&gt;@DanH_sas&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Add DISCRETEORDER=DATA to your XAXIS statement, and set the legend title to be "".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;roc sgplot data=trans;
   vbar month / response=col1 group=study_name;
    yaxis grid display=(nolabel);
   Xaxis display=(nolabel) discreteorder=data;
   keylegend / title="";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It might help get the right plot, but it is still a better practice to use numbers for calendar time periods rather than words like "August","June","July". Then, the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;discreteorder&lt;/FONT&gt;&amp;nbsp;option is not needed. And there are many other potential benefits as well in the long run.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 15:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/enhancement-for-my-code/m-p/469288#M16164</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-11T15:30:59Z</dc:date>
    </item>
  </channel>
</rss>

