BookmarkSubscribeRSS Feed
jteres
Obsidian | Level 7

rIs it possible to control the xaxis (category axis) when using VBAR in the SG procedures? I have 40 months and want to show stacked bars where each bar height is a population and the stacks are comprised of population subcategories.

The issue is that the xaxis is unreadable. None of the xaxis options for time values are effective with VBAR.

Can I get around this with GTL? It's proving to be an enormous time sink, and I don't think that having a bar chart with time as the xaxis is that unreasonable a thing to try to do...

Thanks,

Jed

2 REPLIES 2
snoopy369
Barite | Level 11

Assuming I understand the problem you have with the xaxis, I would use a format (either a built in format or a custom one) to display the date variables as you need.  For example:

data sale;
set sashelp.prdsale;
format month MONYY7.;
run;

proc sgplot data=sale;
vbar month/response=actual group=product groupdisplay=stack;
run;

If that doesn't work for you, more detail would be helpful in terms of what you want to see on the x axis.

DanH_sas
SAS Super FREQ

If the problem is too many tick values, you can can specify FITPOLICY=THIN on the XAXIS statement to help with that.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 1667 views
  • 1 like
  • 3 in conversation