05-16-2018 05:24 PM
We have created a panel bar graph with lines representing benchmark values. We used a keylegend statement to define the line portions of the figures, but the lines are too faint to visually discern the colors or patterns easily. I suspect it is an issue of the legend's transparency so I tried to implement the opaque option but received an error. Is the opaque option available in SAS 9.4? If the opaque option is not available to me, does anyone have any suggestions for changing the line thickness in the legend?
Here is an excerpt of the code from the proc sgpanel:
keylegend "Norm" "Sample Mean" / down = 1 titleattrs=(color = black size = 10) noborder position = top opaque;
Here is the language from the error message:
ERROR 22-322: Syntax error, expecting one of the following: ;, ACROSS, AUTOITEMSIZE, AUTOOUTLINE, BORDER, DOWN, EXCLUDE, FILLASPECT, FILLHEIGHT, LINELENGTH, NOBORDER, OUTERPAD, POSITION, SCALE, SORTORDER, TITLE, TITLEATTRS, TYPE, VALUEATTRS.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
05-16-2018 06:33 PM
Opaque is a valid option in SAS 9.4 for SGPLOT, but not for SGPANEL according to the documentation.
05-16-2018 06:57 PM
No, if you provide a reproducible sample, ie make your code work with a SASHELP data set, I'm happy to look into it but it's hard to do without data or code. Hopefully someone else in this forum, (the SAS staff hopefully) will have a response soon. If not, I'll tag them eventually
05-16-2018 07:00 PM
Thanks! Do you have a suggestion for an alternative within SGPANEL that would make the legend readable?
As a minimum show the entire Proc SGPanel code you are currently using.
If you are setting attributes in the plot that are transparent then you are going to have issues as the legend attempts to replicate those.
Reduce transparency settings if you are using them.
Make the displayed elements a bit larger perhaps, line width or marker size.
Use an ANNOTATE data to create a legend from scratch.
Perhaps use SGPLOT with one or more BY variables.
Move the Graphic template language where there may be more controls with a Layout Lattice that Sgpanel does not honor.