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)
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)
Can you please send me any dummy code for second option that you have suggested. So that I can get better understanding.
Thanks,
Pavan
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
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;
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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.