BookmarkSubscribeRSS Feed
Santoshrk
Obsidian | Level 7

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)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;

1 REPLY 1
Ksharp
Super User
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;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 926 views
  • 0 likes
  • 2 in conversation