<?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 change color of segment label text inside bar in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-color-of-segment-label-text-inside-bar/m-p/602597#M19081</link>
    <description>&lt;P&gt;This may not be the best way but it works. Basically calculate a Y position for a TEXT plot and don't use the seglabel or datalabel options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.myattrs;
length value fillcolor $12;
show='AttrMap';
id="jrc_ID";
value=11; fillcolor='red';textcolor='yellow'; output;
value=12; fillcolor='yellow';textcolor='red'; output;
value=13; fillcolor='green';textcolor='purple'; output;
value=14; fillcolor='blue';textcolor='orange'; output;
value=15; fillcolor='black';textcolor='white'; output;
value=16; fillcolor='cyan';textcolor='black'; output;
run;


proc summary data=sashelp.class nway;
class age;
var weight;
output out=class mean=;
run;
data class;
   set class;
   y= weight/2;
   text = put(weight,best4.);
run;

proc sgplot data=class dattrmap=work.myattrs;
vbarparm category=age response=weight / group=age  dataskin=matte attrid=jrc_ID ;
text x=age y=y text=text/ attrid=jrc_ID group=age;
run;
&lt;/PRE&gt;
&lt;P&gt;Calculating a segment label location for&amp;nbsp;stacked elements may be tad trickier but the general approach works. I'm not sure if a later version&amp;nbsp;has more options for&amp;nbsp;segment text in either the&amp;nbsp;dattrmap set or&amp;nbsp;options.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2019 20:26:07 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-11-07T20:26:07Z</dc:date>
    <item>
      <title>How to change color of segment label text inside bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-color-of-segment-label-text-inside-bar/m-p/602552#M19080</link>
      <description>&lt;P&gt;This is an example of what I have using sashelp:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data myattrs;&lt;BR /&gt;length value fillcolor $12;&lt;BR /&gt;show='AttrMap';&lt;BR /&gt;id="jrc_ID";&lt;BR /&gt;value=11; fillcolor='red'; output;&lt;BR /&gt;value=12; fillcolor='yellow'; output;&lt;BR /&gt;value=13; fillcolor='green'; output;&lt;BR /&gt;value=14; fillcolor='blue'; output;&lt;BR /&gt;value=15; fillcolor='black'; output;&lt;BR /&gt;value=16; fillcolor='cyan'; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc summary data=sashelp.class nway;&lt;BR /&gt;class age;&lt;BR /&gt;var weight;&lt;BR /&gt;output out=class mean=;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sgplot data=class dattrmap=myattrs;&lt;BR /&gt;vbarparm category=age response=weight / group=age seglabel dataskin=matte attrid=jrc_ID datalabel;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to do is set the color of the font inside the each bar to a different color, for example blue bar = yellow font, green bar = white font, cyan bar = black font, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried seglabelattrs but it will only take one color for the font.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 19:14:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-color-of-segment-label-text-inside-bar/m-p/602552#M19080</guid>
      <dc:creator>cuevasj</dc:creator>
      <dc:date>2019-11-07T19:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to change color of segment label text inside bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-color-of-segment-label-text-inside-bar/m-p/602597#M19081</link>
      <description>&lt;P&gt;This may not be the best way but it works. Basically calculate a Y position for a TEXT plot and don't use the seglabel or datalabel options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.myattrs;
length value fillcolor $12;
show='AttrMap';
id="jrc_ID";
value=11; fillcolor='red';textcolor='yellow'; output;
value=12; fillcolor='yellow';textcolor='red'; output;
value=13; fillcolor='green';textcolor='purple'; output;
value=14; fillcolor='blue';textcolor='orange'; output;
value=15; fillcolor='black';textcolor='white'; output;
value=16; fillcolor='cyan';textcolor='black'; output;
run;


proc summary data=sashelp.class nway;
class age;
var weight;
output out=class mean=;
run;
data class;
   set class;
   y= weight/2;
   text = put(weight,best4.);
run;

proc sgplot data=class dattrmap=work.myattrs;
vbarparm category=age response=weight / group=age  dataskin=matte attrid=jrc_ID ;
text x=age y=y text=text/ attrid=jrc_ID group=age;
run;
&lt;/PRE&gt;
&lt;P&gt;Calculating a segment label location for&amp;nbsp;stacked elements may be tad trickier but the general approach works. I'm not sure if a later version&amp;nbsp;has more options for&amp;nbsp;segment text in either the&amp;nbsp;dattrmap set or&amp;nbsp;options.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 20:26:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-color-of-segment-label-text-inside-bar/m-p/602597#M19081</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-07T20:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to change color of segment label text inside bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-change-color-of-segment-label-text-inside-bar/m-p/602628#M19084</link>
      <description>&lt;P&gt;This is doing exactly what I need it to do.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 21:12:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-change-color-of-segment-label-text-inside-bar/m-p/602628#M19084</guid>
      <dc:creator>cuevasj</dc:creator>
      <dc:date>2019-11-07T21:12:19Z</dc:date>
    </item>
  </channel>
</rss>

