Here's a little more information ...
Using this attribute map:
data attrmap; id = 'mycolors'; value='M'; fillcolor='lightblue'; textcolor='blue'; output; value='F'; fillcolor='pink'; textcolor='red'; output; run;
Let's first step back and take a look at a sgplot bar chart. The attribute map controls the bar segment colors, but if I just use the automatic 'datalabel' option on the vbarparm statement, the textcolor from the attrmap does not have an effect.
title "sgplot vbarparm with datalabel"; proc sgplot data=sashelp.class noautolegend dattrmap=attrmap; vbarparm category=name response=height/group=sex attrid=mycolors datalabel=height groupdisplay=cluster; run;
However, if I add a custom text statement in which I can specify an attrid and group to specifically associate with the text, then the attribute map can control the color of the text.
title "sgplot vbarparm with 'text' statement"; proc sgplot data=sashelp.class noautolegend dattrmap=attrmap; vbarparm category=name response=height/datalabel group=sex attrid=mycolors; text x=name y=height text=height / position=top group=sex attrid=mycolors; run;
Since sgpie does not have a text statement, and only has the automatic labels, it is consistent (with bar charts) that the pie slice color is controlled by the attrmap, but the text would not be controlled by the attrmap:
title "sgpie"; proc sgpie data=sashelp.class noautolegend dattrmap=attrmap; pie sex / attrid=mycolors; run;
... View more