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-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
  • 1 reply
  • 621 views
  • 0 likes
  • 2 in conversation