When I set up my bar chart, it renders as expected but I get no color differences by group. I tries using ATTRID with no success. In addition I need to place the data labels in the middle of the bars not the top or the bottom which appear to be the only standard options available.I also tried the style attribute datacontrastcolors also with no success.
length value FillColor LineColor $8;
Id='A'; Value="XX N"; FillColor='Red'; LineColor='Black'; output;
Id='A'; Value="XX C"; FillColor='Yellow'; LineColor='Black'; output;
Id='A'; Value="XX R"; FillColor='Green'; LineColor='Black'; output;
Id='A'; Value="XX M"; FillColor='Blue'; LineColor='Black'; output;
Id='A'; Value="XX K"; FillColor='Orange'; LineColor='Black'; output;
proc sgplot data = geography dattrmap=attrmap;
where index(put(businessunit,$f_bun.),"XX ");
vbar businessunit/response = requestedamount stat = sum datalabel attrid = A ;
xaxis display = (nolabel);
yaxis label = "Amount";
format requestedamount comma32.;
Got it thanks - added about 3 min after posting.
One other question - with a gridded ods layout I've seen documentation of separate titles for the table and chart on the same page. Any tricks to make this work? I tried title statements in the different ods regions but all I get is one title (over the table) and that's it.
Are you using PROC SGPANEL or SGPLOT ?
I am not sure. But could #byval1 syntax for SGPLOT .
proc sort data=sashelp.class out=class; by age; run; options nobyline; ods layout gridded columns=2 advance=table; title 'Age is #byval1'; proc sgplot data=class; by age; scatter x=weight y=height; run; ods layout end;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.