The syntax you used for the label is from the AXIS statement in SAS/GRAPH. The axis statements in the SG procedures are different. Currently, the procedure syntax for controlling the axis text attributes is not there. There are a couple of ways to work around this.
1) You can create a small style like the following and use it on your ODS statement. The drawback (or bonus) is that it will also affect other value-related text in your graph.
define style styles.bigtext;
style GraphValueText from GraphValueText /
2) You can use GTL (graph template language) to create the graph where you will have control over text attributes. The template to create your graph would be the following:
define statgraph barchart;
layout overlay / xaxisopts=( Label="Mean Response Score" labelattrs=(size=12pt)
linearopts=( tickvaluelist=( 1 2 3 4 5 ) viewmin=1 viewmax=5 ) )
yaxisopts=( reverse=true Label="Survey Items" labelattrs=(size=12pt));
BarChart X=Item Y=Avg / orient=horizontal barlabel=true;
Well, this does solve my label size problem. However, I don't know whether this way can keep the options I set in proc sgplot. For example, In proc sgplot, I can use tickvalueformat option to format the tick value, and I can use proc format to format the yaxis text tick values, and I can set the bigger font size of the data label beside each bar.
What are the equivalent ways to implement these parts in your way?
By the way, SAS provides a lot and very good documentations, but if they can come with examples especial when there are many options, then they become more helpful. Just take reference the documentations for other languages from Microsoft.
'Item1'= 'My survey item1'
'Item2' ='My survey item2'
'Item3' ='My survey item3'
'Item4'= 'My survey item4'
'Item5' ='This is a long survey item,\nso I try to break it in two lines';
No, I have set this option at xaxisopts correcly, which displays value 1 as '1 Strongly Disagree' and 5 as '5 Strongly Agree'. I think that option you mentioned should go to yaxisopts, but it doesn't work.
By the way, in my enhanced editor (SAS 9.2 Level 2M3), keywords BEGINGRAPH, LAYOUT, BARCHART, ENDLAYOUT and ENDGRAPH all are shown as red color, which normally mean typo or syntax errors. But the program compiled and ran without error. Why? thanks.
The reason it did not work for the yaxisopts is that the axis is discrete, not linear. The TICKVALUEFORMAT is not supported in discreteopts. To make it work, I would just use a format statement with PROC SGRENDER:
proc sgrender data=temp template=barchart;
format Item $itemfmt.;
To answer your other question, the syntax checking in the SAS Display Manager does not understand the GTL inside of PROC TEMPLATE. However, the editor in Enterprise Guide 4.3 does support the GTL syntax, including colorization, autocompletion, and tooltip documentation. It's pretty nice :-)
Thanks for the in time support, Dan. Now my graph is satisfactory.
As for the GTL stuff, I don't think there should be any excuse for SAS to let those key words to display in red color since SAS decides to let them work with SAS BASE. How can users understand why if they can't see your reply?!