I made a series plot by group. In the results window, all of the lines are solid, but in the .png output, two lines are dashed. I can't figure out what part of the code is doing that.
ods listing gpath='&path'; ods graphics on / reset=all noborder imagename="plot" imagefmt=png; title1 c=gray33 h=14pt "Title"; proc sgplot data=month_total aspect=1; series x=month y=total / smoothconnect group=gr name="a" markers markerattrs=(symbol=squarefilled size=3pt); where date_ < 22554; xaxis values=(1 to 12) valuesdisplay=('Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec' '') valueattrs=(color=gray33 size=10pt) label="payment month"; yaxis label="total" valueattrs=(color=gray33 size=10pt); keylegend "a" / noborder position=right; run;
Different destinations will have different style defaults and will look different. To avoid this you can be more specific in your code. For example, if you want all solid lines in any output add LINEATTRS=(pattern=solid) to your series statement.
https://documentation.sas.com/doc/en/pgmsascdc/v_017/statug/statug_odsgraph_sect048.htm
ODS styles control appearances, and default styles differ for html, pdf, rtf, listing, and so on.
Different destinations will have different style defaults and will look different. To avoid this you can be more specific in your code. For example, if you want all solid lines in any output add LINEATTRS=(pattern=solid) to your series statement.
The LISTING style uses ATTRPRIORITY=NONE, which will allow more than one attribute change per group (in this case, color and pattern). The default style for HTML output is HTMLBlue, which is set to ATTRPRIORITY=COLOR. In that case, all of the colors are exhausted before rotating the other attribute. To get the two outputs to look the same, do this:
ods listing style=HTMLBlue;
Hope this helps!
Dan
For more on the ATTRPRIORITY= option, see this article by Sanjay Matange or this article by Warren Kuhfeld.
Yes, you can. You can add ATTRPRIORITY to the BEGINGRAPH statement in your GTL template.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.