<?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: proc sgplot bar-line graph and x-axis in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132075#M5120</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you provide a small sample of your data, so I can test it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Mar 2013 12:38:57 GMT</pubDate>
    <dc:creator>AncaTilea</dc:creator>
    <dc:date>2013-03-11T12:38:57Z</dc:date>
    <item>
      <title>proc sgplot bar-line graph and x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132072#M5117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using proc sgplot I created a bar-line graph with a primary y-axis and a secondary y-axis.&amp;nbsp; The problem is my x-axis which is a date variable.&amp;nbsp; I would like to format the date using format mmyyd. However I can't seem to figure out how when I have multiple y-axes.&amp;nbsp; I have tried a couple of combinations but none seem to work (see two examples below).&amp;nbsp; I have also included my base code for the entire proc sgplot code.&amp;nbsp; (On an unrelated note, any idea why keylegend comes up in red on my code?&amp;nbsp; This line works but the words are in red as opposed to the expected blue.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;1. format date mmyyd. (I prefer this approach as my date ranges vary for each output.)&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;2. xaxis label="Date" fitpolicy=rotate&amp;nbsp; type=time values=('01Oct2010'd to '01Jan2013'd by month)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=graphs;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vbar date / response=frequency_1&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vbar date / response=frequency_2&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; barwidth=0.5 transparency=0.2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vline date/ response=percent_1 &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;y2axis;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vline date/ response=percent_2&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; y2axis;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;keylegend / across=2; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 12:08:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132072#M5117</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2013-03-11T12:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot bar-line graph and x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132073#M5118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What happens when you try this:(please note the addition of the line in &lt;STRONG&gt;bold)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=graphs; &lt;/P&gt;&lt;P&gt;vbar date / response=frequency_1&lt;SPAN style="font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vbar date / response=frequency_2&lt;SPAN style="font-size: 10pt;"&gt; barwidth=0.5 transparency=0.2;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;vline date/ response=percent_1 &lt;SPAN style="font-size: 10pt;"&gt;y2axis;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vline date/ response=percent_2&lt;SPAN style="font-size: 10pt;"&gt; y2axis;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;keylegend / across=2; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;format date mmyyd.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 12:27:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132073#M5118</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-03-11T12:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot bar-line graph and x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132074#M5119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I use the format date mmyyd. statement, it does format my dates on the x-axis to the desired format. However, it changes the values percent (y2 axis) displayed on the graph.&amp;nbsp; I have found that it sums the percent values rather than just changing the look of the dates.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, here are weekly percent values:&lt;/P&gt;&lt;P&gt;Dec 1 2011 = 8%&lt;/P&gt;&lt;P&gt;Dec 8 2011 = 12%&lt;/P&gt;&lt;P&gt;Dec 15 2011 = 4%&lt;/P&gt;&lt;P&gt;Dec 22 2011 = 0%&lt;/P&gt;&lt;P&gt;Dec 29 2011 = 5%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using format date mmyd. - the % value on the y2 axis = 29% which is incorrect as the max % value for the month of December is 12%.&amp;nbsp; Does this make sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 12:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132074#M5119</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2013-03-11T12:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot bar-line graph and x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132075#M5120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you provide a small sample of your data, so I can test it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 12:38:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132075#M5120</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-03-11T12:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot bar-line graph and x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132076#M5121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help.&amp;nbsp; Please find attached a sample of the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 12:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132076#M5121</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2013-03-11T12:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot bar-line graph and x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132077#M5122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,Sophia.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what I can understand, when you format the x-axis to 'collapse' the weeks of a month into month...the default is to use the "sum" of the values associated with the weeks...&lt;/P&gt;&lt;P&gt;you could change that by using stat = mean in your vline statement.&lt;/P&gt;&lt;P&gt;proc sgplot data=temp; &lt;/P&gt;&lt;P&gt;vbar date / response=frequency_1 ;&lt;/P&gt;&lt;P&gt;vbar date / response=frequency_2 barwidth=0.5 transparency=0.2;&lt;/P&gt;&lt;P&gt;vline date/ response=percent_1 y2axis &lt;STRONG&gt;stat = mean;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;vline date/ response=percent_2 y2axis&lt;STRONG&gt; stat = mean;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;keylegend / across=2;&lt;/P&gt;&lt;P&gt;format date mmyyd.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by doing so, you will display the "average" percent for each month.&lt;/P&gt;&lt;P&gt;I am not sure that this is what you want, but I am also not sure that if you want to use the format you have another choice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 14:10:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132077#M5122</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-03-11T14:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot bar-line graph and x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132078#M5123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank Anca for looking at the code.&amp;nbsp; My main reason for using the mmyyd. format was to clean up the x-axis.&amp;nbsp; (It's too clutter if I keep all of the original dates.) Is there another format you recommend that wouldn't be too much for one graph but I would not have to sacrifice the original values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 14:16:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132078#M5123</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2013-03-11T14:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot bar-line graph and x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132079#M5124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the end I just used the fitpolicy option with rotatethin as the option.&amp;nbsp; This helps with the cluttered look.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your time!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 14:46:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132079#M5124</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2013-03-11T14:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot bar-line graph and x-axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132080#M5125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anca.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 14:57:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-sgplot-bar-line-graph-and-x-axis/m-p/132080#M5125</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-03-11T14:57:19Z</dc:date>
    </item>
  </channel>
</rss>

