04-23-2013 04:39 PM
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.
04-23-2013 04:47 PM
Good point-SAS 9.2. I am using indexes. The first index, coordinates graph data element 1. The rest I don't care about per se in terms of color.
04-23-2013 05:05 PM
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.
04-23-2013 05:11 PM
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.
04-23-2013 05:20 PM
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.
04-24-2013 01:08 PM
I tried defining the color after #12, but it seems to not take effect anymore-Are there limits on the number of graphing elements I can choose?
04-24-2013 05:02 PM
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);
04-23-2013 04:42 PM
On another note is there also another way to set it so that a color does not repeat the original graphdata element w/o specifying every color? I see a repeating black color.