IS there a way to only set the graph elements for the first graph data element
So for example;
style Graphdata1 /Color=black line ;
style Graphdata1 /contrastColor=black linethickness=3 ;
I want only one facility to stand out in terms of having a black line that is thicker and larger markers than the rest of them.
You can set line thickness or marker size in the GraphData elements, but these will not be honored in group case. The color and pattern come from the GraphData elemtn, but thickness comes from the GraphDataDefault element. The reason was to provide equal weight to all group values. To draw one series with a different thickness, you will have to separate it out from the others and draw it with thicker line thickness in the LINEATTRS option.
This works the same way in Attribute Map too. There have been requests for this feature so this may be added at a future release.
Anyway some conditional logic might work?
Also, is there a way to stop the colors from repeating in a pattern? What I see is that it goes for about 12 different colors, then the whole series repeats itself-
So it might be red, black, green...then back again.
With SAS 9.2, colors and patterns (or symbols) cycle through the lists for each group. So, first group value gets first color and first pattern, second group gets second color and second patter, and so on till you run out of the 11 patterns. Then, group #12 gets 12th color and 1st pattern, and it continues..
If you want more colors, define more GraphData elements beyond 12 without any gaps in the color value. If instead you want to hold the color constant, that is easy, just specify the color in the LINEATTRS option.
Here is a SAS 9.2 example. Note Green and Black color needles and scatter markers for last two names.
Note: ContrastColor is used for the markers, Color is used for bars.
define style Styles.Thirteen;
parent = styles.listing;
style GraphData13 /
style GraphData14 /
ods listing style=thirteen;
ods graphics / reset width=6in height=3in imagename='Thirteen';
proc sgplot data=sashelp.class(obs=14);
needle x=name y=height / group=name lineattrs=(pattern=solid thickness=9);
scatter x=name y=height / group=name markerattrs=(symbol=circlefilled size=20);
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.