BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I'm creating a vbar chart and one of the subgroups does not have any observations and so it's not displayed on the chart.

For example, January - April should be displayed but March does not have any data therefore the graph only shows Jan, Feb, and April. I'd like the label of March to remain and the space on the graph to be empty.

Does anyone know how I can accomplish this?

Thanks,
Sonya
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
The AXIS statement should allow you to specify what you want to see. The axis statement can do a lot more, but it will also put your empty space on the graph.

cynthia
[pre]
data salesdata;
length part $ 9 month $3;
input part month $ sales;
return;
datalines;
Widget Jan 7043.97
Widget Jan 8225.26
Widget Jan 5543.97
Sprocket Feb 2773.73
Sprocket Feb 3226.12
Sprocket Feb 4722.24
Gadget Apr 1775.74
Gadget Apr 3424.19
Gadget Apr 6914.25
;
run;

goptions reset=all border ;

title1 'Total Sales';
axis1 order=('Jan' 'Feb' 'Mar' 'Apr');
axis2 order=(0 to 25000 by 5000);

proc gchart data=salesdata;
vbar3d month / sumvar=sales
maxis=axis1
raxis=axis2;
run;
quit;

[/pre]

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