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
Diamond | Level 26
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]

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore 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.

SAS Training: Just a Click Away

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

Browse our catalog!

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