<?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: SGPLOT:  Wrap &amp; Left Justify Tickmark Values in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-Wrap-Left-Justify-Tickmark-Values/m-p/75191#M2799</link>
    <description>There is one other alternative.  If you are able to use vertical bar charts instead of horizontal, you can use the following GTL example that was created by a colleague here to solve a similar problem.  To change the justification, change the VALUEHALIGN option.&lt;BR /&gt;
&lt;BR /&gt;
proc template;&lt;BR /&gt;
define statgraph tickvaluewrap; &lt;BR /&gt;
begingraph  ;&lt;BR /&gt;
  layout lattice / columns=1  rowgutter=0 rowweights=(.85 .15) columndatarange=union;&lt;BR /&gt;
    columnaxes;&lt;BR /&gt;
	  columnaxis / offsetmin=.11 offsetmax=.11 display=none;&lt;BR /&gt;
	endcolumnaxes;&lt;BR /&gt;
    barchart  x=question y=answer / ;&lt;BR /&gt;
    blockplot x=question block=line / class=n display=(values) valuehalign=center;&lt;BR /&gt;
  endlayout;&lt;BR /&gt;
endgraph;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
data survey;  &lt;BR /&gt;
  length line $20;&lt;BR /&gt;
  input Answer Question $3-70;&lt;BR /&gt;
  n=1; &lt;BR /&gt;
  line= scan(question,n,"~");&lt;BR /&gt;
  do while( lengthn(line) &amp;gt; 0 );   &lt;BR /&gt;
    output;&lt;BR /&gt;
    n+1; answer=.;&lt;BR /&gt;
    line= scan(question,n,"~");  &lt;BR /&gt;
  end;&lt;BR /&gt;
datalines;&lt;BR /&gt;
3 #1~How do you~feel today? &lt;BR /&gt;
4 #2~Would you be~willing to try this~again? &lt;BR /&gt;
2 #3~Is there some~way to get there~from here? &lt;BR /&gt;
5 #4~When do you~think this will~be finished,~today?&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
  &lt;BR /&gt;
ods listing;&lt;BR /&gt;
   &lt;BR /&gt;
ods graphics / reset   ;&lt;BR /&gt;
proc sgrender data=survey template=tickvaluewrap;&lt;BR /&gt;
run;</description>
    <pubDate>Fri, 09 Oct 2009 20:42:37 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2009-10-09T20:42:37Z</dc:date>
    <item>
      <title>SGPLOT:  Wrap &amp; Left Justify Tickmark Values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-Wrap-Left-Justify-Tickmark-Values/m-p/75189#M2797</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
When using PROC SGPLOT to create a horizontal bar chart, can I Ieft justify tickmark values?  What I'm looking for is something like the AXIS statement's SPLIT option.  I can make a tickmark value wrap by embedding a linefeed character in the value, but I haven't found a way to left justify the text:&lt;BR /&gt;
&lt;BR /&gt;
data class;&lt;BR /&gt;
length name $ 40;&lt;BR /&gt;
set sashelp.class;&lt;BR /&gt;
if name="Alfred" then name="Alfred" || '0a'x || "AKA: Alfred the Great";&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sgplot data=class;&lt;BR /&gt;
hbar name / response=age stat=sum;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Randy</description>
      <pubDate>Thu, 08 Oct 2009 18:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-Wrap-Left-Justify-Tickmark-Values/m-p/75189#M2797</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-10-08T18:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT:  Wrap &amp; Left Justify Tickmark Values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-Wrap-Left-Justify-Tickmark-Values/m-p/75190#M2798</link>
      <description>Hey Randy,&lt;BR /&gt;
&lt;BR /&gt;
First of all, that was a really creative way to get tick mark splitting :-).  Unfortunately, we currently do not have a way for you to set justification on axis tick values. If tick value splitting is something you need often, I would contact Tech Support and give them that feedback.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Dan</description>
      <pubDate>Fri, 09 Oct 2009 20:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-Wrap-Left-Justify-Tickmark-Values/m-p/75190#M2798</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2009-10-09T20:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT:  Wrap &amp; Left Justify Tickmark Values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-Wrap-Left-Justify-Tickmark-Values/m-p/75191#M2799</link>
      <description>There is one other alternative.  If you are able to use vertical bar charts instead of horizontal, you can use the following GTL example that was created by a colleague here to solve a similar problem.  To change the justification, change the VALUEHALIGN option.&lt;BR /&gt;
&lt;BR /&gt;
proc template;&lt;BR /&gt;
define statgraph tickvaluewrap; &lt;BR /&gt;
begingraph  ;&lt;BR /&gt;
  layout lattice / columns=1  rowgutter=0 rowweights=(.85 .15) columndatarange=union;&lt;BR /&gt;
    columnaxes;&lt;BR /&gt;
	  columnaxis / offsetmin=.11 offsetmax=.11 display=none;&lt;BR /&gt;
	endcolumnaxes;&lt;BR /&gt;
    barchart  x=question y=answer / ;&lt;BR /&gt;
    blockplot x=question block=line / class=n display=(values) valuehalign=center;&lt;BR /&gt;
  endlayout;&lt;BR /&gt;
endgraph;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
data survey;  &lt;BR /&gt;
  length line $20;&lt;BR /&gt;
  input Answer Question $3-70;&lt;BR /&gt;
  n=1; &lt;BR /&gt;
  line= scan(question,n,"~");&lt;BR /&gt;
  do while( lengthn(line) &amp;gt; 0 );   &lt;BR /&gt;
    output;&lt;BR /&gt;
    n+1; answer=.;&lt;BR /&gt;
    line= scan(question,n,"~");  &lt;BR /&gt;
  end;&lt;BR /&gt;
datalines;&lt;BR /&gt;
3 #1~How do you~feel today? &lt;BR /&gt;
4 #2~Would you be~willing to try this~again? &lt;BR /&gt;
2 #3~Is there some~way to get there~from here? &lt;BR /&gt;
5 #4~When do you~think this will~be finished,~today?&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
  &lt;BR /&gt;
ods listing;&lt;BR /&gt;
   &lt;BR /&gt;
ods graphics / reset   ;&lt;BR /&gt;
proc sgrender data=survey template=tickvaluewrap;&lt;BR /&gt;
run;</description>
      <pubDate>Fri, 09 Oct 2009 20:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-Wrap-Left-Justify-Tickmark-Values/m-p/75191#M2799</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2009-10-09T20:42:37Z</dc:date>
    </item>
  </channel>
</rss>

