<?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: Specifying value ranges for date values as x-axis in proc sgpanel in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Specifying-value-ranges-for-date-values-as-x-axis-in-proc/m-p/862757#M23570</link>
    <description>&lt;P&gt;I believe this is happening because the axis offsets are being calculated based on your long REFLINE labels. You can override this calculation by using the the OFFSETMIN and OFFSETMAX options on the COLAXIS statement. For example, you'll probably want to use OFFSETMIN=0 (or perhaps 0.05), since the first tick value is the only feature requiring space. For the OFFSETMAX, try the same value you use for OFFSETMIN, as the REFLINE labels all fall within the area of your series plots, leaving you only with the last tick value to include.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2023 18:42:06 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2023-03-07T18:42:06Z</dc:date>
    <item>
      <title>Specifying value ranges for date values as x-axis in proc sgpanel</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Specifying-value-ranges-for-date-values-as-x-axis-in-proc/m-p/862726#M23568</link>
      <description>&lt;P&gt;I'm struggling to shrink the range of x-axis date values in an sgpanel plot.&amp;nbsp; I've tried several options including using the min/max values, limiting the data set with a where statement and others.&amp;nbsp; I would like the graph to start in 1Nov2015 and end at 30Sep2021.&amp;nbsp; Here is my code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sgpanel data=gen_enc;
	where fisc_monyr &amp;gt;= '01Nov2015'd;
	panelby catvar1 / layout=rowlattice onepanel
		novarname uniscale=column;
	series x=fisc_monyr y=ctsvar1 / legendlabel='xxx' lineattrs=(color=black);
	series x=fisc_monyr y=catvar2 / legendlabel='yyy' lineattrs=(color=crimson);
	band x=fisc_monyr upper=xxx=0 /transparency=0.7;
	colaxis grid
			values=('01Nov2015'd to '01Oct2021'd)
			valuesformat=monyy. 
			label="Month-Year"
			display=all interval=year  valuesrotate=diagonal notimesplit;
	rowaxis grid
			label="AAA per month";
	format fisc_monyr monyy. dmisid $fomrat_gph.;
	/*Add refline for start date*/
	refline mgen_date / axis=x label=mgen_label labelattrs=(color=black Family=arial
										size=6) 
										lineattrs=(color=gray
										pattern=shortDash
										thickness=1)
										transparency=0.6
										;
	refline covid_start / axis=x label=covid_label labelattrs=(color=black Family=arial
										size=6) labelpos=min 
										lineattrs=(color=black
										pattern=dot
										thickness=1)
										transparency=0.8
										;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;Here is how the x-axis is showing:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bhando_0-1678208647506.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81167i380232A5EDD75167/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bhando_0-1678208647506.png" alt="Bhando_0-1678208647506.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there a way to get rid of the space in the red boxes?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 17:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Specifying-value-ranges-for-date-values-as-x-axis-in-proc/m-p/862726#M23568</guid>
      <dc:creator>Bhando</dc:creator>
      <dc:date>2023-03-07T17:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying value ranges for date values as x-axis in proc sgpanel</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Specifying-value-ranges-for-date-values-as-x-axis-in-proc/m-p/862751#M23569</link>
      <description>&lt;P&gt;Show your log, include the submitted code and all the notes, messages and warnings that may appear. Copy all the text and paste into a text box opened on the forum with the &amp;lt;/&amp;gt; icon above the message window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best would be to provide some data that behaves like that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you use DATE values and formats and have uneven boundaries, like your Nov to Oct (not a year or calendar quarter) then the defaults to display the values can start running into multiple issues. You have about 6 years of data and the display space for the axis labels doesn't have much space. You may be able to get more control listing actual values for each tick mark, possibly:&lt;/P&gt;
&lt;PRE&gt;values=('01Nov2015'd, '01Jan2016'd to '01Jan2021'd by year,'01Oct2021'd)&lt;/PRE&gt;
&lt;P&gt;but SAS get get picky about uneven intervals with some display spaces.&lt;/P&gt;
&lt;P&gt;It might help to make the size of the graph larger with the ODS Graphics Width setting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FWIW, not personally a fan of the MONYY5 format as it is easy to confuse Day of Month with the 2-digit year on a glance with some ranges of values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 18:29:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Specifying-value-ranges-for-date-values-as-x-axis-in-proc/m-p/862751#M23569</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-07T18:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying value ranges for date values as x-axis in proc sgpanel</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Specifying-value-ranges-for-date-values-as-x-axis-in-proc/m-p/862757#M23570</link>
      <description>&lt;P&gt;I believe this is happening because the axis offsets are being calculated based on your long REFLINE labels. You can override this calculation by using the the OFFSETMIN and OFFSETMAX options on the COLAXIS statement. For example, you'll probably want to use OFFSETMIN=0 (or perhaps 0.05), since the first tick value is the only feature requiring space. For the OFFSETMAX, try the same value you use for OFFSETMIN, as the REFLINE labels all fall within the area of your series plots, leaving you only with the last tick value to include.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 18:42:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Specifying-value-ranges-for-date-values-as-x-axis-in-proc/m-p/862757#M23570</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2023-03-07T18:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying value ranges for date values as x-axis in proc sgpanel</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Specifying-value-ranges-for-date-values-as-x-axis-in-proc/m-p/862800#M23571</link>
      <description>Hi Ballardw, this solution on the dates worked fantatstic. Thanks so much. Sorry for not posting the log. I will do that next time. I thought it would be too much for folks to read. Really appreciate your help here.</description>
      <pubDate>Tue, 07 Mar 2023 20:50:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Specifying-value-ranges-for-date-values-as-x-axis-in-proc/m-p/862800#M23571</guid>
      <dc:creator>Bhando</dc:creator>
      <dc:date>2023-03-07T20:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying value ranges for date values as x-axis in proc sgpanel</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Specifying-value-ranges-for-date-values-as-x-axis-in-proc/m-p/862801#M23572</link>
      <description>Thanks, Dan. It worked great! Really appreciate all the help.</description>
      <pubDate>Tue, 07 Mar 2023 20:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Specifying-value-ranges-for-date-values-as-x-axis-in-proc/m-p/862801#M23572</guid>
      <dc:creator>Bhando</dc:creator>
      <dc:date>2023-03-07T20:50:33Z</dc:date>
    </item>
  </channel>
</rss>

