<?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 - seglabel= is not a valid syntax - looking for workaround in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-seglabel-is-not-a-valid-syntax-looking-for-workaround/m-p/587011#M18849</link>
    <description>&lt;P&gt;You can use a TEXT statement to overlay the values. You may want to add some offset or adjustment to have them positioned exactly where you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/184742"&gt;@xxformat_com&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;datalabel=... can be used to specified a variable which will use to display the information.&lt;/P&gt;
&lt;P&gt;But there is nothing similar with seglabel. We can not specifiy seglabel=ageb.&lt;/P&gt;
&lt;P&gt;Is there a workaround to display other values that the statistics associated with the group in a bar?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    value yr 12='12 Years Old'
             13='13 Years Old'
             14='14 Years Old'
             15='15 Years Old'
             16='16 Years Old';
run;

data class;
    set sashelp.class;
    ageb=put(age,yr.);
run;

ods graphics / width=15cm height=10cm noborder;

proc sgplot data=class noborder noautolegend;
    vbar sex / group=age 
               seglabel;
run;

/* 
*this will not work as seglabel cannot be followed by an equal sign;
proc sgplot data=class noborder noautolegend;
    vbar sex / group=age 
               seglabel=ageb;
run;
 
proc sgplot data=class noborder noautolegend;
    vbar sex / group=age 
               seglabel=age
               seglabelformat=yr.;
run;
*/
ods graphics off;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 07 Sep 2019 23:22:35 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-09-07T23:22:35Z</dc:date>
    <item>
      <title>sgplot - seglabel= is not a valid syntax - looking for workaround</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-seglabel-is-not-a-valid-syntax-looking-for-workaround/m-p/586952#M18846</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;datalabel=... can be used to specified a variable which will use to display the information.&lt;/P&gt;&lt;P&gt;But there is nothing similar with seglabel. We can not specifiy seglabel=ageb.&lt;/P&gt;&lt;P&gt;Is there a workaround to display other values that the statistics associated with the group in a bar?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    value yr 12='12 Years Old'
             13='13 Years Old'
             14='14 Years Old'
             15='15 Years Old'
             16='16 Years Old';
run;

data class;
    set sashelp.class;
    ageb=put(age,yr.);
run;

ods graphics / width=15cm height=10cm noborder;

proc sgplot data=class noborder noautolegend;
    vbar sex / group=age 
               seglabel;
run;

/* 
*this will not work as seglabel cannot be followed by an equal sign;
proc sgplot data=class noborder noautolegend;
    vbar sex / group=age 
               seglabel=ageb;
run;
 
proc sgplot data=class noborder noautolegend;
    vbar sex / group=age 
               seglabel=age
               seglabelformat=yr.;
run;
*/
ods graphics off;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Sep 2019 08:47:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-seglabel-is-not-a-valid-syntax-looking-for-workaround/m-p/586952#M18846</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2019-09-07T08:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot - seglabel= is not a valid syntax - looking for workaround</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-seglabel-is-not-a-valid-syntax-looking-for-workaround/m-p/587011#M18849</link>
      <description>&lt;P&gt;You can use a TEXT statement to overlay the values. You may want to add some offset or adjustment to have them positioned exactly where you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/184742"&gt;@xxformat_com&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;datalabel=... can be used to specified a variable which will use to display the information.&lt;/P&gt;
&lt;P&gt;But there is nothing similar with seglabel. We can not specifiy seglabel=ageb.&lt;/P&gt;
&lt;P&gt;Is there a workaround to display other values that the statistics associated with the group in a bar?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    value yr 12='12 Years Old'
             13='13 Years Old'
             14='14 Years Old'
             15='15 Years Old'
             16='16 Years Old';
run;

data class;
    set sashelp.class;
    ageb=put(age,yr.);
run;

ods graphics / width=15cm height=10cm noborder;

proc sgplot data=class noborder noautolegend;
    vbar sex / group=age 
               seglabel;
run;

/* 
*this will not work as seglabel cannot be followed by an equal sign;
proc sgplot data=class noborder noautolegend;
    vbar sex / group=age 
               seglabel=ageb;
run;
 
proc sgplot data=class noborder noautolegend;
    vbar sex / group=age 
               seglabel=age
               seglabelformat=yr.;
run;
*/
ods graphics off;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2019 23:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-seglabel-is-not-a-valid-syntax-looking-for-workaround/m-p/587011#M18849</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-07T23:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot - seglabel= is not a valid syntax - looking for workaround</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-seglabel-is-not-a-valid-syntax-looking-for-workaround/m-p/587373#M18851</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here is the solution I finally got with sganno=:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data anno;
    function = 'text';
    textcolor= 'white';
    x1space  = 'datavalue';
    y1space  = 'datavalue';
    justify  = 'center';
    width    = 30;
    
    xc1='F';
    label='11 years old'; y1=.5; output;
    label='12 years old'; y1=2;  output;
    label='13 years old'; y1=4;  output;
    label='14 years old'; y1=6;  output;
    label='15 years old'; y1=8;  output;
    
    xc1='M';
    label='11 years old'; y1=.5;  output;
    label='12 years old'; y1=2.5; output;
    label='13 years old'; y1=4.5; output;
    label='14 years old'; y1=6;   output;
    label='15 years old'; y1=8;   output;
    label='16 years old'; y1=9.5; output;
run;

ods graphics / width=15cm height=10cm noborder;

proc sgplot data=sashelp.class noborder noautolegend sganno=anno;
    vbar sex / group=age;
run;

ods graphics;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sganno.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32330i9699A7A46D4FA73E/image-size/large?v=v2&amp;amp;px=999" role="button" title="sganno.JPG" alt="sganno.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 21:52:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-seglabel-is-not-a-valid-syntax-looking-for-workaround/m-p/587373#M18851</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2019-09-09T21:52:40Z</dc:date>
    </item>
  </channel>
</rss>

