Hi Bob, Copying my response from the original thread, did you try it and get different results that you wanted? I saw your response that the linearopts applied to the response axis. But since your BARCHARTPARM was x=subcat, I think xaxisopts applies to the x axis, which in this case is the vertical axis because it's a horizontal plot. When I ran the code with linearopts removed from the xaxisopts, and then sorted the data, it seemed to give the result you wanted (consistent with Sanjay's note that GTL would user data order by default). My original response: I'm new to GTL, but I think if you remove the linearopts= option, then the categories will be ordered according to the order of the input dataset. I guess when you added linearopts=, it forced the xaxis to be linear, instead of categorical. proc template;
define statgraph FlagBarCharts;
dynamic byvar;
begingraph;
entrytitle "Flag Variable: " byvar ;
layout overlay
/ border=false
WALLDISPLAY=none
xaxisopts=(
label=' '
);
BARCHARTPARM x=subcat y=percent
/ orient=horizontal ;
endlayout;
endgraph;
end;
run;
data in;
subcat='1'; percent=2; output;
subcat='2'; percent=6; output;
subcat='3'; percent=4;output;
run;
proc sort data=in;
by percent;
run;
ods pdf file="d:\junk\me.pdf";
proc sgrender data=in template=FlagBarcharts;
run;
ods pdf close;
... View more