BookmarkSubscribeRSS Feed
pavansvc
Fluorite | Level 6

Hello all,

 

Here am facing an issue to get the values inside the bars with center alignment. 

Following is the code that I have used for getting those values inside the bars but couldn't able to get them center aligned. Any help please?

 

scatter x= Months_from_initial_diagnosis_to y= subjid /markerchar=Months_from_initial_diagnosis_to markercharattrs=(family='arial' color=black weight=bold size=8pt);

scatter x=Months_from_administrat y= subjid / markerchar = Months_from_administrat markercharattrs=(family='arial' color=black weight=bold size=8pt) Capture.JPG

5 REPLIES 5
Reeza
Super User

Did you try DATALABELS instead on the _BAR statement? You can apply the CENTER option to those which seems like it would be an option.

 

Otherwise I think you'll need to adjust your X coordinate, pad it with a few months or calculate the center where it should be located and use that as the X location instead. 

 


@pavansvc wrote:

Hello all,

 

Here am facing an issue to get the values inside the bars with center alignment. 

Following is the code that I have used for getting those values inside the bars but couldn't able to get them center aligned. Any help please?

 

scatter x= Months_from_initial_diagnosis_to y= subjid /markerchar=Months_from_initial_diagnosis_to markercharattrs=(family='arial' color=black weight=bold size=8pt);

scatter x=Months_from_Toca_511_administrat y= subjid / markerchar = Months_from_Toca_511_administrat markercharattrs=(family='arial' color=black weight=bold size=8pt) Capture.JPG


 

pavansvc
Fluorite | Level 6

Can you please send me any dummy code for second option that you have suggested. So that I can get better understanding.

 

Thanks,

Pavan

Jay54
Meteorite | Level 14

VBAR and HBAR also also support SEGLABEL with SAS 9.40M2 release.  This makes it much easier to label each segment of a stacked bar.  http://support.sas.com/kb/55/866.html

Reeza
Super User

Can you provide data and code so I can replicate your current graph? 

 

Mocking up the data and graph from scratch is quite a bit of work (that you’ve already done) and I also can’t see your other code which may impact the results. If you can’t provide your data, try using one of the datasets in SASHELP instead. 

 

Also, what version of SAS are you using?

 

Proc product_status;run;
Reeza
Super User

Can you provide data and code so I can replicate your current graph? 

 

Mocking up the data and graph from scratch is quite a bit of work (that you’ve already done) and I also can’t see your other code which may impact the results. If you can’t provide your data, try using one of the datasets in SASHELP instead. 

 

Also, what version of SAS are you using?

 

Proc product_status;run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 697 views
  • 0 likes
  • 3 in conversation