The SAS Output Delivery System and reporting techniques

No obs on a vbar chart

Reply
N/A
Posts: 0

No obs on a vbar chart

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
SAS Super FREQ
Posts: 8,743

Re: No obs on a vbar chart

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]
Ask a Question
Discussion stats
  • 1 reply
  • 106 views
  • 0 likes
  • 2 in conversation