<?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: How to label a data point using more than one text in proc sgplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/764896#M21918</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10604"&gt;@djrisks&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution given requires that one manually check the field 'text' to identify the other 'text' value, I have then modified it to check it through a code. however I am thing of a situation where there is more than one text value, how does one identify them through a code.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; processhelp2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; data1.processhelp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dates;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; first.dates &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; month = lag(month) &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; lag(text) ne &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;' '&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; text3 = text;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;else&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; first.dates &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; text3=&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;' '&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; text2 = text;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;raw2 = raw+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#08726d"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Aug 2021 16:35:16 GMT</pubDate>
    <dc:creator>Zandi</dc:creator>
    <dc:date>2021-08-30T16:35:16Z</dc:date>
    <item>
      <title>How to label a data point using more than one text in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/762491#M21884</link>
      <description>&lt;P&gt;i have the below code that i used to generate a graph. One of the point corresponding to August has more than one text label. this two labels are on topp of each other. how do i show them separately on the graph.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;options papersize=A3 orientation=landscape pagesize=250 ;&lt;/P&gt;&lt;P&gt;ods graphics on / width=20in;&lt;BR /&gt;ods graphics on /height=8in;&lt;BR /&gt;proc sgplot data=data1.ProcessHelp ;&lt;BR /&gt;title "Process results";&lt;BR /&gt;vbox Clean/ category=month group=ref grouporder=data /*extreme */ name='Cleaned' ;&lt;BR /&gt;vbox raw / y2axis category=month group=Ref_point grouporder=data /* extreme*/ boxwidth=0.3 /*datalabel=dates&lt;BR /&gt;DATALABELATTRS=(Color=red Family="Arial" Size=8 Style=Italic Weight=Bold)*/&lt;BR /&gt;transparency=0.7 fillattrs= (color=darkorange) name='Raws';&lt;BR /&gt;TEXT Y=raw X=month TEXT=text/POSITION=top TEXTATTRS = (SIZE=7 COLOR='red');&lt;BR /&gt;YAXIS LABEL="Allowed process" labelattrs=(weight=bold) ;&lt;BR /&gt;Y2AXIS LABEL="Disallowed process" labelattrs=(weight=bold) ;&lt;BR /&gt;refline 10 / lineattrs=(color=Green pattern=dash) legendlabel='Spec1 ' name= 'Prod' ;&lt;BR /&gt;refline 15 / lineattrs=(color=red pattern=dash) legendlabel='Spec2 ' name='SANS' ;&lt;BR /&gt;keylegend 'Cleaned' 'Raws' / title='Reference points: ' valueattrs=(size=8) titleattrs=(size=8) position=bottom exclude= ("") ;&lt;BR /&gt;keylegend 'Prod' 'SANS' /TITLE= 'Limits:' valueattrs=(size=8) titleattrs=(size=8) position=bottom ;&lt;BR /&gt;xaxis label='Period' ;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 09:29:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/762491#M21884</guid>
      <dc:creator>Zandi</dc:creator>
      <dc:date>2021-08-19T09:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to label a data point using more than one text in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/762687#M21885</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282528"&gt;@Zandi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your SGPLOT procedure, you are using the TEXT statement to display the months. And so all you need to do is essentially use another TEXT statement to show the other date. And you can change the previous TEXT statement to only show one of the values in August 2020.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see the example code below. Where, two new columns were generated which have the text values, and then another column was generated so that the other value in August can be positioned higher up on the y-axis.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data processhelp2;
  set data1.processhelp;
  if dates = '31AUG2020'd then text3 = text;
  else text2 = text;
  raw2 = raw+5;
run;


options papersize=A3 orientation=landscape pagesize=250 ;

ods graphics on / width=20in;
ods graphics on /height=8in;
proc sgplot data=processhelp2;
title "Process results";
vbox Clean/ category=month group=ref grouporder=data /*extreme */ name='Cleaned' ;
vbox raw / y2axis category=month group=Ref_point grouporder=data /* extreme*/ boxwidth=0.3 /*datalabel=dates
DATALABELATTRS=(Color=red Family="Arial" Size=8 Style=Italic Weight=Bold)*/
transparency=0.7 fillattrs= (color=darkorange) name='Raws';
TEXT Y=raw X=month TEXT=text2/POSITION=top TEXTATTRS = (SIZE=7 COLOR='red');
TEXT Y=raw2 X=month TEXT=text3/POSITION=top TEXTATTRS = (SIZE=7 COLOR='red');

YAXIS LABEL="Allowed process" labelattrs=(weight=bold) ;
Y2AXIS LABEL="Disallowed process" labelattrs=(weight=bold) ;
refline 10 / lineattrs=(color=Green pattern=dash) legendlabel='Spec1 ' name= 'Prod' ;
refline 15 / lineattrs=(color=red pattern=dash) legendlabel='Spec2 ' name='SANS' ;
keylegend 'Cleaned' 'Raws' / title='Reference points: ' valueattrs=(size=8) titleattrs=(size=8) position=bottom exclude= ("") ;
keylegend 'Prod' 'SANS' /TITLE= 'Limits:' valueattrs=(size=8) titleattrs=(size=8) position=bottom ;
xaxis label='Period' ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 20:33:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/762687#M21885</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-08-19T20:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to label a data point using more than one text in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/762783#M21887</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10604"&gt;@djrisks&lt;/a&gt;&amp;nbsp;The solution worked perfectly. Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 08:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/762783#M21887</guid>
      <dc:creator>Zandi</dc:creator>
      <dc:date>2021-08-20T08:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to label a data point using more than one text in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/762784#M21888</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282528"&gt;@Zandi&lt;/a&gt;, you're welcome! That's great!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 08:49:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/762784#M21888</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-08-20T08:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to label a data point using more than one text in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/764896#M21918</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10604"&gt;@djrisks&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution given requires that one manually check the field 'text' to identify the other 'text' value, I have then modified it to check it through a code. however I am thing of a situation where there is more than one text value, how does one identify them through a code.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; processhelp2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; data1.processhelp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dates;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; first.dates &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; month = lag(month) &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; lag(text) ne &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;' '&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; text3 = text;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;else&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; first.dates &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; text3=&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;' '&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; text2 = text;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;raw2 = raw+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#08726d"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 16:35:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/764896#M21918</guid>
      <dc:creator>Zandi</dc:creator>
      <dc:date>2021-08-30T16:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to label a data point using more than one text in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/765516#M21930</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282528"&gt;@Zandi&lt;/a&gt;&amp;nbsp;sorry, I do not understand your question. Please can you explain again?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kriss&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 22:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-label-a-data-point-using-more-than-one-text-in-proc/m-p/765516#M21930</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-09-01T22:20:51Z</dc:date>
    </item>
  </channel>
</rss>

