BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello Everyone,

I created a 100% stacked horizontal bar chart using PROC GChart with the following code:

proc gchart data=&input_ds;
hbar region /
nozero
nostats
raxis=axis2
maxis=axis1
percent
sumvar=per
legend = legend1
type=sum
inside=subpercent
subgroup=value
width=2;
run;

This code produces a variable number of bars with each bar subdivided by value and has several sub-group percentages inside each bar. The problem is that the percentages appear to be right justified. Is there a way I can have them be center justified?

I would like the text that is inside each bar to be center justified kind of like how it is in MS Excel or in this picture: http://peltiertech.com/WordPress/wp-content/img200808/GasPricesBarChart.png ..... rather than getting numbers that are right justified as they are in the following picture: http://robslink.com/SAS/democd18/insur.htm. Any ideas if this is possible, and if so how to do it?
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
SAS support website indicates that the SAS/Graph DEVICE driver ACTIVEX does support VALUE=INSIDE, even though the SASLOG indicates otherwise (at least in SAS 8). So, it may be that you can specify VALUE=(JUSTIFY=CENTER) on the AXISn statement to achieve your desired result. If not, I would recommend contacting SAS support for guidance and to get your interests registered with the technical staff, for future consideration.

Also, here is a Google advanced search argument you might want to use to identify SAS support website http://support.sas.com/ resource references for your post/question:

+gchart +inside +justify +center +axis +value site:sas.com

Scott Barry
SBBWorks, Inc.
TS-602

Compatibility Document for the ACTIVEX Device Driver - Version 8 Releases
**This document applies to Version 8 Releases. If you are running SAS/GRAPH 9 or above, please refer to the documentation or online help for the most recent information.

http://support.sas.com/techsup/technote/ts602.html#BAR

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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