EdB,
The example you point to uses the new "proc template" and "proc sgrender".
I'm not an expert at that, so I'm not sure if you can control the justification there.
But I have re-written the example, using traditional "old school" SAS/Graph
proc gchart, with the table programmatically annotated to the side, and
you can easily control the justification of the player names (ie, bar labels)
using the axis statement:
axis1 label=none value=(justify=left);
Here's the complete code for my re-write:
[pre]
data PGA2007;
input Rank 2. Player & $15. Age Events Rounds CutsMade Top10 Wins Earnings;
retain Constant 1;
label CutsMade="Cuts Made" Top10="Top 10s";
format Earnings dollar12.;
format age events wins 3.0;
datalines;
1 Tiger Woods 33 16 61 16 12 7 10867052
2 Phil Mickelson 38 22 73 16 7 3 5819988
3 Vijay Singh 45 27 101 25 7 2 4728377
4 Steve Stricker 41 23 80 19 9 1 4663077
5 K.J. Choi 38 25 88 20 7 2 4587859
6 Rory Sabbatini 32 23 80 18 10 1 4550040
7 Jim Furyk 38 24 84 20 8 1 4154046
8 Zach Johnson 32 23 78 18 5 2 3922338
9 Sergio Garcia 29 19 67 16 7 0 3721185
10 Aaron Baddeley 27 23 82 19 7 1 3441119
run;
data my_anno; set PGA2007;
length text $50 style $20;
function='label'; style='"arial"'; hsys='3'; when='a';
ysys='2'; midpoint=Player;
/* annotate totals at end of bars */
xsys='2'; position='6';
text=' '||trim(left(put(Earnings,dollar12.)));
output;
/* annotate the values for the table to the left of the bar chart */
xsys='3'; position='5';
x=5; text=trim(left(Age)); output;
x=12; text=trim(left(Events)); output;
x=19; text=trim(left(Wins)); output;
run;
data headings;
length text $50 style $20;
function='label'; style='"arial/bold"'; hsys='3'; when='a';
/* annotate the headings for the table to the left of the bar chart */
xsys='3'; position='5';
ysys='3'; y=90;
x=5; text="Age"; output;
x=12; text="Events"; output;
x=19; text="Wins"; output;
run;
/* combine all your anno stuff */
data my_anno; set my_anno headings;
run;
goptions ftitle="arial/bold" ftext="arial" gunit=pct htitle=4 htext=2.25;
/* control left/right/center justification of Player name here! */
axis1 label=none value=(justify=left);
axis2 label=(font="arial/bold" "Earnings") minor=none offset=(0,0);
title1 "Professional Golf Statistics for 2007";
/* fake/blank title, to add white space on the left (don't try it with dev=java or activex!) */
title2 angle=90 height=30pct " ";
pattern1 v=s c=cx9BC4E2;
proc gchart data=PGA2007 anno=my_anno;
hbar Player / type=sum sumvar=Earnings descending nostats
maxis=axis1
raxis=axis2
autoref cref=graydd clipref
;
run;
[/pre]
added 'pre' tags around code, as recommended by Peter C.
Message was edited by: Robert Allison @ SAS
... View more