Your question isn't clear to me. The axis statement will work if you have included the full range of data for all by levels. I'm guessing though that you might want a different axis statement for each by level. I've done that with some macro statements around the plot procedure, e.g. (a snippet from somewhere to show you the principle)
%Macro ByAxis;
%do prd= 1 %to 2 %by 1;
%if &prd=1 %then %do;%let Prod=' HR';%let max=3; %let incr=2;%end;
%else %if &prd=2 %then %do;%let Prod='CR'; %let max=6; %let incr=2;%end;
axis1 order=(0 to &max by &incr)
proc gchart data=prodannual (where=(Product=&Prod));
by product;
vbar period/sumvar=pct
discrete
width=15
caxis=cxbfbfbf
raxis=axis1
;
run;
%end;
%Mend ByAxis;
%ByAxis;
But I have to ask - from a best practice data visualization perspective ...
If there is any intent to compare the by groups, they should all use the same scales on the graphs so that the relative position of the points/lines is immediately evident without having to interpet scale differences.