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

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
  • 583 views
  • 0 likes
  • 2 in conversation