BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kz_
Quartz | Level 8 kz_
Quartz | Level 8

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;
1 ACCEPTED SOLUTION

Accepted Solutions
JeffMeyers
Barite | Level 11

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.

View solution in original post

6 REPLIES 6
WarrenKuhfeld
Ammonite | Level 13

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.

JeffMeyers
Barite | Level 11

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.

DanH_sas
SAS Super FREQ

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

kz_
Quartz | Level 8 kz_
Quartz | Level 8
If I am using a template (so I already have a style = mystyle statement), is there a way to add this to the template?
DanH_sas
SAS Super FREQ

Yes, you can. You can add ATTRPRIORITY to the BEGINGRAPH statement in your GTL template.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 846 views
  • 10 likes
  • 5 in conversation