Hello,
I would like to adjust the segment label position to the top in the attached bar chart. The program is copied below.Segment labels needs to be top aligned (Near to the highlighted portion in Yellow)
proc template;
define statgraph vbarplot;
dynamic _ticklist_;
begingraph / collation=binary;
entrytitle '';
layout overlay / xaxisopts=(type=Discrete discreteOpts=(tickValueList=_ticklist_
tickValueListPolicy=Union tickvaluefitpolicy=rotate) label = "X axis Label")
yaxisopts=(labelFitPolicy=Split label = "Number of Subjects" linearopts=(integer=true) )
cycleattrs=true ;
barchart X=category Y=count / primary=true Group=trtn NAME="VBAR" groupdisplay=cluster
barwidth =1 clusterwidth = 0.65
SEGMENTLABEL = TRUE ;
discretelegend "VBAR"/ location=outside halign=center valign=bottom title=" ";
endlayout;
endgraph;
end;
run;
proc sgrender data=dummy template=vbarplot;
run;
proc summary data=sashelp.class nway;
class age sex;
var height;
output out=class sum=;
run;
data class;
set class;
y=height-2;
run;
proc sgplot data=class;
vbarparm category=age response=height/group=sex groupdisplay=cluster ;
scatter x=age y=y/markerchar=height group=sex groupdisplay=cluster
markercharattrs=(color=black);
run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.