1

Sample Data

x=7:15 z=1 y=2 
x=7:15 z=2 y=1 
x=7:15 z=3 y=4 
x=7:45 z=1 y=3 
x=7:45 z=2 y=4 
x=7:45 z=8 y=2 
...

then:

Proc GPlot; 
 plot y*x=z / vaxis=axis1 legend=legend1 noframe; 
run; quit;

No questions about the proc gplot, it works fine and plots the y vs. timevalue x for each value of z. I tried to produce the same with a stacked proc gchart, but could not produce anything readable:

Proc GChart; 
 vbar y / discrete group=x subgroup=z; * tried variations ; 
run; quit;

The goal was to see z volume of y against the timevalue x.

flag

1 Answer

2

With PROC GCHART you need use sumvar= or freq= option, otherwise each row is count as 1 unit.

proc gchart;
   vbar y /  sumvar=x subgroup=z discrete ;
run;
quit;

proc gchart;
   vbar y /  freq=x subgroup=z discrete ;
run;
quit;

If you are using non sumarized data you can exclude the sumvar= option

data test;
do i=1 to 1000;
    y=floor(uniform(0)*5)+1;
    x=floor(uniform(0)*3)+1;
    z=floor(uniform(0)*6)+1;
    output;
end;


Proc gChart;  vbar y / discrete group=x subgroup=z; * tried variations ; run; quit;
link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.